( () => {
    var e, t = {
        77: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/rotation_axis_x_positive.svg"
        }
        ,
        493: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/empty.svg"
        }
        ,
        516: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/arrow_down.svg"
        }
        ,
        540: e => {
            "use strict";
            e.exports = function(e) {
                var t = document.createElement("style");
                return e.setAttributes(t, e.attributes),
                e.insert(t, e.options),
                t
            }
        }
        ,
        813: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/winter.svg"
        }
        ,
        853: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/icon.svg"
        }
        ,
        858: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/discord.svg"
        }
        ,
        1113: e => {
            "use strict";
            e.exports = function(e, t) {
                if (t.styleSheet)
                    t.styleSheet.cssText = e;
                else {
                    for (; t.firstChild; )
                        t.removeChild(t.firstChild);
                    t.appendChild(document.createTextNode(e))
                }
            }
        }
        ,
        1312: (e, t, n) => {
            var i;
            /**
 * [js-sha256]{@link https://github.com/emn178/js-sha256}
 *
 * @version 0.11.0
 * @author Chen, Yi-Cyuan [emn178@gmail.com]
 * @copyright Chen, Yi-Cyuan 2014-2024
 * @license MIT
 */
            !function() {
                "use strict";
                var t = "input is invalid type"
                  , r = "object" == typeof window
                  , a = r ? window : {};
                a.JS_SHA256_NO_WINDOW && (r = !1);
                var s = !r && "object" == typeof self
                  , o = !a.JS_SHA256_NO_NODE_JS && "object" == typeof process && process.versions && process.versions.node;
                o ? a = n.g : s && (a = self);
                var l = !a.JS_SHA256_NO_COMMON_JS && e.exports
                  , c = n.amdO
                  , h = !a.JS_SHA256_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer
                  , d = "0123456789abcdef".split("")
                  , u = [-2147483648, 8388608, 32768, 128]
                  , p = [24, 16, 8, 0]
                  , f = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298]
                  , m = ["hex", "array", "digest", "arrayBuffer"]
                  , g = [];
                !a.JS_SHA256_NO_NODE_JS && Array.isArray || (Array.isArray = function(e) {
                    return "[object Array]" === Object.prototype.toString.call(e)
                }
                ),
                !h || !a.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW && ArrayBuffer.isView || (ArrayBuffer.isView = function(e) {
                    return "object" == typeof e && e.buffer && e.buffer.constructor === ArrayBuffer
                }
                );
                var v = function(e, t) {
                    return function(n) {
                        return new x(t,!0).update(n)[e]()
                    }
                }
                  , w = function(e) {
                    var t = v("hex", e);
                    o && (t = y(t, e)),
                    t.create = function() {
                        return new x(e)
                    }
                    ,
                    t.update = function(e) {
                        return t.create().update(e)
                    }
                    ;
                    for (var n = 0; n < m.length; ++n) {
                        var i = m[n];
                        t[i] = v(i, e)
                    }
                    return t
                }
                  , y = function(e, i) {
                    var r, s = n(4394), o = n(1903).Buffer, l = i ? "sha224" : "sha256";
                    r = o.from && !a.JS_SHA256_NO_BUFFER_FROM ? o.from : function(e) {
                        return new o(e)
                    }
                    ;
                    return function(n) {
                        if ("string" == typeof n)
                            return s.createHash(l).update(n, "utf8").digest("hex");
                        if (null == n)
                            throw new Error(t);
                        return n.constructor === ArrayBuffer && (n = new Uint8Array(n)),
                        Array.isArray(n) || ArrayBuffer.isView(n) || n.constructor === o ? s.createHash(l).update(r(n)).digest("hex") : e(n)
                    }
                }
                  , b = function(e, t) {
                    return function(n, i) {
                        return new k(n,t,!0).update(i)[e]()
                    }
                }
                  , A = function(e) {
                    var t = b("hex", e);
                    t.create = function(t) {
                        return new k(t,e)
                    }
                    ,
                    t.update = function(e, n) {
                        return t.create(e).update(n)
                    }
                    ;
                    for (var n = 0; n < m.length; ++n) {
                        var i = m[n];
                        t[i] = b(i, e)
                    }
                    return t
                };
                function x(e, t) {
                    t ? (g[0] = g[16] = g[1] = g[2] = g[3] = g[4] = g[5] = g[6] = g[7] = g[8] = g[9] = g[10] = g[11] = g[12] = g[13] = g[14] = g[15] = 0,
                    this.blocks = g) : this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                    e ? (this.h0 = 3238371032,
                    this.h1 = 914150663,
                    this.h2 = 812702999,
                    this.h3 = 4144912697,
                    this.h4 = 4290775857,
                    this.h5 = 1750603025,
                    this.h6 = 1694076839,
                    this.h7 = 3204075428) : (this.h0 = 1779033703,
                    this.h1 = 3144134277,
                    this.h2 = 1013904242,
                    this.h3 = 2773480762,
                    this.h4 = 1359893119,
                    this.h5 = 2600822924,
                    this.h6 = 528734635,
                    this.h7 = 1541459225),
                    this.block = this.start = this.bytes = this.hBytes = 0,
                    this.finalized = this.hashed = !1,
                    this.first = !0,
                    this.is224 = e
                }
                function k(e, n, i) {
                    var r, a = typeof e;
                    if ("string" === a) {
                        var s, o = [], l = e.length, c = 0;
                        for (r = 0; r < l; ++r)
                            (s = e.charCodeAt(r)) < 128 ? o[c++] = s : s < 2048 ? (o[c++] = 192 | s >>> 6,
                            o[c++] = 128 | 63 & s) : s < 55296 || s >= 57344 ? (o[c++] = 224 | s >>> 12,
                            o[c++] = 128 | s >>> 6 & 63,
                            o[c++] = 128 | 63 & s) : (s = 65536 + ((1023 & s) << 10 | 1023 & e.charCodeAt(++r)),
                            o[c++] = 240 | s >>> 18,
                            o[c++] = 128 | s >>> 12 & 63,
                            o[c++] = 128 | s >>> 6 & 63,
                            o[c++] = 128 | 63 & s);
                        e = o
                    } else {
                        if ("object" !== a)
                            throw new Error(t);
                        if (null === e)
                            throw new Error(t);
                        if (h && e.constructor === ArrayBuffer)
                            e = new Uint8Array(e);
                        else if (!(Array.isArray(e) || h && ArrayBuffer.isView(e)))
                            throw new Error(t)
                    }
                    e.length > 64 && (e = new x(n,!0).update(e).array());
                    var d = []
                      , u = [];
                    for (r = 0; r < 64; ++r) {
                        var p = e[r] || 0;
                        d[r] = 92 ^ p,
                        u[r] = 54 ^ p
                    }
                    x.call(this, n, i),
                    this.update(u),
                    this.oKeyPad = d,
                    this.inner = !0,
                    this.sharedMemory = i
                }
                x.prototype.update = function(e) {
                    if (!this.finalized) {
                        var n, i = typeof e;
                        if ("string" !== i) {
                            if ("object" !== i)
                                throw new Error(t);
                            if (null === e)
                                throw new Error(t);
                            if (h && e.constructor === ArrayBuffer)
                                e = new Uint8Array(e);
                            else if (!(Array.isArray(e) || h && ArrayBuffer.isView(e)))
                                throw new Error(t);
                            n = !0
                        }
                        for (var r, a, s = 0, o = e.length, l = this.blocks; s < o; ) {
                            if (this.hashed && (this.hashed = !1,
                            l[0] = this.block,
                            this.block = l[16] = l[1] = l[2] = l[3] = l[4] = l[5] = l[6] = l[7] = l[8] = l[9] = l[10] = l[11] = l[12] = l[13] = l[14] = l[15] = 0),
                            n)
                                for (a = this.start; s < o && a < 64; ++s)
                                    l[a >>> 2] |= e[s] << p[3 & a++];
                            else
                                for (a = this.start; s < o && a < 64; ++s)
                                    (r = e.charCodeAt(s)) < 128 ? l[a >>> 2] |= r << p[3 & a++] : r < 2048 ? (l[a >>> 2] |= (192 | r >>> 6) << p[3 & a++],
                                    l[a >>> 2] |= (128 | 63 & r) << p[3 & a++]) : r < 55296 || r >= 57344 ? (l[a >>> 2] |= (224 | r >>> 12) << p[3 & a++],
                                    l[a >>> 2] |= (128 | r >>> 6 & 63) << p[3 & a++],
                                    l[a >>> 2] |= (128 | 63 & r) << p[3 & a++]) : (r = 65536 + ((1023 & r) << 10 | 1023 & e.charCodeAt(++s)),
                                    l[a >>> 2] |= (240 | r >>> 18) << p[3 & a++],
                                    l[a >>> 2] |= (128 | r >>> 12 & 63) << p[3 & a++],
                                    l[a >>> 2] |= (128 | r >>> 6 & 63) << p[3 & a++],
                                    l[a >>> 2] |= (128 | 63 & r) << p[3 & a++]);
                            this.lastByteIndex = a,
                            this.bytes += a - this.start,
                            a >= 64 ? (this.block = l[16],
                            this.start = a - 64,
                            this.hash(),
                            this.hashed = !0) : this.start = a
                        }
                        return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 | 0,
                        this.bytes = this.bytes % 4294967296),
                        this
                    }
                }
                ,
                x.prototype.finalize = function() {
                    if (!this.finalized) {
                        this.finalized = !0;
                        var e = this.blocks
                          , t = this.lastByteIndex;
                        e[16] = this.block,
                        e[t >>> 2] |= u[3 & t],
                        this.block = e[16],
                        t >= 56 && (this.hashed || this.hash(),
                        e[0] = this.block,
                        e[16] = e[1] = e[2] = e[3] = e[4] = e[5] = e[6] = e[7] = e[8] = e[9] = e[10] = e[11] = e[12] = e[13] = e[14] = e[15] = 0),
                        e[14] = this.hBytes << 3 | this.bytes >>> 29,
                        e[15] = this.bytes << 3,
                        this.hash()
                    }
                }
                ,
                x.prototype.hash = function() {
                    var e, t, n, i, r, a, s, o, l, c = this.h0, h = this.h1, d = this.h2, u = this.h3, p = this.h4, m = this.h5, g = this.h6, v = this.h7, w = this.blocks;
                    for (e = 16; e < 64; ++e)
                        t = ((r = w[e - 15]) >>> 7 | r << 25) ^ (r >>> 18 | r << 14) ^ r >>> 3,
                        n = ((r = w[e - 2]) >>> 17 | r << 15) ^ (r >>> 19 | r << 13) ^ r >>> 10,
                        w[e] = w[e - 16] + t + w[e - 7] + n | 0;
                    for (l = h & d,
                    e = 0; e < 64; e += 4)
                        this.first ? (this.is224 ? (a = 300032,
                        v = (r = w[0] - 1413257819) - 150054599 | 0,
                        u = r + 24177077 | 0) : (a = 704751109,
                        v = (r = w[0] - 210244248) - 1521486534 | 0,
                        u = r + 143694565 | 0),
                        this.first = !1) : (t = (c >>> 2 | c << 30) ^ (c >>> 13 | c << 19) ^ (c >>> 22 | c << 10),
                        i = (a = c & h) ^ c & d ^ l,
                        v = u + (r = v + (n = (p >>> 6 | p << 26) ^ (p >>> 11 | p << 21) ^ (p >>> 25 | p << 7)) + (p & m ^ ~p & g) + f[e] + w[e]) | 0,
                        u = r + (t + i) | 0),
                        t = (u >>> 2 | u << 30) ^ (u >>> 13 | u << 19) ^ (u >>> 22 | u << 10),
                        i = (s = u & c) ^ u & h ^ a,
                        g = d + (r = g + (n = (v >>> 6 | v << 26) ^ (v >>> 11 | v << 21) ^ (v >>> 25 | v << 7)) + (v & p ^ ~v & m) + f[e + 1] + w[e + 1]) | 0,
                        t = ((d = r + (t + i) | 0) >>> 2 | d << 30) ^ (d >>> 13 | d << 19) ^ (d >>> 22 | d << 10),
                        i = (o = d & u) ^ d & c ^ s,
                        m = h + (r = m + (n = (g >>> 6 | g << 26) ^ (g >>> 11 | g << 21) ^ (g >>> 25 | g << 7)) + (g & v ^ ~g & p) + f[e + 2] + w[e + 2]) | 0,
                        t = ((h = r + (t + i) | 0) >>> 2 | h << 30) ^ (h >>> 13 | h << 19) ^ (h >>> 22 | h << 10),
                        i = (l = h & d) ^ h & u ^ o,
                        p = c + (r = p + (n = (m >>> 6 | m << 26) ^ (m >>> 11 | m << 21) ^ (m >>> 25 | m << 7)) + (m & g ^ ~m & v) + f[e + 3] + w[e + 3]) | 0,
                        c = r + (t + i) | 0,
                        this.chromeBugWorkAround = !0;
                    this.h0 = this.h0 + c | 0,
                    this.h1 = this.h1 + h | 0,
                    this.h2 = this.h2 + d | 0,
                    this.h3 = this.h3 + u | 0,
                    this.h4 = this.h4 + p | 0,
                    this.h5 = this.h5 + m | 0,
                    this.h6 = this.h6 + g | 0,
                    this.h7 = this.h7 + v | 0
                }
                ,
                x.prototype.hex = function() {
                    this.finalize();
                    var e = this.h0
                      , t = this.h1
                      , n = this.h2
                      , i = this.h3
                      , r = this.h4
                      , a = this.h5
                      , s = this.h6
                      , o = this.h7
                      , l = d[e >>> 28 & 15] + d[e >>> 24 & 15] + d[e >>> 20 & 15] + d[e >>> 16 & 15] + d[e >>> 12 & 15] + d[e >>> 8 & 15] + d[e >>> 4 & 15] + d[15 & e] + d[t >>> 28 & 15] + d[t >>> 24 & 15] + d[t >>> 20 & 15] + d[t >>> 16 & 15] + d[t >>> 12 & 15] + d[t >>> 8 & 15] + d[t >>> 4 & 15] + d[15 & t] + d[n >>> 28 & 15] + d[n >>> 24 & 15] + d[n >>> 20 & 15] + d[n >>> 16 & 15] + d[n >>> 12 & 15] + d[n >>> 8 & 15] + d[n >>> 4 & 15] + d[15 & n] + d[i >>> 28 & 15] + d[i >>> 24 & 15] + d[i >>> 20 & 15] + d[i >>> 16 & 15] + d[i >>> 12 & 15] + d[i >>> 8 & 15] + d[i >>> 4 & 15] + d[15 & i] + d[r >>> 28 & 15] + d[r >>> 24 & 15] + d[r >>> 20 & 15] + d[r >>> 16 & 15] + d[r >>> 12 & 15] + d[r >>> 8 & 15] + d[r >>> 4 & 15] + d[15 & r] + d[a >>> 28 & 15] + d[a >>> 24 & 15] + d[a >>> 20 & 15] + d[a >>> 16 & 15] + d[a >>> 12 & 15] + d[a >>> 8 & 15] + d[a >>> 4 & 15] + d[15 & a] + d[s >>> 28 & 15] + d[s >>> 24 & 15] + d[s >>> 20 & 15] + d[s >>> 16 & 15] + d[s >>> 12 & 15] + d[s >>> 8 & 15] + d[s >>> 4 & 15] + d[15 & s];
                    return this.is224 || (l += d[o >>> 28 & 15] + d[o >>> 24 & 15] + d[o >>> 20 & 15] + d[o >>> 16 & 15] + d[o >>> 12 & 15] + d[o >>> 8 & 15] + d[o >>> 4 & 15] + d[15 & o]),
                    l
                }
                ,
                x.prototype.toString = x.prototype.hex,
                x.prototype.digest = function() {
                    this.finalize();
                    var e = this.h0
                      , t = this.h1
                      , n = this.h2
                      , i = this.h3
                      , r = this.h4
                      , a = this.h5
                      , s = this.h6
                      , o = this.h7
                      , l = [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t, n >>> 24 & 255, n >>> 16 & 255, n >>> 8 & 255, 255 & n, i >>> 24 & 255, i >>> 16 & 255, i >>> 8 & 255, 255 & i, r >>> 24 & 255, r >>> 16 & 255, r >>> 8 & 255, 255 & r, a >>> 24 & 255, a >>> 16 & 255, a >>> 8 & 255, 255 & a, s >>> 24 & 255, s >>> 16 & 255, s >>> 8 & 255, 255 & s];
                    return this.is224 || l.push(o >>> 24 & 255, o >>> 16 & 255, o >>> 8 & 255, 255 & o),
                    l
                }
                ,
                x.prototype.array = x.prototype.digest,
                x.prototype.arrayBuffer = function() {
                    this.finalize();
                    var e = new ArrayBuffer(this.is224 ? 28 : 32)
                      , t = new DataView(e);
                    return t.setUint32(0, this.h0),
                    t.setUint32(4, this.h1),
                    t.setUint32(8, this.h2),
                    t.setUint32(12, this.h3),
                    t.setUint32(16, this.h4),
                    t.setUint32(20, this.h5),
                    t.setUint32(24, this.h6),
                    this.is224 || t.setUint32(28, this.h7),
                    e
                }
                ,
                k.prototype = new x,
                k.prototype.finalize = function() {
                    if (x.prototype.finalize.call(this),
                    this.inner) {
                        this.inner = !1;
                        var e = this.array();
                        x.call(this, this.is224, this.sharedMemory),
                        this.update(this.oKeyPad),
                        this.update(e),
                        x.prototype.finalize.call(this)
                    }
                }
                ;
                var E = w();
                E.sha256 = E,
                E.sha224 = w(!0),
                E.sha256.hmac = A(),
                E.sha224.hmac = A(!0),
                l ? e.exports = E : (a.sha256 = E.sha256,
                a.sha224 = E.sha224,
                c && (void 0 === (i = function() {
                    return E
                }
                .call(E, n, E, e)) || (e.exports = i)))
            }()
        }
        ,
        1333: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/helmet.svg"
        }
        ,
        1465: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.input-visualizer {\n    position: absolute;\n    left: var(--safe-area-horizontal);\n    bottom: 64px;\n    margin: 10px;\n    padding: 0;\n    --size: 96px;\n    width: calc(var(--size) * 3);\n    height: calc(var(--size) * 2);\n    opacity: 0.9;\n}\n\n.input-visualizer > div {\n    position: absolute;\n    margin: 0;\n    padding: 0;\n    width: var(--size);\n    height: var(--size);\n    background-color: var(--surface-color);\n}\n\n.input-visualizer > .arrow-up {\n    left: var(--size);\n    top: 0;\n}\n\n.input-visualizer > .arrow-right {\n    left: calc(var(--size) * 2);\n    top: var(--size);\n}\n\n.input-visualizer > .arrow-down {\n    left: var(--size);\n    top: var(--size);\n}\n\n.input-visualizer > .arrow-left {\n    left: 0;\n    top: var(--size);\n}\n\n.input-visualizer > div.active {\n    background-color: var(--surface-tertiary-color);\n}\n\n.input-visualizer > div > img {\n    margin: 0;\n    padding: 20px;\n    width: 100%;\n    height: 100%;\n    box-sizing: border-box;\n}\n.input-visualizer > div.active > img {\n    padding: 25px;\n}", ""]);
            const o = s
        }
        ,
        1601: e => {
            "use strict";
            e.exports = function(e) {
                return e[1]
            }
        }
        ,
        1643: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, '\n.settings-menu {\n\tposition: absolute;\n\tleft: calc(50% - 800px / 2);\n\ttop: 0;\n\tz-index: 2;\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 800px;\n\theight: 100%;\n\ttext-align: left;\n\tdisplay: flex;\n\tflex-direction: column;\n\tbackground-color: var(--surface-color);\n}\n\n.settings-menu > h2 {\n\tmargin: 10px;\n\tpadding: 0;\n\tfont-weight: normal;\n\tfont-size: 38px;\n\ttext-align: center;\n\tcolor: var(--text-color);\n}\n\n.settings-menu > .container {\n\tmargin: 0;\n\tpadding: 0;\n\tflex-grow: 1;\n\tbackground-color: var(--surface-secondary-color);\n\toverflow-y: scroll;\n\tpointer-events: auto;\n}\n\n.settings-menu > .container > h2 {\n\tmargin: 10px;\n\tpadding: 4px;\n\tfont-weight: normal;\n\tfont-size: 24px;\n\tcolor: var(--text-color);\n\tborder-bottom: 2px solid var(--text-color);\n}\n\n.settings-menu > .container > h3 {\n\tmargin: 10px 10px 10px 15px;\n\tpadding: 4px;\n\tfont-weight: normal;\n\tfont-size: 22px;\n\tcolor: var(--text-color);\n\tborder-bottom: 2px solid var(--text-color);\n}\n\n.settings-menu > .container > .setting {\n\tmargin: 10px;\n\tdisplay: flex;\n}\n\n.settings-menu > .container > .setting > p {\n\tdisplay: inline-block;\n\tmargin: 10px;\n\tpadding: 0;\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tflex-grow: 1;\n\tflex-shrink: 0;\n\tfont-size: 28px;\n\ttext-align: left;\n\tcolor: var(--text-color);\n}\n.settings-menu > .container > .setting.key-binding > p {\n\tflex-shrink: 1;\n}\n\n.settings-menu > .container > .setting > .button-wrapper {\n\tmargin-bottom: -8px;\n\tdisplay: flex;\n\tjustify-content: end;\n}\n.settings-menu > .container > .setting:not(.key-binding) > .button-wrapper {\n\tflex-wrap: wrap;\n}\n.settings-menu > .container > .setting.wrappable > .button-wrapper {\n\twhite-space: normal;\n}\n.settings-menu > .container > .setting.wrappable > .button-wrapper > button {\n\twidth: calc(100% / 4);\n\tfont-size: 23px;\n}\n\n.settings-menu > .container > .setting > .button-wrapper > button {\n\tmargin-bottom: 8px;\n\theight: 48px;\n\twhite-space: nowrap;\n}\n.settings-menu > .container > .setting > .button-wrapper > button.selected {\n\tbackground-color: var(--button-hover-color);\n}\n.settings-menu > .container > .setting.key-binding > .button-wrapper > button {\n\twidth: 210px;\n\tfont-size: 22px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tvertical-align: top;\n}\n\n.settings-menu > .container > .setting > input[type="range"] {\n\tmargin: 0 20px;\n\twidth: 390px;\n}\n\n.settings-menu > .button-wrapper > .button {\n\tmargin: 10px 0;\n}\n\n.settings-menu > .button-wrapper > .button:first-of-type {\n\tmargin-left: 10px;\n}\n\n.settings-menu > .button-wrapper > .button:last-of-type {\n\tmargin-right: 10px;\n}\n\n.settings-menu > .button-wrapper > .button > img {\n\tmargin-top: -3px;\n}\n\n.settings-menu > .button-wrapper > .apply {\n\tfloat: right;\n}\n', ""]);
            const o = s
        }
        ,
        1705: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/desert.svg"
        }
        ,
        1719: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/reset.svg"
        }
        ,
        1734: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/test.svg"
        }
        ,
        1758: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/desert_colored.svg"
        }
        ,
        1784: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/cancel.svg"
        }
        ,
        1903: () => {}
        ,
        1925: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/copy.svg"
        }
        ,
        1936: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/erase.svg"
        }
        ,
        1997: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, '\n.editor-track-settings > .background {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tz-index: 1;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(20, 20, 30, 0.5);\n\tpointer-events: auto;\n}\n\n.editor-track-settings > .container {\n\tposition: absolute;\n\tleft: calc(50% - 600px / 2);\n\ttop: 0;\n\tz-index: 2;\n\tdisplay: flex;\n\tflex-direction: column;\n\tbox-sizing: border-box;\n\twidth: 600px;\n\theight: 100%;\n\tbackground-color: var(--surface-color);\n}\n\n.editor-track-settings > .container > h1 {\n\tmargin: 10px;\n\tpadding: 0;\n\tfont-weight: normal;\n\tfont-size: 38px;\n\ttext-align: center;\n\tcolor: var(--text-color);\n}\n\n.editor-track-settings > .container > .content {\n\tflex-grow: 1;\n\tbackground-color: var(--surface-secondary-color);\n\toverflow-y: auto;\n\tpointer-events: auto;\n}\n\n.editor-track-settings > .container > .content > .setting {\n\tmargin: 20px;\n\tpadding: 20px;\n\tbackground-color: var(--surface-color);\n\toutline: 2px solid transparent;\n\ttransition: outline 0.25s ease-in-out;\n}\n\n.editor-track-settings > .container > .content > .setting.error {\n\toutline: 2px solid #e34c4c;\n}\n\n.editor-track-settings > .container > .content > .setting > .title {\n\tdisplay: block;\n\tmargin: 0;\n\tpadding: 0;\n\tfont-size: 30px;\n\tcolor: var(--text-color);\n}\n.editor-track-settings > .container > .content > .setting > input[type="text"] {\n\twidth: calc(100% - 20px);\n\tfont-weight: normal;\n\tfont-size: 30px;\n}\n\n.editor-track-settings > .container > .content > .setting > .environment-button {\n\tdisplay: inline-block;\n\tmargin: 10px 0;\n\tpadding: 10px;\n\twidth: calc(100% / 3);\n\tcolor: var(--text-color);\n\tfont-size: 27px;\n}\n.editor-track-settings > .container > .content > .setting > .environment-button.selected {\n\tbackground-color: var(--button-hover-color);\n}\n.editor-track-settings > .container > .content > .setting > .environment-button > img {\n\tmargin: 0;\n\tpadding: 10px 30px;\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tpointer-events: none;\n}\n\n.editor-track-settings > .container > .content > .setting > input[type="range"] {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 64px;\n\t-webkit-appearance: none;\n\tappearance: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\taccent-color: var(--text-color);\n}\n.editor-track-settings > .container > .content > .setting > input[type="range"]::-webkit-slider-runnable-track {\n\tbackground-color: var(--surface-tertiary-color);\n\theight: 10px;\n}\n.editor-track-settings > .container > .content > .setting > input[type="range"]::-moz-range-track {\n\tbackground-color: var(--surface-tertiary-color);\n\theight: 10px;\n}\n.editor-track-settings > .container > .content > .setting > input[type="range"]::-webkit-slider-thumb {\n\t-webkit-appearance: none;\n\tappearance: none;\n\tborder-radius: 0;\n\tbackground: var(--text-color);\n\twidth: 32px;\n\theight: 32px;\n\tmargin: -13px 0 0 0;\n\tborder: 4px solid var(--button-color);\n\toutline: 2px solid var(--text-color);\n}\n.editor-track-settings > .container > .content > .setting > input[type="range"]::-webkit-slider-thumb:hover {\n\tborder: 4px solid var(--button-hover-color);\n}\n@media (hover: none) {\n\t.editor-track-settings > .container > .content > .setting > input[type="range"]::-webkit-slider-thumb:hover {\n\t\tborder: 4px solid var(--button-color);\n\t}\n}\n.editor-track-settings > .container > .content > .setting > input[type="range"]::-webkit-slider-thumb:active {\n\tborder: 4px solid var(--button-active-color);\n}\n.editor-track-settings > .container > .content > .setting > input[type="range"]::-moz-range-thumb {\n\t-webkit-appearance: none;\n\tappearance: none;\n\tborder-radius: 0;\n\tbackground: var(--text-color);\n\twidth: 24px;\n\theight: 24px;\n\tborder: 4px solid var(--button-color);\n\toutline: 2px solid var(--text-color);\n}\n.editor-track-settings > .container > .content > .setting > input[type="range"]::-moz-range-thumb:hover {\n\tborder: 4px solid var(--button-hover-color);\n}\n@media (hover: none) {\n\t.editor-track-settings > .container > .content > .setting > input[type="range"]::-moz-range-thumb:hover {\n\t\tborder: 4px solid var(--button-color);\n\t}\n}\n.editor-track-settings > .container > .content > .setting > input[type="range"]::-moz-range-thumb:active {\n\tborder: 4px solid var(--button-active-color);\n}\n\n\n.editor-track-settings > .container > .button-wrapper > button {\n\tmargin: 10px;\n}\n\n.editor-track-settings > .container > .button-wrapper > button:not(:first-child) {\n\tfloat: right;\n}\n', ""]);
            const o = s
        }
        ,
        2175: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/random.svg"
        }
        ,
        2207: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/arrow_up.svg"
        }
        ,
        2208: (e, t, n) => {
            "use strict";
            e.exports = n.p + "forced_square.woff"
        }
        ,
        2319: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/delete.svg"
        }
        ,
        2344: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/car_stripe.svg"
        }
        ,
        2346: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.editor-side-toolbar {\n\tdisplay: flex;\n\tflex-direction: column;\n\tposition: absolute;\n\tbottom: 40px;\n\tleft: var(--safe-area-left);\n}\n.editor-side-toolbar.touch {\n\tbottom: 176px;\n}\n\n.editor-side-toolbar > .accordion {\n\tdisplay: flex;\n\tflex-direction: row;\n\twidth: 100px;\n\toverflow: hidden; /* Use hidden if clip is not supported */\n\toverflow: clip;\n\ttransition: width 0.25s ease-out;\n}\n.editor-side-toolbar.touch > .accordion {\n\twidth: 120px;\n}\n.editor-side-toolbar > .accordion.open {\n\twidth: auto;\n}\n\n.editor-side-toolbar button {\n\tposition: relative;\n\tflex-shrink: 0;\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100px;\n\theight: 100px;\n\tbackground-color: rgba(17, 32, 82, 0.48);\n\tborder: none;\n\tpointer-events: auto;\n\tcursor: pointer;\n\ttransition: background-color 0.25s ease-out;\n}\n.editor-side-toolbar button:hover {\n\tbackground-color: rgba(37, 54, 105, 0.48);\n}\n.editor-side-toolbar > .accordion > button:not(:first-of-type) {\n\tbackground-color: rgba(17, 32, 82, 0.35);\n}\n.editor-side-toolbar > .accordion > button:not(:first-of-type):hover {\n\tbackground-color: rgba(37, 54, 105, 0.35);\n}\n.editor-side-toolbar > .accordion > button:not(:first-of-type).selected {\n\tbackground-color: rgba(17, 32, 82, 0.55);\n}\n.editor-side-toolbar > .accordion > button:not(:first-of-type):active {\n\tbackground-color: rgba(17, 32, 82, 0.6);\n}\n@media (hover: none) {\n\t.editor-side-toolbar button:hover {\n\t\tbackground-color: rgba(17, 32, 82, 0.48);\n\t}\n}\n.editor-side-toolbar button:active {\n\tbackground-color: rgba(17, 32, 82, 0.6);\n\ttransition: none;\n}\n\n.editor-side-toolbar.touch button {\n\twidth: 120px;\n\theight: 120px;\n}\n\n.editor-side-toolbar button img {\n\tmargin: 0;\n\tpadding: 20%;\n\tvertical-align: top;\n\twidth: 100%;\n    height: 100%;\n\tbox-sizing: border-box;\n\tpointer-events: none;\n\ttransition: transform 0.25s ease-out;\n\tfilter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));\n}\n.editor-side-toolbar button:active img {\n\ttransition: none;\n\ttransform: scale(0.9);\n}\n\n.editor-side-toolbar button.rotate > span {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tposition: absolute;\n\ttop: 0;\n\tleft: 1px;\n\twidth: 100%;\n\theight: 100%;\n\tcolor: var(--text-color);\n\tfont-size: 16px;\n\ttext-shadow: 0 0 2px #000;\n\tpointer-events: none;\n\ttransition: transform 0.25s ease-out;\n}\n.editor-side-toolbar button.rotate:active > span {\n\ttransition: none;\n\ttransform: scale(0.9);\n}\n", ""]);
            const o = s
        }
        ,
        2493: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/overlapping_enabled.svg"
        }
        ,
        2553: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/state_invalid.svg"
        }
        ,
        2709: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/custom_tracks.jpg"
        }
        ,
        2796: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, '\n.verifier-ui {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tz-index: 2;\n\tmargin: 0;\n\tpadding: 16px;\n\twidth: 100%;\n\theight: 100%;\n\toverflow-y: scroll;\n\tbox-sizing: border-box;\n\tbackground-color: var(--surface-color);\n\tpointer-events: auto;\n}\n\n.verifier-ui > p {\n\tmargin: 16px 4px 0 4px;\n\tpadding: 0;\n\tfont-size: 20px;\n\tcolor: var(--text-color);\n\twhite-space: pre-wrap;\n}\n\n.verifier-ui > input[type="range"] {\n\tmargin: 16px 0;\n\twidth: 390px;\n}\n\n.verifier-ui > table {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\tborder-collapse: collapse;\n\ttable-layout: fixed;\n\tcolor: var(--text-color);\n}\n\n.verifier-ui > table > thead > tr > th {\n\ttext-align: left;\n\tborder-bottom: 2px solid var(--text-color);\n}\n\n.verifier-ui > table > thead > tr > th, .verifier-ui > table > tbody > tr > td {\n\tpadding: 8px 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.verifier-ui > button {\n\tdisplay: inline-block;\n\tmargin: 16px 0 0 0;\n}\n', ""]);
            const o = s
        }
        ,
        2817: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, '\n.time-announcer {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 35%;\n\twidth: 100%;\n\toverflow: hidden;\n}\n\n.time-announcer > .record {\n\tmargin: 0;\n\tpadding: 0;\n\tfont-size: 48px;\n\ttext-shadow: 0 0 5px #000;\n\tcolor: #5f5;\n\ttext-align: center;\n\topacity: 0;\n\tanimation: 0.3s ease-out 0.8s 1 normal forwards running time-announcer-record-animation;\n}\n\n.time-announcer > .track-name {\n\tmargin: 0 0 10px 0;\n\tpadding: 4px 20px;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tbackground-color: var(--surface-secondary-color);\n\tfont-size: 60px;\n\tcolor: var(--text-color);\n\ttext-align: center;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tanimation: 0.3s ease-out 0s 1 normal forwards running time-announcer-animation;\n}\n\n.time-announcer > .current {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 0;\n\tbackground-color: var(--surface-color);\n\tfont-size: 48px;\n\tcolor: var(--text-color);\n\ttext-align: center;\n\tanimation: 0.5s ease-out 0s 1 normal forwards running time-announcer-animation;\n}\n.time-announcer > .current:after {\n\tcontent: "\\200b"; /* Keep height even with absolute elements */\n}\n.time-announcer > .current > div {\n\tposition: absolute;\n\tleft: 50%;\n}\n.time-announcer > .current > .time {\n\ttext-align: right;\n\ttransform: translateX(-50%);\n\ttransition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;\n}\n.time-announcer > .current > .position-dash {\n\ttransform: translateX(-50%);\n\topacity: 0;\n\ttransition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;\n}\n.time-announcer > .current > .position {\n\ttext-align: left;\n\topacity: 0;\n\ttransform: translateX(-50%);\n\ttransition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;\n}\n\n.time-announcer > .current.show-position > .time {\n\ttransform: translateX(calc(-100% - 35px));\n}\n.time-announcer > .current.show-position > .position-dash {\n\topacity: 1;\n}\n.time-announcer > .current.show-position > .position {\n\ttransform: translateX(35px);\n\topacity: 1;\n}\n\n.time-announcer > .difference > p {\n\tmargin: 0 0 0 auto;\n\tpadding: 0;\n\twidth: 0;\n\tbackground-color: var(--surface-secondary-color);\n\tcolor: #5f5;\n\tfont-size: 30px;\n\ttext-align: center;\n\tanimation: 0.4s ease-out 0.5s 1 normal forwards running time-announcer-animation;\n}\n.time-announcer > .difference.red > p {\n\tcolor: #f55;\n}\n.time-announcer > .difference > p.title {\n\tmargin-top: 30px;\n\tbackground-color: transparent;\n\ttext-shadow: 0 0 3px #000;\n}\n\n@keyframes time-announcer-record-animation {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(10px);\n\t}\n\n\tto {\n\t\topacity: 1;\n\t}\n}\n\n@keyframes time-announcer-animation {\n\tfrom {\n\t\twidth: 0;\n\t\topacity: 0;\n\t}\n\n\tto {\n\t\twidth: 100%;\n\t\topacity: 1;\n\t}\n}\n', ""]);
            const o = s
        }
        ,
        2832: (e, t, n) => {
            "use strict";
            e.exports = n.p + "forced_square.ttf"
        }
        ,
        2915: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.menu {\n\tdisplay: flex;\n\tflex-direction: column;\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(10, 10, 20, 0.8);\n\ttext-align: center;\n\ttransition: background-color 1s ease-out;\n}\n.menu.loading-screen {\n\tbackground-color: var(--surface-tertiary-color);\n}\n\n.menu > .logo {\n\tdisplay: block;\n\tmargin: 80px auto 0 auto;\n\tpadding: 0;\n\twidth: 1000px;\n\theight: 200px;\n\t-webkit-filter: drop-shadow(0 0 3px #000);\n\tfilter: drop-shadow(0 0 3px #000);\n\ttransition: opacity 0.25s ease-out;\n}\n.menu > .logo.hidden {\n\topacity: 0;\n}\n\n@media (max-width: 1300px) {\n\t.menu > .logo {\n\t\twidth: calc(100vw * (1000 / 1300));\n\t}\n}\n@media (max-width: 975px) {\n\t.menu > .logo {\n\t\twidth: calc(975px * (1000 / 1300));\n\t}\n}\n\n.menu > .warning-message {\n\tmargin: 16px auto 0 auto;\n\tmax-width: 900px;\n\tfont-size: 26px;\n\tcolor: #f66;\n}\n.menu > .warning-message > a {\n\tmargin: 0 auto;\n\tdisplay: block;\n\twidth: max-content;\n\tcolor: var(--text-color);\n\tpointer-events: auto;\n}\n\n.menu > .warning-message.official-link {\n\tcolor: var(--text-color);\n}\n.menu > .warning-message.official-link > a {\n\tcolor: var(--text-color);\n}\n\n.menu > .main-buttons-container {\n\tmargin: 0 0 140px 0;\n\tdisplay: flex;\n\tflex-grow: 1;\n\talign-items: center;\n\tjustify-content: center;\n}\n.menu > .main-buttons-container.hidden {\n\tdisplay: none;\n}\n\n.menu .button-image {\n\tdisplay: inline-block;\n\tmargin: 10px 0;\n\tpadding: 0;\n\twidth: 200px;\n\theight: 200px;\n\tpointer-events: auto;\n}\n.menu .button-image > img {\n\tmargin: 40px 40px 0 40px;\n\tpadding: 0;\n\twidth: 96px;\n\theight: 96px;\n\ttransition: transform 0.2s ease-in-out;\n\tpointer-events: none;\n}\n.menu .button-image:not(:disabled):hover > img {\n\ttransform: translateY(-10px);\n}\n@media (hover: none) {\n\t.menu .button-image:not(:disabled):hover > img {\n\t\ttransform: none;\n\t}\n}\n.menu .button-image > p {\n\tmargin: 0;\n\tpadding: 0;\n\tcolor: var(--text-color);\n\tfont-size: 27px;\n}\n\n.menu .button-image.button-spawn {\n\tanimation: button-spawn 0.5s ease-out forwards;\n\topacity: 0;\n}\n\n@keyframes button-spawn {\n\t0% {\n\t\ttransform: translateY(50px) scale(0.8);\n\t\topacity: 0;\n\t}\n\t70% {\n\t\ttransform: translateY(-10px) scale(1);\n\t\topacity: 1;\n\t}\n\t100% {\n\t\ttransform: translateY(0) scale(1);\n\t\topacity: 1;\n\t}\n}\n\n.menu > .bottom-buttons {\n\tmargin: 8px 8px 8px calc(8px + var(--safe-area-left));\n\tpadding: 0;\n\tposition: absolute;\n\tleft: 0;\n\tbottom: 0;\n}\n\n.menu > .bottom-buttons > .small {\n\tpadding: 6px 12px;\n\tclip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);\n\tfont-size: 22px;\n}\n.menu > .bottom-buttons > .small > img {\n\tvertical-align: middle;\n\twidth: 24px;\n\theight: 24px;\n}\n\n.menu > .info {\n\tposition: absolute;\n\tleft: 0;\n\tbottom: 16px;\n\twidth: 100%;\n}\n.menu > .info > a {\n\tdisplay: block;\n\tmargin: 0 auto;\n\tpadding: 5px;\n\twidth: fit-content;\n\tcolor: var(--text-color);\n\ttext-decoration: none;\n\tfont-size: 20px;\n\tpointer-events: auto;\n}\n.menu > .info > a[href]:hover, .menu > .info > a[href]:focus-visible {\n\ttext-decoration: underline;\n\toutline: none;\n}\n", ""]);
            const o = s
        }
        ,
        2927: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.loading-ui {\n\tmargin: 200px 0 0 0;\n\tpadding: 0;\n}\n.loading-ui.fade-out {\n\topacity: 0;\n\ttransition: opacity 0.25s ease-out;\n}\n\n.loading-ui > p {\n\tmargin: 5px;\n\tpadding: 0;\n\tcolor: var(--text-color);\n\tfont-size: 32px;\n}\n\n.loading-ui > div {\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 600px;\n\theight: 50px;\n\tbackground-color: var(--surface-color);\n\tclip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);\n\toverflow: hidden;\n}\n\n.loading-ui > div > div {\n\tmargin: 15px 20px;\n\tpadding: 0;\n\twidth: 560px;\n\theight: 20px;\n\tclip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);\n\tbackground-color: #224;\n\tbox-shadow: inset 0 0 6px #000;\n}\n\n.loading-ui > div > div > div {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 0;\n\theight: 100%;\n\tclip-path: polygon(2px 0, 100% 0, calc(100% - 2px) 100%, 0 100%);\n\tbackground-color: #fff;\n\tbox-shadow: inset 0 0 6px #000;\n\ttransition: width 0.1s ease-in-out;\n}\n", ""]);
            const o = s
        }
        ,
        3144: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/undo.svg"
        }
        ,
        3223: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/pending.svg"
        }
        ,
        3518: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/grid_large.svg"
        }
        ,
        3571: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => u
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)
              , o = n(4417)
              , l = n.n(o)
              , c = new URL(n(5148),n.b)
              , h = s()(r())
              , d = l()(c);
            h.push([e.id, `\n.touch-controls {\n\tpointer-events: none;\n}\n\n.touch-controls > button {\n\tposition: absolute;\n\ttop: calc(1.5cm + 50px);\n\tmargin: 10px;\n\tpadding: 0;\n\twidth: 160px;\n\theight: 160px;\n\tbackground-color: var(--button-color);\n\tborder: none;\n\topacity: 0.6;\n\tpointer-events: auto;\n\ttouch-action: none;\n}\n.touch-controls > button  > img {\n\tmargin: 0;\n\tpadding: 30px;\n\tvertical-align: top;\n\twidth: 100%;\n    height: 100%;\n\tbox-sizing: border-box;\n\tpointer-events: none;\n\ttransition: transform 0.25s ease-out;\n}\n.touch-controls > button.active > img {\n    transform: scale(0.9);\n}\n\n.touch-controls > .camera {\n\tleft: 1.5cm;\n}\n\n.touch-controls > .reset.checkpoint-available {\n\tbackground-image: url(${d});\n\tbackground-position: 71px 64px;\n\tbackground-size: 32px;\n\tbackground-repeat: no-repeat;\n}\n.touch-controls > .reset {\n\tright: 1.5cm;\n}\n\n.touch-controls > .left-container {\n\tposition: absolute;\n\tleft: 1.5cm;\n\tbottom: 1.5cm;\n}\n\n.touch-controls > .right-container {\n\tposition: absolute;\n\tright: 1.5cm;\n\tbottom: 1.5cm;\n}\n.touch-controls > div.steering > div {\n\tdisplay: inline-block;\n}\n\n.touch-controls > div > div {\n\tmargin: 10px;\n\tpadding: 0;\n\twidth: 160px;\n\theight: 160px;\n\tbackground-color: var(--button-color);\n\topacity: 0.5;\n\tpointer-events: auto;\n\ttouch-action: none;\n}\n.touch-controls > div > div.active {\n\tbackground-color: var(--button-active-color);\n\topacity: 0.6;\n}\n\n.touch-controls > div > div > img {\n\tmargin: 0;\n\tpadding: 40px;\n\tvertical-align: top;\n\twidth: 100%;\n    height: 100%;\n\tbox-sizing: border-box;\n\tpointer-events: none;\n}\n.touch-controls > div > div.active > img {\n    padding: 50px;\n}\n`, ""]);
            const u = h
        }
        ,
        3682: (e, t, n) => {
            "use strict";
            e.exports = n.p + "forced_square.woff2"
        }
        ,
        3693: (e, t, n) => {
            "use strict";
            var i, r;
            n.d(t, {
                _: () => r,
                k: () => i
            }),
            function(e) {
                e.Heavy = "HEAVY",
                e.Medium = "MEDIUM",
                e.Light = "LIGHT"
            }(i || (i = {})),
            function(e) {
                e.Success = "SUCCESS",
                e.Warning = "WARNING",
                e.Error = "ERROR"
            }(r || (r = {}))
        }
        ,
        3755: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/share.svg"
        }
        ,
        3849: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/timer.svg"
        }
        ,
        3895: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/rotation_axis_z_negative.svg"
        }
        ,
        3901: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/summer.svg"
        }
        ,
        3902: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/verified.svg"
        }
        ,
        4239: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, ".ghost-loading-ui {\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\tmargin: 4px;\n\tcolor: var(--text-color);\n\tfont-size: 22px;\n\tfont-weight: normal;\n\ttext-shadow: 1px 1px 1px var(--surface-color), -1px 1px 1px var(--surface-color), -1px -1px 1px var(--surface-color), 1px -1px 1px var(--surface-color);\n\ttransition: opacity 0.25s ease-in-out;\n}\n.ghost-loading-ui.hide {\n\topacity: 0;\n\ttransform: translateX(20px);\n\ttransition: opacity 0.25s ease-in-out 0.5s, transform 0.25s ease-in-out 0.5s;\n}\n.ghost-loading-ui.down {\n\ttop: initial;\n\tbottom: 0;\n}\n\n.ghost-loading-ui > .percentage {\n\tdisplay: inline-block;\n\twidth: 60px;\n\ttext-align: center;\n}\n", ""]);
            const o = s
        }
        ,
        4309: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/save.svg"
        }
        ,
        4344: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.debug {\n\tmargin: 0.25em;\n\tpadding: 0;\n\tposition: absolute;\n\tleft: 0;\n\tbottom: 0;\n\tfont-size: 28px;\n\ttext-shadow: 0 0 5px #000;\n\tcolor: #fff;\n\tz-index: 10;\n}\n", ""]);
            const o = s
        }
        ,
        4394: () => {}
        ,
        4411: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/rotation_axis_z_positive.svg"
        }
        ,
        4417: e => {
            "use strict";
            e.exports = function(e, t) {
                return t || (t = {}),
                e ? (e = String(e.__esModule ? e.default : e),
                /^['"].*['"]$/.test(e) && (e = e.slice(1, -1)),
                t.hash && (e += t.hash),
                /["'() \t\n]|(%20)/.test(e) || t.needQuotes ? '"'.concat(e.replace(/"/g, '\\"').replace(/\n/g, "\\n"), '"') : e) : e
            }
        }
        ,
        4538: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.pause-screen {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(0, 0, 0, 0.75);\n\tanimation: fade-in 0.25s forwards;\n}\n.pause-screen.fade-out {\n\topacity: 0;\n\ttransition: opacity 0.25s;\n}\n\n@keyframes fade-in {\n\tfrom {\n\t\tbackground-color: rgba(0, 0, 0, 0);\n\t}\n\tto {\n\t\tbackground-color: rgba(0, 0, 0, 0.75);\n\t}\n}\n\n\n.pause-screen > .title {\n\tposition: absolute;\n\ttop: 40%;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%);\n\tfont-size: 100px;\n\tcolor: var(--text-color);\n\tanimation: slide-fade-in 0.5s 0.3s forwards;\n\topacity: 0;\n}\n\n@keyframes slide-fade-in {\n\tfrom {\n\t\ttransform: translate(-60%, -50%);\n\t\topacity: 0;\n\t}\n\tto {\n\t\ttransform: translate(-50%, -50%);\n\t\topacity: 1;\n\t}\n}\n", ""]);
            const o = s
        }
        ,
        4543: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.time-bar {\n\tdisplay: flex;\n\tmargin: 0;\n\tpadding: 0 var(--safe-area-horizontal);\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tbackground-color: var(--surface-color);\n}\n\n.time-bar > button {\n\tmargin: 6px;\n\tpadding: 4px 12px;\n}\n.time-bar > button > img {\n\tmargin: 0 0 2px 0;\n\tpadding: 0;\n\tvertical-align: middle;\n\twidth: 28px;\n\theight: 28px;\n\tpointer-events: none;\n}\n\n.time-bar > .bar {\n\tposition: relative;\n\tmargin: 6px 6px 6px -8px;\n\tpadding: 0;\n\tflex-grow: 1;\n\theight: 40px;\n\tbackground-color: var(--surface-secondary-color);\n\tclip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n\ttouch-action: none;\n\tpointer-events: auto;\n}\n.time-bar > .bar > div {\n\tposition: relative;\n\twidth: calc(100% - 8px);\n\theight: 100%;\n}\n.time-bar > .bar > div > .unloaded-fill {\n\tposition: absolute;\n\tright: -8px;\n\ttop: 0;\n\tmargin: 0;\n\tpadding: 0;\n\theight: 100%;\n\tbackground-color: rgba(255, 255, 255, 0.1);\n\tclip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n\twill-change: width;\n}\n.time-bar > .bar > div > .fill {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tmargin: 0;\n\tpadding: 0;\n\theight: 100%;\n\tbackground-color: #7272c2;\n\tclip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n\twill-change: width;\n}\n.time-bar > .bar > div > .dash-container {\n\tpointer-events: none;\n}\n.time-bar > .bar > div > .dash-container > .dash {\n\tposition: absolute;\n\tz-index: 1;\n\tbottom: 0;\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 2px;\n\theight: 25%;\n\tbackground-color: rgba(0, 0, 0, 0.25);\n}\n.time-bar > .bar > div > .dash-container > .dash.long {\n\theight: 50%;\n\tbackground-color: rgba(0, 0, 0, 0.35);\n}\n.time-bar > .bar > div > .dash-container > .checkpoint-dash {\n\tposition: absolute;\n\tz-index: 1;\n\tbottom: 0;\n\tmargin: 0;\n\tpadding: 0;\n\twidth: calc(8px + 2px);\n\theight: 100%;\n\tclip-path: polygon(calc(100% - 2px) 0, 100% 0, 2px 100%, 0 100%);\n\tbackground-color: #ffff00;\n}\n", ""]);
            const o = s
        }
        ,
        4563: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/rotate.svg"
        }
        ,
        4593: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/reset_settings.svg"
        }
        ,
        4804: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.game-toolbar {\n\tposition: absolute;\n\tleft: var(--safe-area-horizontal);\n\tbottom: 0;\n\tz-index: 1;\n\tpadding: 8px 10px;\n\tbackground-color: var(--surface-color);\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n\topacity: 0;\n\ttransform: translateX(-10px);\n\ttransition: opacity 0.2s ease-in-out 0.5s, transform 0.2s ease-in-out 0.5s;\n\tpointer-events: none;\n}\n\n.game-toolbar.up {\n\tposition: absolute;\n\tbottom: auto;\n\ttop: 0;\n}\n\n#ui.has-safe-area-horizontal .game-toolbar {\n\tpadding-right: 16px;\n\tclip-path: polygon(10px 0, calc(100% - 8px) 0, 100% 100%, 0 100%);\n}\n#ui.has-safe-area-horizontal .game-toolbar.up {\n\tpadding-left: 16px;\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 8px 100%);\n}\n\n.game-toolbar.touch > .button {\n\tfont-size: 24px;\n}\n.game-toolbar.touch > .button > img {\n\twidth: 24px;\n\theight: 24px;\n}\n\n.game-toolbar.visible {\n\topacity: 1;\n\ttransform: translateX(0);\n\ttransition: opacity ease-in-out 0.2s, transform ease-in-out 0.2s;\n\tpointer-events: auto;\n}\n", ""]);
            const o = s
        }
        ,
        4930: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/grid_small.svg"
        }
        ,
        4942: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/redo.svg"
        }
        ,
        5001: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/rotation_axis_x_negative.svg"
        }
        ,
        5007: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.editor-height-selector {\n\tposition: absolute;\n\tleft: var(--safe-area-left);\n\tbottom: 0;\n}\n\n.editor-height-selector > .buttons {\n\tdisplay: inline-block;\n\tvertical-align: bottom;\n}\n.editor-height-selector > .buttons > button {\n\tdisplay: block;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: none;\n\tbackground-color: var(--button-color);\n\tpointer-events: auto;\n\tcursor: pointer;\n}\n.editor-height-selector > .buttons > button:hover {\n\tbackground-color: var(--button-hover-color);\n}\n.editor-height-selector > .buttons > button:active {\n\tbackground-color: var(--button-active-color);\n}\n@media (hover: none) {\n\t.editor-height-selector > .buttons > button:hover {\n\t\tbackground-color: var(--button-color);\n\t}\n}\n\n.editor-height-selector > .buttons > button > img { \n\tmargin: 0;\n\tpadding: 0 6px;\n\twidth: 20px;\n\theight: 20px;\n\tvertical-align: bottom;\n\tpointer-events: none;\n}\n.editor-height-selector.touch > .buttons > button > img {\n\tpadding: 24px;\n\twidth: 40px;\n\theight: 40px;\n}\n\n.editor-height-selector > p {\n\tmargin: 0;\n\tpadding: 0 10px;\n\tdisplay: inline-block;\n\tvertical-align: bottom;\n\tline-height: 40px;\n\tmin-width: 140px;\n\tfont-size: 26px;\n\ttext-align: center;\n\tbackground-color: var(--surface-transparent-color);\n\tcolor: var(--text-color);\n}\n.editor-height-selector.touch > p {\n\tline-height: calc((40px + 2 * 24px) * 2);\n}\n", ""]);
            const o = s
        }
        ,
        5010: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/winter_colored.svg"
        }
        ,
        5031: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/help.svg"
        }
        ,
        5056: (e, t, n) => {
            "use strict";
            e.exports = function(e) {
                var t = n.nc;
                t && e.setAttribute("nonce", t)
            }
        }
        ,
        5072: e => {
            "use strict";
            var t = [];
            function n(e) {
                for (var n = -1, i = 0; i < t.length; i++)
                    if (t[i].identifier === e) {
                        n = i;
                        break
                    }
                return n
            }
            function i(e, i) {
                for (var a = {}, s = [], o = 0; o < e.length; o++) {
                    var l = e[o]
                      , c = i.base ? l[0] + i.base : l[0]
                      , h = a[c] || 0
                      , d = "".concat(c, " ").concat(h);
                    a[c] = h + 1;
                    var u = n(d)
                      , p = {
                        css: l[1],
                        media: l[2],
                        sourceMap: l[3],
                        supports: l[4],
                        layer: l[5]
                    };
                    if (-1 !== u)
                        t[u].references++,
                        t[u].updater(p);
                    else {
                        var f = r(p, i);
                        i.byIndex = o,
                        t.splice(o, 0, {
                            identifier: d,
                            updater: f,
                            references: 1
                        })
                    }
                    s.push(d)
                }
                return s
            }
            function r(e, t) {
                var n = t.domAPI(t);
                n.update(e);
                return function(t) {
                    if (t) {
                        if (t.css === e.css && t.media === e.media && t.sourceMap === e.sourceMap && t.supports === e.supports && t.layer === e.layer)
                            return;
                        n.update(e = t)
                    } else
                        n.remove()
                }
            }
            e.exports = function(e, r) {
                var a = i(e = e || [], r = r || {});
                return function(e) {
                    e = e || [];
                    for (var s = 0; s < a.length; s++) {
                        var o = n(a[s]);
                        t[o].references--
                    }
                    for (var l = i(e, r), c = 0; c < a.length; c++) {
                        var h = n(a[c]);
                        0 === t[h].references && (t[h].updater(),
                        t.splice(h, 1))
                    }
                    a = l
                }
            }
        }
        ,
        5086: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.loading-spinner {\n\twidth: 40px;\n\theight: 40px;\n\tborder-radius: 50%;\n\tborder: 5px solid var(--surface-tertiary-color);\n\tborder-left-color: var(--text-color);\n\n\tanimation: 1s linear infinite forwards loading-spinner-spin;\n}\n\n@keyframes loading-spinner-spin {\n\tfrom {\n\t\ttransform: rotate(0);\n\t}\n\tto {\n\t\ttransform: rotate(360deg);\n\t}\n}\n", ""]);
            const o = s
        }
        ,
        5140: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.profile-selection {\n\tposition: absolute;\n\tleft: calc(50% - 500px / 2);\n\ttop: 40%;\n\tz-index: 2;\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 500px;\n\tbox-sizing: border-box;\n\tbackground-color: var(--surface-secondary-color);\n}\n\n.profile-selection > .top-bar {\n\tmargin: 0;\n\tpadding: 10px;\n\tbackground-color: var(--surface-color);\n}\n\n.profile-selection > .top-bar > h2 {\n\tmargin: 0;\n\tpadding: 0;\n\tfont-weight: normal;\n\tfont-size: 38px;\n\ttext-align: center;\n\tcolor: var(--text-color);\n}\n\n.profile-selection > .slot {\n\tposition: relative;\n\tmargin: 10px 10px 0 10px;\n\tpadding: 0;\n}\n\n.profile-selection > .slot > button.main {\n\tmargin: 0;\n\tpadding: 0;\n\tvertical-align: top;\n\twidth: 100%;\n\theight: 100px;\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n\ttext-align: left;\n\twhite-space: nowrap;\n}\n\n.profile-selection > .slot > button.main.selected {\n\tbackground-color: var(--button-hover-color);\n}\n\n.profile-selection > .slot > button.main > .image-container {\n\tdisplay: inline-block;\n\tposition: relative;\n\tbackground-color: rgba(0, 0, 0, 0.1);\n\twidth: 100px;\n\theight: 100px;\n}\n\n.profile-selection > .slot > button.main > .image-container > img {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\twidth: 100%;\n\theight: 100%;\n\tpointer-events: none;\n\topacity: 0;\n\ttransition: opacity 0.5s ease-out;\n}\n.profile-selection > .slot > button.main > .image-container > img.show {\n\topacity: 1;\n}\n\n.profile-selection > .slot > button.main > .name {\n\tdisplay: inline-block;\n\tvertical-align: top;\n\tmargin: 0;\n\tpadding: 12px;\n\tfont-size: 28px;\n\tcolor: var(--text-color);\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\twidth: 320px;\n}\n.profile-selection > .slot > button.main > .name.empty {\n\tcolor: #000;\n\topacity: 0.2;\n}\n\n.profile-selection > .bottom-bar {\n\tmargin: 10px 0 0 0;\n\tpadding: 10px;\n\tbackground-color: var(--surface-color);\n}\n\n.profile-selection > .bottom-bar > .button.right {\n\tfloat: right;\n}\n", ""]);
            const o = s
        }
        ,
        5148: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/checkpoint.svg"
        }
        ,
        5151: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.speedometer {\n\tdisplay: flex;\n\tflex-direction: column;\n\tposition: absolute;\n\tbottom: 0;\n\tright: var(--safe-area-horizontal);\n}\n\n.speedometer.up {\n\tbottom: auto;\n\ttop: 0;\n\tflex-direction: column-reverse;\n}\n\n.speedometer > .box {\n\tmargin: 0;\n\tpadding: 8px 10px;\n\tmin-width: 140px;\n\tline-height: 0;\n\tfont-size: 40px;\n\tcolor: var(--text-color);\n\ttext-align: right;\n\topacity: 0.9;\n\tclip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%);\n\tbackground-color: var(--surface-color);\n}\n.speedometer.up > .box {\n\tclip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%);\n}\n.speedometer.hidden {\n\tdisplay: none;\n}\n\n#ui.has-safe-area-horizontal .speedometer {\n\tclip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 100%, 0 100%);\n}\n#ui.has-safe-area-horizontal .speedometer.up {\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 8px 100%);\n}\n\n.speedometer > .box > .container {\n\tmargin: 0;\n\tpadding: 0 0 0 16px;\n\tclip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%);\n\tbackground-color: var(--surface-tertiary-color);\n}\n.speedometer.up > .box > .container {\n\tclip-path: polygon(0 0, 100% 0, 100% 100%, 6px 100%);\n}\n\n#ui.has-safe-area-horizontal .speedometer > .box > .container {\n\tpadding-right: 4px;\n\tclip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 100%, 0 100%);\n}\n#ui.has-safe-area-horizontal .speedometer.up > .box > .container {\n\tpadding-right: 4px;\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 6px 100%);\n}\n\n.speedometer > .box > .container > span:last-of-type {\n\topacity: 0.5;\n\tmargin: 0 0.3em 0 0.25em;\n\tpadding: 0;\n\tfont-size: 0.5em;\n}\n.speedometer > .box > .container > span > span {\n\tdisplay: inline-block;\n\twidth: 0.5em;\n\ttext-align: center;\n}\n\n.speedometer > .checkpoint-speed {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\ttext-align: center;\n\tfont-size: 26px;\n\ttext-shadow: 1px 1px 1px var(--surface-color), -1px 1px 1px var(--surface-color), -1px -1px 1px var(--surface-color), 1px -1px 1px var(--surface-color);\n\topacity: 0;\n}\n.speedometer > .checkpoint-speed.green {\n\tcolor: #5f5;\n}\n.speedometer > .checkpoint-speed.red {\n\tcolor: #f55;\n}\n", ""]);
            const o = s
        }
        ,
        5437: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.message-box {\n\tmargin: 0;\n\tpadding: 0;\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tz-index: 1;\n\tmax-width: unset;\n\tmax-height: unset;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(20, 20, 30, 0.5);\n\tborder: none;\n\tpointer-events: auto;\n}\n\n.message-box > div {\n\tposition: absolute;\n\tleft: calc(50% - 500px / 2);\n\ttop: 30%;\n\tz-index: 2;\n\tmargin: 0;\n\tpadding: 16px;\n\twidth: 500px;\n\tbox-sizing: border-box;\n\tborder: none;\n\tbackground-color: var(--surface-color);\n\toutline: none;\n\ttext-align: center;\n}\n\n.message-box > div > p {\n\tmargin: 5px 0 20px 0;\n\tpadding: 0;\n\tmin-height: 50px;\n\tline-height: 0.9;\n\tfont-size: 32px;\n\toverflow-wrap: break-word;\n\twhite-space: pre-wrap;\n\tcolor: var(--text-color);\n}\n\n.message-box > div > button {\n\tmin-width: 140px;\n}\n\n.message-box.message > div > button:first-of-type {\n\tdisplay: none;\n}\n\n.message-box.confirm > div > button:first-of-type {\n\tfloat: left;\n}\n.message-box.confirm > div > button:last-of-type {\n\tfloat: right;\n}\n\n.message-box.no-buttons > div > button {\n\tdisplay: none;\n}\n", ""]);
            const o = s
        }
        ,
        5586: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.track-info {\n\tposition: absolute;\n\tleft: calc(50% - 1050px / 2);\n\ttop: 0;\n\tz-index: 2;\n\tdisplay: flex;\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 1000px;\n\theight: 100%;\n}\n.track-info.hidden {\n\tdisplay: none;\n}\n\n.track-info > .side-panel {\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-shrink: 0;\n\tmin-height: 0;\n\tmargin-left: 50px;\n\twidth: 400px;\n\tbackground-color: var(--surface-color);\n}\n\n.track-info > .side-panel > h2 {\n\tmargin: 8px 8px 0 8px;\n\tpadding: 0;\n\tflex-shrink: 0;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tfont-weight: normal;\n\tfont-size: 32px;\n\ttext-align: center;\n\tcolor: var(--text-color);\n}\n\n\n.track-info > .side-panel > .thumbnail {\n\tposition: relative;\n\tmargin: 10px 0 0 0;\n\tpadding: 45px;\n\tflex-grow: 1;\n\tmin-height: 0;\n\tmax-height: 300px;\n\tbox-sizing: border-box;\n\tbackground-color: var(--surface-secondary-color);\n}\n\n.track-info > .side-panel > .thumbnail > canvas {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: contain;\n\t-webkit-filter: drop-shadow(0 0 3px #000);\n\tfilter: drop-shadow(0 0 3px #000);\n\timage-rendering: pixelated;\n}\n\n.track-info > .side-panel > .thumbnail > .share {\n\tdisplay: inline-block;\n\tposition: absolute;\n\tleft: 0;\n\tbottom: 0;\n\tmargin: 8px;\n\tpadding: 0 9px;\n\tclip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);\n}\n.track-info > .side-panel > .thumbnail > .share > img {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 16px;\n\tpointer-events: none;\n}\n\n.track-info > .side-panel > .thumbnail > .environment {\n\tposition: absolute;\n\tright: 0;\n\tbottom: 0;\n\tmargin: 8px;\n\twidth: 32px;\n\topacity: 0.2;\n\tpointer-events: none;\n}\n\n.track-info > .side-panel > .track-author {\n\tmargin: 8px 0;\n\tfont-size: 18px;\n\tcolor: var(--text-color);\n\toverflow-wrap: anywhere;\n}\n\n.track-info > .side-panel > .divider {\n\tborder-top: 1px solid var(--text-color);\n}\n\n.track-info > .side-panel > .personal-best-title, .track-info > .side-panel > .opponents-title {\n\tmargin: 10px 0 0 0;\n\tfont-size: 32px;\n\tcolor: var(--text-color);\n}\n\n.track-info > .side-panel > .personal-best {\n\tmargin: 0 0 16px 0;\n\tfont-size: 28px;\n\tcolor: var(--text-color);\n}\n.track-info > .side-panel > .personal-best.no-record {\n\topacity: 0.5;\n}\n\n.track-info > .side-panel > .personal-best > div {\n\tmargin: 8px 0;\n\tpadding: 0 30px;\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tfont-size: 26px;\n\ttext-align: left;\n\tline-height: 30px;;\n}\n\n.track-info > .side-panel > .personal-best > div > img {\n\tmargin: -1px 8px 1px 0;\n\twidth: 30px;\n\theight: 30px;\n\tvertical-align: top;\n}\n\n.track-info > .side-panel > .personal-best > div > .faded {\n\topacity: 0.5;\n}\n\n.track-info > .side-panel > .opponents-container {\n\tmargin: 8px 16px 16px 16px;\n\tflex-grow: 1;\n\tmin-height: 50px;\n\tfont-size: 18px;\n\tcolor: var(--text-color);\n\topacity: 0.5;\n}\n\n.track-info > .side-panel > .opponents-container.no-opponents {\n\tmargin: 8px 16px 16px 16px;\n\tfont-size: 18px;\n\tcolor: var(--text-color);\n\topacity: 0.5;\n}\n\n.track-info > .side-panel > .button.watch, .track-info > .side-panel > .button.play {\n\tflex-shrink: 0;\n\tmargin: 0 10px 10px 10px;\n\tpadding: 0 0 0 30px;\n\tbox-sizing: border-box;\n\twidth: calc(100% - 2 * 10px);\n\theight: 100px;\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n\ttext-align: center;\n\tfont-size: 50px;\n}\n.track-info > .side-panel > .button.watch {\n\theight: 50px;\n\tfont-size: 40px;\n}\n\n.track-info > .side-panel > .button.watch > img, .track-info > .side-panel > .button.play > img {\n\tmargin: 0 0 0 10px;\n\tpadding: 0;\n\tvertical-align: middle;\n\twidth: 48px;\n\theight: 48px;\n\ttransition: transform 0.2s ease-in-out;\n\tpointer-events: none;\n}\n.track-info > .side-panel > .button.watch > img {\n\twidth: 36px;\n\theight: 36px;\n}\n.track-info > .side-panel > .button.watch:disabled > img {\n\topacity: 0.3;\n}\n\n.track-info > .side-panel > .button.watch:hover > img, .track-info > .side-panel > .button.play:hover > img {\n\ttransform: translateX(10px);\n}\n.track-info > .side-panel > .button.watch:disabled:hover > img {\n\ttransform: none;\n}\n\n@media (hover: none) {\n\t.track-info > .side-panel > .button.watch:hover > img, .track-info > .side-panel > .button.play:hover > img {\n\t\ttransform: none;\n\t}\n}\n\n.track-info > .side-panel > .back {\n\tmargin: 10px;\n}\n\n.track-info > .side-panel > .leaderboard-button {\n\tmargin: 10px;\n\tfloat: right;\n}\n", ""]);
            const o = s
        }
        ,
        5739: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/quit.svg"
        }
        ,
        5768: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.admin-ui {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tz-index: 2;\n\tmargin: 0;\n\tpadding: 16px;\n\twidth: 100%;\n\theight: 100%;\n\toverflow-y: scroll;\n\tbox-sizing: border-box;\n\tbackground-color: var(--surface-color);\n\tpointer-events: auto;\n}\n\n.admin-ui > .tracks-list {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n}\n\n.admin-ui > .tracks-list > button {\n\tmargin: 4px;\n\twidth: 300px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.admin-ui > .leaderboard-container {\n\twidth: 100%;\n}\n\n.admin-ui > .leaderboard-container > table {\n\ttable-layout: fixed;\n\tborder-collapse: collapse;\n\tcolor: var(--text-color);\n\tfont-size: 26px;\n\twidth: 100%;\n}\n.admin-ui > .leaderboard-container > table > tr > th {\n\tborder-bottom: 2px solid var(--text-color);\n\ttext-align: left;\n}\n\n.admin-ui > .leaderboard-container > table > tr > th:nth-of-type(2) {\n\twidth: 150px;\n}\n\n.admin-ui > .leaderboard-container > table > tr > th:nth-of-type(3) {\n\twidth: 220px;\n}\n\n.admin-ui > .leaderboard-container > table > tr > th:nth-of-type(4) {\n\twidth: 200px;\n}\n\n.admin-ui > .leaderboard-container > table > tr > td {\n\theight: 60px;\n}\n\n.admin-ui > .leaderboard-container > table > tr:nth-of-type(2n + 1) > td {\n\tbackground-color: var(--surface-secondary-color);\n}\n\n.admin-ui > .leaderboard-container > .navigation {\n\tdisplay: flex;\n\tmargin: 8px 0;\n}\n.admin-ui > .leaderboard-container > .navigation > input {\n\tflex-grow: 1;\n\ttext-align: center;\n}", ""]);
            const o = s
        }
        ,
        5769: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/state_pending.svg"
        }
        ,
        5798: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/rotation_axis_y_negative.svg"
        }
        ,
        5811: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.checkpoint {\n\tposition: absolute;\n\tbottom: 0;\n\tleft: var(--safe-area-horizontal);\n\tmargin: 0;\n\tpadding: 8px 10px;\n\tline-height: 0;\n\tfont-size: 40px;\n\tcolor: var(--text-color);\n\ttext-align: left;\n\topacity: 0.9;\n\tclip-path: polygon(0 0, calc(100% - 8px) 0, 100% 100%, 0 100%);\n\tbackground-color: var(--surface-color);\n}\n.checkpoint.up {\n\tposition: absolute;\n\tbottom: auto;\n\ttop: 0;\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n}\n.checkpoint.hidden {\n\tdisplay: none;\n}\n\n\n#ui.has-safe-area-horizontal .checkpoint {\n\tclip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 100%, 0 100%);\n}\n#ui.has-safe-area-horizontal .checkpoint.up {\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 8px 100%);\n}\n\n.checkpoint > div {\n\tmargin: 0;\n\tpadding: 0 16px;\n\tclip-path: polygon(0 0, calc(100% - 6px) 0, 100% 100%, 0 100%);\n\tbackground-color: var(--surface-tertiary-color);\n}\n.checkpoint.up > div {\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);\n}\n\n#ui.has-safe-area-horizontal .checkpoint > div {\n\tclip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 100%, 0 100%);\n}\n#ui.has-safe-area-horizontal .checkpoint.up > div {\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 6px 100%);\n}\n\n.checkpoint > div > img {\n\tmargin: 0 12px 5px 0;\n\tpadding: 0;\n\twidth: 24px;\n\theight: 24px;\n\tvertical-align: middle;\n}\n", ""]);
            const o = s
        }
        ,
        5848: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.color-picker {\n\tmargin: 8px;\n}\n\n.color-picker > .value-saturation-picker {\n\tposition: relative;\n\tmargin: 0 0 8px 0;\n\twidth: 140px;\n\theight: 140px;\n\tbackground-color: #fff;\n\toverflow: hidden;\n}\n\n.color-picker > .value-saturation-picker > .marker {\n\tposition: absolute;\n\twidth: 12px;\n\theight: 12px;\n\tbackground-image: radial-gradient(closest-side, transparent, #000, #fff, #000, transparent);\n}\n\n.color-picker > .hue-picker {\n\tposition: relative;\n\twidth: 140px;\n\theight: 30px;\n\tbackground-image: linear-gradient(to right, \n\t\thsl(0, 100%, 50%),\n\t\thsl(60, 100%, 50%),\n\t\thsl(120, 100%, 50%),\n\t\thsl(180, 100%, 50%),\n\t\thsl(240, 100%, 50%),\n\t\thsl(300, 100%, 50%),\n\t\thsl(0, 100%, 50%)\n\t);\n\toverflow: hidden;\n}\n\n.color-picker > .hue-picker > .marker {\n\tposition: absolute;\n\ttop: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbackground-image: linear-gradient(to right, #000, #fff, #000);\n}\n", ""]);
            const o = s
        }
        ,
        5918: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/load.svg"
        }
        ,
        5959: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.customization {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.customization > .safe-area-left {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\twidth: var(--safe-area-left);\n\theight: 100%;\n\tbackground-color: var(--surface-color);\n}\n\n.customization > .top {\n\tdisplay: block;\n\tmargin: 0;\n\tpadding: 0 0 0 var(--safe-area-left);\n\tbackground-color: var(--surface-color);\n}\n.customization > .top > .button {\n\tdisplay: inline-block;\n\tmargin: 8px 0;\n}\n.customization > .top > .button:first-of-type {\n\tmargin-left: 8px;\n}\n\n.customization > .save-message {\n\tmargin: 10px 10px 10px calc(10px + var(--safe-area-left));\n\tpadding: 0;\n\tposition: absolute;\n\tfont-size: 30px;\n\tcolor: #96ff96;\n\ttext-shadow: 0 0 5px #000;\n\tpointer-events: none;\n\n\tleft: -10px;\n\topacity: 0;\n}\n.customization > .save-message.show {\n\tleft: 0;\n\topacity: 1;\n\ttransition: opacity 0.25s ease-in-out, left 0.25s ease-in-out;\n}\n.customization > .save-message.hide {\n\tleft: 0;\n\topacity: 0;\n\ttransition: opacity 0.25s ease-in-out, left 0.25s ease-in-out;\n}\n\n.customization > .colors {\n\tposition: absolute;\n\tleft: 0;\n\tbottom: 0;\n\twidth: 100%;\n\ttext-align: center;\n\twhite-space: nowrap;\n}\n\n.customization > .colors > div {\n\tdisplay: inline-block;\n\tmargin: 0 10px;\n\tpadding: 0;\n\ttext-align: center;\n\tbackground: var(--surface-color);\n\tpointer-events: auto;\n}\n.customization > .colors > div > h2 {\n\tmargin: 0;\n\tpadding: 2px;\n\tfont-size: 26px;\n\tfont-weight: normal;\n\tbackground-color: var(--surface-secondary-color);\n\tcolor: var(--text-color);\n}\n.customization > .colors > div > input {\n\tmargin: 8px 8px 0 8px;\n\twidth: calc(140px - 8px * 2);\n\tfont-weight: normal;\n\tclip-path: none;\n\ttext-align: center;\n}\n", ""]);
            const o = s
        }
        ,
        6027: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/pin.svg"
        }
        ,
        6057: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.editor {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.editor > .safe-area-left {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\twidth: var(--safe-area-left);\n\theight: 100%;\n\tbackground-color: var(--surface-color);\n}\n\n.editor > .safe-area-right {\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\twidth: var(--safe-area-right);\n\theight: 100%;\n\tbackground-color: var(--surface-color);\n}\n\n.editor > .top {\n\tdisplay: block;\n\tmargin: 0;\n\tpadding: 0 var(--safe-area-right) 0 var(--safe-area-left);\n}\n\n.editor > .top > .button-bar {\n\tdisplay: flex;\n\tmargin: 0;\n\tpadding: 0 8px;\n\theight: 68px;\n\tbackground-color: var(--surface-color);\n\twhite-space: nowrap;\n}\n.editor > .top > .button-bar > .button {\n\tmargin: 8px 0;\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.editor > .top > .track-settings-container {\n\tdisplay: inline-block;\n\tmargin: 0;\n\tpadding: 6px 7px;\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);\n\tfont-size: 30px;\n\tcolor: var(--text-color);\n\tbackground: var(--surface-secondary-color);\n}\n.editor > .top > .track-settings-container > button {\n\ttext-align: left;\n\tmin-width: 150px;\n\tmax-width: 450px;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n\n.editor > .side {\n\tposition: absolute;\n\ttop: 68px;\n\tright: 0;\n\tmargin: 0;\n\tpadding: 0 var(--safe-area-right) 0 0;\n\theight: calc(100% - 68px);\n\tdisplay: flex;\n\talign-items: end;\n}\n\n.editor > .side > .container {\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tjustify-content: space-between;\n\talign-items: end;\n}\n\n.editor > .side > .container > .undo-container {\n\tmargin: 0;\n\tpadding: 6px 7px;\n\tclip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%);\n\tfont-size: 30px;\n\tcolor: var(--text-color);\n\tbackground: var(--surface-secondary-color);\n}\n\n.editor > .side > .container > .undo-container > button:first-of-type {\n\tmargin-right: 3px;\n\tclip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%);\n}\n.editor > .side > .container > .undo-container > button:last-of-type {\n\tmargin-left: 3px;\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n}\n\n.editor > .side > .side-panel {\n\theight: 100%;\n\tbackground-color: var(--surface-secondary-color);\n\tpointer-events: auto;\n}\n\n.editor > .side > .side-panel > .category-panel, .editor > .side > .side-panel > .part-panel, .editor > .side > .side-panel > .color-panel {\n\tdisplay: inline-block;\n\tvertical-align: top;\n\tpadding: 2px 2px 0 2px;\n\theight: 100%;\n\tbox-sizing: border-box;\n\toverflow-x: hidden;\n\toverflow-y: scroll;\n\tscrollbar-width: thin;\n}\n.editor > .side > .side-panel > .category-panel > button > img {\n\twidth: 96px;\n\theight: 96px;\n}\n.editor > .side > .side-panel > .part-panel.hidden {\n\tdisplay: none;\n}\n.editor > .side > .side-panel > .color-panel.hidden {\n\tdisplay: none;\n}\n\n.editor > .side > .side-panel button {\n\tdisplay: block;\n\tmargin: 0 0 2px 0;\n\tpadding: 5px;\n\tbackground-color: var(--button-color);\n\tborder: 2px solid rgb(38, 31, 88);\n\tcursor: pointer;\n}\n.editor > .side > .side-panel button:hover {\n\tbackground-color: var(--button-hover-color);\n}\n@media (hover: none) {\n\t.editor > .side > .side-panel button:hover {\n\t\tbackground-color: var(--button-color);\n\t}\n}\n.editor > .side > .side-panel button:active {\n\tbackground-color: var(--button-active-color);\n}\n.editor > .side > .side-panel button.selected {\n\tbackground-color: var(--button-hover-color);\n\tbox-shadow: inset 0 0 5px #fff;\n\tborder: 2px solid #fff;\n}\n.editor > .side > .side-panel button > img {\n\tdisplay: block;\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 64px;\n\theight: 64px;\n\t-webkit-filter: drop-shadow(0 0 2px #000);\n\tfilter: drop-shadow(0 0 2px #000);\n\tpointer-events: none;\n\ttransition: opacity 0.25s ease-out;\n}\n.editor > .side > .side-panel button > img.loading {\n\topacity: 0;\n\ttransition: none;\n}\n\n.editor > .message {\n\tmargin: 10px 10px 10px calc(10px + var(--safe-area-left));\n\tpadding: 0;\n\tposition: absolute;\n\tfont-size: 30px;\n\tcolor: #ff9696;\n\ttext-shadow: 0 0 5px #000;\n\tpointer-events: none;\n\n\tleft: -10px;\n\topacity: 0;\n}\n.editor > .message.green {\n\tcolor: #96ff96;\n}\n.editor > .message.show {\n\tleft: 0;\n\topacity: 1;\n\ttransition: opacity 0.25s ease-in-out, left 0.25s ease-in-out;\n}\n.editor > .message.hide {\n\tleft: 0;\n\topacity: 0;\n\ttransition: opacity 0.25s ease-in-out, left 0.25s ease-in-out;\n}\n", ""]);
            const o = s
        }
        ,
        6099: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/arrow_left.svg"
        }
        ,
        6150: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/arrow_right.svg"
        }
        ,
        6168: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/export.svg"
        }
        ,
        6244: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/state_verified.svg"
        }
        ,
        6314: e => {
            "use strict";
            e.exports = function(e) {
                var t = [];
                return t.toString = function() {
                    return this.map((function(t) {
                        var n = ""
                          , i = void 0 !== t[5];
                        return t[4] && (n += "@supports (".concat(t[4], ") {")),
                        t[2] && (n += "@media ".concat(t[2], " {")),
                        i && (n += "@layer".concat(t[5].length > 0 ? " ".concat(t[5]) : "", " {")),
                        n += e(t),
                        i && (n += "}"),
                        t[2] && (n += "}"),
                        t[4] && (n += "}"),
                        n
                    }
                    )).join("")
                }
                ,
                t.i = function(e, n, i, r, a) {
                    "string" == typeof e && (e = [[null, e, void 0]]);
                    var s = {};
                    if (i)
                        for (var o = 0; o < this.length; o++) {
                            var l = this[o][0];
                            null != l && (s[l] = !0)
                        }
                    for (var c = 0; c < e.length; c++) {
                        var h = [].concat(e[c]);
                        i && s[h[0]] || (void 0 !== a && (void 0 === h[5] || (h[1] = "@layer".concat(h[5].length > 0 ? " ".concat(h[5]) : "", " {").concat(h[1], "}")),
                        h[5] = a),
                        n && (h[2] ? (h[1] = "@media ".concat(h[2], " {").concat(h[1], "}"),
                        h[2] = n) : h[2] = n),
                        r && (h[4] ? (h[1] = "@supports (".concat(h[4], ") {").concat(h[1], "}"),
                        h[4] = r) : h[4] = "".concat(r)),
                        t.push(h))
                    }
                }
                ,
                t
            }
        }
        ,
        6366: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/apply.svg"
        }
        ,
        6474: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.nickname {\n\tposition: absolute;\n\tleft: calc(50% - 500px / 2);\n\ttop: 40%;\n\tz-index: 2;\n\tmargin: 0;\n\tpadding: 16px;\n\twidth: 500px;\n\tbox-sizing: border-box;\n\tbackground-color: var(--surface-color);\n}\n\n.nickname > h1 {\n\tmargin: 0 4px 0 4px;\n\tpadding: 0;\n\tfont-size: 35px;\n\tfont-weight: normal;\n\tcolor: var(--text-color);\n}\n\n.nickname > input[type=text] {\n\tdisplay: block;\n\tmargin: 0;\n\tpadding: 0.25em;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tfont-size: 36px;\n\tfont-weight: normal;\n}\n\n.nickname > p {\n\tmargin: 16px 4px 0 4px;\n\tpadding: 0;\n\tfont-size: 20px;\n\tcolor: var(--text-color);\n}\n\n.nickname > button {\n\tdisplay: inline-block;\n\tmargin: 16px 0 0 0;\n}\n.nickname > button:last-of-type {\n\tfloat: right;\n}\n\n.nickname > button.delete {\n\tposition: absolute;\n\tright: 8px;\n\ttop: 0;\n\tfont-size: 16px;\n\tpadding: 8px 16px;\n}\n\n.nickname > button.delete > img.button-icon {\n\tmargin: -5px 0 -2px -3px;\n\twidth: 16px;\n\theight: 16px;\n}\n\ndiv.nickname-admin-button-container {\n\tposition: absolute;\n\tleft: 0;\n\tbottom: 22px;\n\tmargin: 0 4px;\n}\n\n.nickname-user-token {\n\tposition: absolute;\n\tleft: 0;\n\tbottom: 0;\n\tmargin: 0 4px;\n\ttext-align: left;\n\tfont-size: 18px;\n\topacity: 0.5;\n\tcolor: var(--text-color);\n\tpointer-events: all;\n\t-webkit-user-select: all;\n\t-moz-user-select: all;\n\t-ms-user-select: all;\n\tuser-select: all;\n}\n", ""]);
            const o = s
        }
        ,
        6546: (e, t, n) => {
            "use strict";
            /*! Capacitor: https://capacitorjs.com/ - MIT License */
            var i;
            n.d(t, {
                E_: () => l,
                F3: () => o
            }),
            function(e) {
                e.Unimplemented = "UNIMPLEMENTED",
                e.Unavailable = "UNAVAILABLE"
            }(i || (i = {}));
            class r extends Error {
                constructor(e, t, n) {
                    super(e),
                    this.message = e,
                    this.code = t,
                    this.data = n
                }
            }
            const a = e => {
                const t = e.CapacitorCustomPlatform || null
                  , n = e.Capacitor || {}
                  , a = n.Plugins = n.Plugins || {}
                  , s = () => null !== t ? t.name : (e => {
                    var t, n;
                    return (null == e ? void 0 : e.androidBridge) ? "android" : (null === (n = null === (t = null == e ? void 0 : e.webkit) || void 0 === t ? void 0 : t.messageHandlers) || void 0 === n ? void 0 : n.bridge) ? "ios" : "web"
                }
                )(e)
                  , o = e => {
                    var t;
                    return null === (t = n.PluginHeaders) || void 0 === t ? void 0 : t.find((t => t.name === e))
                }
                  , l = new Map;
                return n.convertFileSrc || (n.convertFileSrc = e => e),
                n.getPlatform = s,
                n.handleError = t => e.console.error(t),
                n.isNativePlatform = () => "web" !== s(),
                n.isPluginAvailable = e => {
                    const t = l.get(e);
                    return !!(null == t ? void 0 : t.platforms.has(s())) || !!o(e)
                }
                ,
                n.registerPlugin = (e, c={}) => {
                    const h = l.get(e);
                    if (h)
                        return console.warn(`Capacitor plugin "${e}" already registered. Cannot register plugins twice.`),
                        h.proxy;
                    const d = s()
                      , u = o(e);
                    let p;
                    const f = a => {
                        let s;
                        const o = (...o) => {
                            const l = (async () => (!p && d in c ? p = p = "function" == typeof c[d] ? await c[d]() : c[d] : null !== t && !p && "web"in c && (p = p = "function" == typeof c.web ? await c.web() : c.web),
                            p))().then((t => {
                                const l = ( (t, a) => {
                                    var s, o;
                                    if (!u) {
                                        if (t)
                                            return null === (o = t[a]) || void 0 === o ? void 0 : o.bind(t);
                                        throw new r(`"${e}" plugin is not implemented on ${d}`,i.Unimplemented)
                                    }
                                    {
                                        const i = null == u ? void 0 : u.methods.find((e => a === e.name));
                                        if (i)
                                            return "promise" === i.rtype ? t => n.nativePromise(e, a.toString(), t) : (t, i) => n.nativeCallback(e, a.toString(), t, i);
                                        if (t)
                                            return null === (s = t[a]) || void 0 === s ? void 0 : s.bind(t)
                                    }
                                }
                                )(t, a);
                                if (l) {
                                    const e = l(...o);
                                    return s = null == e ? void 0 : e.remove,
                                    e
                                }
                                throw new r(`"${e}.${a}()" is not implemented on ${d}`,i.Unimplemented)
                            }
                            ));
                            return "addListener" === a && (l.remove = async () => s()),
                            l
                        }
                        ;
                        return o.toString = () => `${a.toString()}() { [capacitor code] }`,
                        Object.defineProperty(o, "name", {
                            value: a,
                            writable: !1,
                            configurable: !1
                        }),
                        o
                    }
                      , m = f("addListener")
                      , g = f("removeListener")
                      , v = (e, t) => {
                        const n = m({
                            eventName: e
                        }, t)
                          , i = async () => {
                            const i = await n;
                            g({
                                eventName: e,
                                callbackId: i
                            }, t)
                        }
                          , r = new Promise((e => n.then(( () => e({
                            remove: i
                        })))));
                        return r.remove = async () => {
                            console.warn("Using addListener() without 'await' is deprecated."),
                            await i()
                        }
                        ,
                        r
                    }
                      , w = new Proxy({},{
                        get(e, t) {
                            switch (t) {
                            case "$$typeof":
                                return;
                            case "toJSON":
                                return () => ({});
                            case "addListener":
                                return u ? v : m;
                            case "removeListener":
                                return g;
                            default:
                                return f(t)
                            }
                        }
                    });
                    return a[e] = w,
                    l.set(e, {
                        name: e,
                        proxy: w,
                        platforms: new Set([...Object.keys(c), ...u ? [d] : []])
                    }),
                    w
                }
                ,
                n.Exception = r,
                n.DEBUG = !!n.DEBUG,
                n.isLoggingEnabled = !!n.isLoggingEnabled,
                n
            }
              , s = (e => e.Capacitor = a(e))("undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== n.g ? n.g : {})
              , o = s.registerPlugin;
            class l {
                constructor() {
                    this.listeners = {},
                    this.retainedEventArguments = {},
                    this.windowListeners = {}
                }
                addListener(e, t) {
                    let n = !1;
                    this.listeners[e] || (this.listeners[e] = [],
                    n = !0),
                    this.listeners[e].push(t);
                    const i = this.windowListeners[e];
                    i && !i.registered && this.addWindowListener(i),
                    n && this.sendRetainedArgumentsForEvent(e);
                    return Promise.resolve({
                        remove: async () => this.removeListener(e, t)
                    })
                }
                async removeAllListeners() {
                    this.listeners = {};
                    for (const e in this.windowListeners)
                        this.removeWindowListener(this.windowListeners[e]);
                    this.windowListeners = {}
                }
                notifyListeners(e, t, n) {
                    const i = this.listeners[e];
                    if (i)
                        i.forEach((e => e(t)));
                    else if (n) {
                        let n = this.retainedEventArguments[e];
                        n || (n = []),
                        n.push(t),
                        this.retainedEventArguments[e] = n
                    }
                }
                hasListeners(e) {
                    return !!this.listeners[e].length
                }
                registerWindowListener(e, t) {
                    this.windowListeners[t] = {
                        registered: !1,
                        windowEventName: e,
                        pluginEventName: t,
                        handler: e => {
                            this.notifyListeners(t, e)
                        }
                    }
                }
                unimplemented(e="not implemented") {
                    return new s.Exception(e,i.Unimplemented)
                }
                unavailable(e="not available") {
                    return new s.Exception(e,i.Unavailable)
                }
                async removeListener(e, t) {
                    const n = this.listeners[e];
                    if (!n)
                        return;
                    const i = n.indexOf(t);
                    this.listeners[e].splice(i, 1),
                    this.listeners[e].length || this.removeWindowListener(this.windowListeners[e])
                }
                addWindowListener(e) {
                    window.addEventListener(e.windowEventName, e.handler),
                    e.registered = !0
                }
                removeWindowListener(e) {
                    e && (window.removeEventListener(e.windowEventName, e.handler),
                    e.registered = !1)
                }
                sendRetainedArgumentsForEvent(e) {
                    const t = this.retainedEventArguments[e];
                    t && (delete this.retainedEventArguments[e],
                    t.forEach((t => {
                        this.notifyListeners(e, t)
                    }
                    )))
                }
            }
            const c = e => encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape)
              , h = e => e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
            class d extends l {
                async getCookies() {
                    const e = document.cookie
                      , t = {};
                    return e.split(";").forEach((e => {
                        if (e.length <= 0)
                            return;
                        let[n,i] = e.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
                        n = h(n).trim(),
                        i = h(i).trim(),
                        t[n] = i
                    }
                    )),
                    t
                }
                async setCookie(e) {
                    try {
                        const t = c(e.key)
                          , n = c(e.value)
                          , i = `; expires=${(e.expires || "").replace("expires=", "")}`
                          , r = (e.path || "/").replace("path=", "")
                          , a = null != e.url && e.url.length > 0 ? `domain=${e.url}` : "";
                        document.cookie = `${t}=${n || ""}${i}; path=${r}; ${a};`
                    } catch (e) {
                        return Promise.reject(e)
                    }
                }
                async deleteCookie(e) {
                    try {
                        document.cookie = `${e.key}=; Max-Age=0`
                    } catch (e) {
                        return Promise.reject(e)
                    }
                }
                async clearCookies() {
                    try {
                        const e = document.cookie.split(";") || [];
                        for (const t of e)
                            document.cookie = t.replace(/^ +/, "").replace(/=.*/, `=;expires=${(new Date).toUTCString()};path=/`)
                    } catch (e) {
                        return Promise.reject(e)
                    }
                }
                async clearAllCookies() {
                    try {
                        await this.clearCookies()
                    } catch (e) {
                        return Promise.reject(e)
                    }
                }
            }
            o("CapacitorCookies", {
                web: () => new d
            });
            const u = (e, t={}) => {
                const n = Object.assign({
                    method: e.method || "GET",
                    headers: e.headers
                }, t)
                  , i = ( (e={}) => {
                    const t = Object.keys(e);
                    return Object.keys(e).map((e => e.toLocaleLowerCase())).reduce(( (n, i, r) => (n[i] = e[t[r]],
                    n)), {})
                }
                )(e.headers)["content-type"] || "";
                if ("string" == typeof e.data)
                    n.body = e.data;
                else if (i.includes("application/x-www-form-urlencoded")) {
                    const t = new URLSearchParams;
                    for (const [n,i] of Object.entries(e.data || {}))
                        t.set(n, i);
                    n.body = t.toString()
                } else if (i.includes("multipart/form-data") || e.data instanceof FormData) {
                    const t = new FormData;
                    if (e.data instanceof FormData)
                        e.data.forEach(( (e, n) => {
                            t.append(n, e)
                        }
                        ));
                    else
                        for (const n of Object.keys(e.data))
                            t.append(n, e.data[n]);
                    n.body = t;
                    const i = new Headers(n.headers);
                    i.delete("content-type"),
                    n.headers = i
                } else
                    (i.includes("application/json") || "object" == typeof e.data) && (n.body = JSON.stringify(e.data));
                return n
            }
            ;
            class p extends l {
                async request(e) {
                    const t = u(e, e.webFetchExtra)
                      , n = ( (e, t=!0) => e ? Object.entries(e).reduce(( (e, n) => {
                        const [i,r] = n;
                        let a, s;
                        return Array.isArray(r) ? (s = "",
                        r.forEach((e => {
                            a = t ? encodeURIComponent(e) : e,
                            s += `${i}=${a}&`
                        }
                        )),
                        s.slice(0, -1)) : (a = t ? encodeURIComponent(r) : r,
                        s = `${i}=${a}`),
                        `${e}&${s}`
                    }
                    ), "").substr(1) : null)(e.params, e.shouldEncodeUrlParams)
                      , i = n ? `${e.url}?${n}` : e.url
                      , r = await fetch(i, t)
                      , a = r.headers.get("content-type") || "";
                    let s, o, {responseType: l="text"} = r.ok ? e : {};
                    switch (a.includes("application/json") && (l = "json"),
                    l) {
                    case "arraybuffer":
                    case "blob":
                        o = await r.blob(),
                        s = await (async e => new Promise(( (t, n) => {
                            const i = new FileReader;
                            i.onload = () => {
                                const e = i.result;
                                t(e.indexOf(",") >= 0 ? e.split(",")[1] : e)
                            }
                            ,
                            i.onerror = e => n(e),
                            i.readAsDataURL(e)
                        }
                        )))(o);
                        break;
                    case "json":
                        s = await r.json();
                        break;
                    default:
                        s = await r.text()
                    }
                    const c = {};
                    return r.headers.forEach(( (e, t) => {
                        c[t] = e
                    }
                    )),
                    {
                        data: s,
                        headers: c,
                        status: r.status,
                        url: r.url
                    }
                }
                async get(e) {
                    return this.request(Object.assign(Object.assign({}, e), {
                        method: "GET"
                    }))
                }
                async post(e) {
                    return this.request(Object.assign(Object.assign({}, e), {
                        method: "POST"
                    }))
                }
                async put(e) {
                    return this.request(Object.assign(Object.assign({}, e), {
                        method: "PUT"
                    }))
                }
                async patch(e) {
                    return this.request(Object.assign(Object.assign({}, e), {
                        method: "PATCH"
                    }))
                }
                async delete(e) {
                    return this.request(Object.assign(Object.assign({}, e), {
                        method: "DELETE"
                    }))
                }
            }
            o("CapacitorHttp", {
                web: () => new p
            })
        }
        ,
        6657: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.leaderboard {\n\tposition: relative;\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 600px;\n\theight: 100%;\n\ttext-align: left;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\tflex-direction: column;\n\tbackground-color: var(--surface-color);\n}\n\n.leaderboard > h2 {\n\tmargin: 10px 10px 0 10px;\n\tpadding: 0;\n\tfont-weight: normal;\n\tfont-size: 38px;\n\ttext-align: center;\n\tcolor: var(--text-color);\n}\n\n.leaderboard > h3 {\n\tmargin: 0 10px 10px 10px;\n\tpadding: 0;\n\tfont-weight: normal;\n\tfont-size: 18px;\n\ttext-align: center;\n\tcolor: var(--text-color);\n\topacity: 0.5;\n}\n\n.leaderboard > .total-players {\n\tmargin: 10px;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\ttext-align: center;\n\tfont-size: 14px;\n\tcolor: var(--text-color);\n\topacity: 0;\n\ttransition: opacity 0.5s ease-out;\n}\n.leaderboard > .total-players.fade-in {\n\topacity: 0.5;\n}\n\n.leaderboard > .container {\n\tmargin: 0;\n\tpadding: 0;\n\tflex-grow: 1;\n\tbackground-color: var(--surface-secondary-color);\n\toverflow-x: hidden;\n\toverflow-y: scroll;\n\tpointer-events: auto;\n}\n\n.leaderboard > .container > .loading-spinner-container {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.leaderboard > .container > .error-message {\n\tpadding: 0 20px;\n\tfont-size: 20px;\n\ttext-align: center;\n\tcolor: var(--text-color);\n}\n\n.leaderboard > .container > button.main {\n\tmargin: 10px 10px 0 10px;\n\tpadding: 0;\n\tvertical-align: top;\n\twidth: calc(100% - 10px * 2);\n\theight: 100px;\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n\ttext-align: left;\n\twhite-space: nowrap;\n}\n.leaderboard > .container > button.main:last-of-type {\n\tmargin-bottom: 10px;\n}\n\n.leaderboard > .container > button.main.self:not(:focus-visible) {\n\tbackground-color: #2e4182;\n}\n\n.leaderboard > .container > button.main.selected {\n\tbackground-color: var(--button-hover-color);\n}\n.leaderboard > .container > button.main.selected::after {\n\twidth: 100%;\n}\n\n.leaderboard > .container > button.main > .checkmark {\n\tdisplay: none;\n}\n\n.leaderboard > .container > button.main.selected > .checkmark {\n\tdisplay: block;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\tmargin: 6px;\n\twidth: 12px;\n\tanimation: leaderboard-checkmark-spawn 0.15s ease-out;\n}\n\n@keyframes leaderboard-checkmark-spawn {\n\t0% {\n\t\ttransform: scale(0);\n\t}\n\t90% {\n\t\ttransform: scale(1.2);\n\t}\n\t100% {\n\t\ttransform: scale(1);\n\t}\n}\n\n.leaderboard > .container > button.main > .image-container {\n\tdisplay: inline-block;\n\tposition: relative;\n\tbackground-color: rgba(0, 0, 0, 0.1);\n\twidth: 100px;\n\theight: 100px;\n}\n\n.leaderboard > .container > button.main > .image-container > img {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\twidth: 100%;\n\theight: 100%;\n\tpointer-events: none;\n\topacity: 0;\n\ttransition: opacity 0.5s ease-out;\n}\n.leaderboard > .container > button.main > .image-container > img.show {\n\topacity: 1;\n}\n\n.leaderboard > .container > button.main > .left, .leaderboard > .container > button.main > .right {\n\tdisplay: inline-block;\n\tvertical-align: top;\n}\n\n.leaderboard > .container > button.main > div > p {\n\tmargin: 0;\n\tpadding: 12px;\n\tfont-size: 28px;\n\tcolor: var(--text-color);\n}\n\n.leaderboard > .container > button.main > div > .position > span {\n\tfont-size: 20px;\n\topacity: 0.3;\n}\n\n.leaderboard > .container > button.main > div > .name-container {\n\tmargin: 0;\n\tpadding: 0;\n\tfont-size: 28px;\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 360px;\n}\n\n.leaderboard > .container > button.main > div > .name-container > .name {\n\tpadding: 12px;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n}\n.leaderboard > .container > button.main:focus-visible > div > .name-container > .name {\n\ttext-decoration: underline;\n}\n\n.leaderboard > .container > button.main > div > .name-container > .self {\n\tmargin-left: -16px;\n\tpadding: 12px;\n\topacity: 0.5;\n\tfont-size: 16px;\n\tfont-style: normal;\n}\n\n\n\n.leaderboard > .button-wrapper > .back {\n\tmargin: 10px;\n}\n\n\n\n.leaderboard > .button-wrapper > .icon-button {\n\tmargin: 10px 0;\n\tfloat: right;\n}\n.leaderboard > .button-wrapper > .icon-button.first {\n\tmargin: 10px 10px 10px 0;\n}\n\n.leaderboard > .button-wrapper > .icon-button > img {\n\twidth: 28px;\n}\n.leaderboard > .button-wrapper > .icon-button.disabled > img, .leaderboard > .button-wrapper > .icon-button:disabled > img {\n\topacity: 0.25;\n}\n", ""]);
            const o = s
        }
        ,
        6838: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/smoke.png"
        }
        ,
        7173: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/windowed.svg"
        }
        ,
        7268: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/trophy.svg"
        }
        ,
        7404: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/car_thumbnail_placeholder.png"
        }
        ,
        7479: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.timer {\n\tposition: absolute;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\ttext-align: center;\n\topacity: 0.9;\n}\n.timer.up {\n\tbottom: auto;\n\ttop: 0;\n}\n.timer.hidden {\n\tdisplay: none;\n}\n\n.timer > div {\n\tmargin: 0;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\tflex-direction: column;\n\twidth: 240px;\n\tvertical-align: bottom;\n}\n.timer.up > div {\n\tflex-direction: column-reverse;\n\tvertical-align: top;\n}\n.timer > div > .title-container {\n\tposition: relative;\n\tmargin: 0 auto;\n\twidth: 220px;\n\theight: 32px;\n}\n.timer > div > .title-container > h2 {\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tcolor: var(--text-color);\n\tfont-size: 26px;\n\tfont-weight: normal;\n\ttext-shadow: 1px 1px 1px var(--surface-color), -1px 1px 1px var(--surface-color), -1px -1px 1px var(--surface-color), 1px -1px 1px var(--surface-color);\n}\n.timer:not(.up) > div > .title-container > .title {\n\tmargin-top: 8px;\n}\n.timer > div > .title-container > .checkpoint-time {\n\topacity: 0;\n\tfont-size: 32px;\n}\n.timer > div > .title-container > .checkpoint-time.green {\n\tcolor: #5f5;\n}\n.timer > div > .title-container > .checkpoint-time.red {\n\tcolor: #f55;\n}\n\n.timer > div > .time {\n\tmargin: 0;\n\tpadding: 0;\n\tbackground-color: var(--surface-color);\n}\n.timer > .left > .time {\n\tpadding: 8px 4px 8px 10px;\n\tclip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%);\n}\n.timer.up > .left > .time {\n\tclip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%);\n}\n.timer > .center > .time {\n\tposition: relative;\n\tz-index: 1;\n\tmargin: 0 -12px;\n\tpadding: 8px 10px;\n\tclip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 100%, 0 100%);\n}\n.timer.up > .center > .time {\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 8px 100%);\n}\n.timer > .right > .time {\n\tpadding: 8px 10px 8px 4px;\n\tclip-path: polygon(0 0, calc(100% - 8px) 0, 100% 100%, 0 100%);\n}\n.timer.up > .right > .time {\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n}\n\n.timer > div > .time > p {\n\tmargin: 0;\n\tpadding: 0;\n\tbackground-color: var(--surface-tertiary-color);\n\tcolor: var(--text-color);\n\tfont-size: 34px;\n}\n.timer > .left > .time > p {\n\tclip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%);\n}\n.timer.up > .left > .time > p {\n\tclip-path: polygon(0 0, 100% 0, 100% 100%, 6px 100%);\n}\n.timer > .center > .time > p {\n\tfont-size: 46px;\n\tclip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 100%, 0 100%);\n}\n.timer.up > .center > .time > p {\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 6px 100%);\n}\n.timer > .right > .time > p {\n\tclip-path: polygon(0 0, calc(100% - 6px) 0, 100% 100%, 0 100%);\n}\n.timer.up > .right > .time > p {\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);\n}\n\n.timer > div > .time > p.green {\n\tcolor: #5f5;\n}\n.timer > div > .time > p.red {\n\tcolor:#f55;\n}\n\n.timer > div > .time > p > span {\n\tdisplay: inline-block;\n\twidth: 0.5em;\n\ttext-align: center;\n}\n.timer > div > .time > p > span.sign {\n\tmargin-left: -4px;\n\twidth: 0.7em;\n}\n", ""]);
            const o = s
        }
        ,
        7581: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/fullscreen.svg"
        }
        ,
        7659: e => {
            "use strict";
            var t = {};
            e.exports = function(e, n) {
                var i = function(e) {
                    if (void 0 === t[e]) {
                        var n = document.querySelector(e);
                        if (window.HTMLIFrameElement && n instanceof window.HTMLIFrameElement)
                            try {
                                n = n.contentDocument.head
                            } catch (e) {
                                n = null
                            }
                        t[e] = n
                    }
                    return t[e]
                }(e);
                if (!i)
                    throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
                i.appendChild(n)
            }
        }
        ,
        7687: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.track-export > .background {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tz-index: 1;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(20, 20, 30, 0.5);\n\tpointer-events: auto;\n}\n\n.track-export > .box {\n\tposition: absolute;\n\tleft: calc(50% - 80% / 2);\n\ttop: 0;\n\tz-index: 2;\n\tmargin: 0;\n\tpadding: 10px;\n\tbox-sizing: border-box;\n\twidth: 80%;\n\theight: 100%;\n\tbackground-color: var(--surface-color);\n}\n\n.track-export > .box > .bar {\n\ttext-align: left;\n\tpointer-events: auto;\n}\n.track-export > .box > .bar > .button.right {\n\tfloat: right;\n}\n\n.track-export > .box > textarea {\n\tmargin: 10px 0 0 0;\n\tpadding: 10px;\n\tbox-sizing: border-box;\n\tmin-width: 100%;\n\tmax-width: 100%;\n\tmin-height: calc(100% - 52px - 10px);\n\tmax-height: calc(100% - 52px - 10px);\n\tpointer-events: auto;\n\tbackground-color: var(--surface-tertiary-color);\n\tborder: none;\n\tresize: none;\n\tcolor: var(--text-color);\n\tword-break: break-all;\n\tfont-size: 20px;\n}\n.track-export > .box > textarea:focus-visible {\n\toutline: none;\n}\n", ""]);
            const o = s
        }
        ,
        7780: (e, t, n) => {
            var i = {
                "./apply.svg": 6366,
                "./arrow_down.svg": 516,
                "./arrow_left.svg": 6099,
                "./arrow_right.svg": 6150,
                "./arrow_up.svg": 2207,
                "./back.svg": 8787,
                "./cancel.svg": 1784,
                "./car_stripe.svg": 2344,
                "./car_thumbnail_placeholder.png": 7404,
                "./checkmark.svg": 9809,
                "./checkpoint.svg": 5148,
                "./clouds.jpg": 8875,
                "./community_tracks.jpg": 8115,
                "./copy.svg": 1925,
                "./custom_tracks.jpg": 2709,
                "./customize.svg": 9027,
                "./delete.svg": 2319,
                "./desert.svg": 1705,
                "./desert_colored.svg": 1758,
                "./discord.svg": 858,
                "./editor.svg": 8889,
                "./empty.svg": 493,
                "./erase.svg": 1936,
                "./export.svg": 6168,
                "./fullscreen.svg": 7581,
                "./grid_large.svg": 3518,
                "./grid_small.svg": 4930,
                "./helmet.svg": 1333,
                "./help.svg": 5031,
                "./icon.svg": 853,
                "./import.svg": 9077,
                "./load.svg": 5918,
                "./logo.svg": 8903,
                "./official_tracks.jpg": 9391,
                "./overlapping_disabled.svg": 8358,
                "./overlapping_enabled.svg": 2493,
                "./pause.svg": 9708,
                "./pending.svg": 3223,
                "./pin.svg": 6027,
                "./play.svg": 9236,
                "./preview.svg": 9570,
                "./quit.svg": 5739,
                "./random.svg": 2175,
                "./redo.svg": 4942,
                "./reset.svg": 1719,
                "./reset_settings.svg": 4593,
                "./rotate.svg": 4563,
                "./rotation_axis_x_negative.svg": 5001,
                "./rotation_axis_x_positive.svg": 77,
                "./rotation_axis_y_negative.svg": 5798,
                "./rotation_axis_y_positive.svg": 9062,
                "./rotation_axis_z_negative.svg": 3895,
                "./rotation_axis_z_positive.svg": 4411,
                "./save.svg": 4309,
                "./search.svg": 8718,
                "./settings.svg": 8237,
                "./share.svg": 3755,
                "./smoke.png": 6838,
                "./state_invalid.svg": 2553,
                "./state_pending.svg": 5769,
                "./state_verified.svg": 6244,
                "./summer.svg": 3901,
                "./test.svg": 1734,
                "./timer.svg": 3849,
                "./trophy.svg": 7268,
                "./undo.svg": 3144,
                "./verified.svg": 3902,
                "./windowed.svg": 7173,
                "./winter.svg": 813,
                "./winter_colored.svg": 5010
            };
            function r(e) {
                var t = a(e);
                return n(t)
            }
            function a(e) {
                if (!n.o(i, e)) {
                    var t = new Error("Cannot find module '" + e + "'");
                    throw t.code = "MODULE_NOT_FOUND",
                    t
                }
                return i[e]
            }
            r.keys = function() {
                return Object.keys(i)
            }
            ,
            r.resolve = a,
            e.exports = r,
            r.id = 7780
        }
        ,
        7818: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.user-export {\n\tposition: absolute;\n\tleft: calc(50% - 500px / 2);\n\ttop: 35%;\n\tz-index: 2;\n\tmargin: 0;\n\tpadding: 10px;\n\tbox-sizing: border-box;\n\twidth: 500px;\n\theight: 150px;\n\tbackground-color: var(--surface-color);\n}\n\n.user-export > textarea {\n\tmargin: 0;\n\tpadding: 10px;\n\tbox-sizing: border-box;\n\tmin-width: 100%;\n\tmax-width: 100%;\n\tmin-height: calc(100% - 52px - 10px);\n\tmax-height: calc(100% - 52px - 10px);\n\tpointer-events: auto;\n\tbackground-color: var(--surface-tertiary-color);\n\tborder: none;\n\tresize: none;\n\tcolor: var(--text-color);\n\tword-break: break-all;\n\tfont-size: 20px;\n}\n.user-export > textarea:focus-visible {\n\toutline: none;\n}\n\n.user-export > .bar {\n\tmargin: 8px 0 0 0;\n}\n\n.user-export > .bar > .button.right {\n\tfloat: right;\n}\n", ""]);
            const o = s
        }
        ,
        7825: e => {
            "use strict";
            e.exports = function(e) {
                if ("undefined" == typeof document)
                    return {
                        update: function() {},
                        remove: function() {}
                    };
                var t = e.insertStyleElement(e);
                return {
                    update: function(n) {
                        !function(e, t, n) {
                            var i = "";
                            n.supports && (i += "@supports (".concat(n.supports, ") {")),
                            n.media && (i += "@media ".concat(n.media, " {"));
                            var r = void 0 !== n.layer;
                            r && (i += "@layer".concat(n.layer.length > 0 ? " ".concat(n.layer) : "", " {")),
                            i += n.css,
                            r && (i += "}"),
                            n.media && (i += "}"),
                            n.supports && (i += "}");
                            var a = n.sourceMap;
                            a && "undefined" != typeof btoa && (i += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a)))), " */")),
                            t.styleTagTransform(i, e, t.options)
                        }(t, e, n)
                    },
                    remove: function() {
                        !function(e) {
                            if (null === e.parentNode)
                                return !1;
                            e.parentNode.removeChild(e)
                        }(t)
                    }
                }
            }
        }
        ,
        8115: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/community_tracks.jpg"
        }
        ,
        8229: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.hint {\n\tpadding: 0 280px;\n\tposition: absolute;\n\tleft: 0;\n\ttop: 150px;\n\twidth: 100%;\n\tbox-sizing: border-box;\n\ttext-align: center;\n\tcolor: #fff;\n\ttext-shadow: 0 0 5px #000;\n\tpointer-events: none;\n\topacity: 0;\n}\n.hint.show {\n\ttop: 150px;\n\topacity: 1;\n\ttransition: opacity 0.25s ease-in-out, top 0.25s ease-in-out;\n}\n.hint.hide {\n\ttop: 160px;\n\topacity: 0;\n\ttransition: opacity 0.25s ease-in-out, top 0.25s ease-in-out;\n}\n\n.hint > .title {\n\tfont-size: 32px;\n}\n\n.hint > .subtitle {\n\tmargin: 16px 0 0 0;\n\tfont-size: 24px;\n}\n", ""]);
            const o = s
        }
        ,
        8237: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/settings.svg"
        }
        ,
        8353: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => g
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)
              , o = n(4417)
              , l = n.n(o)
              , c = new URL(n(9391),n.b)
              , h = new URL(n(8115),n.b)
              , d = new URL(n(2709),n.b)
              , u = s()(r())
              , p = l()(c)
              , f = l()(h)
              , m = l()(d);
            u.push([e.id, `\n.track-selection {\n\tposition: absolute;\n\tbottom: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\twidth: 100%;\n\theight: 100%;\n\toverflow: hidden;\n\ttext-align: left;\n}\n\n.track-selection > .safe-area-left {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tz-index: 1;\n\twidth: var(--safe-area-left);\n\theight: 100%;\n\tbackground-color: var(--surface-color);\n}\n\n.track-selection > .safe-area-right {\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\tz-index: 1;\n\twidth: var(--safe-area-right);\n\theight: 100%;\n\tbackground-color: var(--surface-color);\n}\n\n.track-selection > .bar {\n\tdisplay: flex;\n\tmargin: 0;\n\tpadding: 0 var(--safe-area-right) 0 var(--safe-area-left);\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tbackground-color: var(--surface-color);\n\ttext-align: left;\n\n\tpointer-events:auto;\n}\n.track-selection > .bar > .button {\n\tmargin: 8px 12px;\n}\n\n.track-selection > .bar > .search-bar-container {\n\tposition: relative;\n\tdisplay: flex;\n\tflex-grow: 1;\n}\n.track-selection > .bar > .search-bar-container > input {\n\tmargin: 8px -10px;\n\tpadding: 0 20px;\n\tflex-grow: 1;\n\tclip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n\tcolor: var(--text-color);\n\ttext-indent: 2px; /* Without this the italic text will be cut off on the left side. */\n}\n.track-selection > .bar > .search-bar-container > img {\n\tmargin: 8px -10px 8px 0;\n\tpadding: 0 16px;\n\twidth: 24px;\n\tbackground-color: var(--button-hover-color);\n\tclip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n}\n\n.track-selection .category-container {\n\tdisplay: flex;\n\tpadding: 0 var(--safe-area-right) 0 var(--safe-area-left);\n\tbackground-color: var(--surface-secondary-color);\n}\n.track-selection .category-container > button {\n\tposition: relative;\n\tmargin: 0 -3px;\n\tpadding: 0.6em 0;\n\tflex-grow: 1;\n\tbackground-color: transparent;\n\tfont-size: 2.8vw;\n\tfont-weight: bold;\n\ttext-shadow: 2px 2px 0 #112052, 0 0 10px #000, 0 0 10px #000;\n\tclip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n}\n.track-selection .category-container > button:first-of-type {\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n}\n.track-selection .category-container > button:last-of-type {\n\tclip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%);\n}\n.track-selection .category-container > button::before {\n\tcontent: "";\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tz-index: -1;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-position: center;\n\tbackground-size: cover;\n\tfilter: blur(2px);\n\ttransition: filter 0.2s ease-in-out,  0.2s ease-in-out;\n}\n.track-selection .category-container > button.official::before {\n\tbackground-image: url(${p});\n}\n.track-selection .category-container > button.community::before {\n\tbackground-image: url(${f});\n}\n.track-selection .category-container > button.custom::before {\n\tbackground-image: url(${m});\n}\n.track-selection .category-container > button:hover::before {\n\tfilter: none;\n\ttransform: scale(1.1);\n}\n@media (hover: none) {\n\t.track-selection .category-container > button:hover::before {\n\t\tfilter: blur(2px);\n\t\ttransform: none;\n\t}\n\n\t.track-selection .category-container > button:active::before {\n\t\tfilter: none;\n\t\ttransform: scale(1.1);\n\t}\n}\n.track-selection .category-container > button.selected::before {\n\tfilter: none;\n}\n.track-selection .category-container > button::after {\n\tbackground-color: transparent;\n}\n.track-selection .category-container > button.selected::after {\n\twidth: 100%;\n}\n\n.track-selection .category-container > button > .cover {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tz-index: -1;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(17, 32, 82, 0.75);\n\ttransition: background-color 0.2s ease-in-out;\n}\n.track-selection .category-container > button:hover > .cover {\n\tbackground-color: rgba(51, 75, 119, 0.5);\n}\n@media (hover: none) {\n\t.track-selection .category-container > button:hover > .cover {\n\t\tbackground-color: rgba(17, 32, 82, 0.75);\n\t}\n}\n.track-selection .category-container > button:active > .cover {\n\tbackground-color: rgba(21, 31, 65, 0.5);\n}\n.track-selection .category-container > button.selected > .cover {\n\tbackground-color: transparent;\n}\n\n@media (max-width: 1150px) {\n\t.track-selection .category-container > button {\n\t\tfont-size: 32.2px;\n\t}\n}\n\n.track-selection .tracks-container {\n\tmargin: 0;\n\tpadding: 20px calc(60px + var(--safe-area-right)) 20px calc(60px + var(--safe-area-left));\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tflex-grow: 1;\n\toverflow-y: auto;\n\tpointer-events: auto;\n\tdisplay: none;\n}\n.track-selection .tracks-container.open {\n\tdisplay: block;\n}\n.track-selection.editor-track-selection .tracks-container {\n\tbackground-color: rgba(20, 20, 45, 0.8);\n}\n\n.track-selection .tracks-container > .empty {\n\tmargin: 100px;\n\tcolor: var(--text-color);\n\ttext-align: center;\n}\n.track-selection .tracks-container > .empty > .title {\n\tfont-size: 48px;\n}\n.track-selection .tracks-container > .empty > .description {\n\tmargin: 20px 0 0 0;\n\tfont-size: 32px;\n\topacity: 0.75;\n}\n\n.track-selection .environment-title {\n\tmargin: 0.5em 0.4em;\n\tpadding: 0;\n\tfont-size: 50px;\n\tfont-weight: normal;\n\tborder-bottom-width: 4px;\n\tborder-bottom-style: solid;\n\t\n}\n.track-selection .environment-title.summer {\n\tcolor: var(--text-color);\n\tborder-image: linear-gradient(to right, var(--text-color), transparent) 1;\n}\n.track-selection .environment-title.winter {\n\tcolor: #bed8f7;\n\tborder-image: linear-gradient(to right, #bed8f7, transparent) 1;\n}\n.track-selection .environment-title.desert {\n\tcolor: #ede2af;\n\tborder-image: linear-gradient(to right, #ede2af, transparent) 1;\n}\n\n.track-selection .environment-title > img {\n\tmargin: 6px 8px;\n\twidth: 36px;\n\theight: 36px;\n\tvertical-align: bottom;\n}\n\n.track-selection .tracks-container .track {\n\tposition: relative;\n\tdisplay: inline-block;\n}\n\n.track-selection .tracks-container .track button {\n\tmargin: 10px;\n\tpadding: 0;\n\tcolor: var(--text-color);\n\tfont-size: 32px;\n}\n.track-selection .tracks-container .track button:after {\n\tborder-bottom: none;\n}\n.track-selection .tracks-container .track button:focus-visible {\n\ttext-decoration: none;\n}\n\n.track-selection .track-title {\n\tmargin: 0;\n\tpadding: 4px;\n\tfont-size: 25px;\n\tbackground-color: var(--surface-secondary-color);\n}\n.track-selection .tracks-container .track button:focus-visible .track-title {\n\ttext-decoration: underline;\n}\n.track-selection .track-title > p {\n\tmargin: 0;\n\tpadding: 0 22px;\n\twidth: 208px;\n\tbox-sizing: border-box;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.track-selection .track canvas {\n\tmargin: 0;\n\tpadding: 20px 40px;\n\twidth: 128px;\n\theight: 128px;\n\tobject-fit: contain;\n\t-webkit-filter: drop-shadow(0 0 3px #000);\n\tfilter: drop-shadow(0 0 3px #000);\n\timage-rendering: pixelated;\n}\n\n.track-selection .track .environment {\n\tposition: absolute;\n\tright: 14px;\n\tbottom: 40px;\n\twidth: 24px;\n\topacity: 0.2;\n\tpointer-events: none;\n}\n\n.track-selection .record {\n\tmargin: 0;\n\tpadding: 4px;\n\tfont-size: 24px;\n\tbackground-color: var(--surface-secondary-color);\n\tcolor: var(--text-color);\n}\n\n.track-selection .delete-button {\n\tposition: absolute;\n\ttop: 7px;\n\tright: 6px;\n\tmargin: 0;\n\tpadding: 0;\n\tline-height: 0;\n\tborder-radius: 2px;\n\tborder: none;\n\tbackground-color: var(--button-color);\n\n\tpointer-events: auto;\n\tcursor: pointer;\n}\n.track-selection .delete-button:hover {\n\tbackground-color: var(--button-hover-color);\n}\n@media (hover: none) {\n\t.track-selection .delete-button:hover {\n\t\tbackground-color: var(--button-color);\n\t}\n}\n.track-selection .delete-button:active {\n\tbackground-color: var(--button-active-color);\n}\n.track-selection .delete-button > img {\n\tmargin: 0;\n\tpadding: 0;\n\theight: 20px;\n\tvertical-align: top;\n\tpointer-events: none;\n}\n`, ""]);
            const g = u
        }
        ,
        8358: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/overlapping_disabled.svg"
        }
        ,
        8419: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => g
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)
              , o = n(4417)
              , l = n.n(o)
              , c = new URL(n(3682),n.b)
              , h = new URL(n(2208),n.b)
              , d = new URL(n(2832),n.b)
              , u = s()(r())
              , p = l()(c)
              , f = l()(h)
              , m = l()(d);
            u.push([e.id, `\n:root {\n\tinterpolate-size: allow-keywords; \n\n\t--text-color: #fff;\n\t--text-disabled-color: #5d6a7c;\n\t--surface-color: #28346a;\n\t--surface-secondary-color: #212b58;\n\t--surface-tertiary-color: #192042;\n\t--surface-transparent-color: rgba(40, 52, 106, 0.5);\n\t--button-color: #112052;\n\t--button-hover-color: #334b77;\n\t--button-active-color: #151f41;\n\t--button-disabled-color: #313d53;\n\n\t/* Set by JS */\n\t--ui-scale-factor: 1.0;\n\n\t--safe-area-left-unscaled: env(safe-area-inset-left, 0px);\n\t--safe-area-right-unscaled: env(safe-area-inset-right, 0px);\n\t--safe-area-top-unscaled: env(safe-area-inset-top, 0px);\n\t--safe-area-bottom-unscaled: env(safe-area-inset-bottom, 0px);\n\n\t--safe-area-left: calc(var(--safe-area-left-unscaled) / var(--ui-scale-factor));\n\t--safe-area-right: calc(var(--safe-area-right-unscaled) / var(--ui-scale-factor));\n\t--safe-area-horizontal: max(var(--safe-area-left), var(--safe-area-right));\n\n\t--safe-area-top: calc(var(--safe-area-top-unscaled) / var(--ui-scale-factor));\n\t--safe-area-bottom: calc(var(--safe-area-bottom-unscaled) / var(--ui-scale-factor));\n\t--safe-area-vertical: max(var(--safe-area-top), var(--safe-area-bottom));\n}\n\n@font-face {\n\tfont-family: ForcedSquare;\n\tsrc:\n\t\turl(${p}) format("woff2"),\n\t\turl(${f}) format("woff"),\n\t\turl(${m}) format("truetype");\n}\n\nhtml, body {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n\toverflow: hidden;\n\toverscroll-behavior: none;\n\n\tbackground: #000;\n}\n\nbody {\n\tscrollbar-color: #7272c2 #223;\n\ttouch-action: none;\n}\n\n* {\n\tfont-style: italic;\n\tfont-family: ForcedSquare, Arial, sans-serif;\n\tline-height: 1;\n}\n\n#screen {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n\t-webkit-tap-highlight-color: transparent;\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\ttouch-action: none;\n}\n\n#ui {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\twidth: 100%;\n\theight: 100%;\n\ttransform-origin: 0 0;\n\tpointer-events: none;\n\t-webkit-tap-highlight-color: transparent;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n}\n\n::-webkit-scrollbar {\n\twidth: 8px;\n\tbackground-color: #223;\n}\n::-webkit-scrollbar-thumb {\n\tborder-radius: 4px;\n\tbackground-color: #7272c2;\n}\n\n::selection {\n\tbackground-color:  #5936d6;\n\tcolor:  #fff;\n}\n\n.hide-cursor {\n\tcursor: none;\n}\n\n.hidden {\n\tdisplay: none;\n}\n\ninput[type="text"] {\n\tmargin: 0;\n\tpadding: 4px 8px;\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n\tfont-size: 24px;\n\tfont-weight: bold;\n\ttext-indent: 6px; /* Fixes italic text being cut off. */\n\tcolor: var(--text-color);\n\tbackground-color: var(--surface-tertiary-color);\n\tborder: none;\n\tpointer-events: auto;\n}\ninput[type="text"]::placeholder {\n\tcolor: var(--text-color);\n\topacity: 0.25;\n}\ninput[type="text"]:focus-visible {\n\toutline: none;\n}\n\ninput[type="range"] {\n\tmargin: 0;\n\tpadding: 0;\n\t-webkit-appearance: none;\n\tappearance: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\taccent-color: var(--text-color);\n}\ninput[type="range"]::-webkit-slider-runnable-track {\n\tbackground-color: var(--surface-tertiary-color);\n\theight: 10px;\n}\ninput[type="range"]::-moz-range-track {\n\tbackground-color: var(--surface-tertiary-color);\n\theight: 10px;\n}\ninput[type="range"]::-webkit-slider-thumb {\n\t-webkit-appearance: none;\n\tappearance: none;\n\tborder-radius: 0;\n\tbackground: var(--text-color);\n\twidth: 32px;\n\theight: 32px;\n\tmargin: -13px 0 0 0;\n\tborder: 4px solid var(--button-color);\n\toutline: 2px solid var(--text-color);\n}\ninput[type="range"]::-webkit-slider-thumb:hover {\n\tborder: 4px solid var(--button-hover-color);\n}\n@media (hover: none) {\n\tinput[type="range"]::-webkit-slider-thumb:hover {\n\t\tborder: 4px solid var(--button-color);\n\t}\n}\ninput[type="range"]::-webkit-slider-thumb:active {\n\tborder: 4px solid var(--button-active-color);\n}\ninput[type="range"]::-moz-range-thumb {\n\t-webkit-appearance: none;\n\tappearance: none;\n\tborder-radius: 0;\n\tbackground: var(--text-color);\n\twidth: 24px;\n\theight: 24px;\n\tborder: 4px solid var(--button-color);\n\toutline: 2px solid var(--text-color);\n}\ninput[type="range"]::-moz-range-thumb:hover {\n\tborder: 4px solid var(--button-hover-color);\n}\n@media (hover: none) {\n\tinput[type="range"]::-moz-range-thumb:hover {\n\t\tborder: 4px solid var(--button-color);\n\t}\n}\ninput[type="range"]::-moz-range-thumb:active {\n\tborder: 4px solid var(--button-active-color);\n}\n\n.button {\n\tposition: relative;\n\tmargin: 0;\n\tpadding: 8px 18px;\n\tbackground-color: var(--button-color);\n\tborder: none;\n\tclip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n\tcolor: var(--text-color);\n\tfont-size: 32px;\n\n\tpointer-events: auto;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\tcursor: pointer;\n}\n.button::after {\n\tcontent: "";\n\tposition: absolute;\n\tleft: 0;\n\tbottom: 0;\n\tz-index: -1;\n\twidth: 0;\n\theight: 100%;\n\tbackground-color: var(--button-hover-color);\n\tborder-bottom: 2px solid var(--text-color);\n\ttransition: width 0.1s ease-in-out;\n}\n.button:hover::after {\n\twidth: 100%;\n}\n@media (hover: none) {\n\t.button::after {\n\t\tbackground-color: var(--button-active-color);\n\t}\n\n\t.button:hover::after {\n\t\twidth: 0;\n\t}\n}\n.button:active::after {\n\tbackground-color: var(--button-active-color);\n\twidth: 100%;\n}\n.button:focus-visible {\n\tbackground-color: var(--button-hover-color);\n\ttext-decoration: underline;\n\toutline: none;\n}\n.button > img.button-icon {\n\tmargin: -6px -4px 0 -4px;\n\tpadding: 0;\n\twidth: 32px;\n\theight: 32px;\n\tvertical-align: middle;\n\tpointer-events: none;\n}\n.button:disabled {\n\tbackground-color: var(--button-disabled-color);\n\tcolor: var(--text-disabled-color);\n\tcursor: default;\n}\n.button:disabled:after {\n\tcontent: none;\n}\n.button:disabled > img.button-icon {\n\topacity: 0.3;\n}\n`, ""]);
            const g = u
        }
        ,
        8718: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/search.svg"
        }
        ,
        8768: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.preview-toolbar {\n\tposition: absolute;\n\tleft: var(--safe-area-horizontal);\n\tbottom: 0;\n\tpadding: 8px 10px 8px 8px;\n\tbackground-color: var(--surface-color);\n\tclip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n}\n\n#ui.has-safe-area-horizontal .preview-toolbar {\n\tpadding-left: 10px;\n\tclip-path: polygon(10px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);\n}\n", ""]);
            const o = s
        }
        ,
        8787: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/back.svg"
        }
        ,
        8875: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/clouds.jpg"
        }
        ,
        8889: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/editor.svg"
        }
        ,
        8903: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/logo.svg"
        }
        ,
        8909: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.editor-checkpoint-order > .buttons {\n\tdisplay: inline-block;\n\tvertical-align: bottom;\n}\n.editor-checkpoint-order > .buttons > button {\n\tdisplay: block;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: none;\n\tbackground-color: var(--button-color);\n\tpointer-events: auto;\n\tcursor: pointer;\n}\n.editor-checkpoint-order > .buttons > button:hover {\n\tbackground-color: var(--button-hover-color);\n}\n.editor-checkpoint-order > .buttons > button:active {\n\tbackground-color: var(--button-active-color);\n}\n@media (hover: none) {\n\t.editor-checkpoint-order > .buttons > button:hover {\n\t\tbackground-color: var(--button-color);\n\t}\n}\n\n.editor-checkpoint-order > .buttons > button > img {\n\tmargin: 0;\n\tpadding: 0 6px;\n\twidth: 20px;\n\theight: 20px;\n\tvertical-align: bottom;\n\tpointer-events: none;\n}\n.editor-checkpoint-order.touch > .buttons > button > img {\n\tpadding: 24px;\n\twidth: 40px;\n\theight: 40px;\n}\n\n.editor-checkpoint-order > p {\n\tmargin: 0;\n\tpadding: 0 10px;\n\tdisplay: inline-block;\n\tvertical-align: bottom;\n\tline-height: 40px;\n\tmin-width: 275px;\n\tfont-size: 26px;\n\ttext-align: center;\n\tbackground-color: var(--surface-transparent-color);\n\tcolor: var(--text-color);\n}\n.editor-checkpoint-order.touch > p {\n\tline-height: calc((40px + 2 * 24px) * 2);\n}\n", ""]);
            const o = s
        }
        ,
        9027: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/customize.svg"
        }
        ,
        9062: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/rotation_axis_y_positive.svg"
        }
        ,
        9077: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/import.svg"
        }
        ,
        9207: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n#transition-layer {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tz-index: 1;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: #000;\n\tpointer-events: none;\n\n\topacity: 0;\n\ttransition: 0.25s ease-in-out opacity;\n}\n", ""]);
            const o = s
        }
        ,
        9236: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/play.svg"
        }
        ,
        9242: (e, t, n) => {
            "use strict";
            n.d(t, {
                A: () => o
            });
            var i = n(1601)
              , r = n.n(i)
              , a = n(6314)
              , s = n.n(a)()(r());
            s.push([e.id, "\n.editor-help > .background {\n\tposition: absolute;\n\tleft: 0;\n\ttop: 0;\n\tz-index: 1;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(20, 20, 30, 0.5);\n\tpointer-events: auto;\n}\n\n.editor-help > .container {\n\tposition: absolute;\n\tleft: calc(50% - 80% / 2);\n\ttop: 0;\n\tz-index: 2;\n\tdisplay: flex;\n\tflex-direction: column;\n\tbox-sizing: border-box;\n\twidth: 80%;\n\theight: 100%;\n\tbackground-color: var(--surface-color);\n}\n\n.editor-help > .container > h1 {\n\tmargin: 10px;\n\tpadding: 0;\n\tfont-weight: normal;\n\tfont-size: 38px;\n\ttext-align: center;\n\tcolor: var(--text-color);\n}\n\n.editor-help > .container > .content {\n\tflex-grow: 1;\n\tpadding: 40px;\n\tbackground-color: var(--surface-secondary-color);\n\toverflow-y: auto;\n\tpointer-events: auto;\n}\n\n.editor-help > .container > .content > h2 {\n\tmargin: 32px 0 16px 0;\n\tpadding: 0;\n\tfont-weight: normal;\n\tfont-size: 30px;\n\tcolor: var(--text-color);\n\tborder-bottom: 2px solid var(--text-color);\n}\n.editor-help > .container > .content > h2:first-of-type {\n\tmargin-top: 0;\n}\n\n.editor-help > .container > .content > p {\n\tmargin: 0;\n\tpadding: 0;\n\tfont-size: 20px;\n\tcolor: var(--text-color);\n\twhite-space: pre-wrap;\n}\n\n.editor-help > .container > .content > .part-images {\n\tdisplay: flex;\n\tjustify-content: space-around;\n}\n\n.editor-help > .container > .content > .part-images > div {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.editor-help > .container > .content > .part-images > div > img {\n\twidth: 128px;\n\theight: 128px;\n\tfilter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.4));\n\tpointer-events: none;\n\ttransition: opacity 0.25s ease-out;\n}\n.editor-help > .container > .content > .part-images > div > img.loading {\n\topacity: 0;\n}\n\n.editor-help > .container > .content > .part-images > div > span {\n\tmargin: 0;\n\tpadding: 0;\n\tfont-size: 20px;\n\tcolor: var(--text-color);\n\ttext-align: center;\n}\n\n.editor-help > .container > .button-wrapper > button {\n\tmargin: 10px;\n}\n", ""]);
            const o = s
        }
        ,
        9391: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/official_tracks.jpg"
        }
        ,
        9570: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/preview.svg"
        }
        ,
        9708: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/pause.svg"
        }
        ,
        9809: (e, t, n) => {
            "use strict";
            e.exports = n.p + "images/checkmark.svg"
        }
    }, n = {};
    function i(e) {
        var r = n[e];
        if (void 0 !== r)
            return r.exports;
        var a = n[e] = {
            id: e,
            exports: {}
        };
        return t[e](a, a.exports, i),
        a.exports
    }
    i.m = t,
    i.amdO = {},
    i.n = e => {
        var t = e && e.__esModule ? () => e.default : () => e;
        return i.d(t, {
            a: t
        }),
        t
    }
    ,
    i.d = (e, t) => {
        for (var n in t)
            i.o(t, n) && !i.o(e, n) && Object.defineProperty(e, n, {
                enumerable: !0,
                get: t[n]
            })
    }
    ,
    i.f = {},
    i.e = e => Promise.all(Object.keys(i.f).reduce(( (t, n) => (i.f[n](e, t),
    t)), [])),
    i.u = e => e + ".bundle.js",
    i.g = function() {
        if ("object" == typeof globalThis)
            return globalThis;
        try {
            return this || new Function("return this")()
        } catch (e) {
            if ("object" == typeof window)
                return window
        }
    }(),
    i.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t),
    e = {},
    i.l = (t, n, r, a) => {
        if (e[t])
            e[t].push(n);
        else {
            var s, o;
            if (void 0 !== r)
                for (var l = document.getElementsByTagName("script"), c = 0; c < l.length; c++) {
                    var h = l[c];
                    if (h.getAttribute("src") == t) {
                        s = h;
                        break
                    }
                }
            s || (o = !0,
            (s = document.createElement("script")).charset = "utf-8",
            s.timeout = 120,
            i.nc && s.setAttribute("nonce", i.nc),
            s.src = t),
            e[t] = [n];
            var d = (n, i) => {
                s.onerror = s.onload = null,
                clearTimeout(u);
                var r = e[t];
                if (delete e[t],
                s.parentNode && s.parentNode.removeChild(s),
                r && r.forEach((e => e(i))),
                n)
                    return n(i)
            }
              , u = setTimeout(d.bind(null, void 0, {
                type: "timeout",
                target: s
            }), 12e4);
            s.onerror = d.bind(null, s.onerror),
            s.onload = d.bind(null, s.onload),
            o && document.head.appendChild(s)
        }
    }
    ,
    i.r = e => {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
            value: "Module"
        }),
        Object.defineProperty(e, "__esModule", {
            value: !0
        })
    }
    ,
    ( () => {
        var e;
        i.g.importScripts && (e = i.g.location + "");
        var t = i.g.document;
        if (!e && t && (t.currentScript && "SCRIPT" === t.currentScript.tagName.toUpperCase() && (e = t.currentScript.src),
        !e)) {
            var n = t.getElementsByTagName("script");
            if (n.length)
                for (var r = n.length - 1; r > -1 && (!e || !/^http(s?):/.test(e)); )
                    e = n[r--].src
        }
        if (!e)
            throw new Error("Automatic publicPath is not supported in this browser");
        e = e.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"),
        i.p = e
    }
    )(),
    ( () => {
        i.b = document.baseURI || self.location.href;
        var e = {
            792: 0
        };
        i.f.j = (t, n) => {
            var r = i.o(e, t) ? e[t] : void 0;
            if (0 !== r)
                if (r)
                    n.push(r[2]);
                else {
                    var a = new Promise(( (n, i) => r = e[t] = [n, i]));
                    n.push(r[2] = a);
                    var s = i.p + i.u(t)
                      , o = new Error;
                    i.l(s, (n => {
                        if (i.o(e, t) && (0 !== (r = e[t]) && (e[t] = void 0),
                        r)) {
                            var a = n && ("load" === n.type ? "missing" : n.type)
                              , s = n && n.target && n.target.src;
                            o.message = "Loading chunk " + t + " failed.\n(" + a + ": " + s + ")",
                            o.name = "ChunkLoadError",
                            o.type = a,
                            o.request = s,
                            r[1](o)
                        }
                    }
                    ), "chunk-" + t, t)
                }
        }
        ;
        var t = (t, n) => {
            var r, a, [s,o,l] = n, c = 0;
            if (s.some((t => 0 !== e[t]))) {
                for (r in o)
                    i.o(o, r) && (i.m[r] = o[r]);
                if (l)
                    l(i)
            }
            for (t && t(n); c < s.length; c++)
                a = s[c],
                i.o(e, a) && e[a] && e[a][0](),
                e[a] = 0
        }
          , n = self.webpackChunk = self.webpackChunk || [];
        n.forEach(t.bind(null, 0)),
        n.push = t.bind(null, n.push.bind(n))
    }
    )(),
    i.nc = void 0,
    ( () => {
        "use strict";
        var e = i(5072)
          , t = i.n(e)
          , n = i(7825)
          , r = i.n(n)
          , a = i(7659)
          , s = i.n(a)
          , o = i(5056)
          , l = i.n(o)
          , c = i(540)
          , h = i.n(c)
          , d = i(1113)
          , u = i.n(d)
          , p = i(8419)
          , f = {};
        f.styleTagTransform = u(),
        f.setAttributes = l(),
        f.insert = s().bind(null, "head"),
        f.domAPI = r(),
        f.insertStyleElement = h();
        t()(p.A, f);
        p.A && p.A.locals && p.A.locals;
        var m = i(6546);
        (0,
        m.F3)("App", {
            web: () => i.e(168).then(i.bind(i, 1168)).then((e => new e.AppWeb))
        });
        const g = "174"
          , v = 0
          , w = 1
          , y = 2
          , b = 0
          , A = 1
          , x = 2
          , k = 3
          , E = 0
          , S = 1
          , M = 2
          , _ = 100
          , T = 101
          , C = 102
          , P = 200
          , I = 201
          , R = 202
          , L = 203
          , D = 204
          , N = 205
          , B = 206
          , U = 207
          , z = 208
          , O = 209
          , F = 210
          , W = 211
          , H = 212
          , V = 213
          , G = 214
          , j = 0
          , Q = 1
          , K = 2
          , q = 3
          , Y = 4
          , X = 5
          , Z = 6
          , J = 7
          , $ = "attached"
          , ee = 301
          , te = 302
          , ne = 303
          , ie = 304
          , re = 306
          , ae = 1e3
          , se = 1001
          , oe = 1002
          , le = 1003
          , ce = 1004
          , he = 1005
          , de = 1006
          , ue = 1007
          , pe = 1008
          , fe = 1009
          , me = 1010
          , ge = 1011
          , ve = 1012
          , we = 1013
          , ye = 1014
          , be = 1015
          , Ae = 1016
          , xe = 1017
          , ke = 1018
          , Ee = 1020
          , Se = 35902
          , Me = 1023
          , _e = 1026
          , Te = 1027
          , Ce = 1028
          , Pe = 1029
          , Ie = 1031
          , Re = 1033
          , Le = 33776
          , De = 33777
          , Ne = 33778
          , Be = 33779
          , Ue = 35840
          , ze = 35841
          , Oe = 35842
          , Fe = 35843
          , We = 36196
          , He = 37492
          , Ve = 37496
          , Ge = 37808
          , je = 37809
          , Qe = 37810
          , Ke = 37811
          , qe = 37812
          , Ye = 37813
          , Xe = 37814
          , Ze = 37815
          , Je = 37816
          , $e = 37817
          , et = 37818
          , tt = 37819
          , nt = 37820
          , it = 37821
          , rt = 36492
          , at = 36494
          , st = 36495
          , ot = 36284
          , lt = 36285
          , ct = 36286
          , ht = 2300
          , dt = 2301
          , ut = 2302
          , pt = 2400
          , ft = 2401
          , mt = 2402
          , gt = ""
          , vt = "srgb"
          , wt = "srgb-linear"
          , yt = "linear"
          , bt = "srgb"
          , At = 7680
          , xt = 512
          , kt = 513
          , Et = 514
          , St = 515
          , Mt = 516
          , _t = 517
          , Tt = 518
          , Ct = 519
          , Pt = 35044
          , It = "300 es"
          , Rt = 2e3
          , Lt = 2001;
        class Dt {
            addEventListener(e, t) {
                void 0 === this._listeners && (this._listeners = {});
                const n = this._listeners;
                void 0 === n[e] && (n[e] = []),
                -1 === n[e].indexOf(t) && n[e].push(t)
            }
            hasEventListener(e, t) {
                const n = this._listeners;
                return void 0 !== n && (void 0 !== n[e] && -1 !== n[e].indexOf(t))
            }
            removeEventListener(e, t) {
                const n = this._listeners;
                if (void 0 === n)
                    return;
                const i = n[e];
                if (void 0 !== i) {
                    const e = i.indexOf(t);
                    -1 !== e && i.splice(e, 1)
                }
            }
            dispatchEvent(e) {
                const t = this._listeners;
                if (void 0 === t)
                    return;
                const n = t[e.type];
                if (void 0 !== n) {
                    e.target = this;
                    const t = n.slice(0);
                    for (let n = 0, i = t.length; n < i; n++)
                        t[n].call(this, e);
                    e.target = null
                }
            }
        }
        const Nt = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
        let Bt = 1234567;
        const Ut = Math.PI / 180
          , zt = 180 / Math.PI;
        function Ot() {
            const e = 4294967295 * Math.random() | 0
              , t = 4294967295 * Math.random() | 0
              , n = 4294967295 * Math.random() | 0
              , i = 4294967295 * Math.random() | 0;
            return (Nt[255 & e] + Nt[e >> 8 & 255] + Nt[e >> 16 & 255] + Nt[e >> 24 & 255] + "-" + Nt[255 & t] + Nt[t >> 8 & 255] + "-" + Nt[t >> 16 & 15 | 64] + Nt[t >> 24 & 255] + "-" + Nt[63 & n | 128] + Nt[n >> 8 & 255] + "-" + Nt[n >> 16 & 255] + Nt[n >> 24 & 255] + Nt[255 & i] + Nt[i >> 8 & 255] + Nt[i >> 16 & 255] + Nt[i >> 24 & 255]).toLowerCase()
        }
        function Ft(e, t, n) {
            return Math.max(t, Math.min(n, e))
        }
        function Wt(e, t) {
            return (e % t + t) % t
        }
        function Ht(e, t, n) {
            return (1 - n) * e + n * t
        }
        function Vt(e, t) {
            switch (t.constructor) {
            case Float32Array:
                return e;
            case Uint32Array:
                return e / 4294967295;
            case Uint16Array:
                return e / 65535;
            case Uint8Array:
                return e / 255;
            case Int32Array:
                return Math.max(e / 2147483647, -1);
            case Int16Array:
                return Math.max(e / 32767, -1);
            case Int8Array:
                return Math.max(e / 127, -1);
            default:
                throw new Error("Invalid component type.")
            }
        }
        function Gt(e, t) {
            switch (t.constructor) {
            case Float32Array:
                return e;
            case Uint32Array:
                return Math.round(4294967295 * e);
            case Uint16Array:
                return Math.round(65535 * e);
            case Uint8Array:
                return Math.round(255 * e);
            case Int32Array:
                return Math.round(2147483647 * e);
            case Int16Array:
                return Math.round(32767 * e);
            case Int8Array:
                return Math.round(127 * e);
            default:
                throw new Error("Invalid component type.")
            }
        }
        const jt = {
            DEG2RAD: Ut,
            RAD2DEG: zt,
            generateUUID: Ot,
            clamp: Ft,
            euclideanModulo: Wt,
            mapLinear: function(e, t, n, i, r) {
                return i + (e - t) * (r - i) / (n - t)
            },
            inverseLerp: function(e, t, n) {
                return e !== t ? (n - e) / (t - e) : 0
            },
            lerp: Ht,
            damp: function(e, t, n, i) {
                return Ht(e, t, 1 - Math.exp(-n * i))
            },
            pingpong: function(e, t=1) {
                return t - Math.abs(Wt(e, 2 * t) - t)
            },
            smoothstep: function(e, t, n) {
                return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t)) * e * (3 - 2 * e)
            },
            smootherstep: function(e, t, n) {
                return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t)) * e * e * (e * (6 * e - 15) + 10)
            },
            randInt: function(e, t) {
                return e + Math.floor(Math.random() * (t - e + 1))
            },
            randFloat: function(e, t) {
                return e + Math.random() * (t - e)
            },
            randFloatSpread: function(e) {
                return e * (.5 - Math.random())
            },
            seededRandom: function(e) {
                void 0 !== e && (Bt = e);
                let t = Bt += 1831565813;
                return t = Math.imul(t ^ t >>> 15, 1 | t),
                t ^= t + Math.imul(t ^ t >>> 7, 61 | t),
                ((t ^ t >>> 14) >>> 0) / 4294967296
            },
            degToRad: function(e) {
                return e * Ut
            },
            radToDeg: function(e) {
                return e * zt
            },
            isPowerOfTwo: function(e) {
                return !(e & e - 1) && 0 !== e
            },
            ceilPowerOfTwo: function(e) {
                return Math.pow(2, Math.ceil(Math.log(e) / Math.LN2))
            },
            floorPowerOfTwo: function(e) {
                return Math.pow(2, Math.floor(Math.log(e) / Math.LN2))
            },
            setQuaternionFromProperEuler: function(e, t, n, i, r) {
                const a = Math.cos
                  , s = Math.sin
                  , o = a(n / 2)
                  , l = s(n / 2)
                  , c = a((t + i) / 2)
                  , h = s((t + i) / 2)
                  , d = a((t - i) / 2)
                  , u = s((t - i) / 2)
                  , p = a((i - t) / 2)
                  , f = s((i - t) / 2);
                switch (r) {
                case "XYX":
                    e.set(o * h, l * d, l * u, o * c);
                    break;
                case "YZY":
                    e.set(l * u, o * h, l * d, o * c);
                    break;
                case "ZXZ":
                    e.set(l * d, l * u, o * h, o * c);
                    break;
                case "XZX":
                    e.set(o * h, l * f, l * p, o * c);
                    break;
                case "YXY":
                    e.set(l * p, o * h, l * f, o * c);
                    break;
                case "ZYZ":
                    e.set(l * f, l * p, o * h, o * c);
                    break;
                default:
                    console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + r)
                }
            },
            normalize: Gt,
            denormalize: Vt
        };
        class Qt {
            constructor(e=0, t=0) {
                Qt.prototype.isVector2 = !0,
                this.x = e,
                this.y = t
            }
            get width() {
                return this.x
            }
            set width(e) {
                this.x = e
            }
            get height() {
                return this.y
            }
            set height(e) {
                this.y = e
            }
            set(e, t) {
                return this.x = e,
                this.y = t,
                this
            }
            setScalar(e) {
                return this.x = e,
                this.y = e,
                this
            }
            setX(e) {
                return this.x = e,
                this
            }
            setY(e) {
                return this.y = e,
                this
            }
            setComponent(e, t) {
                switch (e) {
                case 0:
                    this.x = t;
                    break;
                case 1:
                    this.y = t;
                    break;
                default:
                    throw new Error("index is out of range: " + e)
                }
                return this
            }
            getComponent(e) {
                switch (e) {
                case 0:
                    return this.x;
                case 1:
                    return this.y;
                default:
                    throw new Error("index is out of range: " + e)
                }
            }
            clone() {
                return new this.constructor(this.x,this.y)
            }
            copy(e) {
                return this.x = e.x,
                this.y = e.y,
                this
            }
            add(e) {
                return this.x += e.x,
                this.y += e.y,
                this
            }
            addScalar(e) {
                return this.x += e,
                this.y += e,
                this
            }
            addVectors(e, t) {
                return this.x = e.x + t.x,
                this.y = e.y + t.y,
                this
            }
            addScaledVector(e, t) {
                return this.x += e.x * t,
                this.y += e.y * t,
                this
            }
            sub(e) {
                return this.x -= e.x,
                this.y -= e.y,
                this
            }
            subScalar(e) {
                return this.x -= e,
                this.y -= e,
                this
            }
            subVectors(e, t) {
                return this.x = e.x - t.x,
                this.y = e.y - t.y,
                this
            }
            multiply(e) {
                return this.x *= e.x,
                this.y *= e.y,
                this
            }
            multiplyScalar(e) {
                return this.x *= e,
                this.y *= e,
                this
            }
            divide(e) {
                return this.x /= e.x,
                this.y /= e.y,
                this
            }
            divideScalar(e) {
                return this.multiplyScalar(1 / e)
            }
            applyMatrix3(e) {
                const t = this.x
                  , n = this.y
                  , i = e.elements;
                return this.x = i[0] * t + i[3] * n + i[6],
                this.y = i[1] * t + i[4] * n + i[7],
                this
            }
            min(e) {
                return this.x = Math.min(this.x, e.x),
                this.y = Math.min(this.y, e.y),
                this
            }
            max(e) {
                return this.x = Math.max(this.x, e.x),
                this.y = Math.max(this.y, e.y),
                this
            }
            clamp(e, t) {
                return this.x = Ft(this.x, e.x, t.x),
                this.y = Ft(this.y, e.y, t.y),
                this
            }
            clampScalar(e, t) {
                return this.x = Ft(this.x, e, t),
                this.y = Ft(this.y, e, t),
                this
            }
            clampLength(e, t) {
                const n = this.length();
                return this.divideScalar(n || 1).multiplyScalar(Ft(n, e, t))
            }
            floor() {
                return this.x = Math.floor(this.x),
                this.y = Math.floor(this.y),
                this
            }
            ceil() {
                return this.x = Math.ceil(this.x),
                this.y = Math.ceil(this.y),
                this
            }
            round() {
                return this.x = Math.round(this.x),
                this.y = Math.round(this.y),
                this
            }
            roundToZero() {
                return this.x = Math.trunc(this.x),
                this.y = Math.trunc(this.y),
                this
            }
            negate() {
                return this.x = -this.x,
                this.y = -this.y,
                this
            }
            dot(e) {
                return this.x * e.x + this.y * e.y
            }
            cross(e) {
                return this.x * e.y - this.y * e.x
            }
            lengthSq() {
                return this.x * this.x + this.y * this.y
            }
            length() {
                return Math.sqrt(this.x * this.x + this.y * this.y)
            }
            manhattanLength() {
                return Math.abs(this.x) + Math.abs(this.y)
            }
            normalize() {
                return this.divideScalar(this.length() || 1)
            }
            angle() {
                return Math.atan2(-this.y, -this.x) + Math.PI
            }
            angleTo(e) {
                const t = Math.sqrt(this.lengthSq() * e.lengthSq());
                if (0 === t)
                    return Math.PI / 2;
                const n = this.dot(e) / t;
                return Math.acos(Ft(n, -1, 1))
            }
            distanceTo(e) {
                return Math.sqrt(this.distanceToSquared(e))
            }
            distanceToSquared(e) {
                const t = this.x - e.x
                  , n = this.y - e.y;
                return t * t + n * n
            }
            manhattanDistanceTo(e) {
                return Math.abs(this.x - e.x) + Math.abs(this.y - e.y)
            }
            setLength(e) {
                return this.normalize().multiplyScalar(e)
            }
            lerp(e, t) {
                return this.x += (e.x - this.x) * t,
                this.y += (e.y - this.y) * t,
                this
            }
            lerpVectors(e, t, n) {
                return this.x = e.x + (t.x - e.x) * n,
                this.y = e.y + (t.y - e.y) * n,
                this
            }
            equals(e) {
                return e.x === this.x && e.y === this.y
            }
            fromArray(e, t=0) {
                return this.x = e[t],
                this.y = e[t + 1],
                this
            }
            toArray(e=[], t=0) {
                return e[t] = this.x,
                e[t + 1] = this.y,
                e
            }
            fromBufferAttribute(e, t) {
                return this.x = e.getX(t),
                this.y = e.getY(t),
                this
            }
            rotateAround(e, t) {
                const n = Math.cos(t)
                  , i = Math.sin(t)
                  , r = this.x - e.x
                  , a = this.y - e.y;
                return this.x = r * n - a * i + e.x,
                this.y = r * i + a * n + e.y,
                this
            }
            random() {
                return this.x = Math.random(),
                this.y = Math.random(),
                this
            }
            *[Symbol.iterator]() {
                yield this.x,
                yield this.y
            }
        }
        class Kt {
            constructor(e, t, n, i, r, a, s, o, l) {
                Kt.prototype.isMatrix3 = !0,
                this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1],
                void 0 !== e && this.set(e, t, n, i, r, a, s, o, l)
            }
            set(e, t, n, i, r, a, s, o, l) {
                const c = this.elements;
                return c[0] = e,
                c[1] = i,
                c[2] = s,
                c[3] = t,
                c[4] = r,
                c[5] = o,
                c[6] = n,
                c[7] = a,
                c[8] = l,
                this
            }
            identity() {
                return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
                this
            }
            copy(e) {
                const t = this.elements
                  , n = e.elements;
                return t[0] = n[0],
                t[1] = n[1],
                t[2] = n[2],
                t[3] = n[3],
                t[4] = n[4],
                t[5] = n[5],
                t[6] = n[6],
                t[7] = n[7],
                t[8] = n[8],
                this
            }
            extractBasis(e, t, n) {
                return e.setFromMatrix3Column(this, 0),
                t.setFromMatrix3Column(this, 1),
                n.setFromMatrix3Column(this, 2),
                this
            }
            setFromMatrix4(e) {
                const t = e.elements;
                return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
                this
            }
            multiply(e) {
                return this.multiplyMatrices(this, e)
            }
            premultiply(e) {
                return this.multiplyMatrices(e, this)
            }
            multiplyMatrices(e, t) {
                const n = e.elements
                  , i = t.elements
                  , r = this.elements
                  , a = n[0]
                  , s = n[3]
                  , o = n[6]
                  , l = n[1]
                  , c = n[4]
                  , h = n[7]
                  , d = n[2]
                  , u = n[5]
                  , p = n[8]
                  , f = i[0]
                  , m = i[3]
                  , g = i[6]
                  , v = i[1]
                  , w = i[4]
                  , y = i[7]
                  , b = i[2]
                  , A = i[5]
                  , x = i[8];
                return r[0] = a * f + s * v + o * b,
                r[3] = a * m + s * w + o * A,
                r[6] = a * g + s * y + o * x,
                r[1] = l * f + c * v + h * b,
                r[4] = l * m + c * w + h * A,
                r[7] = l * g + c * y + h * x,
                r[2] = d * f + u * v + p * b,
                r[5] = d * m + u * w + p * A,
                r[8] = d * g + u * y + p * x,
                this
            }
            multiplyScalar(e) {
                const t = this.elements;
                return t[0] *= e,
                t[3] *= e,
                t[6] *= e,
                t[1] *= e,
                t[4] *= e,
                t[7] *= e,
                t[2] *= e,
                t[5] *= e,
                t[8] *= e,
                this
            }
            determinant() {
                const e = this.elements
                  , t = e[0]
                  , n = e[1]
                  , i = e[2]
                  , r = e[3]
                  , a = e[4]
                  , s = e[5]
                  , o = e[6]
                  , l = e[7]
                  , c = e[8];
                return t * a * c - t * s * l - n * r * c + n * s * o + i * r * l - i * a * o
            }
            invert() {
                const e = this.elements
                  , t = e[0]
                  , n = e[1]
                  , i = e[2]
                  , r = e[3]
                  , a = e[4]
                  , s = e[5]
                  , o = e[6]
                  , l = e[7]
                  , c = e[8]
                  , h = c * a - s * l
                  , d = s * o - c * r
                  , u = l * r - a * o
                  , p = t * h + n * d + i * u;
                if (0 === p)
                    return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
                const f = 1 / p;
                return e[0] = h * f,
                e[1] = (i * l - c * n) * f,
                e[2] = (s * n - i * a) * f,
                e[3] = d * f,
                e[4] = (c * t - i * o) * f,
                e[5] = (i * r - s * t) * f,
                e[6] = u * f,
                e[7] = (n * o - l * t) * f,
                e[8] = (a * t - n * r) * f,
                this
            }
            transpose() {
                let e;
                const t = this.elements;
                return e = t[1],
                t[1] = t[3],
                t[3] = e,
                e = t[2],
                t[2] = t[6],
                t[6] = e,
                e = t[5],
                t[5] = t[7],
                t[7] = e,
                this
            }
            getNormalMatrix(e) {
                return this.setFromMatrix4(e).invert().transpose()
            }
            transposeIntoArray(e) {
                const t = this.elements;
                return e[0] = t[0],
                e[1] = t[3],
                e[2] = t[6],
                e[3] = t[1],
                e[4] = t[4],
                e[5] = t[7],
                e[6] = t[2],
                e[7] = t[5],
                e[8] = t[8],
                this
            }
            setUvTransform(e, t, n, i, r, a, s) {
                const o = Math.cos(r)
                  , l = Math.sin(r);
                return this.set(n * o, n * l, -n * (o * a + l * s) + a + e, -i * l, i * o, -i * (-l * a + o * s) + s + t, 0, 0, 1),
                this
            }
            scale(e, t) {
                return this.premultiply(qt.makeScale(e, t)),
                this
            }
            rotate(e) {
                return this.premultiply(qt.makeRotation(-e)),
                this
            }
            translate(e, t) {
                return this.premultiply(qt.makeTranslation(e, t)),
                this
            }
            makeTranslation(e, t) {
                return e.isVector2 ? this.set(1, 0, e.x, 0, 1, e.y, 0, 0, 1) : this.set(1, 0, e, 0, 1, t, 0, 0, 1),
                this
            }
            makeRotation(e) {
                const t = Math.cos(e)
                  , n = Math.sin(e);
                return this.set(t, -n, 0, n, t, 0, 0, 0, 1),
                this
            }
            makeScale(e, t) {
                return this.set(e, 0, 0, 0, t, 0, 0, 0, 1),
                this
            }
            equals(e) {
                const t = this.elements
                  , n = e.elements;
                for (let e = 0; e < 9; e++)
                    if (t[e] !== n[e])
                        return !1;
                return !0
            }
            fromArray(e, t=0) {
                for (let n = 0; n < 9; n++)
                    this.elements[n] = e[n + t];
                return this
            }
            toArray(e=[], t=0) {
                const n = this.elements;
                return e[t] = n[0],
                e[t + 1] = n[1],
                e[t + 2] = n[2],
                e[t + 3] = n[3],
                e[t + 4] = n[4],
                e[t + 5] = n[5],
                e[t + 6] = n[6],
                e[t + 7] = n[7],
                e[t + 8] = n[8],
                e
            }
            clone() {
                return (new this.constructor).fromArray(this.elements)
            }
        }
        const qt = new Kt;
        function Yt(e) {
            for (let t = e.length - 1; t >= 0; --t)
                if (e[t] >= 65535)
                    return !0;
            return !1
        }
        Int8Array,
        Uint8Array,
        Uint8ClampedArray,
        Int16Array,
        Uint16Array,
        Int32Array,
        Uint32Array,
        Float32Array,
        Float64Array;
        function Xt(e) {
            return document.createElementNS("http://www.w3.org/1999/xhtml", e)
        }
        function Zt() {
            const e = Xt("canvas");
            return e.style.display = "block",
            e
        }
        const Jt = {};
        function $t(e) {
            e in Jt || (Jt[e] = !0,
            console.warn(e))
        }
        const en = (new Kt).set(.4123908, .3575843, .1804808, .212639, .7151687, .0721923, .0193308, .1191948, .9505322)
          , tn = (new Kt).set(3.2409699, -1.5373832, -.4986108, -.9692436, 1.8759675, .0415551, .0556301, -.203977, 1.0569715);
        function nn() {
            const e = {
                enabled: !0,
                workingColorSpace: wt,
                spaces: {},
                convert: function(e, t, n) {
                    return !1 !== this.enabled && t !== n && t && n ? (this.spaces[t].transfer === bt && (e.r = an(e.r),
                    e.g = an(e.g),
                    e.b = an(e.b)),
                    this.spaces[t].primaries !== this.spaces[n].primaries && (e.applyMatrix3(this.spaces[t].toXYZ),
                    e.applyMatrix3(this.spaces[n].fromXYZ)),
                    this.spaces[n].transfer === bt && (e.r = sn(e.r),
                    e.g = sn(e.g),
                    e.b = sn(e.b)),
                    e) : e
                },
                fromWorkingColorSpace: function(e, t) {
                    return this.convert(e, this.workingColorSpace, t)
                },
                toWorkingColorSpace: function(e, t) {
                    return this.convert(e, t, this.workingColorSpace)
                },
                getPrimaries: function(e) {
                    return this.spaces[e].primaries
                },
                getTransfer: function(e) {
                    return e === gt ? yt : this.spaces[e].transfer
                },
                getLuminanceCoefficients: function(e, t=this.workingColorSpace) {
                    return e.fromArray(this.spaces[t].luminanceCoefficients)
                },
                define: function(e) {
                    Object.assign(this.spaces, e)
                },
                _getMatrix: function(e, t, n) {
                    return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)
                },
                _getDrawingBufferColorSpace: function(e) {
                    return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace
                },
                _getUnpackColorSpace: function(e=this.workingColorSpace) {
                    return this.spaces[e].workingColorSpaceConfig.unpackColorSpace
                }
            }
              , t = [.64, .33, .3, .6, .15, .06]
              , n = [.2126, .7152, .0722]
              , i = [.3127, .329];
            return e.define({
                [wt]: {
                    primaries: t,
                    whitePoint: i,
                    transfer: yt,
                    toXYZ: en,
                    fromXYZ: tn,
                    luminanceCoefficients: n,
                    workingColorSpaceConfig: {
                        unpackColorSpace: vt
                    },
                    outputColorSpaceConfig: {
                        drawingBufferColorSpace: vt
                    }
                },
                [vt]: {
                    primaries: t,
                    whitePoint: i,
                    transfer: bt,
                    toXYZ: en,
                    fromXYZ: tn,
                    luminanceCoefficients: n,
                    outputColorSpaceConfig: {
                        drawingBufferColorSpace: vt
                    }
                }
            }),
            e
        }
        const rn = nn();
        function an(e) {
            return e < .04045 ? .0773993808 * e : Math.pow(.9478672986 * e + .0521327014, 2.4)
        }
        function sn(e) {
            return e < .0031308 ? 12.92 * e : 1.055 * Math.pow(e, .41666) - .055
        }
        let on;
        class ln {
            static getDataURL(e) {
                if (/^data:/i.test(e.src))
                    return e.src;
                if ("undefined" == typeof HTMLCanvasElement)
                    return e.src;
                let t;
                if (e instanceof HTMLCanvasElement)
                    t = e;
                else {
                    void 0 === on && (on = Xt("canvas")),
                    on.width = e.width,
                    on.height = e.height;
                    const n = on.getContext("2d");
                    e instanceof ImageData ? n.putImageData(e, 0, 0) : n.drawImage(e, 0, 0, e.width, e.height),
                    t = on
                }
                return t.toDataURL("image/png")
            }
            static sRGBToLinear(e) {
                if ("undefined" != typeof HTMLImageElement && e instanceof HTMLImageElement || "undefined" != typeof HTMLCanvasElement && e instanceof HTMLCanvasElement || "undefined" != typeof ImageBitmap && e instanceof ImageBitmap) {
                    const t = Xt("canvas");
                    t.width = e.width,
                    t.height = e.height;
                    const n = t.getContext("2d");
                    n.drawImage(e, 0, 0, e.width, e.height);
                    const i = n.getImageData(0, 0, e.width, e.height)
                      , r = i.data;
                    for (let e = 0; e < r.length; e++)
                        r[e] = 255 * an(r[e] / 255);
                    return n.putImageData(i, 0, 0),
                    t
                }
                if (e.data) {
                    const t = e.data.slice(0);
                    for (let e = 0; e < t.length; e++)
                        t instanceof Uint8Array || t instanceof Uint8ClampedArray ? t[e] = Math.floor(255 * an(t[e] / 255)) : t[e] = an(t[e]);
                    return {
                        data: t,
                        width: e.width,
                        height: e.height
                    }
                }
                return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),
                e
            }
        }
        let cn = 0;
        class hn {
            constructor(e=null) {
                this.isSource = !0,
                Object.defineProperty(this, "id", {
                    value: cn++
                }),
                this.uuid = Ot(),
                this.data = e,
                this.dataReady = !0,
                this.version = 0
            }
            set needsUpdate(e) {
                !0 === e && this.version++
            }
            toJSON(e) {
                const t = void 0 === e || "string" == typeof e;
                if (!t && void 0 !== e.images[this.uuid])
                    return e.images[this.uuid];
                const n = {
                    uuid: this.uuid,
                    url: ""
                }
                  , i = this.data;
                if (null !== i) {
                    let e;
                    if (Array.isArray(i)) {
                        e = [];
                        for (let t = 0, n = i.length; t < n; t++)
                            i[t].isDataTexture ? e.push(dn(i[t].image)) : e.push(dn(i[t]))
                    } else
                        e = dn(i);
                    n.url = e
                }
                return t || (e.images[this.uuid] = n),
                n
            }
        }
        function dn(e) {
            return "undefined" != typeof HTMLImageElement && e instanceof HTMLImageElement || "undefined" != typeof HTMLCanvasElement && e instanceof HTMLCanvasElement || "undefined" != typeof ImageBitmap && e instanceof ImageBitmap ? ln.getDataURL(e) : e.data ? {
                data: Array.from(e.data),
                width: e.width,
                height: e.height,
                type: e.data.constructor.name
            } : (console.warn("THREE.Texture: Unable to serialize Texture."),
            {})
        }
        let un = 0;
        class pn extends Dt {
            constructor(e=pn.DEFAULT_IMAGE, t=pn.DEFAULT_MAPPING, n=1001, i=1001, r=1006, a=1008, s=1023, o=1009, l=pn.DEFAULT_ANISOTROPY, c="") {
                super(),
                this.isTexture = !0,
                Object.defineProperty(this, "id", {
                    value: un++
                }),
                this.uuid = Ot(),
                this.name = "",
                this.source = new hn(e),
                this.mipmaps = [],
                this.mapping = t,
                this.channel = 0,
                this.wrapS = n,
                this.wrapT = i,
                this.magFilter = r,
                this.minFilter = a,
                this.anisotropy = l,
                this.format = s,
                this.internalFormat = null,
                this.type = o,
                this.offset = new Qt(0,0),
                this.repeat = new Qt(1,1),
                this.center = new Qt(0,0),
                this.rotation = 0,
                this.matrixAutoUpdate = !0,
                this.matrix = new Kt,
                this.generateMipmaps = !0,
                this.premultiplyAlpha = !1,
                this.flipY = !0,
                this.unpackAlignment = 4,
                this.colorSpace = c,
                this.userData = {},
                this.version = 0,
                this.onUpdate = null,
                this.renderTarget = null,
                this.isRenderTargetTexture = !1,
                this.pmremVersion = 0
            }
            get image() {
                return this.source.data
            }
            set image(e=null) {
                this.source.data = e
            }
            updateMatrix() {
                this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y)
            }
            clone() {
                return (new this.constructor).copy(this)
            }
            copy(e) {
                return this.name = e.name,
                this.source = e.source,
                this.mipmaps = e.mipmaps.slice(0),
                this.mapping = e.mapping,
                this.channel = e.channel,
                this.wrapS = e.wrapS,
                this.wrapT = e.wrapT,
                this.magFilter = e.magFilter,
                this.minFilter = e.minFilter,
                this.anisotropy = e.anisotropy,
                this.format = e.format,
                this.internalFormat = e.internalFormat,
                this.type = e.type,
                this.offset.copy(e.offset),
                this.repeat.copy(e.repeat),
                this.center.copy(e.center),
                this.rotation = e.rotation,
                this.matrixAutoUpdate = e.matrixAutoUpdate,
                this.matrix.copy(e.matrix),
                this.generateMipmaps = e.generateMipmaps,
                this.premultiplyAlpha = e.premultiplyAlpha,
                this.flipY = e.flipY,
                this.unpackAlignment = e.unpackAlignment,
                this.colorSpace = e.colorSpace,
                this.renderTarget = e.renderTarget,
                this.isRenderTargetTexture = e.isRenderTargetTexture,
                this.userData = JSON.parse(JSON.stringify(e.userData)),
                this.needsUpdate = !0,
                this
            }
            toJSON(e) {
                const t = void 0 === e || "string" == typeof e;
                if (!t && void 0 !== e.textures[this.uuid])
                    return e.textures[this.uuid];
                const n = {
                    metadata: {
                        version: 4.6,
                        type: "Texture",
                        generator: "Texture.toJSON"
                    },
                    uuid: this.uuid,
                    name: this.name,
                    image: this.source.toJSON(e).uuid,
                    mapping: this.mapping,
                    channel: this.channel,
                    repeat: [this.repeat.x, this.repeat.y],
                    offset: [this.offset.x, this.offset.y],
                    center: [this.center.x, this.center.y],
                    rotation: this.rotation,
                    wrap: [this.wrapS, this.wrapT],
                    format: this.format,
                    internalFormat: this.internalFormat,
                    type: this.type,
                    colorSpace: this.colorSpace,
                    minFilter: this.minFilter,
                    magFilter: this.magFilter,
                    anisotropy: this.anisotropy,
                    flipY: this.flipY,
                    generateMipmaps: this.generateMipmaps,
                    premultiplyAlpha: this.premultiplyAlpha,
                    unpackAlignment: this.unpackAlignment
                };
                return Object.keys(this.userData).length > 0 && (n.userData = this.userData),
                t || (e.textures[this.uuid] = n),
                n
            }
            dispose() {
                this.dispatchEvent({
                    type: "dispose"
                })
            }
            transformUv(e) {
                if (300 !== this.mapping)
                    return e;
                if (e.applyMatrix3(this.matrix),
                e.x < 0 || e.x > 1)
                    switch (this.wrapS) {
                    case ae:
                        e.x = e.x - Math.floor(e.x);
                        break;
                    case se:
                        e.x = e.x < 0 ? 0 : 1;
                        break;
                    case oe:
                        1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
                    }
                if (e.y < 0 || e.y > 1)
                    switch (this.wrapT) {
                    case ae:
                        e.y = e.y - Math.floor(e.y);
                        break;
                    case se:
                        e.y = e.y < 0 ? 0 : 1;
                        break;
                    case oe:
                        1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
                    }
                return this.flipY && (e.y = 1 - e.y),
                e
            }
            set needsUpdate(e) {
                !0 === e && (this.version++,
                this.source.needsUpdate = !0)
            }
            set needsPMREMUpdate(e) {
                !0 === e && this.pmremVersion++
            }
        }
        pn.DEFAULT_IMAGE = null,
        pn.DEFAULT_MAPPING = 300,
        pn.DEFAULT_ANISOTROPY = 1;
        class fn {
            constructor(e=0, t=0, n=0, i=1) {
                fn.prototype.isVector4 = !0,
                this.x = e,
                this.y = t,
                this.z = n,
                this.w = i
            }
            get width() {
                return this.z
            }
            set width(e) {
                this.z = e
            }
            get height() {
                return this.w
            }
            set height(e) {
                this.w = e
            }
            set(e, t, n, i) {
                return this.x = e,
                this.y = t,
                this.z = n,
                this.w = i,
                this
            }
            setScalar(e) {
                return this.x = e,
                this.y = e,
                this.z = e,
                this.w = e,
                this
            }
            setX(e) {
                return this.x = e,
                this
            }
            setY(e) {
                return this.y = e,
                this
            }
            setZ(e) {
                return this.z = e,
                this
            }
            setW(e) {
                return this.w = e,
                this
            }
            setComponent(e, t) {
                switch (e) {
                case 0:
                    this.x = t;
                    break;
                case 1:
                    this.y = t;
                    break;
                case 2:
                    this.z = t;
                    break;
                case 3:
                    this.w = t;
                    break;
                default:
                    throw new Error("index is out of range: " + e)
                }
                return this
            }
            getComponent(e) {
                switch (e) {
                case 0:
                    return this.x;
                case 1:
                    return this.y;
                case 2:
                    return this.z;
                case 3:
                    return this.w;
                default:
                    throw new Error("index is out of range: " + e)
                }
            }
            clone() {
                return new this.constructor(this.x,this.y,this.z,this.w)
            }
            copy(e) {
                return this.x = e.x,
                this.y = e.y,
                this.z = e.z,
                this.w = void 0 !== e.w ? e.w : 1,
                this
            }
            add(e) {
                return this.x += e.x,
                this.y += e.y,
                this.z += e.z,
                this.w += e.w,
                this
            }
            addScalar(e) {
                return this.x += e,
                this.y += e,
                this.z += e,
                this.w += e,
                this
            }
            addVectors(e, t) {
                return this.x = e.x + t.x,
                this.y = e.y + t.y,
                this.z = e.z + t.z,
                this.w = e.w + t.w,
                this
            }
            addScaledVector(e, t) {
                return this.x += e.x * t,
                this.y += e.y * t,
                this.z += e.z * t,
                this.w += e.w * t,
                this
            }
            sub(e) {
                return this.x -= e.x,
                this.y -= e.y,
                this.z -= e.z,
                this.w -= e.w,
                this
            }
            subScalar(e) {
                return this.x -= e,
                this.y -= e,
                this.z -= e,
                this.w -= e,
                this
            }
            subVectors(e, t) {
                return this.x = e.x - t.x,
                this.y = e.y - t.y,
                this.z = e.z - t.z,
                this.w = e.w - t.w,
                this
            }
            multiply(e) {
                return this.x *= e.x,
                this.y *= e.y,
                this.z *= e.z,
                this.w *= e.w,
                this
            }
            multiplyScalar(e) {
                return this.x *= e,
                this.y *= e,
                this.z *= e,
                this.w *= e,
                this
            }
            applyMatrix4(e) {
                const t = this.x
                  , n = this.y
                  , i = this.z
                  , r = this.w
                  , a = e.elements;
                return this.x = a[0] * t + a[4] * n + a[8] * i + a[12] * r,
                this.y = a[1] * t + a[5] * n + a[9] * i + a[13] * r,
                this.z = a[2] * t + a[6] * n + a[10] * i + a[14] * r,
                this.w = a[3] * t + a[7] * n + a[11] * i + a[15] * r,
                this
            }
            divide(e) {
                return this.x /= e.x,
                this.y /= e.y,
                this.z /= e.z,
                this.w /= e.w,
                this
            }
            divideScalar(e) {
                return this.multiplyScalar(1 / e)
            }
            setAxisAngleFromQuaternion(e) {
                this.w = 2 * Math.acos(e.w);
                const t = Math.sqrt(1 - e.w * e.w);
                return t < 1e-4 ? (this.x = 1,
                this.y = 0,
                this.z = 0) : (this.x = e.x / t,
                this.y = e.y / t,
                this.z = e.z / t),
                this
            }
            setAxisAngleFromRotationMatrix(e) {
                let t, n, i, r;
                const a = .01
                  , s = .1
                  , o = e.elements
                  , l = o[0]
                  , c = o[4]
                  , h = o[8]
                  , d = o[1]
                  , u = o[5]
                  , p = o[9]
                  , f = o[2]
                  , m = o[6]
                  , g = o[10];
                if (Math.abs(c - d) < a && Math.abs(h - f) < a && Math.abs(p - m) < a) {
                    if (Math.abs(c + d) < s && Math.abs(h + f) < s && Math.abs(p + m) < s && Math.abs(l + u + g - 3) < s)
                        return this.set(1, 0, 0, 0),
                        this;
                    t = Math.PI;
                    const e = (l + 1) / 2
                      , o = (u + 1) / 2
                      , v = (g + 1) / 2
                      , w = (c + d) / 4
                      , y = (h + f) / 4
                      , b = (p + m) / 4;
                    return e > o && e > v ? e < a ? (n = 0,
                    i = .707106781,
                    r = .707106781) : (n = Math.sqrt(e),
                    i = w / n,
                    r = y / n) : o > v ? o < a ? (n = .707106781,
                    i = 0,
                    r = .707106781) : (i = Math.sqrt(o),
                    n = w / i,
                    r = b / i) : v < a ? (n = .707106781,
                    i = .707106781,
                    r = 0) : (r = Math.sqrt(v),
                    n = y / r,
                    i = b / r),
                    this.set(n, i, r, t),
                    this
                }
                let v = Math.sqrt((m - p) * (m - p) + (h - f) * (h - f) + (d - c) * (d - c));
                return Math.abs(v) < .001 && (v = 1),
                this.x = (m - p) / v,
                this.y = (h - f) / v,
                this.z = (d - c) / v,
                this.w = Math.acos((l + u + g - 1) / 2),
                this
            }
            setFromMatrixPosition(e) {
                const t = e.elements;
                return this.x = t[12],
                this.y = t[13],
                this.z = t[14],
                this.w = t[15],
                this
            }
            min(e) {
                return this.x = Math.min(this.x, e.x),
                this.y = Math.min(this.y, e.y),
                this.z = Math.min(this.z, e.z),
                this.w = Math.min(this.w, e.w),
                this
            }
            max(e) {
                return this.x = Math.max(this.x, e.x),
                this.y = Math.max(this.y, e.y),
                this.z = Math.max(this.z, e.z),
                this.w = Math.max(this.w, e.w),
                this
            }
            clamp(e, t) {
                return this.x = Ft(this.x, e.x, t.x),
                this.y = Ft(this.y, e.y, t.y),
                this.z = Ft(this.z, e.z, t.z),
                this.w = Ft(this.w, e.w, t.w),
                this
            }
            clampScalar(e, t) {
                return this.x = Ft(this.x, e, t),
                this.y = Ft(this.y, e, t),
                this.z = Ft(this.z, e, t),
                this.w = Ft(this.w, e, t),
                this
            }
            clampLength(e, t) {
                const n = this.length();
                return this.divideScalar(n || 1).multiplyScalar(Ft(n, e, t))
            }
            floor() {
                return this.x = Math.floor(this.x),
                this.y = Math.floor(this.y),
                this.z = Math.floor(this.z),
                this.w = Math.floor(this.w),
                this
            }
            ceil() {
                return this.x = Math.ceil(this.x),
                this.y = Math.ceil(this.y),
                this.z = Math.ceil(this.z),
                this.w = Math.ceil(this.w),
                this
            }
            round() {
                return this.x = Math.round(this.x),
                this.y = Math.round(this.y),
                this.z = Math.round(this.z),
                this.w = Math.round(this.w),
                this
            }
            roundToZero() {
                return this.x = Math.trunc(this.x),
                this.y = Math.trunc(this.y),
                this.z = Math.trunc(this.z),
                this.w = Math.trunc(this.w),
                this
            }
            negate() {
                return this.x = -this.x,
                this.y = -this.y,
                this.z = -this.z,
                this.w = -this.w,
                this
            }
            dot(e) {
                return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
            }
            lengthSq() {
                return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
            }
            length() {
                return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
            }
            manhattanLength() {
                return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
            }
            normalize() {
                return this.divideScalar(this.length() || 1)
            }
            setLength(e) {
                return this.normalize().multiplyScalar(e)
            }
            lerp(e, t) {
                return this.x += (e.x - this.x) * t,
                this.y += (e.y - this.y) * t,
                this.z += (e.z - this.z) * t,
                this.w += (e.w - this.w) * t,
                this
            }
            lerpVectors(e, t, n) {
                return this.x = e.x + (t.x - e.x) * n,
                this.y = e.y + (t.y - e.y) * n,
                this.z = e.z + (t.z - e.z) * n,
                this.w = e.w + (t.w - e.w) * n,
                this
            }
            equals(e) {
                return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
            }
            fromArray(e, t=0) {
                return this.x = e[t],
                this.y = e[t + 1],
                this.z = e[t + 2],
                this.w = e[t + 3],
                this
            }
            toArray(e=[], t=0) {
                return e[t] = this.x,
                e[t + 1] = this.y,
                e[t + 2] = this.z,
                e[t + 3] = this.w,
                e
            }
            fromBufferAttribute(e, t) {
                return this.x = e.getX(t),
                this.y = e.getY(t),
                this.z = e.getZ(t),
                this.w = e.getW(t),
                this
            }
            random() {
                return this.x = Math.random(),
                this.y = Math.random(),
                this.z = Math.random(),
                this.w = Math.random(),
                this
            }
            *[Symbol.iterator]() {
                yield this.x,
                yield this.y,
                yield this.z,
                yield this.w
            }
        }
        class mn extends Dt {
            constructor(e=1, t=1, n={}) {
                super(),
                this.isRenderTarget = !0,
                this.width = e,
                this.height = t,
                this.depth = 1,
                this.scissor = new fn(0,0,e,t),
                this.scissorTest = !1,
                this.viewport = new fn(0,0,e,t);
                const i = {
                    width: e,
                    height: t,
                    depth: 1
                };
                n = Object.assign({
                    generateMipmaps: !1,
                    internalFormat: null,
                    minFilter: de,
                    depthBuffer: !0,
                    stencilBuffer: !1,
                    resolveDepthBuffer: !0,
                    resolveStencilBuffer: !0,
                    depthTexture: null,
                    samples: 0,
                    count: 1
                }, n);
                const r = new pn(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);
                r.flipY = !1,
                r.generateMipmaps = n.generateMipmaps,
                r.internalFormat = n.internalFormat,
                this.textures = [];
                const a = n.count;
                for (let e = 0; e < a; e++)
                    this.textures[e] = r.clone(),
                    this.textures[e].isRenderTargetTexture = !0,
                    this.textures[e].renderTarget = this;
                this.depthBuffer = n.depthBuffer,
                this.stencilBuffer = n.stencilBuffer,
                this.resolveDepthBuffer = n.resolveDepthBuffer,
                this.resolveStencilBuffer = n.resolveStencilBuffer,
                this._depthTexture = null,
                this.depthTexture = n.depthTexture,
                this.samples = n.samples
            }
            get texture() {
                return this.textures[0]
            }
            set texture(e) {
                this.textures[0] = e
            }
            set depthTexture(e) {
                null !== this._depthTexture && (this._depthTexture.renderTarget = null),
                null !== e && (e.renderTarget = this),
                this._depthTexture = e
            }
            get depthTexture() {
                return this._depthTexture
            }
            setSize(e, t, n=1) {
                if (this.width !== e || this.height !== t || this.depth !== n) {
                    this.width = e,
                    this.height = t,
                    this.depth = n;
                    for (let i = 0, r = this.textures.length; i < r; i++)
                        this.textures[i].image.width = e,
                        this.textures[i].image.height = t,
                        this.textures[i].image.depth = n;
                    this.dispose()
                }
                this.viewport.set(0, 0, e, t),
                this.scissor.set(0, 0, e, t)
            }
            clone() {
                return (new this.constructor).copy(this)
            }
            copy(e) {
                this.width = e.width,
                this.height = e.height,
                this.depth = e.depth,
                this.scissor.copy(e.scissor),
                this.scissorTest = e.scissorTest,
                this.viewport.copy(e.viewport),
                this.textures.length = 0;
                for (let t = 0, n = e.textures.length; t < n; t++) {
                    this.textures[t] = e.textures[t].clone(),
                    this.textures[t].isRenderTargetTexture = !0,
                    this.textures[t].renderTarget = this;
                    const n = Object.assign({}, e.textures[t].image);
                    this.textures[t].source = new hn(n)
                }
                return this.depthBuffer = e.depthBuffer,
                this.stencilBuffer = e.stencilBuffer,
                this.resolveDepthBuffer = e.resolveDepthBuffer,
                this.resolveStencilBuffer = e.resolveStencilBuffer,
                null !== e.depthTexture && (this.depthTexture = e.depthTexture.clone()),
                this.samples = e.samples,
                this
            }
            dispose() {
                this.dispatchEvent({
                    type: "dispose"
                })
            }
        }
        class gn extends mn {
            constructor(e=1, t=1, n={}) {
                super(e, t, n),
                this.isWebGLRenderTarget = !0
            }
        }
        class vn extends pn {
            constructor(e=null, t=1, n=1, i=1) {
                super(null),
                this.isDataArrayTexture = !0,
                this.image = {
                    data: e,
                    width: t,
                    height: n,
                    depth: i
                },
                this.magFilter = le,
                this.minFilter = le,
                this.wrapR = se,
                this.generateMipmaps = !1,
                this.flipY = !1,
                this.unpackAlignment = 1,
                this.layerUpdates = new Set
            }
            addLayerUpdate(e) {
                this.layerUpdates.add(e)
            }
            clearLayerUpdates() {
                this.layerUpdates.clear()
            }
        }
        class wn extends pn {
            constructor(e=null, t=1, n=1, i=1) {
                super(null),
                this.isData3DTexture = !0,
                this.image = {
                    data: e,
                    width: t,
                    height: n,
                    depth: i
                },
                this.magFilter = le,
                this.minFilter = le,
                this.wrapR = se,
                this.generateMipmaps = !1,
                this.flipY = !1,
                this.unpackAlignment = 1
            }
        }
        class yn {
            constructor(e=0, t=0, n=0, i=1) {
                this.isQuaternion = !0,
                this._x = e,
                this._y = t,
                this._z = n,
                this._w = i
            }
            static slerpFlat(e, t, n, i, r, a, s) {
                let o = n[i + 0]
                  , l = n[i + 1]
                  , c = n[i + 2]
                  , h = n[i + 3];
                const d = r[a + 0]
                  , u = r[a + 1]
                  , p = r[a + 2]
                  , f = r[a + 3];
                if (0 === s)
                    return e[t + 0] = o,
                    e[t + 1] = l,
                    e[t + 2] = c,
                    void (e[t + 3] = h);
                if (1 === s)
                    return e[t + 0] = d,
                    e[t + 1] = u,
                    e[t + 2] = p,
                    void (e[t + 3] = f);
                if (h !== f || o !== d || l !== u || c !== p) {
                    let e = 1 - s;
                    const t = o * d + l * u + c * p + h * f
                      , n = t >= 0 ? 1 : -1
                      , i = 1 - t * t;
                    if (i > Number.EPSILON) {
                        const r = Math.sqrt(i)
                          , a = Math.atan2(r, t * n);
                        e = Math.sin(e * a) / r,
                        s = Math.sin(s * a) / r
                    }
                    const r = s * n;
                    if (o = o * e + d * r,
                    l = l * e + u * r,
                    c = c * e + p * r,
                    h = h * e + f * r,
                    e === 1 - s) {
                        const e = 1 / Math.sqrt(o * o + l * l + c * c + h * h);
                        o *= e,
                        l *= e,
                        c *= e,
                        h *= e
                    }
                }
                e[t] = o,
                e[t + 1] = l,
                e[t + 2] = c,
                e[t + 3] = h
            }
            static multiplyQuaternionsFlat(e, t, n, i, r, a) {
                const s = n[i]
                  , o = n[i + 1]
                  , l = n[i + 2]
                  , c = n[i + 3]
                  , h = r[a]
                  , d = r[a + 1]
                  , u = r[a + 2]
                  , p = r[a + 3];
                return e[t] = s * p + c * h + o * u - l * d,
                e[t + 1] = o * p + c * d + l * h - s * u,
                e[t + 2] = l * p + c * u + s * d - o * h,
                e[t + 3] = c * p - s * h - o * d - l * u,
                e
            }
            get x() {
                return this._x
            }
            set x(e) {
                this._x = e,
                this._onChangeCallback()
            }
            get y() {
                return this._y
            }
            set y(e) {
                this._y = e,
                this._onChangeCallback()
            }
            get z() {
                return this._z
            }
            set z(e) {
                this._z = e,
                this._onChangeCallback()
            }
            get w() {
                return this._w
            }
            set w(e) {
                this._w = e,
                this._onChangeCallback()
            }
            set(e, t, n, i) {
                return this._x = e,
                this._y = t,
                this._z = n,
                this._w = i,
                this._onChangeCallback(),
                this
            }
            clone() {
                return new this.constructor(this._x,this._y,this._z,this._w)
            }
            copy(e) {
                return this._x = e.x,
                this._y = e.y,
                this._z = e.z,
                this._w = e.w,
                this._onChangeCallback(),
                this
            }
            setFromEuler(e, t=!0) {
                const n = e._x
                  , i = e._y
                  , r = e._z
                  , a = e._order
                  , s = Math.cos
                  , o = Math.sin
                  , l = s(n / 2)
                  , c = s(i / 2)
                  , h = s(r / 2)
                  , d = o(n / 2)
                  , u = o(i / 2)
                  , p = o(r / 2);
                switch (a) {
                case "XYZ":
                    this._x = d * c * h + l * u * p,
                    this._y = l * u * h - d * c * p,
                    this._z = l * c * p + d * u * h,
                    this._w = l * c * h - d * u * p;
                    break;
                case "YXZ":
                    this._x = d * c * h + l * u * p,
                    this._y = l * u * h - d * c * p,
                    this._z = l * c * p - d * u * h,
                    this._w = l * c * h + d * u * p;
                    break;
                case "ZXY":
                    this._x = d * c * h - l * u * p,
                    this._y = l * u * h + d * c * p,
                    this._z = l * c * p + d * u * h,
                    this._w = l * c * h - d * u * p;
                    break;
                case "ZYX":
                    this._x = d * c * h - l * u * p,
                    this._y = l * u * h + d * c * p,
                    this._z = l * c * p - d * u * h,
                    this._w = l * c * h + d * u * p;
                    break;
                case "YZX":
                    this._x = d * c * h + l * u * p,
                    this._y = l * u * h + d * c * p,
                    this._z = l * c * p - d * u * h,
                    this._w = l * c * h - d * u * p;
                    break;
                case "XZY":
                    this._x = d * c * h - l * u * p,
                    this._y = l * u * h - d * c * p,
                    this._z = l * c * p + d * u * h,
                    this._w = l * c * h + d * u * p;
                    break;
                default:
                    console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a)
                }
                return !0 === t && this._onChangeCallback(),
                this
            }
            setFromAxisAngle(e, t) {
                const n = t / 2
                  , i = Math.sin(n);
                return this._x = e.x * i,
                this._y = e.y * i,
                this._z = e.z * i,
                this._w = Math.cos(n),
                this._onChangeCallback(),
                this
            }
            setFromRotationMatrix(e) {
                const t = e.elements
                  , n = t[0]
                  , i = t[4]
                  , r = t[8]
                  , a = t[1]
                  , s = t[5]
                  , o = t[9]
                  , l = t[2]
                  , c = t[6]
                  , h = t[10]
                  , d = n + s + h;
                if (d > 0) {
                    const e = .5 / Math.sqrt(d + 1);
                    this._w = .25 / e,
                    this._x = (c - o) * e,
                    this._y = (r - l) * e,
                    this._z = (a - i) * e
                } else if (n > s && n > h) {
                    const e = 2 * Math.sqrt(1 + n - s - h);
                    this._w = (c - o) / e,
                    this._x = .25 * e,
                    this._y = (i + a) / e,
                    this._z = (r + l) / e
                } else if (s > h) {
                    const e = 2 * Math.sqrt(1 + s - n - h);
                    this._w = (r - l) / e,
                    this._x = (i + a) / e,
                    this._y = .25 * e,
                    this._z = (o + c) / e
                } else {
                    const e = 2 * Math.sqrt(1 + h - n - s);
                    this._w = (a - i) / e,
                    this._x = (r + l) / e,
                    this._y = (o + c) / e,
                    this._z = .25 * e
                }
                return this._onChangeCallback(),
                this
            }
            setFromUnitVectors(e, t) {
                let n = e.dot(t) + 1;
                return n < Number.EPSILON ? (n = 0,
                Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y,
                this._y = e.x,
                this._z = 0,
                this._w = n) : (this._x = 0,
                this._y = -e.z,
                this._z = e.y,
                this._w = n)) : (this._x = e.y * t.z - e.z * t.y,
                this._y = e.z * t.x - e.x * t.z,
                this._z = e.x * t.y - e.y * t.x,
                this._w = n),
                this.normalize()
            }
            angleTo(e) {
                return 2 * Math.acos(Math.abs(Ft(this.dot(e), -1, 1)))
            }
            rotateTowards(e, t) {
                const n = this.angleTo(e);
                if (0 === n)
                    return this;
                const i = Math.min(1, t / n);
                return this.slerp(e, i),
                this
            }
            identity() {
                return this.set(0, 0, 0, 1)
            }
            invert() {
                return this.conjugate()
            }
            conjugate() {
                return this._x *= -1,
                this._y *= -1,
                this._z *= -1,
                this._onChangeCallback(),
                this
            }
            dot(e) {
                return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
            }
            lengthSq() {
                return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
            }
            length() {
                return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
            }
            normalize() {
                let e = this.length();
                return 0 === e ? (this._x = 0,
                this._y = 0,
                this._z = 0,
                this._w = 1) : (e = 1 / e,
                this._x = this._x * e,
                this._y = this._y * e,
                this._z = this._z * e,
                this._w = this._w * e),
                this._onChangeCallback(),
                this
            }
            multiply(e) {
                return this.multiplyQuaternions(this, e)
            }
            premultiply(e) {
                return this.multiplyQuaternions(e, this)
            }
            multiplyQuaternions(e, t) {
                const n = e._x
                  , i = e._y
                  , r = e._z
                  , a = e._w
                  , s = t._x
                  , o = t._y
                  , l = t._z
                  , c = t._w;
                return this._x = n * c + a * s + i * l - r * o,
                this._y = i * c + a * o + r * s - n * l,
                this._z = r * c + a * l + n * o - i * s,
                this._w = a * c - n * s - i * o - r * l,
                this._onChangeCallback(),
                this
            }
            slerp(e, t) {
                if (0 === t)
                    return this;
                if (1 === t)
                    return this.copy(e);
                const n = this._x
                  , i = this._y
                  , r = this._z
                  , a = this._w;
                let s = a * e._w + n * e._x + i * e._y + r * e._z;
                if (s < 0 ? (this._w = -e._w,
                this._x = -e._x,
                this._y = -e._y,
                this._z = -e._z,
                s = -s) : this.copy(e),
                s >= 1)
                    return this._w = a,
                    this._x = n,
                    this._y = i,
                    this._z = r,
                    this;
                const o = 1 - s * s;
                if (o <= Number.EPSILON) {
                    const e = 1 - t;
                    return this._w = e * a + t * this._w,
                    this._x = e * n + t * this._x,
                    this._y = e * i + t * this._y,
                    this._z = e * r + t * this._z,
                    this.normalize(),
                    this
                }
                const l = Math.sqrt(o)
                  , c = Math.atan2(l, s)
                  , h = Math.sin((1 - t) * c) / l
                  , d = Math.sin(t * c) / l;
                return this._w = a * h + this._w * d,
                this._x = n * h + this._x * d,
                this._y = i * h + this._y * d,
                this._z = r * h + this._z * d,
                this._onChangeCallback(),
                this
            }
            slerpQuaternions(e, t, n) {
                return this.copy(e).slerp(t, n)
            }
            random() {
                const e = 2 * Math.PI * Math.random()
                  , t = 2 * Math.PI * Math.random()
                  , n = Math.random()
                  , i = Math.sqrt(1 - n)
                  , r = Math.sqrt(n);
                return this.set(i * Math.sin(e), i * Math.cos(e), r * Math.sin(t), r * Math.cos(t))
            }
            equals(e) {
                return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
            }
            fromArray(e, t=0) {
                return this._x = e[t],
                this._y = e[t + 1],
                this._z = e[t + 2],
                this._w = e[t + 3],
                this._onChangeCallback(),
                this
            }
            toArray(e=[], t=0) {
                return e[t] = this._x,
                e[t + 1] = this._y,
                e[t + 2] = this._z,
                e[t + 3] = this._w,
                e
            }
            fromBufferAttribute(e, t) {
                return this._x = e.getX(t),
                this._y = e.getY(t),
                this._z = e.getZ(t),
                this._w = e.getW(t),
                this._onChangeCallback(),
                this
            }
            toJSON() {
                return this.toArray()
            }
            _onChange(e) {
                return this._onChangeCallback = e,
                this
            }
            _onChangeCallback() {}
            *[Symbol.iterator]() {
                yield this._x,
                yield this._y,
                yield this._z,
                yield this._w
            }
        }
        class bn {
            constructor(e=0, t=0, n=0) {
                bn.prototype.isVector3 = !0,
                this.x = e,
                this.y = t,
                this.z = n
            }
            set(e, t, n) {
                return void 0 === n && (n = this.z),
                this.x = e,
                this.y = t,
                this.z = n,
                this
            }
            setScalar(e) {
                return this.x = e,
                this.y = e,
                this.z = e,
                this
            }
            setX(e) {
                return this.x = e,
                this
            }
            setY(e) {
                return this.y = e,
                this
            }
            setZ(e) {
                return this.z = e,
                this
            }
            setComponent(e, t) {
                switch (e) {
                case 0:
                    this.x = t;
                    break;
                case 1:
                    this.y = t;
                    break;
                case 2:
                    this.z = t;
                    break;
                default:
                    throw new Error("index is out of range: " + e)
                }
                return this
            }
            getComponent(e) {
                switch (e) {
                case 0:
                    return this.x;
                case 1:
                    return this.y;
                case 2:
                    return this.z;
                default:
                    throw new Error("index is out of range: " + e)
                }
            }
            clone() {
                return new this.constructor(this.x,this.y,this.z)
            }
            copy(e) {
                return this.x = e.x,
                this.y = e.y,
                this.z = e.z,
                this
            }
            add(e) {
                return this.x += e.x,
                this.y += e.y,
                this.z += e.z,
                this
            }
            addScalar(e) {
                return this.x += e,
                this.y += e,
                this.z += e,
                this
            }
            addVectors(e, t) {
                return this.x = e.x + t.x,
                this.y = e.y + t.y,
                this.z = e.z + t.z,
                this
            }
            addScaledVector(e, t) {
                return this.x += e.x * t,
                this.y += e.y * t,
                this.z += e.z * t,
                this
            }
            sub(e) {
                return this.x -= e.x,
                this.y -= e.y,
                this.z -= e.z,
                this
            }
            subScalar(e) {
                return this.x -= e,
                this.y -= e,
                this.z -= e,
                this
            }
            subVectors(e, t) {
                return this.x = e.x - t.x,
                this.y = e.y - t.y,
                this.z = e.z - t.z,
                this
            }
            multiply(e) {
                return this.x *= e.x,
                this.y *= e.y,
                this.z *= e.z,
                this
            }
            multiplyScalar(e) {
                return this.x *= e,
                this.y *= e,
                this.z *= e,
                this
            }
            multiplyVectors(e, t) {
                return this.x = e.x * t.x,
                this.y = e.y * t.y,
                this.z = e.z * t.z,
                this
            }
            applyEuler(e) {
                return this.applyQuaternion(xn.setFromEuler(e))
            }
            applyAxisAngle(e, t) {
                return this.applyQuaternion(xn.setFromAxisAngle(e, t))
            }
            applyMatrix3(e) {
                const t = this.x
                  , n = this.y
                  , i = this.z
                  , r = e.elements;
                return this.x = r[0] * t + r[3] * n + r[6] * i,
                this.y = r[1] * t + r[4] * n + r[7] * i,
                this.z = r[2] * t + r[5] * n + r[8] * i,
                this
            }
            applyNormalMatrix(e) {
                return this.applyMatrix3(e).normalize()
            }
            applyMatrix4(e) {
                const t = this.x
                  , n = this.y
                  , i = this.z
                  , r = e.elements
                  , a = 1 / (r[3] * t + r[7] * n + r[11] * i + r[15]);
                return this.x = (r[0] * t + r[4] * n + r[8] * i + r[12]) * a,
                this.y = (r[1] * t + r[5] * n + r[9] * i + r[13]) * a,
                this.z = (r[2] * t + r[6] * n + r[10] * i + r[14]) * a,
                this
            }
            applyQuaternion(e) {
                const t = this.x
                  , n = this.y
                  , i = this.z
                  , r = e.x
                  , a = e.y
                  , s = e.z
                  , o = e.w
                  , l = 2 * (a * i - s * n)
                  , c = 2 * (s * t - r * i)
                  , h = 2 * (r * n - a * t);
                return this.x = t + o * l + a * h - s * c,
                this.y = n + o * c + s * l - r * h,
                this.z = i + o * h + r * c - a * l,
                this
            }
            project(e) {
                return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)
            }
            unproject(e) {
                return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)
            }
            transformDirection(e) {
                const t = this.x
                  , n = this.y
                  , i = this.z
                  , r = e.elements;
                return this.x = r[0] * t + r[4] * n + r[8] * i,
                this.y = r[1] * t + r[5] * n + r[9] * i,
                this.z = r[2] * t + r[6] * n + r[10] * i,
                this.normalize()
            }
            divide(e) {
                return this.x /= e.x,
                this.y /= e.y,
                this.z /= e.z,
                this
            }
            divideScalar(e) {
                return this.multiplyScalar(1 / e)
            }
            min(e) {
                return this.x = Math.min(this.x, e.x),
                this.y = Math.min(this.y, e.y),
                this.z = Math.min(this.z, e.z),
                this
            }
            max(e) {
                return this.x = Math.max(this.x, e.x),
                this.y = Math.max(this.y, e.y),
                this.z = Math.max(this.z, e.z),
                this
            }
            clamp(e, t) {
                return this.x = Ft(this.x, e.x, t.x),
                this.y = Ft(this.y, e.y, t.y),
                this.z = Ft(this.z, e.z, t.z),
                this
            }
            clampScalar(e, t) {
                return this.x = Ft(this.x, e, t),
                this.y = Ft(this.y, e, t),
                this.z = Ft(this.z, e, t),
                this
            }
            clampLength(e, t) {
                const n = this.length();
                return this.divideScalar(n || 1).multiplyScalar(Ft(n, e, t))
            }
            floor() {
                return this.x = Math.floor(this.x),
                this.y = Math.floor(this.y),
                this.z = Math.floor(this.z),
                this
            }
            ceil() {
                return this.x = Math.ceil(this.x),
                this.y = Math.ceil(this.y),
                this.z = Math.ceil(this.z),
                this
            }
            round() {
                return this.x = Math.round(this.x),
                this.y = Math.round(this.y),
                this.z = Math.round(this.z),
                this
            }
            roundToZero() {
                return this.x = Math.trunc(this.x),
                this.y = Math.trunc(this.y),
                this.z = Math.trunc(this.z),
                this
            }
            negate() {
                return this.x = -this.x,
                this.y = -this.y,
                this.z = -this.z,
                this
            }
            dot(e) {
                return this.x * e.x + this.y * e.y + this.z * e.z
            }
            lengthSq() {
                return this.x * this.x + this.y * this.y + this.z * this.z
            }
            length() {
                return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
            }
            manhattanLength() {
                return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
            }
            normalize() {
                return this.divideScalar(this.length() || 1)
            }
            setLength(e) {
                return this.normalize().multiplyScalar(e)
            }
            lerp(e, t) {
                return this.x += (e.x - this.x) * t,
                this.y += (e.y - this.y) * t,
                this.z += (e.z - this.z) * t,
                this
            }
            lerpVectors(e, t, n) {
                return this.x = e.x + (t.x - e.x) * n,
                this.y = e.y + (t.y - e.y) * n,
                this.z = e.z + (t.z - e.z) * n,
                this
            }
            cross(e) {
                return this.crossVectors(this, e)
            }
            crossVectors(e, t) {
                const n = e.x
                  , i = e.y
                  , r = e.z
                  , a = t.x
                  , s = t.y
                  , o = t.z;
                return this.x = i * o - r * s,
                this.y = r * a - n * o,
                this.z = n * s - i * a,
                this
            }
            projectOnVector(e) {
                const t = e.lengthSq();
                if (0 === t)
                    return this.set(0, 0, 0);
                const n = e.dot(this) / t;
                return this.copy(e).multiplyScalar(n)
            }
            projectOnPlane(e) {
                return An.copy(this).projectOnVector(e),
                this.sub(An)
            }
            reflect(e) {
                return this.sub(An.copy(e).multiplyScalar(2 * this.dot(e)))
            }
            angleTo(e) {
                const t = Math.sqrt(this.lengthSq() * e.lengthSq());
                if (0 === t)
                    return Math.PI / 2;
                const n = this.dot(e) / t;
                return Math.acos(Ft(n, -1, 1))
            }
            distanceTo(e) {
                return Math.sqrt(this.distanceToSquared(e))
            }
            distanceToSquared(e) {
                const t = this.x - e.x
                  , n = this.y - e.y
                  , i = this.z - e.z;
                return t * t + n * n + i * i
            }
            manhattanDistanceTo(e) {
                return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z)
            }
            setFromSpherical(e) {
                return this.setFromSphericalCoords(e.radius, e.phi, e.theta)
            }
            setFromSphericalCoords(e, t, n) {
                const i = Math.sin(t) * e;
                return this.x = i * Math.sin(n),
                this.y = Math.cos(t) * e,
                this.z = i * Math.cos(n),
                this
            }
            setFromCylindrical(e) {
                return this.setFromCylindricalCoords(e.radius, e.theta, e.y)
            }
            setFromCylindricalCoords(e, t, n) {
                return this.x = e * Math.sin(t),
                this.y = n,
                this.z = e * Math.cos(t),
                this
            }
            setFromMatrixPosition(e) {
                const t = e.elements;
                return this.x = t[12],
                this.y = t[13],
                this.z = t[14],
                this
            }
            setFromMatrixScale(e) {
                const t = this.setFromMatrixColumn(e, 0).length()
                  , n = this.setFromMatrixColumn(e, 1).length()
                  , i = this.setFromMatrixColumn(e, 2).length();
                return this.x = t,
                this.y = n,
                this.z = i,
                this
            }
            setFromMatrixColumn(e, t) {
                return this.fromArray(e.elements, 4 * t)
            }
            setFromMatrix3Column(e, t) {
                return this.fromArray(e.elements, 3 * t)
            }
            setFromEuler(e) {
                return this.x = e._x,
                this.y = e._y,
                this.z = e._z,
                this
            }
            setFromColor(e) {
                return this.x = e.r,
                this.y = e.g,
                this.z = e.b,
                this
            }
            equals(e) {
                return e.x === this.x && e.y === this.y && e.z === this.z
            }
            fromArray(e, t=0) {
                return this.x = e[t],
                this.y = e[t + 1],
                this.z = e[t + 2],
                this
            }
            toArray(e=[], t=0) {
                return e[t] = this.x,
                e[t + 1] = this.y,
                e[t + 2] = this.z,
                e
            }
            fromBufferAttribute(e, t) {
                return this.x = e.getX(t),
                this.y = e.getY(t),
                this.z = e.getZ(t),
                this
            }
            random() {
                return this.x = Math.random(),
                this.y = Math.random(),
                this.z = Math.random(),
                this
            }
            randomDirection() {
                const e = Math.random() * Math.PI * 2
                  , t = 2 * Math.random() - 1
                  , n = Math.sqrt(1 - t * t);
                return this.x = n * Math.cos(e),
                this.y = t,
                this.z = n * Math.sin(e),
                this
            }
            *[Symbol.iterator]() {
                yield this.x,
                yield this.y,
                yield this.z
            }
        }
        const An = new bn
          , xn = new yn;
        class kn {
            constructor(e=new bn(1 / 0,1 / 0,1 / 0), t=new bn(-1 / 0,-1 / 0,-1 / 0)) {
                this.isBox3 = !0,
                this.min = e,
                this.max = t
            }
            set(e, t) {
                return this.min.copy(e),
                this.max.copy(t),
                this
            }
            setFromArray(e) {
                this.makeEmpty();
                for (let t = 0, n = e.length; t < n; t += 3)
                    this.expandByPoint(Sn.fromArray(e, t));
                return this
            }
            setFromBufferAttribute(e) {
                this.makeEmpty();
                for (let t = 0, n = e.count; t < n; t++)
                    this.expandByPoint(Sn.fromBufferAttribute(e, t));
                return this
            }
            setFromPoints(e) {
                this.makeEmpty();
                for (let t = 0, n = e.length; t < n; t++)
                    this.expandByPoint(e[t]);
                return this
            }
            setFromCenterAndSize(e, t) {
                const n = Sn.copy(t).multiplyScalar(.5);
                return this.min.copy(e).sub(n),
                this.max.copy(e).add(n),
                this
            }
            setFromObject(e, t=!1) {
                return this.makeEmpty(),
                this.expandByObject(e, t)
            }
            clone() {
                return (new this.constructor).copy(this)
            }
            copy(e) {
                return this.min.copy(e.min),
                this.max.copy(e.max),
                this
            }
            makeEmpty() {
                return this.min.x = this.min.y = this.min.z = 1 / 0,
                this.max.x = this.max.y = this.max.z = -1 / 0,
                this
            }
            isEmpty() {
                return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
            }
            getCenter(e) {
                return this.isEmpty() ? e.set(0, 0, 0) : e.addVectors(this.min, this.max).multiplyScalar(.5)
            }
            getSize(e) {
                return this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min)
            }
            expandByPoint(e) {
                return this.min.min(e),
                this.max.max(e),
                this
            }
            expandByVector(e) {
                return this.min.sub(e),
                this.max.add(e),
                this
            }
            expandByScalar(e) {
                return this.min.addScalar(-e),
                this.max.addScalar(e),
                this
            }
            expandByObject(e, t=!1) {
                e.updateWorldMatrix(!1, !1);
                const n = e.geometry;
                if (void 0 !== n) {
                    const i = n.getAttribute("position");
                    if (!0 === t && void 0 !== i && !0 !== e.isInstancedMesh)
                        for (let t = 0, n = i.count; t < n; t++)
                            !0 === e.isMesh ? e.getVertexPosition(t, Sn) : Sn.fromBufferAttribute(i, t),
                            Sn.applyMatrix4(e.matrixWorld),
                            this.expandByPoint(Sn);
                    else
                        void 0 !== e.boundingBox ? (null === e.boundingBox && e.computeBoundingBox(),
                        Mn.copy(e.boundingBox)) : (null === n.boundingBox && n.computeBoundingBox(),
                        Mn.copy(n.boundingBox)),
                        Mn.applyMatrix4(e.matrixWorld),
                        this.union(Mn)
                }
                const i = e.children;
                for (let e = 0, n = i.length; e < n; e++)
                    this.expandByObject(i[e], t);
                return this
            }
            containsPoint(e) {
                return e.x >= this.min.x && e.x <= this.max.x && e.y >= this.min.y && e.y <= this.max.y && e.z >= this.min.z && e.z <= this.max.z
            }
            containsBox(e) {
                return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z
            }
            getParameter(e, t) {
                return t.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
            }
            intersectsBox(e) {
                return e.max.x >= this.min.x && e.min.x <= this.max.x && e.max.y >= this.min.y && e.min.y <= this.max.y && e.max.z >= this.min.z && e.min.z <= this.max.z
            }
            intersectsSphere(e) {
                return this.clampPoint(e.center, Sn),
                Sn.distanceToSquared(e.center) <= e.radius * e.radius
            }
            intersectsPlane(e) {
                let t, n;
                return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
                n = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
                n = e.normal.x * this.min.x),
                e.normal.y > 0 ? (t += e.normal.y * this.min.y,
                n += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
                n += e.normal.y * this.min.y),
                e.normal.z > 0 ? (t += e.normal.z * this.min.z,
                n += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
                n += e.normal.z * this.min.z),
                t <= -e.constant && n >= -e.constant
            }
            intersectsTriangle(e) {
                if (this.isEmpty())
                    return !1;
                this.getCenter(Ln),
                Dn.subVectors(this.max, Ln),
                _n.subVectors(e.a, Ln),
                Tn.subVectors(e.b, Ln),
                Cn.subVectors(e.c, Ln),
                Pn.subVectors(Tn, _n),
                In.subVectors(Cn, Tn),
                Rn.subVectors(_n, Cn);
                let t = [0, -Pn.z, Pn.y, 0, -In.z, In.y, 0, -Rn.z, Rn.y, Pn.z, 0, -Pn.x, In.z, 0, -In.x, Rn.z, 0, -Rn.x, -Pn.y, Pn.x, 0, -In.y, In.x, 0, -Rn.y, Rn.x, 0];
                return !!Un(t, _n, Tn, Cn, Dn) && (t = [1, 0, 0, 0, 1, 0, 0, 0, 1],
                !!Un(t, _n, Tn, Cn, Dn) && (Nn.crossVectors(Pn, In),
                t = [Nn.x, Nn.y, Nn.z],
                Un(t, _n, Tn, Cn, Dn)))
            }
            clampPoint(e, t) {
                return t.copy(e).clamp(this.min, this.max)
            }
            distanceToPoint(e) {
                return this.clampPoint(e, Sn).distanceTo(e)
            }
            getBoundingSphere(e) {
                return this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center),
                e.radius = .5 * this.getSize(Sn).length()),
                e
            }
            intersect(e) {
                return this.min.max(e.min),
                this.max.min(e.max),
                this.isEmpty() && this.makeEmpty(),
                this
            }
            union(e) {
                return this.min.min(e.min),
                this.max.max(e.max),
                this
            }
            applyMatrix4(e) {
                return this.isEmpty() || (En[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
                En[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
                En[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
                En[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
                En[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
                En[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
                En[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
                En[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
                this.setFromPoints(En)),
                this
            }
            translate(e) {
                return this.min.add(e),
                this.max.add(e),
                this
            }
            equals(e) {
                return e.min.equals(this.min) && e.max.equals(this.max)
            }
        }
        const En = [new bn, new bn, new bn, new bn, new bn, new bn, new bn, new bn]
          , Sn = new bn
          , Mn = new kn
          , _n = new bn
          , Tn = new bn
          , Cn = new bn
          , Pn = new bn
          , In = new bn
          , Rn = new bn
          , Ln = new bn
          , Dn = new bn
          , Nn = new bn
          , Bn = new bn;
        function Un(e, t, n, i, r) {
            for (let a = 0, s = e.length - 3; a <= s; a += 3) {
                Bn.fromArray(e, a);
                const s = r.x * Math.abs(Bn.x) + r.y * Math.abs(Bn.y) + r.z * Math.abs(Bn.z)
                  , o = t.dot(Bn)
                  , l = n.dot(Bn)
                  , c = i.dot(Bn);
                if (Math.max(-Math.max(o, l, c), Math.min(o, l, c)) > s)
                    return !1
            }
            return !0
        }
        const zn = new kn
          , On = new bn
          , Fn = new bn;
        class Wn {
            constructor(e=new bn, t=-1) {
                this.isSphere = !0,
                this.center = e,
                this.radius = t
            }
            set(e, t) {
                return this.center.copy(e),
                this.radius = t,
                this
            }
            setFromPoints(e, t) {
                const n = this.center;
                void 0 !== t ? n.copy(t) : zn.setFromPoints(e).getCenter(n);
                let i = 0;
                for (let t = 0, r = e.length; t < r; t++)
                    i = Math.max(i, n.distanceToSquared(e[t]));
                return this.radius = Math.sqrt(i),
                this
            }
            copy(e) {
                return this.center.copy(e.center),
                this.radius = e.radius,
                this
            }
            isEmpty() {
                return this.radius < 0
            }
            makeEmpty() {
                return this.center.set(0, 0, 0),
                this.radius = -1,
                this
            }
            containsPoint(e) {
                return e.distanceToSquared(this.center) <= this.radius * this.radius
            }
            distanceToPoint(e) {
                return e.distanceTo(this.center) - this.radius
            }
            intersectsSphere(e) {
                const t = this.radius + e.radius;
                return e.center.distanceToSquared(this.center) <= t * t
            }
            intersectsBox(e) {
                return e.intersectsSphere(this)
            }
            intersectsPlane(e) {
                return Math.abs(e.distanceToPoint(this.center)) <= this.radius
            }
            clampPoint(e, t) {
                const n = this.center.distanceToSquared(e);
                return t.copy(e),
                n > this.radius * this.radius && (t.sub(this.center).normalize(),
                t.multiplyScalar(this.radius).add(this.center)),
                t
            }
            getBoundingBox(e) {
                return this.isEmpty() ? (e.makeEmpty(),
                e) : (e.set(this.center, this.center),
                e.expandByScalar(this.radius),
                e)
            }
            applyMatrix4(e) {
                return this.center.applyMatrix4(e),
                this.radius = this.radius * e.getMaxScaleOnAxis(),
                this
            }
            translate(e) {
                return this.center.add(e),
                this
            }
            expandByPoint(e) {
                if (this.isEmpty())
                    return this.center.copy(e),
                    this.radius = 0,
                    this;
                On.subVectors(e, this.center);
                const t = On.lengthSq();
                if (t > this.radius * this.radius) {
                    const e = Math.sqrt(t)
                      , n = .5 * (e - this.radius);
                    this.center.addScaledVector(On, n / e),
                    this.radius += n
                }
                return this
            }
            union(e) {
                return e.isEmpty() ? this : this.isEmpty() ? (this.copy(e),
                this) : (!0 === this.center.equals(e.center) ? this.radius = Math.max(this.radius, e.radius) : (Fn.subVectors(e.center, this.center).setLength(e.radius),
                this.expandByPoint(On.copy(e.center).add(Fn)),
                this.expandByPoint(On.copy(e.center).sub(Fn))),
                this)
            }
            equals(e) {
                return e.center.equals(this.center) && e.radius === this.radius
            }
            clone() {
                return (new this.constructor).copy(this)
            }
        }
        const Hn = new bn
          , Vn = new bn
          , Gn = new bn
          , jn = new bn
          , Qn = new bn
          , Kn = new bn
          , qn = new bn;
        class Yn {
            constructor(e=new bn, t=new bn(0,0,-1)) {
                this.origin = e,
                this.direction = t
            }
            set(e, t) {
                return this.origin.copy(e),
                this.direction.copy(t),
                this
            }
            copy(e) {
                return this.origin.copy(e.origin),
                this.direction.copy(e.direction),
                this
            }
            at(e, t) {
                return t.copy(this.origin).addScaledVector(this.direction, e)
            }
            lookAt(e) {
                return this.direction.copy(e).sub(this.origin).normalize(),
                this
            }
            recast(e) {
                return this.origin.copy(this.at(e, Hn)),
                this
            }
            closestPointToPoint(e, t) {
                t.subVectors(e, this.origin);
                const n = t.dot(this.direction);
                return n < 0 ? t.copy(this.origin) : t.copy(this.origin).addScaledVector(this.direction, n)
            }
            distanceToPoint(e) {
                return Math.sqrt(this.distanceSqToPoint(e))
            }
            distanceSqToPoint(e) {
                const t = Hn.subVectors(e, this.origin).dot(this.direction);
                return t < 0 ? this.origin.distanceToSquared(e) : (Hn.copy(this.origin).addScaledVector(this.direction, t),
                Hn.distanceToSquared(e))
            }
            distanceSqToSegment(e, t, n, i) {
                Vn.copy(e).add(t).multiplyScalar(.5),
                Gn.copy(t).sub(e).normalize(),
                jn.copy(this.origin).sub(Vn);
                const r = .5 * e.distanceTo(t)
                  , a = -this.direction.dot(Gn)
                  , s = jn.dot(this.direction)
                  , o = -jn.dot(Gn)
                  , l = jn.lengthSq()
                  , c = Math.abs(1 - a * a);
                let h, d, u, p;
                if (c > 0)
                    if (h = a * o - s,
                    d = a * s - o,
                    p = r * c,
                    h >= 0)
                        if (d >= -p)
                            if (d <= p) {
                                const e = 1 / c;
                                h *= e,
                                d *= e,
                                u = h * (h + a * d + 2 * s) + d * (a * h + d + 2 * o) + l
                            } else
                                d = r,
                                h = Math.max(0, -(a * d + s)),
                                u = -h * h + d * (d + 2 * o) + l;
                        else
                            d = -r,
                            h = Math.max(0, -(a * d + s)),
                            u = -h * h + d * (d + 2 * o) + l;
                    else
                        d <= -p ? (h = Math.max(0, -(-a * r + s)),
                        d = h > 0 ? -r : Math.min(Math.max(-r, -o), r),
                        u = -h * h + d * (d + 2 * o) + l) : d <= p ? (h = 0,
                        d = Math.min(Math.max(-r, -o), r),
                        u = d * (d + 2 * o) + l) : (h = Math.max(0, -(a * r + s)),
                        d = h > 0 ? r : Math.min(Math.max(-r, -o), r),
                        u = -h * h + d * (d + 2 * o) + l);
                else
                    d = a > 0 ? -r : r,
                    h = Math.max(0, -(a * d + s)),
                    u = -h * h + d * (d + 2 * o) + l;
                return n && n.copy(this.origin).addScaledVector(this.direction, h),
                i && i.copy(Vn).addScaledVector(Gn, d),
                u
            }
            intersectSphere(e, t) {
                Hn.subVectors(e.center, this.origin);
                const n = Hn.dot(this.direction)
                  , i = Hn.dot(Hn) - n * n
                  , r = e.radius * e.radius;
                if (i > r)
                    return null;
                const a = Math.sqrt(r - i)
                  , s = n - a
                  , o = n + a;
                return o < 0 ? null : s < 0 ? this.at(o, t) : this.at(s, t)
            }
            intersectsSphere(e) {
                return this.distanceSqToPoint(e.center) <= e.radius * e.radius
            }
            distanceToPlane(e) {
                const t = e.normal.dot(this.direction);
                if (0 === t)
                    return 0 === e.distanceToPoint(this.origin) ? 0 : null;
                const n = -(this.origin.dot(e.normal) + e.constant) / t;
                return n >= 0 ? n : null
            }
            intersectPlane(e, t) {
                const n = this.distanceToPlane(e);
                return null === n ? null : this.at(n, t)
            }
            intersectsPlane(e) {
                const t = e.distanceToPoint(this.origin);
                if (0 === t)
                    return !0;
                return e.normal.dot(this.direction) * t < 0
            }
            intersectBox(e, t) {
                let n, i, r, a, s, o;
                const l = 1 / this.direction.x
                  , c = 1 / this.direction.y
                  , h = 1 / this.direction.z
                  , d = this.origin;
                return l >= 0 ? (n = (e.min.x - d.x) * l,
                i = (e.max.x - d.x) * l) : (n = (e.max.x - d.x) * l,
                i = (e.min.x - d.x) * l),
                c >= 0 ? (r = (e.min.y - d.y) * c,
                a = (e.max.y - d.y) * c) : (r = (e.max.y - d.y) * c,
                a = (e.min.y - d.y) * c),
                n > a || r > i ? null : ((r > n || isNaN(n)) && (n = r),
                (a < i || isNaN(i)) && (i = a),
                h >= 0 ? (s = (e.min.z - d.z) * h,
                o = (e.max.z - d.z) * h) : (s = (e.max.z - d.z) * h,
                o = (e.min.z - d.z) * h),
                n > o || s > i ? null : ((s > n || n != n) && (n = s),
                (o < i || i != i) && (i = o),
                i < 0 ? null : this.at(n >= 0 ? n : i, t)))
            }
            intersectsBox(e) {
                return null !== this.intersectBox(e, Hn)
            }
            intersectTriangle(e, t, n, i, r) {
                Qn.subVectors(t, e),
                Kn.subVectors(n, e),
                qn.crossVectors(Qn, Kn);
                let a, s = this.direction.dot(qn);
                if (s > 0) {
                    if (i)
                        return null;
                    a = 1
                } else {
                    if (!(s < 0))
                        return null;
                    a = -1,
                    s = -s
                }
                jn.subVectors(this.origin, e);
                const o = a * this.direction.dot(Kn.crossVectors(jn, Kn));
                if (o < 0)
                    return null;
                const l = a * this.direction.dot(Qn.cross(jn));
                if (l < 0)
                    return null;
                if (o + l > s)
                    return null;
                const c = -a * jn.dot(qn);
                return c < 0 ? null : this.at(c / s, r)
            }
            applyMatrix4(e) {
                return this.origin.applyMatrix4(e),
                this.direction.transformDirection(e),
                this
            }
            equals(e) {
                return e.origin.equals(this.origin) && e.direction.equals(this.direction)
            }
            clone() {
                return (new this.constructor).copy(this)
            }
        }
        class Xn {
            constructor(e, t, n, i, r, a, s, o, l, c, h, d, u, p, f, m) {
                Xn.prototype.isMatrix4 = !0,
                this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
                void 0 !== e && this.set(e, t, n, i, r, a, s, o, l, c, h, d, u, p, f, m)
            }
            set(e, t, n, i, r, a, s, o, l, c, h, d, u, p, f, m) {
                const g = this.elements;
                return g[0] = e,
                g[4] = t,
                g[8] = n,
                g[12] = i,
                g[1] = r,
                g[5] = a,
                g[9] = s,
                g[13] = o,
                g[2] = l,
                g[6] = c,
                g[10] = h,
                g[14] = d,
                g[3] = u,
                g[7] = p,
                g[11] = f,
                g[15] = m,
                this
            }
            identity() {
                return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
                this
            }
            clone() {
                return (new Xn).fromArray(this.elements)
            }
            copy(e) {
                const t = this.elements
                  , n = e.elements;
                return t[0] = n[0],
                t[1] = n[1],
                t[2] = n[2],
                t[3] = n[3],
                t[4] = n[4],
                t[5] = n[5],
                t[6] = n[6],
                t[7] = n[7],
                t[8] = n[8],
                t[9] = n[9],
                t[10] = n[10],
                t[11] = n[11],
                t[12] = n[12],
                t[13] = n[13],
                t[14] = n[14],
                t[15] = n[15],
                this
            }
            copyPosition(e) {
                const t = this.elements
                  , n = e.elements;
                return t[12] = n[12],
                t[13] = n[13],
                t[14] = n[14],
                this
            }
            setFromMatrix3(e) {
                const t = e.elements;
                return this.set(t[0], t[3], t[6], 0, t[1], t[4], t[7], 0, t[2], t[5], t[8], 0, 0, 0, 0, 1),
                this
            }
            extractBasis(e, t, n) {
                return e.setFromMatrixColumn(this, 0),
                t.setFromMatrixColumn(this, 1),
                n.setFromMatrixColumn(this, 2),
                this
            }
            makeBasis(e, t, n) {
                return this.set(e.x, t.x, n.x, 0, e.y, t.y, n.y, 0, e.z, t.z, n.z, 0, 0, 0, 0, 1),
                this
            }
            extractRotation(e) {
                const t = this.elements
                  , n = e.elements
                  , i = 1 / Zn.setFromMatrixColumn(e, 0).length()
                  , r = 1 / Zn.setFromMatrixColumn(e, 1).length()
                  , a = 1 / Zn.setFromMatrixColumn(e, 2).length();
                return t[0] = n[0] * i,
                t[1] = n[1] * i,
                t[2] = n[2] * i,
                t[3] = 0,
                t[4] = n[4] * r,
                t[5] = n[5] * r,
                t[6] = n[6] * r,
                t[7] = 0,
                t[8] = n[8] * a,
                t[9] = n[9] * a,
                t[10] = n[10] * a,
                t[11] = 0,
                t[12] = 0,
                t[13] = 0,
                t[14] = 0,
                t[15] = 1,
                this
            }
            makeRotationFromEuler(e) {
                const t = this.elements
                  , n = e.x
                  , i = e.y
                  , r = e.z
                  , a = Math.cos(n)
                  , s = Math.sin(n)
                  , o = Math.cos(i)
                  , l = Math.sin(i)
                  , c = Math.cos(r)
                  , h = Math.sin(r);
                if ("XYZ" === e.order) {
                    const e = a * c
                      , n = a * h
                      , i = s * c
                      , r = s * h;
                    t[0] = o * c,
                    t[4] = -o * h,
                    t[8] = l,
                    t[1] = n + i * l,
                    t[5] = e - r * l,
                    t[9] = -s * o,
                    t[2] = r - e * l,
                    t[6] = i + n * l,
                    t[10] = a * o
                } else if ("YXZ" === e.order) {
                    const e = o * c
                      , n = o * h
                      , i = l * c
                      , r = l * h;
                    t[0] = e + r * s,
                    t[4] = i * s - n,
                    t[8] = a * l,
                    t[1] = a * h,
                    t[5] = a * c,
                    t[9] = -s,
                    t[2] = n * s - i,
                    t[6] = r + e * s,
                    t[10] = a * o
                } else if ("ZXY" === e.order) {
                    const e = o * c
                      , n = o * h
                      , i = l * c
                      , r = l * h;
                    t[0] = e - r * s,
                    t[4] = -a * h,
                    t[8] = i + n * s,
                    t[1] = n + i * s,
                    t[5] = a * c,
                    t[9] = r - e * s,
                    t[2] = -a * l,
                    t[6] = s,
                    t[10] = a * o
                } else if ("ZYX" === e.order) {
                    const e = a * c
                      , n = a * h
                      , i = s * c
                      , r = s * h;
                    t[0] = o * c,
                    t[4] = i * l - n,
                    t[8] = e * l + r,
                    t[1] = o * h,
                    t[5] = r * l + e,
                    t[9] = n * l - i,
                    t[2] = -l,
                    t[6] = s * o,
                    t[10] = a * o
                } else if ("YZX" === e.order) {
                    const e = a * o
                      , n = a * l
                      , i = s * o
                      , r = s * l;
                    t[0] = o * c,
                    t[4] = r - e * h,
                    t[8] = i * h + n,
                    t[1] = h,
                    t[5] = a * c,
                    t[9] = -s * c,
                    t[2] = -l * c,
                    t[6] = n * h + i,
                    t[10] = e - r * h
                } else if ("XZY" === e.order) {
                    const e = a * o
                      , n = a * l
                      , i = s * o
                      , r = s * l;
                    t[0] = o * c,
                    t[4] = -h,
                    t[8] = l * c,
                    t[1] = e * h + r,
                    t[5] = a * c,
                    t[9] = n * h - i,
                    t[2] = i * h - n,
                    t[6] = s * c,
                    t[10] = r * h + e
                }
                return t[3] = 0,
                t[7] = 0,
                t[11] = 0,
                t[12] = 0,
                t[13] = 0,
                t[14] = 0,
                t[15] = 1,
                this
            }
            makeRotationFromQuaternion(e) {
                return this.compose($n, e, ei)
            }
            lookAt(e, t, n) {
                const i = this.elements;
                return ii.subVectors(e, t),
                0 === ii.lengthSq() && (ii.z = 1),
                ii.normalize(),
                ti.crossVectors(n, ii),
                0 === ti.lengthSq() && (1 === Math.abs(n.z) ? ii.x += 1e-4 : ii.z += 1e-4,
                ii.normalize(),
                ti.crossVectors(n, ii)),
                ti.normalize(),
                ni.crossVectors(ii, ti),
                i[0] = ti.x,
                i[4] = ni.x,
                i[8] = ii.x,
                i[1] = ti.y,
                i[5] = ni.y,
                i[9] = ii.y,
                i[2] = ti.z,
                i[6] = ni.z,
                i[10] = ii.z,
                this
            }
            multiply(e) {
                return this.multiplyMatrices(this, e)
            }
            premultiply(e) {
                return this.multiplyMatrices(e, this)
            }
            multiplyMatrices(e, t) {
                const n = e.elements
                  , i = t.elements
                  , r = this.elements
                  , a = n[0]
                  , s = n[4]
                  , o = n[8]
                  , l = n[12]
                  , c = n[1]
                  , h = n[5]
                  , d = n[9]
                  , u = n[13]
                  , p = n[2]
                  , f = n[6]
                  , m = n[10]
                  , g = n[14]
                  , v = n[3]
                  , w = n[7]
                  , y = n[11]
                  , b = n[15]
                  , A = i[0]
                  , x = i[4]
                  , k = i[8]
                  , E = i[12]
                  , S = i[1]
                  , M = i[5]
                  , _ = i[9]
                  , T = i[13]
                  , C = i[2]
                  , P = i[6]
                  , I = i[10]
                  , R = i[14]
                  , L = i[3]
                  , D = i[7]
                  , N = i[11]
                  , B = i[15];
                return r[0] = a * A + s * S + o * C + l * L,
                r[4] = a * x + s * M + o * P + l * D,
                r[8] = a * k + s * _ + o * I + l * N,
                r[12] = a * E + s * T + o * R + l * B,
                r[1] = c * A + h * S + d * C + u * L,
                r[5] = c * x + h * M + d * P + u * D,
                r[9] = c * k + h * _ + d * I + u * N,
                r[13] = c * E + h * T + d * R + u * B,
                r[2] = p * A + f * S + m * C + g * L,
                r[6] = p * x + f * M + m * P + g * D,
                r[10] = p * k + f * _ + m * I + g * N,
                r[14] = p * E + f * T + m * R + g * B,
                r[3] = v * A + w * S + y * C + b * L,
                r[7] = v * x + w * M + y * P + b * D,
                r[11] = v * k + w * _ + y * I + b * N,
                r[15] = v * E + w * T + y * R + b * B,
                this
            }
            multiplyScalar(e) {
                const t = this.elements;
                return t[0] *= e,
                t[4] *= e,
                t[8] *= e,
                t[12] *= e,
                t[1] *= e,
                t[5] *= e,
                t[9] *= e,
                t[13] *= e,
                t[2] *= e,
                t[6] *= e,
                t[10] *= e,
                t[14] *= e,
                t[3] *= e,
                t[7] *= e,
                t[11] *= e,
                t[15] *= e,
                this
            }
            determinant() {
                const e = this.elements
                  , t = e[0]
                  , n = e[4]
                  , i = e[8]
                  , r = e[12]
                  , a = e[1]
                  , s = e[5]
                  , o = e[9]
                  , l = e[13]
                  , c = e[2]
                  , h = e[6]
                  , d = e[10]
                  , u = e[14];
                return e[3] * (+r * o * h - i * l * h - r * s * d + n * l * d + i * s * u - n * o * u) + e[7] * (+t * o * u - t * l * d + r * a * d - i * a * u + i * l * c - r * o * c) + e[11] * (+t * l * h - t * s * u - r * a * h + n * a * u + r * s * c - n * l * c) + e[15] * (-i * s * c - t * o * h + t * s * d + i * a * h - n * a * d + n * o * c)
            }
            transpose() {
                const e = this.elements;
                let t;
                return t = e[1],
                e[1] = e[4],
                e[4] = t,
                t = e[2],
                e[2] = e[8],
                e[8] = t,
                t = e[6],
                e[6] = e[9],
                e[9] = t,
                t = e[3],
                e[3] = e[12],
                e[12] = t,
                t = e[7],
                e[7] = e[13],
                e[13] = t,
                t = e[11],
                e[11] = e[14],
                e[14] = t,
                this
            }
            setPosition(e, t, n) {
                const i = this.elements;
                return e.isVector3 ? (i[12] = e.x,
                i[13] = e.y,
                i[14] = e.z) : (i[12] = e,
                i[13] = t,
                i[14] = n),
                this
            }
            invert() {
                const e = this.elements
                  , t = e[0]
                  , n = e[1]
                  , i = e[2]
                  , r = e[3]
                  , a = e[4]
                  , s = e[5]
                  , o = e[6]
                  , l = e[7]
                  , c = e[8]
                  , h = e[9]
                  , d = e[10]
                  , u = e[11]
                  , p = e[12]
                  , f = e[13]
                  , m = e[14]
                  , g = e[15]
                  , v = h * m * l - f * d * l + f * o * u - s * m * u - h * o * g + s * d * g
                  , w = p * d * l - c * m * l - p * o * u + a * m * u + c * o * g - a * d * g
                  , y = c * f * l - p * h * l + p * s * u - a * f * u - c * s * g + a * h * g
                  , b = p * h * o - c * f * o - p * s * d + a * f * d + c * s * m - a * h * m
                  , A = t * v + n * w + i * y + r * b;
                if (0 === A)
                    return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
                const x = 1 / A;
                return e[0] = v * x,
                e[1] = (f * d * r - h * m * r - f * i * u + n * m * u + h * i * g - n * d * g) * x,
                e[2] = (s * m * r - f * o * r + f * i * l - n * m * l - s * i * g + n * o * g) * x,
                e[3] = (h * o * r - s * d * r - h * i * l + n * d * l + s * i * u - n * o * u) * x,
                e[4] = w * x,
                e[5] = (c * m * r - p * d * r + p * i * u - t * m * u - c * i * g + t * d * g) * x,
                e[6] = (p * o * r - a * m * r - p * i * l + t * m * l + a * i * g - t * o * g) * x,
                e[7] = (a * d * r - c * o * r + c * i * l - t * d * l - a * i * u + t * o * u) * x,
                e[8] = y * x,
                e[9] = (p * h * r - c * f * r - p * n * u + t * f * u + c * n * g - t * h * g) * x,
                e[10] = (a * f * r - p * s * r + p * n * l - t * f * l - a * n * g + t * s * g) * x,
                e[11] = (c * s * r - a * h * r - c * n * l + t * h * l + a * n * u - t * s * u) * x,
                e[12] = b * x,
                e[13] = (c * f * i - p * h * i + p * n * d - t * f * d - c * n * m + t * h * m) * x,
                e[14] = (p * s * i - a * f * i - p * n * o + t * f * o + a * n * m - t * s * m) * x,
                e[15] = (a * h * i - c * s * i + c * n * o - t * h * o - a * n * d + t * s * d) * x,
                this
            }
            scale(e) {
                const t = this.elements
                  , n = e.x
                  , i = e.y
                  , r = e.z;
                return t[0] *= n,
                t[4] *= i,
                t[8] *= r,
                t[1] *= n,
                t[5] *= i,
                t[9] *= r,
                t[2] *= n,
                t[6] *= i,
                t[10] *= r,
                t[3] *= n,
                t[7] *= i,
                t[11] *= r,
                this
            }
            getMaxScaleOnAxis() {
                const e = this.elements
                  , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
                  , n = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
                  , i = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
                return Math.sqrt(Math.max(t, n, i))
            }
            makeTranslation(e, t, n) {
                return e.isVector3 ? this.set(1, 0, 0, e.x, 0, 1, 0, e.y, 0, 0, 1, e.z, 0, 0, 0, 1) : this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, n, 0, 0, 0, 1),
                this
            }
            makeRotationX(e) {
                const t = Math.cos(e)
                  , n = Math.sin(e);
                return this.set(1, 0, 0, 0, 0, t, -n, 0, 0, n, t, 0, 0, 0, 0, 1),
                this
            }
            makeRotationY(e) {
                const t = Math.cos(e)
                  , n = Math.sin(e);
                return this.set(t, 0, n, 0, 0, 1, 0, 0, -n, 0, t, 0, 0, 0, 0, 1),
                this
            }
            makeRotationZ(e) {
                const t = Math.cos(e)
                  , n = Math.sin(e);
                return this.set(t, -n, 0, 0, n, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
                this
            }
            makeRotationAxis(e, t) {
                const n = Math.cos(t)
                  , i = Math.sin(t)
                  , r = 1 - n
                  , a = e.x
                  , s = e.y
                  , o = e.z
                  , l = r * a
                  , c = r * s;
                return this.set(l * a + n, l * s - i * o, l * o + i * s, 0, l * s + i * o, c * s + n, c * o - i * a, 0, l * o - i * s, c * o + i * a, r * o * o + n, 0, 0, 0, 0, 1),
                this
            }
            makeScale(e, t, n) {
                return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, n, 0, 0, 0, 0, 1),
                this
            }
            makeShear(e, t, n, i, r, a) {
                return this.set(1, n, r, 0, e, 1, a, 0, t, i, 1, 0, 0, 0, 0, 1),
                this
            }
            compose(e, t, n) {
                const i = this.elements
                  , r = t._x
                  , a = t._y
                  , s = t._z
                  , o = t._w
                  , l = r + r
                  , c = a + a
                  , h = s + s
                  , d = r * l
                  , u = r * c
                  , p = r * h
                  , f = a * c
                  , m = a * h
                  , g = s * h
                  , v = o * l
                  , w = o * c
                  , y = o * h
                  , b = n.x
                  , A = n.y
                  , x = n.z;
                return i[0] = (1 - (f + g)) * b,
                i[1] = (u + y) * b,
                i[2] = (p - w) * b,
                i[3] = 0,
                i[4] = (u - y) * A,
                i[5] = (1 - (d + g)) * A,
                i[6] = (m + v) * A,
                i[7] = 0,
                i[8] = (p + w) * x,
                i[9] = (m - v) * x,
                i[10] = (1 - (d + f)) * x,
                i[11] = 0,
                i[12] = e.x,
                i[13] = e.y,
                i[14] = e.z,
                i[15] = 1,
                this
            }
            decompose(e, t, n) {
                const i = this.elements;
                let r = Zn.set(i[0], i[1], i[2]).length();
                const a = Zn.set(i[4], i[5], i[6]).length()
                  , s = Zn.set(i[8], i[9], i[10]).length();
                this.determinant() < 0 && (r = -r),
                e.x = i[12],
                e.y = i[13],
                e.z = i[14],
                Jn.copy(this);
                const o = 1 / r
                  , l = 1 / a
                  , c = 1 / s;
                return Jn.elements[0] *= o,
                Jn.elements[1] *= o,
                Jn.elements[2] *= o,
                Jn.elements[4] *= l,
                Jn.elements[5] *= l,
                Jn.elements[6] *= l,
                Jn.elements[8] *= c,
                Jn.elements[9] *= c,
                Jn.elements[10] *= c,
                t.setFromRotationMatrix(Jn),
                n.x = r,
                n.y = a,
                n.z = s,
                this
            }
            makePerspective(e, t, n, i, r, a, s=2e3) {
                const o = this.elements
                  , l = 2 * r / (t - e)
                  , c = 2 * r / (n - i)
                  , h = (t + e) / (t - e)
                  , d = (n + i) / (n - i);
                let u, p;
                if (s === Rt)
                    u = -(a + r) / (a - r),
                    p = -2 * a * r / (a - r);
                else {
                    if (s !== Lt)
                        throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + s);
                    u = -a / (a - r),
                    p = -a * r / (a - r)
                }
                return o[0] = l,
                o[4] = 0,
                o[8] = h,
                o[12] = 0,
                o[1] = 0,
                o[5] = c,
                o[9] = d,
                o[13] = 0,
                o[2] = 0,
                o[6] = 0,
                o[10] = u,
                o[14] = p,
                o[3] = 0,
                o[7] = 0,
                o[11] = -1,
                o[15] = 0,
                this
            }
            makeOrthographic(e, t, n, i, r, a, s=2e3) {
                const o = this.elements
                  , l = 1 / (t - e)
                  , c = 1 / (n - i)
                  , h = 1 / (a - r)
                  , d = (t + e) * l
                  , u = (n + i) * c;
                let p, f;
                if (s === Rt)
                    p = (a + r) * h,
                    f = -2 * h;
                else {
                    if (s !== Lt)
                        throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + s);
                    p = r * h,
                    f = -1 * h
                }
                return o[0] = 2 * l,
                o[4] = 0,
                o[8] = 0,
                o[12] = -d,
                o[1] = 0,
                o[5] = 2 * c,
                o[9] = 0,
                o[13] = -u,
                o[2] = 0,
                o[6] = 0,
                o[10] = f,
                o[14] = -p,
                o[3] = 0,
                o[7] = 0,
                o[11] = 0,
                o[15] = 1,
                this
            }
            equals(e) {
                const t = this.elements
                  , n = e.elements;
                for (let e = 0; e < 16; e++)
                    if (t[e] !== n[e])
                        return !1;
                return !0
            }
            fromArray(e, t=0) {
                for (let n = 0; n < 16; n++)
                    this.elements[n] = e[n + t];
                return this
            }
            toArray(e=[], t=0) {
                const n = this.elements;
                return e[t] = n[0],
                e[t + 1] = n[1],
                e[t + 2] = n[2],
                e[t + 3] = n[3],
                e[t + 4] = n[4],
                e[t + 5] = n[5],
                e[t + 6] = n[6],
                e[t + 7] = n[7],
                e[t + 8] = n[8],
                e[t + 9] = n[9],
                e[t + 10] = n[10],
                e[t + 11] = n[11],
                e[t + 12] = n[12],
                e[t + 13] = n[13],
                e[t + 14] = n[14],
                e[t + 15] = n[15],
                e
            }
        }
        const Zn = new bn
          , Jn = new Xn
          , $n = new bn(0,0,0)
          , ei = new bn(1,1,1)
          , ti = new bn
          , ni = new bn
          , ii = new bn
          , ri = new Xn
          , ai = new yn;
        class si {
            constructor(e=0, t=0, n=0, i=si.DEFAULT_ORDER) {
                this.isEuler = !0,
                this._x = e,
                this._y = t,
                this._z = n,
                this._order = i
            }
            get x() {
                return this._x
            }
            set x(e) {
                this._x = e,
                this._onChangeCallback()
            }
            get y() {
                return this._y
            }
            set y(e) {
                this._y = e,
                this._onChangeCallback()
            }
            get z() {
                return this._z
            }
            set z(e) {
                this._z = e,
                this._onChangeCallback()
            }
            get order() {
                return this._order
            }
            set order(e) {
                this._order = e,
                this._onChangeCallback()
            }
            set(e, t, n, i=this._order) {
                return this._x = e,
                this._y = t,
                this._z = n,
                this._order = i,
                this._onChangeCallback(),
                this
            }
            clone() {
                return new this.constructor(this._x,this._y,this._z,this._order)
            }
            copy(e) {
                return this._x = e._x,
                this._y = e._y,
                this._z = e._z,
                this._order = e._order,
                this._onChangeCallback(),
                this
            }
            setFromRotationMatrix(e, t=this._order, n=!0) {
                const i = e.elements
                  , r = i[0]
                  , a = i[4]
                  , s = i[8]
                  , o = i[1]
                  , l = i[5]
                  , c = i[9]
                  , h = i[2]
                  , d = i[6]
                  , u = i[10];
                switch (t) {
                case "XYZ":
                    this._y = Math.asin(Ft(s, -1, 1)),
                    Math.abs(s) < .9999999 ? (this._x = Math.atan2(-c, u),
                    this._z = Math.atan2(-a, r)) : (this._x = Math.atan2(d, l),
                    this._z = 0);
                    break;
                case "YXZ":
                    this._x = Math.asin(-Ft(c, -1, 1)),
                    Math.abs(c) < .9999999 ? (this._y = Math.atan2(s, u),
                    this._z = Math.atan2(o, l)) : (this._y = Math.atan2(-h, r),
                    this._z = 0);
                    break;
                case "ZXY":
                    this._x = Math.asin(Ft(d, -1, 1)),
                    Math.abs(d) < .9999999 ? (this._y = Math.atan2(-h, u),
                    this._z = Math.atan2(-a, l)) : (this._y = 0,
                    this._z = Math.atan2(o, r));
                    break;
                case "ZYX":
                    this._y = Math.asin(-Ft(h, -1, 1)),
                    Math.abs(h) < .9999999 ? (this._x = Math.atan2(d, u),
                    this._z = Math.atan2(o, r)) : (this._x = 0,
                    this._z = Math.atan2(-a, l));
                    break;
                case "YZX":
                    this._z = Math.asin(Ft(o, -1, 1)),
                    Math.abs(o) < .9999999 ? (this._x = Math.atan2(-c, l),
                    this._y = Math.atan2(-h, r)) : (this._x = 0,
                    this._y = Math.atan2(s, u));
                    break;
                case "XZY":
                    this._z = Math.asin(-Ft(a, -1, 1)),
                    Math.abs(a) < .9999999 ? (this._x = Math.atan2(d, l),
                    this._y = Math.atan2(s, r)) : (this._x = Math.atan2(-c, u),
                    this._y = 0);
                    break;
                default:
                    console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + t)
                }
                return this._order = t,
                !0 === n && this._onChangeCallback(),
                this
            }
            setFromQuaternion(e, t, n) {
                return ri.makeRotationFromQuaternion(e),
                this.setFromRotationMatrix(ri, t, n)
            }
            setFromVector3(e, t=this._order) {
                return this.set(e.x, e.y, e.z, t)
            }
            reorder(e) {
                return ai.setFromEuler(this),
                this.setFromQuaternion(ai, e)
            }
            equals(e) {
                return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
            }
            fromArray(e) {
                return this._x = e[0],
                this._y = e[1],
                this._z = e[2],
                void 0 !== e[3] && (this._order = e[3]),
                this._onChangeCallback(),
                this
            }
            toArray(e=[], t=0) {
                return e[t] = this._x,
                e[t + 1] = this._y,
                e[t + 2] = this._z,
                e[t + 3] = this._order,
                e
            }
            _onChange(e) {
                return this._onChangeCallback = e,
                this
            }
            _onChangeCallback() {}
            *[Symbol.iterator]() {
                yield this._x,
                yield this._y,
                yield this._z,
                yield this._order
            }
        }
        si.DEFAULT_ORDER = "XYZ";
        class oi {
            constructor() {
                this.mask = 1
            }
            set(e) {
                this.mask = 1 << e >>> 0
            }
            enable(e) {
                this.mask |= 1 << e
            }
            enableAll() {
                this.mask = -1
            }
            toggle(e) {
                this.mask ^= 1 << e
            }
            disable(e) {
                this.mask &= ~(1 << e)
            }
            disableAll() {
                this.mask = 0
            }
            test(e) {
                return !!(this.mask & e.mask)
            }
            isEnabled(e) {
                return !!(this.mask & 1 << e)
            }
        }
        let li = 0;
        const ci = new bn
          , hi = new yn
          , di = new Xn
          , ui = new bn
          , pi = new bn
          , fi = new bn
          , mi = new yn
          , gi = new bn(1,0,0)
          , vi = new bn(0,1,0)
          , wi = new bn(0,0,1)
          , yi = {
            type: "added"
        }
          , bi = {
            type: "removed"
        }
          , Ai = {
            type: "childadded",
            child: null
        }
          , xi = {
            type: "childremoved",
            child: null
        };
        class ki extends Dt {
            constructor() {
                super(),
                this.isObject3D = !0,
                Object.defineProperty(this, "id", {
                    value: li++
                }),
                this.uuid = Ot(),
                this.name = "",
                this.type = "Object3D",
                this.parent = null,
                this.children = [],
                this.up = ki.DEFAULT_UP.clone();
                const e = new bn
                  , t = new si
                  , n = new yn
                  , i = new bn(1,1,1);
                t._onChange((function() {
                    n.setFromEuler(t, !1)
                }
                )),
                n._onChange((function() {
                    t.setFromQuaternion(n, void 0, !1)
                }
                )),
                Object.defineProperties(this, {
                    position: {
                        configurable: !0,
                        enumerable: !0,
                        value: e
                    },
                    rotation: {
                        configurable: !0,
                        enumerable: !0,
                        value: t
                    },
                    quaternion: {
                        configurable: !0,
                        enumerable: !0,
                        value: n
                    },
                    scale: {
                        configurable: !0,
                        enumerable: !0,
                        value: i
                    },
                    modelViewMatrix: {
                        value: new Xn
                    },
                    normalMatrix: {
                        value: new Kt
                    }
                }),
                this.matrix = new Xn,
                this.matrixWorld = new Xn,
                this.matrixAutoUpdate = ki.DEFAULT_MATRIX_AUTO_UPDATE,
                this.matrixWorldAutoUpdate = ki.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,
                this.matrixWorldNeedsUpdate = !1,
                this.layers = new oi,
                this.visible = !0,
                this.castShadow = !1,
                this.receiveShadow = !1,
                this.frustumCulled = !0,
                this.renderOrder = 0,
                this.animations = [],
                this.userData = {}
            }
            onBeforeShadow() {}
            onAfterShadow() {}
            onBeforeRender() {}
            onAfterRender() {}
            applyMatrix4(e) {
                this.matrixAutoUpdate && this.updateMatrix(),
                this.matrix.premultiply(e),
                this.matrix.decompose(this.position, this.quaternion, this.scale)
            }
            applyQuaternion(e) {
                return this.quaternion.premultiply(e),
                this
            }
            setRotationFromAxisAngle(e, t) {
                this.quaternion.setFromAxisAngle(e, t)
            }
            setRotationFromEuler(e) {
                this.quaternion.setFromEuler(e, !0)
            }
            setRotationFromMatrix(e) {
                this.quaternion.setFromRotationMatrix(e)
            }
            setRotationFromQuaternion(e) {
                this.quaternion.copy(e)
            }
            rotateOnAxis(e, t) {
                return hi.setFromAxisAngle(e, t),
                this.quaternion.multiply(hi),
                this
            }
            rotateOnWorldAxis(e, t) {
                return hi.setFromAxisAngle(e, t),
                this.quaternion.premultiply(hi),
                this
            }
            rotateX(e) {
                return this.rotateOnAxis(gi, e)
            }
            rotateY(e) {
                return this.rotateOnAxis(vi, e)
            }
            rotateZ(e) {
                return this.rotateOnAxis(wi, e)
            }
            translateOnAxis(e, t) {
                return ci.copy(e).applyQuaternion(this.quaternion),
                this.position.add(ci.multiplyScalar(t)),
                this
            }
            translateX(e) {
                return this.translateOnAxis(gi, e)
            }
            translateY(e) {
                return this.translateOnAxis(vi, e)
            }
            translateZ(e) {
                return this.translateOnAxis(wi, e)
            }
            localToWorld(e) {
                return this.updateWorldMatrix(!0, !1),
                e.applyMatrix4(this.matrixWorld)
            }
            worldToLocal(e) {
                return this.updateWorldMatrix(!0, !1),
                e.applyMatrix4(di.copy(this.matrixWorld).invert())
            }
            lookAt(e, t, n) {
                e.isVector3 ? ui.copy(e) : ui.set(e, t, n);
                const i = this.parent;
                this.updateWorldMatrix(!0, !1),
                pi.setFromMatrixPosition(this.matrixWorld),
                this.isCamera || this.isLight ? di.lookAt(pi, ui, this.up) : di.lookAt(ui, pi, this.up),
                this.quaternion.setFromRotationMatrix(di),
                i && (di.extractRotation(i.matrixWorld),
                hi.setFromRotationMatrix(di),
                this.quaternion.premultiply(hi.invert()))
            }
            add(e) {
                if (arguments.length > 1) {
                    for (let e = 0; e < arguments.length; e++)
                        this.add(arguments[e]);
                    return this
                }
                return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
                this) : (e && e.isObject3D ? (e.removeFromParent(),
                e.parent = this,
                this.children.push(e),
                e.dispatchEvent(yi),
                Ai.child = e,
                this.dispatchEvent(Ai),
                Ai.child = null) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
                this)
            }
            remove(e) {
                if (arguments.length > 1) {
                    for (let e = 0; e < arguments.length; e++)
                        this.remove(arguments[e]);
                    return this
                }
                const t = this.children.indexOf(e);
                return -1 !== t && (e.parent = null,
                this.children.splice(t, 1),
                e.dispatchEvent(bi),
                xi.child = e,
                this.dispatchEvent(xi),
                xi.child = null),
                this
            }
            removeFromParent() {
                const e = this.parent;
                return null !== e && e.remove(this),
                this
            }
            clear() {
                return this.remove(...this.children)
            }
            attach(e) {
                return this.updateWorldMatrix(!0, !1),
                di.copy(this.matrixWorld).invert(),
                null !== e.parent && (e.parent.updateWorldMatrix(!0, !1),
                di.multiply(e.parent.matrixWorld)),
                e.applyMatrix4(di),
                e.removeFromParent(),
                e.parent = this,
                this.children.push(e),
                e.updateWorldMatrix(!1, !0),
                e.dispatchEvent(yi),
                Ai.child = e,
                this.dispatchEvent(Ai),
                Ai.child = null,
                this
            }
            getObjectById(e) {
                return this.getObjectByProperty("id", e)
            }
            getObjectByName(e) {
                return this.getObjectByProperty("name", e)
            }
            getObjectByProperty(e, t) {
                if (this[e] === t)
                    return this;
                for (let n = 0, i = this.children.length; n < i; n++) {
                    const i = this.children[n].getObjectByProperty(e, t);
                    if (void 0 !== i)
                        return i
                }
            }
            getObjectsByProperty(e, t, n=[]) {
                this[e] === t && n.push(this);
                const i = this.children;
                for (let r = 0, a = i.length; r < a; r++)
                    i[r].getObjectsByProperty(e, t, n);
                return n
            }
            getWorldPosition(e) {
                return this.updateWorldMatrix(!0, !1),
                e.setFromMatrixPosition(this.matrixWorld)
            }
            getWorldQuaternion(e) {
                return this.updateWorldMatrix(!0, !1),
                this.matrixWorld.decompose(pi, e, fi),
                e
            }
            getWorldScale(e) {
                return this.updateWorldMatrix(!0, !1),
                this.matrixWorld.decompose(pi, mi, e),
                e
            }
            getWorldDirection(e) {
                this.updateWorldMatrix(!0, !1);
                const t = this.matrixWorld.elements;
                return e.set(t[8], t[9], t[10]).normalize()
            }
            raycast() {}
            traverse(e) {
                e(this);
                const t = this.children;
                for (let n = 0, i = t.length; n < i; n++)
                    t[n].traverse(e)
            }
            traverseVisible(e) {
                if (!1 === this.visible)
                    return;
                e(this);
                const t = this.children;
                for (let n = 0, i = t.length; n < i; n++)
                    t[n].traverseVisible(e)
            }
            traverseAncestors(e) {
                const t = this.parent;
                null !== t && (e(t),
                t.traverseAncestors(e))
            }
            updateMatrix() {
                this.matrix.compose(this.position, this.quaternion, this.scale),
                this.matrixWorldNeedsUpdate = !0
            }
            updateMatrixWorld(e) {
                this.matrixAutoUpdate && this.updateMatrix(),
                (this.matrixWorldNeedsUpdate || e) && (!0 === this.matrixWorldAutoUpdate && (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)),
                this.matrixWorldNeedsUpdate = !1,
                e = !0);
                const t = this.children;
                for (let n = 0, i = t.length; n < i; n++) {
                    t[n].updateMatrixWorld(e)
                }
            }
            updateWorldMatrix(e, t) {
                const n = this.parent;
                if (!0 === e && null !== n && n.updateWorldMatrix(!0, !1),
                this.matrixAutoUpdate && this.updateMatrix(),
                !0 === this.matrixWorldAutoUpdate && (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)),
                !0 === t) {
                    const e = this.children;
                    for (let t = 0, n = e.length; t < n; t++) {
                        e[t].updateWorldMatrix(!1, !0)
                    }
                }
            }
            toJSON(e) {
                const t = void 0 === e || "string" == typeof e
                  , n = {};
                t && (e = {
                    geometries: {},
                    materials: {},
                    textures: {},
                    images: {},
                    shapes: {},
                    skeletons: {},
                    animations: {},
                    nodes: {}
                },
                n.metadata = {
                    version: 4.6,
                    type: "Object",
                    generator: "Object3D.toJSON"
                });
                const i = {};
                function r(t, n) {
                    return void 0 === t[n.uuid] && (t[n.uuid] = n.toJSON(e)),
                    n.uuid
                }
                if (i.uuid = this.uuid,
                i.type = this.type,
                "" !== this.name && (i.name = this.name),
                !0 === this.castShadow && (i.castShadow = !0),
                !0 === this.receiveShadow && (i.receiveShadow = !0),
                !1 === this.visible && (i.visible = !1),
                !1 === this.frustumCulled && (i.frustumCulled = !1),
                0 !== this.renderOrder && (i.renderOrder = this.renderOrder),
                Object.keys(this.userData).length > 0 && (i.userData = this.userData),
                i.layers = this.layers.mask,
                i.matrix = this.matrix.toArray(),
                i.up = this.up.toArray(),
                !1 === this.matrixAutoUpdate && (i.matrixAutoUpdate = !1),
                this.isInstancedMesh && (i.type = "InstancedMesh",
                i.count = this.count,
                i.instanceMatrix = this.instanceMatrix.toJSON(),
                null !== this.instanceColor && (i.instanceColor = this.instanceColor.toJSON())),
                this.isBatchedMesh && (i.type = "BatchedMesh",
                i.perObjectFrustumCulled = this.perObjectFrustumCulled,
                i.sortObjects = this.sortObjects,
                i.drawRanges = this._drawRanges,
                i.reservedRanges = this._reservedRanges,
                i.visibility = this._visibility,
                i.active = this._active,
                i.bounds = this._bounds.map((e => ({
                    boxInitialized: e.boxInitialized,
                    boxMin: e.box.min.toArray(),
                    boxMax: e.box.max.toArray(),
                    sphereInitialized: e.sphereInitialized,
                    sphereRadius: e.sphere.radius,
                    sphereCenter: e.sphere.center.toArray()
                }))),
                i.maxInstanceCount = this._maxInstanceCount,
                i.maxVertexCount = this._maxVertexCount,
                i.maxIndexCount = this._maxIndexCount,
                i.geometryInitialized = this._geometryInitialized,
                i.geometryCount = this._geometryCount,
                i.matricesTexture = this._matricesTexture.toJSON(e),
                null !== this._colorsTexture && (i.colorsTexture = this._colorsTexture.toJSON(e)),
                null !== this.boundingSphere && (i.boundingSphere = {
                    center: i.boundingSphere.center.toArray(),
                    radius: i.boundingSphere.radius
                }),
                null !== this.boundingBox && (i.boundingBox = {
                    min: i.boundingBox.min.toArray(),
                    max: i.boundingBox.max.toArray()
                })),
                this.isScene)
                    this.background && (this.background.isColor ? i.background = this.background.toJSON() : this.background.isTexture && (i.background = this.background.toJSON(e).uuid)),
                    this.environment && this.environment.isTexture && !0 !== this.environment.isRenderTargetTexture && (i.environment = this.environment.toJSON(e).uuid);
                else if (this.isMesh || this.isLine || this.isPoints) {
                    i.geometry = r(e.geometries, this.geometry);
                    const t = this.geometry.parameters;
                    if (void 0 !== t && void 0 !== t.shapes) {
                        const n = t.shapes;
                        if (Array.isArray(n))
                            for (let t = 0, i = n.length; t < i; t++) {
                                const i = n[t];
                                r(e.shapes, i)
                            }
                        else
                            r(e.shapes, n)
                    }
                }
                if (this.isSkinnedMesh && (i.bindMode = this.bindMode,
                i.bindMatrix = this.bindMatrix.toArray(),
                void 0 !== this.skeleton && (r(e.skeletons, this.skeleton),
                i.skeleton = this.skeleton.uuid)),
                void 0 !== this.material)
                    if (Array.isArray(this.material)) {
                        const t = [];
                        for (let n = 0, i = this.material.length; n < i; n++)
                            t.push(r(e.materials, this.material[n]));
                        i.material = t
                    } else
                        i.material = r(e.materials, this.material);
                if (this.children.length > 0) {
                    i.children = [];
                    for (let t = 0; t < this.children.length; t++)
                        i.children.push(this.children[t].toJSON(e).object)
                }
                if (this.animations.length > 0) {
                    i.animations = [];
                    for (let t = 0; t < this.animations.length; t++) {
                        const n = this.animations[t];
                        i.animations.push(r(e.animations, n))
                    }
                }
                if (t) {
                    const t = a(e.geometries)
                      , i = a(e.materials)
                      , r = a(e.textures)
                      , s = a(e.images)
                      , o = a(e.shapes)
                      , l = a(e.skeletons)
                      , c = a(e.animations)
                      , h = a(e.nodes);
                    t.length > 0 && (n.geometries = t),
                    i.length > 0 && (n.materials = i),
                    r.length > 0 && (n.textures = r),
                    s.length > 0 && (n.images = s),
                    o.length > 0 && (n.shapes = o),
                    l.length > 0 && (n.skeletons = l),
                    c.length > 0 && (n.animations = c),
                    h.length > 0 && (n.nodes = h)
                }
                return n.object = i,
                n;
                function a(e) {
                    const t = [];
                    for (const n in e) {
                        const i = e[n];
                        delete i.metadata,
                        t.push(i)
                    }
                    return t
                }
            }
            clone(e) {
                return (new this.constructor).copy(this, e)
            }
            copy(e, t=!0) {
                if (this.name = e.name,
                this.up.copy(e.up),
                this.position.copy(e.position),
                this.rotation.order = e.rotation.order,
                this.quaternion.copy(e.quaternion),
                this.scale.copy(e.scale),
                this.matrix.copy(e.matrix),
                this.matrixWorld.copy(e.matrixWorld),
                this.matrixAutoUpdate = e.matrixAutoUpdate,
                this.matrixWorldAutoUpdate = e.matrixWorldAutoUpdate,
                this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
                this.layers.mask = e.layers.mask,
                this.visible = e.visible,
                this.castShadow = e.castShadow,
                this.receiveShadow = e.receiveShadow,
                this.frustumCulled = e.frustumCulled,
                this.renderOrder = e.renderOrder,
                this.animations = e.animations.slice(),
                this.userData = JSON.parse(JSON.stringify(e.userData)),
                !0 === t)
                    for (let t = 0; t < e.children.length; t++) {
                        const n = e.children[t];
                        this.add(n.clone())
                    }
                return this
            }
        }
        ki.DEFAULT_UP = new bn(0,1,0),
        ki.DEFAULT_MATRIX_AUTO_UPDATE = !0,
        ki.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0;
        const Ei = new bn
          , Si = new bn
          , Mi = new bn
          , _i = new bn
          , Ti = new bn
          , Ci = new bn
          , Pi = new bn
          , Ii = new bn
          , Ri = new bn
          , Li = new bn
          , Di = new fn
          , Ni = new fn
          , Bi = new fn;
        class Ui {
            constructor(e=new bn, t=new bn, n=new bn) {
                this.a = e,
                this.b = t,
                this.c = n
            }
            static getNormal(e, t, n, i) {
                i.subVectors(n, t),
                Ei.subVectors(e, t),
                i.cross(Ei);
                const r = i.lengthSq();
                return r > 0 ? i.multiplyScalar(1 / Math.sqrt(r)) : i.set(0, 0, 0)
            }
            static getBarycoord(e, t, n, i, r) {
                Ei.subVectors(i, t),
                Si.subVectors(n, t),
                Mi.subVectors(e, t);
                const a = Ei.dot(Ei)
                  , s = Ei.dot(Si)
                  , o = Ei.dot(Mi)
                  , l = Si.dot(Si)
                  , c = Si.dot(Mi)
                  , h = a * l - s * s;
                if (0 === h)
                    return r.set(0, 0, 0),
                    null;
                const d = 1 / h
                  , u = (l * o - s * c) * d
                  , p = (a * c - s * o) * d;
                return r.set(1 - u - p, p, u)
            }
            static containsPoint(e, t, n, i) {
                return null !== this.getBarycoord(e, t, n, i, _i) && (_i.x >= 0 && _i.y >= 0 && _i.x + _i.y <= 1)
            }
            static getInterpolation(e, t, n, i, r, a, s, o) {
                return null === this.getBarycoord(e, t, n, i, _i) ? (o.x = 0,
                o.y = 0,
                "z"in o && (o.z = 0),
                "w"in o && (o.w = 0),
                null) : (o.setScalar(0),
                o.addScaledVector(r, _i.x),
                o.addScaledVector(a, _i.y),
                o.addScaledVector(s, _i.z),
                o)
            }
            static getInterpolatedAttribute(e, t, n, i, r, a) {
                return Di.setScalar(0),
                Ni.setScalar(0),
                Bi.setScalar(0),
                Di.fromBufferAttribute(e, t),
                Ni.fromBufferAttribute(e, n),
                Bi.fromBufferAttribute(e, i),
                a.setScalar(0),
                a.addScaledVector(Di, r.x),
                a.addScaledVector(Ni, r.y),
                a.addScaledVector(Bi, r.z),
                a
            }
            static isFrontFacing(e, t, n, i) {
                return Ei.subVectors(n, t),
                Si.subVectors(e, t),
                Ei.cross(Si).dot(i) < 0
            }
            set(e, t, n) {
                return this.a.copy(e),
                this.b.copy(t),
                this.c.copy(n),
                this
            }
            setFromPointsAndIndices(e, t, n, i) {
                return this.a.copy(e[t]),
                this.b.copy(e[n]),
                this.c.copy(e[i]),
                this
            }
            setFromAttributeAndIndices(e, t, n, i) {
                return this.a.fromBufferAttribute(e, t),
                this.b.fromBufferAttribute(e, n),
                this.c.fromBufferAttribute(e, i),
                this
            }
            clone() {
                return (new this.constructor).copy(this)
            }
            copy(e) {
                return this.a.copy(e.a),
                this.b.copy(e.b),
                this.c.copy(e.c),
                this
            }
            getArea() {
                return Ei.subVectors(this.c, this.b),
                Si.subVectors(this.a, this.b),
                .5 * Ei.cross(Si).length()
            }
            getMidpoint(e) {
                return e.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
            }
            getNormal(e) {
                return Ui.getNormal(this.a, this.b, this.c, e)
            }
            getPlane(e) {
                return e.setFromCoplanarPoints(this.a, this.b, this.c)
            }
            getBarycoord(e, t) {
                return Ui.getBarycoord(e, this.a, this.b, this.c, t)
            }
            getInterpolation(e, t, n, i, r) {
                return Ui.getInterpolation(e, this.a, this.b, this.c, t, n, i, r)
            }
            containsPoint(e) {
                return Ui.containsPoint(e, this.a, this.b, this.c)
            }
            isFrontFacing(e) {
                return Ui.isFrontFacing(this.a, this.b, this.c, e)
            }
            intersectsBox(e) {
                return e.intersectsTriangle(this)
            }
            closestPointToPoint(e, t) {
                const n = this.a
                  , i = this.b
                  , r = this.c;
                let a, s;
                Ti.subVectors(i, n),
                Ci.subVectors(r, n),
                Ii.subVectors(e, n);
                const o = Ti.dot(Ii)
                  , l = Ci.dot(Ii);
                if (o <= 0 && l <= 0)
                    return t.copy(n);
                Ri.subVectors(e, i);
                const c = Ti.dot(Ri)
                  , h = Ci.dot(Ri);
                if (c >= 0 && h <= c)
                    return t.copy(i);
                const d = o * h - c * l;
                if (d <= 0 && o >= 0 && c <= 0)
                    return a = o / (o - c),
                    t.copy(n).addScaledVector(Ti, a);
                Li.subVectors(e, r);
                const u = Ti.dot(Li)
                  , p = Ci.dot(Li);
                if (p >= 0 && u <= p)
                    return t.copy(r);
                const f = u * l - o * p;
                if (f <= 0 && l >= 0 && p <= 0)
                    return s = l / (l - p),
                    t.copy(n).addScaledVector(Ci, s);
                const m = c * p - u * h;
                if (m <= 0 && h - c >= 0 && u - p >= 0)
                    return Pi.subVectors(r, i),
                    s = (h - c) / (h - c + (u - p)),
                    t.copy(i).addScaledVector(Pi, s);
                const g = 1 / (m + f + d);
                return a = f * g,
                s = d * g,
                t.copy(n).addScaledVector(Ti, a).addScaledVector(Ci, s)
            }
            equals(e) {
                return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
            }
        }
        const zi = {
            aliceblue: 15792383,
            antiquewhite: 16444375,
            aqua: 65535,
            aquamarine: 8388564,
            azure: 15794175,
            beige: 16119260,
            bisque: 16770244,
            black: 0,
            blanchedalmond: 16772045,
            blue: 255,
            blueviolet: 9055202,
            brown: 10824234,
            burlywood: 14596231,
            cadetblue: 6266528,
            chartreuse: 8388352,
            chocolate: 13789470,
            coral: 16744272,
            cornflowerblue: 6591981,
            cornsilk: 16775388,
            crimson: 14423100,
            cyan: 65535,
            darkblue: 139,
            darkcyan: 35723,
            darkgoldenrod: 12092939,
            darkgray: 11119017,
            darkgreen: 25600,
            darkgrey: 11119017,
            darkkhaki: 12433259,
            darkmagenta: 9109643,
            darkolivegreen: 5597999,
            darkorange: 16747520,
            darkorchid: 10040012,
            darkred: 9109504,
            darksalmon: 15308410,
            darkseagreen: 9419919,
            darkslateblue: 4734347,
            darkslategray: 3100495,
            darkslategrey: 3100495,
            darkturquoise: 52945,
            darkviolet: 9699539,
            deeppink: 16716947,
            deepskyblue: 49151,
            dimgray: 6908265,
            dimgrey: 6908265,
            dodgerblue: 2003199,
            firebrick: 11674146,
            floralwhite: 16775920,
            forestgreen: 2263842,
            fuchsia: 16711935,
            gainsboro: 14474460,
            ghostwhite: 16316671,
            gold: 16766720,
            goldenrod: 14329120,
            gray: 8421504,
            green: 32768,
            greenyellow: 11403055,
            grey: 8421504,
            honeydew: 15794160,
            hotpink: 16738740,
            indianred: 13458524,
            indigo: 4915330,
            ivory: 16777200,
            khaki: 15787660,
            lavender: 15132410,
            lavenderblush: 16773365,
            lawngreen: 8190976,
            lemonchiffon: 16775885,
            lightblue: 11393254,
            lightcoral: 15761536,
            lightcyan: 14745599,
            lightgoldenrodyellow: 16448210,
            lightgray: 13882323,
            lightgreen: 9498256,
            lightgrey: 13882323,
            lightpink: 16758465,
            lightsalmon: 16752762,
            lightseagreen: 2142890,
            lightskyblue: 8900346,
            lightslategray: 7833753,
            lightslategrey: 7833753,
            lightsteelblue: 11584734,
            lightyellow: 16777184,
            lime: 65280,
            limegreen: 3329330,
            linen: 16445670,
            magenta: 16711935,
            maroon: 8388608,
            mediumaquamarine: 6737322,
            mediumblue: 205,
            mediumorchid: 12211667,
            mediumpurple: 9662683,
            mediumseagreen: 3978097,
            mediumslateblue: 8087790,
            mediumspringgreen: 64154,
            mediumturquoise: 4772300,
            mediumvioletred: 13047173,
            midnightblue: 1644912,
            mintcream: 16121850,
            mistyrose: 16770273,
            moccasin: 16770229,
            navajowhite: 16768685,
            navy: 128,
            oldlace: 16643558,
            olive: 8421376,
            olivedrab: 7048739,
            orange: 16753920,
            orangered: 16729344,
            orchid: 14315734,
            palegoldenrod: 15657130,
            palegreen: 10025880,
            paleturquoise: 11529966,
            palevioletred: 14381203,
            papayawhip: 16773077,
            peachpuff: 16767673,
            peru: 13468991,
            pink: 16761035,
            plum: 14524637,
            powderblue: 11591910,
            purple: 8388736,
            rebeccapurple: 6697881,
            red: 16711680,
            rosybrown: 12357519,
            royalblue: 4286945,
            saddlebrown: 9127187,
            salmon: 16416882,
            sandybrown: 16032864,
            seagreen: 3050327,
            seashell: 16774638,
            sienna: 10506797,
            silver: 12632256,
            skyblue: 8900331,
            slateblue: 6970061,
            slategray: 7372944,
            slategrey: 7372944,
            snow: 16775930,
            springgreen: 65407,
            steelblue: 4620980,
            tan: 13808780,
            teal: 32896,
            thistle: 14204888,
            tomato: 16737095,
            turquoise: 4251856,
            violet: 15631086,
            wheat: 16113331,
            white: 16777215,
            whitesmoke: 16119285,
            yellow: 16776960,
            yellowgreen: 10145074
        }
          , Oi = {
            h: 0,
            s: 0,
            l: 0
        }
          , Fi = {
            h: 0,
            s: 0,
            l: 0
        };
        function Wi(e, t, n) {
            return n < 0 && (n += 1),
            n > 1 && (n -= 1),
            n < 1 / 6 ? e + 6 * (t - e) * n : n < .5 ? t : n < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - n) : e
        }
        class Hi {
            constructor(e, t, n) {
                return this.isColor = !0,
                this.r = 1,
                this.g = 1,
                this.b = 1,
                this.set(e, t, n)
            }
            set(e, t, n) {
                if (void 0 === t && void 0 === n) {
                    const t = e;
                    t && t.isColor ? this.copy(t) : "number" == typeof t ? this.setHex(t) : "string" == typeof t && this.setStyle(t)
                } else
                    this.setRGB(e, t, n);
                return this
            }
            setScalar(e) {
                return this.r = e,
                this.g = e,
                this.b = e,
                this
            }
            setHex(e, t=vt) {
                return e = Math.floor(e),
                this.r = (e >> 16 & 255) / 255,
                this.g = (e >> 8 & 255) / 255,
                this.b = (255 & e) / 255,
                rn.toWorkingColorSpace(this, t),
                this
            }
            setRGB(e, t, n, i=rn.workingColorSpace) {
                return this.r = e,
                this.g = t,
                this.b = n,
                rn.toWorkingColorSpace(this, i),
                this
            }
            setHSL(e, t, n, i=rn.workingColorSpace) {
                if (e = Wt(e, 1),
                t = Ft(t, 0, 1),
                n = Ft(n, 0, 1),
                0 === t)
                    this.r = this.g = this.b = n;
                else {
                    const i = n <= .5 ? n * (1 + t) : n + t - n * t
                      , r = 2 * n - i;
                    this.r = Wi(r, i, e + 1 / 3),
                    this.g = Wi(r, i, e),
                    this.b = Wi(r, i, e - 1 / 3)
                }
                return rn.toWorkingColorSpace(this, i),
                this
            }
            setStyle(e, t=vt) {
                function n(t) {
                    void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
                }
                let i;
                if (i = /^(\w+)\(([^\)]*)\)/.exec(e)) {
                    let r;
                    const a = i[1]
                      , s = i[2];
                    switch (a) {
                    case "rgb":
                    case "rgba":
                        if (r = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))
                            return n(r[4]),
                            this.setRGB(Math.min(255, parseInt(r[1], 10)) / 255, Math.min(255, parseInt(r[2], 10)) / 255, Math.min(255, parseInt(r[3], 10)) / 255, t);
                        if (r = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))
                            return n(r[4]),
                            this.setRGB(Math.min(100, parseInt(r[1], 10)) / 100, Math.min(100, parseInt(r[2], 10)) / 100, Math.min(100, parseInt(r[3], 10)) / 100, t);
                        break;
                    case "hsl":
                    case "hsla":
                        if (r = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))
                            return n(r[4]),
                            this.setHSL(parseFloat(r[1]) / 360, parseFloat(r[2]) / 100, parseFloat(r[3]) / 100, t);
                        break;
                    default:
                        console.warn("THREE.Color: Unknown color model " + e)
                    }
                } else if (i = /^\#([A-Fa-f\d]+)$/.exec(e)) {
                    const n = i[1]
                      , r = n.length;
                    if (3 === r)
                        return this.setRGB(parseInt(n.charAt(0), 16) / 15, parseInt(n.charAt(1), 16) / 15, parseInt(n.charAt(2), 16) / 15, t);
                    if (6 === r)
                        return this.setHex(parseInt(n, 16), t);
                    console.warn("THREE.Color: Invalid hex color " + e)
                } else if (e && e.length > 0)
                    return this.setColorName(e, t);
                return this
            }
            setColorName(e, t=vt) {
                const n = zi[e.toLowerCase()];
                return void 0 !== n ? this.setHex(n, t) : console.warn("THREE.Color: Unknown color " + e),
                this
            }
            clone() {
                return new this.constructor(this.r,this.g,this.b)
            }
            copy(e) {
                return this.r = e.r,
                this.g = e.g,
                this.b = e.b,
                this
            }
            copySRGBToLinear(e) {
                return this.r = an(e.r),
                this.g = an(e.g),
                this.b = an(e.b),
                this
            }
            copyLinearToSRGB(e) {
                return this.r = sn(e.r),
                this.g = sn(e.g),
                this.b = sn(e.b),
                this
            }
            convertSRGBToLinear() {
                return this.copySRGBToLinear(this),
                this
            }
            convertLinearToSRGB() {
                return this.copyLinearToSRGB(this),
                this
            }
            getHex(e=vt) {
                return rn.fromWorkingColorSpace(Vi.copy(this), e),
                65536 * Math.round(Ft(255 * Vi.r, 0, 255)) + 256 * Math.round(Ft(255 * Vi.g, 0, 255)) + Math.round(Ft(255 * Vi.b, 0, 255))
            }
            getHexString(e=vt) {
                return ("000000" + this.getHex(e).toString(16)).slice(-6)
            }
            getHSL(e, t=rn.workingColorSpace) {
                rn.fromWorkingColorSpace(Vi.copy(this), t);
                const n = Vi.r
                  , i = Vi.g
                  , r = Vi.b
                  , a = Math.max(n, i, r)
                  , s = Math.min(n, i, r);
                let o, l;
                const c = (s + a) / 2;
                if (s === a)
                    o = 0,
                    l = 0;
                else {
                    const e = a - s;
                    switch (l = c <= .5 ? e / (a + s) : e / (2 - a - s),
                    a) {
                    case n:
                        o = (i - r) / e + (i < r ? 6 : 0);
                        break;
                    case i:
                        o = (r - n) / e + 2;
                        break;
                    case r:
                        o = (n - i) / e + 4
                    }
                    o /= 6
                }
                return e.h = o,
                e.s = l,
                e.l = c,
                e
            }
            getRGB(e, t=rn.workingColorSpace) {
                return rn.fromWorkingColorSpace(Vi.copy(this), t),
                e.r = Vi.r,
                e.g = Vi.g,
                e.b = Vi.b,
                e
            }
            getStyle(e=vt) {
                rn.fromWorkingColorSpace(Vi.copy(this), e);
                const t = Vi.r
                  , n = Vi.g
                  , i = Vi.b;
                return e !== vt ? `color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})` : `rgb(${Math.round(255 * t)},${Math.round(255 * n)},${Math.round(255 * i)})`
            }
            offsetHSL(e, t, n) {
                return this.getHSL(Oi),
                this.setHSL(Oi.h + e, Oi.s + t, Oi.l + n)
            }
            add(e) {
                return this.r += e.r,
                this.g += e.g,
                this.b += e.b,
                this
            }
            addColors(e, t) {
                return this.r = e.r + t.r,
                this.g = e.g + t.g,
                this.b = e.b + t.b,
                this
            }
            addScalar(e) {
                return this.r += e,
                this.g += e,
                this.b += e,
                this
            }
            sub(e) {
                return this.r = Math.max(0, this.r - e.r),
                this.g = Math.max(0, this.g - e.g),
                this.b = Math.max(0, this.b - e.b),
                this
            }
            multiply(e) {
                return this.r *= e.r,
                this.g *= e.g,
                this.b *= e.b,
                this
            }
            multiplyScalar(e) {
                return this.r *= e,
                this.g *= e,
                this.b *= e,
                this
            }
            lerp(e, t) {
                return this.r += (e.r - this.r) * t,
                this.g += (e.g - this.g) * t,
                this.b += (e.b - this.b) * t,
                this
            }
            lerpColors(e, t, n) {
                return this.r = e.r + (t.r - e.r) * n,
                this.g = e.g + (t.g - e.g) * n,
                this.b = e.b + (t.b - e.b) * n,
                this
            }
            lerpHSL(e, t) {
                this.getHSL(Oi),
                e.getHSL(Fi);
                const n = Ht(Oi.h, Fi.h, t)
                  , i = Ht(Oi.s, Fi.s, t)
                  , r = Ht(Oi.l, Fi.l, t);
                return this.setHSL(n, i, r),
                this
            }
            setFromVector3(e) {
                return this.r = e.x,
                this.g = e.y,
                this.b = e.z,
                this
            }
            applyMatrix3(e) {
                const t = this.r
                  , n = this.g
                  , i = this.b
                  , r = e.elements;
                return this.r = r[0] * t + r[3] * n + r[6] * i,
                this.g = r[1] * t + r[4] * n + r[7] * i,
                this.b = r[2] * t + r[5] * n + r[8] * i,
                this
            }
            equals(e) {
                return e.r === this.r && e.g === this.g && e.b === this.b
            }
            fromArray(e, t=0) {
                return this.r = e[t],
                this.g = e[t + 1],
                this.b = e[t + 2],
                this
            }
            toArray(e=[], t=0) {
                return e[t] = this.r,
                e[t + 1] = this.g,
                e[t + 2] = this.b,
                e
            }
            fromBufferAttribute(e, t) {
                return this.r = e.getX(t),
                this.g = e.getY(t),
                this.b = e.getZ(t),
                this
            }
            toJSON() {
                return this.getHex()
            }
            *[Symbol.iterator]() {
                yield this.r,
                yield this.g,
                yield this.b
            }
        }
        const Vi = new Hi;
        Hi.NAMES = zi;
        let Gi = 0;
        class ji extends Dt {
            constructor() {
                super(),
                this.isMaterial = !0,
                Object.defineProperty(this, "id", {
                    value: Gi++
                }),
                this.uuid = Ot(),
                this.name = "",
                this.type = "Material",
                this.blending = 1,
                this.side = 0,
                this.vertexColors = !1,
                this.opacity = 1,
                this.transparent = !1,
                this.alphaHash = !1,
                this.blendSrc = 204,
                this.blendDst = 205,
                this.blendEquation = _,
                this.blendSrcAlpha = null,
                this.blendDstAlpha = null,
                this.blendEquationAlpha = null,
                this.blendColor = new Hi(0,0,0),
                this.blendAlpha = 0,
                this.depthFunc = 3,
                this.depthTest = !0,
                this.depthWrite = !0,
                this.stencilWriteMask = 255,
                this.stencilFunc = 519,
                this.stencilRef = 0,
                this.stencilFuncMask = 255,
                this.stencilFail = At,
                this.stencilZFail = At,
                this.stencilZPass = At,
                this.stencilWrite = !1,
                this.clippingPlanes = null,
                this.clipIntersection = !1,
                this.clipShadows = !1,
                this.shadowSide = null,
                this.colorWrite = !0,
                this.precision = null,
                this.polygonOffset = !1,
                this.polygonOffsetFactor = 0,
                this.polygonOffsetUnits = 0,
                this.dithering = !1,
                this.alphaToCoverage = !1,
                this.premultipliedAlpha = !1,
                this.forceSinglePass = !1,
                this.visible = !0,
                this.toneMapped = !0,
                this.userData = {},
                this.version = 0,
                this._alphaTest = 0
            }
            get alphaTest() {
                return this._alphaTest
            }
            set alphaTest(e) {
                this._alphaTest > 0 != e > 0 && this.version++,
                this._alphaTest = e
            }
            onBeforeRender() {}
            onBeforeCompile() {}
            customProgramCacheKey() {
                return this.onBeforeCompile.toString()
            }
            setValues(e) {
                if (void 0 !== e)
                    for (const t in e) {
                        const n = e[t];
                        if (void 0 === n) {
                            console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);
                            continue
                        }
                        const i = this[t];
                        void 0 !== i ? i && i.isColor ? i.set(n) : i && i.isVector3 && n && n.isVector3 ? i.copy(n) : this[t] = n : console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)
                    }
            }
            toJSON(e) {
                const t = void 0 === e || "string" == typeof e;
                t && (e = {
                    textures: {},
                    images: {}
                });
                const n = {
                    metadata: {
                        version: 4.6,
                        type: "Material",
                        generator: "Material.toJSON"
                    }
                };
                function i(e) {
                    const t = [];
                    for (const n in e) {
                        const i = e[n];
                        delete i.metadata,
                        t.push(i)
                    }
                    return t
                }
                if (n.uuid = this.uuid,
                n.type = this.type,
                "" !== this.name && (n.name = this.name),
                this.color && this.color.isColor && (n.color = this.color.getHex()),
                void 0 !== this.roughness && (n.roughness = this.roughness),
                void 0 !== this.metalness && (n.metalness = this.metalness),
                void 0 !== this.sheen && (n.sheen = this.sheen),
                this.sheenColor && this.sheenColor.isColor && (n.sheenColor = this.sheenColor.getHex()),
                void 0 !== this.sheenRoughness && (n.sheenRoughness = this.sheenRoughness),
                this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()),
                void 0 !== this.emissiveIntensity && 1 !== this.emissiveIntensity && (n.emissiveIntensity = this.emissiveIntensity),
                this.specular && this.specular.isColor && (n.specular = this.specular.getHex()),
                void 0 !== this.specularIntensity && (n.specularIntensity = this.specularIntensity),
                this.specularColor && this.specularColor.isColor && (n.specularColor = this.specularColor.getHex()),
                void 0 !== this.shininess && (n.shininess = this.shininess),
                void 0 !== this.clearcoat && (n.clearcoat = this.clearcoat),
                void 0 !== this.clearcoatRoughness && (n.clearcoatRoughness = this.clearcoatRoughness),
                this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid),
                this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid),
                this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid,
                n.clearcoatNormalScale = this.clearcoatNormalScale.toArray()),
                void 0 !== this.dispersion && (n.dispersion = this.dispersion),
                void 0 !== this.iridescence && (n.iridescence = this.iridescence),
                void 0 !== this.iridescenceIOR && (n.iridescenceIOR = this.iridescenceIOR),
                void 0 !== this.iridescenceThicknessRange && (n.iridescenceThicknessRange = this.iridescenceThicknessRange),
                this.iridescenceMap && this.iridescenceMap.isTexture && (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid),
                this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid),
                void 0 !== this.anisotropy && (n.anisotropy = this.anisotropy),
                void 0 !== this.anisotropyRotation && (n.anisotropyRotation = this.anisotropyRotation),
                this.anisotropyMap && this.anisotropyMap.isTexture && (n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid),
                this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid),
                this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid),
                this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
                this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid,
                n.lightMapIntensity = this.lightMapIntensity),
                this.aoMap && this.aoMap.isTexture && (n.aoMap = this.aoMap.toJSON(e).uuid,
                n.aoMapIntensity = this.aoMapIntensity),
                this.bumpMap && this.bumpMap.isTexture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
                n.bumpScale = this.bumpScale),
                this.normalMap && this.normalMap.isTexture && (n.normalMap = this.normalMap.toJSON(e).uuid,
                n.normalMapType = this.normalMapType,
                n.normalScale = this.normalScale.toArray()),
                this.displacementMap && this.displacementMap.isTexture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
                n.displacementScale = this.displacementScale,
                n.displacementBias = this.displacementBias),
                this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
                this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
                this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
                this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid),
                this.specularIntensityMap && this.specularIntensityMap.isTexture && (n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid),
                this.specularColorMap && this.specularColorMap.isTexture && (n.specularColorMap = this.specularColorMap.toJSON(e).uuid),
                this.envMap && this.envMap.isTexture && (n.envMap = this.envMap.toJSON(e).uuid,
                void 0 !== this.combine && (n.combine = this.combine)),
                void 0 !== this.envMapRotation && (n.envMapRotation = this.envMapRotation.toArray()),
                void 0 !== this.envMapIntensity && (n.envMapIntensity = this.envMapIntensity),
                void 0 !== this.reflectivity && (n.reflectivity = this.reflectivity),
                void 0 !== this.refractionRatio && (n.refractionRatio = this.refractionRatio),
                this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid),
                void 0 !== this.transmission && (n.transmission = this.transmission),
                this.transmissionMap && this.transmissionMap.isTexture && (n.transmissionMap = this.transmissionMap.toJSON(e).uuid),
                void 0 !== this.thickness && (n.thickness = this.thickness),
                this.thicknessMap && this.thicknessMap.isTexture && (n.thicknessMap = this.thicknessMap.toJSON(e).uuid),
                void 0 !== this.attenuationDistance && this.attenuationDistance !== 1 / 0 && (n.attenuationDistance = this.attenuationDistance),
                void 0 !== this.attenuationColor && (n.attenuationColor = this.attenuationColor.getHex()),
                void 0 !== this.size && (n.size = this.size),
                null !== this.shadowSide && (n.shadowSide = this.shadowSide),
                void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
                1 !== this.blending && (n.blending = this.blending),
                0 !== this.side && (n.side = this.side),
                !0 === this.vertexColors && (n.vertexColors = !0),
                this.opacity < 1 && (n.opacity = this.opacity),
                !0 === this.transparent && (n.transparent = !0),
                204 !== this.blendSrc && (n.blendSrc = this.blendSrc),
                205 !== this.blendDst && (n.blendDst = this.blendDst),
                this.blendEquation !== _ && (n.blendEquation = this.blendEquation),
                null !== this.blendSrcAlpha && (n.blendSrcAlpha = this.blendSrcAlpha),
                null !== this.blendDstAlpha && (n.blendDstAlpha = this.blendDstAlpha),
                null !== this.blendEquationAlpha && (n.blendEquationAlpha = this.blendEquationAlpha),
                this.blendColor && this.blendColor.isColor && (n.blendColor = this.blendColor.getHex()),
                0 !== this.blendAlpha && (n.blendAlpha = this.blendAlpha),
                3 !== this.depthFunc && (n.depthFunc = this.depthFunc),
                !1 === this.depthTest && (n.depthTest = this.depthTest),
                !1 === this.depthWrite && (n.depthWrite = this.depthWrite),
                !1 === this.colorWrite && (n.colorWrite = this.colorWrite),
                255 !== this.stencilWriteMask && (n.stencilWriteMask = this.stencilWriteMask),
                519 !== this.stencilFunc && (n.stencilFunc = this.stencilFunc),
                0 !== this.stencilRef && (n.stencilRef = this.stencilRef),
                255 !== this.stencilFuncMask && (n.stencilFuncMask = this.stencilFuncMask),
                this.stencilFail !== At && (n.stencilFail = this.stencilFail),
                this.stencilZFail !== At && (n.stencilZFail = this.stencilZFail),
                this.stencilZPass !== At && (n.stencilZPass = this.stencilZPass),
                !0 === this.stencilWrite && (n.stencilWrite = this.stencilWrite),
                void 0 !== this.rotation && 0 !== this.rotation && (n.rotation = this.rotation),
                !0 === this.polygonOffset && (n.polygonOffset = !0),
                0 !== this.polygonOffsetFactor && (n.polygonOffsetFactor = this.polygonOffsetFactor),
                0 !== this.polygonOffsetUnits && (n.polygonOffsetUnits = this.polygonOffsetUnits),
                void 0 !== this.linewidth && 1 !== this.linewidth && (n.linewidth = this.linewidth),
                void 0 !== this.dashSize && (n.dashSize = this.dashSize),
                void 0 !== this.gapSize && (n.gapSize = this.gapSize),
                void 0 !== this.scale && (n.scale = this.scale),
                !0 === this.dithering && (n.dithering = !0),
                this.alphaTest > 0 && (n.alphaTest = this.alphaTest),
                !0 === this.alphaHash && (n.alphaHash = !0),
                !0 === this.alphaToCoverage && (n.alphaToCoverage = !0),
                !0 === this.premultipliedAlpha && (n.premultipliedAlpha = !0),
                !0 === this.forceSinglePass && (n.forceSinglePass = !0),
                !0 === this.wireframe && (n.wireframe = !0),
                this.wireframeLinewidth > 1 && (n.wireframeLinewidth = this.wireframeLinewidth),
                "round" !== this.wireframeLinecap && (n.wireframeLinecap = this.wireframeLinecap),
                "round" !== this.wireframeLinejoin && (n.wireframeLinejoin = this.wireframeLinejoin),
                !0 === this.flatShading && (n.flatShading = !0),
                !1 === this.visible && (n.visible = !1),
                !1 === this.toneMapped && (n.toneMapped = !1),
                !1 === this.fog && (n.fog = !1),
                Object.keys(this.userData).length > 0 && (n.userData = this.userData),
                t) {
                    const t = i(e.textures)
                      , r = i(e.images);
                    t.length > 0 && (n.textures = t),
                    r.length > 0 && (n.images = r)
                }
                return n
            }
            clone() {
                return (new this.constructor).copy(this)
            }
            copy(e) {
                this.name = e.name,
                this.blending = e.blending,
                this.side = e.side,
                this.vertexColors = e.vertexColors,
                this.opacity = e.opacity,
                this.transparent = e.transparent,
                this.blendSrc = e.blendSrc,
                this.blendDst = e.blendDst,
                this.blendEquation = e.blendEquation,
                this.blendSrcAlpha = e.blendSrcAlpha,
                this.blendDstAlpha = e.blendDstAlpha,
                this.blendEquationAlpha = e.blendEquationAlpha,
                this.blendColor.copy(e.blendColor),
                this.blendAlpha = e.blendAlpha,
                this.depthFunc = e.depthFunc,
                this.depthTest = e.depthTest,
                this.depthWrite = e.depthWrite,
                this.stencilWriteMask = e.stencilWriteMask,
                this.stencilFunc = e.stencilFunc,
                this.stencilRef = e.stencilRef,
                this.stencilFuncMask = e.stencilFuncMask,
                this.stencilFail = e.stencilFail,
                this.stencilZFail = e.stencilZFail,
                this.stencilZPass = e.stencilZPass,
                this.stencilWrite = e.stencilWrite;
                const t = e.clippingPlanes;
                let n = null;
                if (null !== t) {
                    const e = t.length;
                    n = new Array(e);
                    for (let i = 0; i !== e; ++i)
                        n[i] = t[i].clone()
                }
                return this.clippingPlanes = n,
                this.clipIntersection = e.clipIntersection,
                this.clipShadows = e.clipShadows,
                this.shadowSide = e.shadowSide,
                this.colorWrite = e.colorWrite,
                this.precision = e.precision,
                this.polygonOffset = e.polygonOffset,
                this.polygonOffsetFactor = e.polygonOffsetFactor,
                this.polygonOffsetUnits = e.polygonOffsetUnits,
                this.dithering = e.dithering,
                this.alphaTest = e.alphaTest,
                this.alphaHash = e.alphaHash,
                this.alphaToCoverage = e.alphaToCoverage,
                this.premultipliedAlpha = e.premultipliedAlpha,
                this.forceSinglePass = e.forceSinglePass,
                this.visible = e.visible,
                this.toneMapped = e.toneMapped,
                this.userData = JSON.parse(JSON.stringify(e.userData)),
                this
            }
            dispose() {
                this.dispatchEvent({
                    type: "dispose"
                })
            }
            set needsUpdate(e) {
                !0 === e && this.version++
            }
            onBuild() {
                console.warn("Material: onBuild() has been removed.")
            }
        }
        class Qi extends ji {
            constructor(e) {
                super(),
                this.isMeshBasicMaterial = !0,
                this.type = "MeshBasicMaterial",
                this.color = new Hi(16777215),
                this.map = null,
                this.lightMap = null,
                this.lightMapIntensity = 1,
                this.aoMap = null,
                this.aoMapIntensity = 1,
                this.specularMap = null,
                this.alphaMap = null,
                this.envMap = null,
                this.envMapRotation = new si,
                this.combine = 0,
                this.reflectivity = 1,
                this.refractionRatio = .98,
                this.wireframe = !1,
                this.wireframeLinewidth = 1,
                this.wireframeLinecap = "round",
                this.wireframeLinejoin = "round",
                this.fog = !0,
                this.setValues(e)
            }
            copy(e) {
                return super.copy(e),
                this.color.copy(e.color),
                this.map = e.map,
                this.lightMap = e.lightMap,
                this.lightMapIntensity = e.lightMapIntensity,
                this.aoMap = e.aoMap,
                this.aoMapIntensity = e.aoMapIntensity,
                this.specularMap = e.specularMap,
                this.alphaMap = e.alphaMap,
                this.envMap = e.envMap,
                this.envMapRotation.copy(e.envMapRotation),
                this.combine = e.combine,
                this.reflectivity = e.reflectivity,
                this.refractionRatio = e.refractionRatio,
                this.wireframe = e.wireframe,
                this.wireframeLinewidth = e.wireframeLinewidth,
                this.wireframeLinecap = e.wireframeLinecap,
                this.wireframeLinejoin = e.wireframeLinejoin,
                this.fog = e.fog,
                this
            }
        }
        const Ki = new bn
          , qi = new Qt;
        let Yi = 0;
        class Xi {
            constructor(e, t, n=!1) {
                if (Array.isArray(e))
                    throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
                this.isBufferAttribute = !0,
                Object.defineProperty(this, "id", {
                    value: Yi++
                }),
                this.name = "",
                this.array = e,
                this.itemSize = t,
                this.count = void 0 !== e ? e.length / t : 0,
                this.normalized = n,
                this.usage = Pt,
                this.updateRanges = [],
                this.gpuType = be,
                this.version = 0
            }
            onUploadCallback() {}
            set needsUpdate(e) {
                !0 === e && this.version++
            }
            setUsage(e) {
                return this.usage = e,
                this
            }
            addUpdateRange(e, t) {
                this.updateRanges.push({
                    start: e,
                    count: t
                })
            }
            clearUpdateRanges() {
                this.updateRanges.length = 0
            }
            copy(e) {
                return this.name = e.name,
                this.array = new e.array.constructor(e.array),
                this.itemSize = e.itemSize,
                this.count = e.count,
                this.normalized = e.normalized,
                this.usage = e.usage,
                this.gpuType = e.gpuType,
                this
            }
            copyAt(e, t, n) {
                e *= this.itemSize,
                n *= t.itemSize;
                for (let i = 0, r = this.itemSize; i < r; i++)
                    this.array[e + i] = t.array[n + i];
                return this
            }
            copyArray(e) {
                return this.array.set(e),
                this
            }
            applyMatrix3(e) {
                if (2 === this.itemSize)
                    for (let t = 0, n = this.count; t < n; t++)
                        qi.fromBufferAttribute(this, t),
                        qi.applyMatrix3(e),
                        this.setXY(t, qi.x, qi.y);
                else if (3 === this.itemSize)
                    for (let t = 0, n = this.count; t < n; t++)
                        Ki.fromBufferAttribute(this, t),
                        Ki.applyMatrix3(e),
                        this.setXYZ(t, Ki.x, Ki.y, Ki.z);
                return this
            }
            applyMatrix4(e) {
                for (let t = 0, n = this.count; t < n; t++)
                    Ki.fromBufferAttribute(this, t),
                    Ki.applyMatrix4(e),
                    this.setXYZ(t, Ki.x, Ki.y, Ki.z);
                return this
            }
            applyNormalMatrix(e) {
                for (let t = 0, n = this.count; t < n; t++)
                    Ki.fromBufferAttribute(this, t),
                    Ki.applyNormalMatrix(e),
                    this.setXYZ(t, Ki.x, Ki.y, Ki.z);
                return this
            }
            transformDirection(e) {
                for (let t = 0, n = this.count; t < n; t++)
                    Ki.fromBufferAttribute(this, t),
                    Ki.transformDirection(e),
                    this.setXYZ(t, Ki.x, Ki.y, Ki.z);
                return this
            }
            set(e, t=0) {
                return this.array.set(e, t),
                this
            }
            getComponent(e, t) {
                let n = this.array[e * this.itemSize + t];
                return this.normalized && (n = Vt(n, this.array)),
                n
            }
            setComponent(e, t, n) {
                return this.normalized && (n = Gt(n, this.array)),
                this.array[e * this.itemSize + t] = n,
                this
            }
            getX(e) {
                let t = this.array[e * this.itemSize];
                return this.normalized && (t = Vt(t, this.array)),
                t
            }
            setX(e, t) {
                return this.normalized && (t = Gt(t, this.array)),
                this.array[e * this.itemSize] = t,
                this
            }
            getY(e) {
                let t = this.array[e * this.itemSize + 1];
                return this.normalized && (t = Vt(t, this.array)),
                t
            }
            setY(e, t) {
                return this.normalized && (t = Gt(t, this.array)),
                this.array[e * this.itemSize + 1] = t,
                this
            }
            getZ(e) {
                let t = this.array[e * this.itemSize + 2];
                return this.normalized && (t = Vt(t, this.array)),
                t
            }
            setZ(e, t) {
                return this.normalized && (t = Gt(t, this.array)),
                this.array[e * this.itemSize + 2] = t,
                this
            }
            getW(e) {
                let t = this.array[e * this.itemSize + 3];
                return this.normalized && (t = Vt(t, this.array)),
                t
            }
            setW(e, t) {
                return this.normalized && (t = Gt(t, this.array)),
                this.array[e * this.itemSize + 3] = t,
                this
            }
            setXY(e, t, n) {
                return e *= this.itemSize,
                this.normalized && (t = Gt(t, this.array),
                n = Gt(n, this.array)),
                this.array[e + 0] = t,
                this.array[e + 1] = n,
                this
            }
            setXYZ(e, t, n, i) {
                return e *= this.itemSize,
                this.normalized && (t = Gt(t, this.array),
                n = Gt(n, this.array),
                i = Gt(i, this.array)),
                this.array[e + 0] = t,
                this.array[e + 1] = n,
                this.array[e + 2] = i,
                this
            }
            setXYZW(e, t, n, i, r) {
                return e *= this.itemSize,
                this.normalized && (t = Gt(t, this.array),
                n = Gt(n, this.array),
                i = Gt(i, this.array),
                r = Gt(r, this.array)),
                this.array[e + 0] = t,
                this.array[e + 1] = n,
                this.array[e + 2] = i,
                this.array[e + 3] = r,
                this
            }
            onUpload(e) {
                return this.onUploadCallback = e,
                this
            }
            clone() {
                return new this.constructor(this.array,this.itemSize).copy(this)
            }
            toJSON() {
                const e = {
                    itemSize: this.itemSize,
                    type: this.array.constructor.name,
                    array: Array.from(this.array),
                    normalized: this.normalized
                };
                return "" !== this.name && (e.name = this.name),
                this.usage !== Pt && (e.usage = this.usage),
                e
            }
        }
        class Zi extends Xi {
            constructor(e, t, n) {
                super(new Uint16Array(e), t, n)
            }
        }
        class Ji extends Xi {
            constructor(e, t, n) {
                super(new Uint32Array(e), t, n)
            }
        }
        class $i extends Xi {
            constructor(e, t, n) {
                super(new Float32Array(e), t, n)
            }
        }
        let er = 0;
        const tr = new Xn
          , nr = new ki
          , ir = new bn
          , rr = new kn
          , ar = new kn
          , sr = new bn;
        class or extends Dt {
            constructor() {
                super(),
                this.isBufferGeometry = !0,
                Object.defineProperty(this, "id", {
                    value: er++
                }),
                this.uuid = Ot(),
                this.name = "",
                this.type = "BufferGeometry",
                this.index = null,
                this.indirect = null,
                this.attributes = {},
                this.morphAttributes = {},
                this.morphTargetsRelative = !1,
                this.groups = [],
                this.boundingBox = null,
                this.boundingSphere = null,
                this.drawRange = {
                    start: 0,
                    count: 1 / 0
                },
                this.userData = {}
            }
            getIndex() {
                return this.index
            }
            setIndex(e) {
                return Array.isArray(e) ? this.index = new (Yt(e) ? Ji : Zi)(e,1) : this.index = e,
                this
            }
            setIndirect(e) {
                return this.indirect = e,
                this
            }
            getIndirect() {
                return this.indirect
            }
            getAttribute(e) {
                return this.attributes[e]
            }
            setAttribute(e, t) {
                return this.attributes[e] = t,
                this
            }
            deleteAttribute(e) {
                return delete this.attributes[e],
                this
            }
            hasAttribute(e) {
                return void 0 !== this.attributes[e]
            }
            addGroup(e, t, n=0) {
                this.groups.push({
                    start: e,
                    count: t,
                    materialIndex: n
                })
            }
            clearGroups() {
                this.groups = []
            }
            setDrawRange(e, t) {
                this.drawRange.start = e,
                this.drawRange.count = t
            }
            applyMatrix4(e) {
                const t = this.attributes.position;
                void 0 !== t && (t.applyMatrix4(e),
                t.needsUpdate = !0);
                const n = this.attributes.normal;
                if (void 0 !== n) {
                    const t = (new Kt).getNormalMatrix(e);
                    n.applyNormalMatrix(t),
                    n.needsUpdate = !0
                }
                const i = this.attributes.tangent;
                return void 0 !== i && (i.transformDirection(e),
                i.needsUpdate = !0),
                null !== this.boundingBox && this.computeBoundingBox(),
                null !== this.boundingSphere && this.computeBoundingSphere(),
                this
            }
            applyQuaternion(e) {
                return tr.makeRotationFromQuaternion(e),
                this.applyMatrix4(tr),
                this
            }
            rotateX(e) {
                return tr.makeRotationX(e),
                this.applyMatrix4(tr),
                this
            }
            rotateY(e) {
                return tr.makeRotationY(e),
                this.applyMatrix4(tr),
                this
            }
            rotateZ(e) {
                return tr.makeRotationZ(e),
                this.applyMatrix4(tr),
                this
            }
            translate(e, t, n) {
                return tr.makeTranslation(e, t, n),
                this.applyMatrix4(tr),
                this
            }
            scale(e, t, n) {
                return tr.makeScale(e, t, n),
                this.applyMatrix4(tr),
                this
            }
            lookAt(e) {
                return nr.lookAt(e),
                nr.updateMatrix(),
                this.applyMatrix4(nr.matrix),
                this
            }
            center() {
                return this.computeBoundingBox(),
                this.boundingBox.getCenter(ir).negate(),
                this.translate(ir.x, ir.y, ir.z),
                this
            }
            setFromPoints(e) {
                const t = this.getAttribute("position");
                if (void 0 === t) {
                    const t = [];
                    for (let n = 0, i = e.length; n < i; n++) {
                        const i = e[n];
                        t.push(i.x, i.y, i.z || 0)
                    }
                    this.setAttribute("position", new $i(t,3))
                } else {
                    const n = Math.min(e.length, t.count);
                    for (let i = 0; i < n; i++) {
                        const n = e[i];
                        t.setXYZ(i, n.x, n.y, n.z || 0)
                    }
                    e.length > t.count && console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),
                    t.needsUpdate = !0
                }
                return this
            }
            computeBoundingBox() {
                null === this.boundingBox && (this.boundingBox = new kn);
                const e = this.attributes.position
                  , t = this.morphAttributes.position;
                if (e && e.isGLBufferAttribute)
                    return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.", this),
                    void this.boundingBox.set(new bn(-1 / 0,-1 / 0,-1 / 0), new bn(1 / 0,1 / 0,1 / 0));
                if (void 0 !== e) {
                    if (this.boundingBox.setFromBufferAttribute(e),
                    t)
                        for (let e = 0, n = t.length; e < n; e++) {
                            const n = t[e];
                            rr.setFromBufferAttribute(n),
                            this.morphTargetsRelative ? (sr.addVectors(this.boundingBox.min, rr.min),
                            this.boundingBox.expandByPoint(sr),
                            sr.addVectors(this.boundingBox.max, rr.max),
                            this.boundingBox.expandByPoint(sr)) : (this.boundingBox.expandByPoint(rr.min),
                            this.boundingBox.expandByPoint(rr.max))
                        }
                } else
                    this.boundingBox.makeEmpty();
                (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this)
            }
            computeBoundingSphere() {
                null === this.boundingSphere && (this.boundingSphere = new Wn);
                const e = this.attributes.position
                  , t = this.morphAttributes.position;
                if (e && e.isGLBufferAttribute)
                    return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.", this),
                    void this.boundingSphere.set(new bn, 1 / 0);
                if (e) {
                    const n = this.boundingSphere.center;
                    if (rr.setFromBufferAttribute(e),
                    t)
                        for (let e = 0, n = t.length; e < n; e++) {
                            const n = t[e];
                            ar.setFromBufferAttribute(n),
                            this.morphTargetsRelative ? (sr.addVectors(rr.min, ar.min),
                            rr.expandByPoint(sr),
                            sr.addVectors(rr.max, ar.max),
                            rr.expandByPoint(sr)) : (rr.expandByPoint(ar.min),
                            rr.expandByPoint(ar.max))
                        }
                    rr.getCenter(n);
                    let i = 0;
                    for (let t = 0, r = e.count; t < r; t++)
                        sr.fromBufferAttribute(e, t),
                        i = Math.max(i, n.distanceToSquared(sr));
                    if (t)
                        for (let r = 0, a = t.length; r < a; r++) {
                            const a = t[r]
                              , s = this.morphTargetsRelative;
                            for (let t = 0, r = a.count; t < r; t++)
                                sr.fromBufferAttribute(a, t),
                                s && (ir.fromBufferAttribute(e, t),
                                sr.add(ir)),
                                i = Math.max(i, n.distanceToSquared(sr))
                        }
                    this.boundingSphere.radius = Math.sqrt(i),
                    isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
                }
            }
            computeTangents() {
                const e = this.index
                  , t = this.attributes;
                if (null === e || void 0 === t.position || void 0 === t.normal || void 0 === t.uv)
                    return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");
                const n = t.position
                  , i = t.normal
                  , r = t.uv;
                !1 === this.hasAttribute("tangent") && this.setAttribute("tangent", new Xi(new Float32Array(4 * n.count),4));
                const a = this.getAttribute("tangent")
                  , s = []
                  , o = [];
                for (let e = 0; e < n.count; e++)
                    s[e] = new bn,
                    o[e] = new bn;
                const l = new bn
                  , c = new bn
                  , h = new bn
                  , d = new Qt
                  , u = new Qt
                  , p = new Qt
                  , f = new bn
                  , m = new bn;
                function g(e, t, i) {
                    l.fromBufferAttribute(n, e),
                    c.fromBufferAttribute(n, t),
                    h.fromBufferAttribute(n, i),
                    d.fromBufferAttribute(r, e),
                    u.fromBufferAttribute(r, t),
                    p.fromBufferAttribute(r, i),
                    c.sub(l),
                    h.sub(l),
                    u.sub(d),
                    p.sub(d);
                    const a = 1 / (u.x * p.y - p.x * u.y);
                    isFinite(a) && (f.copy(c).multiplyScalar(p.y).addScaledVector(h, -u.y).multiplyScalar(a),
                    m.copy(h).multiplyScalar(u.x).addScaledVector(c, -p.x).multiplyScalar(a),
                    s[e].add(f),
                    s[t].add(f),
                    s[i].add(f),
                    o[e].add(m),
                    o[t].add(m),
                    o[i].add(m))
                }
                let v = this.groups;
                0 === v.length && (v = [{
                    start: 0,
                    count: e.count
                }]);
                for (let t = 0, n = v.length; t < n; ++t) {
                    const n = v[t]
                      , i = n.start;
                    for (let t = i, r = i + n.count; t < r; t += 3)
                        g(e.getX(t + 0), e.getX(t + 1), e.getX(t + 2))
                }
                const w = new bn
                  , y = new bn
                  , b = new bn
                  , A = new bn;
                function x(e) {
                    b.fromBufferAttribute(i, e),
                    A.copy(b);
                    const t = s[e];
                    w.copy(t),
                    w.sub(b.multiplyScalar(b.dot(t))).normalize(),
                    y.crossVectors(A, t);
                    const n = y.dot(o[e]) < 0 ? -1 : 1;
                    a.setXYZW(e, w.x, w.y, w.z, n)
                }
                for (let t = 0, n = v.length; t < n; ++t) {
                    const n = v[t]
                      , i = n.start;
                    for (let t = i, r = i + n.count; t < r; t += 3)
                        x(e.getX(t + 0)),
                        x(e.getX(t + 1)),
                        x(e.getX(t + 2))
                }
            }
            computeVertexNormals() {
                const e = this.index
                  , t = this.getAttribute("position");
                if (void 0 !== t) {
                    let n = this.getAttribute("normal");
                    if (void 0 === n)
                        n = new Xi(new Float32Array(3 * t.count),3),
                        this.setAttribute("normal", n);
                    else
                        for (let e = 0, t = n.count; e < t; e++)
                            n.setXYZ(e, 0, 0, 0);
                    const i = new bn
                      , r = new bn
                      , a = new bn
                      , s = new bn
                      , o = new bn
                      , l = new bn
                      , c = new bn
                      , h = new bn;
                    if (e)
                        for (let d = 0, u = e.count; d < u; d += 3) {
                            const u = e.getX(d + 0)
                              , p = e.getX(d + 1)
                              , f = e.getX(d + 2);
                            i.fromBufferAttribute(t, u),
                            r.fromBufferAttribute(t, p),
                            a.fromBufferAttribute(t, f),
                            c.subVectors(a, r),
                            h.subVectors(i, r),
                            c.cross(h),
                            s.fromBufferAttribute(n, u),
                            o.fromBufferAttribute(n, p),
                            l.fromBufferAttribute(n, f),
                            s.add(c),
                            o.add(c),
                            l.add(c),
                            n.setXYZ(u, s.x, s.y, s.z),
                            n.setXYZ(p, o.x, o.y, o.z),
                            n.setXYZ(f, l.x, l.y, l.z)
                        }
                    else
                        for (let e = 0, s = t.count; e < s; e += 3)
                            i.fromBufferAttribute(t, e + 0),
                            r.fromBufferAttribute(t, e + 1),
                            a.fromBufferAttribute(t, e + 2),
                            c.subVectors(a, r),
                            h.subVectors(i, r),
                            c.cross(h),
                            n.setXYZ(e + 0, c.x, c.y, c.z),
                            n.setXYZ(e + 1, c.x, c.y, c.z),
                            n.setXYZ(e + 2, c.x, c.y, c.z);
                    this.normalizeNormals(),
                    n.needsUpdate = !0
                }
            }
            normalizeNormals() {
                const e = this.attributes.normal;
                for (let t = 0, n = e.count; t < n; t++)
                    sr.fromBufferAttribute(e, t),
                    sr.normalize(),
                    e.setXYZ(t, sr.x, sr.y, sr.z)
            }
            toNonIndexed() {
                function e(e, t) {
                    const n = e.array
                      , i = e.itemSize
                      , r = e.normalized
                      , a = new n.constructor(t.length * i);
                    let s = 0
                      , o = 0;
                    for (let r = 0, l = t.length; r < l; r++) {
                        s = e.isInterleavedBufferAttribute ? t[r] * e.data.stride + e.offset : t[r] * i;
                        for (let e = 0; e < i; e++)
                            a[o++] = n[s++]
                    }
                    return new Xi(a,i,r)
                }
                if (null === this.index)
                    return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),
                    this;
                const t = new or
                  , n = this.index.array
                  , i = this.attributes;
                for (const r in i) {
                    const a = e(i[r], n);
                    t.setAttribute(r, a)
                }
                const r = this.morphAttributes;
                for (const i in r) {
                    const a = []
                      , s = r[i];
                    for (let t = 0, i = s.length; t < i; t++) {
                        const i = e(s[t], n);
                        a.push(i)
                    }
                    t.morphAttributes[i] = a
                }
                t.morphTargetsRelative = this.morphTargetsRelative;
                const a = this.groups;
                for (let e = 0, n = a.length; e < n; e++) {
                    const n = a[e];
                    t.addGroup(n.start, n.count, n.materialIndex)
                }
                return t
            }
            toJSON() {
                const e = {
                    metadata: {
                        version: 4.6,
                        type: "BufferGeometry",
                        generator: "BufferGeometry.toJSON"
                    }
                };
                if (e.uuid = this.uuid,
                e.type = this.type,
                "" !== this.name && (e.name = this.name),
                Object.keys(this.userData).length > 0 && (e.userData = this.userData),
                void 0 !== this.parameters) {
                    const t = this.parameters;
                    for (const n in t)
                        void 0 !== t[n] && (e[n] = t[n]);
                    return e
                }
                e.data = {
                    attributes: {}
                };
                const t = this.index;
                null !== t && (e.data.index = {
                    type: t.array.constructor.name,
                    array: Array.prototype.slice.call(t.array)
                });
                const n = this.attributes;
                for (const t in n) {
                    const i = n[t];
                    e.data.attributes[t] = i.toJSON(e.data)
                }
                const i = {};
                let r = !1;
                for (const t in this.morphAttributes) {
                    const n = this.morphAttributes[t]
                      , a = [];
                    for (let t = 0, i = n.length; t < i; t++) {
                        const i = n[t];
                        a.push(i.toJSON(e.data))
                    }
                    a.length > 0 && (i[t] = a,
                    r = !0)
                }
                r && (e.data.morphAttributes = i,
                e.data.morphTargetsRelative = this.morphTargetsRelative);
                const a = this.groups;
                a.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(a)));
                const s = this.boundingSphere;
                return null !== s && (e.data.boundingSphere = {
                    center: s.center.toArray(),
                    radius: s.radius
                }),
                e
            }
            clone() {
                return (new this.constructor).copy(this)
            }
            copy(e) {
                this.index = null,
                this.attributes = {},
                this.morphAttributes = {},
                this.groups = [],
                this.boundingBox = null,
                this.boundingSphere = null;
                const t = {};
                this.name = e.name;
                const n = e.index;
                null !== n && this.setIndex(n.clone(t));
                const i = e.attributes;
                for (const e in i) {
                    const n = i[e];
                    this.setAttribute(e, n.clone(t))
                }
                const r = e.morphAttributes;
                for (const e in r) {
                    const n = []
                      , i = r[e];
                    for (let e = 0, r = i.length; e < r; e++)
                        n.push(i[e].clone(t));
                    this.morphAttributes[e] = n
                }
                this.morphTargetsRelative = e.morphTargetsRelative;
                const a = e.groups;
                for (let e = 0, t = a.length; e < t; e++) {
                    const t = a[e];
                    this.addGroup(t.start, t.count, t.materialIndex)
                }
                const s = e.boundingBox;
                null !== s && (this.boundingBox = s.clone());
                const o = e.boundingSphere;
                return null !== o && (this.boundingSphere = o.clone()),
                this.drawRange.start = e.drawRange.start,
                this.drawRange.count = e.drawRange.count,
                this.userData = e.userData,
                this
            }
            dispose() {
                this.dispatchEvent({
                    type: "dispose"
                })
            }
        }
        const lr = new Xn
          , cr = new Yn
          , hr = new Wn
          , dr = new bn
          , ur = new bn
          , pr = new bn
          , fr = new bn
          , mr = new bn
          , gr = new bn
          , vr = new bn
          , wr = new bn;
        class yr extends ki {
            constructor(e=new or, t=new Qi) {
                super(),
                this.isMesh = !0,
                this.type = "Mesh",
                this.geometry = e,
                this.material = t,
                this.morphTargetDictionary = void 0,
                this.morphTargetInfluences = void 0,
                this.updateMorphTargets()
            }
            copy(e, t) {
                return super.copy(e, t),
                void 0 !== e.morphTargetInfluences && (this.morphTargetInfluences = e.morphTargetInfluences.slice()),
                void 0 !== e.morphTargetDictionary && (this.morphTargetDictionary = Object.assign({}, e.morphTargetDictionary)),
                this.material = Array.isArray(e.material) ? e.material.slice() : e.material,
                this.geometry = e.geometry,
                this
            }
            updateMorphTargets() {
                const e = this.geometry.morphAttributes
                  , t = Object.keys(e);
                if (t.length > 0) {
                    const n = e[t[0]];
                    if (void 0 !== n) {
                        this.morphTargetInfluences = [],
                        this.morphTargetDictionary = {};
                        for (let e = 0, t = n.length; e < t; e++) {
                            const t = n[e].name || String(e);
                            this.morphTargetInfluences.push(0),
                            this.morphTargetDictionary[t] = e
                        }
                    }
                }
            }
            getVertexPosition(e, t) {
                const n = this.geometry
                  , i = n.attributes.position
                  , r = n.morphAttributes.position
                  , a = n.morphTargetsRelative;
                t.fromBufferAttribute(i, e);
                const s = this.morphTargetInfluences;
                if (r && s) {
                    gr.set(0, 0, 0);
                    for (let n = 0, i = r.length; n < i; n++) {
                        const i = s[n]
                          , o = r[n];
                        0 !== i && (mr.fromBufferAttribute(o, e),
                        a ? gr.addScaledVector(mr, i) : gr.addScaledVector(mr.sub(t), i))
                    }
                    t.add(gr)
                }
                return t
            }
            raycast(e, t) {
                const n = this.geometry
                  , i = this.material
                  , r = this.matrixWorld;
                if (void 0 !== i) {
                    if (null === n.boundingSphere && n.computeBoundingSphere(),
                    hr.copy(n.boundingSphere),
                    hr.applyMatrix4(r),
                    cr.copy(e.ray).recast(e.near),
                    !1 === hr.containsPoint(cr.origin)) {
                        if (null === cr.intersectSphere(hr, dr))
                            return;
                        if (cr.origin.distanceToSquared(dr) > (e.far - e.near) ** 2)
                            return
                    }
                    lr.copy(r).invert(),
                    cr.copy(e.ray).applyMatrix4(lr),
                    null !== n.boundingBox && !1 === cr.intersectsBox(n.boundingBox) || this._computeIntersections(e, t, cr)
                }
            }
            _computeIntersections(e, t, n) {
                let i;
                const r = this.geometry
                  , a = this.material
                  , s = r.index
                  , o = r.attributes.position
                  , l = r.attributes.uv
                  , c = r.attributes.uv1
                  , h = r.attributes.normal
                  , d = r.groups
                  , u = r.drawRange;
                if (null !== s)
                    if (Array.isArray(a))
                        for (let r = 0, o = d.length; r < o; r++) {
                            const o = d[r]
                              , p = a[o.materialIndex];
                            for (let r = Math.max(o.start, u.start), a = Math.min(s.count, Math.min(o.start + o.count, u.start + u.count)); r < a; r += 3) {
                                i = br(this, p, e, n, l, c, h, s.getX(r), s.getX(r + 1), s.getX(r + 2)),
                                i && (i.faceIndex = Math.floor(r / 3),
                                i.face.materialIndex = o.materialIndex,
                                t.push(i))
                            }
                        }
                    else {
                        for (let r = Math.max(0, u.start), o = Math.min(s.count, u.start + u.count); r < o; r += 3) {
                            i = br(this, a, e, n, l, c, h, s.getX(r), s.getX(r + 1), s.getX(r + 2)),
                            i && (i.faceIndex = Math.floor(r / 3),
                            t.push(i))
                        }
                    }
                else if (void 0 !== o)
                    if (Array.isArray(a))
                        for (let r = 0, s = d.length; r < s; r++) {
                            const s = d[r]
                              , p = a[s.materialIndex];
                            for (let r = Math.max(s.start, u.start), a = Math.min(o.count, Math.min(s.start + s.count, u.start + u.count)); r < a; r += 3) {
                                i = br(this, p, e, n, l, c, h, r, r + 1, r + 2),
                                i && (i.faceIndex = Math.floor(r / 3),
                                i.face.materialIndex = s.materialIndex,
                                t.push(i))
                            }
                        }
                    else {
                        for (let r = Math.max(0, u.start), s = Math.min(o.count, u.start + u.count); r < s; r += 3) {
                            i = br(this, a, e, n, l, c, h, r, r + 1, r + 2),
                            i && (i.faceIndex = Math.floor(r / 3),
                            t.push(i))
                        }
                    }
            }
        }
        function br(e, t, n, i, r, a, s, o, l, c) {
            e.getVertexPosition(o, ur),
            e.getVertexPosition(l, pr),
            e.getVertexPosition(c, fr);
            const h = function(e, t, n, i, r, a, s, o) {
                let l;
                if (l = 1 === t.side ? i.intersectTriangle(s, a, r, !0, o) : i.intersectTriangle(r, a, s, 0 === t.side, o),
                null === l)
                    return null;
                wr.copy(o),
                wr.applyMatrix4(e.matrixWorld);
                const c = n.ray.origin.distanceTo(wr);
                return c < n.near || c > n.far ? null : {
                    distance: c,
                    point: wr.clone(),
                    object: e
                }
            }(e, t, n, i, ur, pr, fr, vr);
            if (h) {
                const e = new bn;
                Ui.getBarycoord(vr, ur, pr, fr, e),
                r && (h.uv = Ui.getInterpolatedAttribute(r, o, l, c, e, new Qt)),
                a && (h.uv1 = Ui.getInterpolatedAttribute(a, o, l, c, e, new Qt)),
                s && (h.normal = Ui.getInterpolatedAttribute(s, o, l, c, e, new bn),
                h.normal.dot(i.direction) > 0 && h.normal.multiplyScalar(-1));
                const t = {
                    a: o,
                    b: l,
                    c,
                    normal: new bn,
                    materialIndex: 0
                };
                Ui.getNormal(ur, pr, fr, t.normal),
                h.face = t,
                h.barycoord = e
            }
            return h
        }
        class Ar extends or {
            constructor(e=1, t=1, n=1, i=1, r=1, a=1) {
                super(),
                this.type = "BoxGeometry",
                this.parameters = {
                    width: e,
                    height: t,
                    depth: n,
                    widthSegments: i,
                    heightSegments: r,
                    depthSegments: a
                };
                const s = this;
                i = Math.floor(i),
                r = Math.floor(r),
                a = Math.floor(a);
                const o = []
                  , l = []
                  , c = []
                  , h = [];
                let d = 0
                  , u = 0;
                function p(e, t, n, i, r, a, p, f, m, g, v) {
                    const w = a / m
                      , y = p / g
                      , b = a / 2
                      , A = p / 2
                      , x = f / 2
                      , k = m + 1
                      , E = g + 1;
                    let S = 0
                      , M = 0;
                    const _ = new bn;
                    for (let a = 0; a < E; a++) {
                        const s = a * y - A;
                        for (let o = 0; o < k; o++) {
                            const d = o * w - b;
                            _[e] = d * i,
                            _[t] = s * r,
                            _[n] = x,
                            l.push(_.x, _.y, _.z),
                            _[e] = 0,
                            _[t] = 0,
                            _[n] = f > 0 ? 1 : -1,
                            c.push(_.x, _.y, _.z),
                            h.push(o / m),
                            h.push(1 - a / g),
                            S += 1
                        }
                    }
                    for (let e = 0; e < g; e++)
                        for (let t = 0; t < m; t++) {
                            const n = d + t + k * e
                              , i = d + t + k * (e + 1)
                              , r = d + (t + 1) + k * (e + 1)
                              , a = d + (t + 1) + k * e;
                            o.push(n, i, a),
                            o.push(i, r, a),
                            M += 6
                        }
                    s.addGroup(u, M, v),
                    u += M,
                    d += S
                }
                p("z", "y", "x", -1, -1, n, t, e, a, r, 0),
                p("z", "y", "x", 1, -1, n, t, -e, a, r, 1),
                p("x", "z", "y", 1, 1, e, n, t, i, a, 2),
                p("x", "z", "y", 1, -1, e, n, -t, i, a, 3),
                p("x", "y", "z", 1, -1, e, t, n, i, r, 4),
                p("x", "y", "z", -1, -1, e, t, -n, i, r, 5),
                this.setIndex(o),
                this.setAttribute("position", new $i(l,3)),
                this.setAttribute("normal", new $i(c,3)),
                this.setAttribute("uv", new $i(h,2))
            }
            copy(e) {
                return super.copy(e),
                this.parameters = Object.assign({}, e.parameters),
                this
            }
            static fromJSON(e) {
                return new Ar(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)
            }
        }
        function xr(e) {
            const t = {};
            for (const n in e) {
                t[n] = {};
                for (const i in e[n]) {
                    const r = e[n][i];
                    r && (r.isColor || r.isMatrix3 || r.isMatrix4 || r.isVector2 || r.isVector3 || r.isVector4 || r.isTexture || r.isQuaternion) ? r.isRenderTargetTexture ? (console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),
                    t[n][i] = null) : t[n][i] = r.clone() : Array.isArray(r) ? t[n][i] = r.slice() : t[n][i] = r
                }
            }
            return t
        }
        function kr(e) {
            const t = {};
            for (let n = 0; n < e.length; n++) {
                const i = xr(e[n]);
                for (const e in i)
                    t[e] = i[e]
            }
            return t
        }
        function Er(e) {
            const t = e.getRenderTarget();
            return null === t ? e.outputColorSpace : !0 === t.isXRRenderTarget ? t.texture.colorSpace : rn.workingColorSpace
        }
        const Sr = {
            clone: xr,
            merge: kr
        };
        class Mr extends ji {
            constructor(e) {
                super(),
                this.isShaderMaterial = !0,
                this.type = "ShaderMaterial",
                this.defines = {},
                this.uniforms = {},
                this.uniformsGroups = [],
                this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
                this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
                this.linewidth = 1,
                this.wireframe = !1,
                this.wireframeLinewidth = 1,
                this.fog = !1,
                this.lights = !1,
                this.clipping = !1,
                this.forceSinglePass = !0,
                this.extensions = {
                    clipCullDistance: !1,
                    multiDraw: !1
                },
                this.defaultAttributeValues = {
                    color: [1, 1, 1],
                    uv: [0, 0],
                    uv1: [0, 0]
                },
                this.index0AttributeName = void 0,
                this.uniformsNeedUpdate = !1,
                this.glslVersion = null,
                void 0 !== e && this.setValues(e)
            }
            copy(e) {
                return super.copy(e),
                this.fragmentShader = e.fragmentShader,
                this.vertexShader = e.vertexShader,
                this.uniforms = xr(e.uniforms),
                this.uniformsGroups = function(e) {
                    const t = [];
                    for (let n = 0; n < e.length; n++)
                        t.push(e[n].clone());
                    return t
                }(e.uniformsGroups),
                this.defines = Object.assign({}, e.defines),
                this.wireframe = e.wireframe,
                this.wireframeLinewidth = e.wireframeLinewidth,
                this.fog = e.fog,
                this.lights = e.lights,
                this.clipping = e.clipping,
                this.extensions = Object.assign({}, e.extensions),
                this.glslVersion = e.glslVersion,
                this
            }
            toJSON(e) {
                const t = super.toJSON(e);
                t.glslVersion = this.glslVersion,
                t.uniforms = {};
                for (const n in this.uniforms) {
                    const i = this.uniforms[n].value;
                    i && i.isTexture ? t.uniforms[n] = {
                        type: "t",
                        value: i.toJSON(e).uuid
                    } : i && i.isColor ? t.uniforms[n] = {
                        type: "c",
                        value: i.getHex()
                    } : i && i.isVector2 ? t.uniforms[n] = {
                        type: "v2",
                        value: i.toArray()
                    } : i && i.isVector3 ? t.uniforms[n] = {
                        type: "v3",
                        value: i.toArray()
                    } : i && i.isVector4 ? t.uniforms[n] = {
                        type: "v4",
                        value: i.toArray()
                    } : i && i.isMatrix3 ? t.uniforms[n] = {
                        type: "m3",
                        value: i.toArray()
                    } : i && i.isMatrix4 ? t.uniforms[n] = {
                        type: "m4",
                        value: i.toArray()
                    } : t.uniforms[n] = {
                        value: i
                    }
                }
                Object.keys(this.defines).length > 0 && (t.defines = this.defines),
                t.vertexShader = this.vertexShader,
                t.fragmentShader = this.fragmentShader,
                t.lights = this.lights,
                t.clipping = this.clipping;
                const n = {};
                for (const e in this.extensions)
                    !0 === this.extensions[e] && (n[e] = !0);
                return Object.keys(n).length > 0 && (t.extensions = n),
                t
            }
        }
        class _r extends ki {
            constructor() {
                super(),
                this.isCamera = !0,
                this.type = "Camera",
                this.matrixWorldInverse = new Xn,
                this.projectionMatrix = new Xn,
                this.projectionMatrixInverse = new Xn,
                this.coordinateSystem = Rt
            }
            copy(e, t) {
                return super.copy(e, t),
                this.matrixWorldInverse.copy(e.matrixWorldInverse),
                this.projectionMatrix.copy(e.projectionMatrix),
                this.projectionMatrixInverse.copy(e.projectionMatrixInverse),
                this.coordinateSystem = e.coordinateSystem,
                this
            }
            getWorldDirection(e) {
                return super.getWorldDirection(e).negate()
            }
            updateMatrixWorld(e) {
                super.updateMatrixWorld(e),
                this.matrixWorldInverse.copy(this.matrixWorld).invert()
            }
            updateWorldMatrix(e, t) {
                super.updateWorldMatrix(e, t),
                this.matrixWorldInverse.copy(this.matrixWorld).invert()
            }
            clone() {
                return (new this.constructor).copy(this)
            }
        }
        const Tr = new bn
          , Cr = new Qt
          , Pr = new Qt;
        class Ir extends _r {
            constructor(e=50, t=1, n=.1, i=2e3) {
                super(),
                this.isPerspectiveCamera = !0,
                this.type = "PerspectiveCamera",
                this.fov = e,
                this.zoom = 1,
                this.near = n,
                this.far = i,
                this.focus = 10,
                this.aspect = t,
                this.view = null,
                this.filmGauge = 35,
                this.filmOffset = 0,
                this.updateProjectionMatrix()
            }
            copy(e, t) {
                return super.copy(e, t),
                this.fov = e.fov,
                this.zoom = e.zoom,
                this.near = e.near,
                this.far = e.far,
                this.focus = e.focus,
                this.aspect = e.aspect,
                this.view = null === e.view ? null : Object.assign({}, e.view),
                this.filmGauge = e.filmGauge,
                this.filmOffset = e.filmOffset,
                this
            }
            setFocalLength(e) {
                const t = .5 * this.getFilmHeight() / e;
                this.fov = 2 * zt * Math.atan(t),
                this.updateProjectionMatrix()
            }
            getFocalLength() {
                const e = Math.tan(.5 * Ut * this.fov);
                return .5 * this.getFilmHeight() / e
            }
            getEffectiveFOV() {
                return 2 * zt * Math.atan(Math.tan(.5 * Ut * this.fov) / this.zoom)
            }
            getFilmWidth() {
                return this.filmGauge * Math.min(this.aspect, 1)
            }
            getFilmHeight() {
                return this.filmGauge / Math.max(this.aspect, 1)
            }
            getViewBounds(e, t, n) {
                Tr.set(-1, -1, .5).applyMatrix4(this.projectionMatrixInverse),
                t.set(Tr.x, Tr.y).multiplyScalar(-e / Tr.z),
                Tr.set(1, 1, .5).applyMatrix4(this.projectionMatrixInverse),
                n.set(Tr.x, Tr.y).multiplyScalar(-e / Tr.z)
            }
            getViewSize(e, t) {
                return this.getViewBounds(e, Cr, Pr),
                t.subVectors(Pr, Cr)
            }
            setViewOffset(e, t, n, i, r, a) {
                this.aspect = e / t,
                null === this.view && (this.view = {
                    enabled: !0,
                    fullWidth: 1,
                    fullHeight: 1,
                    offsetX: 0,
                    offsetY: 0,
                    width: 1,
                    height: 1
                }),
                this.view.enabled = !0,
                this.view.fullWidth = e,
                this.view.fullHeight = t,
                this.view.offsetX = n,
                this.view.offsetY = i,
                this.view.width = r,
                this.view.height = a,
                this.updateProjectionMatrix()
            }
            clearViewOffset() {
                null !== this.view && (this.view.enabled = !1),
                this.updateProjectionMatrix()
            }
            updateProjectionMatrix() {
                const e = this.near;
                let t = e * Math.tan(.5 * Ut * this.fov) / this.zoom
                  , n = 2 * t
                  , i = this.aspect * n
                  , r = -.5 * i;
                const a = this.view;
                if (null !== this.view && this.view.enabled) {
                    const e = a.fullWidth
                      , s = a.fullHeight;
                    r += a.offsetX * i / e,
                    t -= a.offsetY * n / s,
                    i *= a.width / e,
                    n *= a.height / s
                }
                const s = this.filmOffset;
                0 !== s && (r += e * s / this.getFilmWidth()),
                this.projectionMatrix.makePerspective(r, r + i, t, t - n, e, this.far, this.coordinateSystem),
                this.projectionMatrixInverse.copy(this.projectionMatrix).invert()
            }
            toJSON(e) {
                const t = super.toJSON(e);
                return t.object.fov = this.fov,
                t.object.zoom = this.zoom,
                t.object.near = this.near,
                t.object.far = this.far,
                t.object.focus = this.focus,
                t.object.aspect = this.aspect,
                null !== this.view && (t.object.view = Object.assign({}, this.view)),
                t.object.filmGauge = this.filmGauge,
                t.object.filmOffset = this.filmOffset,
                t
            }
        }
        const Rr = -90;
        class Lr extends ki {
            constructor(e, t, n) {
                super(),
                this.type = "CubeCamera",
                this.renderTarget = n,
                this.coordinateSystem = null,
                this.activeMipmapLevel = 0;
                const i = new Ir(Rr,1,e,t);
                i.layers = this.layers,
                this.add(i);
                const r = new Ir(Rr,1,e,t);
                r.layers = this.layers,
                this.add(r);
                const a = new Ir(Rr,1,e,t);
                a.layers = this.layers,
                this.add(a);
                const s = new Ir(Rr,1,e,t);
                s.layers = this.layers,
                this.add(s);
                const o = new Ir(Rr,1,e,t);
                o.layers = this.layers,
                this.add(o);
                const l = new Ir(Rr,1,e,t);
                l.layers = this.layers,
                this.add(l)
            }
            updateCoordinateSystem() {
                const e = this.coordinateSystem
                  , t = this.children.concat()
                  , [n,i,r,a,s,o] = t;
                for (const e of t)
                    this.remove(e);
                if (e === Rt)
                    n.up.set(0, 1, 0),
                    n.lookAt(1, 0, 0),
                    i.up.set(0, 1, 0),
                    i.lookAt(-1, 0, 0),
                    r.up.set(0, 0, -1),
                    r.lookAt(0, 1, 0),
                    a.up.set(0, 0, 1),
                    a.lookAt(0, -1, 0),
                    s.up.set(0, 1, 0),
                    s.lookAt(0, 0, 1),
                    o.up.set(0, 1, 0),
                    o.lookAt(0, 0, -1);
                else {
                    if (e !== Lt)
                        throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: " + e);
                    n.up.set(0, -1, 0),
                    n.lookAt(-1, 0, 0),
                    i.up.set(0, -1, 0),
                    i.lookAt(1, 0, 0),
                    r.up.set(0, 0, 1),
                    r.lookAt(0, 1, 0),
                    a.up.set(0, 0, -1),
                    a.lookAt(0, -1, 0),
                    s.up.set(0, -1, 0),
                    s.lookAt(0, 0, 1),
                    o.up.set(0, -1, 0),
                    o.lookAt(0, 0, -1)
                }
                for (const e of t)
                    this.add(e),
                    e.updateMatrixWorld()
            }
            update(e, t) {
                null === this.parent && this.updateMatrixWorld();
                const {renderTarget: n, activeMipmapLevel: i} = this;
                this.coordinateSystem !== e.coordinateSystem && (this.coordinateSystem = e.coordinateSystem,
                this.updateCoordinateSystem());
                const [r,a,s,o,l,c] = this.children
                  , h = e.getRenderTarget()
                  , d = e.getActiveCubeFace()
                  , u = e.getActiveMipmapLevel()
                  , p = e.xr.enabled;
                e.xr.enabled = !1;
                const f = n.texture.generateMipmaps;
                n.texture.generateMipmaps = !1,
                e.setRenderTarget(n, 0, i),
                e.render(t, r),
                e.setRenderTarget(n, 1, i),
                e.render(t, a),
                e.setRenderTarget(n, 2, i),
                e.render(t, s),
                e.setRenderTarget(n, 3, i),
                e.render(t, o),
                e.setRenderTarget(n, 4, i),
                e.render(t, l),
                n.texture.generateMipmaps = f,
                e.setRenderTarget(n, 5, i),
                e.render(t, c),
                e.setRenderTarget(h, d, u),
                e.xr.enabled = p,
                n.texture.needsPMREMUpdate = !0
            }
        }
        class Dr extends pn {
            constructor(e, t, n, i, r, a, s, o, l, c) {
                super(e = void 0 !== e ? e : [], t = void 0 !== t ? t : ee, n, i, r, a, s, o, l, c),
                this.isCubeTexture = !0,
                this.flipY = !1
            }
            get images() {
                return this.image
            }
            set images(e) {
                this.image = e
            }
        }
        class Nr extends gn {
            constructor(e=1, t={}) {
                super(e, e, t),
                this.isWebGLCubeRenderTarget = !0;
                const n = {
                    width: e,
                    height: e,
                    depth: 1
                }
                  , i = [n, n, n, n, n, n];
                this.texture = new Dr(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),
                this.texture.isRenderTargetTexture = !0,
                this.texture.generateMipmaps = void 0 !== t.generateMipmaps && t.generateMipmaps,
                this.texture.minFilter = void 0 !== t.minFilter ? t.minFilter : de
            }
            fromEquirectangularTexture(e, t) {
                this.texture.type = t.type,
                this.texture.colorSpace = t.colorSpace,
                this.texture.generateMipmaps = t.generateMipmaps,
                this.texture.minFilter = t.minFilter,
                this.texture.magFilter = t.magFilter;
                const n = {
                    uniforms: {
                        tEquirect: {
                            value: null
                        }
                    },
                    vertexShader: "\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",
                    fragmentShader: "\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"
                }
                  , i = new Ar(5,5,5)
                  , r = new Mr({
                    name: "CubemapFromEquirect",
                    uniforms: xr(n.uniforms),
                    vertexShader: n.vertexShader,
                    fragmentShader: n.fragmentShader,
                    side: 1,
                    blending: 0
                });
                r.uniforms.tEquirect.value = t;
                const a = new yr(i,r)
                  , s = t.minFilter;
                t.minFilter === pe && (t.minFilter = de);
                return new Lr(1,10,this).update(e, a),
                t.minFilter = s,
                a.geometry.dispose(),
                a.material.dispose(),
                this
            }
            clear(e, t, n, i) {
                const r = e.getRenderTarget();
                for (let r = 0; r < 6; r++)
                    e.setRenderTarget(this, r),
                    e.clear(t, n, i);
                e.setRenderTarget(r)
            }
        }
        class Br extends ki {
            constructor() {
                super(),
                this.isGroup = !0,
                this.type = "Group"
            }
        }
        const Ur = {
            type: "move"
        };
        class zr {
            constructor() {
                this._targetRay = null,
                this._grip = null,
                this._hand = null
            }
            getHandSpace() {
                return null === this._hand && (this._hand = new Br,
                this._hand.matrixAutoUpdate = !1,
                this._hand.visible = !1,
                this._hand.joints = {},
                this._hand.inputState = {
                    pinching: !1
                }),
                this._hand
            }
            getTargetRaySpace() {
                return null === this._targetRay && (this._targetRay = new Br,
                this._targetRay.matrixAutoUpdate = !1,
                this._targetRay.visible = !1,
                this._targetRay.hasLinearVelocity = !1,
                this._targetRay.linearVelocity = new bn,
                this._targetRay.hasAngularVelocity = !1,
                this._targetRay.angularVelocity = new bn),
                this._targetRay
            }
            getGripSpace() {
                return null === this._grip && (this._grip = new Br,
                this._grip.matrixAutoUpdate = !1,
                this._grip.visible = !1,
                this._grip.hasLinearVelocity = !1,
                this._grip.linearVelocity = new bn,
                this._grip.hasAngularVelocity = !1,
                this._grip.angularVelocity = new bn),
                this._grip
            }
            dispatchEvent(e) {
                return null !== this._targetRay && this._targetRay.dispatchEvent(e),
                null !== this._grip && this._grip.dispatchEvent(e),
                null !== this._hand && this._hand.dispatchEvent(e),
                this
            }
            connect(e) {
                if (e && e.hand) {
                    const t = this._hand;
                    if (t)
                        for (const n of e.hand.values())
                            this._getHandJoint(t, n)
                }
                return this.dispatchEvent({
                    type: "connected",
                    data: e
                }),
                this
            }
            disconnect(e) {
                return this.dispatchEvent({
                    type: "disconnected",
                    data: e
                }),
                null !== this._targetRay && (this._targetRay.visible = !1),
                null !== this._grip && (this._grip.visible = !1),
                null !== this._hand && (this._hand.visible = !1),
                this
            }
            update(e, t, n) {
                let i = null
                  , r = null
                  , a = null;
                const s = this._targetRay
                  , o = this._grip
                  , l = this._hand;
                if (e && "visible-blurred" !== t.session.visibilityState) {
                    if (l && e.hand) {
                        a = !0;
                        for (const i of e.hand.values()) {
                            const e = t.getJointPose(i, n)
                              , r = this._getHandJoint(l, i);
                            null !== e && (r.matrix.fromArray(e.transform.matrix),
                            r.matrix.decompose(r.position, r.rotation, r.scale),
                            r.matrixWorldNeedsUpdate = !0,
                            r.jointRadius = e.radius),
                            r.visible = null !== e
                        }
                        const i = l.joints["index-finger-tip"]
                          , r = l.joints["thumb-tip"]
                          , s = i.position.distanceTo(r.position)
                          , o = .02
                          , c = .005;
                        l.inputState.pinching && s > o + c ? (l.inputState.pinching = !1,
                        this.dispatchEvent({
                            type: "pinchend",
                            handedness: e.handedness,
                            target: this
                        })) : !l.inputState.pinching && s <= o - c && (l.inputState.pinching = !0,
                        this.dispatchEvent({
                            type: "pinchstart",
                            handedness: e.handedness,
                            target: this
                        }))
                    } else
                        null !== o && e.gripSpace && (r = t.getPose(e.gripSpace, n),
                        null !== r && (o.matrix.fromArray(r.transform.matrix),
                        o.matrix.decompose(o.position, o.rotation, o.scale),
                        o.matrixWorldNeedsUpdate = !0,
                        r.linearVelocity ? (o.hasLinearVelocity = !0,
                        o.linearVelocity.copy(r.linearVelocity)) : o.hasLinearVelocity = !1,
                        r.angularVelocity ? (o.hasAngularVelocity = !0,
                        o.angularVelocity.copy(r.angularVelocity)) : o.hasAngularVelocity = !1));
                    null !== s && (i = t.getPose(e.targetRaySpace, n),
                    null === i && null !== r && (i = r),
                    null !== i && (s.matrix.fromArray(i.transform.matrix),
                    s.matrix.decompose(s.position, s.rotation, s.scale),
                    s.matrixWorldNeedsUpdate = !0,
                    i.linearVelocity ? (s.hasLinearVelocity = !0,
                    s.linearVelocity.copy(i.linearVelocity)) : s.hasLinearVelocity = !1,
                    i.angularVelocity ? (s.hasAngularVelocity = !0,
                    s.angularVelocity.copy(i.angularVelocity)) : s.hasAngularVelocity = !1,
                    this.dispatchEvent(Ur)))
                }
                return null !== s && (s.visible = null !== i),
                null !== o && (o.visible = null !== r),
                null !== l && (l.visible = null !== a),
                this
            }
            _getHandJoint(e, t) {
                if (void 0 === e.joints[t.jointName]) {
                    const n = new Br;
                    n.matrixAutoUpdate = !1,
                    n.visible = !1,
                    e.joints[t.jointName] = n,
                    e.add(n)
                }
                return e.joints[t.jointName]
            }
        }
        class Or {
            constructor(e, t=1, n=1e3) {
                this.isFog = !0,
                this.name = "",
                this.color = new Hi(e),
                this.near = t,
                this.far = n
            }
            clone() {
                return new Or(this.color,this.near,this.far)
            }
            toJSON() {
                return {
                    type: "Fog",
                    name: this.name,
                    color: this.color.getHex(),
                    near: this.near,
                    far: this.far
                }
            }
        }
        class Fr extends ki {
            constructor() {
                super(),
                this.isScene = !0,
                this.type = "Scene",
                this.background = null,
                this.environment = null,
                this.fog = null,
                this.backgroundBlurriness = 0,
                this.backgroundIntensity = 1,
                this.backgroundRotation = new si,
                this.environmentIntensity = 1,
                this.environmentRotation = new si,
                this.overrideMaterial = null,
                "undefined" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{
                    detail: this
                }))
            }
            copy(e, t) {
                return super.copy(e, t),
                null !== e.background && (this.background = e.background.clone()),
                null !== e.environment && (this.environment = e.environment.clone()),
                null !== e.fog && (this.fog = e.fog.clone()),
                this.backgroundBlurriness = e.backgroundBlurriness,
                this.backgroundIntensity = e.backgroundIntensity,
                this.backgroundRotation.copy(e.backgroundRotation),
                this.environmentIntensity = e.environmentIntensity,
                this.environmentRotation.copy(e.environmentRotation),
                null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
                this.matrixAutoUpdate = e.matrixAutoUpdate,
                this
            }
            toJSON(e) {
                const t = super.toJSON(e);
                return null !== this.fog && (t.object.fog = this.fog.toJSON()),
                this.backgroundBlurriness > 0 && (t.object.backgroundBlurriness = this.backgroundBlurriness),
                1 !== this.backgroundIntensity && (t.object.backgroundIntensity = this.backgroundIntensity),
                t.object.backgroundRotation = this.backgroundRotation.toArray(),
                1 !== this.environmentIntensity && (t.object.environmentIntensity = this.environmentIntensity),
                t.object.environmentRotation = this.environmentRotation.toArray(),
                t
            }
        }
        class Wr {
            constructor(e, t) {
                this.isInterleavedBuffer = !0,
                this.array = e,
                this.stride = t,
                this.count = void 0 !== e ? e.length / t : 0,
                this.usage = Pt,
                this.updateRanges = [],
                this.version = 0,
                this.uuid = Ot()
            }
            onUploadCallback() {}
            set needsUpdate(e) {
                !0 === e && this.version++
            }
            setUsage(e) {
                return this.usage = e,
                this
            }
            addUpdateRange(e, t) {
                this.updateRanges.push({
                    start: e,
                    count: t
                })
            }
            clearUpdateRanges() {
                this.updateRanges.length = 0
            }
            copy(e) {
                return this.array = new e.array.constructor(e.array),
                this.count = e.count,
                this.stride = e.stride,
                this.usage = e.usage,
                this
            }
            copyAt(e, t, n) {
                e *= this.stride,
                n *= t.stride;
                for (let i = 0, r = this.stride; i < r; i++)
                    this.array[e + i] = t.array[n + i];
                return this
            }
            set(e, t=0) {
                return this.array.set(e, t),
                this
            }
            clone(e) {
                void 0 === e.arrayBuffers && (e.arrayBuffers = {}),
                void 0 === this.array.buffer._uuid && (this.array.buffer._uuid = Ot()),
                void 0 === e.arrayBuffers[this.array.buffer._uuid] && (e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer);
                const t = new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid])
                  , n = new this.constructor(t,this.stride);
                return n.setUsage(this.usage),
                n
            }
            onUpload(e) {
                return this.onUploadCallback = e,
                this
            }
            toJSON(e) {
                return void 0 === e.arrayBuffers && (e.arrayBuffers = {}),
                void 0 === this.array.buffer._uuid && (this.array.buffer._uuid = Ot()),
                void 0 === e.arrayBuffers[this.array.buffer._uuid] && (e.arrayBuffers[this.array.buffer._uuid] = Array.from(new Uint32Array(this.array.buffer))),
                {
                    uuid: this.uuid,
                    buffer: this.array.buffer._uuid,
                    type: this.array.constructor.name,
                    stride: this.stride
                }
            }
        }
        const Hr = new bn;
        class Vr {
            constructor(e, t, n, i=!1) {
                this.isInterleavedBufferAttribute = !0,
                this.name = "",
                this.data = e,
                this.itemSize = t,
                this.offset = n,
                this.normalized = i
            }
            get count() {
                return this.data.count
            }
            get array() {
                return this.data.array
            }
            set needsUpdate(e) {
                this.data.needsUpdate = e
            }
            applyMatrix4(e) {
                for (let t = 0, n = this.data.count; t < n; t++)
                    Hr.fromBufferAttribute(this, t),
                    Hr.applyMatrix4(e),
                    this.setXYZ(t, Hr.x, Hr.y, Hr.z);
                return this
            }
            applyNormalMatrix(e) {
                for (let t = 0, n = this.count; t < n; t++)
                    Hr.fromBufferAttribute(this, t),
                    Hr.applyNormalMatrix(e),
                    this.setXYZ(t, Hr.x, Hr.y, Hr.z);
                return this
            }
            transformDirection(e) {
                for (let t = 0, n = this.count; t < n; t++)
                    Hr.fromBufferAttribute(this, t),
                    Hr.transformDirection(e),
                    this.setXYZ(t, Hr.x, Hr.y, Hr.z);
                return this
            }
            getComponent(e, t) {
                let n = this.array[e * this.data.stride + this.offset + t];
                return this.normalized && (n = Vt(n, this.array)),
                n
            }
            setComponent(e, t, n) {
                return this.normalized && (n = Gt(n, this.array)),
                this.data.array[e * this.data.stride + this.offset + t] = n,
                this
            }
            setX(e, t) {
                return this.normalized && (t = Gt(t, this.array)),
                this.data.array[e * this.data.stride + this.offset] = t,
                this
            }
            setY(e, t) {
                return this.normalized && (t = Gt(t, this.array)),
                this.data.array[e * this.data.stride + this.offset + 1] = t,
                this
            }
            setZ(e, t) {
                return this.normalized && (t = Gt(t, this.array)),
                this.data.array[e * this.data.stride + this.offset + 2] = t,
                this
            }
            setW(e, t) {
                return this.normalized && (t = Gt(t, this.array)),
                this.data.array[e * this.data.stride + this.offset + 3] = t,
                this
            }
            getX(e) {
                let t = this.data.array[e * this.data.stride + this.offset];
                return this.normalized && (t = Vt(t, this.array)),
                t
            }
            getY(e) {
                let t = this.data.array[e * this.data.stride + this.offset + 1];
                return this.normalized && (t = Vt(t, this.array)),
                t
            }
            getZ(e) {
                let t = this.data.array[e * this.data.stride + this.offset + 2];
                return this.normalized && (t = Vt(t, this.array)),
                t
            }
            getW(e) {
                let t = this.data.array[e * this.data.stride + this.offset + 3];
                return this.normalized && (t = Vt(t, this.array)),
                t
            }
            setXY(e, t, n) {
                return e = e * this.data.stride + this.offset,
                this.normalized && (t = Gt(t, this.array),
                n = Gt(n, this.array)),
                this.data.array[e + 0] = t,
                this.data.array[e + 1] = n,
                this
            }
            setXYZ(e, t, n, i) {
                return e = e * this.data.stride + this.offset,
                this.normalized && (t = Gt(t, this.array),
                n = Gt(n, this.array),
                i = Gt(i, this.array)),
                this.data.array[e + 0] = t,
                this.data.array[e + 1] = n,
                this.data.array[e + 2] = i,
                this
            }
            setXYZW(e, t, n, i, r) {
                return e = e * this.data.stride + this.offset,
                this.normalized && (t = Gt(t, this.array),
                n = Gt(n, this.array),
                i = Gt(i, this.array),
                r = Gt(r, this.array)),
                this.data.array[e + 0] = t,
                this.data.array[e + 1] = n,
                this.data.array[e + 2] = i,
                this.data.array[e + 3] = r,
                this
            }
            clone(e) {
                if (void 0 === e) {
                    console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");
                    const e = [];
                    for (let t = 0; t < this.count; t++) {
                        const n = t * this.data.stride + this.offset;
                        for (let t = 0; t < this.itemSize; t++)
                            e.push(this.data.array[n + t])
                    }
                    return new Xi(new this.array.constructor(e),this.itemSize,this.normalized)
                }
                return void 0 === e.interleavedBuffers && (e.interleavedBuffers = {}),
                void 0 === e.interleavedBuffers[this.data.uuid] && (e.interleavedBuffers[this.data.uuid] = this.data.clone(e)),
                new Vr(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)
            }
            toJSON(e) {
                if (void 0 === e) {
                    console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");
                    const e = [];
                    for (let t = 0; t < this.count; t++) {
                        const n = t * this.data.stride + this.offset;
                        for (let t = 0; t < this.itemSize; t++)
                            e.push(this.data.array[n + t])
                    }
                    return {
                        itemSize: this.itemSize,
                        type: this.array.constructor.name,
                        array: e,
                        normalized: this.normalized
                    }
                }
                return void 0 === e.interleavedBuffers && (e.interleavedBuffers = {}),
                void 0 === e.interleavedBuffers[this.data.uuid] && (e.interleavedBuffers[this.data.uuid] = this.data.toJSON(e)),
                {
                    isInterleavedBufferAttribute: !0,
                    itemSize: this.itemSize,
                    data: this.data.uuid,
                    offset: this.offset,
                    normalized: this.normalized
                }
            }
        }
        const Gr = new bn
          , jr = new fn
          , Qr = new fn
          , Kr = new bn
          , qr = new Xn
          , Yr = new bn
          , Xr = new Wn
          , Zr = new Xn
          , Jr = new Yn;
        class $r extends yr {
            constructor(e, t) {
                super(e, t),
                this.isSkinnedMesh = !0,
                this.type = "SkinnedMesh",
                this.bindMode = $,
                this.bindMatrix = new Xn,
                this.bindMatrixInverse = new Xn,
                this.boundingBox = null,
                this.boundingSphere = null
            }
            computeBoundingBox() {
                const e = this.geometry;
                null === this.boundingBox && (this.boundingBox = new kn),
                this.boundingBox.makeEmpty();
                const t = e.getAttribute("position");
                for (let e = 0; e < t.count; e++)
                    this.getVertexPosition(e, Yr),
                    this.boundingBox.expandByPoint(Yr)
            }
            computeBoundingSphere() {
                const e = this.geometry;
                null === this.boundingSphere && (this.boundingSphere = new Wn),
                this.boundingSphere.makeEmpty();
                const t = e.getAttribute("position");
                for (let e = 0; e < t.count; e++)
                    this.getVertexPosition(e, Yr),
                    this.boundingSphere.expandByPoint(Yr)
            }
            copy(e, t) {
                return super.copy(e, t),
                this.bindMode = e.bindMode,
                this.bindMatrix.copy(e.bindMatrix),
                this.bindMatrixInverse.copy(e.bindMatrixInverse),
                this.skeleton = e.skeleton,
                null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
                null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
                this
            }
            raycast(e, t) {
                const n = this.material
                  , i = this.matrixWorld;
                void 0 !== n && (null === this.boundingSphere && this.computeBoundingSphere(),
                Xr.copy(this.boundingSphere),
                Xr.applyMatrix4(i),
                !1 !== e.ray.intersectsSphere(Xr) && (Zr.copy(i).invert(),
                Jr.copy(e.ray).applyMatrix4(Zr),
                null !== this.boundingBox && !1 === Jr.intersectsBox(this.boundingBox) || this._computeIntersections(e, t, Jr)))
            }
            getVertexPosition(e, t) {
                return super.getVertexPosition(e, t),
                this.applyBoneTransform(e, t),
                t
            }
            bind(e, t) {
                this.skeleton = e,
                void 0 === t && (this.updateMatrixWorld(!0),
                this.skeleton.calculateInverses(),
                t = this.matrixWorld),
                this.bindMatrix.copy(t),
                this.bindMatrixInverse.copy(t).invert()
            }
            pose() {
                this.skeleton.pose()
            }
            normalizeSkinWeights() {
                const e = new fn
                  , t = this.geometry.attributes.skinWeight;
                for (let n = 0, i = t.count; n < i; n++) {
                    e.fromBufferAttribute(t, n);
                    const i = 1 / e.manhattanLength();
                    i !== 1 / 0 ? e.multiplyScalar(i) : e.set(1, 0, 0, 0),
                    t.setXYZW(n, e.x, e.y, e.z, e.w)
                }
            }
            updateMatrixWorld(e) {
                super.updateMatrixWorld(e),
                this.bindMode === $ ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : "detached" === this.bindMode ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : console.warn("THREE.SkinnedMesh: Unrecognized bindMode: " + this.bindMode)
            }
            applyBoneTransform(e, t) {
                const n = this.skeleton
                  , i = this.geometry;
                jr.fromBufferAttribute(i.attributes.skinIndex, e),
                Qr.fromBufferAttribute(i.attributes.skinWeight, e),
                Gr.copy(t).applyMatrix4(this.bindMatrix),
                t.set(0, 0, 0);
                for (let e = 0; e < 4; e++) {
                    const i = Qr.getComponent(e);
                    if (0 !== i) {
                        const r = jr.getComponent(e);
                        qr.multiplyMatrices(n.bones[r].matrixWorld, n.boneInverses[r]),
                        t.addScaledVector(Kr.copy(Gr).applyMatrix4(qr), i)
                    }
                }
                return t.applyMatrix4(this.bindMatrixInverse)
            }
        }
        class ea extends ki {
            constructor() {
                super(),
                this.isBone = !0,
                this.type = "Bone"
            }
        }
        class ta extends pn {
            constructor(e=null, t=1, n=1, i, r, a, s, o, l=1003, c=1003, h, d) {
                super(null, a, s, o, l, c, i, r, h, d),
                this.isDataTexture = !0,
                this.image = {
                    data: e,
                    width: t,
                    height: n
                },
                this.generateMipmaps = !1,
                this.flipY = !1,
                this.unpackAlignment = 1
            }
        }
        const na = new Xn
          , ia = new Xn;
        class ra {
            constructor(e=[], t=[]) {
                this.uuid = Ot(),
                this.bones = e.slice(0),
                this.boneInverses = t,
                this.boneMatrices = null,
                this.boneTexture = null,
                this.init()
            }
            init() {
                const e = this.bones
                  , t = this.boneInverses;
                if (this.boneMatrices = new Float32Array(16 * e.length),
                0 === t.length)
                    this.calculateInverses();
                else if (e.length !== t.length) {
                    console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),
                    this.boneInverses = [];
                    for (let e = 0, t = this.bones.length; e < t; e++)
                        this.boneInverses.push(new Xn)
                }
            }
            calculateInverses() {
                this.boneInverses.length = 0;
                for (let e = 0, t = this.bones.length; e < t; e++) {
                    const t = new Xn;
                    this.bones[e] && t.copy(this.bones[e].matrixWorld).invert(),
                    this.boneInverses.push(t)
                }
            }
            pose() {
                for (let e = 0, t = this.bones.length; e < t; e++) {
                    const t = this.bones[e];
                    t && t.matrixWorld.copy(this.boneInverses[e]).invert()
                }
                for (let e = 0, t = this.bones.length; e < t; e++) {
                    const t = this.bones[e];
                    t && (t.parent && t.parent.isBone ? (t.matrix.copy(t.parent.matrixWorld).invert(),
                    t.matrix.multiply(t.matrixWorld)) : t.matrix.copy(t.matrixWorld),
                    t.matrix.decompose(t.position, t.quaternion, t.scale))
                }
            }
            update() {
                const e = this.bones
                  , t = this.boneInverses
                  , n = this.boneMatrices
                  , i = this.boneTexture;
                for (let i = 0, r = e.length; i < r; i++) {
                    const r = e[i] ? e[i].matrixWorld : ia;
                    na.multiplyMatrices(r, t[i]),
                    na.toArray(n, 16 * i)
                }
                null !== i && (i.needsUpdate = !0)
            }
            clone() {
                return new ra(this.bones,this.boneInverses)
            }
            computeBoneTexture() {
                let e = Math.sqrt(4 * this.bones.length);
                e = 4 * Math.ceil(e / 4),
                e = Math.max(e, 4);
                const t = new Float32Array(e * e * 4);
                t.set(this.boneMatrices);
                const n = new ta(t,e,e,Me,be);
                return n.needsUpdate = !0,
                this.boneMatrices = t,
                this.boneTexture = n,
                this
            }
            getBoneByName(e) {
                for (let t = 0, n = this.bones.length; t < n; t++) {
                    const n = this.bones[t];
                    if (n.name === e)
                        return n
                }
            }
            dispose() {
                null !== this.boneTexture && (this.boneTexture.dispose(),
                this.boneTexture = null)
            }
            fromJSON(e, t) {
                this.uuid = e.uuid;
                for (let n = 0, i = e.bones.length; n < i; n++) {
                    const i = e.bones[n];
                    let r = t[i];
                    void 0 === r && (console.warn("THREE.Skeleton: No bone found with UUID:", i),
                    r = new ea),
                    this.bones.push(r),
                    this.boneInverses.push((new Xn).fromArray(e.boneInverses[n]))
                }
                return this.init(),
                this
            }
            toJSON() {
                const e = {
                    metadata: {
                        version: 4.6,
                        type: "Skeleton",
                        generator: "Skeleton.toJSON"
                    },
                    bones: [],
                    boneInverses: []
                };
                e.uuid = this.uuid;
                const t = this.bones
                  , n = this.boneInverses;
                for (let i = 0, r = t.length; i < r; i++) {
                    const r = t[i];
                    e.bones.push(r.uuid);
                    const a = n[i];
                    e.boneInverses.push(a.toArray())
                }
                return e
            }
        }
        class aa extends Xi {
            constructor(e, t, n, i=1) {
                super(e, t, n),
                this.isInstancedBufferAttribute = !0,
                this.meshPerAttribute = i
            }
            copy(e) {
                return super.copy(e),
                this.meshPerAttribute = e.meshPerAttribute,
                this
            }
            toJSON() {
                const e = super.toJSON();
                return e.meshPerAttribute = this.meshPerAttribute,
                e.isInstancedBufferAttribute = !0,
                e
            }
        }
        const sa = new Xn
          , oa = new Xn
          , la = []
          , ca = new kn
          , ha = new Xn
          , da = new yr
          , ua = new Wn;
        class pa extends yr {
            constructor(e, t, n) {
                super(e, t),
                this.isInstancedMesh = !0,
                this.instanceMatrix = new aa(new Float32Array(16 * n),16),
                this.instanceColor = null,
                this.morphTexture = null,
                this.count = n,
                this.boundingBox = null,
                this.boundingSphere = null;
                for (let e = 0; e < n; e++)
                    this.setMatrixAt(e, ha)
            }
            computeBoundingBox() {
                const e = this.geometry
                  , t = this.count;
                null === this.boundingBox && (this.boundingBox = new kn),
                null === e.boundingBox && e.computeBoundingBox(),
                this.boundingBox.makeEmpty();
                for (let n = 0; n < t; n++)
                    this.getMatrixAt(n, sa),
                    ca.copy(e.boundingBox).applyMatrix4(sa),
                    this.boundingBox.union(ca)
            }
            computeBoundingSphere() {
                const e = this.geometry
                  , t = this.count;
                null === this.boundingSphere && (this.boundingSphere = new Wn),
                null === e.boundingSphere && e.computeBoundingSphere(),
                this.boundingSphere.makeEmpty();
                for (let n = 0; n < t; n++)
                    this.getMatrixAt(n, sa),
                    ua.copy(e.boundingSphere).applyMatrix4(sa),
                    this.boundingSphere.union(ua)
            }
            copy(e, t) {
                return super.copy(e, t),
                this.instanceMatrix.copy(e.instanceMatrix),
                null !== e.morphTexture && (this.morphTexture = e.morphTexture.clone()),
                null !== e.instanceColor && (this.instanceColor = e.instanceColor.clone()),
                this.count = e.count,
                null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
                null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
                this
            }
            getColorAt(e, t) {
                t.fromArray(this.instanceColor.array, 3 * e)
            }
            getMatrixAt(e, t) {
                t.fromArray(this.instanceMatrix.array, 16 * e)
            }
            getMorphAt(e, t) {
                const n = t.morphTargetInfluences
                  , i = this.morphTexture.source.data.data
                  , r = e * (n.length + 1) + 1;
                for (let e = 0; e < n.length; e++)
                    n[e] = i[r + e]
            }
            raycast(e, t) {
                const n = this.matrixWorld
                  , i = this.count;
                if (da.geometry = this.geometry,
                da.material = this.material,
                void 0 !== da.material && (null === this.boundingSphere && this.computeBoundingSphere(),
                ua.copy(this.boundingSphere),
                ua.applyMatrix4(n),
                !1 !== e.ray.intersectsSphere(ua)))
                    for (let r = 0; r < i; r++) {
                        this.getMatrixAt(r, sa),
                        oa.multiplyMatrices(n, sa),
                        da.matrixWorld = oa,
                        da.raycast(e, la);
                        for (let e = 0, n = la.length; e < n; e++) {
                            const n = la[e];
                            n.instanceId = r,
                            n.object = this,
                            t.push(n)
                        }
                        la.length = 0
                    }
            }
            setColorAt(e, t) {
                null === this.instanceColor && (this.instanceColor = new aa(new Float32Array(3 * this.instanceMatrix.count).fill(1),3)),
                t.toArray(this.instanceColor.array, 3 * e)
            }
            setMatrixAt(e, t) {
                t.toArray(this.instanceMatrix.array, 16 * e)
            }
            setMorphAt(e, t) {
                const n = t.morphTargetInfluences
                  , i = n.length + 1;
                null === this.morphTexture && (this.morphTexture = new ta(new Float32Array(i * this.count),i,this.count,Ce,be));
                const r = this.morphTexture.source.data.data;
                let a = 0;
                for (let e = 0; e < n.length; e++)
                    a += n[e];
                const s = this.geometry.morphTargetsRelative ? 1 : 1 - a
                  , o = i * e;
                r[o] = s,
                r.set(n, o + 1)
            }
            updateMorphTargets() {}
            dispose() {
                this.dispatchEvent({
                    type: "dispose"
                }),
                null !== this.morphTexture && (this.morphTexture.dispose(),
                this.morphTexture = null)
            }
        }
        const fa = new bn
          , ma = new bn
          , ga = new Kt;
        class va {
            constructor(e=new bn(1,0,0), t=0) {
                this.isPlane = !0,
                this.normal = e,
                this.constant = t
            }
            set(e, t) {
                return this.normal.copy(e),
                this.constant = t,
                this
            }
            setComponents(e, t, n, i) {
                return this.normal.set(e, t, n),
                this.constant = i,
                this
            }
            setFromNormalAndCoplanarPoint(e, t) {
                return this.normal.copy(e),
                this.constant = -t.dot(this.normal),
                this
            }
            setFromCoplanarPoints(e, t, n) {
                const i = fa.subVectors(n, t).cross(ma.subVectors(e, t)).normalize();
                return this.setFromNormalAndCoplanarPoint(i, e),
                this
            }
            copy(e) {
                return this.normal.copy(e.normal),
                this.constant = e.constant,
                this
            }
            normalize() {
                const e = 1 / this.normal.length();
                return this.normal.multiplyScalar(e),
                this.constant *= e,
                this
            }
            negate() {
                return this.constant *= -1,
                this.normal.negate(),
                this
            }
            distanceToPoint(e) {
                return this.normal.dot(e) + this.constant
            }
            distanceToSphere(e) {
                return this.distanceToPoint(e.center) - e.radius
            }
            projectPoint(e, t) {
                return t.copy(e).addScaledVector(this.normal, -this.distanceToPoint(e))
            }
            intersectLine(e, t) {
                const n = e.delta(fa)
                  , i = this.normal.dot(n);
                if (0 === i)
                    return 0 === this.distanceToPoint(e.start) ? t.copy(e.start) : null;
                const r = -(e.start.dot(this.normal) + this.constant) / i;
                return r < 0 || r > 1 ? null : t.copy(e.start).addScaledVector(n, r)
            }
            intersectsLine(e) {
                const t = this.distanceToPoint(e.start)
                  , n = this.distanceToPoint(e.end);
                return t < 0 && n > 0 || n < 0 && t > 0
            }
            intersectsBox(e) {
                return e.intersectsPlane(this)
            }
            intersectsSphere(e) {
                return e.intersectsPlane(this)
            }
            coplanarPoint(e) {
                return e.copy(this.normal).multiplyScalar(-this.constant)
            }
            applyMatrix4(e, t) {
                const n = t || ga.getNormalMatrix(e)
                  , i = this.coplanarPoint(fa).applyMatrix4(e)
                  , r = this.normal.applyMatrix3(n).normalize();
                return this.constant = -i.dot(r),
                this
            }
            translate(e) {
                return this.constant -= e.dot(this.normal),
                this
            }
            equals(e) {
                return e.normal.equals(this.normal) && e.constant === this.constant
            }
            clone() {
                return (new this.constructor).copy(this)
            }
        }
        const wa = new Wn
          , ya = new bn;
        class ba {
            constructor(e=new va, t=new va, n=new va, i=new va, r=new va, a=new va) {
                this.planes = [e, t, n, i, r, a]
            }
            set(e, t, n, i, r, a) {
                const s = this.planes;
                return s[0].copy(e),
                s[1].copy(t),
                s[2].copy(n),
                s[3].copy(i),
                s[4].copy(r),
                s[5].copy(a),
                this
            }
            copy(e) {
                const t = this.planes;
                for (let n = 0; n < 6; n++)
                    t[n].copy(e.planes[n]);
                return this
            }
            setFromProjectionMatrix(e, t=2e3) {
                const n = this.planes
                  , i = e.elements
                  , r = i[0]
                  , a = i[1]
                  , s = i[2]
                  , o = i[3]
                  , l = i[4]
                  , c = i[5]
                  , h = i[6]
                  , d = i[7]
                  , u = i[8]
                  , p = i[9]
                  , f = i[10]
                  , m = i[11]
                  , g = i[12]
                  , v = i[13]
                  , w = i[14]
                  , y = i[15];
                if (n[0].setComponents(o - r, d - l, m - u, y - g).normalize(),
                n[1].setComponents(o + r, d + l, m + u, y + g).normalize(),
                n[2].setComponents(o + a, d + c, m + p, y + v).normalize(),
                n[3].setComponents(o - a, d - c, m - p, y - v).normalize(),
                n[4].setComponents(o - s, d - h, m - f, y - w).normalize(),
                t === Rt)
                    n[5].setComponents(o + s, d + h, m + f, y + w).normalize();
                else {
                    if (t !== Lt)
                        throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: " + t);
                    n[5].setComponents(s, h, f, w).normalize()
                }
                return this
            }
            intersectsObject(e) {
                if (void 0 !== e.boundingSphere)
                    null === e.boundingSphere && e.computeBoundingSphere(),
                    wa.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);
                else {
                    const t = e.geometry;
                    null === t.boundingSphere && t.computeBoundingSphere(),
                    wa.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)
                }
                return this.intersectsSphere(wa)
            }
            intersectsSprite(e) {
                return wa.center.set(0, 0, 0),
                wa.radius = .7071067811865476,
                wa.applyMatrix4(e.matrixWorld),
                this.intersectsSphere(wa)
            }
            intersectsSphere(e) {
                const t = this.planes
                  , n = e.center
                  , i = -e.radius;
                for (let e = 0; e < 6; e++) {
                    if (t[e].distanceToPoint(n) < i)
                        return !1
                }
                return !0
            }
            intersectsBox(e) {
                const t = this.planes;
                for (let n = 0; n < 6; n++) {
                    const i = t[n];
                    if (ya.x = i.normal.x > 0 ? e.max.x : e.min.x,
                    ya.y = i.normal.y > 0 ? e.max.y : e.min.y,
                    ya.z = i.normal.z > 0 ? e.max.z : e.min.z,
                    i.distanceToPoint(ya) < 0)
                        return !1
                }
                return !0
            }
            containsPoint(e) {
                const t = this.planes;
                for (let n = 0; n < 6; n++)
                    if (t[n].distanceToPoint(e) < 0)
                        return !1;
                return !0
            }
            clone() {
                return (new this.constructor).copy(this)
            }
        }
        class Aa extends ji {
            constructor(e) {
                super(),
                this.isLineBasicMaterial = !0,
                this.type = "LineBasicMaterial",
                this.color = new Hi(16777215),
                this.map = null,
                this.linewidth = 1,
                this.linecap = "round",
                this.linejoin = "round",
                this.fog = !0,
                this.setValues(e)
            }
            copy(e) {
                return super.copy(e),
                this.color.copy(e.color),
                this.map = e.map,
                this.linewidth = e.linewidth,
                this.linecap = e.linecap,
                this.linejoin = e.linejoin,
                this.fog = e.fog,
                this
            }
        }
        const xa = new bn
          , ka = new bn
          , Ea = new Xn
          , Sa = new Yn
          , Ma = new Wn
          , _a = new bn
          , Ta = new bn;
        class Ca extends ki {
            constructor(e=new or, t=new Aa) {
                super(),
                this.isLine = !0,
                this.type = "Line",
                this.geometry = e,
                this.material = t,
                this.morphTargetDictionary = void 0,
                this.morphTargetInfluences = void 0,
                this.updateMorphTargets()
            }
            copy(e, t) {
                return super.copy(e, t),
                this.material = Array.isArray(e.material) ? e.material.slice() : e.material,
                this.geometry = e.geometry,
                this
            }
            computeLineDistances() {
                const e = this.geometry;
                if (null === e.index) {
                    const t = e.attributes.position
                      , n = [0];
                    for (let e = 1, i = t.count; e < i; e++)
                        xa.fromBufferAttribute(t, e - 1),
                        ka.fromBufferAttribute(t, e),
                        n[e] = n[e - 1],
                        n[e] += xa.distanceTo(ka);
                    e.setAttribute("lineDistance", new $i(n,1))
                } else
                    console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");
                return this
            }
            raycast(e, t) {
                const n = this.geometry
                  , i = this.matrixWorld
                  , r = e.params.Line.threshold
                  , a = n.drawRange;
                if (null === n.boundingSphere && n.computeBoundingSphere(),
                Ma.copy(n.boundingSphere),
                Ma.applyMatrix4(i),
                Ma.radius += r,
                !1 === e.ray.intersectsSphere(Ma))
                    return;
                Ea.copy(i).invert(),
                Sa.copy(e.ray).applyMatrix4(Ea);
                const s = r / ((this.scale.x + this.scale.y + this.scale.z) / 3)
                  , o = s * s
                  , l = this.isLineSegments ? 2 : 1
                  , c = n.index
                  , h = n.attributes.position;
                if (null !== c) {
                    const n = Math.max(0, a.start)
                      , i = Math.min(c.count, a.start + a.count);
                    for (let r = n, a = i - 1; r < a; r += l) {
                        const n = c.getX(r)
                          , i = c.getX(r + 1)
                          , a = Pa(this, e, Sa, o, n, i, r);
                        a && t.push(a)
                    }
                    if (this.isLineLoop) {
                        const r = c.getX(i - 1)
                          , a = c.getX(n)
                          , s = Pa(this, e, Sa, o, r, a, i - 1);
                        s && t.push(s)
                    }
                } else {
                    const n = Math.max(0, a.start)
                      , i = Math.min(h.count, a.start + a.count);
                    for (let r = n, a = i - 1; r < a; r += l) {
                        const n = Pa(this, e, Sa, o, r, r + 1, r);
                        n && t.push(n)
                    }
                    if (this.isLineLoop) {
                        const r = Pa(this, e, Sa, o, i - 1, n, i - 1);
                        r && t.push(r)
                    }
                }
            }
            updateMorphTargets() {
                const e = this.geometry.morphAttributes
                  , t = Object.keys(e);
                if (t.length > 0) {
                    const n = e[t[0]];
                    if (void 0 !== n) {
                        this.morphTargetInfluences = [],
                        this.morphTargetDictionary = {};
                        for (let e = 0, t = n.length; e < t; e++) {
                            const t = n[e].name || String(e);
                            this.morphTargetInfluences.push(0),
                            this.morphTargetDictionary[t] = e
                        }
                    }
                }
            }
        }
        function Pa(e, t, n, i, r, a, s) {
            const o = e.geometry.attributes.position;
            xa.fromBufferAttribute(o, r),
            ka.fromBufferAttribute(o, a);
            if (n.distanceSqToSegment(xa, ka, _a, Ta) > i)
                return;
            _a.applyMatrix4(e.matrixWorld);
            const l = t.ray.origin.distanceTo(_a);
            return l < t.near || l > t.far ? void 0 : {
                distance: l,
                point: Ta.clone().applyMatrix4(e.matrixWorld),
                index: s,
                face: null,
                faceIndex: null,
                barycoord: null,
                object: e
            }
        }
        const Ia = new bn
          , Ra = new bn;
        class La extends Ca {
            constructor(e, t) {
                super(e, t),
                this.isLineSegments = !0,
                this.type = "LineSegments"
            }
            computeLineDistances() {
                const e = this.geometry;
                if (null === e.index) {
                    const t = e.attributes.position
                      , n = [];
                    for (let e = 0, i = t.count; e < i; e += 2)
                        Ia.fromBufferAttribute(t, e),
                        Ra.fromBufferAttribute(t, e + 1),
                        n[e] = 0 === e ? 0 : n[e - 1],
                        n[e + 1] = n[e] + Ia.distanceTo(Ra);
                    e.setAttribute("lineDistance", new $i(n,1))
                } else
                    console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");
                return this
            }
        }
        class Da extends Ca {
            constructor(e, t) {
                super(e, t),
                this.isLineLoop = !0,
                this.type = "LineLoop"
            }
        }
        class Na extends ji {
            constructor(e) {
                super(),
                this.isPointsMaterial = !0,
                this.type = "PointsMaterial",
                this.color = new Hi(16777215),
                this.map = null,
                this.alphaMap = null,
                this.size = 1,
                this.sizeAttenuation = !0,
                this.fog = !0,
                this.setValues(e)
            }
            copy(e) {
                return super.copy(e),
                this.color.copy(e.color),
                this.map = e.map,
                this.alphaMap = e.alphaMap,
                this.size = e.size,
                this.sizeAttenuation = e.sizeAttenuation,
                this.fog = e.fog,
                this
            }
        }
        const Ba = new Xn
          , Ua = new Yn
          , za = new Wn
          , Oa = new bn;
        class Fa extends ki {
            constructor(e=new or, t=new Na) {
                super(),
                this.isPoints = !0,
                this.type = "Points",
                this.geometry = e,
                this.material = t,
                this.morphTargetDictionary = void 0,
                this.morphTargetInfluences = void 0,
                this.updateMorphTargets()
            }
            copy(e, t) {
                return super.copy(e, t),
                this.material = Array.isArray(e.material) ? e.material.slice() : e.material,
                this.geometry = e.geometry,
                this
            }
            raycast(e, t) {
                const n = this.geometry
                  , i = this.matrixWorld
                  , r = e.params.Points.threshold
                  , a = n.drawRange;
                if (null === n.boundingSphere && n.computeBoundingSphere(),
                za.copy(n.boundingSphere),
                za.applyMatrix4(i),
                za.radius += r,
                !1 === e.ray.intersectsSphere(za))
                    return;
                Ba.copy(i).invert(),
                Ua.copy(e.ray).applyMatrix4(Ba);
                const s = r / ((this.scale.x + this.scale.y + this.scale.z) / 3)
                  , o = s * s
                  , l = n.index
                  , c = n.attributes.position;
                if (null !== l) {
                    for (let n = Math.max(0, a.start), r = Math.min(l.count, a.start + a.count); n < r; n++) {
                        const r = l.getX(n);
                        Oa.fromBufferAttribute(c, r),
                        Wa(Oa, r, o, i, e, t, this)
                    }
                } else {
                    for (let n = Math.max(0, a.start), r = Math.min(c.count, a.start + a.count); n < r; n++)
                        Oa.fromBufferAttribute(c, n),
                        Wa(Oa, n, o, i, e, t, this)
                }
            }
            updateMorphTargets() {
                const e = this.geometry.morphAttributes
                  , t = Object.keys(e);
                if (t.length > 0) {
                    const n = e[t[0]];
                    if (void 0 !== n) {
                        this.morphTargetInfluences = [],
                        this.morphTargetDictionary = {};
                        for (let e = 0, t = n.length; e < t; e++) {
                            const t = n[e].name || String(e);
                            this.morphTargetInfluences.push(0),
                            this.morphTargetDictionary[t] = e
                        }
                    }
                }
            }
        }
        function Wa(e, t, n, i, r, a, s) {
            const o = Ua.distanceSqToPoint(e);
            if (o < n) {
                const n = new bn;
                Ua.closestPointToPoint(e, n),
                n.applyMatrix4(i);
                const l = r.ray.origin.distanceTo(n);
                if (l < r.near || l > r.far)
                    return;
                a.push({
                    distance: l,
                    distanceToRay: Math.sqrt(o),
                    point: n,
                    index: t,
                    face: null,
                    faceIndex: null,
                    barycoord: null,
                    object: s
                })
            }
        }
        class Ha extends pn {
            constructor(e, t, n, i, r, a, s, o, l, c=1026) {
                if (c !== _e && c !== Te)
                    throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");
                void 0 === n && c === _e && (n = ye),
                void 0 === n && c === Te && (n = Ee),
                super(null, i, r, a, s, o, c, n, l),
                this.isDepthTexture = !0,
                this.image = {
                    width: e,
                    height: t
                },
                this.magFilter = void 0 !== s ? s : le,
                this.minFilter = void 0 !== o ? o : le,
                this.flipY = !1,
                this.generateMipmaps = !1,
                this.compareFunction = null
            }
            copy(e) {
                return super.copy(e),
                this.source = new hn(Object.assign({}, e.image)),
                this.compareFunction = e.compareFunction,
                this
            }
            toJSON(e) {
                const t = super.toJSON(e);
                return null !== this.compareFunction && (t.compareFunction = this.compareFunction),
                t
            }
        }
        class Va {
            constructor() {
                this.type = "Curve",
                this.arcLengthDivisions = 200,
                this.needsUpdate = !1,
                this.cacheArcLengths = null
            }
            getPoint() {
                console.warn("THREE.Curve: .getPoint() not implemented.")
            }
            getPointAt(e, t) {
                const n = this.getUtoTmapping(e);
                return this.getPoint(n, t)
            }
            getPoints(e=5) {
                const t = [];
                for (let n = 0; n <= e; n++)
                    t.push(this.getPoint(n / e));
                return t
            }
            getSpacedPoints(e=5) {
                const t = [];
                for (let n = 0; n <= e; n++)
                    t.push(this.getPointAt(n / e));
                return t
            }
            getLength() {
                const e = this.getLengths();
                return e[e.length - 1]
            }
            getLengths(e=this.arcLengthDivisions) {
                if (this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
                    return this.cacheArcLengths;
                this.needsUpdate = !1;
                const t = [];
                let n, i = this.getPoint(0), r = 0;
                t.push(0);
                for (let a = 1; a <= e; a++)
                    n = this.getPoint(a / e),
                    r += n.distanceTo(i),
                    t.push(r),
                    i = n;
                return this.cacheArcLengths = t,
                t
            }
            updateArcLengths() {
                this.needsUpdate = !0,
                this.getLengths()
            }
            getUtoTmapping(e, t=null) {
                const n = this.getLengths();
                let i = 0;
                const r = n.length;
                let a;
                a = t || e * n[r - 1];
                let s, o = 0, l = r - 1;
                for (; o <= l; )
                    if (i = Math.floor(o + (l - o) / 2),
                    s = n[i] - a,
                    s < 0)
                        o = i + 1;
                    else {
                        if (!(s > 0)) {
                            l = i;
                            break
                        }
                        l = i - 1
                    }
                if (i = l,
                n[i] === a)
                    return i / (r - 1);
                const c = n[i];
                return (i + (a - c) / (n[i + 1] - c)) / (r - 1)
            }
            getTangent(e, t) {
                const n = 1e-4;
                let i = e - n
                  , r = e + n;
                i < 0 && (i = 0),
                r > 1 && (r = 1);
                const a = this.getPoint(i)
                  , s = this.getPoint(r)
                  , o = t || (a.isVector2 ? new Qt : new bn);
                return o.copy(s).sub(a).normalize(),
                o
            }
            getTangentAt(e, t) {
                const n = this.getUtoTmapping(e);
                return this.getTangent(n, t)
            }
            computeFrenetFrames(e, t=!1) {
                const n = new bn
                  , i = []
                  , r = []
                  , a = []
                  , s = new bn
                  , o = new Xn;
                for (let t = 0; t <= e; t++) {
                    const n = t / e;
                    i[t] = this.getTangentAt(n, new bn)
                }
                r[0] = new bn,
                a[0] = new bn;
                let l = Number.MAX_VALUE;
                const c = Math.abs(i[0].x)
                  , h = Math.abs(i[0].y)
                  , d = Math.abs(i[0].z);
                c <= l && (l = c,
                n.set(1, 0, 0)),
                h <= l && (l = h,
                n.set(0, 1, 0)),
                d <= l && n.set(0, 0, 1),
                s.crossVectors(i[0], n).normalize(),
                r[0].crossVectors(i[0], s),
                a[0].crossVectors(i[0], r[0]);
                for (let t = 1; t <= e; t++) {
                    if (r[t] = r[t - 1].clone(),
                    a[t] = a[t - 1].clone(),
                    s.crossVectors(i[t - 1], i[t]),
                    s.length() > Number.EPSILON) {
                        s.normalize();
                        const e = Math.acos(Ft(i[t - 1].dot(i[t]), -1, 1));
                        r[t].applyMatrix4(o.makeRotationAxis(s, e))
                    }
                    a[t].crossVectors(i[t], r[t])
                }
                if (!0 === t) {
                    let t = Math.acos(Ft(r[0].dot(r[e]), -1, 1));
                    t /= e,
                    i[0].dot(s.crossVectors(r[0], r[e])) > 0 && (t = -t);
                    for (let n = 1; n <= e; n++)
                        r[n].applyMatrix4(o.makeRotationAxis(i[n], t * n)),
                        a[n].crossVectors(i[n], r[n])
                }
                return {
                    tangents: i,
                    normals: r,
                    binormals: a
                }
            }
            clone() {
                return (new this.constructor).copy(this)
            }
            copy(e) {
                return this.arcLengthDivisions = e.arcLengthDivisions,
                this
            }
            toJSON() {
                const e = {
                    metadata: {
                        version: 4.6,
                        type: "Curve",
                        generator: "Curve.toJSON"
                    }
                };
                return e.arcLengthDivisions = this.arcLengthDivisions,
                e.type = this.type,
                e
            }
            fromJSON(e) {
                return this.arcLengthDivisions = e.arcLengthDivisions,
                this
            }
        }
        class Ga extends Va {
            constructor(e=0, t=0, n=1, i=1, r=0, a=2 * Math.PI, s=!1, o=0) {
                super(),
                this.isEllipseCurve = !0,
                this.type = "EllipseCurve",
                this.aX = e,
                this.aY = t,
                this.xRadius = n,
                this.yRadius = i,
                this.aStartAngle = r,
                this.aEndAngle = a,
                this.aClockwise = s,
                this.aRotation = o
            }
            getPoint(e, t=new Qt) {
                const n = t
                  , i = 2 * Math.PI;
                let r = this.aEndAngle - this.aStartAngle;
                const a = Math.abs(r) < Number.EPSILON;
                for (; r < 0; )
                    r += i;
                for (; r > i; )
                    r -= i;
                r < Number.EPSILON && (r = a ? 0 : i),
                !0 !== this.aClockwise || a || (r === i ? r = -i : r -= i);
                const s = this.aStartAngle + e * r;
                let o = this.aX + this.xRadius * Math.cos(s)
                  , l = this.aY + this.yRadius * Math.sin(s);
                if (0 !== this.aRotation) {
                    const e = Math.cos(this.aRotation)
                      , t = Math.sin(this.aRotation)
                      , n = o - this.aX
                      , i = l - this.aY;
                    o = n * e - i * t + this.aX,
                    l = n * t + i * e + this.aY
                }
                return n.set(o, l)
            }
            copy(e) {
                return super.copy(e),
                this.aX = e.aX,
                this.aY = e.aY,
                this.xRadius = e.xRadius,
                this.yRadius = e.yRadius,
                this.aStartAngle = e.aStartAngle,
                this.aEndAngle = e.aEndAngle,
                this.aClockwise = e.aClockwise,
                this.aRotation = e.aRotation,
                this
            }
            toJSON() {
                const e = super.toJSON();
                return e.aX = this.aX,
                e.aY = this.aY,
                e.xRadius = this.xRadius,
                e.yRadius = this.yRadius,
                e.aStartAngle = this.aStartAngle,
                e.aEndAngle = this.aEndAngle,
                e.aClockwise = this.aClockwise,
                e.aRotation = this.aRotation,
                e
            }
            fromJSON(e) {
                return super.fromJSON(e),
                this.aX = e.aX,
                this.aY = e.aY,
                this.xRadius = e.xRadius,
                this.yRadius = e.yRadius,
                this.aStartAngle = e.aStartAngle,
                this.aEndAngle = e.aEndAngle,
                this.aClockwise = e.aClockwise,
                this.aRotation = e.aRotation,
                this
            }
        }
        function ja() {
            let e = 0
              , t = 0
              , n = 0
              , i = 0;
            function r(r, a, s, o) {
                e = r,
                t = s,
                n = -3 * r + 3 * a - 2 * s - o,
                i = 2 * r - 2 * a + s + o
            }
            return {
                initCatmullRom: function(e, t, n, i, a) {
                    r(t, n, a * (n - e), a * (i - t))
                },
                initNonuniformCatmullRom: function(e, t, n, i, a, s, o) {
                    let l = (t - e) / a - (n - e) / (a + s) + (n - t) / s
                      , c = (n - t) / s - (i - t) / (s + o) + (i - n) / o;
                    l *= s,
                    c *= s,
                    r(t, n, l, c)
                },
                calc: function(r) {
                    const a = r * r;
                    return e + t * r + n * a + i * (a * r)
                }
            }
        }
        const Qa = new bn
          , Ka = new ja
          , qa = new ja
          , Ya = new ja;
        function Xa(e, t, n, i, r) {
            const a = .5 * (i - t)
              , s = .5 * (r - n)
              , o = e * e;
            return (2 * n - 2 * i + a + s) * (e * o) + (-3 * n + 3 * i - 2 * a - s) * o + a * e + n
        }
        function Za(e, t, n, i) {
            return function(e, t) {
                const n = 1 - e;
                return n * n * t
            }(e, t) + function(e, t) {
                return 2 * (1 - e) * e * t
            }(e, n) + function(e, t) {
                return e * e * t
            }(e, i)
        }
        function Ja(e, t, n, i, r) {
            return function(e, t) {
                const n = 1 - e;
                return n * n * n * t
            }(e, t) + function(e, t) {
                const n = 1 - e;
                return 3 * n * n * e * t
            }(e, n) + function(e, t) {
                return 3 * (1 - e) * e * e * t
            }(e, i) + function(e, t) {
                return e * e * e * t
            }(e, r)
        }
        class $a extends Va {
            constructor(e=new Qt, t=new Qt, n=new Qt, i=new Qt) {
                super(),
                this.isCubicBezierCurve = !0,
                this.type = "CubicBezierCurve",
                this.v0 = e,
                this.v1 = t,
                this.v2 = n,
                this.v3 = i
            }
            getPoint(e, t=new Qt) {
                const n = t
                  , i = this.v0
                  , r = this.v1
                  , a = this.v2
                  , s = this.v3;
                return n.set(Ja(e, i.x, r.x, a.x, s.x), Ja(e, i.y, r.y, a.y, s.y)),
                n
            }
            copy(e) {
                return super.copy(e),
                this.v0.copy(e.v0),
                this.v1.copy(e.v1),
                this.v2.copy(e.v2),
                this.v3.copy(e.v3),
                this
            }
            toJSON() {
                const e = super.toJSON();
                return e.v0 = this.v0.toArray(),
                e.v1 = this.v1.toArray(),
                e.v2 = this.v2.toArray(),
                e.v3 = this.v3.toArray(),
                e
            }
            fromJSON(e) {
                return super.fromJSON(e),
                this.v0.fromArray(e.v0),
                this.v1.fromArray(e.v1),
                this.v2.fromArray(e.v2),
                this.v3.fromArray(e.v3),
                this
            }
        }
        class es extends Va {
            constructor(e=new Qt, t=new Qt) {
                super(),
                this.isLineCurve = !0,
                this.type = "LineCurve",
                this.v1 = e,
                this.v2 = t
            }
            getPoint(e, t=new Qt) {
                const n = t;
                return 1 === e ? n.copy(this.v2) : (n.copy(this.v2).sub(this.v1),
                n.multiplyScalar(e).add(this.v1)),
                n
            }
            getPointAt(e, t) {
                return this.getPoint(e, t)
            }
            getTangent(e, t=new Qt) {
                return t.subVectors(this.v2, this.v1).normalize()
            }
            getTangentAt(e, t) {
                return this.getTangent(e, t)
            }
            copy(e) {
                return super.copy(e),
                this.v1.copy(e.v1),
                this.v2.copy(e.v2),
                this
            }
            toJSON() {
                const e = super.toJSON();
                return e.v1 = this.v1.toArray(),
                e.v2 = this.v2.toArray(),
                e
            }
            fromJSON(e) {
                return super.fromJSON(e),
                this.v1.fromArray(e.v1),
                this.v2.fromArray(e.v2),
                this
            }
        }
        class ts extends Va {
            constructor(e=new Qt, t=new Qt, n=new Qt) {
                super(),
                this.isQuadraticBezierCurve = !0,
                this.type = "QuadraticBezierCurve",
                this.v0 = e,
                this.v1 = t,
                this.v2 = n
            }
            getPoint(e, t=new Qt) {
                const n = t
                  , i = this.v0
                  , r = this.v1
                  , a = this.v2;
                return n.set(Za(e, i.x, r.x, a.x), Za(e, i.y, r.y, a.y)),
                n
            }
            copy(e) {
                return super.copy(e),
                this.v0.copy(e.v0),
                this.v1.copy(e.v1),
                this.v2.copy(e.v2),
                this
            }
            toJSON() {
                const e = super.toJSON();
                return e.v0 = this.v0.toArray(),
                e.v1 = this.v1.toArray(),
                e.v2 = this.v2.toArray(),
                e
            }
            fromJSON(e) {
                return super.fromJSON(e),
                this.v0.fromArray(e.v0),
                this.v1.fromArray(e.v1),
                this.v2.fromArray(e.v2),
                this
            }
        }
        class ns extends Va {
            constructor(e=new bn, t=new bn, n=new bn) {
                super(),
                this.isQuadraticBezierCurve3 = !0,
                this.type = "QuadraticBezierCurve3",
                this.v0 = e,
                this.v1 = t,
                this.v2 = n
            }
            getPoint(e, t=new bn) {
                const n = t
                  , i = this.v0
                  , r = this.v1
                  , a = this.v2;
                return n.set(Za(e, i.x, r.x, a.x), Za(e, i.y, r.y, a.y), Za(e, i.z, r.z, a.z)),
                n
            }
            copy(e) {
                return super.copy(e),
                this.v0.copy(e.v0),
                this.v1.copy(e.v1),
                this.v2.copy(e.v2),
                this
            }
            toJSON() {
                const e = super.toJSON();
                return e.v0 = this.v0.toArray(),
                e.v1 = this.v1.toArray(),
                e.v2 = this.v2.toArray(),
                e
            }
            fromJSON(e) {
                return super.fromJSON(e),
                this.v0.fromArray(e.v0),
                this.v1.fromArray(e.v1),
                this.v2.fromArray(e.v2),
                this
            }
        }
        class is extends Va {
            constructor(e=[]) {
                super(),
                this.isSplineCurve = !0,
                this.type = "SplineCurve",
                this.points = e
            }
            getPoint(e, t=new Qt) {
                const n = t
                  , i = this.points
                  , r = (i.length - 1) * e
                  , a = Math.floor(r)
                  , s = r - a
                  , o = i[0 === a ? a : a - 1]
                  , l = i[a]
                  , c = i[a > i.length - 2 ? i.length - 1 : a + 1]
                  , h = i[a > i.length - 3 ? i.length - 1 : a + 2];
                return n.set(Xa(s, o.x, l.x, c.x, h.x), Xa(s, o.y, l.y, c.y, h.y)),
                n
            }
            copy(e) {
                super.copy(e),
                this.points = [];
                for (let t = 0, n = e.points.length; t < n; t++) {
                    const n = e.points[t];
                    this.points.push(n.clone())
                }
                return this
            }
            toJSON() {
                const e = super.toJSON();
                e.points = [];
                for (let t = 0, n = this.points.length; t < n; t++) {
                    const n = this.points[t];
                    e.points.push(n.toArray())
                }
                return e
            }
            fromJSON(e) {
                super.fromJSON(e),
                this.points = [];
                for (let t = 0, n = e.points.length; t < n; t++) {
                    const n = e.points[t];
                    this.points.push((new Qt).fromArray(n))
                }
                return this
            }
        }
        var rs = Object.freeze({
            __proto__: null,
            ArcCurve: class extends Ga {
                constructor(e, t, n, i, r, a) {
                    super(e, t, n, n, i, r, a),
                    this.isArcCurve = !0,
                    this.type = "ArcCurve"
                }
            }
            ,
            CatmullRomCurve3: class extends Va {
                constructor(e=[], t=!1, n="centripetal", i=.5) {
                    super(),
                    this.isCatmullRomCurve3 = !0,
                    this.type = "CatmullRomCurve3",
                    this.points = e,
                    this.closed = t,
                    this.curveType = n,
                    this.tension = i
                }
                getPoint(e, t=new bn) {
                    const n = t
                      , i = this.points
                      , r = i.length
                      , a = (r - (this.closed ? 0 : 1)) * e;
                    let s, o, l = Math.floor(a), c = a - l;
                    this.closed ? l += l > 0 ? 0 : (Math.floor(Math.abs(l) / r) + 1) * r : 0 === c && l === r - 1 && (l = r - 2,
                    c = 1),
                    this.closed || l > 0 ? s = i[(l - 1) % r] : (Qa.subVectors(i[0], i[1]).add(i[0]),
                    s = Qa);
                    const h = i[l % r]
                      , d = i[(l + 1) % r];
                    if (this.closed || l + 2 < r ? o = i[(l + 2) % r] : (Qa.subVectors(i[r - 1], i[r - 2]).add(i[r - 1]),
                    o = Qa),
                    "centripetal" === this.curveType || "chordal" === this.curveType) {
                        const e = "chordal" === this.curveType ? .5 : .25;
                        let t = Math.pow(s.distanceToSquared(h), e)
                          , n = Math.pow(h.distanceToSquared(d), e)
                          , i = Math.pow(d.distanceToSquared(o), e);
                        n < 1e-4 && (n = 1),
                        t < 1e-4 && (t = n),
                        i < 1e-4 && (i = n),
                        Ka.initNonuniformCatmullRom(s.x, h.x, d.x, o.x, t, n, i),
                        qa.initNonuniformCatmullRom(s.y, h.y, d.y, o.y, t, n, i),
                        Ya.initNonuniformCatmullRom(s.z, h.z, d.z, o.z, t, n, i)
                    } else
                        "catmullrom" === this.curveType && (Ka.initCatmullRom(s.x, h.x, d.x, o.x, this.tension),
                        qa.initCatmullRom(s.y, h.y, d.y, o.y, this.tension),
                        Ya.initCatmullRom(s.z, h.z, d.z, o.z, this.tension));
                    return n.set(Ka.calc(c), qa.calc(c), Ya.calc(c)),
                    n
                }
                copy(e) {
                    super.copy(e),
                    this.points = [];
                    for (let t = 0, n = e.points.length; t < n; t++) {
                        const n = e.points[t];
                        this.points.push(n.clone())
                    }
                    return this.closed = e.closed,
                    this.curveType = e.curveType,
                    this.tension = e.tension,
                    this
                }
                toJSON() {
                    const e = super.toJSON();
                    e.points = [];
                    for (let t = 0, n = this.points.length; t < n; t++) {
                        const n = this.points[t];
                        e.points.push(n.toArray())
                    }
                    return e.closed = this.closed,
                    e.curveType = this.curveType,
                    e.tension = this.tension,
                    e
                }
                fromJSON(e) {
                    super.fromJSON(e),
                    this.points = [];
                    for (let t = 0, n = e.points.length; t < n; t++) {
                        const n = e.points[t];
                        this.points.push((new bn).fromArray(n))
                    }
                    return this.closed = e.closed,
                    this.curveType = e.curveType,
                    this.tension = e.tension,
                    this
                }
            }
            ,
            CubicBezierCurve: $a,
            CubicBezierCurve3: class extends Va {
                constructor(e=new bn, t=new bn, n=new bn, i=new bn) {
                    super(),
                    this.isCubicBezierCurve3 = !0,
                    this.type = "CubicBezierCurve3",
                    this.v0 = e,
                    this.v1 = t,
                    this.v2 = n,
                    this.v3 = i
                }
                getPoint(e, t=new bn) {
                    const n = t
                      , i = this.v0
                      , r = this.v1
                      , a = this.v2
                      , s = this.v3;
                    return n.set(Ja(e, i.x, r.x, a.x, s.x), Ja(e, i.y, r.y, a.y, s.y), Ja(e, i.z, r.z, a.z, s.z)),
                    n
                }
                copy(e) {
                    return super.copy(e),
                    this.v0.copy(e.v0),
                    this.v1.copy(e.v1),
                    this.v2.copy(e.v2),
                    this.v3.copy(e.v3),
                    this
                }
                toJSON() {
                    const e = super.toJSON();
                    return e.v0 = this.v0.toArray(),
                    e.v1 = this.v1.toArray(),
                    e.v2 = this.v2.toArray(),
                    e.v3 = this.v3.toArray(),
                    e
                }
                fromJSON(e) {
                    return super.fromJSON(e),
                    this.v0.fromArray(e.v0),
                    this.v1.fromArray(e.v1),
                    this.v2.fromArray(e.v2),
                    this.v3.fromArray(e.v3),
                    this
                }
            }
            ,
            EllipseCurve: Ga,
            LineCurve: es,
            LineCurve3: class extends Va {
                constructor(e=new bn, t=new bn) {
                    super(),
                    this.isLineCurve3 = !0,
                    this.type = "LineCurve3",
                    this.v1 = e,
                    this.v2 = t
                }
                getPoint(e, t=new bn) {
                    const n = t;
                    return 1 === e ? n.copy(this.v2) : (n.copy(this.v2).sub(this.v1),
                    n.multiplyScalar(e).add(this.v1)),
                    n
                }
                getPointAt(e, t) {
                    return this.getPoint(e, t)
                }
                getTangent(e, t=new bn) {
                    return t.subVectors(this.v2, this.v1).normalize()
                }
                getTangentAt(e, t) {
                    return this.getTangent(e, t)
                }
                copy(e) {
                    return super.copy(e),
                    this.v1.copy(e.v1),
                    this.v2.copy(e.v2),
                    this
                }
                toJSON() {
                    const e = super.toJSON();
                    return e.v1 = this.v1.toArray(),
                    e.v2 = this.v2.toArray(),
                    e
                }
                fromJSON(e) {
                    return super.fromJSON(e),
                    this.v1.fromArray(e.v1),
                    this.v2.fromArray(e.v2),
                    this
                }
            }
            ,
            QuadraticBezierCurve: ts,
            QuadraticBezierCurve3: ns,
            SplineCurve: is
        });
        class as extends Va {
            constructor() {
                super(),
                this.type = "CurvePath",
                this.curves = [],
                this.autoClose = !1
            }
            add(e) {
                this.curves.push(e)
            }
            closePath() {
                const e = this.curves[0].getPoint(0)
                  , t = this.curves[this.curves.length - 1].getPoint(1);
                if (!e.equals(t)) {
                    const n = !0 === e.isVector2 ? "LineCurve" : "LineCurve3";
                    this.curves.push(new rs[n](t,e))
                }
                return this
            }
            getPoint(e, t) {
                const n = e * this.getLength()
                  , i = this.getCurveLengths();
                let r = 0;
                for (; r < i.length; ) {
                    if (i[r] >= n) {
                        const e = i[r] - n
                          , a = this.curves[r]
                          , s = a.getLength()
                          , o = 0 === s ? 0 : 1 - e / s;
                        return a.getPointAt(o, t)
                    }
                    r++
                }
                return null
            }
            getLength() {
                const e = this.getCurveLengths();
                return e[e.length - 1]
            }
            updateArcLengths() {
                this.needsUpdate = !0,
                this.cacheLengths = null,
                this.getCurveLengths()
            }
            getCurveLengths() {
                if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
                    return this.cacheLengths;
                const e = [];
                let t = 0;
                for (let n = 0, i = this.curves.length; n < i; n++)
                    t += this.curves[n].getLength(),
                    e.push(t);
                return this.cacheLengths = e,
                e
            }
            getSpacedPoints(e=40) {
                const t = [];
                for (let n = 0; n <= e; n++)
                    t.push(this.getPoint(n / e));
                return this.autoClose && t.push(t[0]),
                t
            }
            getPoints(e=12) {
                const t = [];
                let n;
                for (let i = 0, r = this.curves; i < r.length; i++) {
                    const a = r[i]
                      , s = a.isEllipseCurve ? 2 * e : a.isLineCurve || a.isLineCurve3 ? 1 : a.isSplineCurve ? e * a.points.length : e
                      , o = a.getPoints(s);
                    for (let e = 0; e < o.length; e++) {
                        const i = o[e];
                        n && n.equals(i) || (t.push(i),
                        n = i)
                    }
                }
                return this.autoClose && t.length > 1 && !t[t.length - 1].equals(t[0]) && t.push(t[0]),
                t
            }
            copy(e) {
                super.copy(e),
                this.curves = [];
                for (let t = 0, n = e.curves.length; t < n; t++) {
                    const n = e.curves[t];
                    this.curves.push(n.clone())
                }
                return this.autoClose = e.autoClose,
                this
            }
            toJSON() {
                const e = super.toJSON();
                e.autoClose = this.autoClose,
                e.curves = [];
                for (let t = 0, n = this.curves.length; t < n; t++) {
                    const n = this.curves[t];
                    e.curves.push(n.toJSON())
                }
                return e
            }
            fromJSON(e) {
                super.fromJSON(e),
                this.autoClose = e.autoClose,
                this.curves = [];
                for (let t = 0, n = e.curves.length; t < n; t++) {
                    const n = e.curves[t];
                    this.curves.push((new rs[n.type]).fromJSON(n))
                }
                return this
            }
        }
        class ss extends as {
            constructor(e) {
                super(),
                this.type = "Path",
                this.currentPoint = new Qt,
                e && this.setFromPoints(e)
            }
            setFromPoints(e) {
                this.moveTo(e[0].x, e[0].y);
                for (let t = 1, n = e.length; t < n; t++)
                    this.lineTo(e[t].x, e[t].y);
                return this
            }
            moveTo(e, t) {
                return this.currentPoint.set(e, t),
                this
            }
            lineTo(e, t) {
                const n = new es(this.currentPoint.clone(),new Qt(e,t));
                return this.curves.push(n),
                this.currentPoint.set(e, t),
                this
            }
            quadraticCurveTo(e, t, n, i) {
                const r = new ts(this.currentPoint.clone(),new Qt(e,t),new Qt(n,i));
                return this.curves.push(r),
                this.currentPoint.set(n, i),
                this
            }
            bezierCurveTo(e, t, n, i, r, a) {
                const s = new $a(this.currentPoint.clone(),new Qt(e,t),new Qt(n,i),new Qt(r,a));
                return this.curves.push(s),
                this.currentPoint.set(r, a),
                this
            }
            splineThru(e) {
                const t = [this.currentPoint.clone()].concat(e)
                  , n = new is(t);
                return this.curves.push(n),
                this.currentPoint.copy(e[e.length - 1]),
                this
            }
            arc(e, t, n, i, r, a) {
                const s = this.currentPoint.x
                  , o = this.currentPoint.y;
                return this.absarc(e + s, t + o, n, i, r, a),
                this
            }
            absarc(e, t, n, i, r, a) {
                return this.absellipse(e, t, n, n, i, r, a),
                this
            }
            ellipse(e, t, n, i, r, a, s, o) {
                const l = this.currentPoint.x
                  , c = this.currentPoint.y;
                return this.absellipse(e + l, t + c, n, i, r, a, s, o),
                this
            }
            absellipse(e, t, n, i, r, a, s, o) {
                const l = new Ga(e,t,n,i,r,a,s,o);
                if (this.curves.length > 0) {
                    const e = l.getPoint(0);
                    e.equals(this.currentPoint) || this.lineTo(e.x, e.y)
                }
                this.curves.push(l);
                const c = l.getPoint(1);
                return this.currentPoint.copy(c),
                this
            }
            copy(e) {
                return super.copy(e),
                this.currentPoint.copy(e.currentPoint),
                this
            }
            toJSON() {
                const e = super.toJSON();
                return e.currentPoint = this.currentPoint.toArray(),
                e
            }
            fromJSON(e) {
                return super.fromJSON(e),
                this.currentPoint.fromArray(e.currentPoint),
                this
            }
        }
        class os extends ss {
            constructor(e) {
                super(e),
                this.uuid = Ot(),
                this.type = "Shape",
                this.holes = []
            }
            getPointsHoles(e) {
                const t = [];
                for (let n = 0, i = this.holes.length; n < i; n++)
                    t[n] = this.holes[n].getPoints(e);
                return t
            }
            extractPoints(e) {
                return {
                    shape: this.getPoints(e),
                    holes: this.getPointsHoles(e)
                }
            }
            copy(e) {
                super.copy(e),
                this.holes = [];
                for (let t = 0, n = e.holes.length; t < n; t++) {
                    const n = e.holes[t];
                    this.holes.push(n.clone())
                }
                return this
            }
            toJSON() {
                const e = super.toJSON();
                e.uuid = this.uuid,
                e.holes = [];
                for (let t = 0, n = this.holes.length; t < n; t++) {
                    const n = this.holes[t];
                    e.holes.push(n.toJSON())
                }
                return e
            }
            fromJSON(e) {
                super.fromJSON(e),
                this.uuid = e.uuid,
                this.holes = [];
                for (let t = 0, n = e.holes.length; t < n; t++) {
                    const n = e.holes[t];
                    this.holes.push((new ss).fromJSON(n))
                }
                return this
            }
        }
        class ls {
            static triangulate(e, t, n=2) {
                const i = t && t.length
                  , r = i ? t[0] * n : e.length;
                let a = cs(e, 0, r, n, !0);
                const s = [];
                if (!a || a.next === a.prev)
                    return s;
                let o, l, c, h, d, u, p;
                if (i && (a = function(e, t, n, i) {
                    const r = [];
                    let a, s, o, l, c;
                    for (a = 0,
                    s = t.length; a < s; a++)
                        o = t[a] * i,
                        l = a < s - 1 ? t[a + 1] * i : e.length,
                        c = cs(e, o, l, i, !1),
                        c === c.next && (c.steiner = !0),
                        r.push(bs(c));
                    for (r.sort(gs),
                    a = 0; a < r.length; a++)
                        n = vs(r[a], n);
                    return n
                }(e, t, a, n)),
                e.length > 80 * n) {
                    o = c = e[0],
                    l = h = e[1];
                    for (let t = n; t < r; t += n)
                        d = e[t],
                        u = e[t + 1],
                        d < o && (o = d),
                        u < l && (l = u),
                        d > c && (c = d),
                        u > h && (h = u);
                    p = Math.max(c - o, h - l),
                    p = 0 !== p ? 32767 / p : 0
                }
                return ds(a, s, n, o, l, p, 0),
                s
            }
        }
        function cs(e, t, n, i, r) {
            let a, s;
            if (r === function(e, t, n, i) {
                let r = 0;
                for (let a = t, s = n - i; a < n; a += i)
                    r += (e[s] - e[a]) * (e[a + 1] + e[s + 1]),
                    s = a;
                return r
            }(e, t, n, i) > 0)
                for (a = t; a < n; a += i)
                    s = Ps(a, e[a], e[a + 1], s);
            else
                for (a = n - i; a >= t; a -= i)
                    s = Ps(a, e[a], e[a + 1], s);
            return s && Es(s, s.next) && (Is(s),
            s = s.next),
            s
        }
        function hs(e, t) {
            if (!e)
                return e;
            t || (t = e);
            let n, i = e;
            do {
                if (n = !1,
                i.steiner || !Es(i, i.next) && 0 !== ks(i.prev, i, i.next))
                    i = i.next;
                else {
                    if (Is(i),
                    i = t = i.prev,
                    i === i.next)
                        break;
                    n = !0
                }
            } while (n || i !== t);
            return t
        }
        function ds(e, t, n, i, r, a, s) {
            if (!e)
                return;
            !s && a && function(e, t, n, i) {
                let r = e;
                do {
                    0 === r.z && (r.z = ys(r.x, r.y, t, n, i)),
                    r.prevZ = r.prev,
                    r.nextZ = r.next,
                    r = r.next
                } while (r !== e);
                r.prevZ.nextZ = null,
                r.prevZ = null,
                function(e) {
                    let t, n, i, r, a, s, o, l, c = 1;
                    do {
                        for (n = e,
                        e = null,
                        a = null,
                        s = 0; n; ) {
                            for (s++,
                            i = n,
                            o = 0,
                            t = 0; t < c && (o++,
                            i = i.nextZ,
                            i); t++)
                                ;
                            for (l = c; o > 0 || l > 0 && i; )
                                0 !== o && (0 === l || !i || n.z <= i.z) ? (r = n,
                                n = n.nextZ,
                                o--) : (r = i,
                                i = i.nextZ,
                                l--),
                                a ? a.nextZ = r : e = r,
                                r.prevZ = a,
                                a = r;
                            n = i
                        }
                        a.nextZ = null,
                        c *= 2
                    } while (s > 1)
                }(r)
            }(e, i, r, a);
            let o, l, c = e;
            for (; e.prev !== e.next; )
                if (o = e.prev,
                l = e.next,
                a ? ps(e, i, r, a) : us(e))
                    t.push(o.i / n | 0),
                    t.push(e.i / n | 0),
                    t.push(l.i / n | 0),
                    Is(e),
                    e = l.next,
                    c = l.next;
                else if ((e = l) === c) {
                    s ? 1 === s ? ds(e = fs(hs(e), t, n), t, n, i, r, a, 2) : 2 === s && ms(e, t, n, i, r, a) : ds(hs(e), t, n, i, r, a, 1);
                    break
                }
        }
        function us(e) {
            const t = e.prev
              , n = e
              , i = e.next;
            if (ks(t, n, i) >= 0)
                return !1;
            const r = t.x
              , a = n.x
              , s = i.x
              , o = t.y
              , l = n.y
              , c = i.y
              , h = r < a ? r < s ? r : s : a < s ? a : s
              , d = o < l ? o < c ? o : c : l < c ? l : c
              , u = r > a ? r > s ? r : s : a > s ? a : s
              , p = o > l ? o > c ? o : c : l > c ? l : c;
            let f = i.next;
            for (; f !== t; ) {
                if (f.x >= h && f.x <= u && f.y >= d && f.y <= p && As(r, o, a, l, s, c, f.x, f.y) && ks(f.prev, f, f.next) >= 0)
                    return !1;
                f = f.next
            }
            return !0
        }
        function ps(e, t, n, i) {
            const r = e.prev
              , a = e
              , s = e.next;
            if (ks(r, a, s) >= 0)
                return !1;
            const o = r.x
              , l = a.x
              , c = s.x
              , h = r.y
              , d = a.y
              , u = s.y
              , p = o < l ? o < c ? o : c : l < c ? l : c
              , f = h < d ? h < u ? h : u : d < u ? d : u
              , m = o > l ? o > c ? o : c : l > c ? l : c
              , g = h > d ? h > u ? h : u : d > u ? d : u
              , v = ys(p, f, t, n, i)
              , w = ys(m, g, t, n, i);
            let y = e.prevZ
              , b = e.nextZ;
            for (; y && y.z >= v && b && b.z <= w; ) {
                if (y.x >= p && y.x <= m && y.y >= f && y.y <= g && y !== r && y !== s && As(o, h, l, d, c, u, y.x, y.y) && ks(y.prev, y, y.next) >= 0)
                    return !1;
                if (y = y.prevZ,
                b.x >= p && b.x <= m && b.y >= f && b.y <= g && b !== r && b !== s && As(o, h, l, d, c, u, b.x, b.y) && ks(b.prev, b, b.next) >= 0)
                    return !1;
                b = b.nextZ
            }
            for (; y && y.z >= v; ) {
                if (y.x >= p && y.x <= m && y.y >= f && y.y <= g && y !== r && y !== s && As(o, h, l, d, c, u, y.x, y.y) && ks(y.prev, y, y.next) >= 0)
                    return !1;
                y = y.prevZ
            }
            for (; b && b.z <= w; ) {
                if (b.x >= p && b.x <= m && b.y >= f && b.y <= g && b !== r && b !== s && As(o, h, l, d, c, u, b.x, b.y) && ks(b.prev, b, b.next) >= 0)
                    return !1;
                b = b.nextZ
            }
            return !0
        }
        function fs(e, t, n) {
            let i = e;
            do {
                const r = i.prev
                  , a = i.next.next;
                !Es(r, a) && Ss(r, i, i.next, a) && Ts(r, a) && Ts(a, r) && (t.push(r.i / n | 0),
                t.push(i.i / n | 0),
                t.push(a.i / n | 0),
                Is(i),
                Is(i.next),
                i = e = a),
                i = i.next
            } while (i !== e);
            return hs(i)
        }
        function ms(e, t, n, i, r, a) {
            let s = e;
            do {
                let e = s.next.next;
                for (; e !== s.prev; ) {
                    if (s.i !== e.i && xs(s, e)) {
                        let o = Cs(s, e);
                        return s = hs(s, s.next),
                        o = hs(o, o.next),
                        ds(s, t, n, i, r, a, 0),
                        void ds(o, t, n, i, r, a, 0)
                    }
                    e = e.next
                }
                s = s.next
            } while (s !== e)
        }
        function gs(e, t) {
            return e.x - t.x
        }
        function vs(e, t) {
            const n = function(e, t) {
                let n, i = t, r = -1 / 0;
                const a = e.x
                  , s = e.y;
                do {
                    if (s <= i.y && s >= i.next.y && i.next.y !== i.y) {
                        const e = i.x + (s - i.y) * (i.next.x - i.x) / (i.next.y - i.y);
                        if (e <= a && e > r && (r = e,
                        n = i.x < i.next.x ? i : i.next,
                        e === a))
                            return n
                    }
                    i = i.next
                } while (i !== t);
                if (!n)
                    return null;
                const o = n
                  , l = n.x
                  , c = n.y;
                let h, d = 1 / 0;
                i = n;
                do {
                    a >= i.x && i.x >= l && a !== i.x && As(s < c ? a : r, s, l, c, s < c ? r : a, s, i.x, i.y) && (h = Math.abs(s - i.y) / (a - i.x),
                    Ts(i, e) && (h < d || h === d && (i.x > n.x || i.x === n.x && ws(n, i))) && (n = i,
                    d = h)),
                    i = i.next
                } while (i !== o);
                return n
            }(e, t);
            if (!n)
                return t;
            const i = Cs(n, e);
            return hs(i, i.next),
            hs(n, n.next)
        }
        function ws(e, t) {
            return ks(e.prev, e, t.prev) < 0 && ks(t.next, e, e.next) < 0
        }
        function ys(e, t, n, i, r) {
            return (e = 1431655765 & ((e = 858993459 & ((e = 252645135 & ((e = 16711935 & ((e = (e - n) * r | 0) | e << 8)) | e << 4)) | e << 2)) | e << 1)) | (t = 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = (t - i) * r | 0) | t << 8)) | t << 4)) | t << 2)) | t << 1)) << 1
        }
        function bs(e) {
            let t = e
              , n = e;
            do {
                (t.x < n.x || t.x === n.x && t.y < n.y) && (n = t),
                t = t.next
            } while (t !== e);
            return n
        }
        function As(e, t, n, i, r, a, s, o) {
            return (r - s) * (t - o) >= (e - s) * (a - o) && (e - s) * (i - o) >= (n - s) * (t - o) && (n - s) * (a - o) >= (r - s) * (i - o)
        }
        function xs(e, t) {
            return e.next.i !== t.i && e.prev.i !== t.i && !function(e, t) {
                let n = e;
                do {
                    if (n.i !== e.i && n.next.i !== e.i && n.i !== t.i && n.next.i !== t.i && Ss(n, n.next, e, t))
                        return !0;
                    n = n.next
                } while (n !== e);
                return !1
            }(e, t) && (Ts(e, t) && Ts(t, e) && function(e, t) {
                let n = e
                  , i = !1;
                const r = (e.x + t.x) / 2
                  , a = (e.y + t.y) / 2;
                do {
                    n.y > a != n.next.y > a && n.next.y !== n.y && r < (n.next.x - n.x) * (a - n.y) / (n.next.y - n.y) + n.x && (i = !i),
                    n = n.next
                } while (n !== e);
                return i
            }(e, t) && (ks(e.prev, e, t.prev) || ks(e, t.prev, t)) || Es(e, t) && ks(e.prev, e, e.next) > 0 && ks(t.prev, t, t.next) > 0)
        }
        function ks(e, t, n) {
            return (t.y - e.y) * (n.x - t.x) - (t.x - e.x) * (n.y - t.y)
        }
        function Es(e, t) {
            return e.x === t.x && e.y === t.y
        }
        function Ss(e, t, n, i) {
            const r = _s(ks(e, t, n))
              , a = _s(ks(e, t, i))
              , s = _s(ks(n, i, e))
              , o = _s(ks(n, i, t));
            return r !== a && s !== o || (!(0 !== r || !Ms(e, n, t)) || (!(0 !== a || !Ms(e, i, t)) || (!(0 !== s || !Ms(n, e, i)) || !(0 !== o || !Ms(n, t, i)))))
        }
        function Ms(e, t, n) {
            return t.x <= Math.max(e.x, n.x) && t.x >= Math.min(e.x, n.x) && t.y <= Math.max(e.y, n.y) && t.y >= Math.min(e.y, n.y)
        }
        function _s(e) {
            return e > 0 ? 1 : e < 0 ? -1 : 0
        }
        function Ts(e, t) {
            return ks(e.prev, e, e.next) < 0 ? ks(e, t, e.next) >= 0 && ks(e, e.prev, t) >= 0 : ks(e, t, e.prev) < 0 || ks(e, e.next, t) < 0
        }
        function Cs(e, t) {
            const n = new Rs(e.i,e.x,e.y)
              , i = new Rs(t.i,t.x,t.y)
              , r = e.next
              , a = t.prev;
            return e.next = t,
            t.prev = e,
            n.next = r,
            r.prev = n,
            i.next = n,
            n.prev = i,
            a.next = i,
            i.prev = a,
            i
        }
        function Ps(e, t, n, i) {
            const r = new Rs(e,t,n);
            return i ? (r.next = i.next,
            r.prev = i,
            i.next.prev = r,
            i.next = r) : (r.prev = r,
            r.next = r),
            r
        }
        function Is(e) {
            e.next.prev = e.prev,
            e.prev.next = e.next,
            e.prevZ && (e.prevZ.nextZ = e.nextZ),
            e.nextZ && (e.nextZ.prevZ = e.prevZ)
        }
        function Rs(e, t, n) {
            this.i = e,
            this.x = t,
            this.y = n,
            this.prev = null,
            this.next = null,
            this.z = 0,
            this.prevZ = null,
            this.nextZ = null,
            this.steiner = !1
        }
        class Ls {
            static area(e) {
                const t = e.length;
                let n = 0;
                for (let i = t - 1, r = 0; r < t; i = r++)
                    n += e[i].x * e[r].y - e[r].x * e[i].y;
                return .5 * n
            }
            static isClockWise(e) {
                return Ls.area(e) < 0
            }
            static triangulateShape(e, t) {
                const n = []
                  , i = []
                  , r = [];
                Ds(e),
                Ns(n, e);
                let a = e.length;
                t.forEach(Ds);
                for (let e = 0; e < t.length; e++)
                    i.push(a),
                    a += t[e].length,
                    Ns(n, t[e]);
                const s = ls.triangulate(n, i);
                for (let e = 0; e < s.length; e += 3)
                    r.push(s.slice(e, e + 3));
                return r
            }
        }
        function Ds(e) {
            const t = e.length;
            t > 2 && e[t - 1].equals(e[0]) && e.pop()
        }
        function Ns(e, t) {
            for (let n = 0; n < t.length; n++)
                e.push(t[n].x),
                e.push(t[n].y)
        }
        class Bs extends or {
            constructor(e=1, t=1, n=1, i=1) {
                super(),
                this.type = "PlaneGeometry",
                this.parameters = {
                    width: e,
                    height: t,
                    widthSegments: n,
                    heightSegments: i
                };
                const r = e / 2
                  , a = t / 2
                  , s = Math.floor(n)
                  , o = Math.floor(i)
                  , l = s + 1
                  , c = o + 1
                  , h = e / s
                  , d = t / o
                  , u = []
                  , p = []
                  , f = []
                  , m = [];
                for (let e = 0; e < c; e++) {
                    const t = e * d - a;
                    for (let n = 0; n < l; n++) {
                        const i = n * h - r;
                        p.push(i, -t, 0),
                        f.push(0, 0, 1),
                        m.push(n / s),
                        m.push(1 - e / o)
                    }
                }
                for (let e = 0; e < o; e++)
                    for (let t = 0; t < s; t++) {
                        const n = t + l * e
                          , i = t + l * (e + 1)
                          , r = t + 1 + l * (e + 1)
                          , a = t + 1 + l * e;
                        u.push(n, i, a),
                        u.push(i, r, a)
                    }
                this.setIndex(u),
                this.setAttribute("position", new $i(p,3)),
                this.setAttribute("normal", new $i(f,3)),
                this.setAttribute("uv", new $i(m,2))
            }
            copy(e) {
                return super.copy(e),
                this.parameters = Object.assign({}, e.parameters),
                this
            }
            static fromJSON(e) {
                return new Bs(e.width,e.height,e.widthSegments,e.heightSegments)
            }
        }
        class Us extends or {
            constructor(e=new os([new Qt(0,.5), new Qt(-.5,-.5), new Qt(.5,-.5)]), t=12) {
                super(),
                this.type = "ShapeGeometry",
                this.parameters = {
                    shapes: e,
                    curveSegments: t
                };
                const n = []
                  , i = []
                  , r = []
                  , a = [];
                let s = 0
                  , o = 0;
                if (!1 === Array.isArray(e))
                    l(e);
                else
                    for (let t = 0; t < e.length; t++)
                        l(e[t]),
                        this.addGroup(s, o, t),
                        s += o,
                        o = 0;
                function l(e) {
                    const s = i.length / 3
                      , l = e.extractPoints(t);
                    let c = l.shape;
                    const h = l.holes;
                    !1 === Ls.isClockWise(c) && (c = c.reverse());
                    for (let e = 0, t = h.length; e < t; e++) {
                        const t = h[e];
                        !0 === Ls.isClockWise(t) && (h[e] = t.reverse())
                    }
                    const d = Ls.triangulateShape(c, h);
                    for (let e = 0, t = h.length; e < t; e++) {
                        const t = h[e];
                        c = c.concat(t)
                    }
                    for (let e = 0, t = c.length; e < t; e++) {
                        const t = c[e];
                        i.push(t.x, t.y, 0),
                        r.push(0, 0, 1),
                        a.push(t.x, t.y)
                    }
                    for (let e = 0, t = d.length; e < t; e++) {
                        const t = d[e]
                          , i = t[0] + s
                          , r = t[1] + s
                          , a = t[2] + s;
                        n.push(i, r, a),
                        o += 3
                    }
                }
                this.setIndex(n),
                this.setAttribute("position", new $i(i,3)),
                this.setAttribute("normal", new $i(r,3)),
                this.setAttribute("uv", new $i(a,2))
            }
            copy(e) {
                return super.copy(e),
                this.parameters = Object.assign({}, e.parameters),
                this
            }
            toJSON() {
                const e = super.toJSON();
                return function(e, t) {
                    if (t.shapes = [],
                    Array.isArray(e))
                        for (let n = 0, i = e.length; n < i; n++) {
                            const i = e[n];
                            t.shapes.push(i.uuid)
                        }
                    else
                        t.shapes.push(e.uuid);
                    return t
                }(this.parameters.shapes, e)
            }
            static fromJSON(e, t) {
                const n = [];
                for (let i = 0, r = e.shapes.length; i < r; i++) {
                    const r = t[e.shapes[i]];
                    n.push(r)
                }
                return new Us(n,e.curveSegments)
            }
        }
        class zs extends or {
            constructor(e=1, t=32, n=16, i=0, r=2 * Math.PI, a=0, s=Math.PI) {
                super(),
                this.type = "SphereGeometry",
                this.parameters = {
                    radius: e,
                    widthSegments: t,
                    heightSegments: n,
                    phiStart: i,
                    phiLength: r,
                    thetaStart: a,
                    thetaLength: s
                },
                t = Math.max(3, Math.floor(t)),
                n = Math.max(2, Math.floor(n));
                const o = Math.min(a + s, Math.PI);
                let l = 0;
                const c = []
                  , h = new bn
                  , d = new bn
                  , u = []
                  , p = []
                  , f = []
                  , m = [];
                for (let u = 0; u <= n; u++) {
                    const g = []
                      , v = u / n;
                    let w = 0;
                    0 === u && 0 === a ? w = .5 / t : u === n && o === Math.PI && (w = -.5 / t);
                    for (let n = 0; n <= t; n++) {
                        const o = n / t;
                        h.x = -e * Math.cos(i + o * r) * Math.sin(a + v * s),
                        h.y = e * Math.cos(a + v * s),
                        h.z = e * Math.sin(i + o * r) * Math.sin(a + v * s),
                        p.push(h.x, h.y, h.z),
                        d.copy(h).normalize(),
                        f.push(d.x, d.y, d.z),
                        m.push(o + w, 1 - v),
                        g.push(l++)
                    }
                    c.push(g)
                }
                for (let e = 0; e < n; e++)
                    for (let i = 0; i < t; i++) {
                        const t = c[e][i + 1]
                          , r = c[e][i]
                          , s = c[e + 1][i]
                          , l = c[e + 1][i + 1];
                        (0 !== e || a > 0) && u.push(t, r, l),
                        (e !== n - 1 || o < Math.PI) && u.push(r, s, l)
                    }
                this.setIndex(u),
                this.setAttribute("position", new $i(p,3)),
                this.setAttribute("normal", new $i(f,3)),
                this.setAttribute("uv", new $i(m,2))
            }
            copy(e) {
                return super.copy(e),
                this.parameters = Object.assign({}, e.parameters),
                this
            }
            static fromJSON(e) {
                return new zs(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)
            }
        }
        class Os extends ji {
            constructor(e) {
                super(),
                this.isMeshStandardMaterial = !0,
                this.type = "MeshStandardMaterial",
                this.defines = {
                    STANDARD: ""
                },
                this.color = new Hi(16777215),
                this.roughness = 1,
                this.metalness = 0,
                this.map = null,
                this.lightMap = null,
                this.lightMapIntensity = 1,
                this.aoMap = null,
                this.aoMapIntensity = 1,
                this.emissive = new Hi(0),
                this.emissiveIntensity = 1,
                this.emissiveMap = null,
                this.bumpMap = null,
                this.bumpScale = 1,
                this.normalMap = null,
                this.normalMapType = 0,
                this.normalScale = new Qt(1,1),
                this.displacementMap = null,
                this.displacementScale = 1,
                this.displacementBias = 0,
                this.roughnessMap = null,
                this.metalnessMap = null,
                this.alphaMap = null,
                this.envMap = null,
                this.envMapRotation = new si,
                this.envMapIntensity = 1,
                this.wireframe = !1,
                this.wireframeLinewidth = 1,
                this.wireframeLinecap = "round",
                this.wireframeLinejoin = "round",
                this.flatShading = !1,
                this.fog = !0,
                this.setValues(e)
            }
            copy(e) {
                return super.copy(e),
                this.defines = {
                    STANDARD: ""
                },
                this.color.copy(e.color),
                this.roughness = e.roughness,
                this.metalness = e.metalness,
                this.map = e.map,
                this.lightMap = e.lightMap,
                this.lightMapIntensity = e.lightMapIntensity,
                this.aoMap = e.aoMap,
                this.aoMapIntensity = e.aoMapIntensity,
                this.emissive.copy(e.emissive),
                this.emissiveMap = e.emissiveMap,
                this.emissiveIntensity = e.emissiveIntensity,
                this.bumpMap = e.bumpMap,
                this.bumpScale = e.bumpScale,
                this.normalMap = e.normalMap,
                this.normalMapType = e.normalMapType,
                this.normalScale.copy(e.normalScale),
                this.displacementMap = e.displacementMap,
                this.displacementScale = e.displacementScale,
                this.displacementBias = e.displacementBias,
                this.roughnessMap = e.roughnessMap,
                this.metalnessMap = e.metalnessMap,
                this.alphaMap = e.alphaMap,
                this.envMap = e.envMap,
                this.envMapRotation.copy(e.envMapRotation),
                this.envMapIntensity = e.envMapIntensity,
                this.wireframe = e.wireframe,
                this.wireframeLinewidth = e.wireframeLinewidth,
                this.wireframeLinecap = e.wireframeLinecap,
                this.wireframeLinejoin = e.wireframeLinejoin,
                this.flatShading = e.flatShading,
                this.fog = e.fog,
                this
            }
        }
        class Fs extends Os {
            constructor(e) {
                super(),
                this.isMeshPhysicalMaterial = !0,
                this.defines = {
                    STANDARD: "",
                    PHYSICAL: ""
                },
                this.type = "MeshPhysicalMaterial",
                this.anisotropyRotation = 0,
                this.anisotropyMap = null,
                this.clearcoatMap = null,
                this.clearcoatRoughness = 0,
                this.clearcoatRoughnessMap = null,
                this.clearcoatNormalScale = new Qt(1,1),
                this.clearcoatNormalMap = null,
                this.ior = 1.5,
                Object.defineProperty(this, "reflectivity", {
                    get: function() {
                        return Ft(2.5 * (this.ior - 1) / (this.ior + 1), 0, 1)
                    },
                    set: function(e) {
                        this.ior = (1 + .4 * e) / (1 - .4 * e)
                    }
                }),
                this.iridescenceMap = null,
                this.iridescenceIOR = 1.3,
                this.iridescenceThicknessRange = [100, 400],
                this.iridescenceThicknessMap = null,
                this.sheenColor = new Hi(0),
                this.sheenColorMap = null,
                this.sheenRoughness = 1,
                this.sheenRoughnessMap = null,
                this.transmissionMap = null,
                this.thickness = 0,
                this.thicknessMap = null,
                this.attenuationDistance = 1 / 0,
                this.attenuationColor = new Hi(1,1,1),
                this.specularIntensity = 1,
                this.specularIntensityMap = null,
                this.specularColor = new Hi(1,1,1),
                this.specularColorMap = null,
                this._anisotropy = 0,
                this._clearcoat = 0,
                this._dispersion = 0,
                this._iridescence = 0,
                this._sheen = 0,
                this._transmission = 0,
                this.setValues(e)
            }
            get anisotropy() {
                return this._anisotropy
            }
            set anisotropy(e) {
                this._anisotropy > 0 != e > 0 && this.version++,
                this._anisotropy = e
            }
            get clearcoat() {
                return this._clearcoat
            }
            set clearcoat(e) {
                this._clearcoat > 0 != e > 0 && this.version++,
                this._clearcoat = e
            }
            get iridescence() {
                return this._iridescence
            }
            set iridescence(e) {
                this._iridescence > 0 != e > 0 && this.version++,
                this._iridescence = e
            }
            get dispersion() {
                return this._dispersion
            }
            set dispersion(e) {
                this._dispersion > 0 != e > 0 && this.version++,
                this._dispersion = e
            }
            get sheen() {
                return this._sheen
            }
            set sheen(e) {
                this._sheen > 0 != e > 0 && this.version++,
                this._sheen = e
            }
            get transmission() {
                return this._transmission
            }
            set transmission(e) {
                this._transmission > 0 != e > 0 && this.version++,
                this._transmission = e
            }
            copy(e) {
                return super.copy(e),
                this.defines = {
                    STANDARD: "",
                    PHYSICAL: ""
                },
                this.anisotropy = e.anisotropy,
                this.anisotropyRotation = e.anisotropyRotation,
                this.anisotropyMap = e.anisotropyMap,
                this.clearcoat = e.clearcoat,
                this.clearcoatMap = e.clearcoatMap,
                this.clearcoatRoughness = e.clearcoatRoughness,
                this.clearcoatRoughnessMap = e.clearcoatRoughnessMap,
                this.clearcoatNormalMap = e.clearcoatNormalMap,
                this.clearcoatNormalScale.copy(e.clearcoatNormalScale),
                this.dispersion = e.dispersion,
                this.ior = e.ior,
                this.iridescence = e.iridescence,
                this.iridescenceMap = e.iridescenceMap,
                this.iridescenceIOR = e.iridescenceIOR,
                this.iridescenceThicknessRange = [...e.iridescenceThicknessRange],
                this.iridescenceThicknessMap = e.iridescenceThicknessMap,
                this.sheen = e.sheen,
                this.sheenColor.copy(e.sheenColor),
                this.sheenColorMap = e.sheenColorMap,
                this.sheenRoughness = e.sheenRoughness,
                this.sheenRoughnessMap = e.sheenRoughnessMap,
                this.transmission = e.transmission,
                this.transmissionMap = e.transmissionMap,
                this.thickness = e.thickness,
                this.thicknessMap = e.thicknessMap,
                this.attenuationDistance = e.attenuationDistance,
                this.attenuationColor.copy(e.attenuationColor),
                this.specularIntensity = e.specularIntensity,
                this.specularIntensityMap = e.specularIntensityMap,
                this.specularColor.copy(e.specularColor),
                this.specularColorMap = e.specularColorMap,
                this
            }
        }
        class Ws extends ji {
            constructor(e) {
                super(),
                this.isMeshLambertMaterial = !0,
                this.type = "MeshLambertMaterial",
                this.color = new Hi(16777215),
                this.map = null,
                this.lightMap = null,
                this.lightMapIntensity = 1,
                this.aoMap = null,
                this.aoMapIntensity = 1,
                this.emissive = new Hi(0),
                this.emissiveIntensity = 1,
                this.emissiveMap = null,
                this.bumpMap = null,
                this.bumpScale = 1,
                this.normalMap = null,
                this.normalMapType = 0,
                this.normalScale = new Qt(1,1),
                this.displacementMap = null,
                this.displacementScale = 1,
                this.displacementBias = 0,
                this.specularMap = null,
                this.alphaMap = null,
                this.envMap = null,
                this.envMapRotation = new si,
                this.combine = 0,
                this.reflectivity = 1,
                this.refractionRatio = .98,
                this.wireframe = !1,
                this.wireframeLinewidth = 1,
                this.wireframeLinecap = "round",
                this.wireframeLinejoin = "round",
                this.flatShading = !1,
                this.fog = !0,
                this.setValues(e)
            }
            copy(e) {
                return super.copy(e),
                this.color.copy(e.color),
                this.map = e.map,
                this.lightMap = e.lightMap,
                this.lightMapIntensity = e.lightMapIntensity,
                this.aoMap = e.aoMap,
                this.aoMapIntensity = e.aoMapIntensity,
                this.emissive.copy(e.emissive),
                this.emissiveMap = e.emissiveMap,
                this.emissiveIntensity = e.emissiveIntensity,
                this.bumpMap = e.bumpMap,
                this.bumpScale = e.bumpScale,
                this.normalMap = e.normalMap,
                this.normalMapType = e.normalMapType,
                this.normalScale.copy(e.normalScale),
                this.displacementMap = e.displacementMap,
                this.displacementScale = e.displacementScale,
                this.displacementBias = e.displacementBias,
                this.specularMap = e.specularMap,
                this.alphaMap = e.alphaMap,
                this.envMap = e.envMap,
                this.envMapRotation.copy(e.envMapRotation),
                this.combine = e.combine,
                this.reflectivity = e.reflectivity,
                this.refractionRatio = e.refractionRatio,
                this.wireframe = e.wireframe,
                this.wireframeLinewidth = e.wireframeLinewidth,
                this.wireframeLinecap = e.wireframeLinecap,
                this.wireframeLinejoin = e.wireframeLinejoin,
                this.flatShading = e.flatShading,
                this.fog = e.fog,
                this
            }
        }
        class Hs extends ji {
            constructor(e) {
                super(),
                this.isMeshDepthMaterial = !0,
                this.type = "MeshDepthMaterial",
                this.depthPacking = 3200,
                this.map = null,
                this.alphaMap = null,
                this.displacementMap = null,
                this.displacementScale = 1,
                this.displacementBias = 0,
                this.wireframe = !1,
                this.wireframeLinewidth = 1,
                this.setValues(e)
            }
            copy(e) {
                return super.copy(e),
                this.depthPacking = e.depthPacking,
                this.map = e.map,
                this.alphaMap = e.alphaMap,
                this.displacementMap = e.displacementMap,
                this.displacementScale = e.displacementScale,
                this.displacementBias = e.displacementBias,
                this.wireframe = e.wireframe,
                this.wireframeLinewidth = e.wireframeLinewidth,
                this
            }
        }
        class Vs extends ji {
            constructor(e) {
                super(),
                this.isMeshDistanceMaterial = !0,
                this.type = "MeshDistanceMaterial",
                this.map = null,
                this.alphaMap = null,
                this.displacementMap = null,
                this.displacementScale = 1,
                this.displacementBias = 0,
                this.setValues(e)
            }
            copy(e) {
                return super.copy(e),
                this.map = e.map,
                this.alphaMap = e.alphaMap,
                this.displacementMap = e.displacementMap,
                this.displacementScale = e.displacementScale,
                this.displacementBias = e.displacementBias,
                this
            }
        }
        function Gs(e, t, n) {
            return !e || !n && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
        }
        function js(e) {
            return ArrayBuffer.isView(e) && !(e instanceof DataView)
        }
        function Qs(e) {
            const t = e.length
              , n = new Array(t);
            for (let e = 0; e !== t; ++e)
                n[e] = e;
            return n.sort((function(t, n) {
                return e[t] - e[n]
            }
            )),
            n
        }
        function Ks(e, t, n) {
            const i = e.length
              , r = new e.constructor(i);
            for (let a = 0, s = 0; s !== i; ++a) {
                const i = n[a] * t;
                for (let n = 0; n !== t; ++n)
                    r[s++] = e[i + n]
            }
            return r
        }
        function qs(e, t, n, i) {
            let r = 1
              , a = e[0];
            for (; void 0 !== a && void 0 === a[i]; )
                a = e[r++];
            if (void 0 === a)
                return;
            let s = a[i];
            if (void 0 !== s)
                if (Array.isArray(s))
                    do {
                        s = a[i],
                        void 0 !== s && (t.push(a.time),
                        n.push(...s)),
                        a = e[r++]
                    } while (void 0 !== a);
                else if (void 0 !== s.toArray)
                    do {
                        s = a[i],
                        void 0 !== s && (t.push(a.time),
                        s.toArray(n, n.length)),
                        a = e[r++]
                    } while (void 0 !== a);
                else
                    do {
                        s = a[i],
                        void 0 !== s && (t.push(a.time),
                        n.push(s)),
                        a = e[r++]
                    } while (void 0 !== a)
        }
        class Ys {
            constructor(e, t, n, i) {
                this.parameterPositions = e,
                this._cachedIndex = 0,
                this.resultBuffer = void 0 !== i ? i : new t.constructor(n),
                this.sampleValues = t,
                this.valueSize = n,
                this.settings = null,
                this.DefaultSettings_ = {}
            }
            evaluate(e) {
                const t = this.parameterPositions;
                let n = this._cachedIndex
                  , i = t[n]
                  , r = t[n - 1];
                e: {
                    t: {
                        let a;
                        n: {
                            i: if (!(e < i)) {
                                for (let a = n + 2; ; ) {
                                    if (void 0 === i) {
                                        if (e < r)
                                            break i;
                                        return n = t.length,
                                        this._cachedIndex = n,
                                        this.copySampleValue_(n - 1)
                                    }
                                    if (n === a)
                                        break;
                                    if (r = i,
                                    i = t[++n],
                                    e < i)
                                        break t
                                }
                                a = t.length;
                                break n
                            }
                            if (e >= r)
                                break e;
                            {
                                const s = t[1];
                                e < s && (n = 2,
                                r = s);
                                for (let a = n - 2; ; ) {
                                    if (void 0 === r)
                                        return this._cachedIndex = 0,
                                        this.copySampleValue_(0);
                                    if (n === a)
                                        break;
                                    if (i = r,
                                    r = t[--n - 1],
                                    e >= r)
                                        break t
                                }
                                a = n,
                                n = 0
                            }
                        }
                        for (; n < a; ) {
                            const i = n + a >>> 1;
                            e < t[i] ? a = i : n = i + 1
                        }
                        if (i = t[n],
                        r = t[n - 1],
                        void 0 === r)
                            return this._cachedIndex = 0,
                            this.copySampleValue_(0);
                        if (void 0 === i)
                            return n = t.length,
                            this._cachedIndex = n,
                            this.copySampleValue_(n - 1)
                    }
                    this._cachedIndex = n,
                    this.intervalChanged_(n, r, i)
                }
                return this.interpolate_(n, r, e, i)
            }
            getSettings_() {
                return this.settings || this.DefaultSettings_
            }
            copySampleValue_(e) {
                const t = this.resultBuffer
                  , n = this.sampleValues
                  , i = this.valueSize
                  , r = e * i;
                for (let e = 0; e !== i; ++e)
                    t[e] = n[r + e];
                return t
            }
            interpolate_() {
                throw new Error("call to abstract method")
            }
            intervalChanged_() {}
        }
        class Xs extends Ys {
            constructor(e, t, n, i) {
                super(e, t, n, i),
                this._weightPrev = -0,
                this._offsetPrev = -0,
                this._weightNext = -0,
                this._offsetNext = -0,
                this.DefaultSettings_ = {
                    endingStart: pt,
                    endingEnd: pt
                }
            }
            intervalChanged_(e, t, n) {
                const i = this.parameterPositions;
                let r = e - 2
                  , a = e + 1
                  , s = i[r]
                  , o = i[a];
                if (void 0 === s)
                    switch (this.getSettings_().endingStart) {
                    case ft:
                        r = e,
                        s = 2 * t - n;
                        break;
                    case mt:
                        r = i.length - 2,
                        s = t + i[r] - i[r + 1];
                        break;
                    default:
                        r = e,
                        s = n
                    }
                if (void 0 === o)
                    switch (this.getSettings_().endingEnd) {
                    case ft:
                        a = e,
                        o = 2 * n - t;
                        break;
                    case mt:
                        a = 1,
                        o = n + i[1] - i[0];
                        break;
                    default:
                        a = e - 1,
                        o = t
                    }
                const l = .5 * (n - t)
                  , c = this.valueSize;
                this._weightPrev = l / (t - s),
                this._weightNext = l / (o - n),
                this._offsetPrev = r * c,
                this._offsetNext = a * c
            }
            interpolate_(e, t, n, i) {
                const r = this.resultBuffer
                  , a = this.sampleValues
                  , s = this.valueSize
                  , o = e * s
                  , l = o - s
                  , c = this._offsetPrev
                  , h = this._offsetNext
                  , d = this._weightPrev
                  , u = this._weightNext
                  , p = (n - t) / (i - t)
                  , f = p * p
                  , m = f * p
                  , g = -d * m + 2 * d * f - d * p
                  , v = (1 + d) * m + (-1.5 - 2 * d) * f + (-.5 + d) * p + 1
                  , w = (-1 - u) * m + (1.5 + u) * f + .5 * p
                  , y = u * m - u * f;
                for (let e = 0; e !== s; ++e)
                    r[e] = g * a[c + e] + v * a[l + e] + w * a[o + e] + y * a[h + e];
                return r
            }
        }
        class Zs extends Ys {
            constructor(e, t, n, i) {
                super(e, t, n, i)
            }
            interpolate_(e, t, n, i) {
                const r = this.resultBuffer
                  , a = this.sampleValues
                  , s = this.valueSize
                  , o = e * s
                  , l = o - s
                  , c = (n - t) / (i - t)
                  , h = 1 - c;
                for (let e = 0; e !== s; ++e)
                    r[e] = a[l + e] * h + a[o + e] * c;
                return r
            }
        }
        class Js extends Ys {
            constructor(e, t, n, i) {
                super(e, t, n, i)
            }
            interpolate_(e) {
                return this.copySampleValue_(e - 1)
            }
        }
        class $s {
            constructor(e, t, n, i) {
                if (void 0 === e)
                    throw new Error("THREE.KeyframeTrack: track name is undefined");
                if (void 0 === t || 0 === t.length)
                    throw new Error("THREE.KeyframeTrack: no keyframes in track named " + e);
                this.name = e,
                this.times = Gs(t, this.TimeBufferType),
                this.values = Gs(n, this.ValueBufferType),
                this.setInterpolation(i || this.DefaultInterpolation)
            }
            static toJSON(e) {
                const t = e.constructor;
                let n;
                if (t.toJSON !== this.toJSON)
                    n = t.toJSON(e);
                else {
                    n = {
                        name: e.name,
                        times: Gs(e.times, Array),
                        values: Gs(e.values, Array)
                    };
                    const t = e.getInterpolation();
                    t !== e.DefaultInterpolation && (n.interpolation = t)
                }
                return n.type = e.ValueTypeName,
                n
            }
            InterpolantFactoryMethodDiscrete(e) {
                return new Js(this.times,this.values,this.getValueSize(),e)
            }
            InterpolantFactoryMethodLinear(e) {
                return new Zs(this.times,this.values,this.getValueSize(),e)
            }
            InterpolantFactoryMethodSmooth(e) {
                return new Xs(this.times,this.values,this.getValueSize(),e)
            }
            setInterpolation(e) {
                let t;
                switch (e) {
                case ht:
                    t = this.InterpolantFactoryMethodDiscrete;
                    break;
                case dt:
                    t = this.InterpolantFactoryMethodLinear;
                    break;
                case ut:
                    t = this.InterpolantFactoryMethodSmooth
                }
                if (void 0 === t) {
                    const t = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
                    if (void 0 === this.createInterpolant) {
                        if (e === this.DefaultInterpolation)
                            throw new Error(t);
                        this.setInterpolation(this.DefaultInterpolation)
                    }
                    return console.warn("THREE.KeyframeTrack:", t),
                    this
                }
                return this.createInterpolant = t,
                this
            }
            getInterpolation() {
                switch (this.createInterpolant) {
                case this.InterpolantFactoryMethodDiscrete:
                    return ht;
                case this.InterpolantFactoryMethodLinear:
                    return dt;
                case this.InterpolantFactoryMethodSmooth:
                    return ut
                }
            }
            getValueSize() {
                return this.values.length / this.times.length
            }
            shift(e) {
                if (0 !== e) {
                    const t = this.times;
                    for (let n = 0, i = t.length; n !== i; ++n)
                        t[n] += e
                }
                return this
            }
            scale(e) {
                if (1 !== e) {
                    const t = this.times;
                    for (let n = 0, i = t.length; n !== i; ++n)
                        t[n] *= e
                }
                return this
            }
            trim(e, t) {
                const n = this.times
                  , i = n.length;
                let r = 0
                  , a = i - 1;
                for (; r !== i && n[r] < e; )
                    ++r;
                for (; -1 !== a && n[a] > t; )
                    --a;
                if (++a,
                0 !== r || a !== i) {
                    r >= a && (a = Math.max(a, 1),
                    r = a - 1);
                    const e = this.getValueSize();
                    this.times = n.slice(r, a),
                    this.values = this.values.slice(r * e, a * e)
                }
                return this
            }
            validate() {
                let e = !0;
                const t = this.getValueSize();
                t - Math.floor(t) != 0 && (console.error("THREE.KeyframeTrack: Invalid value size in track.", this),
                e = !1);
                const n = this.times
                  , i = this.values
                  , r = n.length;
                0 === r && (console.error("THREE.KeyframeTrack: Track is empty.", this),
                e = !1);
                let a = null;
                for (let t = 0; t !== r; t++) {
                    const i = n[t];
                    if ("number" == typeof i && isNaN(i)) {
                        console.error("THREE.KeyframeTrack: Time is not a valid number.", this, t, i),
                        e = !1;
                        break
                    }
                    if (null !== a && a > i) {
                        console.error("THREE.KeyframeTrack: Out of order keys.", this, t, i, a),
                        e = !1;
                        break
                    }
                    a = i
                }
                if (void 0 !== i && js(i))
                    for (let t = 0, n = i.length; t !== n; ++t) {
                        const n = i[t];
                        if (isNaN(n)) {
                            console.error("THREE.KeyframeTrack: Value is not a valid number.", this, t, n),
                            e = !1;
                            break
                        }
                    }
                return e
            }
            optimize() {
                const e = this.times.slice()
                  , t = this.values.slice()
                  , n = this.getValueSize()
                  , i = this.getInterpolation() === ut
                  , r = e.length - 1;
                let a = 1;
                for (let s = 1; s < r; ++s) {
                    let r = !1;
                    const o = e[s];
                    if (o !== e[s + 1] && (1 !== s || o !== e[0]))
                        if (i)
                            r = !0;
                        else {
                            const e = s * n
                              , i = e - n
                              , a = e + n;
                            for (let s = 0; s !== n; ++s) {
                                const n = t[e + s];
                                if (n !== t[i + s] || n !== t[a + s]) {
                                    r = !0;
                                    break
                                }
                            }
                        }
                    if (r) {
                        if (s !== a) {
                            e[a] = e[s];
                            const i = s * n
                              , r = a * n;
                            for (let e = 0; e !== n; ++e)
                                t[r + e] = t[i + e]
                        }
                        ++a
                    }
                }
                if (r > 0) {
                    e[a] = e[r];
                    for (let e = r * n, i = a * n, s = 0; s !== n; ++s)
                        t[i + s] = t[e + s];
                    ++a
                }
                return a !== e.length ? (this.times = e.slice(0, a),
                this.values = t.slice(0, a * n)) : (this.times = e,
                this.values = t),
                this
            }
            clone() {
                const e = this.times.slice()
                  , t = this.values.slice()
                  , n = new (0,
                this.constructor)(this.name,e,t);
                return n.createInterpolant = this.createInterpolant,
                n
            }
        }
        $s.prototype.TimeBufferType = Float32Array,
        $s.prototype.ValueBufferType = Float32Array,
        $s.prototype.DefaultInterpolation = dt;
        class eo extends $s {
            constructor(e, t, n) {
                super(e, t, n)
            }
        }
        eo.prototype.ValueTypeName = "bool",
        eo.prototype.ValueBufferType = Array,
        eo.prototype.DefaultInterpolation = ht,
        eo.prototype.InterpolantFactoryMethodLinear = void 0,
        eo.prototype.InterpolantFactoryMethodSmooth = void 0;
        class to extends $s {
        }
        to.prototype.ValueTypeName = "color";
        class no extends $s {
        }
        no.prototype.ValueTypeName = "number";
        class io extends Ys {
            constructor(e, t, n, i) {
                super(e, t, n, i)
            }
            interpolate_(e, t, n, i) {
                const r = this.resultBuffer
                  , a = this.sampleValues
                  , s = this.valueSize
                  , o = (n - t) / (i - t);
                let l = e * s;
                for (let e = l + s; l !== e; l += 4)
                    yn.slerpFlat(r, 0, a, l - s, a, l, o);
                return r
            }
        }
        class ro extends $s {
            InterpolantFactoryMethodLinear(e) {
                return new io(this.times,this.values,this.getValueSize(),e)
            }
        }
        ro.prototype.ValueTypeName = "quaternion",
        ro.prototype.InterpolantFactoryMethodSmooth = void 0;
        class ao extends $s {
            constructor(e, t, n) {
                super(e, t, n)
            }
        }
        ao.prototype.ValueTypeName = "string",
        ao.prototype.ValueBufferType = Array,
        ao.prototype.DefaultInterpolation = ht,
        ao.prototype.InterpolantFactoryMethodLinear = void 0,
        ao.prototype.InterpolantFactoryMethodSmooth = void 0;
        class so extends $s {
        }
        so.prototype.ValueTypeName = "vector";
        class oo {
            constructor(e="", t=-1, n=[], i=2500) {
                this.name = e,
                this.tracks = n,
                this.duration = t,
                this.blendMode = i,
                this.uuid = Ot(),
                this.duration < 0 && this.resetDuration()
            }
            static parse(e) {
                const t = []
                  , n = e.tracks
                  , i = 1 / (e.fps || 1);
                for (let e = 0, r = n.length; e !== r; ++e)
                    t.push(lo(n[e]).scale(i));
                const r = new this(e.name,e.duration,t,e.blendMode);
                return r.uuid = e.uuid,
                r
            }
            static toJSON(e) {
                const t = []
                  , n = e.tracks
                  , i = {
                    name: e.name,
                    duration: e.duration,
                    tracks: t,
                    uuid: e.uuid,
                    blendMode: e.blendMode
                };
                for (let e = 0, i = n.length; e !== i; ++e)
                    t.push($s.toJSON(n[e]));
                return i
            }
            static CreateFromMorphTargetSequence(e, t, n, i) {
                const r = t.length
                  , a = [];
                for (let e = 0; e < r; e++) {
                    let s = []
                      , o = [];
                    s.push((e + r - 1) % r, e, (e + 1) % r),
                    o.push(0, 1, 0);
                    const l = Qs(s);
                    s = Ks(s, 1, l),
                    o = Ks(o, 1, l),
                    i || 0 !== s[0] || (s.push(r),
                    o.push(o[0])),
                    a.push(new no(".morphTargetInfluences[" + t[e].name + "]",s,o).scale(1 / n))
                }
                return new this(e,-1,a)
            }
            static findByName(e, t) {
                let n = e;
                if (!Array.isArray(e)) {
                    const t = e;
                    n = t.geometry && t.geometry.animations || t.animations
                }
                for (let e = 0; e < n.length; e++)
                    if (n[e].name === t)
                        return n[e];
                return null
            }
            static CreateClipsFromMorphTargetSequences(e, t, n) {
                const i = {}
                  , r = /^([\w-]*?)([\d]+)$/;
                for (let t = 0, n = e.length; t < n; t++) {
                    const n = e[t]
                      , a = n.name.match(r);
                    if (a && a.length > 1) {
                        const e = a[1];
                        let t = i[e];
                        t || (i[e] = t = []),
                        t.push(n)
                    }
                }
                const a = [];
                for (const e in i)
                    a.push(this.CreateFromMorphTargetSequence(e, i[e], t, n));
                return a
            }
            static parseAnimation(e, t) {
                if (!e)
                    return console.error("THREE.AnimationClip: No animation in JSONLoader data."),
                    null;
                const n = function(e, t, n, i, r) {
                    if (0 !== n.length) {
                        const a = []
                          , s = [];
                        qs(n, a, s, i),
                        0 !== a.length && r.push(new e(t,a,s))
                    }
                }
                  , i = []
                  , r = e.name || "default"
                  , a = e.fps || 30
                  , s = e.blendMode;
                let o = e.length || -1;
                const l = e.hierarchy || [];
                for (let e = 0; e < l.length; e++) {
                    const r = l[e].keys;
                    if (r && 0 !== r.length)
                        if (r[0].morphTargets) {
                            const e = {};
                            let t;
                            for (t = 0; t < r.length; t++)
                                if (r[t].morphTargets)
                                    for (let n = 0; n < r[t].morphTargets.length; n++)
                                        e[r[t].morphTargets[n]] = -1;
                            for (const n in e) {
                                const e = []
                                  , a = [];
                                for (let i = 0; i !== r[t].morphTargets.length; ++i) {
                                    const i = r[t];
                                    e.push(i.time),
                                    a.push(i.morphTarget === n ? 1 : 0)
                                }
                                i.push(new no(".morphTargetInfluence[" + n + "]",e,a))
                            }
                            o = e.length * a
                        } else {
                            const a = ".bones[" + t[e].name + "]";
                            n(so, a + ".position", r, "pos", i),
                            n(ro, a + ".quaternion", r, "rot", i),
                            n(so, a + ".scale", r, "scl", i)
                        }
                }
                if (0 === i.length)
                    return null;
                return new this(r,o,i,s)
            }
            resetDuration() {
                let e = 0;
                for (let t = 0, n = this.tracks.length; t !== n; ++t) {
                    const n = this.tracks[t];
                    e = Math.max(e, n.times[n.times.length - 1])
                }
                return this.duration = e,
                this
            }
            trim() {
                for (let e = 0; e < this.tracks.length; e++)
                    this.tracks[e].trim(0, this.duration);
                return this
            }
            validate() {
                let e = !0;
                for (let t = 0; t < this.tracks.length; t++)
                    e = e && this.tracks[t].validate();
                return e
            }
            optimize() {
                for (let e = 0; e < this.tracks.length; e++)
                    this.tracks[e].optimize();
                return this
            }
            clone() {
                const e = [];
                for (let t = 0; t < this.tracks.length; t++)
                    e.push(this.tracks[t].clone());
                return new this.constructor(this.name,this.duration,e,this.blendMode)
            }
            toJSON() {
                return this.constructor.toJSON(this)
            }
        }
        function lo(e) {
            if (void 0 === e.type)
                throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");
            const t = function(e) {
                switch (e.toLowerCase()) {
                case "scalar":
                case "double":
                case "float":
                case "number":
                case "integer":
                    return no;
                case "vector":
                case "vector2":
                case "vector3":
                case "vector4":
                    return so;
                case "color":
                    return to;
                case "quaternion":
                    return ro;
                case "bool":
                case "boolean":
                    return eo;
                case "string":
                    return ao
                }
                throw new Error("THREE.KeyframeTrack: Unsupported typeName: " + e)
            }(e.type);
            if (void 0 === e.times) {
                const t = []
                  , n = [];
                qs(e.keys, t, n, "value"),
                e.times = t,
                e.values = n
            }
            return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
        }
        const co = {
            enabled: !1,
            files: {},
            add: function(e, t) {
                !1 !== this.enabled && (this.files[e] = t)
            },
            get: function(e) {
                if (!1 !== this.enabled)
                    return this.files[e]
            },
            remove: function(e) {
                delete this.files[e]
            },
            clear: function() {
                this.files = {}
            }
        };
        class ho {
            constructor(e, t, n) {
                const i = this;
                let r, a = !1, s = 0, o = 0;
                const l = [];
                this.onStart = void 0,
                this.onLoad = e,
                this.onProgress = t,
                this.onError = n,
                this.itemStart = function(e) {
                    o++,
                    !1 === a && void 0 !== i.onStart && i.onStart(e, s, o),
                    a = !0
                }
                ,
                this.itemEnd = function(e) {
                    s++,
                    void 0 !== i.onProgress && i.onProgress(e, s, o),
                    s === o && (a = !1,
                    void 0 !== i.onLoad && i.onLoad())
                }
                ,
                this.itemError = function(e) {
                    void 0 !== i.onError && i.onError(e)
                }
                ,
                this.resolveURL = function(e) {
                    return r ? r(e) : e
                }
                ,
                this.setURLModifier = function(e) {
                    return r = e,
                    this
                }
                ,
                this.addHandler = function(e, t) {
                    return l.push(e, t),
                    this
                }
                ,
                this.removeHandler = function(e) {
                    const t = l.indexOf(e);
                    return -1 !== t && l.splice(t, 2),
                    this
                }
                ,
                this.getHandler = function(e) {
                    for (let t = 0, n = l.length; t < n; t += 2) {
                        const n = l[t]
                          , i = l[t + 1];
                        if (n.global && (n.lastIndex = 0),
                        n.test(e))
                            return i
                    }
                    return null
                }
            }
        }
        const uo = new ho;
        class po {
            constructor(e) {
                this.manager = void 0 !== e ? e : uo,
                this.crossOrigin = "anonymous",
                this.withCredentials = !1,
                this.path = "",
                this.resourcePath = "",
                this.requestHeader = {}
            }
            load() {}
            loadAsync(e, t) {
                const n = this;
                return new Promise((function(i, r) {
                    n.load(e, i, t, r)
                }
                ))
            }
            parse() {}
            setCrossOrigin(e) {
                return this.crossOrigin = e,
                this
            }
            setWithCredentials(e) {
                return this.withCredentials = e,
                this
            }
            setPath(e) {
                return this.path = e,
                this
            }
            setResourcePath(e) {
                return this.resourcePath = e,
                this
            }
            setRequestHeader(e) {
                return this.requestHeader = e,
                this
            }
        }
        po.DEFAULT_MATERIAL_NAME = "__DEFAULT";
        const fo = {};
        class mo extends Error {
            constructor(e, t) {
                super(e),
                this.response = t
            }
        }
        class go extends po {
            constructor(e) {
                super(e)
            }
            load(e, t, n, i) {
                void 0 === e && (e = ""),
                void 0 !== this.path && (e = this.path + e),
                e = this.manager.resolveURL(e);
                const r = co.get(e);
                if (void 0 !== r)
                    return this.manager.itemStart(e),
                    setTimeout(( () => {
                        t && t(r),
                        this.manager.itemEnd(e)
                    }
                    ), 0),
                    r;
                if (void 0 !== fo[e])
                    return void fo[e].push({
                        onLoad: t,
                        onProgress: n,
                        onError: i
                    });
                fo[e] = [],
                fo[e].push({
                    onLoad: t,
                    onProgress: n,
                    onError: i
                });
                const a = new Request(e,{
                    headers: new Headers(this.requestHeader),
                    credentials: this.withCredentials ? "include" : "same-origin"
                })
                  , s = this.mimeType
                  , o = this.responseType;
                fetch(a).then((t => {
                    if (200 === t.status || 0 === t.status) {
                        if (0 === t.status && console.warn("THREE.FileLoader: HTTP Status 0 received."),
                        "undefined" == typeof ReadableStream || void 0 === t.body || void 0 === t.body.getReader)
                            return t;
                        const n = fo[e]
                          , i = t.body.getReader()
                          , r = t.headers.get("X-File-Size") || t.headers.get("Content-Length")
                          , a = r ? parseInt(r) : 0
                          , s = 0 !== a;
                        let o = 0;
                        const l = new ReadableStream({
                            start(e) {
                                !function t() {
                                    i.read().then(( ({done: i, value: r}) => {
                                        if (i)
                                            e.close();
                                        else {
                                            o += r.byteLength;
                                            const i = new ProgressEvent("progress",{
                                                lengthComputable: s,
                                                loaded: o,
                                                total: a
                                            });
                                            for (let e = 0, t = n.length; e < t; e++) {
                                                const t = n[e];
                                                t.onProgress && t.onProgress(i)
                                            }
                                            e.enqueue(r),
                                            t()
                                        }
                                    }
                                    ), (t => {
                                        e.error(t)
                                    }
                                    ))
                                }()
                            }
                        });
                        return new Response(l)
                    }
                    throw new mo(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)
                }
                )).then((e => {
                    switch (o) {
                    case "arraybuffer":
                        return e.arrayBuffer();
                    case "blob":
                        return e.blob();
                    case "document":
                        return e.text().then((e => (new DOMParser).parseFromString(e, s)));
                    case "json":
                        return e.json();
                    default:
                        if (void 0 === s)
                            return e.text();
                        {
                            const t = /charset="?([^;"\s]*)"?/i.exec(s)
                              , n = t && t[1] ? t[1].toLowerCase() : void 0
                              , i = new TextDecoder(n);
                            return e.arrayBuffer().then((e => i.decode(e)))
                        }
                    }
                }
                )).then((t => {
                    co.add(e, t);
                    const n = fo[e];
                    delete fo[e];
                    for (let e = 0, i = n.length; e < i; e++) {
                        const i = n[e];
                        i.onLoad && i.onLoad(t)
                    }
                }
                )).catch((t => {
                    const n = fo[e];
                    if (void 0 === n)
                        throw this.manager.itemError(e),
                        t;
                    delete fo[e];
                    for (let e = 0, i = n.length; e < i; e++) {
                        const i = n[e];
                        i.onError && i.onError(t)
                    }
                    this.manager.itemError(e)
                }
                )).finally(( () => {
                    this.manager.itemEnd(e)
                }
                )),
                this.manager.itemStart(e)
            }
            setResponseType(e) {
                return this.responseType = e,
                this
            }
            setMimeType(e) {
                return this.mimeType = e,
                this
            }
        }
        class vo extends po {
            constructor(e) {
                super(e)
            }
            load(e, t, n, i) {
                void 0 !== this.path && (e = this.path + e),
                e = this.manager.resolveURL(e);
                const r = this
                  , a = co.get(e);
                if (void 0 !== a)
                    return r.manager.itemStart(e),
                    setTimeout((function() {
                        t && t(a),
                        r.manager.itemEnd(e)
                    }
                    ), 0),
                    a;
                const s = Xt("img");
                function o() {
                    c(),
                    co.add(e, this),
                    t && t(this),
                    r.manager.itemEnd(e)
                }
                function l(t) {
                    c(),
                    i && i(t),
                    r.manager.itemError(e),
                    r.manager.itemEnd(e)
                }
                function c() {
                    s.removeEventListener("load", o, !1),
                    s.removeEventListener("error", l, !1)
                }
                return s.addEventListener("load", o, !1),
                s.addEventListener("error", l, !1),
                "data:" !== e.slice(0, 5) && void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
                r.manager.itemStart(e),
                s.src = e,
                s
            }
        }
        class wo extends po {
            constructor(e) {
                super(e)
            }
            load(e, t, n, i) {
                const r = new pn
                  , a = new vo(this.manager);
                return a.setCrossOrigin(this.crossOrigin),
                a.setPath(this.path),
                a.load(e, (function(e) {
                    r.image = e,
                    r.needsUpdate = !0,
                    void 0 !== t && t(r)
                }
                ), n, i),
                r
            }
        }
        class yo extends ki {
            constructor(e, t=1) {
                super(),
                this.isLight = !0,
                this.type = "Light",
                this.color = new Hi(e),
                this.intensity = t
            }
            dispose() {}
            copy(e, t) {
                return super.copy(e, t),
                this.color.copy(e.color),
                this.intensity = e.intensity,
                this
            }
            toJSON(e) {
                const t = super.toJSON(e);
                return t.object.color = this.color.getHex(),
                t.object.intensity = this.intensity,
                void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
                void 0 !== this.distance && (t.object.distance = this.distance),
                void 0 !== this.angle && (t.object.angle = this.angle),
                void 0 !== this.decay && (t.object.decay = this.decay),
                void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
                void 0 !== this.shadow && (t.object.shadow = this.shadow.toJSON()),
                void 0 !== this.target && (t.object.target = this.target.uuid),
                t
            }
        }
        class bo extends yo {
            constructor(e, t, n) {
                super(e, n),
                this.isHemisphereLight = !0,
                this.type = "HemisphereLight",
                this.position.copy(ki.DEFAULT_UP),
                this.updateMatrix(),
                this.groundColor = new Hi(t)
            }
            copy(e, t) {
                return super.copy(e, t),
                this.groundColor.copy(e.groundColor),
                this
            }
        }
        const Ao = new Xn
          , xo = new bn
          , ko = new bn;
        class Eo {
            constructor(e) {
                this.camera = e,
                this.intensity = 1,
                this.bias = 0,
                this.normalBias = 0,
                this.radius = 1,
                this.blurSamples = 8,
                this.mapSize = new Qt(512,512),
                this.map = null,
                this.mapPass = null,
                this.matrix = new Xn,
                this.autoUpdate = !0,
                this.needsUpdate = !1,
                this._frustum = new ba,
                this._frameExtents = new Qt(1,1),
                this._viewportCount = 1,
                this._viewports = [new fn(0,0,1,1)]
            }
            getViewportCount() {
                return this._viewportCount
            }
            getFrustum() {
                return this._frustum
            }
            updateMatrices(e) {
                const t = this.camera
                  , n = this.matrix;
                xo.setFromMatrixPosition(e.matrixWorld),
                t.position.copy(xo),
                ko.setFromMatrixPosition(e.target.matrixWorld),
                t.lookAt(ko),
                t.updateMatrixWorld(),
                Ao.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
                this._frustum.setFromProjectionMatrix(Ao),
                n.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
                n.multiply(Ao)
            }
            getViewport(e) {
                return this._viewports[e]
            }
            getFrameExtents() {
                return this._frameExtents
            }
            dispose() {
                this.map && this.map.dispose(),
                this.mapPass && this.mapPass.dispose()
            }
            copy(e) {
                return this.camera = e.camera.clone(),
                this.intensity = e.intensity,
                this.bias = e.bias,
                this.radius = e.radius,
                this.mapSize.copy(e.mapSize),
                this
            }
            clone() {
                return (new this.constructor).copy(this)
            }
            toJSON() {
                const e = {};
                return 1 !== this.intensity && (e.intensity = this.intensity),
                0 !== this.bias && (e.bias = this.bias),
                0 !== this.normalBias && (e.normalBias = this.normalBias),
                1 !== this.radius && (e.radius = this.radius),
                512 === this.mapSize.x && 512 === this.mapSize.y || (e.mapSize = this.mapSize.toArray()),
                e.camera = this.camera.toJSON(!1).object,
                delete e.camera.matrix,
                e
            }
        }
        class So extends Eo {
            constructor() {
                super(new Ir(50,1,.5,500)),
                this.isSpotLightShadow = !0,
                this.focus = 1
            }
            updateMatrices(e) {
                const t = this.camera
                  , n = 2 * zt * e.angle * this.focus
                  , i = this.mapSize.width / this.mapSize.height
                  , r = e.distance || t.far;
                n === t.fov && i === t.aspect && r === t.far || (t.fov = n,
                t.aspect = i,
                t.far = r,
                t.updateProjectionMatrix()),
                super.updateMatrices(e)
            }
            copy(e) {
                return super.copy(e),
                this.focus = e.focus,
                this
            }
        }
        class Mo extends yo {
            constructor(e, t, n=0, i=Math.PI / 3, r=0, a=2) {
                super(e, t),
                this.isSpotLight = !0,
                this.type = "SpotLight",
                this.position.copy(ki.DEFAULT_UP),
                this.updateMatrix(),
                this.target = new ki,
                this.distance = n,
                this.angle = i,
                this.penumbra = r,
                this.decay = a,
                this.map = null,
                this.shadow = new So
            }
            get power() {
                return this.intensity * Math.PI
            }
            set power(e) {
                this.intensity = e / Math.PI
            }
            dispose() {
                this.shadow.dispose()
            }
            copy(e, t) {
                return super.copy(e, t),
                this.distance = e.distance,
                this.angle = e.angle,
                this.penumbra = e.penumbra,
                this.decay = e.decay,
                this.target = e.target.clone(),
                this.shadow = e.shadow.clone(),
                this
            }
        }
        const _o = new Xn
          , To = new bn
          , Co = new bn;
        class Po extends Eo {
            constructor() {
                super(new Ir(90,1,.5,500)),
                this.isPointLightShadow = !0,
                this._frameExtents = new Qt(4,2),
                this._viewportCount = 6,
                this._viewports = [new fn(2,1,1,1), new fn(0,1,1,1), new fn(3,1,1,1), new fn(1,1,1,1), new fn(3,0,1,1), new fn(1,0,1,1)],
                this._cubeDirections = [new bn(1,0,0), new bn(-1,0,0), new bn(0,0,1), new bn(0,0,-1), new bn(0,1,0), new bn(0,-1,0)],
                this._cubeUps = [new bn(0,1,0), new bn(0,1,0), new bn(0,1,0), new bn(0,1,0), new bn(0,0,1), new bn(0,0,-1)]
            }
            updateMatrices(e, t=0) {
                const n = this.camera
                  , i = this.matrix
                  , r = e.distance || n.far;
                r !== n.far && (n.far = r,
                n.updateProjectionMatrix()),
                To.setFromMatrixPosition(e.matrixWorld),
                n.position.copy(To),
                Co.copy(n.position),
                Co.add(this._cubeDirections[t]),
                n.up.copy(this._cubeUps[t]),
                n.lookAt(Co),
                n.updateMatrixWorld(),
                i.makeTranslation(-To.x, -To.y, -To.z),
                _o.multiplyMatrices(n.projectionMatrix, n.matrixWorldInverse),
                this._frustum.setFromProjectionMatrix(_o)
            }
        }
        class Io extends yo {
            constructor(e, t, n=0, i=2) {
                super(e, t),
                this.isPointLight = !0,
                this.type = "PointLight",
                this.distance = n,
                this.decay = i,
                this.shadow = new Po
            }
            get power() {
                return 4 * this.intensity * Math.PI
            }
            set power(e) {
                this.intensity = e / (4 * Math.PI)
            }
            dispose() {
                this.shadow.dispose()
            }
            copy(e, t) {
                return super.copy(e, t),
                this.distance = e.distance,
                this.decay = e.decay,
                this.shadow = e.shadow.clone(),
                this
            }
        }
        class Ro extends _r {
            constructor(e=-1, t=1, n=1, i=-1, r=.1, a=2e3) {
                super(),
                this.isOrthographicCamera = !0,
                this.type = "OrthographicCamera",
                this.zoom = 1,
                this.view = null,
                this.left = e,
                this.right = t,
                this.top = n,
                this.bottom = i,
                this.near = r,
                this.far = a,
                this.updateProjectionMatrix()
            }
            copy(e, t) {
                return super.copy(e, t),
                this.left = e.left,
                this.right = e.right,
                this.top = e.top,
                this.bottom = e.bottom,
                this.near = e.near,
                this.far = e.far,
                this.zoom = e.zoom,
                this.view = null === e.view ? null : Object.assign({}, e.view),
                this
            }
            setViewOffset(e, t, n, i, r, a) {
                null === this.view && (this.view = {
                    enabled: !0,
                    fullWidth: 1,
                    fullHeight: 1,
                    offsetX: 0,
                    offsetY: 0,
                    width: 1,
                    height: 1
                }),
                this.view.enabled = !0,
                this.view.fullWidth = e,
                this.view.fullHeight = t,
                this.view.offsetX = n,
                this.view.offsetY = i,
                this.view.width = r,
                this.view.height = a,
                this.updateProjectionMatrix()
            }
            clearViewOffset() {
                null !== this.view && (this.view.enabled = !1),
                this.updateProjectionMatrix()
            }
            updateProjectionMatrix() {
                const e = (this.right - this.left) / (2 * this.zoom)
                  , t = (this.top - this.bottom) / (2 * this.zoom)
                  , n = (this.right + this.left) / 2
                  , i = (this.top + this.bottom) / 2;
                let r = n - e
                  , a = n + e
                  , s = i + t
                  , o = i - t;
                if (null !== this.view && this.view.enabled) {
                    const e = (this.right - this.left) / this.view.fullWidth / this.zoom
                      , t = (this.top - this.bottom) / this.view.fullHeight / this.zoom;
                    r += e * this.view.offsetX,
                    a = r + e * this.view.width,
                    s -= t * this.view.offsetY,
                    o = s - t * this.view.height
                }
                this.projectionMatrix.makeOrthographic(r, a, s, o, this.near, this.far, this.coordinateSystem),
                this.projectionMatrixInverse.copy(this.projectionMatrix).invert()
            }
            toJSON(e) {
                const t = super.toJSON(e);
                return t.object.zoom = this.zoom,
                t.object.left = this.left,
                t.object.right = this.right,
                t.object.top = this.top,
                t.object.bottom = this.bottom,
                t.object.near = this.near,
                t.object.far = this.far,
                null !== this.view && (t.object.view = Object.assign({}, this.view)),
                t
            }
        }
        class Lo extends Eo {
            constructor() {
                super(new Ro(-5,5,5,-5,.5,500)),
                this.isDirectionalLightShadow = !0
            }
        }
        class Do extends yo {
            constructor(e, t) {
                super(e, t),
                this.isDirectionalLight = !0,
                this.type = "DirectionalLight",
                this.position.copy(ki.DEFAULT_UP),
                this.updateMatrix(),
                this.target = new ki,
                this.shadow = new Lo
            }
            dispose() {
                this.shadow.dispose()
            }
            copy(e) {
                return super.copy(e),
                this.target = e.target.clone(),
                this.shadow = e.shadow.clone(),
                this
            }
        }
        class No {
            static decodeText(e) {
                if (console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),
                "undefined" != typeof TextDecoder)
                    return (new TextDecoder).decode(e);
                let t = "";
                for (let n = 0, i = e.length; n < i; n++)
                    t += String.fromCharCode(e[n]);
                try {
                    return decodeURIComponent(escape(t))
                } catch (e) {
                    return t
                }
            }
            static extractUrlBase(e) {
                const t = e.lastIndexOf("/");
                return -1 === t ? "./" : e.slice(0, t + 1)
            }
            static resolveURL(e, t) {
                return "string" != typeof e || "" === e ? "" : (/^https?:\/\//i.test(t) && /^\//.test(e) && (t = t.replace(/(^https?:\/\/[^\/]+).*/i, "$1")),
                /^(https?:)?\/\//i.test(e) || /^data:.*,.*$/i.test(e) || /^blob:.*$/i.test(e) ? e : t + e)
            }
        }
        class Bo extends po {
            constructor(e) {
                super(e),
                this.isImageBitmapLoader = !0,
                "undefined" == typeof createImageBitmap && console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),
                "undefined" == typeof fetch && console.warn("THREE.ImageBitmapLoader: fetch() not supported."),
                this.options = {
                    premultiplyAlpha: "none"
                }
            }
            setOptions(e) {
                return this.options = e,
                this
            }
            load(e, t, n, i) {
                void 0 === e && (e = ""),
                void 0 !== this.path && (e = this.path + e),
                e = this.manager.resolveURL(e);
                const r = this
                  , a = co.get(e);
                if (void 0 !== a)
                    return r.manager.itemStart(e),
                    a.then ? void a.then((n => {
                        t && t(n),
                        r.manager.itemEnd(e)
                    }
                    )).catch((e => {
                        i && i(e)
                    }
                    )) : (setTimeout((function() {
                        t && t(a),
                        r.manager.itemEnd(e)
                    }
                    ), 0),
                    a);
                const s = {};
                s.credentials = "anonymous" === this.crossOrigin ? "same-origin" : "include",
                s.headers = this.requestHeader;
                const o = fetch(e, s).then((function(e) {
                    return e.blob()
                }
                )).then((function(e) {
                    return createImageBitmap(e, Object.assign(r.options, {
                        colorSpaceConversion: "none"
                    }))
                }
                )).then((function(n) {
                    return co.add(e, n),
                    t && t(n),
                    r.manager.itemEnd(e),
                    n
                }
                )).catch((function(t) {
                    i && i(t),
                    co.remove(e),
                    r.manager.itemError(e),
                    r.manager.itemEnd(e)
                }
                ));
                co.add(e, o),
                r.manager.itemStart(e)
            }
        }
        class Uo extends Ir {
            constructor(e=[]) {
                super(),
                this.isArrayCamera = !0,
                this.cameras = e,
                this.index = 0
            }
        }
        const zo = "\\[\\]\\.:\\/"
          , Oo = new RegExp("[" + zo + "]","g")
          , Fo = "[^" + zo + "]"
          , Wo = "[^" + zo.replace("\\.", "") + "]"
          , Ho = new RegExp("^" + /((?:WC+[\/:])*)/.source.replace("WC", Fo) + /(WCOD+)?/.source.replace("WCOD", Wo) + /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", Fo) + /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", Fo) + "$")
          , Vo = ["material", "materials", "bones", "map"];
        class Go {
            constructor(e, t, n) {
                this.path = t,
                this.parsedPath = n || Go.parseTrackName(t),
                this.node = Go.findNode(e, this.parsedPath.nodeName),
                this.rootNode = e,
                this.getValue = this._getValue_unbound,
                this.setValue = this._setValue_unbound
            }
            static create(e, t, n) {
                return e && e.isAnimationObjectGroup ? new Go.Composite(e,t,n) : new Go(e,t,n)
            }
            static sanitizeNodeName(e) {
                return e.replace(/\s/g, "_").replace(Oo, "")
            }
            static parseTrackName(e) {
                const t = Ho.exec(e);
                if (null === t)
                    throw new Error("PropertyBinding: Cannot parse trackName: " + e);
                const n = {
                    nodeName: t[2],
                    objectName: t[3],
                    objectIndex: t[4],
                    propertyName: t[5],
                    propertyIndex: t[6]
                }
                  , i = n.nodeName && n.nodeName.lastIndexOf(".");
                if (void 0 !== i && -1 !== i) {
                    const e = n.nodeName.substring(i + 1);
                    -1 !== Vo.indexOf(e) && (n.nodeName = n.nodeName.substring(0, i),
                    n.objectName = e)
                }
                if (null === n.propertyName || 0 === n.propertyName.length)
                    throw new Error("PropertyBinding: can not parse propertyName from trackName: " + e);
                return n
            }
            static findNode(e, t) {
                if (void 0 === t || "" === t || "." === t || -1 === t || t === e.name || t === e.uuid)
                    return e;
                if (e.skeleton) {
                    const n = e.skeleton.getBoneByName(t);
                    if (void 0 !== n)
                        return n
                }
                if (e.children) {
                    const n = function(e) {
                        for (let i = 0; i < e.length; i++) {
                            const r = e[i];
                            if (r.name === t || r.uuid === t)
                                return r;
                            const a = n(r.children);
                            if (a)
                                return a
                        }
                        return null
                    }
                      , i = n(e.children);
                    if (i)
                        return i
                }
                return null
            }
            _getValue_unavailable() {}
            _setValue_unavailable() {}
            _getValue_direct(e, t) {
                e[t] = this.targetObject[this.propertyName]
            }
            _getValue_array(e, t) {
                const n = this.resolvedProperty;
                for (let i = 0, r = n.length; i !== r; ++i)
                    e[t++] = n[i]
            }
            _getValue_arrayElement(e, t) {
                e[t] = this.resolvedProperty[this.propertyIndex]
            }
            _getValue_toArray(e, t) {
                this.resolvedProperty.toArray(e, t)
            }
            _setValue_direct(e, t) {
                this.targetObject[this.propertyName] = e[t]
            }
            _setValue_direct_setNeedsUpdate(e, t) {
                this.targetObject[this.propertyName] = e[t],
                this.targetObject.needsUpdate = !0
            }
            _setValue_direct_setMatrixWorldNeedsUpdate(e, t) {
                this.targetObject[this.propertyName] = e[t],
                this.targetObject.matrixWorldNeedsUpdate = !0
            }
            _setValue_array(e, t) {
                const n = this.resolvedProperty;
                for (let i = 0, r = n.length; i !== r; ++i)
                    n[i] = e[t++]
            }
            _setValue_array_setNeedsUpdate(e, t) {
                const n = this.resolvedProperty;
                for (let i = 0, r = n.length; i !== r; ++i)
                    n[i] = e[t++];
                this.targetObject.needsUpdate = !0
            }
            _setValue_array_setMatrixWorldNeedsUpdate(e, t) {
                const n = this.resolvedProperty;
                for (let i = 0, r = n.length; i !== r; ++i)
                    n[i] = e[t++];
                this.targetObject.matrixWorldNeedsUpdate = !0
            }
            _setValue_arrayElement(e, t) {
                this.resolvedProperty[this.propertyIndex] = e[t]
            }
            _setValue_arrayElement_setNeedsUpdate(e, t) {
                this.resolvedProperty[this.propertyIndex] = e[t],
                this.targetObject.needsUpdate = !0
            }
            _setValue_arrayElement_setMatrixWorldNeedsUpdate(e, t) {
                this.resolvedProperty[this.propertyIndex] = e[t],
                this.targetObject.matrixWorldNeedsUpdate = !0
            }
            _setValue_fromArray(e, t) {
                this.resolvedProperty.fromArray(e, t)
            }
            _setValue_fromArray_setNeedsUpdate(e, t) {
                this.resolvedProperty.fromArray(e, t),
                this.targetObject.needsUpdate = !0
            }
            _setValue_fromArray_setMatrixWorldNeedsUpdate(e, t) {
                this.resolvedProperty.fromArray(e, t),
                this.targetObject.matrixWorldNeedsUpdate = !0
            }
            _getValue_unbound(e, t) {
                this.bind(),
                this.getValue(e, t)
            }
            _setValue_unbound(e, t) {
                this.bind(),
                this.setValue(e, t)
            }
            bind() {
                let e = this.node;
                const t = this.parsedPath
                  , n = t.objectName
                  , i = t.propertyName;
                let r = t.propertyIndex;
                if (e || (e = Go.findNode(this.rootNode, t.nodeName),
                this.node = e),
                this.getValue = this._getValue_unavailable,
                this.setValue = this._setValue_unavailable,
                !e)
                    return void console.warn("THREE.PropertyBinding: No target node found for track: " + this.path + ".");
                if (n) {
                    let i = t.objectIndex;
                    switch (n) {
                    case "materials":
                        if (!e.material)
                            return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.", this);
                        if (!e.material.materials)
                            return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.", this);
                        e = e.material.materials;
                        break;
                    case "bones":
                        if (!e.skeleton)
                            return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.", this);
                        e = e.skeleton.bones;
                        for (let t = 0; t < e.length; t++)
                            if (e[t].name === i) {
                                i = t;
                                break
                            }
                        break;
                    case "map":
                        if ("map"in e) {
                            e = e.map;
                            break
                        }
                        if (!e.material)
                            return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.", this);
                        if (!e.material.map)
                            return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.", this);
                        e = e.material.map;
                        break;
                    default:
                        if (void 0 === e[n])
                            return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.", this);
                        e = e[n]
                    }
                    if (void 0 !== i) {
                        if (void 0 === e[i])
                            return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.", this, e);
                        e = e[i]
                    }
                }
                const a = e[i];
                if (void 0 === a) {
                    const n = t.nodeName;
                    return void console.error("THREE.PropertyBinding: Trying to update property for track: " + n + "." + i + " but it wasn't found.", e)
                }
                let s = this.Versioning.None;
                this.targetObject = e,
                !0 === e.isMaterial ? s = this.Versioning.NeedsUpdate : !0 === e.isObject3D && (s = this.Versioning.MatrixWorldNeedsUpdate);
                let o = this.BindingType.Direct;
                if (void 0 !== r) {
                    if ("morphTargetInfluences" === i) {
                        if (!e.geometry)
                            return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.", this);
                        if (!e.geometry.morphAttributes)
                            return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.", this);
                        void 0 !== e.morphTargetDictionary[r] && (r = e.morphTargetDictionary[r])
                    }
                    o = this.BindingType.ArrayElement,
                    this.resolvedProperty = a,
                    this.propertyIndex = r
                } else
                    void 0 !== a.fromArray && void 0 !== a.toArray ? (o = this.BindingType.HasFromToArray,
                    this.resolvedProperty = a) : Array.isArray(a) ? (o = this.BindingType.EntireArray,
                    this.resolvedProperty = a) : this.propertyName = i;
                this.getValue = this.GetterByBindingType[o],
                this.setValue = this.SetterByBindingTypeAndVersioning[o][s]
            }
            unbind() {
                this.node = null,
                this.getValue = this._getValue_unbound,
                this.setValue = this._setValue_unbound
            }
        }
        Go.Composite = class {
            constructor(e, t, n) {
                const i = n || Go.parseTrackName(t);
                this._targetGroup = e,
                this._bindings = e.subscribe_(t, i)
            }
            getValue(e, t) {
                this.bind();
                const n = this._targetGroup.nCachedObjects_
                  , i = this._bindings[n];
                void 0 !== i && i.getValue(e, t)
            }
            setValue(e, t) {
                const n = this._bindings;
                for (let i = this._targetGroup.nCachedObjects_, r = n.length; i !== r; ++i)
                    n[i].setValue(e, t)
            }
            bind() {
                const e = this._bindings;
                for (let t = this._targetGroup.nCachedObjects_, n = e.length; t !== n; ++t)
                    e[t].bind()
            }
            unbind() {
                const e = this._bindings;
                for (let t = this._targetGroup.nCachedObjects_, n = e.length; t !== n; ++t)
                    e[t].unbind()
            }
        }
        ,
        Go.prototype.BindingType = {
            Direct: 0,
            EntireArray: 1,
            ArrayElement: 2,
            HasFromToArray: 3
        },
        Go.prototype.Versioning = {
            None: 0,
            NeedsUpdate: 1,
            MatrixWorldNeedsUpdate: 2
        },
        Go.prototype.GetterByBindingType = [Go.prototype._getValue_direct, Go.prototype._getValue_array, Go.prototype._getValue_arrayElement, Go.prototype._getValue_toArray],
        Go.prototype.SetterByBindingTypeAndVersioning = [[Go.prototype._setValue_direct, Go.prototype._setValue_direct_setNeedsUpdate, Go.prototype._setValue_direct_setMatrixWorldNeedsUpdate], [Go.prototype._setValue_array, Go.prototype._setValue_array_setNeedsUpdate, Go.prototype._setValue_array_setMatrixWorldNeedsUpdate], [Go.prototype._setValue_arrayElement, Go.prototype._setValue_arrayElement_setNeedsUpdate, Go.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate], [Go.prototype._setValue_fromArray, Go.prototype._setValue_fromArray_setNeedsUpdate, Go.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];
        new Float32Array(1);
        const jo = new Xn;
        class Qo {
            constructor(e, t, n=0, i=1 / 0) {
                this.ray = new Yn(e,t),
                this.near = n,
                this.far = i,
                this.camera = null,
                this.layers = new oi,
                this.params = {
                    Mesh: {},
                    Line: {
                        threshold: 1
                    },
                    LOD: {},
                    Points: {
                        threshold: 1
                    },
                    Sprite: {}
                }
            }
            set(e, t) {
                this.ray.set(e, t)
            }
            setFromCamera(e, t) {
                t.isPerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
                this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize(),
                this.camera = t) : t.isOrthographicCamera ? (this.ray.origin.set(e.x, e.y, (t.near + t.far) / (t.near - t.far)).unproject(t),
                this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld),
                this.camera = t) : console.error("THREE.Raycaster: Unsupported camera type: " + t.type)
            }
            setFromXRController(e) {
                return jo.identity().extractRotation(e.matrixWorld),
                this.ray.origin.setFromMatrixPosition(e.matrixWorld),
                this.ray.direction.set(0, 0, -1).applyMatrix4(jo),
                this
            }
            intersectObject(e, t=!0, n=[]) {
                return qo(e, this, n, t),
                n.sort(Ko),
                n
            }
            intersectObjects(e, t=!0, n=[]) {
                for (let i = 0, r = e.length; i < r; i++)
                    qo(e[i], this, n, t);
                return n.sort(Ko),
                n
            }
        }
        function Ko(e, t) {
            return e.distance - t.distance
        }
        function qo(e, t, n, i) {
            let r = !0;
            if (e.layers.test(t.layers)) {
                !1 === e.raycast(t, n) && (r = !1)
            }
            if (!0 === r && !0 === i) {
                const i = e.children;
                for (let e = 0, r = i.length; e < r; e++)
                    qo(i[e], t, n, !0)
            }
        }
        class Yo {
            constructor(e=1, t=0, n=0) {
                this.radius = e,
                this.phi = t,
                this.theta = n
            }
            set(e, t, n) {
                return this.radius = e,
                this.phi = t,
                this.theta = n,
                this
            }
            copy(e) {
                return this.radius = e.radius,
                this.phi = e.phi,
                this.theta = e.theta,
                this
            }
            makeSafe() {
                const e = 1e-6;
                return this.phi = Ft(this.phi, e, Math.PI - e),
                this
            }
            setFromVector3(e) {
                return this.setFromCartesianCoords(e.x, e.y, e.z)
            }
            setFromCartesianCoords(e, t, n) {
                return this.radius = Math.sqrt(e * e + t * t + n * n),
                0 === this.radius ? (this.theta = 0,
                this.phi = 0) : (this.theta = Math.atan2(e, n),
                this.phi = Math.acos(Ft(t / this.radius, -1, 1))),
                this
            }
            clone() {
                return (new this.constructor).copy(this)
            }
        }
        class Xo {
            constructor() {
                this.type = "ShapePath",
                this.color = new Hi,
                this.subPaths = [],
                this.currentPath = null
            }
            moveTo(e, t) {
                return this.currentPath = new ss,
                this.subPaths.push(this.currentPath),
                this.currentPath.moveTo(e, t),
                this
            }
            lineTo(e, t) {
                return this.currentPath.lineTo(e, t),
                this
            }
            quadraticCurveTo(e, t, n, i) {
                return this.currentPath.quadraticCurveTo(e, t, n, i),
                this
            }
            bezierCurveTo(e, t, n, i, r, a) {
                return this.currentPath.bezierCurveTo(e, t, n, i, r, a),
                this
            }
            splineThru(e) {
                return this.currentPath.splineThru(e),
                this
            }
            toShapes(e) {
                function t(e, t) {
                    const n = t.length;
                    let i = !1;
                    for (let r = n - 1, a = 0; a < n; r = a++) {
                        let n = t[r]
                          , s = t[a]
                          , o = s.x - n.x
                          , l = s.y - n.y;
                        if (Math.abs(l) > Number.EPSILON) {
                            if (l < 0 && (n = t[a],
                            o = -o,
                            s = t[r],
                            l = -l),
                            e.y < n.y || e.y > s.y)
                                continue;
                            if (e.y === n.y) {
                                if (e.x === n.x)
                                    return !0
                            } else {
                                const t = l * (e.x - n.x) - o * (e.y - n.y);
                                if (0 === t)
                                    return !0;
                                if (t < 0)
                                    continue;
                                i = !i
                            }
                        } else {
                            if (e.y !== n.y)
                                continue;
                            if (s.x <= e.x && e.x <= n.x || n.x <= e.x && e.x <= s.x)
                                return !0
                        }
                    }
                    return i
                }
                const n = Ls.isClockWise
                  , i = this.subPaths;
                if (0 === i.length)
                    return [];
                let r, a, s;
                const o = [];
                if (1 === i.length)
                    return a = i[0],
                    s = new os,
                    s.curves = a.curves,
                    o.push(s),
                    o;
                let l = !n(i[0].getPoints());
                l = e ? !l : l;
                const c = []
                  , h = [];
                let d, u, p = [], f = 0;
                h[f] = void 0,
                p[f] = [];
                for (let t = 0, s = i.length; t < s; t++)
                    a = i[t],
                    d = a.getPoints(),
                    r = n(d),
                    r = e ? !r : r,
                    r ? (!l && h[f] && f++,
                    h[f] = {
                        s: new os,
                        p: d
                    },
                    h[f].s.curves = a.curves,
                    l && f++,
                    p[f] = []) : p[f].push({
                        h: a,
                        p: d[0]
                    });
                if (!h[0])
                    return function(e) {
                        const t = [];
                        for (let n = 0, i = e.length; n < i; n++) {
                            const i = e[n]
                              , r = new os;
                            r.curves = i.curves,
                            t.push(r)
                        }
                        return t
                    }(i);
                if (h.length > 1) {
                    let e = !1
                      , n = 0;
                    for (let e = 0, t = h.length; e < t; e++)
                        c[e] = [];
                    for (let i = 0, r = h.length; i < r; i++) {
                        const r = p[i];
                        for (let a = 0; a < r.length; a++) {
                            const s = r[a];
                            let o = !0;
                            for (let r = 0; r < h.length; r++)
                                t(s.p, h[r].p) && (i !== r && n++,
                                o ? (o = !1,
                                c[r].push(s)) : e = !0);
                            o && c[i].push(s)
                        }
                    }
                    n > 0 && !1 === e && (p = c)
                }
                for (let e = 0, t = h.length; e < t; e++) {
                    s = h[e].s,
                    o.push(s),
                    u = p[e];
                    for (let e = 0, t = u.length; e < t; e++)
                        s.holes.push(u[e].h)
                }
                return o
            }
        }
        class Zo extends Dt {
            constructor(e, t=null) {
                super(),
                this.object = e,
                this.domElement = t,
                this.enabled = !0,
                this.state = -1,
                this.keys = {},
                this.mouseButtons = {
                    LEFT: null,
                    MIDDLE: null,
                    RIGHT: null
                },
                this.touches = {
                    ONE: null,
                    TWO: null
                }
            }
            connect() {}
            disconnect() {}
            dispose() {}
            update() {}
        }
        function Jo(e, t, n, i) {
            const r = function(e) {
                switch (e) {
                case fe:
                case me:
                    return {
                        byteLength: 1,
                        components: 1
                    };
                case ve:
                case ge:
                case Ae:
                    return {
                        byteLength: 2,
                        components: 1
                    };
                case xe:
                case ke:
                    return {
                        byteLength: 2,
                        components: 4
                    };
                case ye:
                case we:
                case be:
                    return {
                        byteLength: 4,
                        components: 1
                    };
                case Se:
                    return {
                        byteLength: 4,
                        components: 3
                    }
                }
                throw new Error(`Unknown texture type ${e}.`)
            }(i);
            switch (n) {
            case 1021:
            case 1024:
                return e * t;
            case 1025:
                return e * t * 2;
            case Ce:
            case Pe:
                return e * t / r.components * r.byteLength;
            case 1030:
            case Ie:
                return e * t * 2 / r.components * r.byteLength;
            case 1022:
                return e * t * 3 / r.components * r.byteLength;
            case Me:
            case Re:
                return e * t * 4 / r.components * r.byteLength;
            case Le:
            case De:
                return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 8;
            case Ne:
            case Be:
                return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 16;
            case ze:
            case Fe:
                return Math.max(e, 16) * Math.max(t, 8) / 4;
            case Ue:
            case Oe:
                return Math.max(e, 8) * Math.max(t, 8) / 2;
            case We:
            case He:
                return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 8;
            case Ve:
            case Ge:
                return Math.floor((e + 3) / 4) * Math.floor((t + 3) / 4) * 16;
            case je:
                return Math.floor((e + 4) / 5) * Math.floor((t + 3) / 4) * 16;
            case Qe:
                return Math.floor((e + 4) / 5) * Math.floor((t + 4) / 5) * 16;
            case Ke:
                return Math.floor((e + 5) / 6) * Math.floor((t + 4) / 5) * 16;
            case qe:
                return Math.floor((e + 5) / 6) * Math.floor((t + 5) / 6) * 16;
            case Ye:
                return Math.floor((e + 7) / 8) * Math.floor((t + 4) / 5) * 16;
            case Xe:
                return Math.floor((e + 7) / 8) * Math.floor((t + 5) / 6) * 16;
            case Ze:
                return Math.floor((e + 7) / 8) * Math.floor((t + 7) / 8) * 16;
            case Je:
                return Math.floor((e + 9) / 10) * Math.floor((t + 4) / 5) * 16;
            case $e:
                return Math.floor((e + 9) / 10) * Math.floor((t + 5) / 6) * 16;
            case et:
                return Math.floor((e + 9) / 10) * Math.floor((t + 7) / 8) * 16;
            case tt:
                return Math.floor((e + 9) / 10) * Math.floor((t + 9) / 10) * 16;
            case nt:
                return Math.floor((e + 11) / 12) * Math.floor((t + 9) / 10) * 16;
            case it:
                return Math.floor((e + 11) / 12) * Math.floor((t + 11) / 12) * 16;
            case rt:
            case at:
            case st:
                return Math.ceil(e / 4) * Math.ceil(t / 4) * 16;
            case 36283:
            case ot:
                return Math.ceil(e / 4) * Math.ceil(t / 4) * 8;
            case lt:
            case ct:
                return Math.ceil(e / 4) * Math.ceil(t / 4) * 16
            }
            throw new Error(`Unable to determine texture byte length for ${n} format.`)
        }
        var $o;
        "undefined" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{
            detail: {
                revision: g
            }
        })),
        "undefined" != typeof window && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = g),
        function(e) {
            e[e.ImperialUnitsEnabled = 0] = "ImperialUnitsEnabled",
            e[e.ResetHintEnabled = 1] = "ResetHintEnabled",
            e[e.GhostCarEnabled = 2] = "GhostCarEnabled",
            e[e.DefaultCameraMode = 3] = "DefaultCameraMode",
            e[e.CockpitCameraToggle = 4] = "CockpitCameraToggle",
            e[e.Checkpoints = 5] = "Checkpoints",
            e[e.Timer = 6] = "Timer",
            e[e.Speedometer = 7] = "Speedometer",
            e[e.Language = 8] = "Language",
            e[e.ShadowQuality = 9] = "ShadowQuality",
            e[e.CloudsEnabled = 10] = "CloudsEnabled",
            e[e.ParticlesEnabled = 11] = "ParticlesEnabled",
            e[e.SkidmarksEnabled = 12] = "SkidmarksEnabled",
            e[e.RenderScale = 13] = "RenderScale",
            e[e.Antialiasing = 14] = "Antialiasing",
            e[e.SoundEffectVolume = 15] = "SoundEffectVolume",
            e[e.MusicVolume = 16] = "MusicVolume",
            e[e.CheckpointVolume = 17] = "CheckpointVolume",
            e[e.VibrationEnabled = 18] = "VibrationEnabled",
            e[e.TouchSteeringSide = 19] = "TouchSteeringSide"
        }($o || ($o = {}));
        const el = $o;
        var tl, nl, il, rl, al, sl, ol, ll, cl, hl, dl, ul, pl, fl = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, ml = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        nl = new WeakMap,
        il = new WeakMap,
        rl = new WeakMap,
        al = new WeakMap,
        sl = new WeakMap,
        ol = new WeakMap,
        ll = new WeakMap,
        cl = new WeakMap,
        tl = new WeakSet,
        hl = function() {
            ml(this, ll, "f") && !ml(this, cl, "f") ? null != ml(this, ol, "f") && ml(this, ol, "f").gain.setTargetAtTime(1, 0, .1) : null != ml(this, ol, "f") && ml(this, ol, "f").gain.setTargetAtTime(0, 0, .1)
        }
        ,
        dl = function e(t, n) {
            const i = this.context;
            if (null == i)
                n(null);
            else if (0 == t.length)
                n(null);
            else {
                const r = t[0]
                  , a = new XMLHttpRequest;
                a.open("GET", r, !0),
                a.responseType = "arraybuffer",
                a.onload = () => {
                    i.decodeAudioData(a.response).then((e => {
                        n(e)
                    }
                    )).catch(( () => {
                        ml(this, tl, "m", e).call(this, t.slice(1), n)
                    }
                    ))
                }
                ,
                a.send()
            }
        }
        ,
        ul = function(e) {
            var t;
            let n = Math.min(Math.max(e.getSettingFloat(el.SoundEffectVolume), 0), 1);
            Number.isNaN(n) && (n = 0),
            null == ml(this, sl, "f") && null != this.context && null != this.destinationMaster ? (fl(this, sl, this.context.createGain(), "f"),
            ml(this, sl, "f").gain.value = n,
            ml(this, sl, "f").connect(this.destinationMaster)) : null === (t = ml(this, sl, "f")) || void 0 === t || t.gain.setTargetAtTime(n, 0, .1)
        }
        ,
        pl = function(e, t, n) {
            if (t && ml(this, nl, "f").hasLoaded()) {
                if (null == ml(this, rl, "f")) {
                    const e = this.getBuffer("music");
                    if (null != e && null != this.context && null != this.destinationMaster) {
                        const t = this.context.createBufferSource();
                        t.buffer = e,
                        t.loop = !0;
                        const n = this.context.createGain();
                        n.gain.value = 0,
                        t.connect(n),
                        n.connect(this.destinationMaster),
                        t.start(0),
                        fl(this, rl, {
                            source: t,
                            gain: n
                        }, "f")
                    }
                } else {
                    let e = Math.min(Math.max(n.getSettingFloat(el.MusicVolume), 0), 1);
                    Number.isNaN(e) && (e = 0),
                    ml(this, rl, "f").gain.gain.setTargetAtTime(.25 * e, 0, .5)
                }
                fl(this, al, 0, "f")
            } else
                null != ml(this, rl, "f") && (ml(this, rl, "f").gain.gain.setTargetAtTime(0, 0, .5),
                ml(this, al, "f") >= 5 ? (ml(this, rl, "f").source.stop(),
                fl(this, rl, null, "f")) : fl(this, al, ml(this, al, "f") + e, "f"))
        }
        ;
        const gl = class {
            constructor(e) {
                tl.add(this),
                nl.set(this, void 0),
                this.context = null,
                il.set(this, new Map),
                rl.set(this, null),
                al.set(this, 0),
                sl.set(this, null),
                ol.set(this, null),
                ll.set(this, !0),
                cl.set(this, !1),
                fl(this, nl, e, "f");
                try {
                    const e = new (window.AudioContext || window.webkitAudioContext);
                    if ("running" != e.state) {
                        const t = ["click", "contextmenu", "auxclick", "dblclick", "mousedown", "mouseup", "pointerup", "touchend", "keydown", "keyup"]
                          , n = () => {
                            e.resume().catch((e => {
                                console.error(e)
                            }
                            ));
                            for (const e of t)
                                window.removeEventListener(e, n)
                        }
                        ;
                        for (const e of t)
                            window.addEventListener(e, n)
                    }
                    this.context = e
                } catch (e) {
                    this.context = null,
                    console.error("Failed to create audio context: ", e)
                }
                null != this.context ? (fl(this, ol, this.context.createGain(), "f"),
                ml(this, ol, "f").gain.value = 1,
                ml(this, ol, "f").connect(this.context.destination)) : fl(this, ol, null, "f")
            }
            get destinationSfx() {
                return ml(this, sl, "f")
            }
            get destinationMaster() {
                return ml(this, ol, "f")
            }
            set isAppActive(e) {
                fl(this, ll, e, "f"),
                ml(this, tl, "m", hl).call(this)
            }
            set isAdPlaying(e) {
                fl(this, cl, e, "f"),
                ml(this, tl, "m", hl).call(this)
            }
            load(e, t) {
                ml(this, nl, "f").addResource(),
                ml(this, tl, "m", dl).call(this, t, (t => {
                    ml(this, nl, "f").loadedResource(),
                    null == t ? (console.warn('Audio "' + e + '" failed to load'),
                    ml(this, il, "f").set(e, null)) : ml(this, il, "f").set(e, t)
                }
                ))
            }
            getBuffer(e) {
                var t;
                return null == this.context ? null : ml(this, il, "f").has(e) && null !== (t = ml(this, il, "f").get(e)) && void 0 !== t ? t : null
            }
            playUIClick() {
                const e = this.getBuffer("click");
                if (null != e && null != this.context && null != this.destinationSfx) {
                    const t = this.context.createBufferSource();
                    t.buffer = e;
                    const n = this.context.createGain();
                    n.gain.value = .0075,
                    t.connect(n),
                    n.connect(this.destinationSfx),
                    t.start(0)
                }
            }
            refreshListener(e) {
                if (null != this.context) {
                    const t = new bn
                      , n = new yn
                      , i = new bn;
                    e.camera.matrix.decompose(t, n, i);
                    const r = this.context.listener;
                    r.positionX && r.positionY && r.positionZ ? (r.positionX.value = t.x,
                    r.positionY.value = t.y,
                    r.positionZ.value = t.z) : r.setPosition(t.x, t.y, t.z);
                    const a = new bn(0,0,-1);
                    a.applyQuaternion(n);
                    const s = new bn(0,1,0);
                    s.applyQuaternion(n),
                    r.forwardX && r.forwardY && r.forwardZ && r.upX && r.upY && r.upZ ? (r.forwardX.value = a.x,
                    r.forwardY.value = a.y,
                    r.forwardZ.value = a.z,
                    r.upX.value = s.x,
                    r.upY.value = s.y,
                    r.upZ.value = s.z) : r.setOrientation(a.x, a.y, a.z, s.x, s.y, s.z)
                }
            }
            update(e, t, n, i) {
                this.refreshListener(n),
                ml(this, tl, "m", ul).call(this, i),
                ml(this, tl, "m", pl).call(this, e, t, i)
            }
        }
        ;
        function vl(e, t=!1) {
            const n = null !== e[0].index
              , i = new Set(Object.keys(e[0].attributes))
              , r = new Set(Object.keys(e[0].morphAttributes))
              , a = {}
              , s = {}
              , o = e[0].morphTargetsRelative
              , l = new or;
            let c = 0;
            for (let h = 0; h < e.length; ++h) {
                const d = e[h];
                let u = 0;
                if (n !== (null !== d.index))
                    return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + ". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),
                    null;
                for (const e in d.attributes) {
                    if (!i.has(e))
                        return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + '. All geometries must have compatible attributes; make sure "' + e + '" attribute exists among all geometries, or in none of them.'),
                        null;
                    void 0 === a[e] && (a[e] = []),
                    a[e].push(d.attributes[e]),
                    u++
                }
                if (u !== i.size)
                    return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + ". Make sure all geometries have the same number of attributes."),
                    null;
                if (o !== d.morphTargetsRelative)
                    return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + ". .morphTargetsRelative must be consistent throughout all geometries."),
                    null;
                for (const e in d.morphAttributes) {
                    if (!r.has(e))
                        return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + ".  .morphAttributes must be consistent throughout all geometries."),
                        null;
                    void 0 === s[e] && (s[e] = []),
                    s[e].push(d.morphAttributes[e])
                }
                if (t) {
                    let e;
                    if (n)
                        e = d.index.count;
                    else {
                        if (void 0 === d.attributes.position)
                            return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + ". The geometry must have either an index or a position attribute"),
                            null;
                        e = d.attributes.position.count
                    }
                    l.addGroup(c, e, h),
                    c += e
                }
            }
            if (n) {
                let t = 0;
                const n = [];
                for (let i = 0; i < e.length; ++i) {
                    const r = e[i].index;
                    for (let e = 0; e < r.count; ++e)
                        n.push(r.getX(e) + t);
                    t += e[i].attributes.position.count
                }
                l.setIndex(n)
            }
            for (const e in a) {
                const t = wl(a[e]);
                if (!t)
                    return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + e + " attribute."),
                    null;
                l.setAttribute(e, t)
            }
            for (const e in s) {
                const t = s[e][0].length;
                if (0 === t)
                    break;
                l.morphAttributes = l.morphAttributes || {},
                l.morphAttributes[e] = [];
                for (let n = 0; n < t; ++n) {
                    const t = [];
                    for (let i = 0; i < s[e].length; ++i)
                        t.push(s[e][i][n]);
                    const i = wl(t);
                    if (!i)
                        return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + e + " morphAttribute."),
                        null;
                    l.morphAttributes[e].push(i)
                }
            }
            return l
        }
        function wl(e) {
            let t, n, i, r = -1, a = 0;
            for (let s = 0; s < e.length; ++s) {
                const o = e[s];
                if (void 0 === t && (t = o.array.constructor),
                t !== o.array.constructor)
                    return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),
                    null;
                if (void 0 === n && (n = o.itemSize),
                n !== o.itemSize)
                    return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),
                    null;
                if (void 0 === i && (i = o.normalized),
                i !== o.normalized)
                    return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),
                    null;
                if (-1 === r && (r = o.gpuType),
                r !== o.gpuType)
                    return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),
                    null;
                a += o.count * n
            }
            const s = new t(a)
              , o = new Xi(s,n,i);
            let l = 0;
            for (let t = 0; t < e.length; ++t) {
                const i = e[t];
                if (i.isInterleavedBufferAttribute) {
                    const e = l / n;
                    for (let t = 0, r = i.count; t < r; t++)
                        for (let r = 0; r < n; r++) {
                            const n = i.getComponent(t, r);
                            o.setComponent(t + e, r, n)
                        }
                } else
                    s.set(i.array, l);
                l += i.count * n
            }
            return void 0 !== r && (o.gpuType = r),
            o
        }
        function yl(e, t=1e-4) {
            t = Math.max(t, Number.EPSILON);
            const n = {}
              , i = e.getIndex()
              , r = e.getAttribute("position")
              , a = i ? i.count : r.count;
            let s = 0;
            const o = Object.keys(e.attributes)
              , l = {}
              , c = {}
              , h = []
              , d = ["getX", "getY", "getZ", "getW"]
              , u = ["setX", "setY", "setZ", "setW"];
            for (let t = 0, n = o.length; t < n; t++) {
                const n = o[t]
                  , i = e.attributes[n];
                l[n] = new i.constructor(new i.array.constructor(i.count * i.itemSize),i.itemSize,i.normalized);
                const r = e.morphAttributes[n];
                r && (c[n] || (c[n] = []),
                r.forEach(( (e, t) => {
                    const i = new e.array.constructor(e.count * e.itemSize);
                    c[n][t] = new e.constructor(i,e.itemSize,e.normalized)
                }
                )))
            }
            const p = .5 * t
              , f = Math.log10(1 / t)
              , m = Math.pow(10, f)
              , g = p * m;
            for (let t = 0; t < a; t++) {
                const r = i ? i.getX(t) : t;
                let a = "";
                for (let t = 0, n = o.length; t < n; t++) {
                    const n = o[t]
                      , i = e.getAttribute(n)
                      , s = i.itemSize;
                    for (let e = 0; e < s; e++)
                        a += ~~(i[d[e]](r) * m + g) + ","
                }
                if (a in n)
                    h.push(n[a]);
                else {
                    for (let t = 0, n = o.length; t < n; t++) {
                        const n = o[t]
                          , i = e.getAttribute(n)
                          , a = e.morphAttributes[n]
                          , h = i.itemSize
                          , p = l[n]
                          , f = c[n];
                        for (let e = 0; e < h; e++) {
                            const t = d[e]
                              , n = u[e];
                            if (p[n](s, i[t](r)),
                            a)
                                for (let e = 0, i = a.length; e < i; e++)
                                    f[e][n](s, a[e][t](r))
                        }
                    }
                    n[a] = s,
                    h.push(s),
                    s++
                }
            }
            const v = e.clone();
            for (const t in e.attributes) {
                const e = l[t];
                if (v.setAttribute(t, new e.constructor(e.array.slice(0, s * e.itemSize),e.itemSize,e.normalized)),
                t in c)
                    for (let e = 0; e < c[t].length; e++) {
                        const n = c[t][e];
                        v.morphAttributes[t][e] = new n.constructor(n.array.slice(0, s * n.itemSize),n.itemSize,n.normalized)
                    }
            }
            return v.setIndex(h),
            v
        }
        function bl(e, t) {
            if (0 === t)
                return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),
                e;
            if (2 === t || 1 === t) {
                let n = e.getIndex();
                if (null === n) {
                    const t = []
                      , i = e.getAttribute("position");
                    if (void 0 === i)
                        return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),
                        e;
                    for (let e = 0; e < i.count; e++)
                        t.push(e);
                    e.setIndex(t),
                    n = e.getIndex()
                }
                const i = n.count - 2
                  , r = [];
                if (2 === t)
                    for (let e = 1; e <= i; e++)
                        r.push(n.getX(0)),
                        r.push(n.getX(e)),
                        r.push(n.getX(e + 1));
                else
                    for (let e = 0; e < i; e++)
                        e % 2 == 0 ? (r.push(n.getX(e)),
                        r.push(n.getX(e + 1)),
                        r.push(n.getX(e + 2))) : (r.push(n.getX(e + 2)),
                        r.push(n.getX(e + 1)),
                        r.push(n.getX(e)));
                r.length / 3 !== i && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
                const a = e.clone();
                return a.setIndex(r),
                a.clearGroups(),
                a
            }
            return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", t),
            e
        }
        class Al extends po {
            constructor(e) {
                super(e),
                this.dracoLoader = null,
                this.ktx2Loader = null,
                this.meshoptDecoder = null,
                this.pluginCallbacks = [],
                this.register((function(e) {
                    return new _l(e)
                }
                )),
                this.register((function(e) {
                    return new Tl(e)
                }
                )),
                this.register((function(e) {
                    return new Ul(e)
                }
                )),
                this.register((function(e) {
                    return new zl(e)
                }
                )),
                this.register((function(e) {
                    return new Ol(e)
                }
                )),
                this.register((function(e) {
                    return new Pl(e)
                }
                )),
                this.register((function(e) {
                    return new Il(e)
                }
                )),
                this.register((function(e) {
                    return new Rl(e)
                }
                )),
                this.register((function(e) {
                    return new Ll(e)
                }
                )),
                this.register((function(e) {
                    return new Ml(e)
                }
                )),
                this.register((function(e) {
                    return new Dl(e)
                }
                )),
                this.register((function(e) {
                    return new Cl(e)
                }
                )),
                this.register((function(e) {
                    return new Bl(e)
                }
                )),
                this.register((function(e) {
                    return new Nl(e)
                }
                )),
                this.register((function(e) {
                    return new El(e)
                }
                )),
                this.register((function(e) {
                    return new Fl(e)
                }
                )),
                this.register((function(e) {
                    return new Wl(e)
                }
                ))
            }
            load(e, t, n, i) {
                const r = this;
                let a;
                if ("" !== this.resourcePath)
                    a = this.resourcePath;
                else if ("" !== this.path) {
                    const t = No.extractUrlBase(e);
                    a = No.resolveURL(t, this.path)
                } else
                    a = No.extractUrlBase(e);
                this.manager.itemStart(e);
                const s = function(t) {
                    i ? i(t) : console.error(t),
                    r.manager.itemError(e),
                    r.manager.itemEnd(e)
                }
                  , o = new go(this.manager);
                o.setPath(this.path),
                o.setResponseType("arraybuffer"),
                o.setRequestHeader(this.requestHeader),
                o.setWithCredentials(this.withCredentials),
                o.load(e, (function(n) {
                    try {
                        r.parse(n, a, (function(n) {
                            t(n),
                            r.manager.itemEnd(e)
                        }
                        ), s)
                    } catch (e) {
                        s(e)
                    }
                }
                ), n, s)
            }
            setDRACOLoader(e) {
                return this.dracoLoader = e,
                this
            }
            setKTX2Loader(e) {
                return this.ktx2Loader = e,
                this
            }
            setMeshoptDecoder(e) {
                return this.meshoptDecoder = e,
                this
            }
            register(e) {
                return -1 === this.pluginCallbacks.indexOf(e) && this.pluginCallbacks.push(e),
                this
            }
            unregister(e) {
                return -1 !== this.pluginCallbacks.indexOf(e) && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1),
                this
            }
            parse(e, t, n, i) {
                let r;
                const a = {}
                  , s = {}
                  , o = new TextDecoder;
                if ("string" == typeof e)
                    r = JSON.parse(e);
                else if (e instanceof ArrayBuffer) {
                    if (o.decode(new Uint8Array(e,0,4)) === Hl) {
                        try {
                            a[kl.KHR_BINARY_GLTF] = new jl(e)
                        } catch (e) {
                            return void (i && i(e))
                        }
                        r = JSON.parse(a[kl.KHR_BINARY_GLTF].content)
                    } else
                        r = JSON.parse(o.decode(e))
                } else
                    r = e;
                if (void 0 === r.asset || r.asset.version[0] < 2)
                    return void (i && i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));
                const l = new gc(r,{
                    path: t || this.resourcePath || "",
                    crossOrigin: this.crossOrigin,
                    requestHeader: this.requestHeader,
                    manager: this.manager,
                    ktx2Loader: this.ktx2Loader,
                    meshoptDecoder: this.meshoptDecoder
                });
                l.fileLoader.setRequestHeader(this.requestHeader);
                for (let e = 0; e < this.pluginCallbacks.length; e++) {
                    const t = this.pluginCallbacks[e](l);
                    t.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),
                    s[t.name] = t,
                    a[t.name] = !0
                }
                if (r.extensionsUsed)
                    for (let e = 0; e < r.extensionsUsed.length; ++e) {
                        const t = r.extensionsUsed[e]
                          , n = r.extensionsRequired || [];
                        switch (t) {
                        case kl.KHR_MATERIALS_UNLIT:
                            a[t] = new Sl;
                            break;
                        case kl.KHR_DRACO_MESH_COMPRESSION:
                            a[t] = new Ql(r,this.dracoLoader);
                            break;
                        case kl.KHR_TEXTURE_TRANSFORM:
                            a[t] = new Kl;
                            break;
                        case kl.KHR_MESH_QUANTIZATION:
                            a[t] = new ql;
                            break;
                        default:
                            n.indexOf(t) >= 0 && void 0 === s[t] && console.warn('THREE.GLTFLoader: Unknown extension "' + t + '".')
                        }
                    }
                l.setExtensions(a),
                l.setPlugins(s),
                l.parse(n, i)
            }
            parseAsync(e, t) {
                const n = this;
                return new Promise((function(i, r) {
                    n.parse(e, t, i, r)
                }
                ))
            }
        }
        function xl() {
            let e = {};
            return {
                get: function(t) {
                    return e[t]
                },
                add: function(t, n) {
                    e[t] = n
                },
                remove: function(t) {
                    delete e[t]
                },
                removeAll: function() {
                    e = {}
                }
            }
        }
        const kl = {
            KHR_BINARY_GLTF: "KHR_binary_glTF",
            KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
            KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
            KHR_MATERIALS_CLEARCOAT: "KHR_materials_clearcoat",
            KHR_MATERIALS_DISPERSION: "KHR_materials_dispersion",
            KHR_MATERIALS_IOR: "KHR_materials_ior",
            KHR_MATERIALS_SHEEN: "KHR_materials_sheen",
            KHR_MATERIALS_SPECULAR: "KHR_materials_specular",
            KHR_MATERIALS_TRANSMISSION: "KHR_materials_transmission",
            KHR_MATERIALS_IRIDESCENCE: "KHR_materials_iridescence",
            KHR_MATERIALS_ANISOTROPY: "KHR_materials_anisotropy",
            KHR_MATERIALS_UNLIT: "KHR_materials_unlit",
            KHR_MATERIALS_VOLUME: "KHR_materials_volume",
            KHR_TEXTURE_BASISU: "KHR_texture_basisu",
            KHR_TEXTURE_TRANSFORM: "KHR_texture_transform",
            KHR_MESH_QUANTIZATION: "KHR_mesh_quantization",
            KHR_MATERIALS_EMISSIVE_STRENGTH: "KHR_materials_emissive_strength",
            EXT_MATERIALS_BUMP: "EXT_materials_bump",
            EXT_TEXTURE_WEBP: "EXT_texture_webp",
            EXT_TEXTURE_AVIF: "EXT_texture_avif",
            EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
            EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
        };
        class El {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_LIGHTS_PUNCTUAL,
                this.cache = {
                    refs: {},
                    uses: {}
                }
            }
            _markDefs() {
                const e = this.parser
                  , t = this.parser.json.nodes || [];
                for (let n = 0, i = t.length; n < i; n++) {
                    const i = t[n];
                    i.extensions && i.extensions[this.name] && void 0 !== i.extensions[this.name].light && e._addNodeRef(this.cache, i.extensions[this.name].light)
                }
            }
            _loadLight(e) {
                const t = this.parser
                  , n = "light:" + e;
                let i = t.cache.get(n);
                if (i)
                    return i;
                const r = t.json
                  , a = ((r.extensions && r.extensions[this.name] || {}).lights || [])[e];
                let s;
                const o = new Hi(16777215);
                void 0 !== a.color && o.setRGB(a.color[0], a.color[1], a.color[2], wt);
                const l = void 0 !== a.range ? a.range : 0;
                switch (a.type) {
                case "directional":
                    s = new Do(o),
                    s.target.position.set(0, 0, -1),
                    s.add(s.target);
                    break;
                case "point":
                    s = new Io(o),
                    s.distance = l;
                    break;
                case "spot":
                    s = new Mo(o),
                    s.distance = l,
                    a.spot = a.spot || {},
                    a.spot.innerConeAngle = void 0 !== a.spot.innerConeAngle ? a.spot.innerConeAngle : 0,
                    a.spot.outerConeAngle = void 0 !== a.spot.outerConeAngle ? a.spot.outerConeAngle : Math.PI / 4,
                    s.angle = a.spot.outerConeAngle,
                    s.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle,
                    s.target.position.set(0, 0, -1),
                    s.add(s.target);
                    break;
                default:
                    throw new Error("THREE.GLTFLoader: Unexpected light type: " + a.type)
                }
                return s.position.set(0, 0, 0),
                hc(s, a),
                void 0 !== a.intensity && (s.intensity = a.intensity),
                s.name = t.createUniqueName(a.name || "light_" + e),
                i = Promise.resolve(s),
                t.cache.add(n, i),
                i
            }
            getDependency(e, t) {
                if ("light" === e)
                    return this._loadLight(t)
            }
            createNodeAttachment(e) {
                const t = this
                  , n = this.parser
                  , i = n.json.nodes[e]
                  , r = (i.extensions && i.extensions[this.name] || {}).light;
                return void 0 === r ? null : this._loadLight(r).then((function(e) {
                    return n._getNodeRef(t.cache, r, e)
                }
                ))
            }
        }
        class Sl {
            constructor() {
                this.name = kl.KHR_MATERIALS_UNLIT
            }
            getMaterialType() {
                return Qi
            }
            extendParams(e, t, n) {
                const i = [];
                e.color = new Hi(1,1,1),
                e.opacity = 1;
                const r = t.pbrMetallicRoughness;
                if (r) {
                    if (Array.isArray(r.baseColorFactor)) {
                        const t = r.baseColorFactor;
                        e.color.setRGB(t[0], t[1], t[2], wt),
                        e.opacity = t[3]
                    }
                    void 0 !== r.baseColorTexture && i.push(n.assignTexture(e, "map", r.baseColorTexture, vt))
                }
                return Promise.all(i)
            }
        }
        class Ml {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_MATERIALS_EMISSIVE_STRENGTH
            }
            extendMaterialParams(e, t) {
                const n = this.parser.json.materials[e];
                if (!n.extensions || !n.extensions[this.name])
                    return Promise.resolve();
                const i = n.extensions[this.name].emissiveStrength;
                return void 0 !== i && (t.emissiveIntensity = i),
                Promise.resolve()
            }
        }
        class _l {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_MATERIALS_CLEARCOAT
            }
            getMaterialType(e) {
                const t = this.parser.json.materials[e];
                return t.extensions && t.extensions[this.name] ? Fs : null
            }
            extendMaterialParams(e, t) {
                const n = this.parser
                  , i = n.json.materials[e];
                if (!i.extensions || !i.extensions[this.name])
                    return Promise.resolve();
                const r = []
                  , a = i.extensions[this.name];
                if (void 0 !== a.clearcoatFactor && (t.clearcoat = a.clearcoatFactor),
                void 0 !== a.clearcoatTexture && r.push(n.assignTexture(t, "clearcoatMap", a.clearcoatTexture)),
                void 0 !== a.clearcoatRoughnessFactor && (t.clearcoatRoughness = a.clearcoatRoughnessFactor),
                void 0 !== a.clearcoatRoughnessTexture && r.push(n.assignTexture(t, "clearcoatRoughnessMap", a.clearcoatRoughnessTexture)),
                void 0 !== a.clearcoatNormalTexture && (r.push(n.assignTexture(t, "clearcoatNormalMap", a.clearcoatNormalTexture)),
                void 0 !== a.clearcoatNormalTexture.scale)) {
                    const e = a.clearcoatNormalTexture.scale;
                    t.clearcoatNormalScale = new Qt(e,e)
                }
                return Promise.all(r)
            }
        }
        class Tl {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_MATERIALS_DISPERSION
            }
            getMaterialType(e) {
                const t = this.parser.json.materials[e];
                return t.extensions && t.extensions[this.name] ? Fs : null
            }
            extendMaterialParams(e, t) {
                const n = this.parser.json.materials[e];
                if (!n.extensions || !n.extensions[this.name])
                    return Promise.resolve();
                const i = n.extensions[this.name];
                return t.dispersion = void 0 !== i.dispersion ? i.dispersion : 0,
                Promise.resolve()
            }
        }
        class Cl {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_MATERIALS_IRIDESCENCE
            }
            getMaterialType(e) {
                const t = this.parser.json.materials[e];
                return t.extensions && t.extensions[this.name] ? Fs : null
            }
            extendMaterialParams(e, t) {
                const n = this.parser
                  , i = n.json.materials[e];
                if (!i.extensions || !i.extensions[this.name])
                    return Promise.resolve();
                const r = []
                  , a = i.extensions[this.name];
                return void 0 !== a.iridescenceFactor && (t.iridescence = a.iridescenceFactor),
                void 0 !== a.iridescenceTexture && r.push(n.assignTexture(t, "iridescenceMap", a.iridescenceTexture)),
                void 0 !== a.iridescenceIor && (t.iridescenceIOR = a.iridescenceIor),
                void 0 === t.iridescenceThicknessRange && (t.iridescenceThicknessRange = [100, 400]),
                void 0 !== a.iridescenceThicknessMinimum && (t.iridescenceThicknessRange[0] = a.iridescenceThicknessMinimum),
                void 0 !== a.iridescenceThicknessMaximum && (t.iridescenceThicknessRange[1] = a.iridescenceThicknessMaximum),
                void 0 !== a.iridescenceThicknessTexture && r.push(n.assignTexture(t, "iridescenceThicknessMap", a.iridescenceThicknessTexture)),
                Promise.all(r)
            }
        }
        class Pl {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_MATERIALS_SHEEN
            }
            getMaterialType(e) {
                const t = this.parser.json.materials[e];
                return t.extensions && t.extensions[this.name] ? Fs : null
            }
            extendMaterialParams(e, t) {
                const n = this.parser
                  , i = n.json.materials[e];
                if (!i.extensions || !i.extensions[this.name])
                    return Promise.resolve();
                const r = [];
                t.sheenColor = new Hi(0,0,0),
                t.sheenRoughness = 0,
                t.sheen = 1;
                const a = i.extensions[this.name];
                if (void 0 !== a.sheenColorFactor) {
                    const e = a.sheenColorFactor;
                    t.sheenColor.setRGB(e[0], e[1], e[2], wt)
                }
                return void 0 !== a.sheenRoughnessFactor && (t.sheenRoughness = a.sheenRoughnessFactor),
                void 0 !== a.sheenColorTexture && r.push(n.assignTexture(t, "sheenColorMap", a.sheenColorTexture, vt)),
                void 0 !== a.sheenRoughnessTexture && r.push(n.assignTexture(t, "sheenRoughnessMap", a.sheenRoughnessTexture)),
                Promise.all(r)
            }
        }
        class Il {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_MATERIALS_TRANSMISSION
            }
            getMaterialType(e) {
                const t = this.parser.json.materials[e];
                return t.extensions && t.extensions[this.name] ? Fs : null
            }
            extendMaterialParams(e, t) {
                const n = this.parser
                  , i = n.json.materials[e];
                if (!i.extensions || !i.extensions[this.name])
                    return Promise.resolve();
                const r = []
                  , a = i.extensions[this.name];
                return void 0 !== a.transmissionFactor && (t.transmission = a.transmissionFactor),
                void 0 !== a.transmissionTexture && r.push(n.assignTexture(t, "transmissionMap", a.transmissionTexture)),
                Promise.all(r)
            }
        }
        class Rl {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_MATERIALS_VOLUME
            }
            getMaterialType(e) {
                const t = this.parser.json.materials[e];
                return t.extensions && t.extensions[this.name] ? Fs : null
            }
            extendMaterialParams(e, t) {
                const n = this.parser
                  , i = n.json.materials[e];
                if (!i.extensions || !i.extensions[this.name])
                    return Promise.resolve();
                const r = []
                  , a = i.extensions[this.name];
                t.thickness = void 0 !== a.thicknessFactor ? a.thicknessFactor : 0,
                void 0 !== a.thicknessTexture && r.push(n.assignTexture(t, "thicknessMap", a.thicknessTexture)),
                t.attenuationDistance = a.attenuationDistance || 1 / 0;
                const s = a.attenuationColor || [1, 1, 1];
                return t.attenuationColor = (new Hi).setRGB(s[0], s[1], s[2], wt),
                Promise.all(r)
            }
        }
        class Ll {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_MATERIALS_IOR
            }
            getMaterialType(e) {
                const t = this.parser.json.materials[e];
                return t.extensions && t.extensions[this.name] ? Fs : null
            }
            extendMaterialParams(e, t) {
                const n = this.parser.json.materials[e];
                if (!n.extensions || !n.extensions[this.name])
                    return Promise.resolve();
                const i = n.extensions[this.name];
                return t.ior = void 0 !== i.ior ? i.ior : 1.5,
                Promise.resolve()
            }
        }
        class Dl {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_MATERIALS_SPECULAR
            }
            getMaterialType(e) {
                const t = this.parser.json.materials[e];
                return t.extensions && t.extensions[this.name] ? Fs : null
            }
            extendMaterialParams(e, t) {
                const n = this.parser
                  , i = n.json.materials[e];
                if (!i.extensions || !i.extensions[this.name])
                    return Promise.resolve();
                const r = []
                  , a = i.extensions[this.name];
                t.specularIntensity = void 0 !== a.specularFactor ? a.specularFactor : 1,
                void 0 !== a.specularTexture && r.push(n.assignTexture(t, "specularIntensityMap", a.specularTexture));
                const s = a.specularColorFactor || [1, 1, 1];
                return t.specularColor = (new Hi).setRGB(s[0], s[1], s[2], wt),
                void 0 !== a.specularColorTexture && r.push(n.assignTexture(t, "specularColorMap", a.specularColorTexture, vt)),
                Promise.all(r)
            }
        }
        class Nl {
            constructor(e) {
                this.parser = e,
                this.name = kl.EXT_MATERIALS_BUMP
            }
            getMaterialType(e) {
                const t = this.parser.json.materials[e];
                return t.extensions && t.extensions[this.name] ? Fs : null
            }
            extendMaterialParams(e, t) {
                const n = this.parser
                  , i = n.json.materials[e];
                if (!i.extensions || !i.extensions[this.name])
                    return Promise.resolve();
                const r = []
                  , a = i.extensions[this.name];
                return t.bumpScale = void 0 !== a.bumpFactor ? a.bumpFactor : 1,
                void 0 !== a.bumpTexture && r.push(n.assignTexture(t, "bumpMap", a.bumpTexture)),
                Promise.all(r)
            }
        }
        class Bl {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_MATERIALS_ANISOTROPY
            }
            getMaterialType(e) {
                const t = this.parser.json.materials[e];
                return t.extensions && t.extensions[this.name] ? Fs : null
            }
            extendMaterialParams(e, t) {
                const n = this.parser
                  , i = n.json.materials[e];
                if (!i.extensions || !i.extensions[this.name])
                    return Promise.resolve();
                const r = []
                  , a = i.extensions[this.name];
                return void 0 !== a.anisotropyStrength && (t.anisotropy = a.anisotropyStrength),
                void 0 !== a.anisotropyRotation && (t.anisotropyRotation = a.anisotropyRotation),
                void 0 !== a.anisotropyTexture && r.push(n.assignTexture(t, "anisotropyMap", a.anisotropyTexture)),
                Promise.all(r)
            }
        }
        class Ul {
            constructor(e) {
                this.parser = e,
                this.name = kl.KHR_TEXTURE_BASISU
            }
            loadTexture(e) {
                const t = this.parser
                  , n = t.json
                  , i = n.textures[e];
                if (!i.extensions || !i.extensions[this.name])
                    return null;
                const r = i.extensions[this.name]
                  , a = t.options.ktx2Loader;
                if (!a) {
                    if (n.extensionsRequired && n.extensionsRequired.indexOf(this.name) >= 0)
                        throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
                    return null
                }
                return t.loadTextureImage(e, r.source, a)
            }
        }
        class zl {
            constructor(e) {
                this.parser = e,
                this.name = kl.EXT_TEXTURE_WEBP,
                this.isSupported = null
            }
            loadTexture(e) {
                const t = this.name
                  , n = this.parser
                  , i = n.json
                  , r = i.textures[e];
                if (!r.extensions || !r.extensions[t])
                    return null;
                const a = r.extensions[t]
                  , s = i.images[a.source];
                let o = n.textureLoader;
                if (s.uri) {
                    const e = n.options.manager.getHandler(s.uri);
                    null !== e && (o = e)
                }
                return this.detectSupport().then((function(r) {
                    if (r)
                        return n.loadTextureImage(e, a.source, o);
                    if (i.extensionsRequired && i.extensionsRequired.indexOf(t) >= 0)
                        throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");
                    return n.loadTexture(e)
                }
                ))
            }
            detectSupport() {
                return this.isSupported || (this.isSupported = new Promise((function(e) {
                    const t = new Image;
                    t.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",
                    t.onload = t.onerror = function() {
                        e(1 === t.height)
                    }
                }
                ))),
                this.isSupported
            }
        }
        class Ol {
            constructor(e) {
                this.parser = e,
                this.name = kl.EXT_TEXTURE_AVIF,
                this.isSupported = null
            }
            loadTexture(e) {
                const t = this.name
                  , n = this.parser
                  , i = n.json
                  , r = i.textures[e];
                if (!r.extensions || !r.extensions[t])
                    return null;
                const a = r.extensions[t]
                  , s = i.images[a.source];
                let o = n.textureLoader;
                if (s.uri) {
                    const e = n.options.manager.getHandler(s.uri);
                    null !== e && (o = e)
                }
                return this.detectSupport().then((function(r) {
                    if (r)
                        return n.loadTextureImage(e, a.source, o);
                    if (i.extensionsRequired && i.extensionsRequired.indexOf(t) >= 0)
                        throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");
                    return n.loadTexture(e)
                }
                ))
            }
            detectSupport() {
                return this.isSupported || (this.isSupported = new Promise((function(e) {
                    const t = new Image;
                    t.src = "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",
                    t.onload = t.onerror = function() {
                        e(1 === t.height)
                    }
                }
                ))),
                this.isSupported
            }
        }
        class Fl {
            constructor(e) {
                this.name = kl.EXT_MESHOPT_COMPRESSION,
                this.parser = e
            }
            loadBufferView(e) {
                const t = this.parser.json
                  , n = t.bufferViews[e];
                if (n.extensions && n.extensions[this.name]) {
                    const e = n.extensions[this.name]
                      , i = this.parser.getDependency("buffer", e.buffer)
                      , r = this.parser.options.meshoptDecoder;
                    if (!r || !r.supported) {
                        if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0)
                            throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
                        return null
                    }
                    return i.then((function(t) {
                        const n = e.byteOffset || 0
                          , i = e.byteLength || 0
                          , a = e.count
                          , s = e.byteStride
                          , o = new Uint8Array(t,n,i);
                        return r.decodeGltfBufferAsync ? r.decodeGltfBufferAsync(a, s, o, e.mode, e.filter).then((function(e) {
                            return e.buffer
                        }
                        )) : r.ready.then((function() {
                            const t = new ArrayBuffer(a * s);
                            return r.decodeGltfBuffer(new Uint8Array(t), a, s, o, e.mode, e.filter),
                            t
                        }
                        ))
                    }
                    ))
                }
                return null
            }
        }
        class Wl {
            constructor(e) {
                this.name = kl.EXT_MESH_GPU_INSTANCING,
                this.parser = e
            }
            createNodeMesh(e) {
                const t = this.parser.json
                  , n = t.nodes[e];
                if (!n.extensions || !n.extensions[this.name] || void 0 === n.mesh)
                    return null;
                const i = t.meshes[n.mesh];
                for (const e of i.primitives)
                    if (e.mode !== Jl.TRIANGLES && e.mode !== Jl.TRIANGLE_STRIP && e.mode !== Jl.TRIANGLE_FAN && void 0 !== e.mode)
                        return null;
                const r = n.extensions[this.name].attributes
                  , a = []
                  , s = {};
                for (const e in r)
                    a.push(this.parser.getDependency("accessor", r[e]).then((t => (s[e] = t,
                    s[e]))));
                return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)),
                Promise.all(a).then((e => {
                    const t = e.pop()
                      , n = t.isGroup ? t.children : [t]
                      , i = e[0].count
                      , r = [];
                    for (const e of n) {
                        const t = new Xn
                          , n = new bn
                          , a = new yn
                          , o = new bn(1,1,1)
                          , l = new pa(e.geometry,e.material,i);
                        for (let e = 0; e < i; e++)
                            s.TRANSLATION && n.fromBufferAttribute(s.TRANSLATION, e),
                            s.ROTATION && a.fromBufferAttribute(s.ROTATION, e),
                            s.SCALE && o.fromBufferAttribute(s.SCALE, e),
                            l.setMatrixAt(e, t.compose(n, a, o));
                        for (const t in s)
                            if ("_COLOR_0" === t) {
                                const e = s[t];
                                l.instanceColor = new aa(e.array,e.itemSize,e.normalized)
                            } else
                                "TRANSLATION" !== t && "ROTATION" !== t && "SCALE" !== t && e.geometry.setAttribute(t, s[t]);
                        ki.prototype.copy.call(l, e),
                        this.parser.assignFinalMaterial(l),
                        r.push(l)
                    }
                    return t.isGroup ? (t.clear(),
                    t.add(...r),
                    t) : r[0]
                }
                )))
            }
        }
        const Hl = "glTF"
          , Vl = 1313821514
          , Gl = 5130562;
        class jl {
            constructor(e) {
                this.name = kl.KHR_BINARY_GLTF,
                this.content = null,
                this.body = null;
                const t = new DataView(e,0,12)
                  , n = new TextDecoder;
                if (this.header = {
                    magic: n.decode(new Uint8Array(e.slice(0, 4))),
                    version: t.getUint32(4, !0),
                    length: t.getUint32(8, !0)
                },
                this.header.magic !== Hl)
                    throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
                if (this.header.version < 2)
                    throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
                const i = this.header.length - 12
                  , r = new DataView(e,12);
                let a = 0;
                for (; a < i; ) {
                    const t = r.getUint32(a, !0);
                    a += 4;
                    const i = r.getUint32(a, !0);
                    if (a += 4,
                    i === Vl) {
                        const i = new Uint8Array(e,12 + a,t);
                        this.content = n.decode(i)
                    } else if (i === Gl) {
                        const n = 12 + a;
                        this.body = e.slice(n, n + t)
                    }
                    a += t
                }
                if (null === this.content)
                    throw new Error("THREE.GLTFLoader: JSON content not found.")
            }
        }
        class Ql {
            constructor(e, t) {
                if (!t)
                    throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
                this.name = kl.KHR_DRACO_MESH_COMPRESSION,
                this.json = e,
                this.dracoLoader = t,
                this.dracoLoader.preload()
            }
            decodePrimitive(e, t) {
                const n = this.json
                  , i = this.dracoLoader
                  , r = e.extensions[this.name].bufferView
                  , a = e.extensions[this.name].attributes
                  , s = {}
                  , o = {}
                  , l = {};
                for (const e in a) {
                    const t = ic[e] || e.toLowerCase();
                    s[t] = a[e]
                }
                for (const t in e.attributes) {
                    const i = ic[t] || t.toLowerCase();
                    if (void 0 !== a[t]) {
                        const r = n.accessors[e.attributes[t]]
                          , a = $l[r.componentType];
                        l[i] = a.name,
                        o[i] = !0 === r.normalized
                    }
                }
                return t.getDependency("bufferView", r).then((function(e) {
                    return new Promise((function(t, n) {
                        i.decodeDracoFile(e, (function(e) {
                            for (const t in e.attributes) {
                                const n = e.attributes[t]
                                  , i = o[t];
                                void 0 !== i && (n.normalized = i)
                            }
                            t(e)
                        }
                        ), s, l, wt, n)
                    }
                    ))
                }
                ))
            }
        }
        class Kl {
            constructor() {
                this.name = kl.KHR_TEXTURE_TRANSFORM
            }
            extendTexture(e, t) {
                return void 0 !== t.texCoord && t.texCoord !== e.channel || void 0 !== t.offset || void 0 !== t.rotation || void 0 !== t.scale ? (e = e.clone(),
                void 0 !== t.texCoord && (e.channel = t.texCoord),
                void 0 !== t.offset && e.offset.fromArray(t.offset),
                void 0 !== t.rotation && (e.rotation = t.rotation),
                void 0 !== t.scale && e.repeat.fromArray(t.scale),
                e.needsUpdate = !0,
                e) : e
            }
        }
        class ql {
            constructor() {
                this.name = kl.KHR_MESH_QUANTIZATION
            }
        }
        class Yl extends Ys {
            constructor(e, t, n, i) {
                super(e, t, n, i)
            }
            copySampleValue_(e) {
                const t = this.resultBuffer
                  , n = this.sampleValues
                  , i = this.valueSize
                  , r = e * i * 3 + i;
                for (let e = 0; e !== i; e++)
                    t[e] = n[r + e];
                return t
            }
            interpolate_(e, t, n, i) {
                const r = this.resultBuffer
                  , a = this.sampleValues
                  , s = this.valueSize
                  , o = 2 * s
                  , l = 3 * s
                  , c = i - t
                  , h = (n - t) / c
                  , d = h * h
                  , u = d * h
                  , p = e * l
                  , f = p - l
                  , m = -2 * u + 3 * d
                  , g = u - d
                  , v = 1 - m
                  , w = g - d + h;
                for (let e = 0; e !== s; e++) {
                    const t = a[f + e + s]
                      , n = a[f + e + o] * c
                      , i = a[p + e + s]
                      , l = a[p + e] * c;
                    r[e] = v * t + w * n + m * i + g * l
                }
                return r
            }
        }
        const Xl = new yn;
        class Zl extends Yl {
            interpolate_(e, t, n, i) {
                const r = super.interpolate_(e, t, n, i);
                return Xl.fromArray(r).normalize().toArray(r),
                r
            }
        }
        const Jl = {
            FLOAT: 5126,
            FLOAT_MAT3: 35675,
            FLOAT_MAT4: 35676,
            FLOAT_VEC2: 35664,
            FLOAT_VEC3: 35665,
            FLOAT_VEC4: 35666,
            LINEAR: 9729,
            REPEAT: 10497,
            SAMPLER_2D: 35678,
            POINTS: 0,
            LINES: 1,
            LINE_LOOP: 2,
            LINE_STRIP: 3,
            TRIANGLES: 4,
            TRIANGLE_STRIP: 5,
            TRIANGLE_FAN: 6,
            UNSIGNED_BYTE: 5121,
            UNSIGNED_SHORT: 5123
        }
          , $l = {
            5120: Int8Array,
            5121: Uint8Array,
            5122: Int16Array,
            5123: Uint16Array,
            5125: Uint32Array,
            5126: Float32Array
        }
          , ec = {
            9728: le,
            9729: de,
            9984: ce,
            9985: ue,
            9986: he,
            9987: pe
        }
          , tc = {
            33071: se,
            33648: oe,
            10497: ae
        }
          , nc = {
            SCALAR: 1,
            VEC2: 2,
            VEC3: 3,
            VEC4: 4,
            MAT2: 4,
            MAT3: 9,
            MAT4: 16
        }
          , ic = {
            POSITION: "position",
            NORMAL: "normal",
            TANGENT: "tangent",
            TEXCOORD_0: "uv",
            TEXCOORD_1: "uv1",
            TEXCOORD_2: "uv2",
            TEXCOORD_3: "uv3",
            COLOR_0: "color",
            WEIGHTS_0: "skinWeight",
            JOINTS_0: "skinIndex"
        }
          , rc = {
            scale: "scale",
            translation: "position",
            rotation: "quaternion",
            weights: "morphTargetInfluences"
        }
          , ac = {
            CUBICSPLINE: void 0,
            LINEAR: dt,
            STEP: ht
        }
          , sc = "OPAQUE"
          , oc = "MASK"
          , lc = "BLEND";
        function cc(e, t, n) {
            for (const i in n.extensions)
                void 0 === e[i] && (t.userData.gltfExtensions = t.userData.gltfExtensions || {},
                t.userData.gltfExtensions[i] = n.extensions[i])
        }
        function hc(e, t) {
            void 0 !== t.extras && ("object" == typeof t.extras ? Object.assign(e.userData, t.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + t.extras))
        }
        function dc(e, t) {
            if (e.updateMorphTargets(),
            void 0 !== t.weights)
                for (let n = 0, i = t.weights.length; n < i; n++)
                    e.morphTargetInfluences[n] = t.weights[n];
            if (t.extras && Array.isArray(t.extras.targetNames)) {
                const n = t.extras.targetNames;
                if (e.morphTargetInfluences.length === n.length) {
                    e.morphTargetDictionary = {};
                    for (let t = 0, i = n.length; t < i; t++)
                        e.morphTargetDictionary[n[t]] = t
                } else
                    console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")
            }
        }
        function uc(e) {
            let t;
            const n = e.extensions && e.extensions[kl.KHR_DRACO_MESH_COMPRESSION];
            if (t = n ? "draco:" + n.bufferView + ":" + n.indices + ":" + pc(n.attributes) : e.indices + ":" + pc(e.attributes) + ":" + e.mode,
            void 0 !== e.targets)
                for (let n = 0, i = e.targets.length; n < i; n++)
                    t += ":" + pc(e.targets[n]);
            return t
        }
        function pc(e) {
            let t = "";
            const n = Object.keys(e).sort();
            for (let i = 0, r = n.length; i < r; i++)
                t += n[i] + ":" + e[n[i]] + ";";
            return t
        }
        function fc(e) {
            switch (e) {
            case Int8Array:
                return 1 / 127;
            case Uint8Array:
                return 1 / 255;
            case Int16Array:
                return 1 / 32767;
            case Uint16Array:
                return 1 / 65535;
            default:
                throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")
            }
        }
        const mc = new Xn;
        class gc {
            constructor(e={}, t={}) {
                this.json = e,
                this.extensions = {},
                this.plugins = {},
                this.options = t,
                this.cache = new xl,
                this.associations = new Map,
                this.primitiveCache = {},
                this.nodeCache = {},
                this.meshCache = {
                    refs: {},
                    uses: {}
                },
                this.cameraCache = {
                    refs: {},
                    uses: {}
                },
                this.lightCache = {
                    refs: {},
                    uses: {}
                },
                this.sourceCache = {},
                this.textureCache = {},
                this.nodeNamesUsed = {};
                let n = !1
                  , i = -1
                  , r = !1
                  , a = -1;
                if ("undefined" != typeof navigator) {
                    const e = navigator.userAgent;
                    n = !0 === /^((?!chrome|android).)*safari/i.test(e);
                    const t = e.match(/Version\/(\d+)/);
                    i = n && t ? parseInt(t[1], 10) : -1,
                    r = e.indexOf("Firefox") > -1,
                    a = r ? e.match(/Firefox\/([0-9]+)\./)[1] : -1
                }
                "undefined" == typeof createImageBitmap || n && i < 17 || r && a < 98 ? this.textureLoader = new wo(this.options.manager) : this.textureLoader = new Bo(this.options.manager),
                this.textureLoader.setCrossOrigin(this.options.crossOrigin),
                this.textureLoader.setRequestHeader(this.options.requestHeader),
                this.fileLoader = new go(this.options.manager),
                this.fileLoader.setResponseType("arraybuffer"),
                "use-credentials" === this.options.crossOrigin && this.fileLoader.setWithCredentials(!0)
            }
            setExtensions(e) {
                this.extensions = e
            }
            setPlugins(e) {
                this.plugins = e
            }
            parse(e, t) {
                const n = this
                  , i = this.json
                  , r = this.extensions;
                this.cache.removeAll(),
                this.nodeCache = {},
                this._invokeAll((function(e) {
                    return e._markDefs && e._markDefs()
                }
                )),
                Promise.all(this._invokeAll((function(e) {
                    return e.beforeRoot && e.beforeRoot()
                }
                ))).then((function() {
                    return Promise.all([n.getDependencies("scene"), n.getDependencies("animation"), n.getDependencies("camera")])
                }
                )).then((function(t) {
                    const a = {
                        scene: t[0][i.scene || 0],
                        scenes: t[0],
                        animations: t[1],
                        cameras: t[2],
                        asset: i.asset,
                        parser: n,
                        userData: {}
                    };
                    return cc(r, a, i),
                    hc(a, i),
                    Promise.all(n._invokeAll((function(e) {
                        return e.afterRoot && e.afterRoot(a)
                    }
                    ))).then((function() {
                        for (const e of a.scenes)
                            e.updateMatrixWorld();
                        e(a)
                    }
                    ))
                }
                )).catch(t)
            }
            _markDefs() {
                const e = this.json.nodes || []
                  , t = this.json.skins || []
                  , n = this.json.meshes || [];
                for (let n = 0, i = t.length; n < i; n++) {
                    const i = t[n].joints;
                    for (let t = 0, n = i.length; t < n; t++)
                        e[i[t]].isBone = !0
                }
                for (let t = 0, i = e.length; t < i; t++) {
                    const i = e[t];
                    void 0 !== i.mesh && (this._addNodeRef(this.meshCache, i.mesh),
                    void 0 !== i.skin && (n[i.mesh].isSkinnedMesh = !0)),
                    void 0 !== i.camera && this._addNodeRef(this.cameraCache, i.camera)
                }
            }
            _addNodeRef(e, t) {
                void 0 !== t && (void 0 === e.refs[t] && (e.refs[t] = e.uses[t] = 0),
                e.refs[t]++)
            }
            _getNodeRef(e, t, n) {
                if (e.refs[t] <= 1)
                    return n;
                const i = n.clone()
                  , r = (e, t) => {
                    const n = this.associations.get(e);
                    null != n && this.associations.set(t, n);
                    for (const [n,i] of e.children.entries())
                        r(i, t.children[n])
                }
                ;
                return r(n, i),
                i.name += "_instance_" + e.uses[t]++,
                i
            }
            _invokeOne(e) {
                const t = Object.values(this.plugins);
                t.push(this);
                for (let n = 0; n < t.length; n++) {
                    const i = e(t[n]);
                    if (i)
                        return i
                }
                return null
            }
            _invokeAll(e) {
                const t = Object.values(this.plugins);
                t.unshift(this);
                const n = [];
                for (let i = 0; i < t.length; i++) {
                    const r = e(t[i]);
                    r && n.push(r)
                }
                return n
            }
            getDependency(e, t) {
                const n = e + ":" + t;
                let i = this.cache.get(n);
                if (!i) {
                    switch (e) {
                    case "scene":
                        i = this.loadScene(t);
                        break;
                    case "node":
                        i = this._invokeOne((function(e) {
                            return e.loadNode && e.loadNode(t)
                        }
                        ));
                        break;
                    case "mesh":
                        i = this._invokeOne((function(e) {
                            return e.loadMesh && e.loadMesh(t)
                        }
                        ));
                        break;
                    case "accessor":
                        i = this.loadAccessor(t);
                        break;
                    case "bufferView":
                        i = this._invokeOne((function(e) {
                            return e.loadBufferView && e.loadBufferView(t)
                        }
                        ));
                        break;
                    case "buffer":
                        i = this.loadBuffer(t);
                        break;
                    case "material":
                        i = this._invokeOne((function(e) {
                            return e.loadMaterial && e.loadMaterial(t)
                        }
                        ));
                        break;
                    case "texture":
                        i = this._invokeOne((function(e) {
                            return e.loadTexture && e.loadTexture(t)
                        }
                        ));
                        break;
                    case "skin":
                        i = this.loadSkin(t);
                        break;
                    case "animation":
                        i = this._invokeOne((function(e) {
                            return e.loadAnimation && e.loadAnimation(t)
                        }
                        ));
                        break;
                    case "camera":
                        i = this.loadCamera(t);
                        break;
                    default:
                        if (i = this._invokeOne((function(n) {
                            return n != this && n.getDependency && n.getDependency(e, t)
                        }
                        )),
                        !i)
                            throw new Error("Unknown type: " + e)
                    }
                    this.cache.add(n, i)
                }
                return i
            }
            getDependencies(e) {
                let t = this.cache.get(e);
                if (!t) {
                    const n = this
                      , i = this.json[e + ("mesh" === e ? "es" : "s")] || [];
                    t = Promise.all(i.map((function(t, i) {
                        return n.getDependency(e, i)
                    }
                    ))),
                    this.cache.add(e, t)
                }
                return t
            }
            loadBuffer(e) {
                const t = this.json.buffers[e]
                  , n = this.fileLoader;
                if (t.type && "arraybuffer" !== t.type)
                    throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
                if (void 0 === t.uri && 0 === e)
                    return Promise.resolve(this.extensions[kl.KHR_BINARY_GLTF].body);
                const i = this.options;
                return new Promise((function(e, r) {
                    n.load(No.resolveURL(t.uri, i.path), e, void 0, (function() {
                        r(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'))
                    }
                    ))
                }
                ))
            }
            loadBufferView(e) {
                const t = this.json.bufferViews[e];
                return this.getDependency("buffer", t.buffer).then((function(e) {
                    const n = t.byteLength || 0
                      , i = t.byteOffset || 0;
                    return e.slice(i, i + n)
                }
                ))
            }
            loadAccessor(e) {
                const t = this
                  , n = this.json
                  , i = this.json.accessors[e];
                if (void 0 === i.bufferView && void 0 === i.sparse) {
                    const e = nc[i.type]
                      , t = $l[i.componentType]
                      , n = !0 === i.normalized
                      , r = new t(i.count * e);
                    return Promise.resolve(new Xi(r,e,n))
                }
                const r = [];
                return void 0 !== i.bufferView ? r.push(this.getDependency("bufferView", i.bufferView)) : r.push(null),
                void 0 !== i.sparse && (r.push(this.getDependency("bufferView", i.sparse.indices.bufferView)),
                r.push(this.getDependency("bufferView", i.sparse.values.bufferView))),
                Promise.all(r).then((function(e) {
                    const r = e[0]
                      , a = nc[i.type]
                      , s = $l[i.componentType]
                      , o = s.BYTES_PER_ELEMENT
                      , l = o * a
                      , c = i.byteOffset || 0
                      , h = void 0 !== i.bufferView ? n.bufferViews[i.bufferView].byteStride : void 0
                      , d = !0 === i.normalized;
                    let u, p;
                    if (h && h !== l) {
                        const e = Math.floor(c / h)
                          , n = "InterleavedBuffer:" + i.bufferView + ":" + i.componentType + ":" + e + ":" + i.count;
                        let l = t.cache.get(n);
                        l || (u = new s(r,e * h,i.count * h / o),
                        l = new Wr(u,h / o),
                        t.cache.add(n, l)),
                        p = new Vr(l,a,c % h / o,d)
                    } else
                        u = null === r ? new s(i.count * a) : new s(r,c,i.count * a),
                        p = new Xi(u,a,d);
                    if (void 0 !== i.sparse) {
                        const t = nc.SCALAR
                          , n = $l[i.sparse.indices.componentType]
                          , o = i.sparse.indices.byteOffset || 0
                          , l = i.sparse.values.byteOffset || 0
                          , c = new n(e[1],o,i.sparse.count * t)
                          , h = new s(e[2],l,i.sparse.count * a);
                        null !== r && (p = new Xi(p.array.slice(),p.itemSize,p.normalized)),
                        p.normalized = !1;
                        for (let e = 0, t = c.length; e < t; e++) {
                            const t = c[e];
                            if (p.setX(t, h[e * a]),
                            a >= 2 && p.setY(t, h[e * a + 1]),
                            a >= 3 && p.setZ(t, h[e * a + 2]),
                            a >= 4 && p.setW(t, h[e * a + 3]),
                            a >= 5)
                                throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")
                        }
                        p.normalized = d
                    }
                    return p
                }
                ))
            }
            loadTexture(e) {
                const t = this.json
                  , n = this.options
                  , i = t.textures[e].source
                  , r = t.images[i];
                let a = this.textureLoader;
                if (r.uri) {
                    const e = n.manager.getHandler(r.uri);
                    null !== e && (a = e)
                }
                return this.loadTextureImage(e, i, a)
            }
            loadTextureImage(e, t, n) {
                const i = this
                  , r = this.json
                  , a = r.textures[e]
                  , s = r.images[t]
                  , o = (s.uri || s.bufferView) + ":" + a.sampler;
                if (this.textureCache[o])
                    return this.textureCache[o];
                const l = this.loadImageSource(t, n).then((function(t) {
                    t.flipY = !1,
                    t.name = a.name || s.name || "",
                    "" === t.name && "string" == typeof s.uri && !1 === s.uri.startsWith("data:image/") && (t.name = s.uri);
                    const n = (r.samplers || {})[a.sampler] || {};
                    return t.magFilter = ec[n.magFilter] || de,
                    t.minFilter = ec[n.minFilter] || pe,
                    t.wrapS = tc[n.wrapS] || ae,
                    t.wrapT = tc[n.wrapT] || ae,
                    t.generateMipmaps = !t.isCompressedTexture && t.minFilter !== le && t.minFilter !== de,
                    i.associations.set(t, {
                        textures: e
                    }),
                    t
                }
                )).catch((function() {
                    return null
                }
                ));
                return this.textureCache[o] = l,
                l
            }
            loadImageSource(e, t) {
                const n = this
                  , i = this.json
                  , r = this.options;
                if (void 0 !== this.sourceCache[e])
                    return this.sourceCache[e].then((e => e.clone()));
                const a = i.images[e]
                  , s = self.URL || self.webkitURL;
                let o = a.uri || ""
                  , l = !1;
                if (void 0 !== a.bufferView)
                    o = n.getDependency("bufferView", a.bufferView).then((function(e) {
                        l = !0;
                        const t = new Blob([e],{
                            type: a.mimeType
                        });
                        return o = s.createObjectURL(t),
                        o
                    }
                    ));
                else if (void 0 === a.uri)
                    throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
                const c = Promise.resolve(o).then((function(e) {
                    return new Promise((function(n, i) {
                        let a = n;
                        !0 === t.isImageBitmapLoader && (a = function(e) {
                            const t = new pn(e);
                            t.needsUpdate = !0,
                            n(t)
                        }
                        ),
                        t.load(No.resolveURL(e, r.path), a, void 0, i)
                    }
                    ))
                }
                )).then((function(e) {
                    var t;
                    return !0 === l && s.revokeObjectURL(o),
                    hc(e, a),
                    e.userData.mimeType = a.mimeType || ((t = a.uri).search(/\.jpe?g($|\?)/i) > 0 || 0 === t.search(/^data\:image\/jpeg/) ? "image/jpeg" : t.search(/\.webp($|\?)/i) > 0 || 0 === t.search(/^data\:image\/webp/) ? "image/webp" : t.search(/\.ktx2($|\?)/i) > 0 || 0 === t.search(/^data\:image\/ktx2/) ? "image/ktx2" : "image/png"),
                    e
                }
                )).catch((function(e) {
                    throw console.error("THREE.GLTFLoader: Couldn't load texture", o),
                    e
                }
                ));
                return this.sourceCache[e] = c,
                c
            }
            assignTexture(e, t, n, i) {
                const r = this;
                return this.getDependency("texture", n.index).then((function(a) {
                    if (!a)
                        return null;
                    if (void 0 !== n.texCoord && n.texCoord > 0 && ((a = a.clone()).channel = n.texCoord),
                    r.extensions[kl.KHR_TEXTURE_TRANSFORM]) {
                        const e = void 0 !== n.extensions ? n.extensions[kl.KHR_TEXTURE_TRANSFORM] : void 0;
                        if (e) {
                            const t = r.associations.get(a);
                            a = r.extensions[kl.KHR_TEXTURE_TRANSFORM].extendTexture(a, e),
                            r.associations.set(a, t)
                        }
                    }
                    return void 0 !== i && (a.colorSpace = i),
                    e[t] = a,
                    a
                }
                ))
            }
            assignFinalMaterial(e) {
                const t = e.geometry;
                let n = e.material;
                const i = void 0 === t.attributes.tangent
                  , r = void 0 !== t.attributes.color
                  , a = void 0 === t.attributes.normal;
                if (e.isPoints) {
                    const e = "PointsMaterial:" + n.uuid;
                    let t = this.cache.get(e);
                    t || (t = new Na,
                    ji.prototype.copy.call(t, n),
                    t.color.copy(n.color),
                    t.map = n.map,
                    t.sizeAttenuation = !1,
                    this.cache.add(e, t)),
                    n = t
                } else if (e.isLine) {
                    const e = "LineBasicMaterial:" + n.uuid;
                    let t = this.cache.get(e);
                    t || (t = new Aa,
                    ji.prototype.copy.call(t, n),
                    t.color.copy(n.color),
                    t.map = n.map,
                    this.cache.add(e, t)),
                    n = t
                }
                if (i || r || a) {
                    let e = "ClonedMaterial:" + n.uuid + ":";
                    i && (e += "derivative-tangents:"),
                    r && (e += "vertex-colors:"),
                    a && (e += "flat-shading:");
                    let t = this.cache.get(e);
                    t || (t = n.clone(),
                    r && (t.vertexColors = !0),
                    a && (t.flatShading = !0),
                    i && (t.normalScale && (t.normalScale.y *= -1),
                    t.clearcoatNormalScale && (t.clearcoatNormalScale.y *= -1)),
                    this.cache.add(e, t),
                    this.associations.set(t, this.associations.get(n))),
                    n = t
                }
                e.material = n
            }
            getMaterialType() {
                return Os
            }
            loadMaterial(e) {
                const t = this
                  , n = this.json
                  , i = this.extensions
                  , r = n.materials[e];
                let a;
                const s = {}
                  , o = [];
                if ((r.extensions || {})[kl.KHR_MATERIALS_UNLIT]) {
                    const e = i[kl.KHR_MATERIALS_UNLIT];
                    a = e.getMaterialType(),
                    o.push(e.extendParams(s, r, t))
                } else {
                    const n = r.pbrMetallicRoughness || {};
                    if (s.color = new Hi(1,1,1),
                    s.opacity = 1,
                    Array.isArray(n.baseColorFactor)) {
                        const e = n.baseColorFactor;
                        s.color.setRGB(e[0], e[1], e[2], wt),
                        s.opacity = e[3]
                    }
                    void 0 !== n.baseColorTexture && o.push(t.assignTexture(s, "map", n.baseColorTexture, vt)),
                    s.metalness = void 0 !== n.metallicFactor ? n.metallicFactor : 1,
                    s.roughness = void 0 !== n.roughnessFactor ? n.roughnessFactor : 1,
                    void 0 !== n.metallicRoughnessTexture && (o.push(t.assignTexture(s, "metalnessMap", n.metallicRoughnessTexture)),
                    o.push(t.assignTexture(s, "roughnessMap", n.metallicRoughnessTexture))),
                    a = this._invokeOne((function(t) {
                        return t.getMaterialType && t.getMaterialType(e)
                    }
                    )),
                    o.push(Promise.all(this._invokeAll((function(t) {
                        return t.extendMaterialParams && t.extendMaterialParams(e, s)
                    }
                    ))))
                }
                !0 === r.doubleSided && (s.side = 2);
                const l = r.alphaMode || sc;
                if (l === lc ? (s.transparent = !0,
                s.depthWrite = !1) : (s.transparent = !1,
                l === oc && (s.alphaTest = void 0 !== r.alphaCutoff ? r.alphaCutoff : .5)),
                void 0 !== r.normalTexture && a !== Qi && (o.push(t.assignTexture(s, "normalMap", r.normalTexture)),
                s.normalScale = new Qt(1,1),
                void 0 !== r.normalTexture.scale)) {
                    const e = r.normalTexture.scale;
                    s.normalScale.set(e, e)
                }
                if (void 0 !== r.occlusionTexture && a !== Qi && (o.push(t.assignTexture(s, "aoMap", r.occlusionTexture)),
                void 0 !== r.occlusionTexture.strength && (s.aoMapIntensity = r.occlusionTexture.strength)),
                void 0 !== r.emissiveFactor && a !== Qi) {
                    const e = r.emissiveFactor;
                    s.emissive = (new Hi).setRGB(e[0], e[1], e[2], wt)
                }
                return void 0 !== r.emissiveTexture && a !== Qi && o.push(t.assignTexture(s, "emissiveMap", r.emissiveTexture, vt)),
                Promise.all(o).then((function() {
                    const n = new a(s);
                    return r.name && (n.name = r.name),
                    hc(n, r),
                    t.associations.set(n, {
                        materials: e
                    }),
                    r.extensions && cc(i, n, r),
                    n
                }
                ))
            }
            createUniqueName(e) {
                const t = Go.sanitizeNodeName(e || "");
                return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0,
                t)
            }
            loadGeometries(e) {
                const t = this
                  , n = this.extensions
                  , i = this.primitiveCache;
                function r(e) {
                    return n[kl.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e, t).then((function(n) {
                        return vc(n, e, t)
                    }
                    ))
                }
                const a = [];
                for (let n = 0, s = e.length; n < s; n++) {
                    const s = e[n]
                      , o = uc(s)
                      , l = i[o];
                    if (l)
                        a.push(l.promise);
                    else {
                        let e;
                        e = s.extensions && s.extensions[kl.KHR_DRACO_MESH_COMPRESSION] ? r(s) : vc(new or, s, t),
                        i[o] = {
                            primitive: s,
                            promise: e
                        },
                        a.push(e)
                    }
                }
                return Promise.all(a)
            }
            loadMesh(e) {
                const t = this
                  , n = this.json
                  , i = this.extensions
                  , r = n.meshes[e]
                  , a = r.primitives
                  , s = [];
                for (let e = 0, t = a.length; e < t; e++) {
                    const t = void 0 === a[e].material ? (void 0 === (o = this.cache).DefaultMaterial && (o.DefaultMaterial = new Os({
                        color: 16777215,
                        emissive: 0,
                        metalness: 1,
                        roughness: 1,
                        transparent: !1,
                        depthTest: !0,
                        side: 0
                    })),
                    o.DefaultMaterial) : this.getDependency("material", a[e].material);
                    s.push(t)
                }
                var o;
                return s.push(t.loadGeometries(a)),
                Promise.all(s).then((function(n) {
                    const s = n.slice(0, n.length - 1)
                      , o = n[n.length - 1]
                      , l = [];
                    for (let n = 0, c = o.length; n < c; n++) {
                        const c = o[n]
                          , h = a[n];
                        let d;
                        const u = s[n];
                        if (h.mode === Jl.TRIANGLES || h.mode === Jl.TRIANGLE_STRIP || h.mode === Jl.TRIANGLE_FAN || void 0 === h.mode)
                            d = !0 === r.isSkinnedMesh ? new $r(c,u) : new yr(c,u),
                            !0 === d.isSkinnedMesh && d.normalizeSkinWeights(),
                            h.mode === Jl.TRIANGLE_STRIP ? d.geometry = bl(d.geometry, 1) : h.mode === Jl.TRIANGLE_FAN && (d.geometry = bl(d.geometry, 2));
                        else if (h.mode === Jl.LINES)
                            d = new La(c,u);
                        else if (h.mode === Jl.LINE_STRIP)
                            d = new Ca(c,u);
                        else if (h.mode === Jl.LINE_LOOP)
                            d = new Da(c,u);
                        else {
                            if (h.mode !== Jl.POINTS)
                                throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + h.mode);
                            d = new Fa(c,u)
                        }
                        Object.keys(d.geometry.morphAttributes).length > 0 && dc(d, r),
                        d.name = t.createUniqueName(r.name || "mesh_" + e),
                        hc(d, r),
                        h.extensions && cc(i, d, h),
                        t.assignFinalMaterial(d),
                        l.push(d)
                    }
                    for (let n = 0, i = l.length; n < i; n++)
                        t.associations.set(l[n], {
                            meshes: e,
                            primitives: n
                        });
                    if (1 === l.length)
                        return r.extensions && cc(i, l[0], r),
                        l[0];
                    const c = new Br;
                    r.extensions && cc(i, c, r),
                    t.associations.set(c, {
                        meshes: e
                    });
                    for (let e = 0, t = l.length; e < t; e++)
                        c.add(l[e]);
                    return c
                }
                ))
            }
            loadCamera(e) {
                let t;
                const n = this.json.cameras[e]
                  , i = n[n.type];
                if (i)
                    return "perspective" === n.type ? t = new Ir(jt.radToDeg(i.yfov),i.aspectRatio || 1,i.znear || 1,i.zfar || 2e6) : "orthographic" === n.type && (t = new Ro(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),
                    n.name && (t.name = this.createUniqueName(n.name)),
                    hc(t, n),
                    Promise.resolve(t);
                console.warn("THREE.GLTFLoader: Missing camera parameters.")
            }
            loadSkin(e) {
                const t = this.json.skins[e]
                  , n = [];
                for (let e = 0, i = t.joints.length; e < i; e++)
                    n.push(this._loadNodeShallow(t.joints[e]));
                return void 0 !== t.inverseBindMatrices ? n.push(this.getDependency("accessor", t.inverseBindMatrices)) : n.push(null),
                Promise.all(n).then((function(e) {
                    const n = e.pop()
                      , i = e
                      , r = []
                      , a = [];
                    for (let e = 0, s = i.length; e < s; e++) {
                        const s = i[e];
                        if (s) {
                            r.push(s);
                            const t = new Xn;
                            null !== n && t.fromArray(n.array, 16 * e),
                            a.push(t)
                        } else
                            console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[e])
                    }
                    return new ra(r,a)
                }
                ))
            }
            loadAnimation(e) {
                const t = this.json
                  , n = this
                  , i = t.animations[e]
                  , r = i.name ? i.name : "animation_" + e
                  , a = []
                  , s = []
                  , o = []
                  , l = []
                  , c = [];
                for (let e = 0, t = i.channels.length; e < t; e++) {
                    const t = i.channels[e]
                      , n = i.samplers[t.sampler]
                      , r = t.target
                      , h = r.node
                      , d = void 0 !== i.parameters ? i.parameters[n.input] : n.input
                      , u = void 0 !== i.parameters ? i.parameters[n.output] : n.output;
                    void 0 !== r.node && (a.push(this.getDependency("node", h)),
                    s.push(this.getDependency("accessor", d)),
                    o.push(this.getDependency("accessor", u)),
                    l.push(n),
                    c.push(r))
                }
                return Promise.all([Promise.all(a), Promise.all(s), Promise.all(o), Promise.all(l), Promise.all(c)]).then((function(e) {
                    const t = e[0]
                      , i = e[1]
                      , a = e[2]
                      , s = e[3]
                      , o = e[4]
                      , l = [];
                    for (let e = 0, r = t.length; e < r; e++) {
                        const r = t[e]
                          , c = i[e]
                          , h = a[e]
                          , d = s[e]
                          , u = o[e];
                        if (void 0 === r)
                            continue;
                        r.updateMatrix && r.updateMatrix();
                        const p = n._createAnimationTracks(r, c, h, d, u);
                        if (p)
                            for (let e = 0; e < p.length; e++)
                                l.push(p[e])
                    }
                    return new oo(r,void 0,l)
                }
                ))
            }
            createNodeMesh(e) {
                const t = this.json
                  , n = this
                  , i = t.nodes[e];
                return void 0 === i.mesh ? null : n.getDependency("mesh", i.mesh).then((function(e) {
                    const t = n._getNodeRef(n.meshCache, i.mesh, e);
                    return void 0 !== i.weights && t.traverse((function(e) {
                        if (e.isMesh)
                            for (let t = 0, n = i.weights.length; t < n; t++)
                                e.morphTargetInfluences[t] = i.weights[t]
                    }
                    )),
                    t
                }
                ))
            }
            loadNode(e) {
                const t = this
                  , n = this.json.nodes[e]
                  , i = t._loadNodeShallow(e)
                  , r = []
                  , a = n.children || [];
                for (let e = 0, n = a.length; e < n; e++)
                    r.push(t.getDependency("node", a[e]));
                const s = void 0 === n.skin ? Promise.resolve(null) : t.getDependency("skin", n.skin);
                return Promise.all([i, Promise.all(r), s]).then((function(e) {
                    const t = e[0]
                      , n = e[1]
                      , i = e[2];
                    null !== i && t.traverse((function(e) {
                        e.isSkinnedMesh && e.bind(i, mc)
                    }
                    ));
                    for (let e = 0, i = n.length; e < i; e++)
                        t.add(n[e]);
                    return t
                }
                ))
            }
            _loadNodeShallow(e) {
                const t = this.json
                  , n = this.extensions
                  , i = this;
                if (void 0 !== this.nodeCache[e])
                    return this.nodeCache[e];
                const r = t.nodes[e]
                  , a = r.name ? i.createUniqueName(r.name) : ""
                  , s = []
                  , o = i._invokeOne((function(t) {
                    return t.createNodeMesh && t.createNodeMesh(e)
                }
                ));
                return o && s.push(o),
                void 0 !== r.camera && s.push(i.getDependency("camera", r.camera).then((function(e) {
                    return i._getNodeRef(i.cameraCache, r.camera, e)
                }
                ))),
                i._invokeAll((function(t) {
                    return t.createNodeAttachment && t.createNodeAttachment(e)
                }
                )).forEach((function(e) {
                    s.push(e)
                }
                )),
                this.nodeCache[e] = Promise.all(s).then((function(t) {
                    let s;
                    if (s = !0 === r.isBone ? new ea : t.length > 1 ? new Br : 1 === t.length ? t[0] : new ki,
                    s !== t[0])
                        for (let e = 0, n = t.length; e < n; e++)
                            s.add(t[e]);
                    if (r.name && (s.userData.name = r.name,
                    s.name = a),
                    hc(s, r),
                    r.extensions && cc(n, s, r),
                    void 0 !== r.matrix) {
                        const e = new Xn;
                        e.fromArray(r.matrix),
                        s.applyMatrix4(e)
                    } else
                        void 0 !== r.translation && s.position.fromArray(r.translation),
                        void 0 !== r.rotation && s.quaternion.fromArray(r.rotation),
                        void 0 !== r.scale && s.scale.fromArray(r.scale);
                    return i.associations.has(s) || i.associations.set(s, {}),
                    i.associations.get(s).nodes = e,
                    s
                }
                )),
                this.nodeCache[e]
            }
            loadScene(e) {
                const t = this.extensions
                  , n = this.json.scenes[e]
                  , i = this
                  , r = new Br;
                n.name && (r.name = i.createUniqueName(n.name)),
                hc(r, n),
                n.extensions && cc(t, r, n);
                const a = n.nodes || []
                  , s = [];
                for (let e = 0, t = a.length; e < t; e++)
                    s.push(i.getDependency("node", a[e]));
                return Promise.all(s).then((function(e) {
                    for (let t = 0, n = e.length; t < n; t++)
                        r.add(e[t]);
                    return i.associations = (e => {
                        const t = new Map;
                        for (const [e,n] of i.associations)
                            (e instanceof ji || e instanceof pn) && t.set(e, n);
                        return e.traverse((e => {
                            const n = i.associations.get(e);
                            null != n && t.set(e, n)
                        }
                        )),
                        t
                    }
                    )(r),
                    r
                }
                ))
            }
            _createAnimationTracks(e, t, n, i, r) {
                const a = []
                  , s = e.name ? e.name : e.uuid
                  , o = [];
                let l;
                switch (rc[r.path] === rc.weights ? e.traverse((function(e) {
                    e.morphTargetInfluences && o.push(e.name ? e.name : e.uuid)
                }
                )) : o.push(s),
                rc[r.path]) {
                case rc.weights:
                    l = no;
                    break;
                case rc.rotation:
                    l = ro;
                    break;
                case rc.position:
                case rc.scale:
                    l = so;
                    break;
                default:
                    if (1 === n.itemSize)
                        l = no;
                    else
                        l = so
                }
                const c = void 0 !== i.interpolation ? ac[i.interpolation] : dt
                  , h = this._getArrayFromAccessor(n);
                for (let e = 0, n = o.length; e < n; e++) {
                    const n = new l(o[e] + "." + rc[r.path],t.array,h,c);
                    "CUBICSPLINE" === i.interpolation && this._createCubicSplineTrackInterpolant(n),
                    a.push(n)
                }
                return a
            }
            _getArrayFromAccessor(e) {
                let t = e.array;
                if (e.normalized) {
                    const e = fc(t.constructor)
                      , n = new Float32Array(t.length);
                    for (let i = 0, r = t.length; i < r; i++)
                        n[i] = t[i] * e;
                    t = n
                }
                return t
            }
            _createCubicSplineTrackInterpolant(e) {
                e.createInterpolant = function(e) {
                    return new (this instanceof ro ? Zl : Yl)(this.times,this.values,this.getValueSize() / 3,e)
                }
                ,
                e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0
            }
        }
        function vc(e, t, n) {
            const i = t.attributes
              , r = [];
            function a(t, i) {
                return n.getDependency("accessor", t).then((function(t) {
                    e.setAttribute(i, t)
                }
                ))
            }
            for (const t in i) {
                const n = ic[t] || t.toLowerCase();
                n in e.attributes || r.push(a(i[t], n))
            }
            if (void 0 !== t.indices && !e.index) {
                const i = n.getDependency("accessor", t.indices).then((function(t) {
                    e.setIndex(t)
                }
                ));
                r.push(i)
            }
            return rn.workingColorSpace !== wt && "COLOR_0"in i && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${rn.workingColorSpace}" not supported.`),
            hc(e, t),
            function(e, t, n) {
                const i = t.attributes
                  , r = new kn;
                if (void 0 === i.POSITION)
                    return;
                {
                    const e = n.json.accessors[i.POSITION]
                      , t = e.min
                      , a = e.max;
                    if (void 0 === t || void 0 === a)
                        return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
                    if (r.set(new bn(t[0],t[1],t[2]), new bn(a[0],a[1],a[2])),
                    e.normalized) {
                        const t = fc($l[e.componentType]);
                        r.min.multiplyScalar(t),
                        r.max.multiplyScalar(t)
                    }
                }
                const a = t.targets;
                if (void 0 !== a) {
                    const e = new bn
                      , t = new bn;
                    for (let i = 0, r = a.length; i < r; i++) {
                        const r = a[i];
                        if (void 0 !== r.POSITION) {
                            const i = n.json.accessors[r.POSITION]
                              , a = i.min
                              , s = i.max;
                            if (void 0 !== a && void 0 !== s) {
                                if (t.setX(Math.max(Math.abs(a[0]), Math.abs(s[0]))),
                                t.setY(Math.max(Math.abs(a[1]), Math.abs(s[1]))),
                                t.setZ(Math.max(Math.abs(a[2]), Math.abs(s[2]))),
                                i.normalized) {
                                    const e = fc($l[i.componentType]);
                                    t.multiplyScalar(e)
                                }
                                e.max(t)
                            } else
                                console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")
                        }
                    }
                    r.expandByVector(e)
                }
                e.boundingBox = r;
                const s = new Wn;
                r.getCenter(s.center),
                s.radius = r.min.distanceTo(r.max) / 2,
                e.boundingSphere = s
            }(e, t, n),
            Promise.all(r).then((function() {
                return void 0 !== t.targets ? function(e, t, n) {
                    let i = !1
                      , r = !1
                      , a = !1;
                    for (let e = 0, n = t.length; e < n; e++) {
                        const n = t[e];
                        if (void 0 !== n.POSITION && (i = !0),
                        void 0 !== n.NORMAL && (r = !0),
                        void 0 !== n.COLOR_0 && (a = !0),
                        i && r && a)
                            break
                    }
                    if (!i && !r && !a)
                        return Promise.resolve(e);
                    const s = []
                      , o = []
                      , l = [];
                    for (let c = 0, h = t.length; c < h; c++) {
                        const h = t[c];
                        if (i) {
                            const t = void 0 !== h.POSITION ? n.getDependency("accessor", h.POSITION) : e.attributes.position;
                            s.push(t)
                        }
                        if (r) {
                            const t = void 0 !== h.NORMAL ? n.getDependency("accessor", h.NORMAL) : e.attributes.normal;
                            o.push(t)
                        }
                        if (a) {
                            const t = void 0 !== h.COLOR_0 ? n.getDependency("accessor", h.COLOR_0) : e.attributes.color;
                            l.push(t)
                        }
                    }
                    return Promise.all([Promise.all(s), Promise.all(o), Promise.all(l)]).then((function(t) {
                        const n = t[0]
                          , s = t[1]
                          , o = t[2];
                        return i && (e.morphAttributes.position = n),
                        r && (e.morphAttributes.normal = s),
                        a && (e.morphAttributes.color = o),
                        e.morphTargetsRelative = !0,
                        e
                    }
                    ))
                }(e, t.targets, n) : e
            }
            ))
        }
        /**
 * @license
 * Copyright 2010-2025 Three.js Authors
 * SPDX-License-Identifier: MIT
 */
        function wc() {
            let e = null
              , t = !1
              , n = null
              , i = null;
            function r(t, a) {
                n(t, a),
                i = e.requestAnimationFrame(r)
            }
            return {
                start: function() {
                    !0 !== t && null !== n && (i = e.requestAnimationFrame(r),
                    t = !0)
                },
                stop: function() {
                    e.cancelAnimationFrame(i),
                    t = !1
                },
                setAnimationLoop: function(e) {
                    n = e
                },
                setContext: function(t) {
                    e = t
                }
            }
        }
        function yc(e) {
            const t = new WeakMap;
            return {
                get: function(e) {
                    return e.isInterleavedBufferAttribute && (e = e.data),
                    t.get(e)
                },
                remove: function(n) {
                    n.isInterleavedBufferAttribute && (n = n.data);
                    const i = t.get(n);
                    i && (e.deleteBuffer(i.buffer),
                    t.delete(n))
                },
                update: function(n, i) {
                    if (n.isInterleavedBufferAttribute && (n = n.data),
                    n.isGLBufferAttribute) {
                        const e = t.get(n);
                        return void ((!e || e.version < n.version) && t.set(n, {
                            buffer: n.buffer,
                            type: n.type,
                            bytesPerElement: n.elementSize,
                            version: n.version
                        }))
                    }
                    const r = t.get(n);
                    if (void 0 === r)
                        t.set(n, function(t, n) {
                            const i = t.array
                              , r = t.usage
                              , a = i.byteLength
                              , s = e.createBuffer();
                            let o;
                            if (e.bindBuffer(n, s),
                            e.bufferData(n, i, r),
                            t.onUploadCallback(),
                            i instanceof Float32Array)
                                o = e.FLOAT;
                            else if (i instanceof Uint16Array)
                                o = t.isFloat16BufferAttribute ? e.HALF_FLOAT : e.UNSIGNED_SHORT;
                            else if (i instanceof Int16Array)
                                o = e.SHORT;
                            else if (i instanceof Uint32Array)
                                o = e.UNSIGNED_INT;
                            else if (i instanceof Int32Array)
                                o = e.INT;
                            else if (i instanceof Int8Array)
                                o = e.BYTE;
                            else if (i instanceof Uint8Array)
                                o = e.UNSIGNED_BYTE;
                            else {
                                if (!(i instanceof Uint8ClampedArray))
                                    throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: " + i);
                                o = e.UNSIGNED_BYTE
                            }
                            return {
                                buffer: s,
                                type: o,
                                bytesPerElement: i.BYTES_PER_ELEMENT,
                                version: t.version,
                                size: a
                            }
                        }(n, i));
                    else if (r.version < n.version) {
                        if (r.size !== n.array.byteLength)
                            throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");
                        !function(t, n, i) {
                            const r = n.array
                              , a = n.updateRanges;
                            if (e.bindBuffer(i, t),
                            0 === a.length)
                                e.bufferSubData(i, 0, r);
                            else {
                                a.sort(( (e, t) => e.start - t.start));
                                let t = 0;
                                for (let e = 1; e < a.length; e++) {
                                    const n = a[t]
                                      , i = a[e];
                                    i.start <= n.start + n.count + 1 ? n.count = Math.max(n.count, i.start + i.count - n.start) : (++t,
                                    a[t] = i)
                                }
                                a.length = t + 1;
                                for (let t = 0, n = a.length; t < n; t++) {
                                    const n = a[t];
                                    e.bufferSubData(i, n.start * r.BYTES_PER_ELEMENT, r, n.start, n.count)
                                }
                                n.clearUpdateRanges()
                            }
                            n.onUploadCallback()
                        }(r.buffer, n, i),
                        r.version = n.version
                    }
                }
            }
        }
        const bc = {
            alphahash_fragment: "#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",
            alphahash_pars_fragment: "#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",
            alphamap_fragment: "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",
            alphamap_pars_fragment: "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",
            alphatest_fragment: "#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",
            alphatest_pars_fragment: "#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",
            aomap_fragment: "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",
            aomap_pars_fragment: "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
            batching_pars_vertex: "#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",
            batching_vertex: "#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",
            begin_vertex: "vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",
            beginnormal_vertex: "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",
            bsdfs: "float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",
            iridescence_fragment: "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660,  0.0556434,\n\t\t-1.5371385,  1.8760108, -0.2040259,\n\t\t-0.4985314,  0.0415560,  1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",
            bumpmap_pars_fragment: "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",
            clipping_planes_fragment: "#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",
            clipping_planes_pars_fragment: "#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",
            clipping_planes_pars_vertex: "#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",
            clipping_planes_vertex: "#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",
            color_fragment: "#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",
            color_pars_fragment: "#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",
            color_pars_vertex: "#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",
            color_vertex: "#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",
            common: "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",
            cube_uv_reflection_fragment: "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",
            defaultnormal_vertex: "vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",
            displacementmap_pars_vertex: "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",
            displacementmap_vertex: "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",
            emissivemap_fragment: "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\n\t#endif\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",
            emissivemap_pars_fragment: "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",
            colorspace_fragment: "gl_FragColor = linearToOutputTexel( gl_FragColor );",
            colorspace_pars_fragment: "vec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",
            envmap_fragment: "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",
            envmap_common_pars_fragment: "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",
            envmap_pars_fragment: "#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",
            envmap_pars_vertex: "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",
            envmap_physical_pars_fragment: "#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",
            envmap_vertex: "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",
            fog_vertex: "#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",
            fog_pars_vertex: "#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",
            fog_fragment: "#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",
            fog_pars_fragment: "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
            gradientmap_pars_fragment: "#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",
            lightmap_pars_fragment: "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
            lights_lambert_fragment: "LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",
            lights_lambert_pars_fragment: "varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",
            lights_pars_begin: "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",
            lights_toon_fragment: "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",
            lights_toon_pars_fragment: "varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",
            lights_phong_fragment: "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",
            lights_phong_pars_fragment: "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",
            lights_physical_fragment: "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",
            lights_physical_pars_fragment: "struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n    float x2 = x * x;\n    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",
            lights_fragment_begin: "\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",
            lights_fragment_maps: "#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",
            lights_fragment_end: "#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",
            logdepthbuf_fragment: "#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",
            logdepthbuf_pars_fragment: "#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",
            logdepthbuf_pars_vertex: "#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",
            logdepthbuf_vertex: "#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",
            map_fragment: "#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",
            map_pars_fragment: "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",
            map_particle_fragment: "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",
            map_particle_pars_fragment: "#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",
            metalnessmap_fragment: "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",
            metalnessmap_pars_fragment: "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
            morphinstance_vertex: "#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",
            morphcolor_vertex: "#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",
            morphnormal_vertex: "#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",
            morphtarget_pars_vertex: "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",
            morphtarget_vertex: "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",
            normal_fragment_begin: "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",
            normal_fragment_maps: "#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",
            normal_pars_fragment: "#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",
            normal_pars_vertex: "#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",
            normal_vertex: "#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",
            normalmap_pars_fragment: "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",
            clearcoat_normal_fragment_begin: "#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",
            clearcoat_normal_fragment_maps: "#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",
            clearcoat_pars_fragment: "#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",
            iridescence_pars_fragment: "#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",
            opaque_fragment: "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",
            packing: "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",
            premultiplied_alpha_fragment: "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",
            project_vertex: "vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",
            dithering_fragment: "#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",
            dithering_pars_fragment: "#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",
            roughnessmap_fragment: "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",
            roughnessmap_pars_fragment: "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
            shadowmap_pars_fragment: "#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",
            shadowmap_pars_vertex: "#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",
            shadowmap_vertex: "#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",
            shadowmask_pars_fragment: "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",
            skinbase_vertex: "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
            skinning_pars_vertex: "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",
            skinning_vertex: "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",
            skinnormal_vertex: "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",
            specularmap_fragment: "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
            specularmap_pars_fragment: "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
            tonemapping_fragment: "#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",
            tonemapping_pars_fragment: "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(  1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,  1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",
            transmission_fragment: "#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",
            transmission_pars_fragment: "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t#else\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",
            uv_pars_fragment: "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",
            uv_pars_vertex: "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",
            uv_vertex: "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",
            worldpos_vertex: "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",
            background_vert: "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",
            background_frag: "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",
            backgroundCube_vert: "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",
            backgroundCube_frag: "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",
            cube_vert: "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",
            cube_frag: "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",
            depth_vert: "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",
            depth_frag: "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",
            distanceRGBA_vert: "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",
            distanceRGBA_frag: "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",
            equirect_vert: "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",
            equirect_frag: "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",
            linedashed_vert: "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",
            linedashed_frag: "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",
            meshbasic_vert: "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",
            meshbasic_frag: "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",
            meshlambert_vert: "#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",
            meshlambert_frag: "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",
            meshmatcap_vert: "#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",
            meshmatcap_frag: "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",
            meshnormal_vert: "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",
            meshnormal_frag: "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",
            meshphong_vert: "#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",
            meshphong_frag: "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",
            meshphysical_vert: "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",
            meshphysical_frag: "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",
            meshtoon_vert: "#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",
            meshtoon_frag: "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",
            points_vert: "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",
            points_frag: "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",
            shadow_vert: "#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",
            shadow_frag: "uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",
            sprite_vert: "uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix[ 3 ];\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",
            sprite_frag: "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"
        }
          , Ac = {
            common: {
                diffuse: {
                    value: new Hi(16777215)
                },
                opacity: {
                    value: 1
                },
                map: {
                    value: null
                },
                mapTransform: {
                    value: new Kt
                },
                alphaMap: {
                    value: null
                },
                alphaMapTransform: {
                    value: new Kt
                },
                alphaTest: {
                    value: 0
                }
            },
            specularmap: {
                specularMap: {
                    value: null
                },
                specularMapTransform: {
                    value: new Kt
                }
            },
            envmap: {
                envMap: {
                    value: null
                },
                envMapRotation: {
                    value: new Kt
                },
                flipEnvMap: {
                    value: -1
                },
                reflectivity: {
                    value: 1
                },
                ior: {
                    value: 1.5
                },
                refractionRatio: {
                    value: .98
                }
            },
            aomap: {
                aoMap: {
                    value: null
                },
                aoMapIntensity: {
                    value: 1
                },
                aoMapTransform: {
                    value: new Kt
                }
            },
            lightmap: {
                lightMap: {
                    value: null
                },
                lightMapIntensity: {
                    value: 1
                },
                lightMapTransform: {
                    value: new Kt
                }
            },
            bumpmap: {
                bumpMap: {
                    value: null
                },
                bumpMapTransform: {
                    value: new Kt
                },
                bumpScale: {
                    value: 1
                }
            },
            normalmap: {
                normalMap: {
                    value: null
                },
                normalMapTransform: {
                    value: new Kt
                },
                normalScale: {
                    value: new Qt(1,1)
                }
            },
            displacementmap: {
                displacementMap: {
                    value: null
                },
                displacementMapTransform: {
                    value: new Kt
                },
                displacementScale: {
                    value: 1
                },
                displacementBias: {
                    value: 0
                }
            },
            emissivemap: {
                emissiveMap: {
                    value: null
                },
                emissiveMapTransform: {
                    value: new Kt
                }
            },
            metalnessmap: {
                metalnessMap: {
                    value: null
                },
                metalnessMapTransform: {
                    value: new Kt
                }
            },
            roughnessmap: {
                roughnessMap: {
                    value: null
                },
                roughnessMapTransform: {
                    value: new Kt
                }
            },
            gradientmap: {
                gradientMap: {
                    value: null
                }
            },
            fog: {
                fogDensity: {
                    value: 25e-5
                },
                fogNear: {
                    value: 1
                },
                fogFar: {
                    value: 2e3
                },
                fogColor: {
                    value: new Hi(16777215)
                }
            },
            lights: {
                ambientLightColor: {
                    value: []
                },
                lightProbe: {
                    value: []
                },
                directionalLights: {
                    value: [],
                    properties: {
                        direction: {},
                        color: {}
                    }
                },
                directionalLightShadows: {
                    value: [],
                    properties: {
                        shadowIntensity: 1,
                        shadowBias: {},
                        shadowNormalBias: {},
                        shadowRadius: {},
                        shadowMapSize: {}
                    }
                },
                directionalShadowMap: {
                    value: []
                },
                directionalShadowMatrix: {
                    value: []
                },
                spotLights: {
                    value: [],
                    properties: {
                        color: {},
                        position: {},
                        direction: {},
                        distance: {},
                        coneCos: {},
                        penumbraCos: {},
                        decay: {}
                    }
                },
                spotLightShadows: {
                    value: [],
                    properties: {
                        shadowIntensity: 1,
                        shadowBias: {},
                        shadowNormalBias: {},
                        shadowRadius: {},
                        shadowMapSize: {}
                    }
                },
                spotLightMap: {
                    value: []
                },
                spotShadowMap: {
                    value: []
                },
                spotLightMatrix: {
                    value: []
                },
                pointLights: {
                    value: [],
                    properties: {
                        color: {},
                        position: {},
                        decay: {},
                        distance: {}
                    }
                },
                pointLightShadows: {
                    value: [],
                    properties: {
                        shadowIntensity: 1,
                        shadowBias: {},
                        shadowNormalBias: {},
                        shadowRadius: {},
                        shadowMapSize: {},
                        shadowCameraNear: {},
                        shadowCameraFar: {}
                    }
                },
                pointShadowMap: {
                    value: []
                },
                pointShadowMatrix: {
                    value: []
                },
                hemisphereLights: {
                    value: [],
                    properties: {
                        direction: {},
                        skyColor: {},
                        groundColor: {}
                    }
                },
                rectAreaLights: {
                    value: [],
                    properties: {
                        color: {},
                        position: {},
                        width: {},
                        height: {}
                    }
                },
                ltc_1: {
                    value: null
                },
                ltc_2: {
                    value: null
                }
            },
            points: {
                diffuse: {
                    value: new Hi(16777215)
                },
                opacity: {
                    value: 1
                },
                size: {
                    value: 1
                },
                scale: {
                    value: 1
                },
                map: {
                    value: null
                },
                alphaMap: {
                    value: null
                },
                alphaMapTransform: {
                    value: new Kt
                },
                alphaTest: {
                    value: 0
                },
                uvTransform: {
                    value: new Kt
                }
            },
            sprite: {
                diffuse: {
                    value: new Hi(16777215)
                },
                opacity: {
                    value: 1
                },
                center: {
                    value: new Qt(.5,.5)
                },
                rotation: {
                    value: 0
                },
                map: {
                    value: null
                },
                mapTransform: {
                    value: new Kt
                },
                alphaMap: {
                    value: null
                },
                alphaMapTransform: {
                    value: new Kt
                },
                alphaTest: {
                    value: 0
                }
            }
        }
          , xc = {
            basic: {
                uniforms: kr([Ac.common, Ac.specularmap, Ac.envmap, Ac.aomap, Ac.lightmap, Ac.fog]),
                vertexShader: bc.meshbasic_vert,
                fragmentShader: bc.meshbasic_frag
            },
            lambert: {
                uniforms: kr([Ac.common, Ac.specularmap, Ac.envmap, Ac.aomap, Ac.lightmap, Ac.emissivemap, Ac.bumpmap, Ac.normalmap, Ac.displacementmap, Ac.fog, Ac.lights, {
                    emissive: {
                        value: new Hi(0)
                    }
                }]),
                vertexShader: bc.meshlambert_vert,
                fragmentShader: bc.meshlambert_frag
            },
            phong: {
                uniforms: kr([Ac.common, Ac.specularmap, Ac.envmap, Ac.aomap, Ac.lightmap, Ac.emissivemap, Ac.bumpmap, Ac.normalmap, Ac.displacementmap, Ac.fog, Ac.lights, {
                    emissive: {
                        value: new Hi(0)
                    },
                    specular: {
                        value: new Hi(1118481)
                    },
                    shininess: {
                        value: 30
                    }
                }]),
                vertexShader: bc.meshphong_vert,
                fragmentShader: bc.meshphong_frag
            },
            standard: {
                uniforms: kr([Ac.common, Ac.envmap, Ac.aomap, Ac.lightmap, Ac.emissivemap, Ac.bumpmap, Ac.normalmap, Ac.displacementmap, Ac.roughnessmap, Ac.metalnessmap, Ac.fog, Ac.lights, {
                    emissive: {
                        value: new Hi(0)
                    },
                    roughness: {
                        value: 1
                    },
                    metalness: {
                        value: 0
                    },
                    envMapIntensity: {
                        value: 1
                    }
                }]),
                vertexShader: bc.meshphysical_vert,
                fragmentShader: bc.meshphysical_frag
            },
            toon: {
                uniforms: kr([Ac.common, Ac.aomap, Ac.lightmap, Ac.emissivemap, Ac.bumpmap, Ac.normalmap, Ac.displacementmap, Ac.gradientmap, Ac.fog, Ac.lights, {
                    emissive: {
                        value: new Hi(0)
                    }
                }]),
                vertexShader: bc.meshtoon_vert,
                fragmentShader: bc.meshtoon_frag
            },
            matcap: {
                uniforms: kr([Ac.common, Ac.bumpmap, Ac.normalmap, Ac.displacementmap, Ac.fog, {
                    matcap: {
                        value: null
                    }
                }]),
                vertexShader: bc.meshmatcap_vert,
                fragmentShader: bc.meshmatcap_frag
            },
            points: {
                uniforms: kr([Ac.points, Ac.fog]),
                vertexShader: bc.points_vert,
                fragmentShader: bc.points_frag
            },
            dashed: {
                uniforms: kr([Ac.common, Ac.fog, {
                    scale: {
                        value: 1
                    },
                    dashSize: {
                        value: 1
                    },
                    totalSize: {
                        value: 2
                    }
                }]),
                vertexShader: bc.linedashed_vert,
                fragmentShader: bc.linedashed_frag
            },
            depth: {
                uniforms: kr([Ac.common, Ac.displacementmap]),
                vertexShader: bc.depth_vert,
                fragmentShader: bc.depth_frag
            },
            normal: {
                uniforms: kr([Ac.common, Ac.bumpmap, Ac.normalmap, Ac.displacementmap, {
                    opacity: {
                        value: 1
                    }
                }]),
                vertexShader: bc.meshnormal_vert,
                fragmentShader: bc.meshnormal_frag
            },
            sprite: {
                uniforms: kr([Ac.sprite, Ac.fog]),
                vertexShader: bc.sprite_vert,
                fragmentShader: bc.sprite_frag
            },
            background: {
                uniforms: {
                    uvTransform: {
                        value: new Kt
                    },
                    t2D: {
                        value: null
                    },
                    backgroundIntensity: {
                        value: 1
                    }
                },
                vertexShader: bc.background_vert,
                fragmentShader: bc.background_frag
            },
            backgroundCube: {
                uniforms: {
                    envMap: {
                        value: null
                    },
                    flipEnvMap: {
                        value: -1
                    },
                    backgroundBlurriness: {
                        value: 0
                    },
                    backgroundIntensity: {
                        value: 1
                    },
                    backgroundRotation: {
                        value: new Kt
                    }
                },
                vertexShader: bc.backgroundCube_vert,
                fragmentShader: bc.backgroundCube_frag
            },
            cube: {
                uniforms: {
                    tCube: {
                        value: null
                    },
                    tFlip: {
                        value: -1
                    },
                    opacity: {
                        value: 1
                    }
                },
                vertexShader: bc.cube_vert,
                fragmentShader: bc.cube_frag
            },
            equirect: {
                uniforms: {
                    tEquirect: {
                        value: null
                    }
                },
                vertexShader: bc.equirect_vert,
                fragmentShader: bc.equirect_frag
            },
            distanceRGBA: {
                uniforms: kr([Ac.common, Ac.displacementmap, {
                    referencePosition: {
                        value: new bn
                    },
                    nearDistance: {
                        value: 1
                    },
                    farDistance: {
                        value: 1e3
                    }
                }]),
                vertexShader: bc.distanceRGBA_vert,
                fragmentShader: bc.distanceRGBA_frag
            },
            shadow: {
                uniforms: kr([Ac.lights, Ac.fog, {
                    color: {
                        value: new Hi(0)
                    },
                    opacity: {
                        value: 1
                    }
                }]),
                vertexShader: bc.shadow_vert,
                fragmentShader: bc.shadow_frag
            }
        };
        xc.physical = {
            uniforms: kr([xc.standard.uniforms, {
                clearcoat: {
                    value: 0
                },
                clearcoatMap: {
                    value: null
                },
                clearcoatMapTransform: {
                    value: new Kt
                },
                clearcoatNormalMap: {
                    value: null
                },
                clearcoatNormalMapTransform: {
                    value: new Kt
                },
                clearcoatNormalScale: {
                    value: new Qt(1,1)
                },
                clearcoatRoughness: {
                    value: 0
                },
                clearcoatRoughnessMap: {
                    value: null
                },
                clearcoatRoughnessMapTransform: {
                    value: new Kt
                },
                dispersion: {
                    value: 0
                },
                iridescence: {
                    value: 0
                },
                iridescenceMap: {
                    value: null
                },
                iridescenceMapTransform: {
                    value: new Kt
                },
                iridescenceIOR: {
                    value: 1.3
                },
                iridescenceThicknessMinimum: {
                    value: 100
                },
                iridescenceThicknessMaximum: {
                    value: 400
                },
                iridescenceThicknessMap: {
                    value: null
                },
                iridescenceThicknessMapTransform: {
                    value: new Kt
                },
                sheen: {
                    value: 0
                },
                sheenColor: {
                    value: new Hi(0)
                },
                sheenColorMap: {
                    value: null
                },
                sheenColorMapTransform: {
                    value: new Kt
                },
                sheenRoughness: {
                    value: 1
                },
                sheenRoughnessMap: {
                    value: null
                },
                sheenRoughnessMapTransform: {
                    value: new Kt
                },
                transmission: {
                    value: 0
                },
                transmissionMap: {
                    value: null
                },
                transmissionMapTransform: {
                    value: new Kt
                },
                transmissionSamplerSize: {
                    value: new Qt
                },
                transmissionSamplerMap: {
                    value: null
                },
                thickness: {
                    value: 0
                },
                thicknessMap: {
                    value: null
                },
                thicknessMapTransform: {
                    value: new Kt
                },
                attenuationDistance: {
                    value: 0
                },
                attenuationColor: {
                    value: new Hi(0)
                },
                specularColor: {
                    value: new Hi(1,1,1)
                },
                specularColorMap: {
                    value: null
                },
                specularColorMapTransform: {
                    value: new Kt
                },
                specularIntensity: {
                    value: 1
                },
                specularIntensityMap: {
                    value: null
                },
                specularIntensityMapTransform: {
                    value: new Kt
                },
                anisotropyVector: {
                    value: new Qt
                },
                anisotropyMap: {
                    value: null
                },
                anisotropyMapTransform: {
                    value: new Kt
                }
            }]),
            vertexShader: bc.meshphysical_vert,
            fragmentShader: bc.meshphysical_frag
        };
        const kc = {
            r: 0,
            b: 0,
            g: 0
        }
          , Ec = new si
          , Sc = new Xn;
        function Mc(e, t, n, i, r, a, s) {
            const o = new Hi(0);
            let l, c, h = !0 === a ? 0 : 1, d = null, u = 0, p = null;
            function f(e) {
                let i = !0 === e.isScene ? e.background : null;
                if (i && i.isTexture) {
                    i = (e.backgroundBlurriness > 0 ? n : t).get(i)
                }
                return i
            }
            function m(t, n) {
                t.getRGB(kc, Er(e)),
                i.buffers.color.setClear(kc.r, kc.g, kc.b, n, s)
            }
            return {
                getClearColor: function() {
                    return o
                },
                setClearColor: function(e, t=1) {
                    o.set(e),
                    h = t,
                    m(o, h)
                },
                getClearAlpha: function() {
                    return h
                },
                setClearAlpha: function(e) {
                    h = e,
                    m(o, h)
                },
                render: function(t) {
                    let n = !1;
                    const r = f(t);
                    null === r ? m(o, h) : r && r.isColor && (m(r, 1),
                    n = !0);
                    const a = e.xr.getEnvironmentBlendMode();
                    "additive" === a ? i.buffers.color.setClear(0, 0, 0, 1, s) : "alpha-blend" === a && i.buffers.color.setClear(0, 0, 0, 0, s),
                    (e.autoClear || n) && (i.buffers.depth.setTest(!0),
                    i.buffers.depth.setMask(!0),
                    i.buffers.color.setMask(!0),
                    e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil))
                },
                addToRenderList: function(t, n) {
                    const i = f(n);
                    i && (i.isCubeTexture || i.mapping === re) ? (void 0 === c && (c = new yr(new Ar(1,1,1),new Mr({
                        name: "BackgroundCubeMaterial",
                        uniforms: xr(xc.backgroundCube.uniforms),
                        vertexShader: xc.backgroundCube.vertexShader,
                        fragmentShader: xc.backgroundCube.fragmentShader,
                        side: 1,
                        depthTest: !1,
                        depthWrite: !1,
                        fog: !1
                    })),
                    c.geometry.deleteAttribute("normal"),
                    c.geometry.deleteAttribute("uv"),
                    c.onBeforeRender = function(e, t, n) {
                        this.matrixWorld.copyPosition(n.matrixWorld)
                    }
                    ,
                    Object.defineProperty(c.material, "envMap", {
                        get: function() {
                            return this.uniforms.envMap.value
                        }
                    }),
                    r.update(c)),
                    Ec.copy(n.backgroundRotation),
                    Ec.x *= -1,
                    Ec.y *= -1,
                    Ec.z *= -1,
                    i.isCubeTexture && !1 === i.isRenderTargetTexture && (Ec.y *= -1,
                    Ec.z *= -1),
                    c.material.uniforms.envMap.value = i,
                    c.material.uniforms.flipEnvMap.value = i.isCubeTexture && !1 === i.isRenderTargetTexture ? -1 : 1,
                    c.material.uniforms.backgroundBlurriness.value = n.backgroundBlurriness,
                    c.material.uniforms.backgroundIntensity.value = n.backgroundIntensity,
                    c.material.uniforms.backgroundRotation.value.setFromMatrix4(Sc.makeRotationFromEuler(Ec)),
                    c.material.toneMapped = rn.getTransfer(i.colorSpace) !== bt,
                    d === i && u === i.version && p === e.toneMapping || (c.material.needsUpdate = !0,
                    d = i,
                    u = i.version,
                    p = e.toneMapping),
                    c.layers.enableAll(),
                    t.unshift(c, c.geometry, c.material, 0, 0, null)) : i && i.isTexture && (void 0 === l && (l = new yr(new Bs(2,2),new Mr({
                        name: "BackgroundMaterial",
                        uniforms: xr(xc.background.uniforms),
                        vertexShader: xc.background.vertexShader,
                        fragmentShader: xc.background.fragmentShader,
                        side: 0,
                        depthTest: !1,
                        depthWrite: !1,
                        fog: !1
                    })),
                    l.geometry.deleteAttribute("normal"),
                    Object.defineProperty(l.material, "map", {
                        get: function() {
                            return this.uniforms.t2D.value
                        }
                    }),
                    r.update(l)),
                    l.material.uniforms.t2D.value = i,
                    l.material.uniforms.backgroundIntensity.value = n.backgroundIntensity,
                    l.material.toneMapped = rn.getTransfer(i.colorSpace) !== bt,
                    !0 === i.matrixAutoUpdate && i.updateMatrix(),
                    l.material.uniforms.uvTransform.value.copy(i.matrix),
                    d === i && u === i.version && p === e.toneMapping || (l.material.needsUpdate = !0,
                    d = i,
                    u = i.version,
                    p = e.toneMapping),
                    l.layers.enableAll(),
                    t.unshift(l, l.geometry, l.material, 0, 0, null))
                },
                dispose: function() {
                    void 0 !== c && (c.geometry.dispose(),
                    c.material.dispose(),
                    c = void 0),
                    void 0 !== l && (l.geometry.dispose(),
                    l.material.dispose(),
                    l = void 0)
                }
            }
        }
        function _c(e, t) {
            const n = e.getParameter(e.MAX_VERTEX_ATTRIBS)
              , i = {}
              , r = c(null);
            let a = r
              , s = !1;
            function o(t) {
                return e.bindVertexArray(t)
            }
            function l(t) {
                return e.deleteVertexArray(t)
            }
            function c(e) {
                const t = []
                  , i = []
                  , r = [];
                for (let e = 0; e < n; e++)
                    t[e] = 0,
                    i[e] = 0,
                    r[e] = 0;
                return {
                    geometry: null,
                    program: null,
                    wireframe: !1,
                    newAttributes: t,
                    enabledAttributes: i,
                    attributeDivisors: r,
                    object: e,
                    attributes: {},
                    index: null
                }
            }
            function h() {
                const e = a.newAttributes;
                for (let t = 0, n = e.length; t < n; t++)
                    e[t] = 0
            }
            function d(e) {
                u(e, 0)
            }
            function u(t, n) {
                const i = a.newAttributes
                  , r = a.enabledAttributes
                  , s = a.attributeDivisors;
                i[t] = 1,
                0 === r[t] && (e.enableVertexAttribArray(t),
                r[t] = 1),
                s[t] !== n && (e.vertexAttribDivisor(t, n),
                s[t] = n)
            }
            function p() {
                const t = a.newAttributes
                  , n = a.enabledAttributes;
                for (let i = 0, r = n.length; i < r; i++)
                    n[i] !== t[i] && (e.disableVertexAttribArray(i),
                    n[i] = 0)
            }
            function f(t, n, i, r, a, s, o) {
                !0 === o ? e.vertexAttribIPointer(t, n, i, a, s) : e.vertexAttribPointer(t, n, i, r, a, s)
            }
            function m() {
                g(),
                s = !0,
                a !== r && (a = r,
                o(a.object))
            }
            function g() {
                r.geometry = null,
                r.program = null,
                r.wireframe = !1
            }
            return {
                setup: function(n, r, l, m, g) {
                    let v = !1;
                    const w = function(t, n, r) {
                        const a = !0 === r.wireframe;
                        let s = i[t.id];
                        void 0 === s && (s = {},
                        i[t.id] = s);
                        let o = s[n.id];
                        void 0 === o && (o = {},
                        s[n.id] = o);
                        let l = o[a];
                        void 0 === l && (l = c(e.createVertexArray()),
                        o[a] = l);
                        return l
                    }(m, l, r);
                    a !== w && (a = w,
                    o(a.object)),
                    v = function(e, t, n, i) {
                        const r = a.attributes
                          , s = t.attributes;
                        let o = 0;
                        const l = n.getAttributes();
                        for (const t in l) {
                            if (l[t].location >= 0) {
                                const n = r[t];
                                let i = s[t];
                                if (void 0 === i && ("instanceMatrix" === t && e.instanceMatrix && (i = e.instanceMatrix),
                                "instanceColor" === t && e.instanceColor && (i = e.instanceColor)),
                                void 0 === n)
                                    return !0;
                                if (n.attribute !== i)
                                    return !0;
                                if (i && n.data !== i.data)
                                    return !0;
                                o++
                            }
                        }
                        return a.attributesNum !== o || a.index !== i
                    }(n, m, l, g),
                    v && function(e, t, n, i) {
                        const r = {}
                          , s = t.attributes;
                        let o = 0;
                        const l = n.getAttributes();
                        for (const t in l) {
                            if (l[t].location >= 0) {
                                let n = s[t];
                                void 0 === n && ("instanceMatrix" === t && e.instanceMatrix && (n = e.instanceMatrix),
                                "instanceColor" === t && e.instanceColor && (n = e.instanceColor));
                                const i = {};
                                i.attribute = n,
                                n && n.data && (i.data = n.data),
                                r[t] = i,
                                o++
                            }
                        }
                        a.attributes = r,
                        a.attributesNum = o,
                        a.index = i
                    }(n, m, l, g),
                    null !== g && t.update(g, e.ELEMENT_ARRAY_BUFFER),
                    (v || s) && (s = !1,
                    function(n, i, r, a) {
                        h();
                        const s = a.attributes
                          , o = r.getAttributes()
                          , l = i.defaultAttributeValues;
                        for (const i in o) {
                            const r = o[i];
                            if (r.location >= 0) {
                                let o = s[i];
                                if (void 0 === o && ("instanceMatrix" === i && n.instanceMatrix && (o = n.instanceMatrix),
                                "instanceColor" === i && n.instanceColor && (o = n.instanceColor)),
                                void 0 !== o) {
                                    const i = o.normalized
                                      , s = o.itemSize
                                      , l = t.get(o);
                                    if (void 0 === l)
                                        continue;
                                    const c = l.buffer
                                      , h = l.type
                                      , p = l.bytesPerElement
                                      , m = h === e.INT || h === e.UNSIGNED_INT || o.gpuType === we;
                                    if (o.isInterleavedBufferAttribute) {
                                        const t = o.data
                                          , l = t.stride
                                          , g = o.offset;
                                        if (t.isInstancedInterleavedBuffer) {
                                            for (let e = 0; e < r.locationSize; e++)
                                                u(r.location + e, t.meshPerAttribute);
                                            !0 !== n.isInstancedMesh && void 0 === a._maxInstanceCount && (a._maxInstanceCount = t.meshPerAttribute * t.count)
                                        } else
                                            for (let e = 0; e < r.locationSize; e++)
                                                d(r.location + e);
                                        e.bindBuffer(e.ARRAY_BUFFER, c);
                                        for (let e = 0; e < r.locationSize; e++)
                                            f(r.location + e, s / r.locationSize, h, i, l * p, (g + s / r.locationSize * e) * p, m)
                                    } else {
                                        if (o.isInstancedBufferAttribute) {
                                            for (let e = 0; e < r.locationSize; e++)
                                                u(r.location + e, o.meshPerAttribute);
                                            !0 !== n.isInstancedMesh && void 0 === a._maxInstanceCount && (a._maxInstanceCount = o.meshPerAttribute * o.count)
                                        } else
                                            for (let e = 0; e < r.locationSize; e++)
                                                d(r.location + e);
                                        e.bindBuffer(e.ARRAY_BUFFER, c);
                                        for (let e = 0; e < r.locationSize; e++)
                                            f(r.location + e, s / r.locationSize, h, i, s * p, s / r.locationSize * e * p, m)
                                    }
                                } else if (void 0 !== l) {
                                    const t = l[i];
                                    if (void 0 !== t)
                                        switch (t.length) {
                                        case 2:
                                            e.vertexAttrib2fv(r.location, t);
                                            break;
                                        case 3:
                                            e.vertexAttrib3fv(r.location, t);
                                            break;
                                        case 4:
                                            e.vertexAttrib4fv(r.location, t);
                                            break;
                                        default:
                                            e.vertexAttrib1fv(r.location, t)
                                        }
                                }
                            }
                        }
                        p()
                    }(n, r, l, m),
                    null !== g && e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, t.get(g).buffer))
                },
                reset: m,
                resetDefaultState: g,
                dispose: function() {
                    m();
                    for (const e in i) {
                        const t = i[e];
                        for (const e in t) {
                            const n = t[e];
                            for (const e in n)
                                l(n[e].object),
                                delete n[e];
                            delete t[e]
                        }
                        delete i[e]
                    }
                },
                releaseStatesOfGeometry: function(e) {
                    if (void 0 === i[e.id])
                        return;
                    const t = i[e.id];
                    for (const e in t) {
                        const n = t[e];
                        for (const e in n)
                            l(n[e].object),
                            delete n[e];
                        delete t[e]
                    }
                    delete i[e.id]
                },
                releaseStatesOfProgram: function(e) {
                    for (const t in i) {
                        const n = i[t];
                        if (void 0 === n[e.id])
                            continue;
                        const r = n[e.id];
                        for (const e in r)
                            l(r[e].object),
                            delete r[e];
                        delete n[e.id]
                    }
                },
                initAttributes: h,
                enableAttribute: d,
                disableUnusedAttributes: p
            }
        }
        function Tc(e, t, n) {
            let i;
            function r(t, r, a) {
                0 !== a && (e.drawArraysInstanced(i, t, r, a),
                n.update(r, i, a))
            }
            this.setMode = function(e) {
                i = e
            }
            ,
            this.render = function(t, r) {
                e.drawArrays(i, t, r),
                n.update(r, i, 1)
            }
            ,
            this.renderInstances = r,
            this.renderMultiDraw = function(e, r, a) {
                if (0 === a)
                    return;
                t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i, e, 0, r, 0, a);
                let s = 0;
                for (let e = 0; e < a; e++)
                    s += r[e];
                n.update(s, i, 1)
            }
            ,
            this.renderMultiDrawInstances = function(e, a, s, o) {
                if (0 === s)
                    return;
                const l = t.get("WEBGL_multi_draw");
                if (null === l)
                    for (let t = 0; t < e.length; t++)
                        r(e[t], a[t], o[t]);
                else {
                    l.multiDrawArraysInstancedWEBGL(i, e, 0, a, 0, o, 0, s);
                    let t = 0;
                    for (let e = 0; e < s; e++)
                        t += a[e] * o[e];
                    n.update(t, i, 1)
                }
            }
        }
        function Cc(e, t, n, i) {
            let r;
            function a(t) {
                if ("highp" === t) {
                    if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
                        return "highp";
                    t = "mediump"
                }
                return "mediump" === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
            }
            let s = void 0 !== n.precision ? n.precision : "highp";
            const o = a(s);
            o !== s && (console.warn("THREE.WebGLRenderer:", s, "not supported, using", o, "instead."),
            s = o);
            const l = !0 === n.logarithmicDepthBuffer
              , c = !0 === n.reverseDepthBuffer && t.has("EXT_clip_control")
              , h = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
              , d = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);
            return {
                isWebGL2: !0,
                getMaxAnisotropy: function() {
                    if (void 0 !== r)
                        return r;
                    if (!0 === t.has("EXT_texture_filter_anisotropic")) {
                        const n = t.get("EXT_texture_filter_anisotropic");
                        r = e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)
                    } else
                        r = 0;
                    return r
                },
                getMaxPrecision: a,
                textureFormatReadable: function(t) {
                    return t === Me || i.convert(t) === e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)
                },
                textureTypeReadable: function(n) {
                    const r = n === Ae && (t.has("EXT_color_buffer_half_float") || t.has("EXT_color_buffer_float"));
                    return !(n !== fe && i.convert(n) !== e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE) && n !== be && !r)
                },
                precision: s,
                logarithmicDepthBuffer: l,
                reverseDepthBuffer: c,
                maxTextures: h,
                maxVertexTextures: d,
                maxTextureSize: e.getParameter(e.MAX_TEXTURE_SIZE),
                maxCubemapSize: e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
                maxAttributes: e.getParameter(e.MAX_VERTEX_ATTRIBS),
                maxVertexUniforms: e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
                maxVaryings: e.getParameter(e.MAX_VARYING_VECTORS),
                maxFragmentUniforms: e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
                vertexTextures: d > 0,
                maxSamples: e.getParameter(e.MAX_SAMPLES)
            }
        }
        function Pc(e) {
            const t = this;
            let n = null
              , i = 0
              , r = !1
              , a = !1;
            const s = new va
              , o = new Kt
              , l = {
                value: null,
                needsUpdate: !1
            };
            function c(e, n, i, r) {
                const a = null !== e ? e.length : 0;
                let c = null;
                if (0 !== a) {
                    if (c = l.value,
                    !0 !== r || null === c) {
                        const t = i + 4 * a
                          , r = n.matrixWorldInverse;
                        o.getNormalMatrix(r),
                        (null === c || c.length < t) && (c = new Float32Array(t));
                        for (let t = 0, n = i; t !== a; ++t,
                        n += 4)
                            s.copy(e[t]).applyMatrix4(r, o),
                            s.normal.toArray(c, n),
                            c[n + 3] = s.constant
                    }
                    l.value = c,
                    l.needsUpdate = !0
                }
                return t.numPlanes = a,
                t.numIntersection = 0,
                c
            }
            this.uniform = l,
            this.numPlanes = 0,
            this.numIntersection = 0,
            this.init = function(e, t) {
                const n = 0 !== e.length || t || 0 !== i || r;
                return r = t,
                i = e.length,
                n
            }
            ,
            this.beginShadows = function() {
                a = !0,
                c(null)
            }
            ,
            this.endShadows = function() {
                a = !1
            }
            ,
            this.setGlobalState = function(e, t) {
                n = c(e, t, 0)
            }
            ,
            this.setState = function(s, o, h) {
                const d = s.clippingPlanes
                  , u = s.clipIntersection
                  , p = s.clipShadows
                  , f = e.get(s);
                if (!r || null === d || 0 === d.length || a && !p)
                    a ? c(null) : function() {
                        l.value !== n && (l.value = n,
                        l.needsUpdate = i > 0);
                        t.numPlanes = i,
                        t.numIntersection = 0
                    }();
                else {
                    const e = a ? 0 : i
                      , t = 4 * e;
                    let r = f.clippingState || null;
                    l.value = r,
                    r = c(d, o, t, h);
                    for (let e = 0; e !== t; ++e)
                        r[e] = n[e];
                    f.clippingState = r,
                    this.numIntersection = u ? this.numPlanes : 0,
                    this.numPlanes += e
                }
            }
        }
        function Ic(e) {
            let t = new WeakMap;
            function n(e, t) {
                return t === ne ? e.mapping = ee : t === ie && (e.mapping = te),
                e
            }
            function i(e) {
                const n = e.target;
                n.removeEventListener("dispose", i);
                const r = t.get(n);
                void 0 !== r && (t.delete(n),
                r.dispose())
            }
            return {
                get: function(r) {
                    if (r && r.isTexture) {
                        const a = r.mapping;
                        if (a === ne || a === ie) {
                            if (t.has(r)) {
                                return n(t.get(r).texture, r.mapping)
                            }
                            {
                                const a = r.image;
                                if (a && a.height > 0) {
                                    const s = new Nr(a.height);
                                    return s.fromEquirectangularTexture(e, r),
                                    t.set(r, s),
                                    r.addEventListener("dispose", i),
                                    n(s.texture, r.mapping)
                                }
                                return null
                            }
                        }
                    }
                    return r
                },
                dispose: function() {
                    t = new WeakMap
                }
            }
        }
        const Rc = [.125, .215, .35, .446, .526, .582]
          , Lc = 20
          , Dc = new Ro
          , Nc = new Hi;
        let Bc = null
          , Uc = 0
          , zc = 0
          , Oc = !1;
        const Fc = (1 + Math.sqrt(5)) / 2
          , Wc = 1 / Fc
          , Hc = [new bn(-Fc,Wc,0), new bn(Fc,Wc,0), new bn(-Wc,0,Fc), new bn(Wc,0,Fc), new bn(0,Fc,-Wc), new bn(0,Fc,Wc), new bn(-1,1,-1), new bn(1,1,-1), new bn(-1,1,1), new bn(1,1,1)]
          , Vc = new bn;
        class Gc {
            constructor(e) {
                this._renderer = e,
                this._pingPongRenderTarget = null,
                this._lodMax = 0,
                this._cubeSize = 0,
                this._lodPlanes = [],
                this._sizeLods = [],
                this._sigmas = [],
                this._blurMaterial = null,
                this._cubemapMaterial = null,
                this._equirectMaterial = null,
                this._compileMaterial(this._blurMaterial)
            }
            fromScene(e, t=0, n=.1, i=100, r={}) {
                const {size: a=256, position: s=Vc} = r;
                Bc = this._renderer.getRenderTarget(),
                Uc = this._renderer.getActiveCubeFace(),
                zc = this._renderer.getActiveMipmapLevel(),
                Oc = this._renderer.xr.enabled,
                this._renderer.xr.enabled = !1,
                this._setSize(a);
                const o = this._allocateTargets();
                return o.depthBuffer = !0,
                this._sceneToCubeUV(e, n, i, o, s),
                t > 0 && this._blur(o, 0, 0, t),
                this._applyPMREM(o),
                this._cleanup(o),
                o
            }
            fromEquirectangular(e, t=null) {
                return this._fromTexture(e, t)
            }
            fromCubemap(e, t=null) {
                return this._fromTexture(e, t)
            }
            compileCubemapShader() {
                null === this._cubemapMaterial && (this._cubemapMaterial = qc(),
                this._compileMaterial(this._cubemapMaterial))
            }
            compileEquirectangularShader() {
                null === this._equirectMaterial && (this._equirectMaterial = Kc(),
                this._compileMaterial(this._equirectMaterial))
            }
            dispose() {
                this._dispose(),
                null !== this._cubemapMaterial && this._cubemapMaterial.dispose(),
                null !== this._equirectMaterial && this._equirectMaterial.dispose()
            }
            _setSize(e) {
                this._lodMax = Math.floor(Math.log2(e)),
                this._cubeSize = Math.pow(2, this._lodMax)
            }
            _dispose() {
                null !== this._blurMaterial && this._blurMaterial.dispose(),
                null !== this._pingPongRenderTarget && this._pingPongRenderTarget.dispose();
                for (let e = 0; e < this._lodPlanes.length; e++)
                    this._lodPlanes[e].dispose()
            }
            _cleanup(e) {
                this._renderer.setRenderTarget(Bc, Uc, zc),
                this._renderer.xr.enabled = Oc,
                e.scissorTest = !1,
                Qc(e, 0, 0, e.width, e.height)
            }
            _fromTexture(e, t) {
                e.mapping === ee || e.mapping === te ? this._setSize(0 === e.image.length ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4),
                Bc = this._renderer.getRenderTarget(),
                Uc = this._renderer.getActiveCubeFace(),
                zc = this._renderer.getActiveMipmapLevel(),
                Oc = this._renderer.xr.enabled,
                this._renderer.xr.enabled = !1;
                const n = t || this._allocateTargets();
                return this._textureToCubeUV(e, n),
                this._applyPMREM(n),
                this._cleanup(n),
                n
            }
            _allocateTargets() {
                const e = 3 * Math.max(this._cubeSize, 112)
                  , t = 4 * this._cubeSize
                  , n = {
                    magFilter: de,
                    minFilter: de,
                    generateMipmaps: !1,
                    type: Ae,
                    format: Me,
                    colorSpace: wt,
                    depthBuffer: !1
                }
                  , i = jc(e, t, n);
                if (null === this._pingPongRenderTarget || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) {
                    null !== this._pingPongRenderTarget && this._dispose(),
                    this._pingPongRenderTarget = jc(e, t, n);
                    const {_lodMax: i} = this;
                    ({sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas} = function(e) {
                        const t = []
                          , n = []
                          , i = [];
                        let r = e;
                        const a = e - 4 + 1 + Rc.length;
                        for (let s = 0; s < a; s++) {
                            const a = Math.pow(2, r);
                            n.push(a);
                            let o = 1 / a;
                            s > e - 4 ? o = Rc[s - e + 4 - 1] : 0 === s && (o = 0),
                            i.push(o);
                            const l = 1 / (a - 2)
                              , c = -l
                              , h = 1 + l
                              , d = [c, c, h, c, h, h, c, c, h, h, c, h]
                              , u = 6
                              , p = 6
                              , f = 3
                              , m = 2
                              , g = 1
                              , v = new Float32Array(f * p * u)
                              , w = new Float32Array(m * p * u)
                              , y = new Float32Array(g * p * u);
                            for (let e = 0; e < u; e++) {
                                const t = e % 3 * 2 / 3 - 1
                                  , n = e > 2 ? 0 : -1
                                  , i = [t, n, 0, t + 2 / 3, n, 0, t + 2 / 3, n + 1, 0, t, n, 0, t + 2 / 3, n + 1, 0, t, n + 1, 0];
                                v.set(i, f * p * e),
                                w.set(d, m * p * e);
                                const r = [e, e, e, e, e, e];
                                y.set(r, g * p * e)
                            }
                            const b = new or;
                            b.setAttribute("position", new Xi(v,f)),
                            b.setAttribute("uv", new Xi(w,m)),
                            b.setAttribute("faceIndex", new Xi(y,g)),
                            t.push(b),
                            r > 4 && r--
                        }
                        return {
                            lodPlanes: t,
                            sizeLods: n,
                            sigmas: i
                        }
                    }(i)),
                    this._blurMaterial = function(e, t, n) {
                        const i = new Float32Array(Lc)
                          , r = new bn(0,1,0)
                          , a = new Mr({
                            name: "SphericalGaussianBlur",
                            defines: {
                                n: Lc,
                                CUBEUV_TEXEL_WIDTH: 1 / t,
                                CUBEUV_TEXEL_HEIGHT: 1 / n,
                                CUBEUV_MAX_MIP: `${e}.0`
                            },
                            uniforms: {
                                envMap: {
                                    value: null
                                },
                                samples: {
                                    value: 1
                                },
                                weights: {
                                    value: i
                                },
                                latitudinal: {
                                    value: !1
                                },
                                dTheta: {
                                    value: 0
                                },
                                mipInt: {
                                    value: 0
                                },
                                poleAxis: {
                                    value: r
                                }
                            },
                            vertexShader: Yc(),
                            fragmentShader: "\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",
                            blending: 0,
                            depthTest: !1,
                            depthWrite: !1
                        });
                        return a
                    }(i, e, t)
                }
                return i
            }
            _compileMaterial(e) {
                const t = new yr(this._lodPlanes[0],e);
                this._renderer.compile(t, Dc)
            }
            _sceneToCubeUV(e, t, n, i, r) {
                const a = new Ir(90,1,t,n)
                  , s = [1, -1, 1, 1, 1, 1]
                  , o = [1, 1, 1, -1, -1, -1]
                  , l = this._renderer
                  , c = l.autoClear
                  , h = l.toneMapping;
                l.getClearColor(Nc),
                l.toneMapping = 0,
                l.autoClear = !1;
                const d = new Qi({
                    name: "PMREM.Background",
                    side: 1,
                    depthWrite: !1,
                    depthTest: !1
                })
                  , u = new yr(new Ar,d);
                let p = !1;
                const f = e.background;
                f ? f.isColor && (d.color.copy(f),
                e.background = null,
                p = !0) : (d.color.copy(Nc),
                p = !0);
                for (let t = 0; t < 6; t++) {
                    const n = t % 3;
                    0 === n ? (a.up.set(0, s[t], 0),
                    a.position.set(r.x, r.y, r.z),
                    a.lookAt(r.x + o[t], r.y, r.z)) : 1 === n ? (a.up.set(0, 0, s[t]),
                    a.position.set(r.x, r.y, r.z),
                    a.lookAt(r.x, r.y + o[t], r.z)) : (a.up.set(0, s[t], 0),
                    a.position.set(r.x, r.y, r.z),
                    a.lookAt(r.x, r.y, r.z + o[t]));
                    const c = this._cubeSize;
                    Qc(i, n * c, t > 2 ? c : 0, c, c),
                    l.setRenderTarget(i),
                    p && l.render(u, a),
                    l.render(e, a)
                }
                u.geometry.dispose(),
                u.material.dispose(),
                l.toneMapping = h,
                l.autoClear = c,
                e.background = f
            }
            _textureToCubeUV(e, t) {
                const n = this._renderer
                  , i = e.mapping === ee || e.mapping === te;
                i ? (null === this._cubemapMaterial && (this._cubemapMaterial = qc()),
                this._cubemapMaterial.uniforms.flipEnvMap.value = !1 === e.isRenderTargetTexture ? -1 : 1) : null === this._equirectMaterial && (this._equirectMaterial = Kc());
                const r = i ? this._cubemapMaterial : this._equirectMaterial
                  , a = new yr(this._lodPlanes[0],r);
                r.uniforms.envMap.value = e;
                const s = this._cubeSize;
                Qc(t, 0, 0, 3 * s, 2 * s),
                n.setRenderTarget(t),
                n.render(a, Dc)
            }
            _applyPMREM(e) {
                const t = this._renderer
                  , n = t.autoClear;
                t.autoClear = !1;
                const i = this._lodPlanes.length;
                for (let t = 1; t < i; t++) {
                    const n = Math.sqrt(this._sigmas[t] * this._sigmas[t] - this._sigmas[t - 1] * this._sigmas[t - 1])
                      , r = Hc[(i - t - 1) % Hc.length];
                    this._blur(e, t - 1, t, n, r)
                }
                t.autoClear = n
            }
            _blur(e, t, n, i, r) {
                const a = this._pingPongRenderTarget;
                this._halfBlur(e, a, t, n, i, "latitudinal", r),
                this._halfBlur(a, e, n, n, i, "longitudinal", r)
            }
            _halfBlur(e, t, n, i, r, a, s) {
                const o = this._renderer
                  , l = this._blurMaterial;
                "latitudinal" !== a && "longitudinal" !== a && console.error("blur direction must be either latitudinal or longitudinal!");
                const c = new yr(this._lodPlanes[i],l)
                  , h = l.uniforms
                  , d = this._sizeLods[n] - 1
                  , u = isFinite(r) ? Math.PI / (2 * d) : 2 * Math.PI / 39
                  , p = r / u
                  , f = isFinite(r) ? 1 + Math.floor(3 * p) : Lc;
                f > Lc && console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);
                const m = [];
                let g = 0;
                for (let e = 0; e < Lc; ++e) {
                    const t = e / p
                      , n = Math.exp(-t * t / 2);
                    m.push(n),
                    0 === e ? g += n : e < f && (g += 2 * n)
                }
                for (let e = 0; e < m.length; e++)
                    m[e] = m[e] / g;
                h.envMap.value = e.texture,
                h.samples.value = f,
                h.weights.value = m,
                h.latitudinal.value = "latitudinal" === a,
                s && (h.poleAxis.value = s);
                const {_lodMax: v} = this;
                h.dTheta.value = u,
                h.mipInt.value = v - n;
                const w = this._sizeLods[i];
                Qc(t, 3 * w * (i > v - 4 ? i - v + 4 : 0), 4 * (this._cubeSize - w), 3 * w, 2 * w),
                o.setRenderTarget(t),
                o.render(c, Dc)
            }
        }
        function jc(e, t, n) {
            const i = new gn(e,t,n);
            return i.texture.mapping = re,
            i.texture.name = "PMREM.cubeUv",
            i.scissorTest = !0,
            i
        }
        function Qc(e, t, n, i, r) {
            e.viewport.set(t, n, i, r),
            e.scissor.set(t, n, i, r)
        }
        function Kc() {
            return new Mr({
                name: "EquirectangularToCubeUV",
                uniforms: {
                    envMap: {
                        value: null
                    }
                },
                vertexShader: Yc(),
                fragmentShader: "\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",
                blending: 0,
                depthTest: !1,
                depthWrite: !1
            })
        }
        function qc() {
            return new Mr({
                name: "CubemapToCubeUV",
                uniforms: {
                    envMap: {
                        value: null
                    },
                    flipEnvMap: {
                        value: -1
                    }
                },
                vertexShader: Yc(),
                fragmentShader: "\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",
                blending: 0,
                depthTest: !1,
                depthWrite: !1
            })
        }
        function Yc() {
            return "\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"
        }
        function Xc(e) {
            let t = new WeakMap
              , n = null;
            function i(e) {
                const n = e.target;
                n.removeEventListener("dispose", i);
                const r = t.get(n);
                void 0 !== r && (t.delete(n),
                r.dispose())
            }
            return {
                get: function(r) {
                    if (r && r.isTexture) {
                        const a = r.mapping
                          , s = a === ne || a === ie
                          , o = a === ee || a === te;
                        if (s || o) {
                            let a = t.get(r);
                            const l = void 0 !== a ? a.texture.pmremVersion : 0;
                            if (r.isRenderTargetTexture && r.pmremVersion !== l)
                                return null === n && (n = new Gc(e)),
                                a = s ? n.fromEquirectangular(r, a) : n.fromCubemap(r, a),
                                a.texture.pmremVersion = r.pmremVersion,
                                t.set(r, a),
                                a.texture;
                            if (void 0 !== a)
                                return a.texture;
                            {
                                const l = r.image;
                                return s && l && l.height > 0 || o && l && function(e) {
                                    let t = 0;
                                    const n = 6;
                                    for (let i = 0; i < n; i++)
                                        void 0 !== e[i] && t++;
                                    return t === n
                                }(l) ? (null === n && (n = new Gc(e)),
                                a = s ? n.fromEquirectangular(r) : n.fromCubemap(r),
                                a.texture.pmremVersion = r.pmremVersion,
                                t.set(r, a),
                                r.addEventListener("dispose", i),
                                a.texture) : null
                            }
                        }
                    }
                    return r
                },
                dispose: function() {
                    t = new WeakMap,
                    null !== n && (n.dispose(),
                    n = null)
                }
            }
        }
        function Zc(e) {
            const t = {};
            function n(n) {
                if (void 0 !== t[n])
                    return t[n];
                let i;
                switch (n) {
                case "WEBGL_depth_texture":
                    i = e.getExtension("WEBGL_depth_texture") || e.getExtension("MOZ_WEBGL_depth_texture") || e.getExtension("WEBKIT_WEBGL_depth_texture");
                    break;
                case "EXT_texture_filter_anisotropic":
                    i = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
                    break;
                case "WEBGL_compressed_texture_s3tc":
                    i = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
                    break;
                case "WEBGL_compressed_texture_pvrtc":
                    i = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
                    break;
                default:
                    i = e.getExtension(n)
                }
                return t[n] = i,
                i
            }
            return {
                has: function(e) {
                    return null !== n(e)
                },
                init: function() {
                    n("EXT_color_buffer_float"),
                    n("WEBGL_clip_cull_distance"),
                    n("OES_texture_float_linear"),
                    n("EXT_color_buffer_half_float"),
                    n("WEBGL_multisampled_render_to_texture"),
                    n("WEBGL_render_shared_exponent")
                },
                get: function(e) {
                    const t = n(e);
                    return null === t && $t("THREE.WebGLRenderer: " + e + " extension not supported."),
                    t
                }
            }
        }
        function Jc(e, t, n, i) {
            const r = {}
              , a = new WeakMap;
            function s(e) {
                const o = e.target;
                null !== o.index && t.remove(o.index);
                for (const e in o.attributes)
                    t.remove(o.attributes[e]);
                o.removeEventListener("dispose", s),
                delete r[o.id];
                const l = a.get(o);
                l && (t.remove(l),
                a.delete(o)),
                i.releaseStatesOfGeometry(o),
                !0 === o.isInstancedBufferGeometry && delete o._maxInstanceCount,
                n.memory.geometries--
            }
            function o(e) {
                const n = []
                  , i = e.index
                  , r = e.attributes.position;
                let s = 0;
                if (null !== i) {
                    const e = i.array;
                    s = i.version;
                    for (let t = 0, i = e.length; t < i; t += 3) {
                        const i = e[t + 0]
                          , r = e[t + 1]
                          , a = e[t + 2];
                        n.push(i, r, r, a, a, i)
                    }
                } else {
                    if (void 0 === r)
                        return;
                    {
                        const e = r.array;
                        s = r.version;
                        for (let t = 0, i = e.length / 3 - 1; t < i; t += 3) {
                            const e = t + 0
                              , i = t + 1
                              , r = t + 2;
                            n.push(e, i, i, r, r, e)
                        }
                    }
                }
                const o = new (Yt(n) ? Ji : Zi)(n,1);
                o.version = s;
                const l = a.get(e);
                l && t.remove(l),
                a.set(e, o)
            }
            return {
                get: function(e, t) {
                    return !0 === r[t.id] || (t.addEventListener("dispose", s),
                    r[t.id] = !0,
                    n.memory.geometries++),
                    t
                },
                update: function(n) {
                    const i = n.attributes;
                    for (const n in i)
                        t.update(i[n], e.ARRAY_BUFFER)
                },
                getWireframeAttribute: function(e) {
                    const t = a.get(e);
                    if (t) {
                        const n = e.index;
                        null !== n && t.version < n.version && o(e)
                    } else
                        o(e);
                    return a.get(e)
                }
            }
        }
        function $c(e, t, n) {
            let i, r, a;
            function s(t, s, o) {
                0 !== o && (e.drawElementsInstanced(i, s, r, t * a, o),
                n.update(s, i, o))
            }
            this.setMode = function(e) {
                i = e
            }
            ,
            this.setIndex = function(e) {
                r = e.type,
                a = e.bytesPerElement
            }
            ,
            this.render = function(t, s) {
                e.drawElements(i, s, r, t * a),
                n.update(s, i, 1)
            }
            ,
            this.renderInstances = s,
            this.renderMultiDraw = function(e, a, s) {
                if (0 === s)
                    return;
                t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i, a, 0, r, e, 0, s);
                let o = 0;
                for (let e = 0; e < s; e++)
                    o += a[e];
                n.update(o, i, 1)
            }
            ,
            this.renderMultiDrawInstances = function(e, o, l, c) {
                if (0 === l)
                    return;
                const h = t.get("WEBGL_multi_draw");
                if (null === h)
                    for (let t = 0; t < e.length; t++)
                        s(e[t] / a, o[t], c[t]);
                else {
                    h.multiDrawElementsInstancedWEBGL(i, o, 0, r, e, 0, c, 0, l);
                    let t = 0;
                    for (let e = 0; e < l; e++)
                        t += o[e] * c[e];
                    n.update(t, i, 1)
                }
            }
        }
        function eh(e) {
            const t = {
                frame: 0,
                calls: 0,
                triangles: 0,
                points: 0,
                lines: 0
            };
            return {
                memory: {
                    geometries: 0,
                    textures: 0
                },
                render: t,
                programs: null,
                autoReset: !0,
                reset: function() {
                    t.calls = 0,
                    t.triangles = 0,
                    t.points = 0,
                    t.lines = 0
                },
                update: function(n, i, r) {
                    switch (t.calls++,
                    i) {
                    case e.TRIANGLES:
                        t.triangles += r * (n / 3);
                        break;
                    case e.LINES:
                        t.lines += r * (n / 2);
                        break;
                    case e.LINE_STRIP:
                        t.lines += r * (n - 1);
                        break;
                    case e.LINE_LOOP:
                        t.lines += r * n;
                        break;
                    case e.POINTS:
                        t.points += r * n;
                        break;
                    default:
                        console.error("THREE.WebGLInfo: Unknown draw mode:", i)
                    }
                }
            }
        }
        function th(e, t, n) {
            const i = new WeakMap
              , r = new fn;
            return {
                update: function(a, s, o) {
                    const l = a.morphTargetInfluences
                      , c = s.morphAttributes.position || s.morphAttributes.normal || s.morphAttributes.color
                      , h = void 0 !== c ? c.length : 0;
                    let d = i.get(s);
                    if (void 0 === d || d.count !== h) {
                        void 0 !== d && d.texture.dispose();
                        const u = void 0 !== s.morphAttributes.position
                          , p = void 0 !== s.morphAttributes.normal
                          , f = void 0 !== s.morphAttributes.color
                          , m = s.morphAttributes.position || []
                          , g = s.morphAttributes.normal || []
                          , v = s.morphAttributes.color || [];
                        let w = 0;
                        !0 === u && (w = 1),
                        !0 === p && (w = 2),
                        !0 === f && (w = 3);
                        let y = s.attributes.position.count * w
                          , b = 1;
                        y > t.maxTextureSize && (b = Math.ceil(y / t.maxTextureSize),
                        y = t.maxTextureSize);
                        const A = new Float32Array(y * b * 4 * h)
                          , x = new vn(A,y,b,h);
                        x.type = be,
                        x.needsUpdate = !0;
                        const k = 4 * w;
                        for (let S = 0; S < h; S++) {
                            const M = m[S]
                              , _ = g[S]
                              , T = v[S]
                              , C = y * b * 4 * S;
                            for (let P = 0; P < M.count; P++) {
                                const I = P * k;
                                !0 === u && (r.fromBufferAttribute(M, P),
                                A[C + I + 0] = r.x,
                                A[C + I + 1] = r.y,
                                A[C + I + 2] = r.z,
                                A[C + I + 3] = 0),
                                !0 === p && (r.fromBufferAttribute(_, P),
                                A[C + I + 4] = r.x,
                                A[C + I + 5] = r.y,
                                A[C + I + 6] = r.z,
                                A[C + I + 7] = 0),
                                !0 === f && (r.fromBufferAttribute(T, P),
                                A[C + I + 8] = r.x,
                                A[C + I + 9] = r.y,
                                A[C + I + 10] = r.z,
                                A[C + I + 11] = 4 === T.itemSize ? r.w : 1)
                            }
                        }
                        function E() {
                            x.dispose(),
                            i.delete(s),
                            s.removeEventListener("dispose", E)
                        }
                        d = {
                            count: h,
                            texture: x,
                            size: new Qt(y,b)
                        },
                        i.set(s, d),
                        s.addEventListener("dispose", E)
                    }
                    if (!0 === a.isInstancedMesh && null !== a.morphTexture)
                        o.getUniforms().setValue(e, "morphTexture", a.morphTexture, n);
                    else {
                        let R = 0;
                        for (let D = 0; D < l.length; D++)
                            R += l[D];
                        const L = s.morphTargetsRelative ? 1 : 1 - R;
                        o.getUniforms().setValue(e, "morphTargetBaseInfluence", L),
                        o.getUniforms().setValue(e, "morphTargetInfluences", l)
                    }
                    o.getUniforms().setValue(e, "morphTargetsTexture", d.texture, n),
                    o.getUniforms().setValue(e, "morphTargetsTextureSize", d.size)
                }
            }
        }
        function nh(e, t, n, i) {
            let r = new WeakMap;
            function a(e) {
                const t = e.target;
                t.removeEventListener("dispose", a),
                n.remove(t.instanceMatrix),
                null !== t.instanceColor && n.remove(t.instanceColor)
            }
            return {
                update: function(s) {
                    const o = i.render.frame
                      , l = s.geometry
                      , c = t.get(s, l);
                    if (r.get(c) !== o && (t.update(c),
                    r.set(c, o)),
                    s.isInstancedMesh && (!1 === s.hasEventListener("dispose", a) && s.addEventListener("dispose", a),
                    r.get(s) !== o && (n.update(s.instanceMatrix, e.ARRAY_BUFFER),
                    null !== s.instanceColor && n.update(s.instanceColor, e.ARRAY_BUFFER),
                    r.set(s, o))),
                    s.isSkinnedMesh) {
                        const e = s.skeleton;
                        r.get(e) !== o && (e.update(),
                        r.set(e, o))
                    }
                    return c
                },
                dispose: function() {
                    r = new WeakMap
                }
            }
        }
        const ih = new pn
          , rh = new Ha(1,1)
          , ah = new vn
          , sh = new wn
          , oh = new Dr
          , lh = []
          , ch = []
          , hh = new Float32Array(16)
          , dh = new Float32Array(9)
          , uh = new Float32Array(4);
        function ph(e, t, n) {
            const i = e[0];
            if (i <= 0 || i > 0)
                return e;
            const r = t * n;
            let a = lh[r];
            if (void 0 === a && (a = new Float32Array(r),
            lh[r] = a),
            0 !== t) {
                i.toArray(a, 0);
                for (let i = 1, r = 0; i !== t; ++i)
                    r += n,
                    e[i].toArray(a, r)
            }
            return a
        }
        function fh(e, t) {
            if (e.length !== t.length)
                return !1;
            for (let n = 0, i = e.length; n < i; n++)
                if (e[n] !== t[n])
                    return !1;
            return !0
        }
        function mh(e, t) {
            for (let n = 0, i = t.length; n < i; n++)
                e[n] = t[n]
        }
        function gh(e, t) {
            let n = ch[t];
            void 0 === n && (n = new Int32Array(t),
            ch[t] = n);
            for (let i = 0; i !== t; ++i)
                n[i] = e.allocateTextureUnit();
            return n
        }
        function vh(e, t) {
            const n = this.cache;
            n[0] !== t && (e.uniform1f(this.addr, t),
            n[0] = t)
        }
        function wh(e, t) {
            const n = this.cache;
            if (void 0 !== t.x)
                n[0] === t.x && n[1] === t.y || (e.uniform2f(this.addr, t.x, t.y),
                n[0] = t.x,
                n[1] = t.y);
            else {
                if (fh(n, t))
                    return;
                e.uniform2fv(this.addr, t),
                mh(n, t)
            }
        }
        function yh(e, t) {
            const n = this.cache;
            if (void 0 !== t.x)
                n[0] === t.x && n[1] === t.y && n[2] === t.z || (e.uniform3f(this.addr, t.x, t.y, t.z),
                n[0] = t.x,
                n[1] = t.y,
                n[2] = t.z);
            else if (void 0 !== t.r)
                n[0] === t.r && n[1] === t.g && n[2] === t.b || (e.uniform3f(this.addr, t.r, t.g, t.b),
                n[0] = t.r,
                n[1] = t.g,
                n[2] = t.b);
            else {
                if (fh(n, t))
                    return;
                e.uniform3fv(this.addr, t),
                mh(n, t)
            }
        }
        function bh(e, t) {
            const n = this.cache;
            if (void 0 !== t.x)
                n[0] === t.x && n[1] === t.y && n[2] === t.z && n[3] === t.w || (e.uniform4f(this.addr, t.x, t.y, t.z, t.w),
                n[0] = t.x,
                n[1] = t.y,
                n[2] = t.z,
                n[3] = t.w);
            else {
                if (fh(n, t))
                    return;
                e.uniform4fv(this.addr, t),
                mh(n, t)
            }
        }
        function Ah(e, t) {
            const n = this.cache
              , i = t.elements;
            if (void 0 === i) {
                if (fh(n, t))
                    return;
                e.uniformMatrix2fv(this.addr, !1, t),
                mh(n, t)
            } else {
                if (fh(n, i))
                    return;
                uh.set(i),
                e.uniformMatrix2fv(this.addr, !1, uh),
                mh(n, i)
            }
        }
        function xh(e, t) {
            const n = this.cache
              , i = t.elements;
            if (void 0 === i) {
                if (fh(n, t))
                    return;
                e.uniformMatrix3fv(this.addr, !1, t),
                mh(n, t)
            } else {
                if (fh(n, i))
                    return;
                dh.set(i),
                e.uniformMatrix3fv(this.addr, !1, dh),
                mh(n, i)
            }
        }
        function kh(e, t) {
            const n = this.cache
              , i = t.elements;
            if (void 0 === i) {
                if (fh(n, t))
                    return;
                e.uniformMatrix4fv(this.addr, !1, t),
                mh(n, t)
            } else {
                if (fh(n, i))
                    return;
                hh.set(i),
                e.uniformMatrix4fv(this.addr, !1, hh),
                mh(n, i)
            }
        }
        function Eh(e, t) {
            const n = this.cache;
            n[0] !== t && (e.uniform1i(this.addr, t),
            n[0] = t)
        }
        function Sh(e, t) {
            const n = this.cache;
            if (void 0 !== t.x)
                n[0] === t.x && n[1] === t.y || (e.uniform2i(this.addr, t.x, t.y),
                n[0] = t.x,
                n[1] = t.y);
            else {
                if (fh(n, t))
                    return;
                e.uniform2iv(this.addr, t),
                mh(n, t)
            }
        }
        function Mh(e, t) {
            const n = this.cache;
            if (void 0 !== t.x)
                n[0] === t.x && n[1] === t.y && n[2] === t.z || (e.uniform3i(this.addr, t.x, t.y, t.z),
                n[0] = t.x,
                n[1] = t.y,
                n[2] = t.z);
            else {
                if (fh(n, t))
                    return;
                e.uniform3iv(this.addr, t),
                mh(n, t)
            }
        }
        function _h(e, t) {
            const n = this.cache;
            if (void 0 !== t.x)
                n[0] === t.x && n[1] === t.y && n[2] === t.z && n[3] === t.w || (e.uniform4i(this.addr, t.x, t.y, t.z, t.w),
                n[0] = t.x,
                n[1] = t.y,
                n[2] = t.z,
                n[3] = t.w);
            else {
                if (fh(n, t))
                    return;
                e.uniform4iv(this.addr, t),
                mh(n, t)
            }
        }
        function Th(e, t) {
            const n = this.cache;
            n[0] !== t && (e.uniform1ui(this.addr, t),
            n[0] = t)
        }
        function Ch(e, t) {
            const n = this.cache;
            if (void 0 !== t.x)
                n[0] === t.x && n[1] === t.y || (e.uniform2ui(this.addr, t.x, t.y),
                n[0] = t.x,
                n[1] = t.y);
            else {
                if (fh(n, t))
                    return;
                e.uniform2uiv(this.addr, t),
                mh(n, t)
            }
        }
        function Ph(e, t) {
            const n = this.cache;
            if (void 0 !== t.x)
                n[0] === t.x && n[1] === t.y && n[2] === t.z || (e.uniform3ui(this.addr, t.x, t.y, t.z),
                n[0] = t.x,
                n[1] = t.y,
                n[2] = t.z);
            else {
                if (fh(n, t))
                    return;
                e.uniform3uiv(this.addr, t),
                mh(n, t)
            }
        }
        function Ih(e, t) {
            const n = this.cache;
            if (void 0 !== t.x)
                n[0] === t.x && n[1] === t.y && n[2] === t.z && n[3] === t.w || (e.uniform4ui(this.addr, t.x, t.y, t.z, t.w),
                n[0] = t.x,
                n[1] = t.y,
                n[2] = t.z,
                n[3] = t.w);
            else {
                if (fh(n, t))
                    return;
                e.uniform4uiv(this.addr, t),
                mh(n, t)
            }
        }
        function Rh(e, t, n) {
            const i = this.cache
              , r = n.allocateTextureUnit();
            let a;
            i[0] !== r && (e.uniform1i(this.addr, r),
            i[0] = r),
            this.type === e.SAMPLER_2D_SHADOW ? (rh.compareFunction = 515,
            a = rh) : a = ih,
            n.setTexture2D(t || a, r)
        }
        function Lh(e, t, n) {
            const i = this.cache
              , r = n.allocateTextureUnit();
            i[0] !== r && (e.uniform1i(this.addr, r),
            i[0] = r),
            n.setTexture3D(t || sh, r)
        }
        function Dh(e, t, n) {
            const i = this.cache
              , r = n.allocateTextureUnit();
            i[0] !== r && (e.uniform1i(this.addr, r),
            i[0] = r),
            n.setTextureCube(t || oh, r)
        }
        function Nh(e, t, n) {
            const i = this.cache
              , r = n.allocateTextureUnit();
            i[0] !== r && (e.uniform1i(this.addr, r),
            i[0] = r),
            n.setTexture2DArray(t || ah, r)
        }
        function Bh(e, t) {
            e.uniform1fv(this.addr, t)
        }
        function Uh(e, t) {
            const n = ph(t, this.size, 2);
            e.uniform2fv(this.addr, n)
        }
        function zh(e, t) {
            const n = ph(t, this.size, 3);
            e.uniform3fv(this.addr, n)
        }
        function Oh(e, t) {
            const n = ph(t, this.size, 4);
            e.uniform4fv(this.addr, n)
        }
        function Fh(e, t) {
            const n = ph(t, this.size, 4);
            e.uniformMatrix2fv(this.addr, !1, n)
        }
        function Wh(e, t) {
            const n = ph(t, this.size, 9);
            e.uniformMatrix3fv(this.addr, !1, n)
        }
        function Hh(e, t) {
            const n = ph(t, this.size, 16);
            e.uniformMatrix4fv(this.addr, !1, n)
        }
        function Vh(e, t) {
            e.uniform1iv(this.addr, t)
        }
        function Gh(e, t) {
            e.uniform2iv(this.addr, t)
        }
        function jh(e, t) {
            e.uniform3iv(this.addr, t)
        }
        function Qh(e, t) {
            e.uniform4iv(this.addr, t)
        }
        function Kh(e, t) {
            e.uniform1uiv(this.addr, t)
        }
        function qh(e, t) {
            e.uniform2uiv(this.addr, t)
        }
        function Yh(e, t) {
            e.uniform3uiv(this.addr, t)
        }
        function Xh(e, t) {
            e.uniform4uiv(this.addr, t)
        }
        function Zh(e, t, n) {
            const i = this.cache
              , r = t.length
              , a = gh(n, r);
            fh(i, a) || (e.uniform1iv(this.addr, a),
            mh(i, a));
            for (let e = 0; e !== r; ++e)
                n.setTexture2D(t[e] || ih, a[e])
        }
        function Jh(e, t, n) {
            const i = this.cache
              , r = t.length
              , a = gh(n, r);
            fh(i, a) || (e.uniform1iv(this.addr, a),
            mh(i, a));
            for (let e = 0; e !== r; ++e)
                n.setTexture3D(t[e] || sh, a[e])
        }
        function $h(e, t, n) {
            const i = this.cache
              , r = t.length
              , a = gh(n, r);
            fh(i, a) || (e.uniform1iv(this.addr, a),
            mh(i, a));
            for (let e = 0; e !== r; ++e)
                n.setTextureCube(t[e] || oh, a[e])
        }
        function ed(e, t, n) {
            const i = this.cache
              , r = t.length
              , a = gh(n, r);
            fh(i, a) || (e.uniform1iv(this.addr, a),
            mh(i, a));
            for (let e = 0; e !== r; ++e)
                n.setTexture2DArray(t[e] || ah, a[e])
        }
        class td {
            constructor(e, t, n) {
                this.id = e,
                this.addr = n,
                this.cache = [],
                this.type = t.type,
                this.setValue = function(e) {
                    switch (e) {
                    case 5126:
                        return vh;
                    case 35664:
                        return wh;
                    case 35665:
                        return yh;
                    case 35666:
                        return bh;
                    case 35674:
                        return Ah;
                    case 35675:
                        return xh;
                    case 35676:
                        return kh;
                    case 5124:
                    case 35670:
                        return Eh;
                    case 35667:
                    case 35671:
                        return Sh;
                    case 35668:
                    case 35672:
                        return Mh;
                    case 35669:
                    case 35673:
                        return _h;
                    case 5125:
                        return Th;
                    case 36294:
                        return Ch;
                    case 36295:
                        return Ph;
                    case 36296:
                        return Ih;
                    case 35678:
                    case 36198:
                    case 36298:
                    case 36306:
                    case 35682:
                        return Rh;
                    case 35679:
                    case 36299:
                    case 36307:
                        return Lh;
                    case 35680:
                    case 36300:
                    case 36308:
                    case 36293:
                        return Dh;
                    case 36289:
                    case 36303:
                    case 36311:
                    case 36292:
                        return Nh
                    }
                }(t.type)
            }
        }
        class nd {
            constructor(e, t, n) {
                this.id = e,
                this.addr = n,
                this.cache = [],
                this.type = t.type,
                this.size = t.size,
                this.setValue = function(e) {
                    switch (e) {
                    case 5126:
                        return Bh;
                    case 35664:
                        return Uh;
                    case 35665:
                        return zh;
                    case 35666:
                        return Oh;
                    case 35674:
                        return Fh;
                    case 35675:
                        return Wh;
                    case 35676:
                        return Hh;
                    case 5124:
                    case 35670:
                        return Vh;
                    case 35667:
                    case 35671:
                        return Gh;
                    case 35668:
                    case 35672:
                        return jh;
                    case 35669:
                    case 35673:
                        return Qh;
                    case 5125:
                        return Kh;
                    case 36294:
                        return qh;
                    case 36295:
                        return Yh;
                    case 36296:
                        return Xh;
                    case 35678:
                    case 36198:
                    case 36298:
                    case 36306:
                    case 35682:
                        return Zh;
                    case 35679:
                    case 36299:
                    case 36307:
                        return Jh;
                    case 35680:
                    case 36300:
                    case 36308:
                    case 36293:
                        return $h;
                    case 36289:
                    case 36303:
                    case 36311:
                    case 36292:
                        return ed
                    }
                }(t.type)
            }
        }
        class id {
            constructor(e) {
                this.id = e,
                this.seq = [],
                this.map = {}
            }
            setValue(e, t, n) {
                const i = this.seq;
                for (let r = 0, a = i.length; r !== a; ++r) {
                    const a = i[r];
                    a.setValue(e, t[a.id], n)
                }
            }
        }
        const rd = /(\w+)(\])?(\[|\.)?/g;
        function ad(e, t) {
            e.seq.push(t),
            e.map[t.id] = t
        }
        function sd(e, t, n) {
            const i = e.name
              , r = i.length;
            for (rd.lastIndex = 0; ; ) {
                const a = rd.exec(i)
                  , s = rd.lastIndex;
                let o = a[1];
                const l = "]" === a[2]
                  , c = a[3];
                if (l && (o |= 0),
                void 0 === c || "[" === c && s + 2 === r) {
                    ad(n, void 0 === c ? new td(o,e,t) : new nd(o,e,t));
                    break
                }
                {
                    let e = n.map[o];
                    void 0 === e && (e = new id(o),
                    ad(n, e)),
                    n = e
                }
            }
        }
        class od {
            constructor(e, t) {
                this.seq = [],
                this.map = {};
                const n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS);
                for (let i = 0; i < n; ++i) {
                    const n = e.getActiveUniform(t, i);
                    sd(n, e.getUniformLocation(t, n.name), this)
                }
            }
            setValue(e, t, n, i) {
                const r = this.map[t];
                void 0 !== r && r.setValue(e, n, i)
            }
            setOptional(e, t, n) {
                const i = t[n];
                void 0 !== i && this.setValue(e, n, i)
            }
            static upload(e, t, n, i) {
                for (let r = 0, a = t.length; r !== a; ++r) {
                    const a = t[r]
                      , s = n[a.id];
                    !1 !== s.needsUpdate && a.setValue(e, s.value, i)
                }
            }
            static seqWithValue(e, t) {
                const n = [];
                for (let i = 0, r = e.length; i !== r; ++i) {
                    const r = e[i];
                    r.id in t && n.push(r)
                }
                return n
            }
        }
        function ld(e, t, n) {
            const i = e.createShader(t);
            return e.shaderSource(i, n),
            e.compileShader(i),
            i
        }
        let cd = 0;
        const hd = new Kt;
        function dd(e, t, n) {
            const i = e.getShaderParameter(t, e.COMPILE_STATUS)
              , r = e.getShaderInfoLog(t).trim();
            if (i && "" === r)
                return "";
            const a = /ERROR: 0:(\d+)/.exec(r);
            if (a) {
                const i = parseInt(a[1]);
                return n.toUpperCase() + "\n\n" + r + "\n\n" + function(e, t) {
                    const n = e.split("\n")
                      , i = []
                      , r = Math.max(t - 6, 0)
                      , a = Math.min(t + 6, n.length);
                    for (let e = r; e < a; e++) {
                        const r = e + 1;
                        i.push(`${r === t ? ">" : " "} ${r}: ${n[e]}`)
                    }
                    return i.join("\n")
                }(e.getShaderSource(t), i)
            }
            return r
        }
        function ud(e, t) {
            const n = function(e) {
                rn._getMatrix(hd, rn.workingColorSpace, e);
                const t = `mat3( ${hd.elements.map((e => e.toFixed(4)))} )`;
                switch (rn.getTransfer(e)) {
                case yt:
                    return [t, "LinearTransferOETF"];
                case bt:
                    return [t, "sRGBTransferOETF"];
                default:
                    return console.warn("THREE.WebGLProgram: Unsupported color space: ", e),
                    [t, "LinearTransferOETF"]
                }
            }(t);
            return [`vec4 ${e}( vec4 value ) {`, `\treturn ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`, "}"].join("\n")
        }
        function pd(e, t) {
            let n;
            switch (t) {
            case 1:
                n = "Linear";
                break;
            case 2:
                n = "Reinhard";
                break;
            case 3:
                n = "Cineon";
                break;
            case 4:
                n = "ACESFilmic";
                break;
            case 6:
                n = "AgX";
                break;
            case 7:
                n = "Neutral";
                break;
            case 5:
                n = "Custom";
                break;
            default:
                console.warn("THREE.WebGLProgram: Unsupported toneMapping:", t),
                n = "Linear"
            }
            return "vec3 " + e + "( vec3 color ) { return " + n + "ToneMapping( color ); }"
        }
        const fd = new bn;
        function md() {
            rn.getLuminanceCoefficients(fd);
            return ["float luminance( const in vec3 rgb ) {", `\tconst vec3 weights = vec3( ${fd.x.toFixed(4)}, ${fd.y.toFixed(4)}, ${fd.z.toFixed(4)} );`, "\treturn dot( weights, rgb );", "}"].join("\n")
        }
        function gd(e) {
            return "" !== e
        }
        function vd(e, t) {
            const n = t.numSpotLightShadows + t.numSpotLightMaps - t.numSpotLightShadowsWithMaps;
            return e.replace(/NUM_DIR_LIGHTS/g, t.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g, t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g, n).replace(/NUM_RECT_AREA_LIGHTS/g, t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, t.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g, t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, t.numPointLightShadows)
        }
        function wd(e, t) {
            return e.replace(/NUM_CLIPPING_PLANES/g, t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, t.numClippingPlanes - t.numClipIntersection)
        }
        const yd = /^[ \t]*#include +<([\w\d./]+)>/gm;
        function bd(e) {
            return e.replace(yd, xd)
        }
        const Ad = new Map;
        function xd(e, t) {
            let n = bc[t];
            if (void 0 === n) {
                const e = Ad.get(t);
                if (void 0 === e)
                    throw new Error("Can not resolve #include <" + t + ">");
                n = bc[e],
                console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', t, e)
            }
            return bd(n)
        }
        const kd = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
        function Ed(e) {
            return e.replace(kd, Sd)
        }
        function Sd(e, t, n, i) {
            let r = "";
            for (let e = parseInt(t); e < parseInt(n); e++)
                r += i.replace(/\[\s*i\s*\]/g, "[ " + e + " ]").replace(/UNROLLED_LOOP_INDEX/g, e);
            return r
        }
        function Md(e) {
            let t = `precision ${e.precision} float;\n\tprecision ${e.precision} int;\n\tprecision ${e.precision} sampler2D;\n\tprecision ${e.precision} samplerCube;\n\tprecision ${e.precision} sampler3D;\n\tprecision ${e.precision} sampler2DArray;\n\tprecision ${e.precision} sampler2DShadow;\n\tprecision ${e.precision} samplerCubeShadow;\n\tprecision ${e.precision} sampler2DArrayShadow;\n\tprecision ${e.precision} isampler2D;\n\tprecision ${e.precision} isampler3D;\n\tprecision ${e.precision} isamplerCube;\n\tprecision ${e.precision} isampler2DArray;\n\tprecision ${e.precision} usampler2D;\n\tprecision ${e.precision} usampler3D;\n\tprecision ${e.precision} usamplerCube;\n\tprecision ${e.precision} usampler2DArray;\n\t`;
            return "highp" === e.precision ? t += "\n#define HIGH_PRECISION" : "mediump" === e.precision ? t += "\n#define MEDIUM_PRECISION" : "lowp" === e.precision && (t += "\n#define LOW_PRECISION"),
            t
        }
        function _d(e, t, n, i) {
            const r = e.getContext()
              , a = n.defines;
            let s = n.vertexShader
              , o = n.fragmentShader;
            const l = function(e) {
                let t = "SHADOWMAP_TYPE_BASIC";
                return 1 === e.shadowMapType ? t = "SHADOWMAP_TYPE_PCF" : 2 === e.shadowMapType ? t = "SHADOWMAP_TYPE_PCF_SOFT" : 3 === e.shadowMapType && (t = "SHADOWMAP_TYPE_VSM"),
                t
            }(n)
              , c = function(e) {
                let t = "ENVMAP_TYPE_CUBE";
                if (e.envMap)
                    switch (e.envMapMode) {
                    case ee:
                    case te:
                        t = "ENVMAP_TYPE_CUBE";
                        break;
                    case re:
                        t = "ENVMAP_TYPE_CUBE_UV"
                    }
                return t
            }(n)
              , h = function(e) {
                let t = "ENVMAP_MODE_REFLECTION";
                e.envMap && e.envMapMode === te && (t = "ENVMAP_MODE_REFRACTION");
                return t
            }(n)
              , d = function(e) {
                let t = "ENVMAP_BLENDING_NONE";
                if (e.envMap)
                    switch (e.combine) {
                    case 0:
                        t = "ENVMAP_BLENDING_MULTIPLY";
                        break;
                    case 1:
                        t = "ENVMAP_BLENDING_MIX";
                        break;
                    case 2:
                        t = "ENVMAP_BLENDING_ADD"
                    }
                return t
            }(n)
              , u = function(e) {
                const t = e.envMapCubeUVHeight;
                if (null === t)
                    return null;
                const n = Math.log2(t) - 2
                  , i = 1 / t;
                return {
                    texelWidth: 1 / (3 * Math.max(Math.pow(2, n), 112)),
                    texelHeight: i,
                    maxMip: n
                }
            }(n)
              , p = function(e) {
                return [e.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "", e.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : ""].filter(gd).join("\n")
            }(n)
              , f = function(e) {
                const t = [];
                for (const n in e) {
                    const i = e[n];
                    !1 !== i && t.push("#define " + n + " " + i)
                }
                return t.join("\n")
            }(a)
              , m = r.createProgram();
            let g, v, w = n.glslVersion ? "#version " + n.glslVersion + "\n" : "";
            n.isRawShaderMaterial ? (g = ["#define SHADER_TYPE " + n.shaderType, "#define SHADER_NAME " + n.shaderName, f].filter(gd).join("\n"),
            g.length > 0 && (g += "\n"),
            v = ["#define SHADER_TYPE " + n.shaderType, "#define SHADER_NAME " + n.shaderName, f].filter(gd).join("\n"),
            v.length > 0 && (v += "\n")) : (g = [Md(n), "#define SHADER_TYPE " + n.shaderType, "#define SHADER_NAME " + n.shaderName, f, n.extensionClipCullDistance ? "#define USE_CLIP_DISTANCE" : "", n.batching ? "#define USE_BATCHING" : "", n.batchingColor ? "#define USE_BATCHING_COLOR" : "", n.instancing ? "#define USE_INSTANCING" : "", n.instancingColor ? "#define USE_INSTANCING_COLOR" : "", n.instancingMorph ? "#define USE_INSTANCING_MORPH" : "", n.useFog && n.fog ? "#define USE_FOG" : "", n.useFog && n.fogExp2 ? "#define FOG_EXP2" : "", n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + h : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.normalMapObjectSpace ? "#define USE_NORMALMAP_OBJECTSPACE" : "", n.normalMapTangentSpace ? "#define USE_NORMALMAP_TANGENTSPACE" : "", n.displacementMap ? "#define USE_DISPLACEMENTMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.anisotropy ? "#define USE_ANISOTROPY" : "", n.anisotropyMap ? "#define USE_ANISOTROPYMAP" : "", n.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", n.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", n.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", n.iridescenceMap ? "#define USE_IRIDESCENCEMAP" : "", n.iridescenceThicknessMap ? "#define USE_IRIDESCENCE_THICKNESSMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.specularColorMap ? "#define USE_SPECULAR_COLORMAP" : "", n.specularIntensityMap ? "#define USE_SPECULAR_INTENSITYMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.alphaHash ? "#define USE_ALPHAHASH" : "", n.transmission ? "#define USE_TRANSMISSION" : "", n.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", n.thicknessMap ? "#define USE_THICKNESSMAP" : "", n.sheenColorMap ? "#define USE_SHEEN_COLORMAP" : "", n.sheenRoughnessMap ? "#define USE_SHEEN_ROUGHNESSMAP" : "", n.mapUv ? "#define MAP_UV " + n.mapUv : "", n.alphaMapUv ? "#define ALPHAMAP_UV " + n.alphaMapUv : "", n.lightMapUv ? "#define LIGHTMAP_UV " + n.lightMapUv : "", n.aoMapUv ? "#define AOMAP_UV " + n.aoMapUv : "", n.emissiveMapUv ? "#define EMISSIVEMAP_UV " + n.emissiveMapUv : "", n.bumpMapUv ? "#define BUMPMAP_UV " + n.bumpMapUv : "", n.normalMapUv ? "#define NORMALMAP_UV " + n.normalMapUv : "", n.displacementMapUv ? "#define DISPLACEMENTMAP_UV " + n.displacementMapUv : "", n.metalnessMapUv ? "#define METALNESSMAP_UV " + n.metalnessMapUv : "", n.roughnessMapUv ? "#define ROUGHNESSMAP_UV " + n.roughnessMapUv : "", n.anisotropyMapUv ? "#define ANISOTROPYMAP_UV " + n.anisotropyMapUv : "", n.clearcoatMapUv ? "#define CLEARCOATMAP_UV " + n.clearcoatMapUv : "", n.clearcoatNormalMapUv ? "#define CLEARCOAT_NORMALMAP_UV " + n.clearcoatNormalMapUv : "", n.clearcoatRoughnessMapUv ? "#define CLEARCOAT_ROUGHNESSMAP_UV " + n.clearcoatRoughnessMapUv : "", n.iridescenceMapUv ? "#define IRIDESCENCEMAP_UV " + n.iridescenceMapUv : "", n.iridescenceThicknessMapUv ? "#define IRIDESCENCE_THICKNESSMAP_UV " + n.iridescenceThicknessMapUv : "", n.sheenColorMapUv ? "#define SHEEN_COLORMAP_UV " + n.sheenColorMapUv : "", n.sheenRoughnessMapUv ? "#define SHEEN_ROUGHNESSMAP_UV " + n.sheenRoughnessMapUv : "", n.specularMapUv ? "#define SPECULARMAP_UV " + n.specularMapUv : "", n.specularColorMapUv ? "#define SPECULAR_COLORMAP_UV " + n.specularColorMapUv : "", n.specularIntensityMapUv ? "#define SPECULAR_INTENSITYMAP_UV " + n.specularIntensityMapUv : "", n.transmissionMapUv ? "#define TRANSMISSIONMAP_UV " + n.transmissionMapUv : "", n.thicknessMapUv ? "#define THICKNESSMAP_UV " + n.thicknessMapUv : "", n.vertexTangents && !1 === n.flatShading ? "#define USE_TANGENT" : "", n.vertexColors ? "#define USE_COLOR" : "", n.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", n.vertexUv1s ? "#define USE_UV1" : "", n.vertexUv2s ? "#define USE_UV2" : "", n.vertexUv3s ? "#define USE_UV3" : "", n.pointsUvs ? "#define USE_POINTS_UV" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.skinning ? "#define USE_SKINNING" : "", n.morphTargets ? "#define USE_MORPHTARGETS" : "", n.morphNormals && !1 === n.flatShading ? "#define USE_MORPHNORMALS" : "", n.morphColors ? "#define USE_MORPHCOLORS" : "", n.morphTargetsCount > 0 ? "#define MORPHTARGETS_TEXTURE_STRIDE " + n.morphTextureStride : "", n.morphTargetsCount > 0 ? "#define MORPHTARGETS_COUNT " + n.morphTargetsCount : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + l : "", n.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", n.numLightProbes > 0 ? "#define USE_LIGHT_PROBES" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.reverseDepthBuffer ? "#define USE_REVERSEDEPTHBUF" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", "#ifdef USE_INSTANCING", "\tattribute mat4 instanceMatrix;", "#endif", "#ifdef USE_INSTANCING_COLOR", "\tattribute vec3 instanceColor;", "#endif", "#ifdef USE_INSTANCING_MORPH", "\tuniform sampler2D morphTexture;", "#endif", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_UV1", "\tattribute vec2 uv1;", "#endif", "#ifdef USE_UV2", "\tattribute vec2 uv2;", "#endif", "#ifdef USE_UV3", "\tattribute vec2 uv3;", "#endif", "#ifdef USE_TANGENT", "\tattribute vec4 tangent;", "#endif", "#if defined( USE_COLOR_ALPHA )", "\tattribute vec4 color;", "#elif defined( USE_COLOR )", "\tattribute vec3 color;", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(gd).join("\n"),
            v = [Md(n), "#define SHADER_TYPE " + n.shaderType, "#define SHADER_NAME " + n.shaderName, f, n.useFog && n.fog ? "#define USE_FOG" : "", n.useFog && n.fogExp2 ? "#define FOG_EXP2" : "", n.alphaToCoverage ? "#define ALPHA_TO_COVERAGE" : "", n.map ? "#define USE_MAP" : "", n.matcap ? "#define USE_MATCAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + c : "", n.envMap ? "#define " + h : "", n.envMap ? "#define " + d : "", u ? "#define CUBEUV_TEXEL_WIDTH " + u.texelWidth : "", u ? "#define CUBEUV_TEXEL_HEIGHT " + u.texelHeight : "", u ? "#define CUBEUV_MAX_MIP " + u.maxMip + ".0" : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.normalMapObjectSpace ? "#define USE_NORMALMAP_OBJECTSPACE" : "", n.normalMapTangentSpace ? "#define USE_NORMALMAP_TANGENTSPACE" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.anisotropy ? "#define USE_ANISOTROPY" : "", n.anisotropyMap ? "#define USE_ANISOTROPYMAP" : "", n.clearcoat ? "#define USE_CLEARCOAT" : "", n.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", n.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", n.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", n.dispersion ? "#define USE_DISPERSION" : "", n.iridescence ? "#define USE_IRIDESCENCE" : "", n.iridescenceMap ? "#define USE_IRIDESCENCEMAP" : "", n.iridescenceThicknessMap ? "#define USE_IRIDESCENCE_THICKNESSMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.specularColorMap ? "#define USE_SPECULAR_COLORMAP" : "", n.specularIntensityMap ? "#define USE_SPECULAR_INTENSITYMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.alphaTest ? "#define USE_ALPHATEST" : "", n.alphaHash ? "#define USE_ALPHAHASH" : "", n.sheen ? "#define USE_SHEEN" : "", n.sheenColorMap ? "#define USE_SHEEN_COLORMAP" : "", n.sheenRoughnessMap ? "#define USE_SHEEN_ROUGHNESSMAP" : "", n.transmission ? "#define USE_TRANSMISSION" : "", n.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", n.thicknessMap ? "#define USE_THICKNESSMAP" : "", n.vertexTangents && !1 === n.flatShading ? "#define USE_TANGENT" : "", n.vertexColors || n.instancingColor || n.batchingColor ? "#define USE_COLOR" : "", n.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", n.vertexUv1s ? "#define USE_UV1" : "", n.vertexUv2s ? "#define USE_UV2" : "", n.vertexUv3s ? "#define USE_UV3" : "", n.pointsUvs ? "#define USE_POINTS_UV" : "", n.gradientMap ? "#define USE_GRADIENTMAP" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + l : "", n.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", n.numLightProbes > 0 ? "#define USE_LIGHT_PROBES" : "", n.decodeVideoTexture ? "#define DECODE_VIDEO_TEXTURE" : "", n.decodeVideoTextureEmissive ? "#define DECODE_VIDEO_TEXTURE_EMISSIVE" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.reverseDepthBuffer ? "#define USE_REVERSEDEPTHBUF" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", 0 !== n.toneMapping ? "#define TONE_MAPPING" : "", 0 !== n.toneMapping ? bc.tonemapping_pars_fragment : "", 0 !== n.toneMapping ? pd("toneMapping", n.toneMapping) : "", n.dithering ? "#define DITHERING" : "", n.opaque ? "#define OPAQUE" : "", bc.colorspace_pars_fragment, ud("linearToOutputTexel", n.outputColorSpace), md(), n.useDepthPacking ? "#define DEPTH_PACKING " + n.depthPacking : "", "\n"].filter(gd).join("\n")),
            s = bd(s),
            s = vd(s, n),
            s = wd(s, n),
            o = bd(o),
            o = vd(o, n),
            o = wd(o, n),
            s = Ed(s),
            o = Ed(o),
            !0 !== n.isRawShaderMaterial && (w = "#version 300 es\n",
            g = [p, "#define attribute in", "#define varying out", "#define texture2D texture"].join("\n") + "\n" + g,
            v = ["#define varying in", n.glslVersion === It ? "" : "layout(location = 0) out highp vec4 pc_fragColor;", n.glslVersion === It ? "" : "#define gl_FragColor pc_fragColor", "#define gl_FragDepthEXT gl_FragDepth", "#define texture2D texture", "#define textureCube texture", "#define texture2DProj textureProj", "#define texture2DLodEXT textureLod", "#define texture2DProjLodEXT textureProjLod", "#define textureCubeLodEXT textureLod", "#define texture2DGradEXT textureGrad", "#define texture2DProjGradEXT textureProjGrad", "#define textureCubeGradEXT textureGrad"].join("\n") + "\n" + v);
            const y = w + g + s
              , b = w + v + o
              , A = ld(r, r.VERTEX_SHADER, y)
              , x = ld(r, r.FRAGMENT_SHADER, b);
            function k(t) {
                if (e.debug.checkShaderErrors) {
                    const n = r.getProgramInfoLog(m).trim()
                      , i = r.getShaderInfoLog(A).trim()
                      , a = r.getShaderInfoLog(x).trim();
                    let s = !0
                      , o = !0;
                    if (!1 === r.getProgramParameter(m, r.LINK_STATUS))
                        if (s = !1,
                        "function" == typeof e.debug.onShaderError)
                            e.debug.onShaderError(r, m, A, x);
                        else {
                            const e = dd(r, A, "vertex")
                              , i = dd(r, x, "fragment");
                            console.error("THREE.WebGLProgram: Shader Error " + r.getError() + " - VALIDATE_STATUS " + r.getProgramParameter(m, r.VALIDATE_STATUS) + "\n\nMaterial Name: " + t.name + "\nMaterial Type: " + t.type + "\n\nProgram Info Log: " + n + "\n" + e + "\n" + i)
                        }
                    else
                        "" !== n ? console.warn("THREE.WebGLProgram: Program Info Log:", n) : "" !== i && "" !== a || (o = !1);
                    o && (t.diagnostics = {
                        runnable: s,
                        programLog: n,
                        vertexShader: {
                            log: i,
                            prefix: g
                        },
                        fragmentShader: {
                            log: a,
                            prefix: v
                        }
                    })
                }
                r.deleteShader(A),
                r.deleteShader(x),
                E = new od(r,m),
                S = function(e, t) {
                    const n = {}
                      , i = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES);
                    for (let r = 0; r < i; r++) {
                        const i = e.getActiveAttrib(t, r)
                          , a = i.name;
                        let s = 1;
                        i.type === e.FLOAT_MAT2 && (s = 2),
                        i.type === e.FLOAT_MAT3 && (s = 3),
                        i.type === e.FLOAT_MAT4 && (s = 4),
                        n[a] = {
                            type: i.type,
                            location: e.getAttribLocation(t, a),
                            locationSize: s
                        }
                    }
                    return n
                }(r, m)
            }
            let E, S;
            r.attachShader(m, A),
            r.attachShader(m, x),
            void 0 !== n.index0AttributeName ? r.bindAttribLocation(m, 0, n.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(m, 0, "position"),
            r.linkProgram(m),
            this.getUniforms = function() {
                return void 0 === E && k(this),
                E
            }
            ,
            this.getAttributes = function() {
                return void 0 === S && k(this),
                S
            }
            ;
            let M = !1 === n.rendererExtensionParallelShaderCompile;
            return this.isReady = function() {
                return !1 === M && (M = r.getProgramParameter(m, 37297)),
                M
            }
            ,
            this.destroy = function() {
                i.releaseStatesOfProgram(this),
                r.deleteProgram(m),
                this.program = void 0
            }
            ,
            this.type = n.shaderType,
            this.name = n.shaderName,
            this.id = cd++,
            this.cacheKey = t,
            this.usedTimes = 1,
            this.program = m,
            this.vertexShader = A,
            this.fragmentShader = x,
            this
        }
        let Td = 0;
        class Cd {
            constructor() {
                this.shaderCache = new Map,
                this.materialCache = new Map
            }
            update(e) {
                const t = e.vertexShader
                  , n = e.fragmentShader
                  , i = this._getShaderStage(t)
                  , r = this._getShaderStage(n)
                  , a = this._getShaderCacheForMaterial(e);
                return !1 === a.has(i) && (a.add(i),
                i.usedTimes++),
                !1 === a.has(r) && (a.add(r),
                r.usedTimes++),
                this
            }
            remove(e) {
                const t = this.materialCache.get(e);
                for (const e of t)
                    e.usedTimes--,
                    0 === e.usedTimes && this.shaderCache.delete(e.code);
                return this.materialCache.delete(e),
                this
            }
            getVertexShaderID(e) {
                return this._getShaderStage(e.vertexShader).id
            }
            getFragmentShaderID(e) {
                return this._getShaderStage(e.fragmentShader).id
            }
            dispose() {
                this.shaderCache.clear(),
                this.materialCache.clear()
            }
            _getShaderCacheForMaterial(e) {
                const t = this.materialCache;
                let n = t.get(e);
                return void 0 === n && (n = new Set,
                t.set(e, n)),
                n
            }
            _getShaderStage(e) {
                const t = this.shaderCache;
                let n = t.get(e);
                return void 0 === n && (n = new Pd(e),
                t.set(e, n)),
                n
            }
        }
        class Pd {
            constructor(e) {
                this.id = Td++,
                this.code = e,
                this.usedTimes = 0
            }
        }
        function Id(e, t, n, i, r, a, s) {
            const o = new oi
              , l = new Cd
              , c = new Set
              , h = []
              , d = r.logarithmicDepthBuffer
              , u = r.vertexTextures;
            let p = r.precision;
            const f = {
                MeshDepthMaterial: "depth",
                MeshDistanceMaterial: "distanceRGBA",
                MeshNormalMaterial: "normal",
                MeshBasicMaterial: "basic",
                MeshLambertMaterial: "lambert",
                MeshPhongMaterial: "phong",
                MeshToonMaterial: "toon",
                MeshStandardMaterial: "physical",
                MeshPhysicalMaterial: "physical",
                MeshMatcapMaterial: "matcap",
                LineBasicMaterial: "basic",
                LineDashedMaterial: "dashed",
                PointsMaterial: "points",
                ShadowMaterial: "shadow",
                SpriteMaterial: "sprite"
            };
            function m(e) {
                return c.add(e),
                0 === e ? "uv" : `uv${e}`
            }
            return {
                getParameters: function(a, o, h, g, v) {
                    const w = g.fog
                      , y = v.geometry
                      , b = a.isMeshStandardMaterial ? g.environment : null
                      , A = (a.isMeshStandardMaterial ? n : t).get(a.envMap || b)
                      , x = A && A.mapping === re ? A.image.height : null
                      , k = f[a.type];
                    null !== a.precision && (p = r.getMaxPrecision(a.precision),
                    p !== a.precision && console.warn("THREE.WebGLProgram.getParameters:", a.precision, "not supported, using", p, "instead."));
                    const E = y.morphAttributes.position || y.morphAttributes.normal || y.morphAttributes.color
                      , S = void 0 !== E ? E.length : 0;
                    let M, _, T, C, P = 0;
                    if (void 0 !== y.morphAttributes.position && (P = 1),
                    void 0 !== y.morphAttributes.normal && (P = 2),
                    void 0 !== y.morphAttributes.color && (P = 3),
                    k) {
                        const e = xc[k];
                        M = e.vertexShader,
                        _ = e.fragmentShader
                    } else
                        M = a.vertexShader,
                        _ = a.fragmentShader,
                        l.update(a),
                        T = l.getVertexShaderID(a),
                        C = l.getFragmentShaderID(a);
                    const I = e.getRenderTarget()
                      , R = e.state.buffers.depth.getReversed()
                      , L = !0 === v.isInstancedMesh
                      , D = !0 === v.isBatchedMesh
                      , N = !!a.map
                      , B = !!a.matcap
                      , U = !!A
                      , z = !!a.aoMap
                      , O = !!a.lightMap
                      , F = !!a.bumpMap
                      , W = !!a.normalMap
                      , H = !!a.displacementMap
                      , V = !!a.emissiveMap
                      , G = !!a.metalnessMap
                      , j = !!a.roughnessMap
                      , Q = a.anisotropy > 0
                      , K = a.clearcoat > 0
                      , q = a.dispersion > 0
                      , Y = a.iridescence > 0
                      , X = a.sheen > 0
                      , Z = a.transmission > 0
                      , J = Q && !!a.anisotropyMap
                      , $ = K && !!a.clearcoatMap
                      , ee = K && !!a.clearcoatNormalMap
                      , te = K && !!a.clearcoatRoughnessMap
                      , ne = Y && !!a.iridescenceMap
                      , ie = Y && !!a.iridescenceThicknessMap
                      , ae = X && !!a.sheenColorMap
                      , se = X && !!a.sheenRoughnessMap
                      , oe = !!a.specularMap
                      , le = !!a.specularColorMap
                      , ce = !!a.specularIntensityMap
                      , he = Z && !!a.transmissionMap
                      , de = Z && !!a.thicknessMap
                      , ue = !!a.gradientMap
                      , pe = !!a.alphaMap
                      , fe = a.alphaTest > 0
                      , me = !!a.alphaHash
                      , ge = !!a.extensions;
                    let ve = 0;
                    a.toneMapped && (null !== I && !0 !== I.isXRRenderTarget || (ve = e.toneMapping));
                    const we = {
                        shaderID: k,
                        shaderType: a.type,
                        shaderName: a.name,
                        vertexShader: M,
                        fragmentShader: _,
                        defines: a.defines,
                        customVertexShaderID: T,
                        customFragmentShaderID: C,
                        isRawShaderMaterial: !0 === a.isRawShaderMaterial,
                        glslVersion: a.glslVersion,
                        precision: p,
                        batching: D,
                        batchingColor: D && null !== v._colorsTexture,
                        instancing: L,
                        instancingColor: L && null !== v.instanceColor,
                        instancingMorph: L && null !== v.morphTexture,
                        supportsVertexTextures: u,
                        outputColorSpace: null === I ? e.outputColorSpace : !0 === I.isXRRenderTarget ? I.texture.colorSpace : wt,
                        alphaToCoverage: !!a.alphaToCoverage,
                        map: N,
                        matcap: B,
                        envMap: U,
                        envMapMode: U && A.mapping,
                        envMapCubeUVHeight: x,
                        aoMap: z,
                        lightMap: O,
                        bumpMap: F,
                        normalMap: W,
                        displacementMap: u && H,
                        emissiveMap: V,
                        normalMapObjectSpace: W && 1 === a.normalMapType,
                        normalMapTangentSpace: W && 0 === a.normalMapType,
                        metalnessMap: G,
                        roughnessMap: j,
                        anisotropy: Q,
                        anisotropyMap: J,
                        clearcoat: K,
                        clearcoatMap: $,
                        clearcoatNormalMap: ee,
                        clearcoatRoughnessMap: te,
                        dispersion: q,
                        iridescence: Y,
                        iridescenceMap: ne,
                        iridescenceThicknessMap: ie,
                        sheen: X,
                        sheenColorMap: ae,
                        sheenRoughnessMap: se,
                        specularMap: oe,
                        specularColorMap: le,
                        specularIntensityMap: ce,
                        transmission: Z,
                        transmissionMap: he,
                        thicknessMap: de,
                        gradientMap: ue,
                        opaque: !1 === a.transparent && 1 === a.blending && !1 === a.alphaToCoverage,
                        alphaMap: pe,
                        alphaTest: fe,
                        alphaHash: me,
                        combine: a.combine,
                        mapUv: N && m(a.map.channel),
                        aoMapUv: z && m(a.aoMap.channel),
                        lightMapUv: O && m(a.lightMap.channel),
                        bumpMapUv: F && m(a.bumpMap.channel),
                        normalMapUv: W && m(a.normalMap.channel),
                        displacementMapUv: H && m(a.displacementMap.channel),
                        emissiveMapUv: V && m(a.emissiveMap.channel),
                        metalnessMapUv: G && m(a.metalnessMap.channel),
                        roughnessMapUv: j && m(a.roughnessMap.channel),
                        anisotropyMapUv: J && m(a.anisotropyMap.channel),
                        clearcoatMapUv: $ && m(a.clearcoatMap.channel),
                        clearcoatNormalMapUv: ee && m(a.clearcoatNormalMap.channel),
                        clearcoatRoughnessMapUv: te && m(a.clearcoatRoughnessMap.channel),
                        iridescenceMapUv: ne && m(a.iridescenceMap.channel),
                        iridescenceThicknessMapUv: ie && m(a.iridescenceThicknessMap.channel),
                        sheenColorMapUv: ae && m(a.sheenColorMap.channel),
                        sheenRoughnessMapUv: se && m(a.sheenRoughnessMap.channel),
                        specularMapUv: oe && m(a.specularMap.channel),
                        specularColorMapUv: le && m(a.specularColorMap.channel),
                        specularIntensityMapUv: ce && m(a.specularIntensityMap.channel),
                        transmissionMapUv: he && m(a.transmissionMap.channel),
                        thicknessMapUv: de && m(a.thicknessMap.channel),
                        alphaMapUv: pe && m(a.alphaMap.channel),
                        vertexTangents: !!y.attributes.tangent && (W || Q),
                        vertexColors: a.vertexColors,
                        vertexAlphas: !0 === a.vertexColors && !!y.attributes.color && 4 === y.attributes.color.itemSize,
                        pointsUvs: !0 === v.isPoints && !!y.attributes.uv && (N || pe),
                        fog: !!w,
                        useFog: !0 === a.fog,
                        fogExp2: !!w && w.isFogExp2,
                        flatShading: !0 === a.flatShading,
                        sizeAttenuation: !0 === a.sizeAttenuation,
                        logarithmicDepthBuffer: d,
                        reverseDepthBuffer: R,
                        skinning: !0 === v.isSkinnedMesh,
                        morphTargets: void 0 !== y.morphAttributes.position,
                        morphNormals: void 0 !== y.morphAttributes.normal,
                        morphColors: void 0 !== y.morphAttributes.color,
                        morphTargetsCount: S,
                        morphTextureStride: P,
                        numDirLights: o.directional.length,
                        numPointLights: o.point.length,
                        numSpotLights: o.spot.length,
                        numSpotLightMaps: o.spotLightMap.length,
                        numRectAreaLights: o.rectArea.length,
                        numHemiLights: o.hemi.length,
                        numDirLightShadows: o.directionalShadowMap.length,
                        numPointLightShadows: o.pointShadowMap.length,
                        numSpotLightShadows: o.spotShadowMap.length,
                        numSpotLightShadowsWithMaps: o.numSpotLightShadowsWithMaps,
                        numLightProbes: o.numLightProbes,
                        numClippingPlanes: s.numPlanes,
                        numClipIntersection: s.numIntersection,
                        dithering: a.dithering,
                        shadowMapEnabled: e.shadowMap.enabled && h.length > 0,
                        shadowMapType: e.shadowMap.type,
                        toneMapping: ve,
                        decodeVideoTexture: N && !0 === a.map.isVideoTexture && rn.getTransfer(a.map.colorSpace) === bt,
                        decodeVideoTextureEmissive: V && !0 === a.emissiveMap.isVideoTexture && rn.getTransfer(a.emissiveMap.colorSpace) === bt,
                        premultipliedAlpha: a.premultipliedAlpha,
                        doubleSided: 2 === a.side,
                        flipSided: 1 === a.side,
                        useDepthPacking: a.depthPacking >= 0,
                        depthPacking: a.depthPacking || 0,
                        index0AttributeName: a.index0AttributeName,
                        extensionClipCullDistance: ge && !0 === a.extensions.clipCullDistance && i.has("WEBGL_clip_cull_distance"),
                        extensionMultiDraw: (ge && !0 === a.extensions.multiDraw || D) && i.has("WEBGL_multi_draw"),
                        rendererExtensionParallelShaderCompile: i.has("KHR_parallel_shader_compile"),
                        customProgramCacheKey: a.customProgramCacheKey()
                    };
                    return we.vertexUv1s = c.has(1),
                    we.vertexUv2s = c.has(2),
                    we.vertexUv3s = c.has(3),
                    c.clear(),
                    we
                },
                getProgramCacheKey: function(t) {
                    const n = [];
                    if (t.shaderID ? n.push(t.shaderID) : (n.push(t.customVertexShaderID),
                    n.push(t.customFragmentShaderID)),
                    void 0 !== t.defines)
                        for (const e in t.defines)
                            n.push(e),
                            n.push(t.defines[e]);
                    return !1 === t.isRawShaderMaterial && (!function(e, t) {
                        e.push(t.precision),
                        e.push(t.outputColorSpace),
                        e.push(t.envMapMode),
                        e.push(t.envMapCubeUVHeight),
                        e.push(t.mapUv),
                        e.push(t.alphaMapUv),
                        e.push(t.lightMapUv),
                        e.push(t.aoMapUv),
                        e.push(t.bumpMapUv),
                        e.push(t.normalMapUv),
                        e.push(t.displacementMapUv),
                        e.push(t.emissiveMapUv),
                        e.push(t.metalnessMapUv),
                        e.push(t.roughnessMapUv),
                        e.push(t.anisotropyMapUv),
                        e.push(t.clearcoatMapUv),
                        e.push(t.clearcoatNormalMapUv),
                        e.push(t.clearcoatRoughnessMapUv),
                        e.push(t.iridescenceMapUv),
                        e.push(t.iridescenceThicknessMapUv),
                        e.push(t.sheenColorMapUv),
                        e.push(t.sheenRoughnessMapUv),
                        e.push(t.specularMapUv),
                        e.push(t.specularColorMapUv),
                        e.push(t.specularIntensityMapUv),
                        e.push(t.transmissionMapUv),
                        e.push(t.thicknessMapUv),
                        e.push(t.combine),
                        e.push(t.fogExp2),
                        e.push(t.sizeAttenuation),
                        e.push(t.morphTargetsCount),
                        e.push(t.morphAttributeCount),
                        e.push(t.numDirLights),
                        e.push(t.numPointLights),
                        e.push(t.numSpotLights),
                        e.push(t.numSpotLightMaps),
                        e.push(t.numHemiLights),
                        e.push(t.numRectAreaLights),
                        e.push(t.numDirLightShadows),
                        e.push(t.numPointLightShadows),
                        e.push(t.numSpotLightShadows),
                        e.push(t.numSpotLightShadowsWithMaps),
                        e.push(t.numLightProbes),
                        e.push(t.shadowMapType),
                        e.push(t.toneMapping),
                        e.push(t.numClippingPlanes),
                        e.push(t.numClipIntersection),
                        e.push(t.depthPacking)
                    }(n, t),
                    function(e, t) {
                        o.disableAll(),
                        t.supportsVertexTextures && o.enable(0);
                        t.instancing && o.enable(1);
                        t.instancingColor && o.enable(2);
                        t.instancingMorph && o.enable(3);
                        t.matcap && o.enable(4);
                        t.envMap && o.enable(5);
                        t.normalMapObjectSpace && o.enable(6);
                        t.normalMapTangentSpace && o.enable(7);
                        t.clearcoat && o.enable(8);
                        t.iridescence && o.enable(9);
                        t.alphaTest && o.enable(10);
                        t.vertexColors && o.enable(11);
                        t.vertexAlphas && o.enable(12);
                        t.vertexUv1s && o.enable(13);
                        t.vertexUv2s && o.enable(14);
                        t.vertexUv3s && o.enable(15);
                        t.vertexTangents && o.enable(16);
                        t.anisotropy && o.enable(17);
                        t.alphaHash && o.enable(18);
                        t.batching && o.enable(19);
                        t.dispersion && o.enable(20);
                        t.batchingColor && o.enable(21);
                        e.push(o.mask),
                        o.disableAll(),
                        t.fog && o.enable(0);
                        t.useFog && o.enable(1);
                        t.flatShading && o.enable(2);
                        t.logarithmicDepthBuffer && o.enable(3);
                        t.reverseDepthBuffer && o.enable(4);
                        t.skinning && o.enable(5);
                        t.morphTargets && o.enable(6);
                        t.morphNormals && o.enable(7);
                        t.morphColors && o.enable(8);
                        t.premultipliedAlpha && o.enable(9);
                        t.shadowMapEnabled && o.enable(10);
                        t.doubleSided && o.enable(11);
                        t.flipSided && o.enable(12);
                        t.useDepthPacking && o.enable(13);
                        t.dithering && o.enable(14);
                        t.transmission && o.enable(15);
                        t.sheen && o.enable(16);
                        t.opaque && o.enable(17);
                        t.pointsUvs && o.enable(18);
                        t.decodeVideoTexture && o.enable(19);
                        t.decodeVideoTextureEmissive && o.enable(20);
                        t.alphaToCoverage && o.enable(21);
                        e.push(o.mask)
                    }(n, t),
                    n.push(e.outputColorSpace)),
                    n.push(t.customProgramCacheKey),
                    n.join()
                },
                getUniforms: function(e) {
                    const t = f[e.type];
                    let n;
                    if (t) {
                        const e = xc[t];
                        n = Sr.clone(e.uniforms)
                    } else
                        n = e.uniforms;
                    return n
                },
                acquireProgram: function(t, n) {
                    let i;
                    for (let e = 0, t = h.length; e < t; e++) {
                        const t = h[e];
                        if (t.cacheKey === n) {
                            i = t,
                            ++i.usedTimes;
                            break
                        }
                    }
                    return void 0 === i && (i = new _d(e,n,t,a),
                    h.push(i)),
                    i
                },
                releaseProgram: function(e) {
                    if (0 == --e.usedTimes) {
                        const t = h.indexOf(e);
                        h[t] = h[h.length - 1],
                        h.pop(),
                        e.destroy()
                    }
                },
                releaseShaderCache: function(e) {
                    l.remove(e)
                },
                programs: h,
                dispose: function() {
                    l.dispose()
                }
            }
        }
        function Rd() {
            let e = new WeakMap;
            return {
                has: function(t) {
                    return e.has(t)
                },
                get: function(t) {
                    let n = e.get(t);
                    return void 0 === n && (n = {},
                    e.set(t, n)),
                    n
                },
                remove: function(t) {
                    e.delete(t)
                },
                update: function(t, n, i) {
                    e.get(t)[n] = i
                },
                dispose: function() {
                    e = new WeakMap
                }
            }
        }
        function Ld(e, t) {
            return e.groupOrder !== t.groupOrder ? e.groupOrder - t.groupOrder : e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.material.id !== t.material.id ? e.material.id - t.material.id : e.z !== t.z ? e.z - t.z : e.id - t.id
        }
        function Dd(e, t) {
            return e.groupOrder !== t.groupOrder ? e.groupOrder - t.groupOrder : e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : e.id - t.id
        }
        function Nd() {
            const e = [];
            let t = 0;
            const n = []
              , i = []
              , r = [];
            function a(n, i, r, a, s, o) {
                let l = e[t];
                return void 0 === l ? (l = {
                    id: n.id,
                    object: n,
                    geometry: i,
                    material: r,
                    groupOrder: a,
                    renderOrder: n.renderOrder,
                    z: s,
                    group: o
                },
                e[t] = l) : (l.id = n.id,
                l.object = n,
                l.geometry = i,
                l.material = r,
                l.groupOrder = a,
                l.renderOrder = n.renderOrder,
                l.z = s,
                l.group = o),
                t++,
                l
            }
            return {
                opaque: n,
                transmissive: i,
                transparent: r,
                init: function() {
                    t = 0,
                    n.length = 0,
                    i.length = 0,
                    r.length = 0
                },
                push: function(e, t, s, o, l, c) {
                    const h = a(e, t, s, o, l, c);
                    s.transmission > 0 ? i.push(h) : !0 === s.transparent ? r.push(h) : n.push(h)
                },
                unshift: function(e, t, s, o, l, c) {
                    const h = a(e, t, s, o, l, c);
                    s.transmission > 0 ? i.unshift(h) : !0 === s.transparent ? r.unshift(h) : n.unshift(h)
                },
                finish: function() {
                    for (let n = t, i = e.length; n < i; n++) {
                        const t = e[n];
                        if (null === t.id)
                            break;
                        t.id = null,
                        t.object = null,
                        t.geometry = null,
                        t.material = null,
                        t.group = null
                    }
                },
                sort: function(e, t) {
                    n.length > 1 && n.sort(e || Ld),
                    i.length > 1 && i.sort(t || Dd),
                    r.length > 1 && r.sort(t || Dd)
                }
            }
        }
        function Bd() {
            let e = new WeakMap;
            return {
                get: function(t, n) {
                    const i = e.get(t);
                    let r;
                    return void 0 === i ? (r = new Nd,
                    e.set(t, [r])) : n >= i.length ? (r = new Nd,
                    i.push(r)) : r = i[n],
                    r
                },
                dispose: function() {
                    e = new WeakMap
                }
            }
        }
        function Ud() {
            const e = {};
            return {
                get: function(t) {
                    if (void 0 !== e[t.id])
                        return e[t.id];
                    let n;
                    switch (t.type) {
                    case "DirectionalLight":
                        n = {
                            direction: new bn,
                            color: new Hi
                        };
                        break;
                    case "SpotLight":
                        n = {
                            position: new bn,
                            direction: new bn,
                            color: new Hi,
                            distance: 0,
                            coneCos: 0,
                            penumbraCos: 0,
                            decay: 0
                        };
                        break;
                    case "PointLight":
                        n = {
                            position: new bn,
                            color: new Hi,
                            distance: 0,
                            decay: 0
                        };
                        break;
                    case "HemisphereLight":
                        n = {
                            direction: new bn,
                            skyColor: new Hi,
                            groundColor: new Hi
                        };
                        break;
                    case "RectAreaLight":
                        n = {
                            color: new Hi,
                            position: new bn,
                            halfWidth: new bn,
                            halfHeight: new bn
                        }
                    }
                    return e[t.id] = n,
                    n
                }
            }
        }
        let zd = 0;
        function Od(e, t) {
            return (t.castShadow ? 2 : 0) - (e.castShadow ? 2 : 0) + (t.map ? 1 : 0) - (e.map ? 1 : 0)
        }
        function Fd(e) {
            const t = new Ud
              , n = function() {
                const e = {};
                return {
                    get: function(t) {
                        if (void 0 !== e[t.id])
                            return e[t.id];
                        let n;
                        switch (t.type) {
                        case "DirectionalLight":
                        case "SpotLight":
                            n = {
                                shadowIntensity: 1,
                                shadowBias: 0,
                                shadowNormalBias: 0,
                                shadowRadius: 1,
                                shadowMapSize: new Qt
                            };
                            break;
                        case "PointLight":
                            n = {
                                shadowIntensity: 1,
                                shadowBias: 0,
                                shadowNormalBias: 0,
                                shadowRadius: 1,
                                shadowMapSize: new Qt,
                                shadowCameraNear: 1,
                                shadowCameraFar: 1e3
                            }
                        }
                        return e[t.id] = n,
                        n
                    }
                }
            }()
              , i = {
                version: 0,
                hash: {
                    directionalLength: -1,
                    pointLength: -1,
                    spotLength: -1,
                    rectAreaLength: -1,
                    hemiLength: -1,
                    numDirectionalShadows: -1,
                    numPointShadows: -1,
                    numSpotShadows: -1,
                    numSpotMaps: -1,
                    numLightProbes: -1
                },
                ambient: [0, 0, 0],
                probe: [],
                directional: [],
                directionalShadow: [],
                directionalShadowMap: [],
                directionalShadowMatrix: [],
                spot: [],
                spotLightMap: [],
                spotShadow: [],
                spotShadowMap: [],
                spotLightMatrix: [],
                rectArea: [],
                rectAreaLTC1: null,
                rectAreaLTC2: null,
                point: [],
                pointShadow: [],
                pointShadowMap: [],
                pointShadowMatrix: [],
                hemi: [],
                numSpotLightShadowsWithMaps: 0,
                numLightProbes: 0
            };
            for (let e = 0; e < 9; e++)
                i.probe.push(new bn);
            const r = new bn
              , a = new Xn
              , s = new Xn;
            return {
                setup: function(r) {
                    let a = 0
                      , s = 0
                      , o = 0;
                    for (let e = 0; e < 9; e++)
                        i.probe[e].set(0, 0, 0);
                    let l = 0
                      , c = 0
                      , h = 0
                      , d = 0
                      , u = 0
                      , p = 0
                      , f = 0
                      , m = 0
                      , g = 0
                      , v = 0
                      , w = 0;
                    r.sort(Od);
                    for (let e = 0, y = r.length; e < y; e++) {
                        const y = r[e]
                          , b = y.color
                          , A = y.intensity
                          , x = y.distance
                          , k = y.shadow && y.shadow.map ? y.shadow.map.texture : null;
                        if (y.isAmbientLight)
                            a += b.r * A,
                            s += b.g * A,
                            o += b.b * A;
                        else if (y.isLightProbe) {
                            for (let e = 0; e < 9; e++)
                                i.probe[e].addScaledVector(y.sh.coefficients[e], A);
                            w++
                        } else if (y.isDirectionalLight) {
                            const e = t.get(y);
                            if (e.color.copy(y.color).multiplyScalar(y.intensity),
                            y.castShadow) {
                                const e = y.shadow
                                  , t = n.get(y);
                                t.shadowIntensity = e.intensity,
                                t.shadowBias = e.bias,
                                t.shadowNormalBias = e.normalBias,
                                t.shadowRadius = e.radius,
                                t.shadowMapSize = e.mapSize,
                                i.directionalShadow[l] = t,
                                i.directionalShadowMap[l] = k,
                                i.directionalShadowMatrix[l] = y.shadow.matrix,
                                p++
                            }
                            i.directional[l] = e,
                            l++
                        } else if (y.isSpotLight) {
                            const e = t.get(y);
                            e.position.setFromMatrixPosition(y.matrixWorld),
                            e.color.copy(b).multiplyScalar(A),
                            e.distance = x,
                            e.coneCos = Math.cos(y.angle),
                            e.penumbraCos = Math.cos(y.angle * (1 - y.penumbra)),
                            e.decay = y.decay,
                            i.spot[h] = e;
                            const r = y.shadow;
                            if (y.map && (i.spotLightMap[g] = y.map,
                            g++,
                            r.updateMatrices(y),
                            y.castShadow && v++),
                            i.spotLightMatrix[h] = r.matrix,
                            y.castShadow) {
                                const e = n.get(y);
                                e.shadowIntensity = r.intensity,
                                e.shadowBias = r.bias,
                                e.shadowNormalBias = r.normalBias,
                                e.shadowRadius = r.radius,
                                e.shadowMapSize = r.mapSize,
                                i.spotShadow[h] = e,
                                i.spotShadowMap[h] = k,
                                m++
                            }
                            h++
                        } else if (y.isRectAreaLight) {
                            const e = t.get(y);
                            e.color.copy(b).multiplyScalar(A),
                            e.halfWidth.set(.5 * y.width, 0, 0),
                            e.halfHeight.set(0, .5 * y.height, 0),
                            i.rectArea[d] = e,
                            d++
                        } else if (y.isPointLight) {
                            const e = t.get(y);
                            if (e.color.copy(y.color).multiplyScalar(y.intensity),
                            e.distance = y.distance,
                            e.decay = y.decay,
                            y.castShadow) {
                                const e = y.shadow
                                  , t = n.get(y);
                                t.shadowIntensity = e.intensity,
                                t.shadowBias = e.bias,
                                t.shadowNormalBias = e.normalBias,
                                t.shadowRadius = e.radius,
                                t.shadowMapSize = e.mapSize,
                                t.shadowCameraNear = e.camera.near,
                                t.shadowCameraFar = e.camera.far,
                                i.pointShadow[c] = t,
                                i.pointShadowMap[c] = k,
                                i.pointShadowMatrix[c] = y.shadow.matrix,
                                f++
                            }
                            i.point[c] = e,
                            c++
                        } else if (y.isHemisphereLight) {
                            const e = t.get(y);
                            e.skyColor.copy(y.color).multiplyScalar(A),
                            e.groundColor.copy(y.groundColor).multiplyScalar(A),
                            i.hemi[u] = e,
                            u++
                        }
                    }
                    d > 0 && (!0 === e.has("OES_texture_float_linear") ? (i.rectAreaLTC1 = Ac.LTC_FLOAT_1,
                    i.rectAreaLTC2 = Ac.LTC_FLOAT_2) : (i.rectAreaLTC1 = Ac.LTC_HALF_1,
                    i.rectAreaLTC2 = Ac.LTC_HALF_2)),
                    i.ambient[0] = a,
                    i.ambient[1] = s,
                    i.ambient[2] = o;
                    const y = i.hash;
                    y.directionalLength === l && y.pointLength === c && y.spotLength === h && y.rectAreaLength === d && y.hemiLength === u && y.numDirectionalShadows === p && y.numPointShadows === f && y.numSpotShadows === m && y.numSpotMaps === g && y.numLightProbes === w || (i.directional.length = l,
                    i.spot.length = h,
                    i.rectArea.length = d,
                    i.point.length = c,
                    i.hemi.length = u,
                    i.directionalShadow.length = p,
                    i.directionalShadowMap.length = p,
                    i.pointShadow.length = f,
                    i.pointShadowMap.length = f,
                    i.spotShadow.length = m,
                    i.spotShadowMap.length = m,
                    i.directionalShadowMatrix.length = p,
                    i.pointShadowMatrix.length = f,
                    i.spotLightMatrix.length = m + g - v,
                    i.spotLightMap.length = g,
                    i.numSpotLightShadowsWithMaps = v,
                    i.numLightProbes = w,
                    y.directionalLength = l,
                    y.pointLength = c,
                    y.spotLength = h,
                    y.rectAreaLength = d,
                    y.hemiLength = u,
                    y.numDirectionalShadows = p,
                    y.numPointShadows = f,
                    y.numSpotShadows = m,
                    y.numSpotMaps = g,
                    y.numLightProbes = w,
                    i.version = zd++)
                },
                setupView: function(e, t) {
                    let n = 0
                      , o = 0
                      , l = 0
                      , c = 0
                      , h = 0;
                    const d = t.matrixWorldInverse;
                    for (let t = 0, u = e.length; t < u; t++) {
                        const u = e[t];
                        if (u.isDirectionalLight) {
                            const e = i.directional[n];
                            e.direction.setFromMatrixPosition(u.matrixWorld),
                            r.setFromMatrixPosition(u.target.matrixWorld),
                            e.direction.sub(r),
                            e.direction.transformDirection(d),
                            n++
                        } else if (u.isSpotLight) {
                            const e = i.spot[l];
                            e.position.setFromMatrixPosition(u.matrixWorld),
                            e.position.applyMatrix4(d),
                            e.direction.setFromMatrixPosition(u.matrixWorld),
                            r.setFromMatrixPosition(u.target.matrixWorld),
                            e.direction.sub(r),
                            e.direction.transformDirection(d),
                            l++
                        } else if (u.isRectAreaLight) {
                            const e = i.rectArea[c];
                            e.position.setFromMatrixPosition(u.matrixWorld),
                            e.position.applyMatrix4(d),
                            s.identity(),
                            a.copy(u.matrixWorld),
                            a.premultiply(d),
                            s.extractRotation(a),
                            e.halfWidth.set(.5 * u.width, 0, 0),
                            e.halfHeight.set(0, .5 * u.height, 0),
                            e.halfWidth.applyMatrix4(s),
                            e.halfHeight.applyMatrix4(s),
                            c++
                        } else if (u.isPointLight) {
                            const e = i.point[o];
                            e.position.setFromMatrixPosition(u.matrixWorld),
                            e.position.applyMatrix4(d),
                            o++
                        } else if (u.isHemisphereLight) {
                            const e = i.hemi[h];
                            e.direction.setFromMatrixPosition(u.matrixWorld),
                            e.direction.transformDirection(d),
                            h++
                        }
                    }
                },
                state: i
            }
        }
        function Wd(e) {
            const t = new Fd(e)
              , n = []
              , i = [];
            const r = {
                lightsArray: n,
                shadowsArray: i,
                camera: null,
                lights: t,
                transmissionRenderTarget: {}
            };
            return {
                init: function(e) {
                    r.camera = e,
                    n.length = 0,
                    i.length = 0
                },
                state: r,
                setupLights: function() {
                    t.setup(n)
                },
                setupLightsView: function(e) {
                    t.setupView(n, e)
                },
                pushLight: function(e) {
                    n.push(e)
                },
                pushShadow: function(e) {
                    i.push(e)
                }
            }
        }
        function Hd(e) {
            let t = new WeakMap;
            return {
                get: function(n, i=0) {
                    const r = t.get(n);
                    let a;
                    return void 0 === r ? (a = new Wd(e),
                    t.set(n, [a])) : i >= r.length ? (a = new Wd(e),
                    r.push(a)) : a = r[i],
                    a
                },
                dispose: function() {
                    t = new WeakMap
                }
            }
        }
        function Vd(e, t, n) {
            let i = new ba;
            const r = new Qt
              , a = new Qt
              , s = new fn
              , o = new Hs({
                depthPacking: 3201
            })
              , l = new Vs
              , c = {}
              , h = n.maxTextureSize
              , d = {
                [E]: 1,
                [S]: 0,
                [M]: 2
            }
              , u = new Mr({
                defines: {
                    VSM_SAMPLES: 8
                },
                uniforms: {
                    shadow_pass: {
                        value: null
                    },
                    resolution: {
                        value: new Qt
                    },
                    radius: {
                        value: 4
                    }
                },
                vertexShader: "void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",
                fragmentShader: "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"
            })
              , p = u.clone();
            p.defines.HORIZONTAL_PASS = 1;
            const f = new or;
            f.setAttribute("position", new Xi(new Float32Array([-1, -1, .5, 3, -1, .5, -1, 3, .5]),3));
            const m = new yr(f,u)
              , g = this;
            this.enabled = !1,
            this.autoUpdate = !0,
            this.needsUpdate = !1,
            this.type = 1;
            let v = this.type;
            function w(n, i) {
                const a = t.update(m);
                u.defines.VSM_SAMPLES !== n.blurSamples && (u.defines.VSM_SAMPLES = n.blurSamples,
                p.defines.VSM_SAMPLES = n.blurSamples,
                u.needsUpdate = !0,
                p.needsUpdate = !0),
                null === n.mapPass && (n.mapPass = new gn(r.x,r.y)),
                u.uniforms.shadow_pass.value = n.map.texture,
                u.uniforms.resolution.value = n.mapSize,
                u.uniforms.radius.value = n.radius,
                e.setRenderTarget(n.mapPass),
                e.clear(),
                e.renderBufferDirect(i, null, a, u, m, null),
                p.uniforms.shadow_pass.value = n.mapPass.texture,
                p.uniforms.resolution.value = n.mapSize,
                p.uniforms.radius.value = n.radius,
                e.setRenderTarget(n.map),
                e.clear(),
                e.renderBufferDirect(i, null, a, p, m, null)
            }
            function y(t, n, i, r) {
                let a = null;
                const s = !0 === i.isPointLight ? t.customDistanceMaterial : t.customDepthMaterial;
                if (void 0 !== s)
                    a = s;
                else if (a = !0 === i.isPointLight ? l : o,
                e.localClippingEnabled && !0 === n.clipShadows && Array.isArray(n.clippingPlanes) && 0 !== n.clippingPlanes.length || n.displacementMap && 0 !== n.displacementScale || n.alphaMap && n.alphaTest > 0 || n.map && n.alphaTest > 0) {
                    const e = a.uuid
                      , t = n.uuid;
                    let i = c[e];
                    void 0 === i && (i = {},
                    c[e] = i);
                    let r = i[t];
                    void 0 === r && (r = a.clone(),
                    i[t] = r,
                    n.addEventListener("dispose", A)),
                    a = r
                }
                if (a.visible = n.visible,
                a.wireframe = n.wireframe,
                a.side = 3 === r ? null !== n.shadowSide ? n.shadowSide : n.side : null !== n.shadowSide ? n.shadowSide : d[n.side],
                a.alphaMap = n.alphaMap,
                a.alphaTest = n.alphaTest,
                a.map = n.map,
                a.clipShadows = n.clipShadows,
                a.clippingPlanes = n.clippingPlanes,
                a.clipIntersection = n.clipIntersection,
                a.displacementMap = n.displacementMap,
                a.displacementScale = n.displacementScale,
                a.displacementBias = n.displacementBias,
                a.wireframeLinewidth = n.wireframeLinewidth,
                a.linewidth = n.linewidth,
                !0 === i.isPointLight && !0 === a.isMeshDistanceMaterial) {
                    e.properties.get(a).light = i
                }
                return a
            }
            function b(n, r, a, s, o) {
                if (!1 === n.visible)
                    return;
                if (n.layers.test(r.layers) && (n.isMesh || n.isLine || n.isPoints) && (n.castShadow || n.receiveShadow && 3 === o) && (!n.frustumCulled || i.intersectsObject(n))) {
                    n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse, n.matrixWorld);
                    const i = t.update(n)
                      , l = n.material;
                    if (Array.isArray(l)) {
                        const t = i.groups;
                        for (let c = 0, h = t.length; c < h; c++) {
                            const h = t[c]
                              , d = l[h.materialIndex];
                            if (d && d.visible) {
                                const t = y(n, d, s, o);
                                n.onBeforeShadow(e, n, r, a, i, t, h),
                                e.renderBufferDirect(a, null, i, t, n, h),
                                n.onAfterShadow(e, n, r, a, i, t, h)
                            }
                        }
                    } else if (l.visible) {
                        const t = y(n, l, s, o);
                        n.onBeforeShadow(e, n, r, a, i, t, null),
                        e.renderBufferDirect(a, null, i, t, n, null),
                        n.onAfterShadow(e, n, r, a, i, t, null)
                    }
                }
                const l = n.children;
                for (let e = 0, t = l.length; e < t; e++)
                    b(l[e], r, a, s, o)
            }
            function A(e) {
                e.target.removeEventListener("dispose", A);
                for (const t in c) {
                    const n = c[t]
                      , i = e.target.uuid;
                    if (i in n) {
                        n[i].dispose(),
                        delete n[i]
                    }
                }
            }
            this.render = function(t, n, o) {
                if (!1 === g.enabled)
                    return;
                if (!1 === g.autoUpdate && !1 === g.needsUpdate)
                    return;
                if (0 === t.length)
                    return;
                const l = e.getRenderTarget()
                  , c = e.getActiveCubeFace()
                  , d = e.getActiveMipmapLevel()
                  , u = e.state;
                u.setBlending(0),
                u.buffers.color.setClear(1, 1, 1, 1),
                u.buffers.depth.setTest(!0),
                u.setScissorTest(!1);
                const p = 3 !== v && 3 === this.type
                  , f = 3 === v && 3 !== this.type;
                for (let l = 0, c = t.length; l < c; l++) {
                    const c = t[l]
                      , d = c.shadow;
                    if (void 0 === d) {
                        console.warn("THREE.WebGLShadowMap:", c, "has no shadow.");
                        continue
                    }
                    if (!1 === d.autoUpdate && !1 === d.needsUpdate)
                        continue;
                    r.copy(d.mapSize);
                    const m = d.getFrameExtents();
                    if (r.multiply(m),
                    a.copy(d.mapSize),
                    (r.x > h || r.y > h) && (r.x > h && (a.x = Math.floor(h / m.x),
                    r.x = a.x * m.x,
                    d.mapSize.x = a.x),
                    r.y > h && (a.y = Math.floor(h / m.y),
                    r.y = a.y * m.y,
                    d.mapSize.y = a.y)),
                    null === d.map || !0 === p || !0 === f) {
                        const e = 3 !== this.type ? {
                            minFilter: le,
                            magFilter: le
                        } : {};
                        null !== d.map && d.map.dispose(),
                        d.map = new gn(r.x,r.y,e),
                        d.map.texture.name = c.name + ".shadowMap",
                        d.camera.updateProjectionMatrix()
                    }
                    e.setRenderTarget(d.map),
                    e.clear();
                    const g = d.getViewportCount();
                    for (let e = 0; e < g; e++) {
                        const t = d.getViewport(e);
                        s.set(a.x * t.x, a.y * t.y, a.x * t.z, a.y * t.w),
                        u.viewport(s),
                        d.updateMatrices(c, e),
                        i = d.getFrustum(),
                        b(n, o, d.camera, c, this.type)
                    }
                    !0 !== d.isPointLightShadow && 3 === this.type && w(d, o),
                    d.needsUpdate = !1
                }
                v = this.type,
                g.needsUpdate = !1,
                e.setRenderTarget(l, c, d)
            }
        }
        const Gd = {
            [j]: 1,
            [K]: 6,
            [Y]: 7,
            [q]: 5,
            [Q]: 0,
            [Z]: 2,
            [J]: 4,
            [X]: 3
        };
        function jd(e, t) {
            const n = new function() {
                let t = !1;
                const n = new fn;
                let i = null;
                const r = new fn(0,0,0,0);
                return {
                    setMask: function(n) {
                        i === n || t || (e.colorMask(n, n, n, n),
                        i = n)
                    },
                    setLocked: function(e) {
                        t = e
                    },
                    setClear: function(t, i, a, s, o) {
                        !0 === o && (t *= s,
                        i *= s,
                        a *= s),
                        n.set(t, i, a, s),
                        !1 === r.equals(n) && (e.clearColor(t, i, a, s),
                        r.copy(n))
                    },
                    reset: function() {
                        t = !1,
                        i = null,
                        r.set(-1, 0, 0, 0)
                    }
                }
            }
              , i = new function() {
                let n = !1
                  , i = !1
                  , r = null
                  , a = null
                  , s = null;
                return {
                    setReversed: function(e) {
                        if (i !== e) {
                            const e = t.get("EXT_clip_control");
                            i ? e.clipControlEXT(e.LOWER_LEFT_EXT, e.ZERO_TO_ONE_EXT) : e.clipControlEXT(e.LOWER_LEFT_EXT, e.NEGATIVE_ONE_TO_ONE_EXT);
                            const n = s;
                            s = null,
                            this.setClear(n)
                        }
                        i = e
                    },
                    getReversed: function() {
                        return i
                    },
                    setTest: function(t) {
                        t ? re(e.DEPTH_TEST) : ae(e.DEPTH_TEST)
                    },
                    setMask: function(t) {
                        r === t || n || (e.depthMask(t),
                        r = t)
                    },
                    setFunc: function(t) {
                        if (i && (t = Gd[t]),
                        a !== t) {
                            switch (t) {
                            case 0:
                                e.depthFunc(e.NEVER);
                                break;
                            case 1:
                                e.depthFunc(e.ALWAYS);
                                break;
                            case 2:
                                e.depthFunc(e.LESS);
                                break;
                            case 3:
                            default:
                                e.depthFunc(e.LEQUAL);
                                break;
                            case 4:
                                e.depthFunc(e.EQUAL);
                                break;
                            case 5:
                                e.depthFunc(e.GEQUAL);
                                break;
                            case 6:
                                e.depthFunc(e.GREATER);
                                break;
                            case 7:
                                e.depthFunc(e.NOTEQUAL)
                            }
                            a = t
                        }
                    },
                    setLocked: function(e) {
                        n = e
                    },
                    setClear: function(t) {
                        s !== t && (i && (t = 1 - t),
                        e.clearDepth(t),
                        s = t)
                    },
                    reset: function() {
                        n = !1,
                        r = null,
                        a = null,
                        s = null,
                        i = !1
                    }
                }
            }
              , r = new function() {
                let t = !1
                  , n = null
                  , i = null
                  , r = null
                  , a = null
                  , s = null
                  , o = null
                  , l = null
                  , c = null;
                return {
                    setTest: function(n) {
                        t || (n ? re(e.STENCIL_TEST) : ae(e.STENCIL_TEST))
                    },
                    setMask: function(i) {
                        n === i || t || (e.stencilMask(i),
                        n = i)
                    },
                    setFunc: function(t, n, s) {
                        i === t && r === n && a === s || (e.stencilFunc(t, n, s),
                        i = t,
                        r = n,
                        a = s)
                    },
                    setOp: function(t, n, i) {
                        s === t && o === n && l === i || (e.stencilOp(t, n, i),
                        s = t,
                        o = n,
                        l = i)
                    },
                    setLocked: function(e) {
                        t = e
                    },
                    setClear: function(t) {
                        c !== t && (e.clearStencil(t),
                        c = t)
                    },
                    reset: function() {
                        t = !1,
                        n = null,
                        i = null,
                        r = null,
                        a = null,
                        s = null,
                        o = null,
                        l = null,
                        c = null
                    }
                }
            }
              , a = new WeakMap
              , s = new WeakMap;
            let o = {}
              , l = {}
              , c = new WeakMap
              , h = []
              , d = null
              , u = !1
              , p = null
              , f = null
              , m = null
              , g = null
              , v = null
              , w = null
              , y = null
              , b = new Hi(0,0,0)
              , A = 0
              , x = !1
              , k = null
              , E = null
              , S = null
              , M = null
              , j = null;
            const Q = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);
            let K = !1
              , q = 0;
            const Y = e.getParameter(e.VERSION);
            -1 !== Y.indexOf("WebGL") ? (q = parseFloat(/^WebGL (\d)/.exec(Y)[1]),
            K = q >= 1) : -1 !== Y.indexOf("OpenGL ES") && (q = parseFloat(/^OpenGL ES (\d)/.exec(Y)[1]),
            K = q >= 2);
            let X = null
              , Z = {};
            const J = e.getParameter(e.SCISSOR_BOX)
              , $ = e.getParameter(e.VIEWPORT)
              , ee = (new fn).fromArray(J)
              , te = (new fn).fromArray($);
            function ne(t, n, i, r) {
                const a = new Uint8Array(4)
                  , s = e.createTexture();
                e.bindTexture(t, s),
                e.texParameteri(t, e.TEXTURE_MIN_FILTER, e.NEAREST),
                e.texParameteri(t, e.TEXTURE_MAG_FILTER, e.NEAREST);
                for (let s = 0; s < i; s++)
                    t === e.TEXTURE_3D || t === e.TEXTURE_2D_ARRAY ? e.texImage3D(n, 0, e.RGBA, 1, 1, r, 0, e.RGBA, e.UNSIGNED_BYTE, a) : e.texImage2D(n + s, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, a);
                return s
            }
            const ie = {};
            function re(t) {
                !0 !== o[t] && (e.enable(t),
                o[t] = !0)
            }
            function ae(t) {
                !1 !== o[t] && (e.disable(t),
                o[t] = !1)
            }
            ie[e.TEXTURE_2D] = ne(e.TEXTURE_2D, e.TEXTURE_2D, 1),
            ie[e.TEXTURE_CUBE_MAP] = ne(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6),
            ie[e.TEXTURE_2D_ARRAY] = ne(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1),
            ie[e.TEXTURE_3D] = ne(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1),
            n.setClear(0, 0, 0, 1),
            i.setClear(1),
            r.setClear(0),
            re(e.DEPTH_TEST),
            i.setFunc(3),
            ce(!1),
            he(1),
            re(e.CULL_FACE),
            le(0);
            const se = {
                [_]: e.FUNC_ADD,
                [T]: e.FUNC_SUBTRACT,
                [C]: e.FUNC_REVERSE_SUBTRACT
            };
            se[103] = e.MIN,
            se[104] = e.MAX;
            const oe = {
                [P]: e.ZERO,
                [I]: e.ONE,
                [R]: e.SRC_COLOR,
                [D]: e.SRC_ALPHA,
                [F]: e.SRC_ALPHA_SATURATE,
                [z]: e.DST_COLOR,
                [B]: e.DST_ALPHA,
                [L]: e.ONE_MINUS_SRC_COLOR,
                [N]: e.ONE_MINUS_SRC_ALPHA,
                [O]: e.ONE_MINUS_DST_COLOR,
                [U]: e.ONE_MINUS_DST_ALPHA,
                [W]: e.CONSTANT_COLOR,
                [H]: e.ONE_MINUS_CONSTANT_COLOR,
                [V]: e.CONSTANT_ALPHA,
                [G]: e.ONE_MINUS_CONSTANT_ALPHA
            };
            function le(t, n, i, r, a, s, o, l, c, h) {
                if (0 !== t) {
                    if (!1 === u && (re(e.BLEND),
                    u = !0),
                    5 === t)
                        a = a || n,
                        s = s || i,
                        o = o || r,
                        n === f && a === v || (e.blendEquationSeparate(se[n], se[a]),
                        f = n,
                        v = a),
                        i === m && r === g && s === w && o === y || (e.blendFuncSeparate(oe[i], oe[r], oe[s], oe[o]),
                        m = i,
                        g = r,
                        w = s,
                        y = o),
                        !1 !== l.equals(b) && c === A || (e.blendColor(l.r, l.g, l.b, c),
                        b.copy(l),
                        A = c),
                        p = t,
                        x = !1;
                    else if (t !== p || h !== x) {
                        if (f === _ && v === _ || (e.blendEquation(e.FUNC_ADD),
                        f = _,
                        v = _),
                        h)
                            switch (t) {
                            case 1:
                                e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA);
                                break;
                            case 2:
                                e.blendFunc(e.ONE, e.ONE);
                                break;
                            case 3:
                                e.blendFuncSeparate(e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ZERO, e.ONE);
                                break;
                            case 4:
                                e.blendFuncSeparate(e.ZERO, e.SRC_COLOR, e.ZERO, e.SRC_ALPHA);
                                break;
                            default:
                                console.error("THREE.WebGLState: Invalid blending: ", t)
                            }
                        else
                            switch (t) {
                            case 1:
                                e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA);
                                break;
                            case 2:
                                e.blendFunc(e.SRC_ALPHA, e.ONE);
                                break;
                            case 3:
                                e.blendFuncSeparate(e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ZERO, e.ONE);
                                break;
                            case 4:
                                e.blendFunc(e.ZERO, e.SRC_COLOR);
                                break;
                            default:
                                console.error("THREE.WebGLState: Invalid blending: ", t)
                            }
                        m = null,
                        g = null,
                        w = null,
                        y = null,
                        b.set(0, 0, 0),
                        A = 0,
                        p = t,
                        x = h
                    }
                } else
                    !0 === u && (ae(e.BLEND),
                    u = !1)
            }
            function ce(t) {
                k !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
                k = t)
            }
            function he(t) {
                0 !== t ? (re(e.CULL_FACE),
                t !== E && (1 === t ? e.cullFace(e.BACK) : 2 === t ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))) : ae(e.CULL_FACE),
                E = t
            }
            function de(t, n, i) {
                t ? (re(e.POLYGON_OFFSET_FILL),
                M === n && j === i || (e.polygonOffset(n, i),
                M = n,
                j = i)) : ae(e.POLYGON_OFFSET_FILL)
            }
            return {
                buffers: {
                    color: n,
                    depth: i,
                    stencil: r
                },
                enable: re,
                disable: ae,
                bindFramebuffer: function(t, n) {
                    return l[t] !== n && (e.bindFramebuffer(t, n),
                    l[t] = n,
                    t === e.DRAW_FRAMEBUFFER && (l[e.FRAMEBUFFER] = n),
                    t === e.FRAMEBUFFER && (l[e.DRAW_FRAMEBUFFER] = n),
                    !0)
                },
                drawBuffers: function(t, n) {
                    let i = h
                      , r = !1;
                    if (t) {
                        i = c.get(n),
                        void 0 === i && (i = [],
                        c.set(n, i));
                        const a = t.textures;
                        if (i.length !== a.length || i[0] !== e.COLOR_ATTACHMENT0) {
                            for (let t = 0, n = a.length; t < n; t++)
                                i[t] = e.COLOR_ATTACHMENT0 + t;
                            i.length = a.length,
                            r = !0
                        }
                    } else
                        i[0] !== e.BACK && (i[0] = e.BACK,
                        r = !0);
                    r && e.drawBuffers(i)
                },
                useProgram: function(t) {
                    return d !== t && (e.useProgram(t),
                    d = t,
                    !0)
                },
                setBlending: le,
                setMaterial: function(t, a) {
                    2 === t.side ? ae(e.CULL_FACE) : re(e.CULL_FACE);
                    let s = 1 === t.side;
                    a && (s = !s),
                    ce(s),
                    1 === t.blending && !1 === t.transparent ? le(0) : le(t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha),
                    i.setFunc(t.depthFunc),
                    i.setTest(t.depthTest),
                    i.setMask(t.depthWrite),
                    n.setMask(t.colorWrite);
                    const o = t.stencilWrite;
                    r.setTest(o),
                    o && (r.setMask(t.stencilWriteMask),
                    r.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask),
                    r.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)),
                    de(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits),
                    !0 === t.alphaToCoverage ? re(e.SAMPLE_ALPHA_TO_COVERAGE) : ae(e.SAMPLE_ALPHA_TO_COVERAGE)
                },
                setFlipSided: ce,
                setCullFace: he,
                setLineWidth: function(t) {
                    t !== S && (K && e.lineWidth(t),
                    S = t)
                },
                setPolygonOffset: de,
                setScissorTest: function(t) {
                    t ? re(e.SCISSOR_TEST) : ae(e.SCISSOR_TEST)
                },
                activeTexture: function(t) {
                    void 0 === t && (t = e.TEXTURE0 + Q - 1),
                    X !== t && (e.activeTexture(t),
                    X = t)
                },
                bindTexture: function(t, n, i) {
                    void 0 === i && (i = null === X ? e.TEXTURE0 + Q - 1 : X);
                    let r = Z[i];
                    void 0 === r && (r = {
                        type: void 0,
                        texture: void 0
                    },
                    Z[i] = r),
                    r.type === t && r.texture === n || (X !== i && (e.activeTexture(i),
                    X = i),
                    e.bindTexture(t, n || ie[t]),
                    r.type = t,
                    r.texture = n)
                },
                unbindTexture: function() {
                    const t = Z[X];
                    void 0 !== t && void 0 !== t.type && (e.bindTexture(t.type, null),
                    t.type = void 0,
                    t.texture = void 0)
                },
                compressedTexImage2D: function() {
                    try {
                        e.compressedTexImage2D(...arguments)
                    } catch (e) {
                        console.error("THREE.WebGLState:", e)
                    }
                },
                compressedTexImage3D: function() {
                    try {
                        e.compressedTexImage3D(...arguments)
                    } catch (e) {
                        console.error("THREE.WebGLState:", e)
                    }
                },
                texImage2D: function() {
                    try {
                        e.texImage2D(...arguments)
                    } catch (e) {
                        console.error("THREE.WebGLState:", e)
                    }
                },
                texImage3D: function() {
                    try {
                        e.texImage3D(...arguments)
                    } catch (e) {
                        console.error("THREE.WebGLState:", e)
                    }
                },
                updateUBOMapping: function(t, n) {
                    let i = s.get(n);
                    void 0 === i && (i = new WeakMap,
                    s.set(n, i));
                    let r = i.get(t);
                    void 0 === r && (r = e.getUniformBlockIndex(n, t.name),
                    i.set(t, r))
                },
                uniformBlockBinding: function(t, n) {
                    const i = s.get(n).get(t);
                    a.get(n) !== i && (e.uniformBlockBinding(n, i, t.__bindingPointIndex),
                    a.set(n, i))
                },
                texStorage2D: function() {
                    try {
                        e.texStorage2D(...arguments)
                    } catch (e) {
                        console.error("THREE.WebGLState:", e)
                    }
                },
                texStorage3D: function() {
                    try {
                        e.texStorage3D(...arguments)
                    } catch (e) {
                        console.error("THREE.WebGLState:", e)
                    }
                },
                texSubImage2D: function() {
                    try {
                        e.texSubImage2D(...arguments)
                    } catch (e) {
                        console.error("THREE.WebGLState:", e)
                    }
                },
                texSubImage3D: function() {
                    try {
                        e.texSubImage3D(...arguments)
                    } catch (e) {
                        console.error("THREE.WebGLState:", e)
                    }
                },
                compressedTexSubImage2D: function() {
                    try {
                        e.compressedTexSubImage2D(...arguments)
                    } catch (e) {
                        console.error("THREE.WebGLState:", e)
                    }
                },
                compressedTexSubImage3D: function() {
                    try {
                        e.compressedTexSubImage3D(...arguments)
                    } catch (e) {
                        console.error("THREE.WebGLState:", e)
                    }
                },
                scissor: function(t) {
                    !1 === ee.equals(t) && (e.scissor(t.x, t.y, t.z, t.w),
                    ee.copy(t))
                },
                viewport: function(t) {
                    !1 === te.equals(t) && (e.viewport(t.x, t.y, t.z, t.w),
                    te.copy(t))
                },
                reset: function() {
                    e.disable(e.BLEND),
                    e.disable(e.CULL_FACE),
                    e.disable(e.DEPTH_TEST),
                    e.disable(e.POLYGON_OFFSET_FILL),
                    e.disable(e.SCISSOR_TEST),
                    e.disable(e.STENCIL_TEST),
                    e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),
                    e.blendEquation(e.FUNC_ADD),
                    e.blendFunc(e.ONE, e.ZERO),
                    e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO),
                    e.blendColor(0, 0, 0, 0),
                    e.colorMask(!0, !0, !0, !0),
                    e.clearColor(0, 0, 0, 0),
                    e.depthMask(!0),
                    e.depthFunc(e.LESS),
                    i.setReversed(!1),
                    e.clearDepth(1),
                    e.stencilMask(4294967295),
                    e.stencilFunc(e.ALWAYS, 0, 4294967295),
                    e.stencilOp(e.KEEP, e.KEEP, e.KEEP),
                    e.clearStencil(0),
                    e.cullFace(e.BACK),
                    e.frontFace(e.CCW),
                    e.polygonOffset(0, 0),
                    e.activeTexture(e.TEXTURE0),
                    e.bindFramebuffer(e.FRAMEBUFFER, null),
                    e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null),
                    e.bindFramebuffer(e.READ_FRAMEBUFFER, null),
                    e.useProgram(null),
                    e.lineWidth(1),
                    e.scissor(0, 0, e.canvas.width, e.canvas.height),
                    e.viewport(0, 0, e.canvas.width, e.canvas.height),
                    o = {},
                    X = null,
                    Z = {},
                    l = {},
                    c = new WeakMap,
                    h = [],
                    d = null,
                    u = !1,
                    p = null,
                    f = null,
                    m = null,
                    g = null,
                    v = null,
                    w = null,
                    y = null,
                    b = new Hi(0,0,0),
                    A = 0,
                    x = !1,
                    k = null,
                    E = null,
                    S = null,
                    M = null,
                    j = null,
                    ee.set(0, 0, e.canvas.width, e.canvas.height),
                    te.set(0, 0, e.canvas.width, e.canvas.height),
                    n.reset(),
                    i.reset(),
                    r.reset()
                }
            }
        }
        function Qd(e, t, n, i, r, a, s) {
            const o = t.has("WEBGL_multisampled_render_to_texture") ? t.get("WEBGL_multisampled_render_to_texture") : null
              , l = "undefined" != typeof navigator && /OculusBrowser/g.test(navigator.userAgent)
              , c = new Qt
              , h = new WeakMap;
            let d;
            const u = new WeakMap;
            let p = !1;
            try {
                p = "undefined" != typeof OffscreenCanvas && null !== new OffscreenCanvas(1,1).getContext("2d")
            } catch (e) {}
            function f(e, t) {
                return p ? new OffscreenCanvas(e,t) : Xt("canvas")
            }
            function m(e, t, n) {
                let i = 1;
                const r = W(e);
                if ((r.width > n || r.height > n) && (i = n / Math.max(r.width, r.height)),
                i < 1) {
                    if ("undefined" != typeof HTMLImageElement && e instanceof HTMLImageElement || "undefined" != typeof HTMLCanvasElement && e instanceof HTMLCanvasElement || "undefined" != typeof ImageBitmap && e instanceof ImageBitmap || "undefined" != typeof VideoFrame && e instanceof VideoFrame) {
                        const n = Math.floor(i * r.width)
                          , a = Math.floor(i * r.height);
                        void 0 === d && (d = f(n, a));
                        const s = t ? f(n, a) : d;
                        s.width = n,
                        s.height = a;
                        return s.getContext("2d").drawImage(e, 0, 0, n, a),
                        console.warn("THREE.WebGLRenderer: Texture has been resized from (" + r.width + "x" + r.height + ") to (" + n + "x" + a + ")."),
                        s
                    }
                    return "data"in e && console.warn("THREE.WebGLRenderer: Image in DataTexture is too big (" + r.width + "x" + r.height + ")."),
                    e
                }
                return e
            }
            function g(e) {
                return e.generateMipmaps
            }
            function v(t) {
                e.generateMipmap(t)
            }
            function w(t) {
                return t.isWebGLCubeRenderTarget ? e.TEXTURE_CUBE_MAP : t.isWebGL3DRenderTarget ? e.TEXTURE_3D : t.isWebGLArrayRenderTarget || t.isCompressedArrayTexture ? e.TEXTURE_2D_ARRAY : e.TEXTURE_2D
            }
            function y(n, i, r, a, s=!1) {
                if (null !== n) {
                    if (void 0 !== e[n])
                        return e[n];
                    console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '" + n + "'")
                }
                let o = i;
                if (i === e.RED && (r === e.FLOAT && (o = e.R32F),
                r === e.HALF_FLOAT && (o = e.R16F),
                r === e.UNSIGNED_BYTE && (o = e.R8)),
                i === e.RED_INTEGER && (r === e.UNSIGNED_BYTE && (o = e.R8UI),
                r === e.UNSIGNED_SHORT && (o = e.R16UI),
                r === e.UNSIGNED_INT && (o = e.R32UI),
                r === e.BYTE && (o = e.R8I),
                r === e.SHORT && (o = e.R16I),
                r === e.INT && (o = e.R32I)),
                i === e.RG && (r === e.FLOAT && (o = e.RG32F),
                r === e.HALF_FLOAT && (o = e.RG16F),
                r === e.UNSIGNED_BYTE && (o = e.RG8)),
                i === e.RG_INTEGER && (r === e.UNSIGNED_BYTE && (o = e.RG8UI),
                r === e.UNSIGNED_SHORT && (o = e.RG16UI),
                r === e.UNSIGNED_INT && (o = e.RG32UI),
                r === e.BYTE && (o = e.RG8I),
                r === e.SHORT && (o = e.RG16I),
                r === e.INT && (o = e.RG32I)),
                i === e.RGB_INTEGER && (r === e.UNSIGNED_BYTE && (o = e.RGB8UI),
                r === e.UNSIGNED_SHORT && (o = e.RGB16UI),
                r === e.UNSIGNED_INT && (o = e.RGB32UI),
                r === e.BYTE && (o = e.RGB8I),
                r === e.SHORT && (o = e.RGB16I),
                r === e.INT && (o = e.RGB32I)),
                i === e.RGBA_INTEGER && (r === e.UNSIGNED_BYTE && (o = e.RGBA8UI),
                r === e.UNSIGNED_SHORT && (o = e.RGBA16UI),
                r === e.UNSIGNED_INT && (o = e.RGBA32UI),
                r === e.BYTE && (o = e.RGBA8I),
                r === e.SHORT && (o = e.RGBA16I),
                r === e.INT && (o = e.RGBA32I)),
                i === e.RGB && r === e.UNSIGNED_INT_5_9_9_9_REV && (o = e.RGB9_E5),
                i === e.RGBA) {
                    const t = s ? yt : rn.getTransfer(a);
                    r === e.FLOAT && (o = e.RGBA32F),
                    r === e.HALF_FLOAT && (o = e.RGBA16F),
                    r === e.UNSIGNED_BYTE && (o = t === bt ? e.SRGB8_ALPHA8 : e.RGBA8),
                    r === e.UNSIGNED_SHORT_4_4_4_4 && (o = e.RGBA4),
                    r === e.UNSIGNED_SHORT_5_5_5_1 && (o = e.RGB5_A1)
                }
                return o !== e.R16F && o !== e.R32F && o !== e.RG16F && o !== e.RG32F && o !== e.RGBA16F && o !== e.RGBA32F || t.get("EXT_color_buffer_float"),
                o
            }
            function b(t, n) {
                let i;
                return t ? null === n || n === ye || n === Ee ? i = e.DEPTH24_STENCIL8 : n === be ? i = e.DEPTH32F_STENCIL8 : n === ve && (i = e.DEPTH24_STENCIL8,
                console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : null === n || n === ye || n === Ee ? i = e.DEPTH_COMPONENT24 : n === be ? i = e.DEPTH_COMPONENT32F : n === ve && (i = e.DEPTH_COMPONENT16),
                i
            }
            function A(e, t) {
                return !0 === g(e) || e.isFramebufferTexture && e.minFilter !== le && e.minFilter !== de ? Math.log2(Math.max(t.width, t.height)) + 1 : void 0 !== e.mipmaps && e.mipmaps.length > 0 ? e.mipmaps.length : e.isCompressedTexture && Array.isArray(e.image) ? t.mipmaps.length : 1
            }
            function x(e) {
                const t = e.target;
                t.removeEventListener("dispose", x),
                function(e) {
                    const t = i.get(e);
                    if (void 0 === t.__webglInit)
                        return;
                    const n = e.source
                      , r = u.get(n);
                    if (r) {
                        const i = r[t.__cacheKey];
                        i.usedTimes--,
                        0 === i.usedTimes && E(e),
                        0 === Object.keys(r).length && u.delete(n)
                    }
                    i.remove(e)
                }(t),
                t.isVideoTexture && h.delete(t)
            }
            function k(t) {
                const n = t.target;
                n.removeEventListener("dispose", k),
                function(t) {
                    const n = i.get(t);
                    t.depthTexture && (t.depthTexture.dispose(),
                    i.remove(t.depthTexture));
                    if (t.isWebGLCubeRenderTarget)
                        for (let t = 0; t < 6; t++) {
                            if (Array.isArray(n.__webglFramebuffer[t]))
                                for (let i = 0; i < n.__webglFramebuffer[t].length; i++)
                                    e.deleteFramebuffer(n.__webglFramebuffer[t][i]);
                            else
                                e.deleteFramebuffer(n.__webglFramebuffer[t]);
                            n.__webglDepthbuffer && e.deleteRenderbuffer(n.__webglDepthbuffer[t])
                        }
                    else {
                        if (Array.isArray(n.__webglFramebuffer))
                            for (let t = 0; t < n.__webglFramebuffer.length; t++)
                                e.deleteFramebuffer(n.__webglFramebuffer[t]);
                        else
                            e.deleteFramebuffer(n.__webglFramebuffer);
                        if (n.__webglDepthbuffer && e.deleteRenderbuffer(n.__webglDepthbuffer),
                        n.__webglMultisampledFramebuffer && e.deleteFramebuffer(n.__webglMultisampledFramebuffer),
                        n.__webglColorRenderbuffer)
                            for (let t = 0; t < n.__webglColorRenderbuffer.length; t++)
                                n.__webglColorRenderbuffer[t] && e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);
                        n.__webglDepthRenderbuffer && e.deleteRenderbuffer(n.__webglDepthRenderbuffer)
                    }
                    const r = t.textures;
                    for (let t = 0, n = r.length; t < n; t++) {
                        const n = i.get(r[t]);
                        n.__webglTexture && (e.deleteTexture(n.__webglTexture),
                        s.memory.textures--),
                        i.remove(r[t])
                    }
                    i.remove(t)
                }(n)
            }
            function E(t) {
                const n = i.get(t);
                e.deleteTexture(n.__webglTexture);
                const r = t.source;
                delete u.get(r)[n.__cacheKey],
                s.memory.textures--
            }
            let S = 0;
            function M(t, r) {
                const a = i.get(t);
                if (t.isVideoTexture && function(e) {
                    const t = s.render.frame;
                    h.get(e) !== t && (h.set(e, t),
                    e.update())
                }(t),
                !1 === t.isRenderTargetTexture && t.version > 0 && a.__version !== t.version) {
                    const e = t.image;
                    if (null === e)
                        console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");
                    else {
                        if (!1 !== e.complete)
                            return void R(a, t, r);
                        console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")
                    }
                }
                n.bindTexture(e.TEXTURE_2D, a.__webglTexture, e.TEXTURE0 + r)
            }
            const _ = {
                [ae]: e.REPEAT,
                [se]: e.CLAMP_TO_EDGE,
                [oe]: e.MIRRORED_REPEAT
            }
              , T = {
                [le]: e.NEAREST,
                [ce]: e.NEAREST_MIPMAP_NEAREST,
                [he]: e.NEAREST_MIPMAP_LINEAR,
                [de]: e.LINEAR,
                [ue]: e.LINEAR_MIPMAP_NEAREST,
                [pe]: e.LINEAR_MIPMAP_LINEAR
            }
              , C = {
                [xt]: e.NEVER,
                [Ct]: e.ALWAYS,
                [kt]: e.LESS,
                [St]: e.LEQUAL,
                [Et]: e.EQUAL,
                [Tt]: e.GEQUAL,
                [Mt]: e.GREATER,
                [_t]: e.NOTEQUAL
            };
            function P(n, a) {
                if (a.type !== be || !1 !== t.has("OES_texture_float_linear") || a.magFilter !== de && a.magFilter !== ue && a.magFilter !== he && a.magFilter !== pe && a.minFilter !== de && a.minFilter !== ue && a.minFilter !== he && a.minFilter !== pe || console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),
                e.texParameteri(n, e.TEXTURE_WRAP_S, _[a.wrapS]),
                e.texParameteri(n, e.TEXTURE_WRAP_T, _[a.wrapT]),
                n !== e.TEXTURE_3D && n !== e.TEXTURE_2D_ARRAY || e.texParameteri(n, e.TEXTURE_WRAP_R, _[a.wrapR]),
                e.texParameteri(n, e.TEXTURE_MAG_FILTER, T[a.magFilter]),
                e.texParameteri(n, e.TEXTURE_MIN_FILTER, T[a.minFilter]),
                a.compareFunction && (e.texParameteri(n, e.TEXTURE_COMPARE_MODE, e.COMPARE_REF_TO_TEXTURE),
                e.texParameteri(n, e.TEXTURE_COMPARE_FUNC, C[a.compareFunction])),
                !0 === t.has("EXT_texture_filter_anisotropic")) {
                    if (a.magFilter === le)
                        return;
                    if (a.minFilter !== he && a.minFilter !== pe)
                        return;
                    if (a.type === be && !1 === t.has("OES_texture_float_linear"))
                        return;
                    if (a.anisotropy > 1 || i.get(a).__currentAnisotropy) {
                        const s = t.get("EXT_texture_filter_anisotropic");
                        e.texParameterf(n, s.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(a.anisotropy, r.getMaxAnisotropy())),
                        i.get(a).__currentAnisotropy = a.anisotropy
                    }
                }
            }
            function I(t, n) {
                let i = !1;
                void 0 === t.__webglInit && (t.__webglInit = !0,
                n.addEventListener("dispose", x));
                const r = n.source;
                let a = u.get(r);
                void 0 === a && (a = {},
                u.set(r, a));
                const o = function(e) {
                    const t = [];
                    return t.push(e.wrapS),
                    t.push(e.wrapT),
                    t.push(e.wrapR || 0),
                    t.push(e.magFilter),
                    t.push(e.minFilter),
                    t.push(e.anisotropy),
                    t.push(e.internalFormat),
                    t.push(e.format),
                    t.push(e.type),
                    t.push(e.generateMipmaps),
                    t.push(e.premultiplyAlpha),
                    t.push(e.flipY),
                    t.push(e.unpackAlignment),
                    t.push(e.colorSpace),
                    t.join()
                }(n);
                if (o !== t.__cacheKey) {
                    void 0 === a[o] && (a[o] = {
                        texture: e.createTexture(),
                        usedTimes: 0
                    },
                    s.memory.textures++,
                    i = !0),
                    a[o].usedTimes++;
                    const r = a[t.__cacheKey];
                    void 0 !== r && (a[t.__cacheKey].usedTimes--,
                    0 === r.usedTimes && E(n)),
                    t.__cacheKey = o,
                    t.__webglTexture = a[o].texture
                }
                return i
            }
            function R(t, s, o) {
                let l = e.TEXTURE_2D;
                (s.isDataArrayTexture || s.isCompressedArrayTexture) && (l = e.TEXTURE_2D_ARRAY),
                s.isData3DTexture && (l = e.TEXTURE_3D);
                const c = I(t, s)
                  , h = s.source;
                n.bindTexture(l, t.__webglTexture, e.TEXTURE0 + o);
                const d = i.get(h);
                if (h.version !== d.__version || !0 === c) {
                    n.activeTexture(e.TEXTURE0 + o);
                    const t = rn.getPrimaries(rn.workingColorSpace)
                      , i = s.colorSpace === gt ? null : rn.getPrimaries(s.colorSpace)
                      , u = s.colorSpace === gt || t === i ? e.NONE : e.BROWSER_DEFAULT_WEBGL;
                    e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, s.flipY),
                    e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, s.premultiplyAlpha),
                    e.pixelStorei(e.UNPACK_ALIGNMENT, s.unpackAlignment),
                    e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, u);
                    let p = m(s.image, !1, r.maxTextureSize);
                    p = F(s, p);
                    const f = a.convert(s.format, s.colorSpace)
                      , w = a.convert(s.type);
                    let x, k = y(s.internalFormat, f, w, s.colorSpace, s.isVideoTexture);
                    P(l, s);
                    const E = s.mipmaps
                      , S = !0 !== s.isVideoTexture
                      , M = void 0 === d.__version || !0 === c
                      , _ = h.dataReady
                      , T = A(s, p);
                    if (s.isDepthTexture)
                        k = b(s.format === Te, s.type),
                        M && (S ? n.texStorage2D(e.TEXTURE_2D, 1, k, p.width, p.height) : n.texImage2D(e.TEXTURE_2D, 0, k, p.width, p.height, 0, f, w, null));
                    else if (s.isDataTexture)
                        if (E.length > 0) {
                            S && M && n.texStorage2D(e.TEXTURE_2D, T, k, E[0].width, E[0].height);
                            for (let t = 0, i = E.length; t < i; t++)
                                x = E[t],
                                S ? _ && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, x.width, x.height, f, w, x.data) : n.texImage2D(e.TEXTURE_2D, t, k, x.width, x.height, 0, f, w, x.data);
                            s.generateMipmaps = !1
                        } else
                            S ? (M && n.texStorage2D(e.TEXTURE_2D, T, k, p.width, p.height),
                            _ && n.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, p.width, p.height, f, w, p.data)) : n.texImage2D(e.TEXTURE_2D, 0, k, p.width, p.height, 0, f, w, p.data);
                    else if (s.isCompressedTexture)
                        if (s.isCompressedArrayTexture) {
                            S && M && n.texStorage3D(e.TEXTURE_2D_ARRAY, T, k, E[0].width, E[0].height, p.depth);
                            for (let t = 0, i = E.length; t < i; t++)
                                if (x = E[t],
                                s.format !== Me)
                                    if (null !== f)
                                        if (S) {
                                            if (_)
                                                if (s.layerUpdates.size > 0) {
                                                    const i = Jo(x.width, x.height, s.format, s.type);
                                                    for (const r of s.layerUpdates) {
                                                        const a = x.data.subarray(r * i / x.data.BYTES_PER_ELEMENT, (r + 1) * i / x.data.BYTES_PER_ELEMENT);
                                                        n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY, t, 0, 0, r, x.width, x.height, 1, f, a)
                                                    }
                                                    s.clearLayerUpdates()
                                                } else
                                                    n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY, t, 0, 0, 0, x.width, x.height, p.depth, f, x.data)
                                        } else
                                            n.compressedTexImage3D(e.TEXTURE_2D_ARRAY, t, k, x.width, x.height, p.depth, 0, x.data, 0, 0);
                                    else
                                        console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");
                                else
                                    S ? _ && n.texSubImage3D(e.TEXTURE_2D_ARRAY, t, 0, 0, 0, x.width, x.height, p.depth, f, w, x.data) : n.texImage3D(e.TEXTURE_2D_ARRAY, t, k, x.width, x.height, p.depth, 0, f, w, x.data)
                        } else {
                            S && M && n.texStorage2D(e.TEXTURE_2D, T, k, E[0].width, E[0].height);
                            for (let t = 0, i = E.length; t < i; t++)
                                x = E[t],
                                s.format !== Me ? null !== f ? S ? _ && n.compressedTexSubImage2D(e.TEXTURE_2D, t, 0, 0, x.width, x.height, f, x.data) : n.compressedTexImage2D(e.TEXTURE_2D, t, k, x.width, x.height, 0, x.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : S ? _ && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, x.width, x.height, f, w, x.data) : n.texImage2D(e.TEXTURE_2D, t, k, x.width, x.height, 0, f, w, x.data)
                        }
                    else if (s.isDataArrayTexture)
                        if (S) {
                            if (M && n.texStorage3D(e.TEXTURE_2D_ARRAY, T, k, p.width, p.height, p.depth),
                            _)
                                if (s.layerUpdates.size > 0) {
                                    const t = Jo(p.width, p.height, s.format, s.type);
                                    for (const i of s.layerUpdates) {
                                        const r = p.data.subarray(i * t / p.data.BYTES_PER_ELEMENT, (i + 1) * t / p.data.BYTES_PER_ELEMENT);
                                        n.texSubImage3D(e.TEXTURE_2D_ARRAY, 0, 0, 0, i, p.width, p.height, 1, f, w, r)
                                    }
                                    s.clearLayerUpdates()
                                } else
                                    n.texSubImage3D(e.TEXTURE_2D_ARRAY, 0, 0, 0, 0, p.width, p.height, p.depth, f, w, p.data)
                        } else
                            n.texImage3D(e.TEXTURE_2D_ARRAY, 0, k, p.width, p.height, p.depth, 0, f, w, p.data);
                    else if (s.isData3DTexture)
                        S ? (M && n.texStorage3D(e.TEXTURE_3D, T, k, p.width, p.height, p.depth),
                        _ && n.texSubImage3D(e.TEXTURE_3D, 0, 0, 0, 0, p.width, p.height, p.depth, f, w, p.data)) : n.texImage3D(e.TEXTURE_3D, 0, k, p.width, p.height, p.depth, 0, f, w, p.data);
                    else if (s.isFramebufferTexture) {
                        if (M)
                            if (S)
                                n.texStorage2D(e.TEXTURE_2D, T, k, p.width, p.height);
                            else {
                                let t = p.width
                                  , i = p.height;
                                for (let r = 0; r < T; r++)
                                    n.texImage2D(e.TEXTURE_2D, r, k, t, i, 0, f, w, null),
                                    t >>= 1,
                                    i >>= 1
                            }
                    } else if (E.length > 0) {
                        if (S && M) {
                            const t = W(E[0]);
                            n.texStorage2D(e.TEXTURE_2D, T, k, t.width, t.height)
                        }
                        for (let t = 0, i = E.length; t < i; t++)
                            x = E[t],
                            S ? _ && n.texSubImage2D(e.TEXTURE_2D, t, 0, 0, f, w, x) : n.texImage2D(e.TEXTURE_2D, t, k, f, w, x);
                        s.generateMipmaps = !1
                    } else if (S) {
                        if (M) {
                            const t = W(p);
                            n.texStorage2D(e.TEXTURE_2D, T, k, t.width, t.height)
                        }
                        _ && n.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, f, w, p)
                    } else
                        n.texImage2D(e.TEXTURE_2D, 0, k, f, w, p);
                    g(s) && v(l),
                    d.__version = h.version,
                    s.onUpdate && s.onUpdate(s)
                }
                t.__version = s.version
            }
            function L(t, r, s, l, c, h) {
                const d = a.convert(s.format, s.colorSpace)
                  , u = a.convert(s.type)
                  , p = y(s.internalFormat, d, u, s.colorSpace)
                  , f = i.get(r)
                  , m = i.get(s);
                if (m.__renderTarget = r,
                !f.__hasExternalTextures) {
                    const t = Math.max(1, r.width >> h)
                      , i = Math.max(1, r.height >> h);
                    c === e.TEXTURE_3D || c === e.TEXTURE_2D_ARRAY ? n.texImage3D(c, h, p, t, i, r.depth, 0, d, u, null) : n.texImage2D(c, h, p, t, i, 0, d, u, null)
                }
                n.bindFramebuffer(e.FRAMEBUFFER, t),
                O(r) ? o.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, l, c, m.__webglTexture, 0, z(r)) : (c === e.TEXTURE_2D || c >= e.TEXTURE_CUBE_MAP_POSITIVE_X && c <= e.TEXTURE_CUBE_MAP_NEGATIVE_Z) && e.framebufferTexture2D(e.FRAMEBUFFER, l, c, m.__webglTexture, h),
                n.bindFramebuffer(e.FRAMEBUFFER, null)
            }
            function D(t, n, i) {
                if (e.bindRenderbuffer(e.RENDERBUFFER, t),
                n.depthBuffer) {
                    const r = n.depthTexture
                      , a = r && r.isDepthTexture ? r.type : null
                      , s = b(n.stencilBuffer, a)
                      , l = n.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT
                      , c = z(n);
                    O(n) ? o.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, c, s, n.width, n.height) : i ? e.renderbufferStorageMultisample(e.RENDERBUFFER, c, s, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, s, n.width, n.height),
                    e.framebufferRenderbuffer(e.FRAMEBUFFER, l, e.RENDERBUFFER, t)
                } else {
                    const t = n.textures;
                    for (let r = 0; r < t.length; r++) {
                        const s = t[r]
                          , l = a.convert(s.format, s.colorSpace)
                          , c = a.convert(s.type)
                          , h = y(s.internalFormat, l, c, s.colorSpace)
                          , d = z(n);
                        i && !1 === O(n) ? e.renderbufferStorageMultisample(e.RENDERBUFFER, d, h, n.width, n.height) : O(n) ? o.renderbufferStorageMultisampleEXT(e.RENDERBUFFER, d, h, n.width, n.height) : e.renderbufferStorage(e.RENDERBUFFER, h, n.width, n.height)
                    }
                }
                e.bindRenderbuffer(e.RENDERBUFFER, null)
            }
            function N(t) {
                const r = i.get(t)
                  , a = !0 === t.isWebGLCubeRenderTarget;
                if (r.__boundDepthTexture !== t.depthTexture) {
                    const e = t.depthTexture;
                    if (r.__depthDisposeCallback && r.__depthDisposeCallback(),
                    e) {
                        const t = () => {
                            delete r.__boundDepthTexture,
                            delete r.__depthDisposeCallback,
                            e.removeEventListener("dispose", t)
                        }
                        ;
                        e.addEventListener("dispose", t),
                        r.__depthDisposeCallback = t
                    }
                    r.__boundDepthTexture = e
                }
                if (t.depthTexture && !r.__autoAllocateDepthBuffer) {
                    if (a)
                        throw new Error("target.depthTexture not supported in Cube render targets");
                    !function(t, r) {
                        if (r && r.isWebGLCubeRenderTarget)
                            throw new Error("Depth Texture with cube render targets is not supported");
                        if (n.bindFramebuffer(e.FRAMEBUFFER, t),
                        !r.depthTexture || !r.depthTexture.isDepthTexture)
                            throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
                        const a = i.get(r.depthTexture);
                        a.__renderTarget = r,
                        a.__webglTexture && r.depthTexture.image.width === r.width && r.depthTexture.image.height === r.height || (r.depthTexture.image.width = r.width,
                        r.depthTexture.image.height = r.height,
                        r.depthTexture.needsUpdate = !0),
                        M(r.depthTexture, 0);
                        const s = a.__webglTexture
                          , l = z(r);
                        if (r.depthTexture.format === _e)
                            O(r) ? o.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, e.DEPTH_ATTACHMENT, e.TEXTURE_2D, s, 0, l) : e.framebufferTexture2D(e.FRAMEBUFFER, e.DEPTH_ATTACHMENT, e.TEXTURE_2D, s, 0);
                        else {
                            if (r.depthTexture.format !== Te)
                                throw new Error("Unknown depthTexture format");
                            O(r) ? o.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER, e.DEPTH_STENCIL_ATTACHMENT, e.TEXTURE_2D, s, 0, l) : e.framebufferTexture2D(e.FRAMEBUFFER, e.DEPTH_STENCIL_ATTACHMENT, e.TEXTURE_2D, s, 0)
                        }
                    }(r.__webglFramebuffer, t)
                } else if (a) {
                    r.__webglDepthbuffer = [];
                    for (let i = 0; i < 6; i++)
                        if (n.bindFramebuffer(e.FRAMEBUFFER, r.__webglFramebuffer[i]),
                        void 0 === r.__webglDepthbuffer[i])
                            r.__webglDepthbuffer[i] = e.createRenderbuffer(),
                            D(r.__webglDepthbuffer[i], t, !1);
                        else {
                            const n = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT
                              , a = r.__webglDepthbuffer[i];
                            e.bindRenderbuffer(e.RENDERBUFFER, a),
                            e.framebufferRenderbuffer(e.FRAMEBUFFER, n, e.RENDERBUFFER, a)
                        }
                } else if (n.bindFramebuffer(e.FRAMEBUFFER, r.__webglFramebuffer),
                void 0 === r.__webglDepthbuffer)
                    r.__webglDepthbuffer = e.createRenderbuffer(),
                    D(r.__webglDepthbuffer, t, !1);
                else {
                    const n = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT
                      , i = r.__webglDepthbuffer;
                    e.bindRenderbuffer(e.RENDERBUFFER, i),
                    e.framebufferRenderbuffer(e.FRAMEBUFFER, n, e.RENDERBUFFER, i)
                }
                n.bindFramebuffer(e.FRAMEBUFFER, null)
            }
            const B = []
              , U = [];
            function z(e) {
                return Math.min(r.maxSamples, e.samples)
            }
            function O(e) {
                const n = i.get(e);
                return e.samples > 0 && !0 === t.has("WEBGL_multisampled_render_to_texture") && !1 !== n.__useRenderToTexture
            }
            function F(e, t) {
                const n = e.colorSpace
                  , i = e.format
                  , r = e.type;
                return !0 === e.isCompressedTexture || !0 === e.isVideoTexture || n !== wt && n !== gt && (rn.getTransfer(n) === bt ? i === Me && r === fe || console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : console.error("THREE.WebGLTextures: Unsupported texture color space:", n)),
                t
            }
            function W(e) {
                return "undefined" != typeof HTMLImageElement && e instanceof HTMLImageElement ? (c.width = e.naturalWidth || e.width,
                c.height = e.naturalHeight || e.height) : "undefined" != typeof VideoFrame && e instanceof VideoFrame ? (c.width = e.displayWidth,
                c.height = e.displayHeight) : (c.width = e.width,
                c.height = e.height),
                c
            }
            this.allocateTextureUnit = function() {
                const e = S;
                return e >= r.maxTextures && console.warn("THREE.WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + r.maxTextures),
                S += 1,
                e
            }
            ,
            this.resetTextureUnits = function() {
                S = 0
            }
            ,
            this.setTexture2D = M,
            this.setTexture2DArray = function(t, r) {
                const a = i.get(t);
                t.version > 0 && a.__version !== t.version ? R(a, t, r) : n.bindTexture(e.TEXTURE_2D_ARRAY, a.__webglTexture, e.TEXTURE0 + r)
            }
            ,
            this.setTexture3D = function(t, r) {
                const a = i.get(t);
                t.version > 0 && a.__version !== t.version ? R(a, t, r) : n.bindTexture(e.TEXTURE_3D, a.__webglTexture, e.TEXTURE0 + r)
            }
            ,
            this.setTextureCube = function(t, s) {
                const o = i.get(t);
                t.version > 0 && o.__version !== t.version ? function(t, s, o) {
                    if (6 !== s.image.length)
                        return;
                    const l = I(t, s)
                      , c = s.source;
                    n.bindTexture(e.TEXTURE_CUBE_MAP, t.__webglTexture, e.TEXTURE0 + o);
                    const h = i.get(c);
                    if (c.version !== h.__version || !0 === l) {
                        n.activeTexture(e.TEXTURE0 + o);
                        const t = rn.getPrimaries(rn.workingColorSpace)
                          , i = s.colorSpace === gt ? null : rn.getPrimaries(s.colorSpace)
                          , d = s.colorSpace === gt || t === i ? e.NONE : e.BROWSER_DEFAULT_WEBGL;
                        e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, s.flipY),
                        e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, s.premultiplyAlpha),
                        e.pixelStorei(e.UNPACK_ALIGNMENT, s.unpackAlignment),
                        e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, d);
                        const u = s.isCompressedTexture || s.image[0].isCompressedTexture
                          , p = s.image[0] && s.image[0].isDataTexture
                          , f = [];
                        for (let e = 0; e < 6; e++)
                            f[e] = u || p ? p ? s.image[e].image : s.image[e] : m(s.image[e], !0, r.maxCubemapSize),
                            f[e] = F(s, f[e]);
                        const w = f[0]
                          , b = a.convert(s.format, s.colorSpace)
                          , x = a.convert(s.type)
                          , k = y(s.internalFormat, b, x, s.colorSpace)
                          , E = !0 !== s.isVideoTexture
                          , S = void 0 === h.__version || !0 === l
                          , M = c.dataReady;
                        let _, T = A(s, w);
                        if (P(e.TEXTURE_CUBE_MAP, s),
                        u) {
                            E && S && n.texStorage2D(e.TEXTURE_CUBE_MAP, T, k, w.width, w.height);
                            for (let t = 0; t < 6; t++) {
                                _ = f[t].mipmaps;
                                for (let i = 0; i < _.length; i++) {
                                    const r = _[i];
                                    s.format !== Me ? null !== b ? E ? M && n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, i, 0, 0, r.width, r.height, b, r.data) : n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, i, k, r.width, r.height, 0, r.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : E ? M && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, i, 0, 0, r.width, r.height, b, x, r.data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, i, k, r.width, r.height, 0, b, x, r.data)
                                }
                            }
                        } else {
                            if (_ = s.mipmaps,
                            E && S) {
                                _.length > 0 && T++;
                                const t = W(f[0]);
                                n.texStorage2D(e.TEXTURE_CUBE_MAP, T, k, t.width, t.height)
                            }
                            for (let t = 0; t < 6; t++)
                                if (p) {
                                    E ? M && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, 0, 0, f[t].width, f[t].height, b, x, f[t].data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, k, f[t].width, f[t].height, 0, b, x, f[t].data);
                                    for (let i = 0; i < _.length; i++) {
                                        const r = _[i].image[t].image;
                                        E ? M && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, i + 1, 0, 0, r.width, r.height, b, x, r.data) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, i + 1, k, r.width, r.height, 0, b, x, r.data)
                                    }
                                } else {
                                    E ? M && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, 0, 0, b, x, f[t]) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, 0, k, b, x, f[t]);
                                    for (let i = 0; i < _.length; i++) {
                                        const r = _[i];
                                        E ? M && n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, i + 1, 0, 0, b, x, r.image[t]) : n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + t, i + 1, k, b, x, r.image[t])
                                    }
                                }
                        }
                        g(s) && v(e.TEXTURE_CUBE_MAP),
                        h.__version = c.version,
                        s.onUpdate && s.onUpdate(s)
                    }
                    t.__version = s.version
                }(o, t, s) : n.bindTexture(e.TEXTURE_CUBE_MAP, o.__webglTexture, e.TEXTURE0 + s)
            }
            ,
            this.rebindTextures = function(t, n, r) {
                const a = i.get(t);
                void 0 !== n && L(a.__webglFramebuffer, t, t.texture, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, 0),
                void 0 !== r && N(t)
            }
            ,
            this.setupRenderTarget = function(t) {
                const r = t.texture
                  , o = i.get(t)
                  , l = i.get(r);
                t.addEventListener("dispose", k);
                const c = t.textures
                  , h = !0 === t.isWebGLCubeRenderTarget
                  , d = c.length > 1;
                if (d || (void 0 === l.__webglTexture && (l.__webglTexture = e.createTexture()),
                l.__version = r.version,
                s.memory.textures++),
                h) {
                    o.__webglFramebuffer = [];
                    for (let t = 0; t < 6; t++)
                        if (r.mipmaps && r.mipmaps.length > 0) {
                            o.__webglFramebuffer[t] = [];
                            for (let n = 0; n < r.mipmaps.length; n++)
                                o.__webglFramebuffer[t][n] = e.createFramebuffer()
                        } else
                            o.__webglFramebuffer[t] = e.createFramebuffer()
                } else {
                    if (r.mipmaps && r.mipmaps.length > 0) {
                        o.__webglFramebuffer = [];
                        for (let t = 0; t < r.mipmaps.length; t++)
                            o.__webglFramebuffer[t] = e.createFramebuffer()
                    } else
                        o.__webglFramebuffer = e.createFramebuffer();
                    if (d)
                        for (let t = 0, n = c.length; t < n; t++) {
                            const n = i.get(c[t]);
                            void 0 === n.__webglTexture && (n.__webglTexture = e.createTexture(),
                            s.memory.textures++)
                        }
                    if (t.samples > 0 && !1 === O(t)) {
                        o.__webglMultisampledFramebuffer = e.createFramebuffer(),
                        o.__webglColorRenderbuffer = [],
                        n.bindFramebuffer(e.FRAMEBUFFER, o.__webglMultisampledFramebuffer);
                        for (let n = 0; n < c.length; n++) {
                            const i = c[n];
                            o.__webglColorRenderbuffer[n] = e.createRenderbuffer(),
                            e.bindRenderbuffer(e.RENDERBUFFER, o.__webglColorRenderbuffer[n]);
                            const r = a.convert(i.format, i.colorSpace)
                              , s = a.convert(i.type)
                              , l = y(i.internalFormat, r, s, i.colorSpace, !0 === t.isXRRenderTarget)
                              , h = z(t);
                            e.renderbufferStorageMultisample(e.RENDERBUFFER, h, l, t.width, t.height),
                            e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + n, e.RENDERBUFFER, o.__webglColorRenderbuffer[n])
                        }
                        e.bindRenderbuffer(e.RENDERBUFFER, null),
                        t.depthBuffer && (o.__webglDepthRenderbuffer = e.createRenderbuffer(),
                        D(o.__webglDepthRenderbuffer, t, !0)),
                        n.bindFramebuffer(e.FRAMEBUFFER, null)
                    }
                }
                if (h) {
                    n.bindTexture(e.TEXTURE_CUBE_MAP, l.__webglTexture),
                    P(e.TEXTURE_CUBE_MAP, r);
                    for (let n = 0; n < 6; n++)
                        if (r.mipmaps && r.mipmaps.length > 0)
                            for (let i = 0; i < r.mipmaps.length; i++)
                                L(o.__webglFramebuffer[n][i], t, r, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + n, i);
                        else
                            L(o.__webglFramebuffer[n], t, r, e.COLOR_ATTACHMENT0, e.TEXTURE_CUBE_MAP_POSITIVE_X + n, 0);
                    g(r) && v(e.TEXTURE_CUBE_MAP),
                    n.unbindTexture()
                } else if (d) {
                    for (let r = 0, a = c.length; r < a; r++) {
                        const a = c[r]
                          , s = i.get(a);
                        n.bindTexture(e.TEXTURE_2D, s.__webglTexture),
                        P(e.TEXTURE_2D, a),
                        L(o.__webglFramebuffer, t, a, e.COLOR_ATTACHMENT0 + r, e.TEXTURE_2D, 0),
                        g(a) && v(e.TEXTURE_2D)
                    }
                    n.unbindTexture()
                } else {
                    let i = e.TEXTURE_2D;
                    if ((t.isWebGL3DRenderTarget || t.isWebGLArrayRenderTarget) && (i = t.isWebGL3DRenderTarget ? e.TEXTURE_3D : e.TEXTURE_2D_ARRAY),
                    n.bindTexture(i, l.__webglTexture),
                    P(i, r),
                    r.mipmaps && r.mipmaps.length > 0)
                        for (let n = 0; n < r.mipmaps.length; n++)
                            L(o.__webglFramebuffer[n], t, r, e.COLOR_ATTACHMENT0, i, n);
                    else
                        L(o.__webglFramebuffer, t, r, e.COLOR_ATTACHMENT0, i, 0);
                    g(r) && v(i),
                    n.unbindTexture()
                }
                t.depthBuffer && N(t)
            }
            ,
            this.updateRenderTargetMipmap = function(e) {
                const t = e.textures;
                for (let r = 0, a = t.length; r < a; r++) {
                    const a = t[r];
                    if (g(a)) {
                        const t = w(e)
                          , r = i.get(a).__webglTexture;
                        n.bindTexture(t, r),
                        v(t),
                        n.unbindTexture()
                    }
                }
            }
            ,
            this.updateMultisampleRenderTarget = function(t) {
                if (t.samples > 0)
                    if (!1 === O(t)) {
                        const r = t.textures
                          , a = t.width
                          , s = t.height;
                        let o = e.COLOR_BUFFER_BIT;
                        const c = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT
                          , h = i.get(t)
                          , d = r.length > 1;
                        if (d)
                            for (let t = 0; t < r.length; t++)
                                n.bindFramebuffer(e.FRAMEBUFFER, h.__webglMultisampledFramebuffer),
                                e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.RENDERBUFFER, null),
                                n.bindFramebuffer(e.FRAMEBUFFER, h.__webglFramebuffer),
                                e.framebufferTexture2D(e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.TEXTURE_2D, null, 0);
                        n.bindFramebuffer(e.READ_FRAMEBUFFER, h.__webglMultisampledFramebuffer),
                        n.bindFramebuffer(e.DRAW_FRAMEBUFFER, h.__webglFramebuffer);
                        for (let n = 0; n < r.length; n++) {
                            if (t.resolveDepthBuffer && (t.depthBuffer && (o |= e.DEPTH_BUFFER_BIT),
                            t.stencilBuffer && t.resolveStencilBuffer && (o |= e.STENCIL_BUFFER_BIT)),
                            d) {
                                e.framebufferRenderbuffer(e.READ_FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.RENDERBUFFER, h.__webglColorRenderbuffer[n]);
                                const t = i.get(r[n]).__webglTexture;
                                e.framebufferTexture2D(e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, t, 0)
                            }
                            e.blitFramebuffer(0, 0, a, s, 0, 0, a, s, o, e.NEAREST),
                            !0 === l && (B.length = 0,
                            U.length = 0,
                            B.push(e.COLOR_ATTACHMENT0 + n),
                            t.depthBuffer && !1 === t.resolveDepthBuffer && (B.push(c),
                            U.push(c),
                            e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER, U)),
                            e.invalidateFramebuffer(e.READ_FRAMEBUFFER, B))
                        }
                        if (n.bindFramebuffer(e.READ_FRAMEBUFFER, null),
                        n.bindFramebuffer(e.DRAW_FRAMEBUFFER, null),
                        d)
                            for (let t = 0; t < r.length; t++) {
                                n.bindFramebuffer(e.FRAMEBUFFER, h.__webglMultisampledFramebuffer),
                                e.framebufferRenderbuffer(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.RENDERBUFFER, h.__webglColorRenderbuffer[t]);
                                const a = i.get(r[t]).__webglTexture;
                                n.bindFramebuffer(e.FRAMEBUFFER, h.__webglFramebuffer),
                                e.framebufferTexture2D(e.DRAW_FRAMEBUFFER, e.COLOR_ATTACHMENT0 + t, e.TEXTURE_2D, a, 0)
                            }
                        n.bindFramebuffer(e.DRAW_FRAMEBUFFER, h.__webglMultisampledFramebuffer)
                    } else if (t.depthBuffer && !1 === t.resolveDepthBuffer && l) {
                        const n = t.stencilBuffer ? e.DEPTH_STENCIL_ATTACHMENT : e.DEPTH_ATTACHMENT;
                        e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER, [n])
                    }
            }
            ,
            this.setupDepthRenderbuffer = N,
            this.setupFrameBufferTexture = L,
            this.useMultisampledRTT = O
        }
        function Kd(e, t) {
            return {
                convert: function(n, i="") {
                    let r;
                    const a = rn.getTransfer(i);
                    if (n === fe)
                        return e.UNSIGNED_BYTE;
                    if (n === xe)
                        return e.UNSIGNED_SHORT_4_4_4_4;
                    if (n === ke)
                        return e.UNSIGNED_SHORT_5_5_5_1;
                    if (n === Se)
                        return e.UNSIGNED_INT_5_9_9_9_REV;
                    if (n === me)
                        return e.BYTE;
                    if (n === ge)
                        return e.SHORT;
                    if (n === ve)
                        return e.UNSIGNED_SHORT;
                    if (n === we)
                        return e.INT;
                    if (n === ye)
                        return e.UNSIGNED_INT;
                    if (n === be)
                        return e.FLOAT;
                    if (n === Ae)
                        return e.HALF_FLOAT;
                    if (1021 === n)
                        return e.ALPHA;
                    if (1022 === n)
                        return e.RGB;
                    if (n === Me)
                        return e.RGBA;
                    if (1024 === n)
                        return e.LUMINANCE;
                    if (1025 === n)
                        return e.LUMINANCE_ALPHA;
                    if (n === _e)
                        return e.DEPTH_COMPONENT;
                    if (n === Te)
                        return e.DEPTH_STENCIL;
                    if (n === Ce)
                        return e.RED;
                    if (n === Pe)
                        return e.RED_INTEGER;
                    if (1030 === n)
                        return e.RG;
                    if (n === Ie)
                        return e.RG_INTEGER;
                    if (n === Re)
                        return e.RGBA_INTEGER;
                    if (n === Le || n === De || n === Ne || n === Be)
                        if (a === bt) {
                            if (r = t.get("WEBGL_compressed_texture_s3tc_srgb"),
                            null === r)
                                return null;
                            if (n === Le)
                                return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;
                            if (n === De)
                                return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
                            if (n === Ne)
                                return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
                            if (n === Be)
                                return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
                        } else {
                            if (r = t.get("WEBGL_compressed_texture_s3tc"),
                            null === r)
                                return null;
                            if (n === Le)
                                return r.COMPRESSED_RGB_S3TC_DXT1_EXT;
                            if (n === De)
                                return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;
                            if (n === Ne)
                                return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;
                            if (n === Be)
                                return r.COMPRESSED_RGBA_S3TC_DXT5_EXT
                        }
                    if (n === Ue || n === ze || n === Oe || n === Fe) {
                        if (r = t.get("WEBGL_compressed_texture_pvrtc"),
                        null === r)
                            return null;
                        if (n === Ue)
                            return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
                        if (n === ze)
                            return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
                        if (n === Oe)
                            return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
                        if (n === Fe)
                            return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
                    }
                    if (n === We || n === He || n === Ve) {
                        if (r = t.get("WEBGL_compressed_texture_etc"),
                        null === r)
                            return null;
                        if (n === We || n === He)
                            return a === bt ? r.COMPRESSED_SRGB8_ETC2 : r.COMPRESSED_RGB8_ETC2;
                        if (n === Ve)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : r.COMPRESSED_RGBA8_ETC2_EAC
                    }
                    if (n === Ge || n === je || n === Qe || n === Ke || n === qe || n === Ye || n === Xe || n === Ze || n === Je || n === $e || n === et || n === tt || n === nt || n === it) {
                        if (r = t.get("WEBGL_compressed_texture_astc"),
                        null === r)
                            return null;
                        if (n === Ge)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : r.COMPRESSED_RGBA_ASTC_4x4_KHR;
                        if (n === je)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : r.COMPRESSED_RGBA_ASTC_5x4_KHR;
                        if (n === Qe)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : r.COMPRESSED_RGBA_ASTC_5x5_KHR;
                        if (n === Ke)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : r.COMPRESSED_RGBA_ASTC_6x5_KHR;
                        if (n === qe)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : r.COMPRESSED_RGBA_ASTC_6x6_KHR;
                        if (n === Ye)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : r.COMPRESSED_RGBA_ASTC_8x5_KHR;
                        if (n === Xe)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : r.COMPRESSED_RGBA_ASTC_8x6_KHR;
                        if (n === Ze)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : r.COMPRESSED_RGBA_ASTC_8x8_KHR;
                        if (n === Je)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : r.COMPRESSED_RGBA_ASTC_10x5_KHR;
                        if (n === $e)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : r.COMPRESSED_RGBA_ASTC_10x6_KHR;
                        if (n === et)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : r.COMPRESSED_RGBA_ASTC_10x8_KHR;
                        if (n === tt)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r.COMPRESSED_RGBA_ASTC_10x10_KHR;
                        if (n === nt)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r.COMPRESSED_RGBA_ASTC_12x10_KHR;
                        if (n === it)
                            return a === bt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r.COMPRESSED_RGBA_ASTC_12x12_KHR
                    }
                    if (n === rt || n === at || n === st) {
                        if (r = t.get("EXT_texture_compression_bptc"),
                        null === r)
                            return null;
                        if (n === rt)
                            return a === bt ? r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : r.COMPRESSED_RGBA_BPTC_UNORM_EXT;
                        if (n === at)
                            return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
                        if (n === st)
                            return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT
                    }
                    if (36283 === n || n === ot || n === lt || n === ct) {
                        if (r = t.get("EXT_texture_compression_rgtc"),
                        null === r)
                            return null;
                        if (n === rt)
                            return r.COMPRESSED_RED_RGTC1_EXT;
                        if (n === ot)
                            return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;
                        if (n === lt)
                            return r.COMPRESSED_RED_GREEN_RGTC2_EXT;
                        if (n === ct)
                            return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT
                    }
                    return n === Ee ? e.UNSIGNED_INT_24_8 : void 0 !== e[n] ? e[n] : null
                }
            }
        }
        class qd {
            constructor() {
                this.texture = null,
                this.mesh = null,
                this.depthNear = 0,
                this.depthFar = 0
            }
            init(e, t, n) {
                if (null === this.texture) {
                    const i = new pn;
                    e.properties.get(i).__webglTexture = t.texture,
                    t.depthNear === n.depthNear && t.depthFar === n.depthFar || (this.depthNear = t.depthNear,
                    this.depthFar = t.depthFar),
                    this.texture = i
                }
            }
            getMesh(e) {
                if (null !== this.texture && null === this.mesh) {
                    const t = e.cameras[0].viewport
                      , n = new Mr({
                        vertexShader: "\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",
                        fragmentShader: "\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",
                        uniforms: {
                            depthColor: {
                                value: this.texture
                            },
                            depthWidth: {
                                value: t.z
                            },
                            depthHeight: {
                                value: t.w
                            }
                        }
                    });
                    this.mesh = new yr(new Bs(20,20),n)
                }
                return this.mesh
            }
            reset() {
                this.texture = null,
                this.mesh = null
            }
            getDepthTexture() {
                return this.texture
            }
        }
        class Yd extends Dt {
            constructor(e, t) {
                super();
                const n = this;
                let i = null
                  , r = 1
                  , a = null
                  , s = "local-floor"
                  , o = 1
                  , l = null
                  , c = null
                  , h = null
                  , d = null
                  , u = null
                  , p = null;
                const f = new qd
                  , m = t.getContextAttributes();
                let g = null
                  , v = null;
                const w = []
                  , y = []
                  , b = new Qt;
                let A = null;
                const x = new Ir;
                x.viewport = new fn;
                const k = new Ir;
                k.viewport = new fn;
                const E = [x, k]
                  , S = new Uo;
                let M = null
                  , _ = null;
                function T(e) {
                    const t = y.indexOf(e.inputSource);
                    if (-1 === t)
                        return;
                    const n = w[t];
                    void 0 !== n && (n.update(e.inputSource, e.frame, l || a),
                    n.dispatchEvent({
                        type: e.type,
                        data: e.inputSource
                    }))
                }
                function C() {
                    i.removeEventListener("select", T),
                    i.removeEventListener("selectstart", T),
                    i.removeEventListener("selectend", T),
                    i.removeEventListener("squeeze", T),
                    i.removeEventListener("squeezestart", T),
                    i.removeEventListener("squeezeend", T),
                    i.removeEventListener("end", C),
                    i.removeEventListener("inputsourceschange", P);
                    for (let e = 0; e < w.length; e++) {
                        const t = y[e];
                        null !== t && (y[e] = null,
                        w[e].disconnect(t))
                    }
                    M = null,
                    _ = null,
                    f.reset(),
                    e.setRenderTarget(g),
                    u = null,
                    d = null,
                    h = null,
                    i = null,
                    v = null,
                    N.stop(),
                    n.isPresenting = !1,
                    e.setPixelRatio(A),
                    e.setSize(b.width, b.height, !1),
                    n.dispatchEvent({
                        type: "sessionend"
                    })
                }
                function P(e) {
                    for (let t = 0; t < e.removed.length; t++) {
                        const n = e.removed[t]
                          , i = y.indexOf(n);
                        i >= 0 && (y[i] = null,
                        w[i].disconnect(n))
                    }
                    for (let t = 0; t < e.added.length; t++) {
                        const n = e.added[t];
                        let i = y.indexOf(n);
                        if (-1 === i) {
                            for (let e = 0; e < w.length; e++) {
                                if (e >= y.length) {
                                    y.push(n),
                                    i = e;
                                    break
                                }
                                if (null === y[e]) {
                                    y[e] = n,
                                    i = e;
                                    break
                                }
                            }
                            if (-1 === i)
                                break
                        }
                        const r = w[i];
                        r && r.connect(n)
                    }
                }
                this.cameraAutoUpdate = !0,
                this.enabled = !1,
                this.isPresenting = !1,
                this.getController = function(e) {
                    let t = w[e];
                    return void 0 === t && (t = new zr,
                    w[e] = t),
                    t.getTargetRaySpace()
                }
                ,
                this.getControllerGrip = function(e) {
                    let t = w[e];
                    return void 0 === t && (t = new zr,
                    w[e] = t),
                    t.getGripSpace()
                }
                ,
                this.getHand = function(e) {
                    let t = w[e];
                    return void 0 === t && (t = new zr,
                    w[e] = t),
                    t.getHandSpace()
                }
                ,
                this.setFramebufferScaleFactor = function(e) {
                    r = e,
                    !0 === n.isPresenting && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")
                }
                ,
                this.setReferenceSpaceType = function(e) {
                    s = e,
                    !0 === n.isPresenting && console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")
                }
                ,
                this.getReferenceSpace = function() {
                    return l || a
                }
                ,
                this.setReferenceSpace = function(e) {
                    l = e
                }
                ,
                this.getBaseLayer = function() {
                    return null !== d ? d : u
                }
                ,
                this.getBinding = function() {
                    return h
                }
                ,
                this.getFrame = function() {
                    return p
                }
                ,
                this.getSession = function() {
                    return i
                }
                ,
                this.setSession = async function(c) {
                    if (i = c,
                    null !== i) {
                        g = e.getRenderTarget(),
                        i.addEventListener("select", T),
                        i.addEventListener("selectstart", T),
                        i.addEventListener("selectend", T),
                        i.addEventListener("squeeze", T),
                        i.addEventListener("squeezestart", T),
                        i.addEventListener("squeezeend", T),
                        i.addEventListener("end", C),
                        i.addEventListener("inputsourceschange", P),
                        !0 !== m.xrCompatible && await t.makeXRCompatible(),
                        A = e.getPixelRatio(),
                        e.getSize(b);
                        if ("undefined" != typeof XRWebGLBinding && "createProjectionLayer"in XRWebGLBinding.prototype) {
                            let n = null
                              , a = null
                              , s = null;
                            m.depth && (s = m.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24,
                            n = m.stencil ? Te : _e,
                            a = m.stencil ? Ee : ye);
                            const o = {
                                colorFormat: t.RGBA8,
                                depthFormat: s,
                                scaleFactor: r
                            };
                            h = new XRWebGLBinding(i,t),
                            d = h.createProjectionLayer(o),
                            i.updateRenderState({
                                layers: [d]
                            }),
                            e.setPixelRatio(1),
                            e.setSize(d.textureWidth, d.textureHeight, !1),
                            v = new gn(d.textureWidth,d.textureHeight,{
                                format: Me,
                                type: fe,
                                depthTexture: new Ha(d.textureWidth,d.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),
                                stencilBuffer: m.stencil,
                                colorSpace: e.outputColorSpace,
                                samples: m.antialias ? 4 : 0,
                                resolveDepthBuffer: !1 === d.ignoreDepthValues,
                                resolveStencilBuffer: !1 === d.ignoreDepthValues
                            })
                        } else {
                            const n = {
                                antialias: m.antialias,
                                alpha: !0,
                                depth: m.depth,
                                stencil: m.stencil,
                                framebufferScaleFactor: r
                            };
                            u = new XRWebGLLayer(i,t,n),
                            i.updateRenderState({
                                baseLayer: u
                            }),
                            e.setPixelRatio(1),
                            e.setSize(u.framebufferWidth, u.framebufferHeight, !1),
                            v = new gn(u.framebufferWidth,u.framebufferHeight,{
                                format: Me,
                                type: fe,
                                colorSpace: e.outputColorSpace,
                                stencilBuffer: m.stencil,
                                resolveDepthBuffer: !1 === u.ignoreDepthValues,
                                resolveStencilBuffer: !1 === u.ignoreDepthValues
                            })
                        }
                        v.isXRRenderTarget = !0,
                        this.setFoveation(o),
                        l = null,
                        a = await i.requestReferenceSpace(s),
                        N.setContext(i),
                        N.start(),
                        n.isPresenting = !0,
                        n.dispatchEvent({
                            type: "sessionstart"
                        })
                    }
                }
                ,
                this.getEnvironmentBlendMode = function() {
                    if (null !== i)
                        return i.environmentBlendMode
                }
                ,
                this.getDepthTexture = function() {
                    return f.getDepthTexture()
                }
                ;
                const I = new bn
                  , R = new bn;
                function L(e, t) {
                    null === t ? e.matrixWorld.copy(e.matrix) : e.matrixWorld.multiplyMatrices(t.matrixWorld, e.matrix),
                    e.matrixWorldInverse.copy(e.matrixWorld).invert()
                }
                this.updateCamera = function(e) {
                    if (null === i)
                        return;
                    let t = e.near
                      , n = e.far;
                    null !== f.texture && (f.depthNear > 0 && (t = f.depthNear),
                    f.depthFar > 0 && (n = f.depthFar)),
                    S.near = k.near = x.near = t,
                    S.far = k.far = x.far = n,
                    M === S.near && _ === S.far || (i.updateRenderState({
                        depthNear: S.near,
                        depthFar: S.far
                    }),
                    M = S.near,
                    _ = S.far),
                    x.layers.mask = 2 | e.layers.mask,
                    k.layers.mask = 4 | e.layers.mask,
                    S.layers.mask = x.layers.mask | k.layers.mask;
                    const r = e.parent
                      , a = S.cameras;
                    L(S, r);
                    for (let e = 0; e < a.length; e++)
                        L(a[e], r);
                    2 === a.length ? function(e, t, n) {
                        I.setFromMatrixPosition(t.matrixWorld),
                        R.setFromMatrixPosition(n.matrixWorld);
                        const i = I.distanceTo(R)
                          , r = t.projectionMatrix.elements
                          , a = n.projectionMatrix.elements
                          , s = r[14] / (r[10] - 1)
                          , o = r[14] / (r[10] + 1)
                          , l = (r[9] + 1) / r[5]
                          , c = (r[9] - 1) / r[5]
                          , h = (r[8] - 1) / r[0]
                          , d = (a[8] + 1) / a[0]
                          , u = s * h
                          , p = s * d
                          , f = i / (-h + d)
                          , m = f * -h;
                        if (t.matrixWorld.decompose(e.position, e.quaternion, e.scale),
                        e.translateX(m),
                        e.translateZ(f),
                        e.matrixWorld.compose(e.position, e.quaternion, e.scale),
                        e.matrixWorldInverse.copy(e.matrixWorld).invert(),
                        -1 === r[10])
                            e.projectionMatrix.copy(t.projectionMatrix),
                            e.projectionMatrixInverse.copy(t.projectionMatrixInverse);
                        else {
                            const t = s + f
                              , n = o + f
                              , r = u - m
                              , a = p + (i - m)
                              , h = l * o / n * t
                              , d = c * o / n * t;
                            e.projectionMatrix.makePerspective(r, a, h, d, t, n),
                            e.projectionMatrixInverse.copy(e.projectionMatrix).invert()
                        }
                    }(S, x, k) : S.projectionMatrix.copy(x.projectionMatrix),
                    function(e, t, n) {
                        null === n ? e.matrix.copy(t.matrixWorld) : (e.matrix.copy(n.matrixWorld),
                        e.matrix.invert(),
                        e.matrix.multiply(t.matrixWorld));
                        e.matrix.decompose(e.position, e.quaternion, e.scale),
                        e.updateMatrixWorld(!0),
                        e.projectionMatrix.copy(t.projectionMatrix),
                        e.projectionMatrixInverse.copy(t.projectionMatrixInverse),
                        e.isPerspectiveCamera && (e.fov = 2 * zt * Math.atan(1 / e.projectionMatrix.elements[5]),
                        e.zoom = 1)
                    }(e, S, r)
                }
                ,
                this.getCamera = function() {
                    return S
                }
                ,
                this.getFoveation = function() {
                    if (null !== d || null !== u)
                        return o
                }
                ,
                this.setFoveation = function(e) {
                    o = e,
                    null !== d && (d.fixedFoveation = e),
                    null !== u && void 0 !== u.fixedFoveation && (u.fixedFoveation = e)
                }
                ,
                this.hasDepthSensing = function() {
                    return null !== f.texture
                }
                ,
                this.getDepthSensingMesh = function() {
                    return f.getMesh(S)
                }
                ;
                let D = null;
                const N = new wc;
                N.setAnimationLoop((function(t, r) {
                    if (c = r.getViewerPose(l || a),
                    p = r,
                    null !== c) {
                        const t = c.views;
                        null !== u && (e.setRenderTargetFramebuffer(v, u.framebuffer),
                        e.setRenderTarget(v));
                        let n = !1;
                        t.length !== S.cameras.length && (S.cameras.length = 0,
                        n = !0);
                        for (let i = 0; i < t.length; i++) {
                            const r = t[i];
                            let a = null;
                            if (null !== u)
                                a = u.getViewport(r);
                            else {
                                const t = h.getViewSubImage(d, r);
                                a = t.viewport,
                                0 === i && (e.setRenderTargetTextures(v, t.colorTexture, d.ignoreDepthValues ? void 0 : t.depthStencilTexture),
                                e.setRenderTarget(v))
                            }
                            let s = E[i];
                            void 0 === s && (s = new Ir,
                            s.layers.enable(i),
                            s.viewport = new fn,
                            E[i] = s),
                            s.matrix.fromArray(r.transform.matrix),
                            s.matrix.decompose(s.position, s.quaternion, s.scale),
                            s.projectionMatrix.fromArray(r.projectionMatrix),
                            s.projectionMatrixInverse.copy(s.projectionMatrix).invert(),
                            s.viewport.set(a.x, a.y, a.width, a.height),
                            0 === i && (S.matrix.copy(s.matrix),
                            S.matrix.decompose(S.position, S.quaternion, S.scale)),
                            !0 === n && S.cameras.push(s)
                        }
                        const r = i.enabledFeatures;
                        if (r && r.includes("depth-sensing") && "gpu-optimized" == i.depthUsage && h) {
                            const n = h.getDepthInformation(t[0]);
                            n && n.isValid && n.texture && f.init(e, n, i.renderState)
                        }
                    }
                    for (let e = 0; e < w.length; e++) {
                        const t = y[e]
                          , n = w[e];
                        null !== t && void 0 !== n && n.update(t, r, l || a)
                    }
                    D && D(t, r),
                    r.detectedPlanes && n.dispatchEvent({
                        type: "planesdetected",
                        data: r
                    }),
                    p = null
                }
                )),
                this.setAnimationLoop = function(e) {
                    D = e
                }
                ,
                this.dispose = function() {}
            }
        }
        const Xd = new si
          , Zd = new Xn;
        function Jd(e, t) {
            function n(e, t) {
                !0 === e.matrixAutoUpdate && e.updateMatrix(),
                t.value.copy(e.matrix)
            }
            function i(e, i) {
                e.opacity.value = i.opacity,
                i.color && e.diffuse.value.copy(i.color),
                i.emissive && e.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),
                i.map && (e.map.value = i.map,
                n(i.map, e.mapTransform)),
                i.alphaMap && (e.alphaMap.value = i.alphaMap,
                n(i.alphaMap, e.alphaMapTransform)),
                i.bumpMap && (e.bumpMap.value = i.bumpMap,
                n(i.bumpMap, e.bumpMapTransform),
                e.bumpScale.value = i.bumpScale,
                1 === i.side && (e.bumpScale.value *= -1)),
                i.normalMap && (e.normalMap.value = i.normalMap,
                n(i.normalMap, e.normalMapTransform),
                e.normalScale.value.copy(i.normalScale),
                1 === i.side && e.normalScale.value.negate()),
                i.displacementMap && (e.displacementMap.value = i.displacementMap,
                n(i.displacementMap, e.displacementMapTransform),
                e.displacementScale.value = i.displacementScale,
                e.displacementBias.value = i.displacementBias),
                i.emissiveMap && (e.emissiveMap.value = i.emissiveMap,
                n(i.emissiveMap, e.emissiveMapTransform)),
                i.specularMap && (e.specularMap.value = i.specularMap,
                n(i.specularMap, e.specularMapTransform)),
                i.alphaTest > 0 && (e.alphaTest.value = i.alphaTest);
                const r = t.get(i)
                  , a = r.envMap
                  , s = r.envMapRotation;
                a && (e.envMap.value = a,
                Xd.copy(s),
                Xd.x *= -1,
                Xd.y *= -1,
                Xd.z *= -1,
                a.isCubeTexture && !1 === a.isRenderTargetTexture && (Xd.y *= -1,
                Xd.z *= -1),
                e.envMapRotation.value.setFromMatrix4(Zd.makeRotationFromEuler(Xd)),
                e.flipEnvMap.value = a.isCubeTexture && !1 === a.isRenderTargetTexture ? -1 : 1,
                e.reflectivity.value = i.reflectivity,
                e.ior.value = i.ior,
                e.refractionRatio.value = i.refractionRatio),
                i.lightMap && (e.lightMap.value = i.lightMap,
                e.lightMapIntensity.value = i.lightMapIntensity,
                n(i.lightMap, e.lightMapTransform)),
                i.aoMap && (e.aoMap.value = i.aoMap,
                e.aoMapIntensity.value = i.aoMapIntensity,
                n(i.aoMap, e.aoMapTransform))
            }
            return {
                refreshFogUniforms: function(t, n) {
                    n.color.getRGB(t.fogColor.value, Er(e)),
                    n.isFog ? (t.fogNear.value = n.near,
                    t.fogFar.value = n.far) : n.isFogExp2 && (t.fogDensity.value = n.density)
                },
                refreshMaterialUniforms: function(e, r, a, s, o) {
                    r.isMeshBasicMaterial || r.isMeshLambertMaterial ? i(e, r) : r.isMeshToonMaterial ? (i(e, r),
                    function(e, t) {
                        t.gradientMap && (e.gradientMap.value = t.gradientMap)
                    }(e, r)) : r.isMeshPhongMaterial ? (i(e, r),
                    function(e, t) {
                        e.specular.value.copy(t.specular),
                        e.shininess.value = Math.max(t.shininess, 1e-4)
                    }(e, r)) : r.isMeshStandardMaterial ? (i(e, r),
                    function(e, t) {
                        e.metalness.value = t.metalness,
                        t.metalnessMap && (e.metalnessMap.value = t.metalnessMap,
                        n(t.metalnessMap, e.metalnessMapTransform));
                        e.roughness.value = t.roughness,
                        t.roughnessMap && (e.roughnessMap.value = t.roughnessMap,
                        n(t.roughnessMap, e.roughnessMapTransform));
                        t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
                    }(e, r),
                    r.isMeshPhysicalMaterial && function(e, t, i) {
                        e.ior.value = t.ior,
                        t.sheen > 0 && (e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),
                        e.sheenRoughness.value = t.sheenRoughness,
                        t.sheenColorMap && (e.sheenColorMap.value = t.sheenColorMap,
                        n(t.sheenColorMap, e.sheenColorMapTransform)),
                        t.sheenRoughnessMap && (e.sheenRoughnessMap.value = t.sheenRoughnessMap,
                        n(t.sheenRoughnessMap, e.sheenRoughnessMapTransform)));
                        t.clearcoat > 0 && (e.clearcoat.value = t.clearcoat,
                        e.clearcoatRoughness.value = t.clearcoatRoughness,
                        t.clearcoatMap && (e.clearcoatMap.value = t.clearcoatMap,
                        n(t.clearcoatMap, e.clearcoatMapTransform)),
                        t.clearcoatRoughnessMap && (e.clearcoatRoughnessMap.value = t.clearcoatRoughnessMap,
                        n(t.clearcoatRoughnessMap, e.clearcoatRoughnessMapTransform)),
                        t.clearcoatNormalMap && (e.clearcoatNormalMap.value = t.clearcoatNormalMap,
                        n(t.clearcoatNormalMap, e.clearcoatNormalMapTransform),
                        e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),
                        1 === t.side && e.clearcoatNormalScale.value.negate()));
                        t.dispersion > 0 && (e.dispersion.value = t.dispersion);
                        t.iridescence > 0 && (e.iridescence.value = t.iridescence,
                        e.iridescenceIOR.value = t.iridescenceIOR,
                        e.iridescenceThicknessMinimum.value = t.iridescenceThicknessRange[0],
                        e.iridescenceThicknessMaximum.value = t.iridescenceThicknessRange[1],
                        t.iridescenceMap && (e.iridescenceMap.value = t.iridescenceMap,
                        n(t.iridescenceMap, e.iridescenceMapTransform)),
                        t.iridescenceThicknessMap && (e.iridescenceThicknessMap.value = t.iridescenceThicknessMap,
                        n(t.iridescenceThicknessMap, e.iridescenceThicknessMapTransform)));
                        t.transmission > 0 && (e.transmission.value = t.transmission,
                        e.transmissionSamplerMap.value = i.texture,
                        e.transmissionSamplerSize.value.set(i.width, i.height),
                        t.transmissionMap && (e.transmissionMap.value = t.transmissionMap,
                        n(t.transmissionMap, e.transmissionMapTransform)),
                        e.thickness.value = t.thickness,
                        t.thicknessMap && (e.thicknessMap.value = t.thicknessMap,
                        n(t.thicknessMap, e.thicknessMapTransform)),
                        e.attenuationDistance.value = t.attenuationDistance,
                        e.attenuationColor.value.copy(t.attenuationColor));
                        t.anisotropy > 0 && (e.anisotropyVector.value.set(t.anisotropy * Math.cos(t.anisotropyRotation), t.anisotropy * Math.sin(t.anisotropyRotation)),
                        t.anisotropyMap && (e.anisotropyMap.value = t.anisotropyMap,
                        n(t.anisotropyMap, e.anisotropyMapTransform)));
                        e.specularIntensity.value = t.specularIntensity,
                        e.specularColor.value.copy(t.specularColor),
                        t.specularColorMap && (e.specularColorMap.value = t.specularColorMap,
                        n(t.specularColorMap, e.specularColorMapTransform));
                        t.specularIntensityMap && (e.specularIntensityMap.value = t.specularIntensityMap,
                        n(t.specularIntensityMap, e.specularIntensityMapTransform))
                    }(e, r, o)) : r.isMeshMatcapMaterial ? (i(e, r),
                    function(e, t) {
                        t.matcap && (e.matcap.value = t.matcap)
                    }(e, r)) : r.isMeshDepthMaterial ? i(e, r) : r.isMeshDistanceMaterial ? (i(e, r),
                    function(e, n) {
                        const i = t.get(n).light;
                        e.referencePosition.value.setFromMatrixPosition(i.matrixWorld),
                        e.nearDistance.value = i.shadow.camera.near,
                        e.farDistance.value = i.shadow.camera.far
                    }(e, r)) : r.isMeshNormalMaterial ? i(e, r) : r.isLineBasicMaterial ? (function(e, t) {
                        e.diffuse.value.copy(t.color),
                        e.opacity.value = t.opacity,
                        t.map && (e.map.value = t.map,
                        n(t.map, e.mapTransform))
                    }(e, r),
                    r.isLineDashedMaterial && function(e, t) {
                        e.dashSize.value = t.dashSize,
                        e.totalSize.value = t.dashSize + t.gapSize,
                        e.scale.value = t.scale
                    }(e, r)) : r.isPointsMaterial ? function(e, t, i, r) {
                        e.diffuse.value.copy(t.color),
                        e.opacity.value = t.opacity,
                        e.size.value = t.size * i,
                        e.scale.value = .5 * r,
                        t.map && (e.map.value = t.map,
                        n(t.map, e.uvTransform));
                        t.alphaMap && (e.alphaMap.value = t.alphaMap,
                        n(t.alphaMap, e.alphaMapTransform));
                        t.alphaTest > 0 && (e.alphaTest.value = t.alphaTest)
                    }(e, r, a, s) : r.isSpriteMaterial ? function(e, t) {
                        e.diffuse.value.copy(t.color),
                        e.opacity.value = t.opacity,
                        e.rotation.value = t.rotation,
                        t.map && (e.map.value = t.map,
                        n(t.map, e.mapTransform));
                        t.alphaMap && (e.alphaMap.value = t.alphaMap,
                        n(t.alphaMap, e.alphaMapTransform));
                        t.alphaTest > 0 && (e.alphaTest.value = t.alphaTest)
                    }(e, r) : r.isShadowMaterial ? (e.color.value.copy(r.color),
                    e.opacity.value = r.opacity) : r.isShaderMaterial && (r.uniformsNeedUpdate = !1)
                }
            }
        }
        function $d(e, t, n, i) {
            let r = {}
              , a = {}
              , s = [];
            const o = e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);
            function l(e, t, n, i) {
                const r = e.value
                  , a = t + "_" + n;
                if (void 0 === i[a])
                    return i[a] = "number" == typeof r || "boolean" == typeof r ? r : r.clone(),
                    !0;
                {
                    const e = i[a];
                    if ("number" == typeof r || "boolean" == typeof r) {
                        if (e !== r)
                            return i[a] = r,
                            !0
                    } else if (!1 === e.equals(r))
                        return e.copy(r),
                        !0
                }
                return !1
            }
            function c(e) {
                const t = {
                    boundary: 0,
                    storage: 0
                };
                return "number" == typeof e || "boolean" == typeof e ? (t.boundary = 4,
                t.storage = 4) : e.isVector2 ? (t.boundary = 8,
                t.storage = 8) : e.isVector3 || e.isColor ? (t.boundary = 16,
                t.storage = 12) : e.isVector4 ? (t.boundary = 16,
                t.storage = 16) : e.isMatrix3 ? (t.boundary = 48,
                t.storage = 48) : e.isMatrix4 ? (t.boundary = 64,
                t.storage = 64) : e.isTexture ? console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.") : console.warn("THREE.WebGLRenderer: Unsupported uniform value type.", e),
                t
            }
            function h(t) {
                const n = t.target;
                n.removeEventListener("dispose", h);
                const i = s.indexOf(n.__bindingPointIndex);
                s.splice(i, 1),
                e.deleteBuffer(r[n.id]),
                delete r[n.id],
                delete a[n.id]
            }
            return {
                bind: function(e, t) {
                    const n = t.program;
                    i.uniformBlockBinding(e, n)
                },
                update: function(n, d) {
                    let u = r[n.id];
                    void 0 === u && (!function(e) {
                        const t = e.uniforms;
                        let n = 0;
                        const i = 16;
                        for (let e = 0, r = t.length; e < r; e++) {
                            const r = Array.isArray(t[e]) ? t[e] : [t[e]];
                            for (let e = 0, t = r.length; e < t; e++) {
                                const t = r[e]
                                  , a = Array.isArray(t.value) ? t.value : [t.value];
                                for (let e = 0, r = a.length; e < r; e++) {
                                    const r = c(a[e])
                                      , s = n % i
                                      , o = s % r.boundary
                                      , l = s + o;
                                    n += o,
                                    0 !== l && i - l < r.storage && (n += i - l),
                                    t.__data = new Float32Array(r.storage / Float32Array.BYTES_PER_ELEMENT),
                                    t.__offset = n,
                                    n += r.storage
                                }
                            }
                        }
                        const r = n % i;
                        r > 0 && (n += i - r);
                        e.__size = n,
                        e.__cache = {}
                    }(n),
                    u = function(t) {
                        const n = function() {
                            for (let e = 0; e < o; e++)
                                if (-1 === s.indexOf(e))
                                    return s.push(e),
                                    e;
                            return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),
                            0
                        }();
                        t.__bindingPointIndex = n;
                        const i = e.createBuffer()
                          , r = t.__size
                          , a = t.usage;
                        return e.bindBuffer(e.UNIFORM_BUFFER, i),
                        e.bufferData(e.UNIFORM_BUFFER, r, a),
                        e.bindBuffer(e.UNIFORM_BUFFER, null),
                        e.bindBufferBase(e.UNIFORM_BUFFER, n, i),
                        i
                    }(n),
                    r[n.id] = u,
                    n.addEventListener("dispose", h));
                    const p = d.program;
                    i.updateUBOMapping(n, p);
                    const f = t.render.frame;
                    a[n.id] !== f && (!function(t) {
                        const n = r[t.id]
                          , i = t.uniforms
                          , a = t.__cache;
                        e.bindBuffer(e.UNIFORM_BUFFER, n);
                        for (let t = 0, n = i.length; t < n; t++) {
                            const n = Array.isArray(i[t]) ? i[t] : [i[t]];
                            for (let i = 0, r = n.length; i < r; i++) {
                                const r = n[i];
                                if (!0 === l(r, t, i, a)) {
                                    const t = r.__offset
                                      , n = Array.isArray(r.value) ? r.value : [r.value];
                                    let i = 0;
                                    for (let a = 0; a < n.length; a++) {
                                        const s = n[a]
                                          , o = c(s);
                                        "number" == typeof s || "boolean" == typeof s ? (r.__data[0] = s,
                                        e.bufferSubData(e.UNIFORM_BUFFER, t + i, r.__data)) : s.isMatrix3 ? (r.__data[0] = s.elements[0],
                                        r.__data[1] = s.elements[1],
                                        r.__data[2] = s.elements[2],
                                        r.__data[3] = 0,
                                        r.__data[4] = s.elements[3],
                                        r.__data[5] = s.elements[4],
                                        r.__data[6] = s.elements[5],
                                        r.__data[7] = 0,
                                        r.__data[8] = s.elements[6],
                                        r.__data[9] = s.elements[7],
                                        r.__data[10] = s.elements[8],
                                        r.__data[11] = 0) : (s.toArray(r.__data, i),
                                        i += o.storage / Float32Array.BYTES_PER_ELEMENT)
                                    }
                                    e.bufferSubData(e.UNIFORM_BUFFER, t, r.__data)
                                }
                            }
                        }
                        e.bindBuffer(e.UNIFORM_BUFFER, null)
                    }(n),
                    a[n.id] = f)
                },
                dispose: function() {
                    for (const t in r)
                        e.deleteBuffer(r[t]);
                    s = [],
                    r = {},
                    a = {}
                }
            }
        }
        class eu {
            constructor(e={}) {
                const {canvas: t=Zt(), context: n=null, depth: i=!0, stencil: r=!1, alpha: a=!1, antialias: s=!1, premultipliedAlpha: o=!0, preserveDrawingBuffer: l=!1, powerPreference: c="default", failIfMajorPerformanceCaveat: h=!1, reverseDepthBuffer: d=!1} = e;
                let u;
                if (this.isWebGLRenderer = !0,
                null !== n) {
                    if ("undefined" != typeof WebGLRenderingContext && n instanceof WebGLRenderingContext)
                        throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");
                    u = n.getContextAttributes().alpha
                } else
                    u = a;
                const p = new Uint32Array(4)
                  , f = new Int32Array(4);
                let m = null
                  , v = null;
                const w = []
                  , y = [];
                this.domElement = t,
                this.debug = {
                    checkShaderErrors: !0,
                    onShaderError: null
                },
                this.autoClear = !0,
                this.autoClearColor = !0,
                this.autoClearDepth = !0,
                this.autoClearStencil = !0,
                this.sortObjects = !0,
                this.clippingPlanes = [],
                this.localClippingEnabled = !1,
                this._outputColorSpace = vt,
                this.toneMapping = 0,
                this.toneMappingExposure = 1;
                const b = this;
                let A = !1
                  , x = 0
                  , k = 0
                  , E = null
                  , S = -1
                  , M = null;
                const _ = new fn
                  , T = new fn;
                let C = null;
                const P = new Hi(0);
                let I = 0
                  , R = t.width
                  , L = t.height
                  , D = 1
                  , N = null
                  , B = null;
                const U = new fn(0,0,R,L)
                  , z = new fn(0,0,R,L);
                let O = !1;
                const F = new ba;
                let W = !1
                  , H = !1;
                this.transmissionResolutionScale = 1;
                const V = new Xn
                  , G = new Xn
                  , j = new bn
                  , Q = new fn
                  , K = {
                    background: null,
                    fog: null,
                    environment: null,
                    overrideMaterial: null,
                    isScene: !0
                };
                let q = !1;
                function Y() {
                    return null === E ? D : 1
                }
                let X, Z, J, $, ee, te, ne, ie, re, ae, se, oe, le, ce, he, de, ue, me, ge, we, be, Se, Me, _e, Te = n;
                function Ce(e, n) {
                    return t.getContext(e, n)
                }
                try {
                    const e = {
                        alpha: !0,
                        depth: i,
                        stencil: r,
                        antialias: s,
                        premultipliedAlpha: o,
                        preserveDrawingBuffer: l,
                        powerPreference: c,
                        failIfMajorPerformanceCaveat: h
                    };
                    if ("setAttribute"in t && t.setAttribute("data-engine", `three.js r${g}`),
                    t.addEventListener("webglcontextlost", Ne, !1),
                    t.addEventListener("webglcontextrestored", Be, !1),
                    t.addEventListener("webglcontextcreationerror", Ue, !1),
                    null === Te) {
                        const t = "webgl2";
                        if (Te = Ce(t, e),
                        null === Te)
                            throw Ce(t) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context.")
                    }
                } catch (e) {
                    throw console.error("THREE.WebGLRenderer: " + e.message),
                    e
                }
                function Le() {
                    X = new Zc(Te),
                    X.init(),
                    Se = new Kd(Te,X),
                    Z = new Cc(Te,X,e,Se),
                    J = new jd(Te,X),
                    Z.reverseDepthBuffer && d && J.buffers.depth.setReversed(!0),
                    $ = new eh(Te),
                    ee = new Rd,
                    te = new Qd(Te,X,J,ee,Z,Se,$),
                    ne = new Ic(b),
                    ie = new Xc(b),
                    re = new yc(Te),
                    Me = new _c(Te,re),
                    ae = new Jc(Te,re,$,Me),
                    se = new nh(Te,ae,re,$),
                    ge = new th(Te,Z,te),
                    de = new Pc(ee),
                    oe = new Id(b,ne,ie,X,Z,Me,de),
                    le = new Jd(b,ee),
                    ce = new Bd,
                    he = new Hd(X),
                    me = new Mc(b,ne,ie,J,se,u,o),
                    ue = new Vd(b,se,Z),
                    _e = new $d(Te,$,Z,J),
                    we = new Tc(Te,X,$),
                    be = new $c(Te,X,$),
                    $.programs = oe.programs,
                    b.capabilities = Z,
                    b.extensions = X,
                    b.properties = ee,
                    b.renderLists = ce,
                    b.shadowMap = ue,
                    b.state = J,
                    b.info = $
                }
                Le();
                const De = new Yd(b,Te);
                function Ne(e) {
                    e.preventDefault(),
                    console.log("THREE.WebGLRenderer: Context Lost."),
                    A = !0
                }
                function Be() {
                    console.log("THREE.WebGLRenderer: Context Restored."),
                    A = !1;
                    const e = $.autoReset
                      , t = ue.enabled
                      , n = ue.autoUpdate
                      , i = ue.needsUpdate
                      , r = ue.type;
                    Le(),
                    $.autoReset = e,
                    ue.enabled = t,
                    ue.autoUpdate = n,
                    ue.needsUpdate = i,
                    ue.type = r
                }
                function Ue(e) {
                    console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ", e.statusMessage)
                }
                function ze(e) {
                    const t = e.target;
                    t.removeEventListener("dispose", ze),
                    function(e) {
                        (function(e) {
                            const t = ee.get(e).programs;
                            void 0 !== t && (t.forEach((function(e) {
                                oe.releaseProgram(e)
                            }
                            )),
                            e.isShaderMaterial && oe.releaseShaderCache(e))
                        }
                        )(e),
                        ee.remove(e)
                    }(t)
                }
                function Oe(e, t, n) {
                    !0 === e.transparent && 2 === e.side && !1 === e.forceSinglePass ? (e.side = 1,
                    e.needsUpdate = !0,
                    Ye(e, t, n),
                    e.side = 0,
                    e.needsUpdate = !0,
                    Ye(e, t, n),
                    e.side = 2) : Ye(e, t, n)
                }
                this.xr = De,
                this.getContext = function() {
                    return Te
                }
                ,
                this.getContextAttributes = function() {
                    return Te.getContextAttributes()
                }
                ,
                this.forceContextLoss = function() {
                    const e = X.get("WEBGL_lose_context");
                    e && e.loseContext()
                }
                ,
                this.forceContextRestore = function() {
                    const e = X.get("WEBGL_lose_context");
                    e && e.restoreContext()
                }
                ,
                this.getPixelRatio = function() {
                    return D
                }
                ,
                this.setPixelRatio = function(e) {
                    void 0 !== e && (D = e,
                    this.setSize(R, L, !1))
                }
                ,
                this.getSize = function(e) {
                    return e.set(R, L)
                }
                ,
                this.setSize = function(e, n, i=!0) {
                    De.isPresenting ? console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.") : (R = e,
                    L = n,
                    t.width = Math.floor(e * D),
                    t.height = Math.floor(n * D),
                    !0 === i && (t.style.width = e + "px",
                    t.style.height = n + "px"),
                    this.setViewport(0, 0, e, n))
                }
                ,
                this.getDrawingBufferSize = function(e) {
                    return e.set(R * D, L * D).floor()
                }
                ,
                this.setDrawingBufferSize = function(e, n, i) {
                    R = e,
                    L = n,
                    D = i,
                    t.width = Math.floor(e * i),
                    t.height = Math.floor(n * i),
                    this.setViewport(0, 0, e, n)
                }
                ,
                this.getCurrentViewport = function(e) {
                    return e.copy(_)
                }
                ,
                this.getViewport = function(e) {
                    return e.copy(U)
                }
                ,
                this.setViewport = function(e, t, n, i) {
                    e.isVector4 ? U.set(e.x, e.y, e.z, e.w) : U.set(e, t, n, i),
                    J.viewport(_.copy(U).multiplyScalar(D).round())
                }
                ,
                this.getScissor = function(e) {
                    return e.copy(z)
                }
                ,
                this.setScissor = function(e, t, n, i) {
                    e.isVector4 ? z.set(e.x, e.y, e.z, e.w) : z.set(e, t, n, i),
                    J.scissor(T.copy(z).multiplyScalar(D).round())
                }
                ,
                this.getScissorTest = function() {
                    return O
                }
                ,
                this.setScissorTest = function(e) {
                    J.setScissorTest(O = e)
                }
                ,
                this.setOpaqueSort = function(e) {
                    N = e
                }
                ,
                this.setTransparentSort = function(e) {
                    B = e
                }
                ,
                this.getClearColor = function(e) {
                    return e.copy(me.getClearColor())
                }
                ,
                this.setClearColor = function() {
                    me.setClearColor(...arguments)
                }
                ,
                this.getClearAlpha = function() {
                    return me.getClearAlpha()
                }
                ,
                this.setClearAlpha = function() {
                    me.setClearAlpha(...arguments)
                }
                ,
                this.clear = function(e=!0, t=!0, n=!0) {
                    let i = 0;
                    if (e) {
                        let e = !1;
                        if (null !== E) {
                            const t = E.texture.format;
                            e = t === Re || t === Ie || t === Pe
                        }
                        if (e) {
                            const e = E.texture.type
                              , t = e === fe || e === ye || e === ve || e === Ee || e === xe || e === ke
                              , n = me.getClearColor()
                              , i = me.getClearAlpha()
                              , r = n.r
                              , a = n.g
                              , s = n.b;
                            t ? (p[0] = r,
                            p[1] = a,
                            p[2] = s,
                            p[3] = i,
                            Te.clearBufferuiv(Te.COLOR, 0, p)) : (f[0] = r,
                            f[1] = a,
                            f[2] = s,
                            f[3] = i,
                            Te.clearBufferiv(Te.COLOR, 0, f))
                        } else
                            i |= Te.COLOR_BUFFER_BIT
                    }
                    t && (i |= Te.DEPTH_BUFFER_BIT),
                    n && (i |= Te.STENCIL_BUFFER_BIT,
                    this.state.buffers.stencil.setMask(4294967295)),
                    Te.clear(i)
                }
                ,
                this.clearColor = function() {
                    this.clear(!0, !1, !1)
                }
                ,
                this.clearDepth = function() {
                    this.clear(!1, !0, !1)
                }
                ,
                this.clearStencil = function() {
                    this.clear(!1, !1, !0)
                }
                ,
                this.dispose = function() {
                    t.removeEventListener("webglcontextlost", Ne, !1),
                    t.removeEventListener("webglcontextrestored", Be, !1),
                    t.removeEventListener("webglcontextcreationerror", Ue, !1),
                    me.dispose(),
                    ce.dispose(),
                    he.dispose(),
                    ee.dispose(),
                    ne.dispose(),
                    ie.dispose(),
                    se.dispose(),
                    Me.dispose(),
                    _e.dispose(),
                    oe.dispose(),
                    De.dispose(),
                    De.removeEventListener("sessionstart", We),
                    De.removeEventListener("sessionend", He),
                    Ve.stop()
                }
                ,
                this.renderBufferDirect = function(e, t, n, i, r, a) {
                    null === t && (t = K);
                    const s = r.isMesh && r.matrixWorld.determinant() < 0
                      , o = function(e, t, n, i, r) {
                        !0 !== t.isScene && (t = K);
                        te.resetTextureUnits();
                        const a = t.fog
                          , s = i.isMeshStandardMaterial ? t.environment : null
                          , o = null === E ? b.outputColorSpace : !0 === E.isXRRenderTarget ? E.texture.colorSpace : wt
                          , l = (i.isMeshStandardMaterial ? ie : ne).get(i.envMap || s)
                          , c = !0 === i.vertexColors && !!n.attributes.color && 4 === n.attributes.color.itemSize
                          , h = !!n.attributes.tangent && (!!i.normalMap || i.anisotropy > 0)
                          , d = !!n.morphAttributes.position
                          , u = !!n.morphAttributes.normal
                          , p = !!n.morphAttributes.color;
                        let f = 0;
                        i.toneMapped && (null !== E && !0 !== E.isXRRenderTarget || (f = b.toneMapping));
                        const m = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color
                          , g = void 0 !== m ? m.length : 0
                          , w = ee.get(i)
                          , y = v.state.lights;
                        if (!0 === W && (!0 === H || e !== M)) {
                            const t = e === M && i.id === S;
                            de.setState(i, e, t)
                        }
                        let A = !1;
                        i.version === w.__version ? w.needsLights && w.lightsStateVersion !== y.state.version || w.outputColorSpace !== o || r.isBatchedMesh && !1 === w.batching ? A = !0 : r.isBatchedMesh || !0 !== w.batching ? r.isBatchedMesh && !0 === w.batchingColor && null === r.colorTexture || r.isBatchedMesh && !1 === w.batchingColor && null !== r.colorTexture || r.isInstancedMesh && !1 === w.instancing ? A = !0 : r.isInstancedMesh || !0 !== w.instancing ? r.isSkinnedMesh && !1 === w.skinning ? A = !0 : r.isSkinnedMesh || !0 !== w.skinning ? r.isInstancedMesh && !0 === w.instancingColor && null === r.instanceColor || r.isInstancedMesh && !1 === w.instancingColor && null !== r.instanceColor || r.isInstancedMesh && !0 === w.instancingMorph && null === r.morphTexture || r.isInstancedMesh && !1 === w.instancingMorph && null !== r.morphTexture || w.envMap !== l || !0 === i.fog && w.fog !== a ? A = !0 : void 0 === w.numClippingPlanes || w.numClippingPlanes === de.numPlanes && w.numIntersection === de.numIntersection ? (w.vertexAlphas !== c || w.vertexTangents !== h || w.morphTargets !== d || w.morphNormals !== u || w.morphColors !== p || w.toneMapping !== f || w.morphTargetsCount !== g) && (A = !0) : A = !0 : A = !0 : A = !0 : A = !0 : (A = !0,
                        w.__version = i.version);
                        let x = w.currentProgram;
                        !0 === A && (x = Ye(i, t, r));
                        let k = !1
                          , _ = !1
                          , T = !1;
                        const C = x.getUniforms()
                          , P = w.uniforms;
                        J.useProgram(x.program) && (k = !0,
                        _ = !0,
                        T = !0);
                        i.id !== S && (S = i.id,
                        _ = !0);
                        if (k || M !== e) {
                            J.buffers.depth.getReversed() ? (V.copy(e.projectionMatrix),
                            function(e) {
                                const t = e.elements;
                                t[2] = .5 * t[2] + .5 * t[3],
                                t[6] = .5 * t[6] + .5 * t[7],
                                t[10] = .5 * t[10] + .5 * t[11],
                                t[14] = .5 * t[14] + .5 * t[15]
                            }(V),
                            function(e) {
                                const t = e.elements;
                                -1 === t[11] ? (t[10] = -t[10] - 1,
                                t[14] = -t[14]) : (t[10] = -t[10],
                                t[14] = 1 - t[14])
                            }(V),
                            C.setValue(Te, "projectionMatrix", V)) : C.setValue(Te, "projectionMatrix", e.projectionMatrix),
                            C.setValue(Te, "viewMatrix", e.matrixWorldInverse);
                            const t = C.map.cameraPosition;
                            void 0 !== t && t.setValue(Te, j.setFromMatrixPosition(e.matrixWorld)),
                            Z.logarithmicDepthBuffer && C.setValue(Te, "logDepthBufFC", 2 / (Math.log(e.far + 1) / Math.LN2)),
                            (i.isMeshPhongMaterial || i.isMeshToonMaterial || i.isMeshLambertMaterial || i.isMeshBasicMaterial || i.isMeshStandardMaterial || i.isShaderMaterial) && C.setValue(Te, "isOrthographic", !0 === e.isOrthographicCamera),
                            M !== e && (M = e,
                            _ = !0,
                            T = !0)
                        }
                        if (r.isSkinnedMesh) {
                            C.setOptional(Te, r, "bindMatrix"),
                            C.setOptional(Te, r, "bindMatrixInverse");
                            const e = r.skeleton;
                            e && (null === e.boneTexture && e.computeBoneTexture(),
                            C.setValue(Te, "boneTexture", e.boneTexture, te))
                        }
                        r.isBatchedMesh && (C.setOptional(Te, r, "batchingTexture"),
                        C.setValue(Te, "batchingTexture", r._matricesTexture, te),
                        C.setOptional(Te, r, "batchingIdTexture"),
                        C.setValue(Te, "batchingIdTexture", r._indirectTexture, te),
                        C.setOptional(Te, r, "batchingColorTexture"),
                        null !== r._colorsTexture && C.setValue(Te, "batchingColorTexture", r._colorsTexture, te));
                        const I = n.morphAttributes;
                        void 0 === I.position && void 0 === I.normal && void 0 === I.color || ge.update(r, n, x);
                        (_ || w.receiveShadow !== r.receiveShadow) && (w.receiveShadow = r.receiveShadow,
                        C.setValue(Te, "receiveShadow", r.receiveShadow));
                        i.isMeshGouraudMaterial && null !== i.envMap && (P.envMap.value = l,
                        P.flipEnvMap.value = l.isCubeTexture && !1 === l.isRenderTargetTexture ? -1 : 1);
                        i.isMeshStandardMaterial && null === i.envMap && null !== t.environment && (P.envMapIntensity.value = t.environmentIntensity);
                        _ && (C.setValue(Te, "toneMappingExposure", b.toneMappingExposure),
                        w.needsLights && (N = T,
                        (R = P).ambientLightColor.needsUpdate = N,
                        R.lightProbe.needsUpdate = N,
                        R.directionalLights.needsUpdate = N,
                        R.directionalLightShadows.needsUpdate = N,
                        R.pointLights.needsUpdate = N,
                        R.pointLightShadows.needsUpdate = N,
                        R.spotLights.needsUpdate = N,
                        R.spotLightShadows.needsUpdate = N,
                        R.rectAreaLights.needsUpdate = N,
                        R.hemisphereLights.needsUpdate = N),
                        a && !0 === i.fog && le.refreshFogUniforms(P, a),
                        le.refreshMaterialUniforms(P, i, D, L, v.state.transmissionRenderTarget[e.id]),
                        od.upload(Te, Xe(w), P, te));
                        var R, N;
                        i.isShaderMaterial && !0 === i.uniformsNeedUpdate && (od.upload(Te, Xe(w), P, te),
                        i.uniformsNeedUpdate = !1);
                        i.isSpriteMaterial && C.setValue(Te, "center", r.center);
                        if (C.setValue(Te, "modelViewMatrix", r.modelViewMatrix),
                        C.setValue(Te, "normalMatrix", r.normalMatrix),
                        C.setValue(Te, "modelMatrix", r.matrixWorld),
                        i.isShaderMaterial || i.isRawShaderMaterial) {
                            const e = i.uniformsGroups;
                            for (let t = 0, n = e.length; t < n; t++) {
                                const n = e[t];
                                _e.update(n, x),
                                _e.bind(n, x)
                            }
                        }
                        return x
                    }(e, t, n, i, r);
                    J.setMaterial(i, s);
                    let l = n.index
                      , c = 1;
                    if (!0 === i.wireframe) {
                        if (l = ae.getWireframeAttribute(n),
                        void 0 === l)
                            return;
                        c = 2
                    }
                    const h = n.drawRange
                      , d = n.attributes.position;
                    let u = h.start * c
                      , p = (h.start + h.count) * c;
                    null !== a && (u = Math.max(u, a.start * c),
                    p = Math.min(p, (a.start + a.count) * c)),
                    null !== l ? (u = Math.max(u, 0),
                    p = Math.min(p, l.count)) : null != d && (u = Math.max(u, 0),
                    p = Math.min(p, d.count));
                    const f = p - u;
                    if (f < 0 || f === 1 / 0)
                        return;
                    let m;
                    Me.setup(r, i, o, n, l);
                    let g = we;
                    if (null !== l && (m = re.get(l),
                    g = be,
                    g.setIndex(m)),
                    r.isMesh)
                        !0 === i.wireframe ? (J.setLineWidth(i.wireframeLinewidth * Y()),
                        g.setMode(Te.LINES)) : g.setMode(Te.TRIANGLES);
                    else if (r.isLine) {
                        let e = i.linewidth;
                        void 0 === e && (e = 1),
                        J.setLineWidth(e * Y()),
                        r.isLineSegments ? g.setMode(Te.LINES) : r.isLineLoop ? g.setMode(Te.LINE_LOOP) : g.setMode(Te.LINE_STRIP)
                    } else
                        r.isPoints ? g.setMode(Te.POINTS) : r.isSprite && g.setMode(Te.TRIANGLES);
                    if (r.isBatchedMesh)
                        if (null !== r._multiDrawInstances)
                            $t("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),
                            g.renderMultiDrawInstances(r._multiDrawStarts, r._multiDrawCounts, r._multiDrawCount, r._multiDrawInstances);
                        else if (X.get("WEBGL_multi_draw"))
                            g.renderMultiDraw(r._multiDrawStarts, r._multiDrawCounts, r._multiDrawCount);
                        else {
                            const e = r._multiDrawStarts
                              , t = r._multiDrawCounts
                              , n = r._multiDrawCount
                              , a = l ? re.get(l).bytesPerElement : 1
                              , s = ee.get(i).currentProgram.getUniforms();
                            for (let i = 0; i < n; i++)
                                s.setValue(Te, "_gl_DrawID", i),
                                g.render(e[i] / a, t[i])
                        }
                    else if (r.isInstancedMesh)
                        g.renderInstances(u, f, r.count);
                    else if (n.isInstancedBufferGeometry) {
                        const e = void 0 !== n._maxInstanceCount ? n._maxInstanceCount : 1 / 0
                          , t = Math.min(n.instanceCount, e);
                        g.renderInstances(u, f, t)
                    } else
                        g.render(u, f)
                }
                ,
                this.compile = function(e, t, n=null) {
                    null === n && (n = e),
                    v = he.get(n),
                    v.init(t),
                    y.push(v),
                    n.traverseVisible((function(e) {
                        e.isLight && e.layers.test(t.layers) && (v.pushLight(e),
                        e.castShadow && v.pushShadow(e))
                    }
                    )),
                    e !== n && e.traverseVisible((function(e) {
                        e.isLight && e.layers.test(t.layers) && (v.pushLight(e),
                        e.castShadow && v.pushShadow(e))
                    }
                    )),
                    v.setupLights();
                    const i = new Set;
                    return e.traverse((function(e) {
                        if (!(e.isMesh || e.isPoints || e.isLine || e.isSprite))
                            return;
                        const t = e.material;
                        if (t)
                            if (Array.isArray(t))
                                for (let r = 0; r < t.length; r++) {
                                    const a = t[r];
                                    Oe(a, n, e),
                                    i.add(a)
                                }
                            else
                                Oe(t, n, e),
                                i.add(t)
                    }
                    )),
                    v = y.pop(),
                    i
                }
                ,
                this.compileAsync = function(e, t, n=null) {
                    const i = this.compile(e, t, n);
                    return new Promise((t => {
                        function n() {
                            i.forEach((function(e) {
                                ee.get(e).currentProgram.isReady() && i.delete(e)
                            }
                            )),
                            0 !== i.size ? setTimeout(n, 10) : t(e)
                        }
                        null !== X.get("KHR_parallel_shader_compile") ? n() : setTimeout(n, 10)
                    }
                    ))
                }
                ;
                let Fe = null;
                function We() {
                    Ve.stop()
                }
                function He() {
                    Ve.start()
                }
                const Ve = new wc;
                function Ge(e, t, n, i) {
                    if (!1 === e.visible)
                        return;
                    if (e.layers.test(t.layers))
                        if (e.isGroup)
                            n = e.renderOrder;
                        else if (e.isLOD)
                            !0 === e.autoUpdate && e.update(t);
                        else if (e.isLight)
                            v.pushLight(e),
                            e.castShadow && v.pushShadow(e);
                        else if (e.isSprite) {
                            if (!e.frustumCulled || F.intersectsSprite(e)) {
                                i && Q.setFromMatrixPosition(e.matrixWorld).applyMatrix4(G);
                                const t = se.update(e)
                                  , r = e.material;
                                r.visible && m.push(e, t, r, n, Q.z, null)
                            }
                        } else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || F.intersectsObject(e))) {
                            const t = se.update(e)
                              , r = e.material;
                            if (i && (void 0 !== e.boundingSphere ? (null === e.boundingSphere && e.computeBoundingSphere(),
                            Q.copy(e.boundingSphere.center)) : (null === t.boundingSphere && t.computeBoundingSphere(),
                            Q.copy(t.boundingSphere.center)),
                            Q.applyMatrix4(e.matrixWorld).applyMatrix4(G)),
                            Array.isArray(r)) {
                                const i = t.groups;
                                for (let a = 0, s = i.length; a < s; a++) {
                                    const s = i[a]
                                      , o = r[s.materialIndex];
                                    o && o.visible && m.push(e, t, o, n, Q.z, s)
                                }
                            } else
                                r.visible && m.push(e, t, r, n, Q.z, null)
                        }
                    const r = e.children;
                    for (let e = 0, a = r.length; e < a; e++)
                        Ge(r[e], t, n, i)
                }
                function je(e, t, n, i) {
                    const r = e.opaque
                      , a = e.transmissive
                      , s = e.transparent;
                    v.setupLightsView(n),
                    !0 === W && de.setGlobalState(b.clippingPlanes, n),
                    i && J.viewport(_.copy(i)),
                    r.length > 0 && Ke(r, t, n),
                    a.length > 0 && Ke(a, t, n),
                    s.length > 0 && Ke(s, t, n),
                    J.buffers.depth.setTest(!0),
                    J.buffers.depth.setMask(!0),
                    J.buffers.color.setMask(!0),
                    J.setPolygonOffset(!1)
                }
                function Qe(e, t, n, i) {
                    if (null !== (!0 === n.isScene ? n.overrideMaterial : null))
                        return;
                    void 0 === v.state.transmissionRenderTarget[i.id] && (v.state.transmissionRenderTarget[i.id] = new gn(1,1,{
                        generateMipmaps: !0,
                        type: X.has("EXT_color_buffer_half_float") || X.has("EXT_color_buffer_float") ? Ae : fe,
                        minFilter: pe,
                        samples: 4,
                        stencilBuffer: r,
                        resolveDepthBuffer: !1,
                        resolveStencilBuffer: !1,
                        colorSpace: rn.workingColorSpace
                    }));
                    const a = v.state.transmissionRenderTarget[i.id]
                      , s = i.viewport || _;
                    a.setSize(s.z * b.transmissionResolutionScale, s.w * b.transmissionResolutionScale);
                    const o = b.getRenderTarget();
                    b.setRenderTarget(a),
                    b.getClearColor(P),
                    I = b.getClearAlpha(),
                    I < 1 && b.setClearColor(16777215, .5),
                    b.clear(),
                    q && me.render(n);
                    const l = b.toneMapping;
                    b.toneMapping = 0;
                    const c = i.viewport;
                    if (void 0 !== i.viewport && (i.viewport = void 0),
                    v.setupLightsView(i),
                    !0 === W && de.setGlobalState(b.clippingPlanes, i),
                    Ke(e, n, i),
                    te.updateMultisampleRenderTarget(a),
                    te.updateRenderTargetMipmap(a),
                    !1 === X.has("WEBGL_multisampled_render_to_texture")) {
                        let e = !1;
                        for (let r = 0, a = t.length; r < a; r++) {
                            const a = t[r]
                              , s = a.object
                              , o = a.geometry
                              , l = a.material
                              , c = a.group;
                            if (2 === l.side && s.layers.test(i.layers)) {
                                const t = l.side;
                                l.side = 1,
                                l.needsUpdate = !0,
                                qe(s, n, i, o, l, c),
                                l.side = t,
                                l.needsUpdate = !0,
                                e = !0
                            }
                        }
                        !0 === e && (te.updateMultisampleRenderTarget(a),
                        te.updateRenderTargetMipmap(a))
                    }
                    b.setRenderTarget(o),
                    b.setClearColor(P, I),
                    void 0 !== c && (i.viewport = c),
                    b.toneMapping = l
                }
                function Ke(e, t, n) {
                    const i = !0 === t.isScene ? t.overrideMaterial : null;
                    for (let r = 0, a = e.length; r < a; r++) {
                        const a = e[r]
                          , s = a.object
                          , o = a.geometry
                          , l = null === i ? a.material : i
                          , c = a.group;
                        s.layers.test(n.layers) && qe(s, t, n, o, l, c)
                    }
                }
                function qe(e, t, n, i, r, a) {
                    e.onBeforeRender(b, t, n, i, r, a),
                    e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse, e.matrixWorld),
                    e.normalMatrix.getNormalMatrix(e.modelViewMatrix),
                    r.onBeforeRender(b, t, n, i, e, a),
                    !0 === r.transparent && 2 === r.side && !1 === r.forceSinglePass ? (r.side = 1,
                    r.needsUpdate = !0,
                    b.renderBufferDirect(n, t, i, r, e, a),
                    r.side = 0,
                    r.needsUpdate = !0,
                    b.renderBufferDirect(n, t, i, r, e, a),
                    r.side = 2) : b.renderBufferDirect(n, t, i, r, e, a),
                    e.onAfterRender(b, t, n, i, r, a)
                }
                function Ye(e, t, n) {
                    !0 !== t.isScene && (t = K);
                    const i = ee.get(e)
                      , r = v.state.lights
                      , a = v.state.shadowsArray
                      , s = r.state.version
                      , o = oe.getParameters(e, r.state, a, t, n)
                      , l = oe.getProgramCacheKey(o);
                    let c = i.programs;
                    i.environment = e.isMeshStandardMaterial ? t.environment : null,
                    i.fog = t.fog,
                    i.envMap = (e.isMeshStandardMaterial ? ie : ne).get(e.envMap || i.environment),
                    i.envMapRotation = null !== i.environment && null === e.envMap ? t.environmentRotation : e.envMapRotation,
                    void 0 === c && (e.addEventListener("dispose", ze),
                    c = new Map,
                    i.programs = c);
                    let h = c.get(l);
                    if (void 0 !== h) {
                        if (i.currentProgram === h && i.lightsStateVersion === s)
                            return Ze(e, o),
                            h
                    } else
                        o.uniforms = oe.getUniforms(e),
                        e.onBeforeCompile(o, b),
                        h = oe.acquireProgram(o, l),
                        c.set(l, h),
                        i.uniforms = o.uniforms;
                    const d = i.uniforms;
                    return (e.isShaderMaterial || e.isRawShaderMaterial) && !0 !== e.clipping || (d.clippingPlanes = de.uniform),
                    Ze(e, o),
                    i.needsLights = function(e) {
                        return e.isMeshLambertMaterial || e.isMeshToonMaterial || e.isMeshPhongMaterial || e.isMeshStandardMaterial || e.isShadowMaterial || e.isShaderMaterial && !0 === e.lights
                    }(e),
                    i.lightsStateVersion = s,
                    i.needsLights && (d.ambientLightColor.value = r.state.ambient,
                    d.lightProbe.value = r.state.probe,
                    d.directionalLights.value = r.state.directional,
                    d.directionalLightShadows.value = r.state.directionalShadow,
                    d.spotLights.value = r.state.spot,
                    d.spotLightShadows.value = r.state.spotShadow,
                    d.rectAreaLights.value = r.state.rectArea,
                    d.ltc_1.value = r.state.rectAreaLTC1,
                    d.ltc_2.value = r.state.rectAreaLTC2,
                    d.pointLights.value = r.state.point,
                    d.pointLightShadows.value = r.state.pointShadow,
                    d.hemisphereLights.value = r.state.hemi,
                    d.directionalShadowMap.value = r.state.directionalShadowMap,
                    d.directionalShadowMatrix.value = r.state.directionalShadowMatrix,
                    d.spotShadowMap.value = r.state.spotShadowMap,
                    d.spotLightMatrix.value = r.state.spotLightMatrix,
                    d.spotLightMap.value = r.state.spotLightMap,
                    d.pointShadowMap.value = r.state.pointShadowMap,
                    d.pointShadowMatrix.value = r.state.pointShadowMatrix),
                    i.currentProgram = h,
                    i.uniformsList = null,
                    h
                }
                function Xe(e) {
                    if (null === e.uniformsList) {
                        const t = e.currentProgram.getUniforms();
                        e.uniformsList = od.seqWithValue(t.seq, e.uniforms)
                    }
                    return e.uniformsList
                }
                function Ze(e, t) {
                    const n = ee.get(e);
                    n.outputColorSpace = t.outputColorSpace,
                    n.batching = t.batching,
                    n.batchingColor = t.batchingColor,
                    n.instancing = t.instancing,
                    n.instancingColor = t.instancingColor,
                    n.instancingMorph = t.instancingMorph,
                    n.skinning = t.skinning,
                    n.morphTargets = t.morphTargets,
                    n.morphNormals = t.morphNormals,
                    n.morphColors = t.morphColors,
                    n.morphTargetsCount = t.morphTargetsCount,
                    n.numClippingPlanes = t.numClippingPlanes,
                    n.numIntersection = t.numClipIntersection,
                    n.vertexAlphas = t.vertexAlphas,
                    n.vertexTangents = t.vertexTangents,
                    n.toneMapping = t.toneMapping
                }
                Ve.setAnimationLoop((function(e) {
                    Fe && Fe(e)
                }
                )),
                "undefined" != typeof self && Ve.setContext(self),
                this.setAnimationLoop = function(e) {
                    Fe = e,
                    De.setAnimationLoop(e),
                    null === e ? Ve.stop() : Ve.start()
                }
                ,
                De.addEventListener("sessionstart", We),
                De.addEventListener("sessionend", He),
                this.render = function(e, t) {
                    if (void 0 !== t && !0 !== t.isCamera)
                        return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
                    if (!0 === A)
                        return;
                    if (!0 === e.matrixWorldAutoUpdate && e.updateMatrixWorld(),
                    null === t.parent && !0 === t.matrixWorldAutoUpdate && t.updateMatrixWorld(),
                    !0 === De.enabled && !0 === De.isPresenting && (!0 === De.cameraAutoUpdate && De.updateCamera(t),
                    t = De.getCamera()),
                    !0 === e.isScene && e.onBeforeRender(b, e, t, E),
                    v = he.get(e, y.length),
                    v.init(t),
                    y.push(v),
                    G.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
                    F.setFromProjectionMatrix(G),
                    H = this.localClippingEnabled,
                    W = de.init(this.clippingPlanes, H),
                    m = ce.get(e, w.length),
                    m.init(),
                    w.push(m),
                    !0 === De.enabled && !0 === De.isPresenting) {
                        const e = b.xr.getDepthSensingMesh();
                        null !== e && Ge(e, t, -1 / 0, b.sortObjects)
                    }
                    Ge(e, t, 0, b.sortObjects),
                    m.finish(),
                    !0 === b.sortObjects && m.sort(N, B),
                    q = !1 === De.enabled || !1 === De.isPresenting || !1 === De.hasDepthSensing(),
                    q && me.addToRenderList(m, e),
                    this.info.render.frame++,
                    !0 === W && de.beginShadows();
                    const n = v.state.shadowsArray;
                    ue.render(n, e, t),
                    !0 === W && de.endShadows(),
                    !0 === this.info.autoReset && this.info.reset();
                    const i = m.opaque
                      , r = m.transmissive;
                    if (v.setupLights(),
                    t.isArrayCamera) {
                        const n = t.cameras;
                        if (r.length > 0)
                            for (let t = 0, a = n.length; t < a; t++) {
                                Qe(i, r, e, n[t])
                            }
                        q && me.render(e);
                        for (let t = 0, i = n.length; t < i; t++) {
                            const i = n[t];
                            je(m, e, i, i.viewport)
                        }
                    } else
                        r.length > 0 && Qe(i, r, e, t),
                        q && me.render(e),
                        je(m, e, t);
                    null !== E && 0 === k && (te.updateMultisampleRenderTarget(E),
                    te.updateRenderTargetMipmap(E)),
                    !0 === e.isScene && e.onAfterRender(b, e, t),
                    Me.resetDefaultState(),
                    S = -1,
                    M = null,
                    y.pop(),
                    y.length > 0 ? (v = y[y.length - 1],
                    !0 === W && de.setGlobalState(b.clippingPlanes, v.state.camera)) : v = null,
                    w.pop(),
                    m = w.length > 0 ? w[w.length - 1] : null
                }
                ,
                this.getActiveCubeFace = function() {
                    return x
                }
                ,
                this.getActiveMipmapLevel = function() {
                    return k
                }
                ,
                this.getRenderTarget = function() {
                    return E
                }
                ,
                this.setRenderTargetTextures = function(e, t, n) {
                    ee.get(e.texture).__webglTexture = t,
                    ee.get(e.depthTexture).__webglTexture = n;
                    const i = ee.get(e);
                    i.__hasExternalTextures = !0,
                    i.__autoAllocateDepthBuffer = void 0 === n,
                    i.__autoAllocateDepthBuffer || !0 === X.has("WEBGL_multisampled_render_to_texture") && (console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),
                    i.__useRenderToTexture = !1)
                }
                ,
                this.setRenderTargetFramebuffer = function(e, t) {
                    const n = ee.get(e);
                    n.__webglFramebuffer = t,
                    n.__useDefaultFramebuffer = void 0 === t
                }
                ;
                const Je = Te.createFramebuffer();
                this.setRenderTarget = function(e, t=0, n=0) {
                    E = e,
                    x = t,
                    k = n;
                    let i = !0
                      , r = null
                      , a = !1
                      , s = !1;
                    if (e) {
                        const o = ee.get(e);
                        if (void 0 !== o.__useDefaultFramebuffer)
                            J.bindFramebuffer(Te.FRAMEBUFFER, null),
                            i = !1;
                        else if (void 0 === o.__webglFramebuffer)
                            te.setupRenderTarget(e);
                        else if (o.__hasExternalTextures)
                            te.rebindTextures(e, ee.get(e.texture).__webglTexture, ee.get(e.depthTexture).__webglTexture);
                        else if (e.depthBuffer) {
                            const t = e.depthTexture;
                            if (o.__boundDepthTexture !== t) {
                                if (null !== t && ee.has(t) && (e.width !== t.image.width || e.height !== t.image.height))
                                    throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");
                                te.setupDepthRenderbuffer(e)
                            }
                        }
                        const l = e.texture;
                        (l.isData3DTexture || l.isDataArrayTexture || l.isCompressedArrayTexture) && (s = !0);
                        const c = ee.get(e).__webglFramebuffer;
                        e.isWebGLCubeRenderTarget ? (r = Array.isArray(c[t]) ? c[t][n] : c[t],
                        a = !0) : r = e.samples > 0 && !1 === te.useMultisampledRTT(e) ? ee.get(e).__webglMultisampledFramebuffer : Array.isArray(c) ? c[n] : c,
                        _.copy(e.viewport),
                        T.copy(e.scissor),
                        C = e.scissorTest
                    } else
                        _.copy(U).multiplyScalar(D).floor(),
                        T.copy(z).multiplyScalar(D).floor(),
                        C = O;
                    0 !== n && (r = Je);
                    if (J.bindFramebuffer(Te.FRAMEBUFFER, r) && i && J.drawBuffers(e, r),
                    J.viewport(_),
                    J.scissor(T),
                    J.setScissorTest(C),
                    a) {
                        const i = ee.get(e.texture);
                        Te.framebufferTexture2D(Te.FRAMEBUFFER, Te.COLOR_ATTACHMENT0, Te.TEXTURE_CUBE_MAP_POSITIVE_X + t, i.__webglTexture, n)
                    } else if (s) {
                        const i = ee.get(e.texture)
                          , r = t;
                        Te.framebufferTextureLayer(Te.FRAMEBUFFER, Te.COLOR_ATTACHMENT0, i.__webglTexture, n, r)
                    } else if (null !== e && 0 !== n) {
                        const t = ee.get(e.texture);
                        Te.framebufferTexture2D(Te.FRAMEBUFFER, Te.COLOR_ATTACHMENT0, Te.TEXTURE_2D, t.__webglTexture, n)
                    }
                    S = -1
                }
                ,
                this.readRenderTargetPixels = function(e, t, n, i, r, a, s) {
                    if (!e || !e.isWebGLRenderTarget)
                        return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
                    let o = ee.get(e).__webglFramebuffer;
                    if (e.isWebGLCubeRenderTarget && void 0 !== s && (o = o[s]),
                    o) {
                        J.bindFramebuffer(Te.FRAMEBUFFER, o);
                        try {
                            const s = e.texture
                              , o = s.format
                              , l = s.type;
                            if (!Z.textureFormatReadable(o))
                                return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
                            if (!Z.textureTypeReadable(l))
                                return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
                            t >= 0 && t <= e.width - i && n >= 0 && n <= e.height - r && Te.readPixels(t, n, i, r, Se.convert(o), Se.convert(l), a)
                        } finally {
                            const e = null !== E ? ee.get(E).__webglFramebuffer : null;
                            J.bindFramebuffer(Te.FRAMEBUFFER, e)
                        }
                    }
                }
                ,
                this.readRenderTargetPixelsAsync = async function(e, t, n, i, r, a, s) {
                    if (!e || !e.isWebGLRenderTarget)
                        throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
                    let o = ee.get(e).__webglFramebuffer;
                    if (e.isWebGLCubeRenderTarget && void 0 !== s && (o = o[s]),
                    o) {
                        const s = e.texture
                          , l = s.format
                          , c = s.type;
                        if (!Z.textureFormatReadable(l))
                            throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");
                        if (!Z.textureTypeReadable(c))
                            throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");
                        if (t >= 0 && t <= e.width - i && n >= 0 && n <= e.height - r) {
                            J.bindFramebuffer(Te.FRAMEBUFFER, o);
                            const e = Te.createBuffer();
                            Te.bindBuffer(Te.PIXEL_PACK_BUFFER, e),
                            Te.bufferData(Te.PIXEL_PACK_BUFFER, a.byteLength, Te.STREAM_READ),
                            Te.readPixels(t, n, i, r, Se.convert(l), Se.convert(c), 0);
                            const s = null !== E ? ee.get(E).__webglFramebuffer : null;
                            J.bindFramebuffer(Te.FRAMEBUFFER, s);
                            const h = Te.fenceSync(Te.SYNC_GPU_COMMANDS_COMPLETE, 0);
                            return Te.flush(),
                            await function(e, t, n) {
                                return new Promise((function(i, r) {
                                    setTimeout((function a() {
                                        switch (e.clientWaitSync(t, e.SYNC_FLUSH_COMMANDS_BIT, 0)) {
                                        case e.WAIT_FAILED:
                                            r();
                                            break;
                                        case e.TIMEOUT_EXPIRED:
                                            setTimeout(a, n);
                                            break;
                                        default:
                                            i()
                                        }
                                    }
                                    ), n)
                                }
                                ))
                            }(Te, h, 4),
                            Te.bindBuffer(Te.PIXEL_PACK_BUFFER, e),
                            Te.getBufferSubData(Te.PIXEL_PACK_BUFFER, 0, a),
                            Te.deleteBuffer(e),
                            Te.deleteSync(h),
                            a
                        }
                        throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")
                    }
                }
                ,
                this.copyFramebufferToTexture = function(e, t=null, n=0) {
                    !0 !== e.isTexture && ($t("WebGLRenderer: copyFramebufferToTexture function signature has changed."),
                    t = arguments[0] || null,
                    e = arguments[1]);
                    const i = Math.pow(2, -n)
                      , r = Math.floor(e.image.width * i)
                      , a = Math.floor(e.image.height * i)
                      , s = null !== t ? t.x : 0
                      , o = null !== t ? t.y : 0;
                    te.setTexture2D(e, 0),
                    Te.copyTexSubImage2D(Te.TEXTURE_2D, n, 0, 0, s, o, r, a),
                    J.unbindTexture()
                }
                ;
                const $e = Te.createFramebuffer()
                  , et = Te.createFramebuffer();
                this.copyTextureToTexture = function(e, t, n=null, i=null, r=0, a=null) {
                    let s, o, l, c, h, d, u, p, f;
                    !0 !== e.isTexture && ($t("WebGLRenderer: copyTextureToTexture function signature has changed."),
                    i = arguments[0] || null,
                    e = arguments[1],
                    t = arguments[2],
                    a = arguments[3] || 0,
                    n = null),
                    null === a && (0 !== r ? ($t("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),
                    a = r,
                    r = 0) : a = 0);
                    const m = e.isCompressedTexture ? e.mipmaps[a] : e.image;
                    if (null !== n)
                        s = n.max.x - n.min.x,
                        o = n.max.y - n.min.y,
                        l = n.isBox3 ? n.max.z - n.min.z : 1,
                        c = n.min.x,
                        h = n.min.y,
                        d = n.isBox3 ? n.min.z : 0;
                    else {
                        const t = Math.pow(2, -r);
                        s = Math.floor(m.width * t),
                        o = Math.floor(m.height * t),
                        l = e.isDataArrayTexture ? m.depth : e.isData3DTexture ? Math.floor(m.depth * t) : 1,
                        c = 0,
                        h = 0,
                        d = 0
                    }
                    null !== i ? (u = i.x,
                    p = i.y,
                    f = i.z) : (u = 0,
                    p = 0,
                    f = 0);
                    const g = Se.convert(t.format)
                      , v = Se.convert(t.type);
                    let w;
                    t.isData3DTexture ? (te.setTexture3D(t, 0),
                    w = Te.TEXTURE_3D) : t.isDataArrayTexture || t.isCompressedArrayTexture ? (te.setTexture2DArray(t, 0),
                    w = Te.TEXTURE_2D_ARRAY) : (te.setTexture2D(t, 0),
                    w = Te.TEXTURE_2D),
                    Te.pixelStorei(Te.UNPACK_FLIP_Y_WEBGL, t.flipY),
                    Te.pixelStorei(Te.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
                    Te.pixelStorei(Te.UNPACK_ALIGNMENT, t.unpackAlignment);
                    const y = Te.getParameter(Te.UNPACK_ROW_LENGTH)
                      , b = Te.getParameter(Te.UNPACK_IMAGE_HEIGHT)
                      , A = Te.getParameter(Te.UNPACK_SKIP_PIXELS)
                      , x = Te.getParameter(Te.UNPACK_SKIP_ROWS)
                      , k = Te.getParameter(Te.UNPACK_SKIP_IMAGES);
                    Te.pixelStorei(Te.UNPACK_ROW_LENGTH, m.width),
                    Te.pixelStorei(Te.UNPACK_IMAGE_HEIGHT, m.height),
                    Te.pixelStorei(Te.UNPACK_SKIP_PIXELS, c),
                    Te.pixelStorei(Te.UNPACK_SKIP_ROWS, h),
                    Te.pixelStorei(Te.UNPACK_SKIP_IMAGES, d);
                    const E = e.isDataArrayTexture || e.isData3DTexture
                      , S = t.isDataArrayTexture || t.isData3DTexture;
                    if (e.isDepthTexture) {
                        const n = ee.get(e)
                          , i = ee.get(t)
                          , m = ee.get(n.__renderTarget)
                          , g = ee.get(i.__renderTarget);
                        J.bindFramebuffer(Te.READ_FRAMEBUFFER, m.__webglFramebuffer),
                        J.bindFramebuffer(Te.DRAW_FRAMEBUFFER, g.__webglFramebuffer);
                        for (let n = 0; n < l; n++)
                            E && (Te.framebufferTextureLayer(Te.READ_FRAMEBUFFER, Te.COLOR_ATTACHMENT0, ee.get(e).__webglTexture, r, d + n),
                            Te.framebufferTextureLayer(Te.DRAW_FRAMEBUFFER, Te.COLOR_ATTACHMENT0, ee.get(t).__webglTexture, a, f + n)),
                            Te.blitFramebuffer(c, h, s, o, u, p, s, o, Te.DEPTH_BUFFER_BIT, Te.NEAREST);
                        J.bindFramebuffer(Te.READ_FRAMEBUFFER, null),
                        J.bindFramebuffer(Te.DRAW_FRAMEBUFFER, null)
                    } else if (0 !== r || e.isRenderTargetTexture || ee.has(e)) {
                        const n = ee.get(e)
                          , i = ee.get(t);
                        J.bindFramebuffer(Te.READ_FRAMEBUFFER, $e),
                        J.bindFramebuffer(Te.DRAW_FRAMEBUFFER, et);
                        for (let e = 0; e < l; e++)
                            E ? Te.framebufferTextureLayer(Te.READ_FRAMEBUFFER, Te.COLOR_ATTACHMENT0, n.__webglTexture, r, d + e) : Te.framebufferTexture2D(Te.READ_FRAMEBUFFER, Te.COLOR_ATTACHMENT0, Te.TEXTURE_2D, n.__webglTexture, r),
                            S ? Te.framebufferTextureLayer(Te.DRAW_FRAMEBUFFER, Te.COLOR_ATTACHMENT0, i.__webglTexture, a, f + e) : Te.framebufferTexture2D(Te.DRAW_FRAMEBUFFER, Te.COLOR_ATTACHMENT0, Te.TEXTURE_2D, i.__webglTexture, a),
                            0 !== r ? Te.blitFramebuffer(c, h, s, o, u, p, s, o, Te.COLOR_BUFFER_BIT, Te.NEAREST) : S ? Te.copyTexSubImage3D(w, a, u, p, f + e, c, h, s, o) : Te.copyTexSubImage2D(w, a, u, p, c, h, s, o);
                        J.bindFramebuffer(Te.READ_FRAMEBUFFER, null),
                        J.bindFramebuffer(Te.DRAW_FRAMEBUFFER, null)
                    } else
                        S ? e.isDataTexture || e.isData3DTexture ? Te.texSubImage3D(w, a, u, p, f, s, o, l, g, v, m.data) : t.isCompressedArrayTexture ? Te.compressedTexSubImage3D(w, a, u, p, f, s, o, l, g, m.data) : Te.texSubImage3D(w, a, u, p, f, s, o, l, g, v, m) : e.isDataTexture ? Te.texSubImage2D(Te.TEXTURE_2D, a, u, p, s, o, g, v, m.data) : e.isCompressedTexture ? Te.compressedTexSubImage2D(Te.TEXTURE_2D, a, u, p, m.width, m.height, g, m.data) : Te.texSubImage2D(Te.TEXTURE_2D, a, u, p, s, o, g, v, m);
                    Te.pixelStorei(Te.UNPACK_ROW_LENGTH, y),
                    Te.pixelStorei(Te.UNPACK_IMAGE_HEIGHT, b),
                    Te.pixelStorei(Te.UNPACK_SKIP_PIXELS, A),
                    Te.pixelStorei(Te.UNPACK_SKIP_ROWS, x),
                    Te.pixelStorei(Te.UNPACK_SKIP_IMAGES, k),
                    0 === a && t.generateMipmaps && Te.generateMipmap(w),
                    J.unbindTexture()
                }
                ,
                this.copyTextureToTexture3D = function(e, t, n=null, i=null, r=0) {
                    return !0 !== e.isTexture && ($t("WebGLRenderer: copyTextureToTexture3D function signature has changed."),
                    n = arguments[0] || null,
                    i = arguments[1] || null,
                    e = arguments[2],
                    t = arguments[3],
                    r = arguments[4] || 0),
                    $t('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),
                    this.copyTextureToTexture(e, t, n, i, r)
                }
                ,
                this.initRenderTarget = function(e) {
                    void 0 === ee.get(e).__webglFramebuffer && te.setupRenderTarget(e)
                }
                ,
                this.initTexture = function(e) {
                    e.isCubeTexture ? te.setTextureCube(e, 0) : e.isData3DTexture ? te.setTexture3D(e, 0) : e.isDataArrayTexture || e.isCompressedArrayTexture ? te.setTexture2DArray(e, 0) : te.setTexture2D(e, 0),
                    J.unbindTexture()
                }
                ,
                this.resetState = function() {
                    x = 0,
                    k = 0,
                    E = null,
                    J.reset(),
                    Me.reset()
                }
                ,
                "undefined" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{
                    detail: this
                }))
            }
            get coordinateSystem() {
                return Rt
            }
            get outputColorSpace() {
                return this._outputColorSpace
            }
            set outputColorSpace(e) {
                this._outputColorSpace = e;
                const t = this.getContext();
                t.drawingBufferColorspace = rn._getDrawingBufferColorSpace(e),
                t.unpackColorSpace = rn._getUnpackColorSpace()
            }
        }
        const tu = new Xn;
        class nu {
            constructor(e) {
                e = e || {},
                this.zNear = !0 === e.webGL ? -1 : 0,
                this.vertices = {
                    near: [new bn, new bn, new bn, new bn],
                    far: [new bn, new bn, new bn, new bn]
                },
                void 0 !== e.projectionMatrix && this.setFromProjectionMatrix(e.projectionMatrix, e.maxFar || 1e4)
            }
            setFromProjectionMatrix(e, t) {
                const n = this.zNear
                  , i = 0 === e.elements[11];
                return tu.copy(e).invert(),
                this.vertices.near[0].set(1, 1, n),
                this.vertices.near[1].set(1, -1, n),
                this.vertices.near[2].set(-1, -1, n),
                this.vertices.near[3].set(-1, 1, n),
                this.vertices.near.forEach((function(e) {
                    e.applyMatrix4(tu)
                }
                )),
                this.vertices.far[0].set(1, 1, 1),
                this.vertices.far[1].set(1, -1, 1),
                this.vertices.far[2].set(-1, -1, 1),
                this.vertices.far[3].set(-1, 1, 1),
                this.vertices.far.forEach((function(e) {
                    e.applyMatrix4(tu);
                    const n = Math.abs(e.z);
                    i ? e.z *= Math.min(t / n, 1) : e.multiplyScalar(Math.min(t / n, 1))
                }
                )),
                this.vertices
            }
            split(e, t) {
                for (; e.length > t.length; )
                    t.push(new nu);
                t.length = e.length;
                for (let n = 0; n < e.length; n++) {
                    const i = t[n];
                    if (0 === n)
                        for (let e = 0; e < 4; e++)
                            i.vertices.near[e].copy(this.vertices.near[e]);
                    else
                        for (let t = 0; t < 4; t++)
                            i.vertices.near[t].lerpVectors(this.vertices.near[t], this.vertices.far[t], e[n - 1]);
                    if (n === e.length - 1)
                        for (let e = 0; e < 4; e++)
                            i.vertices.far[e].copy(this.vertices.far[e]);
                    else
                        for (let t = 0; t < 4; t++)
                            i.vertices.far[t].lerpVectors(this.vertices.near[t], this.vertices.far[t], e[n])
                }
            }
            toSpace(e, t) {
                for (let n = 0; n < 4; n++)
                    t.vertices.near[n].copy(this.vertices.near[n]).applyMatrix4(e),
                    t.vertices.far[n].copy(this.vertices.far[n]).applyMatrix4(e)
            }
        }
        const iu = {
            lights_fragment_begin: "\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n\n#ifdef USE_CLEARCOAT\n\n\tgeometryClearcoatNormal = clearcoatNormal;\n\n#endif\n\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\t// Iridescence F0 approximation\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n \tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\n  \t\t// spot lights are ordered [shadows with maps, shadows without maps, maps without shadows, none]\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && defined( USE_CSM ) && defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\tfloat linearDepth = (vViewPosition.z) / (shadowFar - cameraNear);\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#if defined( USE_SHADOWMAP ) && defined( CSM_FADE )\n\t\tvec2 cascade;\n\t\tfloat cascadeCenter;\n\t\tfloat closestEdge;\n\t\tfloat margin;\n\t\tfloat csmx;\n\t\tfloat csmy;\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\t\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\n\t\t\t#if ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\t\t\t// NOTE: Depth gets larger away from the camera.\n\t\t\t\t// cascade.x is closer, cascade.y is further\n\t\t\t\tcascade = CSM_cascades[ i ];\n\t\t\t\tcascadeCenter = ( cascade.x + cascade.y ) / 2.0;\n\t\t\t\tclosestEdge = linearDepth < cascadeCenter ? cascade.x : cascade.y;\n\t\t\t\tmargin = 0.25 * pow( closestEdge, 2.0 );\n\t\t\t\tcsmx = cascade.x - margin / 2.0;\n\t\t\t\tcsmy = cascade.y + margin / 2.0;\n\t\t\t\tif( linearDepth >= csmx && ( linearDepth < csmy || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 ) ) {\n\n\t\t\t\t\tfloat dist = min( linearDepth - csmx, csmy - linearDepth );\n\t\t\t\t\tfloat ratio = clamp( dist / margin, 0.0, 1.0 );\n\n\t\t\t\t\tvec3 prevColor = directLight.color;\n\t\t\t\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\t\t\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t\t\t\tbool shouldFadeLastCascade = UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth > cascadeCenter;\n\t\t\t\t\tdirectLight.color = mix( prevColor, directLight.color, shouldFadeLastCascade ? ratio : 1.0 );\n\n\t\t\t\t\tReflectedLight prevLight = reflectedLight;\n\t\t\t\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t\t\t\t\tbool shouldBlend = UNROLLED_LOOP_INDEX != CSM_CASCADES - 1 || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth < cascadeCenter;\n\t\t\t\t\tfloat blendRatio = shouldBlend ? ratio : 1.0;\n\n\t\t\t\t\treflectedLight.directDiffuse = mix( prevLight.directDiffuse, reflectedLight.directDiffuse, blendRatio );\n\t\t\t\t\treflectedLight.directSpecular = mix( prevLight.directSpecular, reflectedLight.directSpecular, blendRatio );\n\t\t\t\t\treflectedLight.indirectDiffuse = mix( prevLight.indirectDiffuse, reflectedLight.indirectDiffuse, blendRatio );\n\t\t\t\t\treflectedLight.indirectSpecular = mix( prevLight.indirectSpecular, reflectedLight.indirectSpecular, blendRatio );\n\n\t\t\t\t}\n\t\t\t#endif\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#elif defined (USE_SHADOWMAP)\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\t\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\n\t\t\t#if ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\n\t\t\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\t\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y) directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && (linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1)) RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t\t\t#endif\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#elif ( NUM_DIR_LIGHT_SHADOWS > 0 )\n\t\t// note: no loop here - all CSM lights are in fact one light only\n\t\tgetDirectionalLightInfo( directionalLights[0], directLight );\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t#endif\n\n\t#if ( NUM_DIR_LIGHTS > NUM_DIR_LIGHT_SHADOWS)\n\t\t// compute the lights not casting shadows (if any)\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = NUM_DIR_LIGHT_SHADOWS; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\n\t\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\n\t\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && !defined( USE_CSM ) && !defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\t#if defined( USE_LIGHT_PROBES )\n\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\n\t#endif\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",
            lights_pars_begin: "\n#if defined( USE_CSM ) && defined( CSM_CASCADES )\nuniform vec2 CSM_cascades[CSM_CASCADES];\nuniform float cameraNear;\nuniform float shadowFar;\n#endif\n\t" + bc.lights_pars_begin
        }
          , ru = new Xn
          , au = new nu({
            webGL: !0
        })
          , su = new bn
          , ou = new kn
          , lu = []
          , cu = []
          , hu = new Xn
          , du = new Xn
          , uu = new bn(0,1,0);
        class pu {
            constructor(e) {
                this.camera = e.camera,
                this.parent = e.parent,
                this.cascades = e.cascades || 3,
                this.maxFar = e.maxFar || 1e5,
                this.mode = e.mode || "practical",
                this.shadowMapSize = e.shadowMapSize || 2048,
                this.shadowBias = e.shadowBias || 1e-6,
                this.lightDirection = e.lightDirection || new bn(1,-1,1).normalize(),
                this.lightIntensity = e.lightIntensity || 3,
                this.lightNear = e.lightNear || 1,
                this.lightFar = e.lightFar || 2e3,
                this.lightMargin = e.lightMargin || 200,
                this.customSplitsCallback = e.customSplitsCallback,
                this.fade = !1,
                this.mainFrustum = new nu({
                    webGL: !0
                }),
                this.frustums = [],
                this.breaks = [],
                this.lights = [],
                this.shaders = new Map,
                this.createLights(),
                this.updateFrustums(),
                this.injectInclude()
            }
            createLights() {
                for (let e = 0; e < this.cascades; e++) {
                    const e = new Do(16777215,this.lightIntensity);
                    e.castShadow = !0,
                    e.shadow.mapSize.width = this.shadowMapSize,
                    e.shadow.mapSize.height = this.shadowMapSize,
                    e.shadow.camera.near = this.lightNear,
                    e.shadow.camera.far = this.lightFar,
                    e.shadow.bias = this.shadowBias,
                    this.parent.add(e),
                    this.parent.add(e.target),
                    this.lights.push(e)
                }
            }
            initCascades() {
                const e = this.camera;
                e.updateProjectionMatrix(),
                this.mainFrustum.setFromProjectionMatrix(e.projectionMatrix, this.maxFar),
                this.mainFrustum.split(this.breaks, this.frustums)
            }
            updateShadowBounds() {
                const e = this.frustums;
                for (let t = 0; t < e.length; t++) {
                    const e = this.lights[t].shadow.camera
                      , n = this.frustums[t]
                      , i = n.vertices.near
                      , r = n.vertices.far
                      , a = r[0];
                    let s;
                    s = a.distanceTo(r[2]) > a.distanceTo(i[2]) ? r[2] : i[2];
                    let o = a.distanceTo(s);
                    if (this.fade) {
                        const e = this.camera
                          , t = Math.max(e.far, this.maxFar)
                          , i = n.vertices.far[0].z / (t - e.near);
                        o += .25 * Math.pow(i, 2) * (t - e.near)
                    }
                    e.left = -o / 2,
                    e.right = o / 2,
                    e.top = o / 2,
                    e.bottom = -o / 2,
                    e.updateProjectionMatrix()
                }
            }
            getBreaks() {
                const e = this.camera
                  , t = Math.min(e.far, this.maxFar);
                switch (this.breaks.length = 0,
                this.mode) {
                case "uniform":
                    n(this.cascades, e.near, t, this.breaks);
                    break;
                case "logarithmic":
                    i(this.cascades, e.near, t, this.breaks);
                    break;
                case "practical":
                    !function(e, t, r, a, s) {
                        lu.length = 0,
                        cu.length = 0,
                        i(e, t, r, cu),
                        n(e, t, r, lu);
                        for (let t = 1; t < e; t++)
                            s.push(jt.lerp(lu[t - 1], cu[t - 1], a));
                        s.push(1)
                    }(this.cascades, e.near, t, .5, this.breaks);
                    break;
                case "custom":
                    void 0 === this.customSplitsCallback && console.error("CSM: Custom split scheme callback not defined."),
                    this.customSplitsCallback(this.cascades, e.near, t, this.breaks)
                }
                function n(e, t, n, i) {
                    for (let r = 1; r < e; r++)
                        i.push((t + (n - t) * r / e) / n);
                    i.push(1)
                }
                function i(e, t, n, i) {
                    for (let r = 1; r < e; r++)
                        i.push(t * (n / t) ** (r / e) / n);
                    i.push(1)
                }
            }
            update() {
                const e = this.camera
                  , t = this.frustums;
                hu.lookAt(new bn, this.lightDirection, uu),
                du.copy(hu).invert();
                for (let n = 0; n < t.length; n++) {
                    const i = this.lights[n]
                      , r = i.shadow.camera
                      , a = (r.right - r.left) / this.shadowMapSize
                      , s = (r.top - r.bottom) / this.shadowMapSize;
                    ru.multiplyMatrices(du, e.matrixWorld),
                    t[n].toSpace(ru, au);
                    const o = au.vertices.near
                      , l = au.vertices.far;
                    ou.makeEmpty();
                    for (let e = 0; e < 4; e++)
                        ou.expandByPoint(o[e]),
                        ou.expandByPoint(l[e]);
                    ou.getCenter(su),
                    su.z = ou.max.z + this.lightMargin,
                    su.x = Math.floor(su.x / a) * a,
                    su.y = Math.floor(su.y / s) * s,
                    su.applyMatrix4(hu),
                    i.position.copy(su),
                    i.target.position.copy(su),
                    i.target.position.x += this.lightDirection.x,
                    i.target.position.y += this.lightDirection.y,
                    i.target.position.z += this.lightDirection.z
                }
            }
            injectInclude() {
                bc.lights_fragment_begin = iu.lights_fragment_begin,
                bc.lights_pars_begin = iu.lights_pars_begin
            }
            setupMaterial(e) {
                e.defines = e.defines || {},
                e.defines.USE_CSM = 1,
                e.defines.CSM_CASCADES = this.cascades,
                this.fade && (e.defines.CSM_FADE = "");
                const t = []
                  , n = this
                  , i = this.shaders;
                e.onBeforeCompile = function(r) {
                    const a = Math.min(n.camera.far, n.maxFar);
                    n.getExtendedBreaks(t),
                    r.uniforms.CSM_cascades = {
                        value: t
                    },
                    r.uniforms.cameraNear = {
                        value: n.camera.near
                    },
                    r.uniforms.shadowFar = {
                        value: a
                    },
                    i.set(e, r)
                }
                ,
                i.set(e, null)
            }
            updateUniforms() {
                const e = Math.min(this.camera.far, this.maxFar);
                this.shaders.forEach((function(t, n) {
                    if (null !== t) {
                        const n = t.uniforms;
                        this.getExtendedBreaks(n.CSM_cascades.value),
                        n.cameraNear.value = this.camera.near,
                        n.shadowFar.value = e
                    }
                    !this.fade && "CSM_FADE"in n.defines ? (delete n.defines.CSM_FADE,
                    n.needsUpdate = !0) : this.fade && !("CSM_FADE"in n.defines) && (n.defines.CSM_FADE = "",
                    n.needsUpdate = !0)
                }
                ), this)
            }
            getExtendedBreaks(e) {
                for (; e.length < this.breaks.length; )
                    e.push(new Qt);
                e.length = this.breaks.length;
                for (let t = 0; t < this.cascades; t++) {
                    const n = this.breaks[t]
                      , i = this.breaks[t - 1] || 0;
                    e[t].x = i,
                    e[t].y = n
                }
            }
            updateFrustums() {
                this.getBreaks(),
                this.initCascades(),
                this.updateShadowBounds(),
                this.updateUniforms()
            }
            remove() {
                for (let e = 0; e < this.lights.length; e++)
                    this.parent.remove(this.lights[e].target),
                    this.parent.remove(this.lights[e])
            }
            dispose() {
                const e = this.shaders;
                e.forEach((function(e, t) {
                    delete t.onBeforeCompile,
                    delete t.defines.USE_CSM,
                    delete t.defines.CSM_CASCADES,
                    delete t.defines.CSM_FADE,
                    null !== e && (delete e.uniforms.CSM_cascades,
                    delete e.uniforms.cameraNear,
                    delete e.uniforms.shadowFar),
                    t.needsUpdate = !0
                }
                )),
                e.clear()
            }
        }
        const fu = JSON.parse('{"rE":"0.5.2","l$":{"r":1,"M":4}}');
        const mu = "kodub"
          , gu = !1
          , vu = "https://polytrack-backend.htmlunblockedgames.workers.dev/"
          , wu = fu.l$.r;
        if (!Number.isSafeInteger(wu) || wu < 1)
            throw new Error("package.json beta version property must be a positive integer");
        let yu = "";
        const bu = fu.rE + yu
          , Au = fu.l$.M;
        if (!Number.isSafeInteger(Au) || Au < 1)
            throw new Error("package.json beta physicsVersion property must be a positive integer");
        var xu, ku, Eu, Su, Mu, _u, Tu, Cu, Pu, Iu, Ru, Lu, Du, Nu, Bu, Uu, zu, Ou, Fu, Wu, Hu = function(e, t, n, i) {
            return new (n || (n = Promise))((function(r, a) {
                function s(e) {
                    try {
                        l(i.next(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function o(e) {
                    try {
                        l(i.throw(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(e) {
                    var t;
                    e.done ? r(e.value) : (t = e.value,
                    t instanceof n ? t : new n((function(e) {
                        e(t)
                    }
                    ))).then(s, o)
                }
                l((i = i.apply(e, t || [])).next())
            }
            ))
        }, Vu = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, Gu = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class ju {
            constructor(e, t, n=!0, i=!1) {
                var r;
                xu.add(this),
                ku.set(this, void 0),
                Eu.set(this, void 0),
                Su.set(this, void 0),
                Mu.set(this, !1),
                _u.set(this, void 0),
                Tu.set(this, new Ir),
                Cu.set(this, null),
                Pu.set(this, null),
                Iu.set(this, []),
                Ru.set(this, null),
                Lu.set(this, new bn(8,10,10)),
                Du.set(this, []),
                Nu.set(this, []),
                Vu(this, ku, e, "f"),
                Vu(this, Eu, t, "f");
                const a = {
                    antialias: null === (r = null == t ? void 0 : t.getSettingBoolean(el.Antialiasing)) || void 0 === r || r,
                    powerPreference: "high-performance",
                    canvas: e,
                    alpha: i
                };
                try {
                    a.failIfMajorPerformanceCaveat = !0,
                    Vu(this, Su, new eu(a), "f"),
                    Vu(this, Mu, !1, "f")
                } catch (e) {
                    a.failIfMajorPerformanceCaveat = !1,
                    Vu(this, Su, new eu(a), "f"),
                    Vu(this, Mu, !0, "f")
                }
                Gu(this, Su, "f").outputColorSpace = wt,
                Gu(this, Su, "f").debug.checkShaderErrors = gu,
                Vu(this, _u, new Fr, "f"),
                n && (Gu(this, _u, "f").fog = new Or(10211839,0,ju.maxViewDistance)),
                Gu(this, _u, "f").add(new bo(3891597,11714755,4.7)),
                document.addEventListener("fullscreenchange", ( () => {
                    Gu(this, xu, "m", Fu).call(this)
                }
                )),
                Gu(this, ku, "f").addEventListener("webglcontextrestored", ( () => {
                    for (const e of Gu(this, Nu, "f"))
                        e()
                }
                )),
                null != window.electron && window.electron.addFullscreenChangeListener(( () => {
                    Gu(this, xu, "m", Fu).call(this)
                }
                ))
            }
            clear() {
                Gu(this, Su, "f").clear()
            }
            update(e) {
                var t, n, i;
                Gu(this, Lu, "f").copy(e.getSunPosition());
                let r = null !== (n = null === (t = Gu(this, Eu, "f")) || void 0 === t ? void 0 : t.getSettingInteger(el.ShadowQuality)) && void 0 !== n ? n : 0;
                if (this.isShadowQualitySupported(r) || (r = 0),
                !Number.isSafeInteger(r) || r <= 2 || r > 5)
                    if (null != Gu(this, Cu, "f") && (Gu(this, Cu, "f").remove(),
                    Gu(this, Cu, "f").dispose(),
                    Vu(this, Cu, null, "f"),
                    Vu(this, Pu, null, "f")),
                    null == Gu(this, Ru, "f") && (Vu(this, Ru, new Do(16777215,4.7), "f"),
                    Gu(this, Ru, "f").position.copy(Gu(this, Lu, "f")),
                    Gu(this, _u, "f").add(Gu(this, Ru, "f")),
                    Gu(this, _u, "f").add(Gu(this, Ru, "f").target)),
                    1 == r || 2 == r) {
                        if (!Gu(this, Ru, "f").castShadow) {
                            const e = Gu(this, xu, "m", Ou).call(this, r);
                            Gu(this, Ru, "f").castShadow = !0,
                            Gu(this, Ru, "f").shadow.camera.top = 10,
                            Gu(this, Ru, "f").shadow.camera.right = 10,
                            Gu(this, Ru, "f").shadow.camera.bottom = -10,
                            Gu(this, Ru, "f").shadow.camera.left = -10,
                            Gu(this, Ru, "f").shadow.camera.near = 1,
                            Gu(this, Ru, "f").shadow.camera.far = 50,
                            Gu(this, Ru, "f").shadow.mapSize.width = e,
                            Gu(this, Ru, "f").shadow.mapSize.height = e,
                            Gu(this, Ru, "f").shadow.normalBias = .03,
                            Gu(this, Ru, "f").shadow.intensity = .6
                        }
                        Gu(this, Ru, "f").position.addVectors(Gu(this, Tu, "f").position, Gu(this, Lu, "f").multiplyScalar(12.5)),
                        Gu(this, Ru, "f").target.position.copy(Gu(this, Tu, "f").position),
                        Gu(this, Su, "f").shadowMap.type = 1,
                        Gu(this, Su, "f").shadowMap.enabled = !0
                    } else
                        Gu(this, Ru, "f").castShadow = !1,
                        null === (i = Gu(this, Ru, "f").shadow.map) || void 0 === i || i.dispose(),
                        Gu(this, Ru, "f").shadow.map = null,
                        Gu(this, Su, "f").shadowMap.enabled = !1;
                else {
                    if (null != Gu(this, Cu, "f") && Gu(this, Pu, "f") != r && (Gu(this, Cu, "f").remove(),
                    Gu(this, Cu, "f").dispose(),
                    Vu(this, Cu, null, "f"),
                    Vu(this, Pu, null, "f"),
                    Gu(this, Su, "f").compile(Gu(this, _u, "f"), Gu(this, Tu, "f"))),
                    null == Gu(this, Cu, "f")) {
                        Gu(this, Su, "f").shadowMap.enabled = !0,
                        Gu(this, Su, "f").shadowMap.type = 2,
                        Vu(this, Cu, Gu(this, xu, "m", Bu).call(this, r), "f"),
                        Vu(this, Pu, r, "f");
                        for (const {material: e, onBeforeCompile: t, customProgramCacheKey: n} of Gu(this, Iu, "f"))
                            Gu(this, xu, "m", zu).call(this, e, t, n)
                    }
                    null != Gu(this, Ru, "f") && (Gu(this, _u, "f").remove(Gu(this, Ru, "f")),
                    Gu(this, _u, "f").remove(Gu(this, Ru, "f").target),
                    Vu(this, Ru, null, "f")),
                    Gu(this, Cu, "f").lightDirection = Gu(this, Lu, "f").clone().negate().normalize(),
                    Gu(this, Cu, "f").update()
                }
                Gu(this, xu, "m", Uu).call(this),
                Gu(this, Su, "f").render(Gu(this, _u, "f"), Gu(this, Tu, "f"))
            }
            addMaterial(e) {
                const t = Array.isArray(e) ? e : [e];
                for (const e of t) {
                    const t = e.onBeforeCompile.bind(e)
                      , n = e.onBeforeCompile.toString();
                    Gu(this, Iu, "f").push({
                        material: e,
                        onBeforeCompile: t,
                        customProgramCacheKey: n
                    }),
                    null != Gu(this, Cu, "f") && Gu(this, xu, "m", zu).call(this, e, t, n)
                }
            }
            removeMaterial(e) {
                if (Array.isArray(e))
                    for (const t of e) {
                        const e = Gu(this, Iu, "f").findIndex((e => e.material == t));
                        e >= 0 && Gu(this, Iu, "f").splice(e, 1)
                    }
                else {
                    const t = Gu(this, Iu, "f").findIndex((t => t.material == e));
                    t >= 0 && Gu(this, Iu, "f").splice(t, 1)
                }
            }
            isTrackShadowsEnabled() {
                var e, t;
                const n = null !== (t = null === (e = Gu(this, Eu, "f")) || void 0 === e ? void 0 : e.getSettingInteger(el.ShadowQuality)) && void 0 !== t ? t : 0;
                return 3 == n || 4 == n || 5 == n
            }
            isShadowQualitySupported(e) {
                return !Number.isSafeInteger(e) || e <= 0 || e > 5 || Gu(this, Su, "f").capabilities.maxTextureSize >= Gu(this, xu, "m", Ou).call(this, e)
            }
            getMaxAnisotropy() {
                return Gu(this, Su, "f").capabilities.getMaxAnisotropy()
            }
            get isUsingSoftwareRenderer() {
                return Gu(this, Mu, "f")
            }
            get isFullscreen() {
                return null != window.electron ? window.electron.isFullscreen() : null != document.fullscreenElement
            }
            toggleFullscreen() {
                return Hu(this, void 0, void 0, (function*() {
                    this.isFullscreen ? null != window.electron ? window.electron.setFullscreen(!1) : yield document.exitFullscreen() : null != window.electron ? window.electron.setFullscreen(!0) : yield document.body.requestFullscreen()
                }
                ))
            }
            addFullscreenChangeListener(e) {
                Gu(this, Du, "f").push(e)
            }
            removeFullscreenChangeListener(e) {
                const t = Gu(this, Du, "f").indexOf(e);
                t >= 0 && Gu(this, Du, "f").splice(t, 1)
            }
            addContextRestoredEventListener(e) {
                Gu(this, Nu, "f").push(e)
            }
            removeContextRestoredEventListener(e) {
                const t = Gu(this, Nu, "f").indexOf(e);
                t >= 0 && Gu(this, Nu, "f").splice(t, 1)
            }
            get csm() {
                return Gu(this, Cu, "f")
            }
            setCamera(e) {
                Vu(this, Tu, e, "f"),
                null != Gu(this, Cu, "f") && (Gu(this, Cu, "f").camera = e,
                Gu(this, xu, "m", Wu).call(this))
            }
            get camera() {
                return Gu(this, Tu, "f")
            }
            get canvas() {
                return Gu(this, ku, "f")
            }
            setAnimationLoop(e) {
                Gu(this, Su, "f").setAnimationLoop(e)
            }
            get scene() {
                return Gu(this, _u, "f")
            }
        }
        ku = new WeakMap,
        Eu = new WeakMap,
        Su = new WeakMap,
        Mu = new WeakMap,
        _u = new WeakMap,
        Tu = new WeakMap,
        Cu = new WeakMap,
        Pu = new WeakMap,
        Iu = new WeakMap,
        Ru = new WeakMap,
        Lu = new WeakMap,
        Du = new WeakMap,
        Nu = new WeakMap,
        xu = new WeakSet,
        Bu = function(e) {
            if (3 != e && 4 != e && 5 != e)
                throw new Error("Unsupported shadow quality: " + e.toString());
            const t = Gu(this, xu, "m", Ou).call(this, e);
            let n, i;
            switch (e) {
            case 5:
                n = 2e3;
                break;
            case 4:
                n = 1e3;
                break;
            case 3:
                n = 500
            }
            switch (e) {
            case 5:
                i = 5;
                break;
            case 4:
            case 3:
                i = 4
            }
            const r = new pu({
                maxFar: n,
                lightFar: 15e3,
                lightNear: 10,
                lightMargin: 5e3,
                cascades: i,
                mode: "custom",
                customSplitsCallback: (t, n, i, r) => {
                    5 == e ? (r.push((15 - n) / i),
                    r.push((40 - n) / i),
                    r.push((150 - n) / i),
                    r.push((500 - n) / i),
                    r.push(1)) : 4 == e ? (r.push((15 - n) / i),
                    r.push((80 - n) / i),
                    r.push((300 - n) / i),
                    r.push(1)) : (r.push((15 - n) / i),
                    r.push((60 - n) / i),
                    r.push((150 - n) / i),
                    r.push(1))
                }
                ,
                parent: Gu(this, _u, "f"),
                shadowMapSize: t,
                lightDirection: new bn(0,0,-1),
                lightIntensity: 4.7,
                camera: Gu(this, Tu, "f")
            });
            r.fade = !0,
            5 == e ? (r.lights[0].shadow.normalBias = .025,
            r.lights[1].shadow.normalBias = .04,
            r.lights[2].shadow.normalBias = .11,
            r.lights[3].shadow.normalBias = .32,
            r.lights[4].shadow.normalBias = 1.25) : 4 == e ? (r.lights[0].shadow.normalBias = .041,
            r.lights[1].shadow.normalBias = .13,
            r.lights[2].shadow.normalBias = .48,
            r.lights[3].shadow.normalBias = 1.25) : (r.lights[0].shadow.normalBias = .08,
            r.lights[1].shadow.normalBias = .21,
            r.lights[2].shadow.normalBias = .6,
            r.lights[3].shadow.normalBias = 1.9);
            for (const e of r.lights)
                e.shadow.intensity = .6;
            return r
        }
        ,
        Uu = function() {
            var e, t;
            let n = null !== (t = null === (e = Gu(this, Eu, "f")) || void 0 === e ? void 0 : e.getSettingFloat(el.RenderScale)) && void 0 !== t ? t : 1;
            n = Number.isFinite(n) ? Math.min(Math.max(n, .25), 2) : 1;
            const i = window.devicePixelRatio * n;
            if (Gu(this, Su, "f").getPixelRatio() != i && Gu(this, Su, "f").setPixelRatio(i),
            Gu(this, Tu, "f")instanceof Ir) {
                const e = window.innerWidth / window.innerHeight
                  , t = new Qt;
                Gu(this, Su, "f").getSize(t);
                const n = Math.max(1, .5 * e);
                t.width == window.innerWidth && t.height == window.innerHeight && Gu(this, Tu, "f").aspect == e && Gu(this, Tu, "f").zoom == n || (Gu(this, Su, "f").setSize(window.innerWidth, window.innerHeight),
                Gu(this, Tu, "f").aspect = e,
                Gu(this, Tu, "f").zoom = n,
                Gu(this, xu, "m", Wu).call(this),
                Gu(this, Tu, "f").updateProjectionMatrix())
            }
        }
        ,
        zu = function(e, t, n) {
            var i;
            const r = Array.isArray(e) ? e : [e];
            for (const e of r) {
                null === (i = Gu(this, Cu, "f")) || void 0 === i || i.setupMaterial(e);
                const r = e.onBeforeCompile.toString()
                  , a = e.onBeforeCompile.bind(e);
                e.onBeforeCompile = (e, n) => {
                    a(e, n),
                    t(e, n)
                }
                ,
                e.customProgramCacheKey = () => r + n,
                e.needsUpdate = !0
            }
        }
        ,
        Ou = function(e) {
            switch (e) {
            case 5:
                return 8192;
            case 4:
                return 4096;
            case 3:
                return 2048;
            case 2:
            case 1:
                return 1024;
            default:
                throw new Error("Unsupported shadow quality: " + e.toString())
            }
        }
        ,
        Fu = function() {
            for (const e of Gu(this, Du, "f"))
                e()
        }
        ,
        Wu = function() {
            if (null != Gu(this, Cu, "f"))
                if (Gu(this, Tu, "f")instanceof Ir) {
                    const e = Gu(this, Tu, "f").fov;
                    Gu(this, Tu, "f").fov = 100,
                    Gu(this, Cu, "f").updateFrustums(),
                    Gu(this, Tu, "f").fov = e
                } else
                    Gu(this, Cu, "f").updateFrustums()
        }
        ,
        ju.maxViewDistance = 1e4;
        const Qu = ju;
        var Ku, qu, Yu, Xu, Zu, Ju = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class $u {
            constructor() {
                Ku.add(this),
                Xu.set(this, new Ir(Ju(qu, qu, "f", Yu),1,.5,Qu.maxViewDistance))
            }
            reset(e, t, n) {
                this.update(e, t, 0),
                Ju(this, Xu, "f").fov = Ju(this, Ku, "m", Zu).call(this, null != n ? n : 0),
                Ju(this, Xu, "f").updateProjectionMatrix()
            }
            update(e, t, n) {
                Ju(this, Xu, "f").fov = Ju(this, Ku, "m", Zu).call(this, n),
                Ju(this, Xu, "f").updateProjectionMatrix();
                const i = new bn(0,1.1 + .46 / Ju(this, Xu, "f").zoom - .46,.4);
                Ju(this, Xu, "f").position.addVectors(e, i.applyQuaternion(t)),
                Ju(this, Xu, "f").quaternion.copy(t),
                Ju(this, Xu, "f").quaternion.multiply((new yn).setFromEuler(new si(0,Math.PI,0))),
                Ju(this, Xu, "f").updateMatrix()
            }
            get camera() {
                return Ju(this, Xu, "f")
            }
        }
        qu = $u,
        Xu = new WeakMap,
        Ku = new WeakSet,
        Zu = function(e) {
            return Ju(qu, qu, "f", Yu) + (80 - Ju(qu, qu, "f", Yu)) * (1 - Math.exp(-Math.abs(e) / 200))
        }
        ,
        Yu = {
            value: 70
        };
        const ep = $u;
        class tp {
            constructor(e, t, n, i) {
                this.primary = e,
                this.secondary = t,
                this.frame = n,
                this.rims = i
            }
            static random() {
                const e = 360 * Math.random()
                  , t = 100 * (1 - Math.pow(Math.random(), 2))
                  , n = 100 * (.05 + .25 * (1 - Math.pow(Math.random(), 2)));
                return new tp(new Hi("hsl(" + e.toString() + "," + t.toString() + "%," + n.toString() + "%)"),new Hi("#ffffff"),new Hi("#131313"),new Hi("#666666"))
            }
            serialize() {
                return this.primary.getHexString() + this.secondary.getHexString() + this.frame.getHexString() + this.rims.getHexString()
            }
            static deserialize(e) {
                const t = [];
                for (let n = 0; n < 4; n++) {
                    const i = e.substring(6 * n, 6 * (n + 1));
                    /^[0-9a-f]{6}$/i.test(i) ? t.push(new Hi("#" + i)) : t.push(new Hi("#555"))
                }
                return new tp(t[0],t[1],t[2],t[3])
            }
        }
        const np = tp;
        var ip, rp, ap, sp, op, lp, cp, hp = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, dp = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class up {
            constructor() {
                ip.add(this),
                sp.set(this, new Ir(dp(rp, rp, "f", ap),1,.5,1e4)),
                op.set(this, new bn),
                lp.set(this, new bn(0,1,0))
            }
            reset(e, t, n) {
                hp(this, op, new bn(1e-5,0,-1), "f"),
                dp(this, op, "f").applyQuaternion(t),
                dp(this, op, "f").add(e),
                hp(this, lp, new bn(0,1,0), "f"),
                dp(this, lp, "f").applyQuaternion(t),
                this.update(0, e, t, 0),
                dp(this, sp, "f").fov = dp(this, ip, "m", cp).call(this, null != n ? n : 0),
                dp(this, sp, "f").updateProjectionMatrix()
            }
            update(e, t, n, i) {
                dp(this, sp, "f").fov = dp(this, ip, "m", cp).call(this, i),
                dp(this, sp, "f").updateProjectionMatrix();
                const r = new bn(0,1,0);
                r.applyQuaternion(n);
                const a = Math.min(1, 5 * e);
                dp(this, lp, "f").set(a * r.x + (1 - a) * dp(this, lp, "f").x, a * r.y + (1 - a) * dp(this, lp, "f").y, a * r.z + (1 - a) * dp(this, lp, "f").z);
                const s = (new bn).subVectors(t, dp(this, op, "f"));
                s.normalize();
                const o = 5.5
                  , l = 1.8 / Math.min(dp(this, sp, "f").zoom, 2);
                dp(this, sp, "f").position.x = t.x - s.x * o + 2 * dp(this, lp, "f").x,
                dp(this, sp, "f").position.y = Math.max(.25, t.y - s.y * o + 2 * dp(this, lp, "f").y),
                dp(this, sp, "f").position.z = t.z - s.z * o + 2 * dp(this, lp, "f").z,
                dp(this, sp, "f").lookAt(t.x + dp(this, lp, "f").x * l, t.y + dp(this, lp, "f").y * l, t.z + dp(this, lp, "f").z * l),
                dp(this, sp, "f").updateMatrix(),
                dp(this, op, "f").set(t.x - s.x * o, t.y - s.y * o, t.z - s.z * o)
            }
            get camera() {
                return dp(this, sp, "f")
            }
        }
        rp = up,
        sp = new WeakMap,
        op = new WeakMap,
        lp = new WeakMap,
        ip = new WeakSet,
        cp = function(e) {
            return dp(rp, rp, "f", ap) + (100 - dp(rp, rp, "f", ap)) * (1 - Math.exp(-Math.abs(e) / 200))
        }
        ,
        ap = {
            value: 70
        };
        const pp = up;
        var fp, mp, gp, vp, wp, yp, bp, Ap, xp = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, kp = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class Ep {
            constructor(e) {
                mp.set(this, void 0),
                gp.set(this, void 0),
                vp.set(this, []),
                wp.set(this, 256),
                yp.set(this, new bn(0,1,0)),
                xp(this, mp, e, "f"),
                xp(this, gp, new pa(kp(fp, fp, "f", bp),kp(fp, fp, "f", Ap),kp(this, wp, "f")), "f"),
                kp(this, gp, "f").frustumCulled = !1,
                e.scene.add(kp(this, gp, "f")),
                this.clear()
            }
            dispose() {
                kp(this, gp, "f").dispose(),
                kp(this, mp, "f").scene.remove(kp(this, gp, "f"))
            }
            clear() {
                kp(this, vp, "f").length = 0,
                kp(this, gp, "f").count = 0,
                kp(this, gp, "f").instanceMatrix.needsUpdate = !0
            }
            spawn(e, t, n) {
                kp(this, vp, "f").push({
                    x: e + .25 * (Math.random() - .5),
                    y: t + .25 * (Math.random() - .5),
                    z: n + .25 * (Math.random() - .5),
                    vx: .5 * (Math.random() - .5),
                    vy: .5 * (Math.random() - .5),
                    vz: .5 * (Math.random() - .5),
                    rotation: Math.random() * Math.PI * 2,
                    lifetime: .5
                })
            }
            update(e) {
                for (let t = kp(this, vp, "f").length - 1; t >= 0; --t) {
                    const n = kp(this, vp, "f")[t];
                    n.vy += 15 * e,
                    n.x += n.vx * e,
                    n.y += n.vy * e,
                    n.z += n.vz * e,
                    n.lifetime -= e,
                    n.lifetime <= 0 && kp(this, vp, "f").splice(t, 1)
                }
                let t = !1;
                kp(this, gp, "f").count != kp(this, vp, "f").length && (kp(this, gp, "f").count = Math.min(kp(this, vp, "f").length, kp(this, wp, "f")),
                t = !0);
                for (let e = 0; e < kp(this, gp, "f").count; ++e) {
                    const t = kp(this, vp, "f")[kp(this, vp, "f").length - 1 - e]
                      , n = new Xn;
                    n.lookAt(new bn(t.x,t.y,t.z), kp(this, mp, "f").camera.position, kp(this, yp, "f")),
                    n.setPosition(t.x, t.y, t.z),
                    n.multiply((new Xn).makeRotationZ(t.rotation));
                    const i = .5 + 2 * (.5 - t.lifetime);
                    n.scale(new bn(i,i,i)),
                    kp(this, gp, "f").setMatrixAt(e, n)
                }
                (t || kp(this, vp, "f").length > 0) && (kp(this, gp, "f").instanceMatrix.needsUpdate = !0)
            }
            static initResources(e) {
                e.addResource();
                const t = (new wo).load("images/smoke.png", ( () => {
                    e.loadedResource()
                }
                ));
                kp(this, fp, "f", Ap).map = t
            }
        }
        fp = Ep,
        mp = new WeakMap,
        gp = new WeakMap,
        vp = new WeakMap,
        wp = new WeakMap,
        yp = new WeakMap,
        bp = {
            value: ( () => {
                const e = new Bs;
                return e.rotateX(Math.PI),
                e
            }
            )()
        },
        Ap = {
            value: new Qi({
                opacity: .3,
                depthWrite: !1,
                transparent: !0
            })
        };
        const Sp = Ep;
        var Mp, _p, Tp, Cp, Pp, Ip, Rp, Lp, Dp, Np, Bp = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, Up = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class zp {
            constructor(e) {
                _p.set(this, void 0),
                Tp.set(this, void 0),
                Cp.set(this, void 0),
                Pp.set(this, void 0),
                Ip.set(this, 1e3),
                Rp.set(this, 0),
                Lp.set(this, null),
                Dp.set(this, null),
                Bp(this, _p, e, "f");
                const t = new or;
                Bp(this, Cp, new Float32Array(6 * Up(this, Ip, "f") * 3), "f"),
                Bp(this, Pp, new Xi(Up(this, Cp, "f"),3), "f"),
                t.setAttribute("position", Up(this, Pp, "f")),
                Bp(this, Tp, new yr(t,Up(Mp, Mp, "f", Np)), "f"),
                Up(this, Tp, "f").frustumCulled = !1,
                Up(this, _p, "f").scene.add(Up(this, Tp, "f"))
            }
            dispose() {
                Up(this, Tp, "f").geometry.dispose(),
                Up(this, _p, "f").scene.remove(Up(this, Tp, "f"))
            }
            clear() {
                for (let e = 0; e < Up(this, Cp, "f").length; ++e)
                    Up(this, Cp, "f")[e] = 0;
                Up(this, Pp, "f").needsUpdate = !0,
                Bp(this, Rp, 0, "f"),
                this.break()
            }
            break() {
                Bp(this, Lp, null, "f"),
                Bp(this, Dp, null, "f")
            }
            spawn(e, t, n, i) {
                var r, a;
                const s = Up(this, Lp, "f")
                  , o = Up(this, Dp, "f")
                  , l = (new bn).addVectors(e, new bn(.172,-.3,0).applyQuaternion(t))
                  , c = (new bn).addVectors(e, new bn(-.172,-.3,0).applyQuaternion(t))
                  , h = (new bn).copy(l)
                  , d = (new bn).copy(c)
                  , u = (new bn).subVectors(l, n).dot(i);
                h.addScaledVector(i, -u);
                const p = (new bn).subVectors(c, n).dot(i);
                if (d.addScaledVector(i, -p),
                null != s && null != o) {
                    const e = (Bp(this, Rp, (a = Up(this, Rp, "f"),
                    r = a++,
                    a), "f"),
                    r);
                    Up(this, Cp, "f")[6 * e * 3 + 0] = h.x,
                    Up(this, Cp, "f")[6 * e * 3 + 1] = h.y,
                    Up(this, Cp, "f")[6 * e * 3 + 2] = h.z,
                    Up(this, Cp, "f")[6 * e * 3 + 3] = s.x,
                    Up(this, Cp, "f")[6 * e * 3 + 4] = s.y,
                    Up(this, Cp, "f")[6 * e * 3 + 5] = s.z,
                    Up(this, Cp, "f")[6 * e * 3 + 6] = d.x,
                    Up(this, Cp, "f")[6 * e * 3 + 7] = d.y,
                    Up(this, Cp, "f")[6 * e * 3 + 8] = d.z,
                    Up(this, Cp, "f")[6 * e * 3 + 9] = d.x,
                    Up(this, Cp, "f")[6 * e * 3 + 10] = d.y,
                    Up(this, Cp, "f")[6 * e * 3 + 11] = d.z,
                    Up(this, Cp, "f")[6 * e * 3 + 12] = s.x,
                    Up(this, Cp, "f")[6 * e * 3 + 13] = s.y,
                    Up(this, Cp, "f")[6 * e * 3 + 14] = s.z,
                    Up(this, Cp, "f")[6 * e * 3 + 15] = o.x,
                    Up(this, Cp, "f")[6 * e * 3 + 16] = o.y,
                    Up(this, Cp, "f")[6 * e * 3 + 17] = o.z,
                    Up(this, Pp, "f").needsUpdate = !0,
                    Up(this, Rp, "f") >= Up(this, Ip, "f") - 1 && Bp(this, Rp, 0, "f")
                }
                Bp(this, Lp, h, "f"),
                Bp(this, Dp, d, "f")
            }
        }
        Mp = zp,
        _p = new WeakMap,
        Tp = new WeakMap,
        Cp = new WeakMap,
        Pp = new WeakMap,
        Ip = new WeakMap,
        Rp = new WeakMap,
        Lp = new WeakMap,
        Dp = new WeakMap,
        Np = {
            value: new Qi({
                color: 1118481,
                side: 2,
                polygonOffset: !0,
                polygonOffsetFactor: -1,
                polygonOffsetUnits: 0
            })
        };
        const Op = zp;
        var Fp, Wp = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, Hp = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class Vp {
            constructor(e) {
                if (Fp.set(this, 0),
                null != e) {
                    if (!Number.isSafeInteger(e))
                        throw new Error("Frames is not a safe integer");
                    Wp(this, Fp, e, "f")
                }
            }
            get numberOfFrames() {
                return Hp(this, Fp, "f")
            }
            get time() {
                return Hp(this, Fp, "f") / 1e3
            }
            increment() {
                var e;
                Wp(this, Fp, (e = Hp(this, Fp, "f"),
                ++e), "f")
            }
            difference(e) {
                return new Vp(Hp(this, Fp, "f") - Hp(e, Fp, "f"))
            }
            lessThan(e) {
                return Hp(this, Fp, "f") < Hp(e, Fp, "f")
            }
            greaterThan(e) {
                return Hp(this, Fp, "f") > Hp(e, Fp, "f")
            }
            lessOrEqual(e) {
                return Hp(this, Fp, "f") <= Hp(e, Fp, "f")
            }
            greaterOrEqual(e) {
                return Hp(this, Fp, "f") >= Hp(e, Fp, "f")
            }
            equals(e) {
                return Hp(this, Fp, "f") == Hp(e, Fp, "f")
            }
            isNegative() {
                return Hp(this, Fp, "f") < 0
            }
            clone() {
                const e = new Vp;
                return Wp(e, Fp, Hp(this, Fp, "f"), "f"),
                e
            }
        }
        Fp = new WeakMap;
        const Gp = Vp;
        function jp(e) {
            let t = e.length;
            for (; --t >= 0; )
                e[t] = 0
        }
        const Qp = 256
          , Kp = 286
          , qp = 30
          , Yp = 15
          , Xp = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0])
          , Zp = new Uint8Array([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13])
          , Jp = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7])
          , $p = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
          , ef = new Array(576);
        jp(ef);
        const tf = new Array(60);
        jp(tf);
        const nf = new Array(512);
        jp(nf);
        const rf = new Array(256);
        jp(rf);
        const af = new Array(29);
        jp(af);
        const sf = new Array(qp);
        function of(e, t, n, i, r) {
            this.static_tree = e,
            this.extra_bits = t,
            this.extra_base = n,
            this.elems = i,
            this.max_length = r,
            this.has_stree = e && e.length
        }
        let lf, cf, hf;
        function df(e, t) {
            this.dyn_tree = e,
            this.max_code = 0,
            this.stat_desc = t
        }
        jp(sf);
        const uf = e => e < 256 ? nf[e] : nf[256 + (e >>> 7)]
          , pf = (e, t) => {
            e.pending_buf[e.pending++] = 255 & t,
            e.pending_buf[e.pending++] = t >>> 8 & 255
        }
          , ff = (e, t, n) => {
            e.bi_valid > 16 - n ? (e.bi_buf |= t << e.bi_valid & 65535,
            pf(e, e.bi_buf),
            e.bi_buf = t >> 16 - e.bi_valid,
            e.bi_valid += n - 16) : (e.bi_buf |= t << e.bi_valid & 65535,
            e.bi_valid += n)
        }
          , mf = (e, t, n) => {
            ff(e, n[2 * t], n[2 * t + 1])
        }
          , gf = (e, t) => {
            let n = 0;
            do {
                n |= 1 & e,
                e >>>= 1,
                n <<= 1
            } while (--t > 0);
            return n >>> 1
        }
          , vf = (e, t, n) => {
            const i = new Array(16);
            let r, a, s = 0;
            for (r = 1; r <= Yp; r++)
                s = s + n[r - 1] << 1,
                i[r] = s;
            for (a = 0; a <= t; a++) {
                let t = e[2 * a + 1];
                0 !== t && (e[2 * a] = gf(i[t]++, t))
            }
        }
          , wf = e => {
            let t;
            for (t = 0; t < Kp; t++)
                e.dyn_ltree[2 * t] = 0;
            for (t = 0; t < qp; t++)
                e.dyn_dtree[2 * t] = 0;
            for (t = 0; t < 19; t++)
                e.bl_tree[2 * t] = 0;
            e.dyn_ltree[512] = 1,
            e.opt_len = e.static_len = 0,
            e.sym_next = e.matches = 0
        }
          , yf = e => {
            e.bi_valid > 8 ? pf(e, e.bi_buf) : e.bi_valid > 0 && (e.pending_buf[e.pending++] = e.bi_buf),
            e.bi_buf = 0,
            e.bi_valid = 0
        }
          , bf = (e, t, n, i) => {
            const r = 2 * t
              , a = 2 * n;
            return e[r] < e[a] || e[r] === e[a] && i[t] <= i[n]
        }
          , Af = (e, t, n) => {
            const i = e.heap[n];
            let r = n << 1;
            for (; r <= e.heap_len && (r < e.heap_len && bf(t, e.heap[r + 1], e.heap[r], e.depth) && r++,
            !bf(t, i, e.heap[r], e.depth)); )
                e.heap[n] = e.heap[r],
                n = r,
                r <<= 1;
            e.heap[n] = i
        }
          , xf = (e, t, n) => {
            let i, r, a, s, o = 0;
            if (0 !== e.sym_next)
                do {
                    i = 255 & e.pending_buf[e.sym_buf + o++],
                    i += (255 & e.pending_buf[e.sym_buf + o++]) << 8,
                    r = e.pending_buf[e.sym_buf + o++],
                    0 === i ? mf(e, r, t) : (a = rf[r],
                    mf(e, a + Qp + 1, t),
                    s = Xp[a],
                    0 !== s && (r -= af[a],
                    ff(e, r, s)),
                    i--,
                    a = uf(i),
                    mf(e, a, n),
                    s = Zp[a],
                    0 !== s && (i -= sf[a],
                    ff(e, i, s)))
                } while (o < e.sym_next);
            mf(e, 256, t)
        }
          , kf = (e, t) => {
            const n = t.dyn_tree
              , i = t.stat_desc.static_tree
              , r = t.stat_desc.has_stree
              , a = t.stat_desc.elems;
            let s, o, l, c = -1;
            for (e.heap_len = 0,
            e.heap_max = 573,
            s = 0; s < a; s++)
                0 !== n[2 * s] ? (e.heap[++e.heap_len] = c = s,
                e.depth[s] = 0) : n[2 * s + 1] = 0;
            for (; e.heap_len < 2; )
                l = e.heap[++e.heap_len] = c < 2 ? ++c : 0,
                n[2 * l] = 1,
                e.depth[l] = 0,
                e.opt_len--,
                r && (e.static_len -= i[2 * l + 1]);
            for (t.max_code = c,
            s = e.heap_len >> 1; s >= 1; s--)
                Af(e, n, s);
            l = a;
            do {
                s = e.heap[1],
                e.heap[1] = e.heap[e.heap_len--],
                Af(e, n, 1),
                o = e.heap[1],
                e.heap[--e.heap_max] = s,
                e.heap[--e.heap_max] = o,
                n[2 * l] = n[2 * s] + n[2 * o],
                e.depth[l] = (e.depth[s] >= e.depth[o] ? e.depth[s] : e.depth[o]) + 1,
                n[2 * s + 1] = n[2 * o + 1] = l,
                e.heap[1] = l++,
                Af(e, n, 1)
            } while (e.heap_len >= 2);
            e.heap[--e.heap_max] = e.heap[1],
            ( (e, t) => {
                const n = t.dyn_tree
                  , i = t.max_code
                  , r = t.stat_desc.static_tree
                  , a = t.stat_desc.has_stree
                  , s = t.stat_desc.extra_bits
                  , o = t.stat_desc.extra_base
                  , l = t.stat_desc.max_length;
                let c, h, d, u, p, f, m = 0;
                for (u = 0; u <= Yp; u++)
                    e.bl_count[u] = 0;
                for (n[2 * e.heap[e.heap_max] + 1] = 0,
                c = e.heap_max + 1; c < 573; c++)
                    h = e.heap[c],
                    u = n[2 * n[2 * h + 1] + 1] + 1,
                    u > l && (u = l,
                    m++),
                    n[2 * h + 1] = u,
                    h > i || (e.bl_count[u]++,
                    p = 0,
                    h >= o && (p = s[h - o]),
                    f = n[2 * h],
                    e.opt_len += f * (u + p),
                    a && (e.static_len += f * (r[2 * h + 1] + p)));
                if (0 !== m) {
                    do {
                        for (u = l - 1; 0 === e.bl_count[u]; )
                            u--;
                        e.bl_count[u]--,
                        e.bl_count[u + 1] += 2,
                        e.bl_count[l]--,
                        m -= 2
                    } while (m > 0);
                    for (u = l; 0 !== u; u--)
                        for (h = e.bl_count[u]; 0 !== h; )
                            d = e.heap[--c],
                            d > i || (n[2 * d + 1] !== u && (e.opt_len += (u - n[2 * d + 1]) * n[2 * d],
                            n[2 * d + 1] = u),
                            h--)
                }
            }
            )(e, t),
            vf(n, c, e.bl_count)
        }
          , Ef = (e, t, n) => {
            let i, r, a = -1, s = t[1], o = 0, l = 7, c = 4;
            for (0 === s && (l = 138,
            c = 3),
            t[2 * (n + 1) + 1] = 65535,
            i = 0; i <= n; i++)
                r = s,
                s = t[2 * (i + 1) + 1],
                ++o < l && r === s || (o < c ? e.bl_tree[2 * r] += o : 0 !== r ? (r !== a && e.bl_tree[2 * r]++,
                e.bl_tree[32]++) : o <= 10 ? e.bl_tree[34]++ : e.bl_tree[36]++,
                o = 0,
                a = r,
                0 === s ? (l = 138,
                c = 3) : r === s ? (l = 6,
                c = 3) : (l = 7,
                c = 4))
        }
          , Sf = (e, t, n) => {
            let i, r, a = -1, s = t[1], o = 0, l = 7, c = 4;
            for (0 === s && (l = 138,
            c = 3),
            i = 0; i <= n; i++)
                if (r = s,
                s = t[2 * (i + 1) + 1],
                !(++o < l && r === s)) {
                    if (o < c)
                        do {
                            mf(e, r, e.bl_tree)
                        } while (0 != --o);
                    else
                        0 !== r ? (r !== a && (mf(e, r, e.bl_tree),
                        o--),
                        mf(e, 16, e.bl_tree),
                        ff(e, o - 3, 2)) : o <= 10 ? (mf(e, 17, e.bl_tree),
                        ff(e, o - 3, 3)) : (mf(e, 18, e.bl_tree),
                        ff(e, o - 11, 7));
                    o = 0,
                    a = r,
                    0 === s ? (l = 138,
                    c = 3) : r === s ? (l = 6,
                    c = 3) : (l = 7,
                    c = 4)
                }
        }
        ;
        let Mf = !1;
        const _f = (e, t, n, i) => {
            ff(e, 0 + (i ? 1 : 0), 3),
            yf(e),
            pf(e, n),
            pf(e, ~n),
            n && e.pending_buf.set(e.window.subarray(t, t + n), e.pending),
            e.pending += n
        }
        ;
        var Tf = e => {
            Mf || (( () => {
                let e, t, n, i, r;
                const a = new Array(16);
                for (n = 0,
                i = 0; i < 28; i++)
                    for (af[i] = n,
                    e = 0; e < 1 << Xp[i]; e++)
                        rf[n++] = i;
                for (rf[n - 1] = i,
                r = 0,
                i = 0; i < 16; i++)
                    for (sf[i] = r,
                    e = 0; e < 1 << Zp[i]; e++)
                        nf[r++] = i;
                for (r >>= 7; i < qp; i++)
                    for (sf[i] = r << 7,
                    e = 0; e < 1 << Zp[i] - 7; e++)
                        nf[256 + r++] = i;
                for (t = 0; t <= Yp; t++)
                    a[t] = 0;
                for (e = 0; e <= 143; )
                    ef[2 * e + 1] = 8,
                    e++,
                    a[8]++;
                for (; e <= 255; )
                    ef[2 * e + 1] = 9,
                    e++,
                    a[9]++;
                for (; e <= 279; )
                    ef[2 * e + 1] = 7,
                    e++,
                    a[7]++;
                for (; e <= 287; )
                    ef[2 * e + 1] = 8,
                    e++,
                    a[8]++;
                for (vf(ef, 287, a),
                e = 0; e < qp; e++)
                    tf[2 * e + 1] = 5,
                    tf[2 * e] = gf(e, 5);
                lf = new of(ef,Xp,257,Kp,Yp),
                cf = new of(tf,Zp,0,qp,Yp),
                hf = new of(new Array(0),Jp,0,19,7)
            }
            )(),
            Mf = !0),
            e.l_desc = new df(e.dyn_ltree,lf),
            e.d_desc = new df(e.dyn_dtree,cf),
            e.bl_desc = new df(e.bl_tree,hf),
            e.bi_buf = 0,
            e.bi_valid = 0,
            wf(e)
        }
          , Cf = (e, t, n, i) => {
            let r, a, s = 0;
            e.level > 0 ? (2 === e.strm.data_type && (e.strm.data_type = (e => {
                let t, n = 4093624447;
                for (t = 0; t <= 31; t++,
                n >>>= 1)
                    if (1 & n && 0 !== e.dyn_ltree[2 * t])
                        return 0;
                if (0 !== e.dyn_ltree[18] || 0 !== e.dyn_ltree[20] || 0 !== e.dyn_ltree[26])
                    return 1;
                for (t = 32; t < Qp; t++)
                    if (0 !== e.dyn_ltree[2 * t])
                        return 1;
                return 0
            }
            )(e)),
            kf(e, e.l_desc),
            kf(e, e.d_desc),
            s = (e => {
                let t;
                for (Ef(e, e.dyn_ltree, e.l_desc.max_code),
                Ef(e, e.dyn_dtree, e.d_desc.max_code),
                kf(e, e.bl_desc),
                t = 18; t >= 3 && 0 === e.bl_tree[2 * $p[t] + 1]; t--)
                    ;
                return e.opt_len += 3 * (t + 1) + 5 + 5 + 4,
                t
            }
            )(e),
            r = e.opt_len + 3 + 7 >>> 3,
            a = e.static_len + 3 + 7 >>> 3,
            a <= r && (r = a)) : r = a = n + 5,
            n + 4 <= r && -1 !== t ? _f(e, t, n, i) : 4 === e.strategy || a === r ? (ff(e, 2 + (i ? 1 : 0), 3),
            xf(e, ef, tf)) : (ff(e, 4 + (i ? 1 : 0), 3),
            ( (e, t, n, i) => {
                let r;
                for (ff(e, t - 257, 5),
                ff(e, n - 1, 5),
                ff(e, i - 4, 4),
                r = 0; r < i; r++)
                    ff(e, e.bl_tree[2 * $p[r] + 1], 3);
                Sf(e, e.dyn_ltree, t - 1),
                Sf(e, e.dyn_dtree, n - 1)
            }
            )(e, e.l_desc.max_code + 1, e.d_desc.max_code + 1, s + 1),
            xf(e, e.dyn_ltree, e.dyn_dtree)),
            wf(e),
            i && yf(e)
        }
          , Pf = (e, t, n) => (e.pending_buf[e.sym_buf + e.sym_next++] = t,
        e.pending_buf[e.sym_buf + e.sym_next++] = t >> 8,
        e.pending_buf[e.sym_buf + e.sym_next++] = n,
        0 === t ? e.dyn_ltree[2 * n]++ : (e.matches++,
        t--,
        e.dyn_ltree[2 * (rf[n] + Qp + 1)]++,
        e.dyn_dtree[2 * uf(t)]++),
        e.sym_next === e.sym_end)
          , If = {
            _tr_init: Tf,
            _tr_stored_block: _f,
            _tr_flush_block: Cf,
            _tr_tally: Pf,
            _tr_align: e => {
                ff(e, 2, 3),
                mf(e, 256, ef),
                (e => {
                    16 === e.bi_valid ? (pf(e, e.bi_buf),
                    e.bi_buf = 0,
                    e.bi_valid = 0) : e.bi_valid >= 8 && (e.pending_buf[e.pending++] = 255 & e.bi_buf,
                    e.bi_buf >>= 8,
                    e.bi_valid -= 8)
                }
                )(e)
            }
        };
        var Rf = (e, t, n, i) => {
            let r = 65535 & e
              , a = e >>> 16 & 65535
              , s = 0;
            for (; 0 !== n; ) {
                s = n > 2e3 ? 2e3 : n,
                n -= s;
                do {
                    r = r + t[i++] | 0,
                    a = a + r | 0
                } while (--s);
                r %= 65521,
                a %= 65521
            }
            return r | a << 16
        }
        ;
        const Lf = new Uint32Array(( () => {
            let e, t = [];
            for (var n = 0; n < 256; n++) {
                e = n;
                for (var i = 0; i < 8; i++)
                    e = 1 & e ? 3988292384 ^ e >>> 1 : e >>> 1;
                t[n] = e
            }
            return t
        }
        )());
        var Df = (e, t, n, i) => {
            const r = Lf
              , a = i + n;
            e ^= -1;
            for (let n = i; n < a; n++)
                e = e >>> 8 ^ r[255 & (e ^ t[n])];
            return ~e
        }
          , Nf = {
            2: "need dictionary",
            1: "stream end",
            0: "",
            "-1": "file error",
            "-2": "stream error",
            "-3": "data error",
            "-4": "insufficient memory",
            "-5": "buffer error",
            "-6": "incompatible version"
        }
          , Bf = {
            Z_NO_FLUSH: 0,
            Z_PARTIAL_FLUSH: 1,
            Z_SYNC_FLUSH: 2,
            Z_FULL_FLUSH: 3,
            Z_FINISH: 4,
            Z_BLOCK: 5,
            Z_TREES: 6,
            Z_OK: 0,
            Z_STREAM_END: 1,
            Z_NEED_DICT: 2,
            Z_ERRNO: -1,
            Z_STREAM_ERROR: -2,
            Z_DATA_ERROR: -3,
            Z_MEM_ERROR: -4,
            Z_BUF_ERROR: -5,
            Z_NO_COMPRESSION: 0,
            Z_BEST_SPEED: 1,
            Z_BEST_COMPRESSION: 9,
            Z_DEFAULT_COMPRESSION: -1,
            Z_FILTERED: 1,
            Z_HUFFMAN_ONLY: 2,
            Z_RLE: 3,
            Z_FIXED: 4,
            Z_DEFAULT_STRATEGY: 0,
            Z_BINARY: 0,
            Z_TEXT: 1,
            Z_UNKNOWN: 2,
            Z_DEFLATED: 8
        };
        const {_tr_init: Uf, _tr_stored_block: zf, _tr_flush_block: Of, _tr_tally: Ff, _tr_align: Wf} = If
          , {Z_NO_FLUSH: Hf, Z_PARTIAL_FLUSH: Vf, Z_FULL_FLUSH: Gf, Z_FINISH: jf, Z_BLOCK: Qf, Z_OK: Kf, Z_STREAM_END: qf, Z_STREAM_ERROR: Yf, Z_DATA_ERROR: Xf, Z_BUF_ERROR: Zf, Z_DEFAULT_COMPRESSION: Jf, Z_FILTERED: $f, Z_HUFFMAN_ONLY: em, Z_RLE: tm, Z_FIXED: nm, Z_DEFAULT_STRATEGY: im, Z_UNKNOWN: rm, Z_DEFLATED: am} = Bf
          , sm = 258
          , om = 262
          , lm = 42
          , cm = 113
          , hm = 666
          , dm = (e, t) => (e.msg = Nf[t],
        t)
          , um = e => 2 * e - (e > 4 ? 9 : 0)
          , pm = e => {
            let t = e.length;
            for (; --t >= 0; )
                e[t] = 0
        }
          , fm = e => {
            let t, n, i, r = e.w_size;
            t = e.hash_size,
            i = t;
            do {
                n = e.head[--i],
                e.head[i] = n >= r ? n - r : 0
            } while (--t);
            t = r,
            i = t;
            do {
                n = e.prev[--i],
                e.prev[i] = n >= r ? n - r : 0
            } while (--t)
        }
        ;
        let mm = (e, t, n) => (t << e.hash_shift ^ n) & e.hash_mask;
        const gm = e => {
            const t = e.state;
            let n = t.pending;
            n > e.avail_out && (n = e.avail_out),
            0 !== n && (e.output.set(t.pending_buf.subarray(t.pending_out, t.pending_out + n), e.next_out),
            e.next_out += n,
            t.pending_out += n,
            e.total_out += n,
            e.avail_out -= n,
            t.pending -= n,
            0 === t.pending && (t.pending_out = 0))
        }
          , vm = (e, t) => {
            Of(e, e.block_start >= 0 ? e.block_start : -1, e.strstart - e.block_start, t),
            e.block_start = e.strstart,
            gm(e.strm)
        }
          , wm = (e, t) => {
            e.pending_buf[e.pending++] = t
        }
          , ym = (e, t) => {
            e.pending_buf[e.pending++] = t >>> 8 & 255,
            e.pending_buf[e.pending++] = 255 & t
        }
          , bm = (e, t, n, i) => {
            let r = e.avail_in;
            return r > i && (r = i),
            0 === r ? 0 : (e.avail_in -= r,
            t.set(e.input.subarray(e.next_in, e.next_in + r), n),
            1 === e.state.wrap ? e.adler = Rf(e.adler, t, r, n) : 2 === e.state.wrap && (e.adler = Df(e.adler, t, r, n)),
            e.next_in += r,
            e.total_in += r,
            r)
        }
          , Am = (e, t) => {
            let n, i, r = e.max_chain_length, a = e.strstart, s = e.prev_length, o = e.nice_match;
            const l = e.strstart > e.w_size - om ? e.strstart - (e.w_size - om) : 0
              , c = e.window
              , h = e.w_mask
              , d = e.prev
              , u = e.strstart + sm;
            let p = c[a + s - 1]
              , f = c[a + s];
            e.prev_length >= e.good_match && (r >>= 2),
            o > e.lookahead && (o = e.lookahead);
            do {
                if (n = t,
                c[n + s] === f && c[n + s - 1] === p && c[n] === c[a] && c[++n] === c[a + 1]) {
                    a += 2,
                    n++;
                    do {} while (c[++a] === c[++n] && c[++a] === c[++n] && c[++a] === c[++n] && c[++a] === c[++n] && c[++a] === c[++n] && c[++a] === c[++n] && c[++a] === c[++n] && c[++a] === c[++n] && a < u);
                    if (i = sm - (u - a),
                    a = u - sm,
                    i > s) {
                        if (e.match_start = t,
                        s = i,
                        i >= o)
                            break;
                        p = c[a + s - 1],
                        f = c[a + s]
                    }
                }
            } while ((t = d[t & h]) > l && 0 != --r);
            return s <= e.lookahead ? s : e.lookahead
        }
          , xm = e => {
            const t = e.w_size;
            let n, i, r;
            do {
                if (i = e.window_size - e.lookahead - e.strstart,
                e.strstart >= t + (t - om) && (e.window.set(e.window.subarray(t, t + t - i), 0),
                e.match_start -= t,
                e.strstart -= t,
                e.block_start -= t,
                e.insert > e.strstart && (e.insert = e.strstart),
                fm(e),
                i += t),
                0 === e.strm.avail_in)
                    break;
                if (n = bm(e.strm, e.window, e.strstart + e.lookahead, i),
                e.lookahead += n,
                e.lookahead + e.insert >= 3)
                    for (r = e.strstart - e.insert,
                    e.ins_h = e.window[r],
                    e.ins_h = mm(e, e.ins_h, e.window[r + 1]); e.insert && (e.ins_h = mm(e, e.ins_h, e.window[r + 3 - 1]),
                    e.prev[r & e.w_mask] = e.head[e.ins_h],
                    e.head[e.ins_h] = r,
                    r++,
                    e.insert--,
                    !(e.lookahead + e.insert < 3)); )
                        ;
            } while (e.lookahead < om && 0 !== e.strm.avail_in)
        }
          , km = (e, t) => {
            let n, i, r, a = e.pending_buf_size - 5 > e.w_size ? e.w_size : e.pending_buf_size - 5, s = 0, o = e.strm.avail_in;
            do {
                if (n = 65535,
                r = e.bi_valid + 42 >> 3,
                e.strm.avail_out < r)
                    break;
                if (r = e.strm.avail_out - r,
                i = e.strstart - e.block_start,
                n > i + e.strm.avail_in && (n = i + e.strm.avail_in),
                n > r && (n = r),
                n < a && (0 === n && t !== jf || t === Hf || n !== i + e.strm.avail_in))
                    break;
                s = t === jf && n === i + e.strm.avail_in ? 1 : 0,
                zf(e, 0, 0, s),
                e.pending_buf[e.pending - 4] = n,
                e.pending_buf[e.pending - 3] = n >> 8,
                e.pending_buf[e.pending - 2] = ~n,
                e.pending_buf[e.pending - 1] = ~n >> 8,
                gm(e.strm),
                i && (i > n && (i = n),
                e.strm.output.set(e.window.subarray(e.block_start, e.block_start + i), e.strm.next_out),
                e.strm.next_out += i,
                e.strm.avail_out -= i,
                e.strm.total_out += i,
                e.block_start += i,
                n -= i),
                n && (bm(e.strm, e.strm.output, e.strm.next_out, n),
                e.strm.next_out += n,
                e.strm.avail_out -= n,
                e.strm.total_out += n)
            } while (0 === s);
            return o -= e.strm.avail_in,
            o && (o >= e.w_size ? (e.matches = 2,
            e.window.set(e.strm.input.subarray(e.strm.next_in - e.w_size, e.strm.next_in), 0),
            e.strstart = e.w_size,
            e.insert = e.strstart) : (e.window_size - e.strstart <= o && (e.strstart -= e.w_size,
            e.window.set(e.window.subarray(e.w_size, e.w_size + e.strstart), 0),
            e.matches < 2 && e.matches++,
            e.insert > e.strstart && (e.insert = e.strstart)),
            e.window.set(e.strm.input.subarray(e.strm.next_in - o, e.strm.next_in), e.strstart),
            e.strstart += o,
            e.insert += o > e.w_size - e.insert ? e.w_size - e.insert : o),
            e.block_start = e.strstart),
            e.high_water < e.strstart && (e.high_water = e.strstart),
            s ? 4 : t !== Hf && t !== jf && 0 === e.strm.avail_in && e.strstart === e.block_start ? 2 : (r = e.window_size - e.strstart,
            e.strm.avail_in > r && e.block_start >= e.w_size && (e.block_start -= e.w_size,
            e.strstart -= e.w_size,
            e.window.set(e.window.subarray(e.w_size, e.w_size + e.strstart), 0),
            e.matches < 2 && e.matches++,
            r += e.w_size,
            e.insert > e.strstart && (e.insert = e.strstart)),
            r > e.strm.avail_in && (r = e.strm.avail_in),
            r && (bm(e.strm, e.window, e.strstart, r),
            e.strstart += r,
            e.insert += r > e.w_size - e.insert ? e.w_size - e.insert : r),
            e.high_water < e.strstart && (e.high_water = e.strstart),
            r = e.bi_valid + 42 >> 3,
            r = e.pending_buf_size - r > 65535 ? 65535 : e.pending_buf_size - r,
            a = r > e.w_size ? e.w_size : r,
            i = e.strstart - e.block_start,
            (i >= a || (i || t === jf) && t !== Hf && 0 === e.strm.avail_in && i <= r) && (n = i > r ? r : i,
            s = t === jf && 0 === e.strm.avail_in && n === i ? 1 : 0,
            zf(e, e.block_start, n, s),
            e.block_start += n,
            gm(e.strm)),
            s ? 3 : 1)
        }
          , Em = (e, t) => {
            let n, i;
            for (; ; ) {
                if (e.lookahead < om) {
                    if (xm(e),
                    e.lookahead < om && t === Hf)
                        return 1;
                    if (0 === e.lookahead)
                        break
                }
                if (n = 0,
                e.lookahead >= 3 && (e.ins_h = mm(e, e.ins_h, e.window[e.strstart + 3 - 1]),
                n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h],
                e.head[e.ins_h] = e.strstart),
                0 !== n && e.strstart - n <= e.w_size - om && (e.match_length = Am(e, n)),
                e.match_length >= 3)
                    if (i = Ff(e, e.strstart - e.match_start, e.match_length - 3),
                    e.lookahead -= e.match_length,
                    e.match_length <= e.max_lazy_match && e.lookahead >= 3) {
                        e.match_length--;
                        do {
                            e.strstart++,
                            e.ins_h = mm(e, e.ins_h, e.window[e.strstart + 3 - 1]),
                            n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h],
                            e.head[e.ins_h] = e.strstart
                        } while (0 != --e.match_length);
                        e.strstart++
                    } else
                        e.strstart += e.match_length,
                        e.match_length = 0,
                        e.ins_h = e.window[e.strstart],
                        e.ins_h = mm(e, e.ins_h, e.window[e.strstart + 1]);
                else
                    i = Ff(e, 0, e.window[e.strstart]),
                    e.lookahead--,
                    e.strstart++;
                if (i && (vm(e, !1),
                0 === e.strm.avail_out))
                    return 1
            }
            return e.insert = e.strstart < 2 ? e.strstart : 2,
            t === jf ? (vm(e, !0),
            0 === e.strm.avail_out ? 3 : 4) : e.sym_next && (vm(e, !1),
            0 === e.strm.avail_out) ? 1 : 2
        }
          , Sm = (e, t) => {
            let n, i, r;
            for (; ; ) {
                if (e.lookahead < om) {
                    if (xm(e),
                    e.lookahead < om && t === Hf)
                        return 1;
                    if (0 === e.lookahead)
                        break
                }
                if (n = 0,
                e.lookahead >= 3 && (e.ins_h = mm(e, e.ins_h, e.window[e.strstart + 3 - 1]),
                n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h],
                e.head[e.ins_h] = e.strstart),
                e.prev_length = e.match_length,
                e.prev_match = e.match_start,
                e.match_length = 2,
                0 !== n && e.prev_length < e.max_lazy_match && e.strstart - n <= e.w_size - om && (e.match_length = Am(e, n),
                e.match_length <= 5 && (e.strategy === $f || 3 === e.match_length && e.strstart - e.match_start > 4096) && (e.match_length = 2)),
                e.prev_length >= 3 && e.match_length <= e.prev_length) {
                    r = e.strstart + e.lookahead - 3,
                    i = Ff(e, e.strstart - 1 - e.prev_match, e.prev_length - 3),
                    e.lookahead -= e.prev_length - 1,
                    e.prev_length -= 2;
                    do {
                        ++e.strstart <= r && (e.ins_h = mm(e, e.ins_h, e.window[e.strstart + 3 - 1]),
                        n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h],
                        e.head[e.ins_h] = e.strstart)
                    } while (0 != --e.prev_length);
                    if (e.match_available = 0,
                    e.match_length = 2,
                    e.strstart++,
                    i && (vm(e, !1),
                    0 === e.strm.avail_out))
                        return 1
                } else if (e.match_available) {
                    if (i = Ff(e, 0, e.window[e.strstart - 1]),
                    i && vm(e, !1),
                    e.strstart++,
                    e.lookahead--,
                    0 === e.strm.avail_out)
                        return 1
                } else
                    e.match_available = 1,
                    e.strstart++,
                    e.lookahead--
            }
            return e.match_available && (i = Ff(e, 0, e.window[e.strstart - 1]),
            e.match_available = 0),
            e.insert = e.strstart < 2 ? e.strstart : 2,
            t === jf ? (vm(e, !0),
            0 === e.strm.avail_out ? 3 : 4) : e.sym_next && (vm(e, !1),
            0 === e.strm.avail_out) ? 1 : 2
        }
        ;
        function Mm(e, t, n, i, r) {
            this.good_length = e,
            this.max_lazy = t,
            this.nice_length = n,
            this.max_chain = i,
            this.func = r
        }
        const _m = [new Mm(0,0,0,0,km), new Mm(4,4,8,4,Em), new Mm(4,5,16,8,Em), new Mm(4,6,32,32,Em), new Mm(4,4,16,16,Sm), new Mm(8,16,32,32,Sm), new Mm(8,16,128,128,Sm), new Mm(8,32,128,256,Sm), new Mm(32,128,258,1024,Sm), new Mm(32,258,258,4096,Sm)];
        function Tm() {
            this.strm = null,
            this.status = 0,
            this.pending_buf = null,
            this.pending_buf_size = 0,
            this.pending_out = 0,
            this.pending = 0,
            this.wrap = 0,
            this.gzhead = null,
            this.gzindex = 0,
            this.method = am,
            this.last_flush = -1,
            this.w_size = 0,
            this.w_bits = 0,
            this.w_mask = 0,
            this.window = null,
            this.window_size = 0,
            this.prev = null,
            this.head = null,
            this.ins_h = 0,
            this.hash_size = 0,
            this.hash_bits = 0,
            this.hash_mask = 0,
            this.hash_shift = 0,
            this.block_start = 0,
            this.match_length = 0,
            this.prev_match = 0,
            this.match_available = 0,
            this.strstart = 0,
            this.match_start = 0,
            this.lookahead = 0,
            this.prev_length = 0,
            this.max_chain_length = 0,
            this.max_lazy_match = 0,
            this.level = 0,
            this.strategy = 0,
            this.good_match = 0,
            this.nice_match = 0,
            this.dyn_ltree = new Uint16Array(1146),
            this.dyn_dtree = new Uint16Array(122),
            this.bl_tree = new Uint16Array(78),
            pm(this.dyn_ltree),
            pm(this.dyn_dtree),
            pm(this.bl_tree),
            this.l_desc = null,
            this.d_desc = null,
            this.bl_desc = null,
            this.bl_count = new Uint16Array(16),
            this.heap = new Uint16Array(573),
            pm(this.heap),
            this.heap_len = 0,
            this.heap_max = 0,
            this.depth = new Uint16Array(573),
            pm(this.depth),
            this.sym_buf = 0,
            this.lit_bufsize = 0,
            this.sym_next = 0,
            this.sym_end = 0,
            this.opt_len = 0,
            this.static_len = 0,
            this.matches = 0,
            this.insert = 0,
            this.bi_buf = 0,
            this.bi_valid = 0
        }
        const Cm = e => {
            if (!e)
                return 1;
            const t = e.state;
            return !t || t.strm !== e || t.status !== lm && 57 !== t.status && 69 !== t.status && 73 !== t.status && 91 !== t.status && 103 !== t.status && t.status !== cm && t.status !== hm ? 1 : 0
        }
          , Pm = e => {
            if (Cm(e))
                return dm(e, Yf);
            e.total_in = e.total_out = 0,
            e.data_type = rm;
            const t = e.state;
            return t.pending = 0,
            t.pending_out = 0,
            t.wrap < 0 && (t.wrap = -t.wrap),
            t.status = 2 === t.wrap ? 57 : t.wrap ? lm : cm,
            e.adler = 2 === t.wrap ? 0 : 1,
            t.last_flush = -2,
            Uf(t),
            Kf
        }
          , Im = e => {
            const t = Pm(e);
            var n;
            return t === Kf && ((n = e.state).window_size = 2 * n.w_size,
            pm(n.head),
            n.max_lazy_match = _m[n.level].max_lazy,
            n.good_match = _m[n.level].good_length,
            n.nice_match = _m[n.level].nice_length,
            n.max_chain_length = _m[n.level].max_chain,
            n.strstart = 0,
            n.block_start = 0,
            n.lookahead = 0,
            n.insert = 0,
            n.match_length = n.prev_length = 2,
            n.match_available = 0,
            n.ins_h = 0),
            t
        }
          , Rm = (e, t, n, i, r, a) => {
            if (!e)
                return Yf;
            let s = 1;
            if (t === Jf && (t = 6),
            i < 0 ? (s = 0,
            i = -i) : i > 15 && (s = 2,
            i -= 16),
            r < 1 || r > 9 || n !== am || i < 8 || i > 15 || t < 0 || t > 9 || a < 0 || a > nm || 8 === i && 1 !== s)
                return dm(e, Yf);
            8 === i && (i = 9);
            const o = new Tm;
            return e.state = o,
            o.strm = e,
            o.status = lm,
            o.wrap = s,
            o.gzhead = null,
            o.w_bits = i,
            o.w_size = 1 << o.w_bits,
            o.w_mask = o.w_size - 1,
            o.hash_bits = r + 7,
            o.hash_size = 1 << o.hash_bits,
            o.hash_mask = o.hash_size - 1,
            o.hash_shift = ~~((o.hash_bits + 3 - 1) / 3),
            o.window = new Uint8Array(2 * o.w_size),
            o.head = new Uint16Array(o.hash_size),
            o.prev = new Uint16Array(o.w_size),
            o.lit_bufsize = 1 << r + 6,
            o.pending_buf_size = 4 * o.lit_bufsize,
            o.pending_buf = new Uint8Array(o.pending_buf_size),
            o.sym_buf = o.lit_bufsize,
            o.sym_end = 3 * (o.lit_bufsize - 1),
            o.level = t,
            o.strategy = a,
            o.method = n,
            Im(e)
        }
        ;
        var Lm = {
            deflateInit: (e, t) => Rm(e, t, am, 15, 8, im),
            deflateInit2: Rm,
            deflateReset: Im,
            deflateResetKeep: Pm,
            deflateSetHeader: (e, t) => Cm(e) || 2 !== e.state.wrap ? Yf : (e.state.gzhead = t,
            Kf),
            deflate: (e, t) => {
                if (Cm(e) || t > Qf || t < 0)
                    return e ? dm(e, Yf) : Yf;
                const n = e.state;
                if (!e.output || 0 !== e.avail_in && !e.input || n.status === hm && t !== jf)
                    return dm(e, 0 === e.avail_out ? Zf : Yf);
                const i = n.last_flush;
                if (n.last_flush = t,
                0 !== n.pending) {
                    if (gm(e),
                    0 === e.avail_out)
                        return n.last_flush = -1,
                        Kf
                } else if (0 === e.avail_in && um(t) <= um(i) && t !== jf)
                    return dm(e, Zf);
                if (n.status === hm && 0 !== e.avail_in)
                    return dm(e, Zf);
                if (n.status === lm && 0 === n.wrap && (n.status = cm),
                n.status === lm) {
                    let t = am + (n.w_bits - 8 << 4) << 8
                      , i = -1;
                    if (i = n.strategy >= em || n.level < 2 ? 0 : n.level < 6 ? 1 : 6 === n.level ? 2 : 3,
                    t |= i << 6,
                    0 !== n.strstart && (t |= 32),
                    t += 31 - t % 31,
                    ym(n, t),
                    0 !== n.strstart && (ym(n, e.adler >>> 16),
                    ym(n, 65535 & e.adler)),
                    e.adler = 1,
                    n.status = cm,
                    gm(e),
                    0 !== n.pending)
                        return n.last_flush = -1,
                        Kf
                }
                if (57 === n.status)
                    if (e.adler = 0,
                    wm(n, 31),
                    wm(n, 139),
                    wm(n, 8),
                    n.gzhead)
                        wm(n, (n.gzhead.text ? 1 : 0) + (n.gzhead.hcrc ? 2 : 0) + (n.gzhead.extra ? 4 : 0) + (n.gzhead.name ? 8 : 0) + (n.gzhead.comment ? 16 : 0)),
                        wm(n, 255 & n.gzhead.time),
                        wm(n, n.gzhead.time >> 8 & 255),
                        wm(n, n.gzhead.time >> 16 & 255),
                        wm(n, n.gzhead.time >> 24 & 255),
                        wm(n, 9 === n.level ? 2 : n.strategy >= em || n.level < 2 ? 4 : 0),
                        wm(n, 255 & n.gzhead.os),
                        n.gzhead.extra && n.gzhead.extra.length && (wm(n, 255 & n.gzhead.extra.length),
                        wm(n, n.gzhead.extra.length >> 8 & 255)),
                        n.gzhead.hcrc && (e.adler = Df(e.adler, n.pending_buf, n.pending, 0)),
                        n.gzindex = 0,
                        n.status = 69;
                    else if (wm(n, 0),
                    wm(n, 0),
                    wm(n, 0),
                    wm(n, 0),
                    wm(n, 0),
                    wm(n, 9 === n.level ? 2 : n.strategy >= em || n.level < 2 ? 4 : 0),
                    wm(n, 3),
                    n.status = cm,
                    gm(e),
                    0 !== n.pending)
                        return n.last_flush = -1,
                        Kf;
                if (69 === n.status) {
                    if (n.gzhead.extra) {
                        let t = n.pending
                          , i = (65535 & n.gzhead.extra.length) - n.gzindex;
                        for (; n.pending + i > n.pending_buf_size; ) {
                            let r = n.pending_buf_size - n.pending;
                            if (n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex, n.gzindex + r), n.pending),
                            n.pending = n.pending_buf_size,
                            n.gzhead.hcrc && n.pending > t && (e.adler = Df(e.adler, n.pending_buf, n.pending - t, t)),
                            n.gzindex += r,
                            gm(e),
                            0 !== n.pending)
                                return n.last_flush = -1,
                                Kf;
                            t = 0,
                            i -= r
                        }
                        let r = new Uint8Array(n.gzhead.extra);
                        n.pending_buf.set(r.subarray(n.gzindex, n.gzindex + i), n.pending),
                        n.pending += i,
                        n.gzhead.hcrc && n.pending > t && (e.adler = Df(e.adler, n.pending_buf, n.pending - t, t)),
                        n.gzindex = 0
                    }
                    n.status = 73
                }
                if (73 === n.status) {
                    if (n.gzhead.name) {
                        let t, i = n.pending;
                        do {
                            if (n.pending === n.pending_buf_size) {
                                if (n.gzhead.hcrc && n.pending > i && (e.adler = Df(e.adler, n.pending_buf, n.pending - i, i)),
                                gm(e),
                                0 !== n.pending)
                                    return n.last_flush = -1,
                                    Kf;
                                i = 0
                            }
                            t = n.gzindex < n.gzhead.name.length ? 255 & n.gzhead.name.charCodeAt(n.gzindex++) : 0,
                            wm(n, t)
                        } while (0 !== t);
                        n.gzhead.hcrc && n.pending > i && (e.adler = Df(e.adler, n.pending_buf, n.pending - i, i)),
                        n.gzindex = 0
                    }
                    n.status = 91
                }
                if (91 === n.status) {
                    if (n.gzhead.comment) {
                        let t, i = n.pending;
                        do {
                            if (n.pending === n.pending_buf_size) {
                                if (n.gzhead.hcrc && n.pending > i && (e.adler = Df(e.adler, n.pending_buf, n.pending - i, i)),
                                gm(e),
                                0 !== n.pending)
                                    return n.last_flush = -1,
                                    Kf;
                                i = 0
                            }
                            t = n.gzindex < n.gzhead.comment.length ? 255 & n.gzhead.comment.charCodeAt(n.gzindex++) : 0,
                            wm(n, t)
                        } while (0 !== t);
                        n.gzhead.hcrc && n.pending > i && (e.adler = Df(e.adler, n.pending_buf, n.pending - i, i))
                    }
                    n.status = 103
                }
                if (103 === n.status) {
                    if (n.gzhead.hcrc) {
                        if (n.pending + 2 > n.pending_buf_size && (gm(e),
                        0 !== n.pending))
                            return n.last_flush = -1,
                            Kf;
                        wm(n, 255 & e.adler),
                        wm(n, e.adler >> 8 & 255),
                        e.adler = 0
                    }
                    if (n.status = cm,
                    gm(e),
                    0 !== n.pending)
                        return n.last_flush = -1,
                        Kf
                }
                if (0 !== e.avail_in || 0 !== n.lookahead || t !== Hf && n.status !== hm) {
                    let i = 0 === n.level ? km(n, t) : n.strategy === em ? ( (e, t) => {
                        let n;
                        for (; ; ) {
                            if (0 === e.lookahead && (xm(e),
                            0 === e.lookahead)) {
                                if (t === Hf)
                                    return 1;
                                break
                            }
                            if (e.match_length = 0,
                            n = Ff(e, 0, e.window[e.strstart]),
                            e.lookahead--,
                            e.strstart++,
                            n && (vm(e, !1),
                            0 === e.strm.avail_out))
                                return 1
                        }
                        return e.insert = 0,
                        t === jf ? (vm(e, !0),
                        0 === e.strm.avail_out ? 3 : 4) : e.sym_next && (vm(e, !1),
                        0 === e.strm.avail_out) ? 1 : 2
                    }
                    )(n, t) : n.strategy === tm ? ( (e, t) => {
                        let n, i, r, a;
                        const s = e.window;
                        for (; ; ) {
                            if (e.lookahead <= sm) {
                                if (xm(e),
                                e.lookahead <= sm && t === Hf)
                                    return 1;
                                if (0 === e.lookahead)
                                    break
                            }
                            if (e.match_length = 0,
                            e.lookahead >= 3 && e.strstart > 0 && (r = e.strstart - 1,
                            i = s[r],
                            i === s[++r] && i === s[++r] && i === s[++r])) {
                                a = e.strstart + sm;
                                do {} while (i === s[++r] && i === s[++r] && i === s[++r] && i === s[++r] && i === s[++r] && i === s[++r] && i === s[++r] && i === s[++r] && r < a);
                                e.match_length = sm - (a - r),
                                e.match_length > e.lookahead && (e.match_length = e.lookahead)
                            }
                            if (e.match_length >= 3 ? (n = Ff(e, 1, e.match_length - 3),
                            e.lookahead -= e.match_length,
                            e.strstart += e.match_length,
                            e.match_length = 0) : (n = Ff(e, 0, e.window[e.strstart]),
                            e.lookahead--,
                            e.strstart++),
                            n && (vm(e, !1),
                            0 === e.strm.avail_out))
                                return 1
                        }
                        return e.insert = 0,
                        t === jf ? (vm(e, !0),
                        0 === e.strm.avail_out ? 3 : 4) : e.sym_next && (vm(e, !1),
                        0 === e.strm.avail_out) ? 1 : 2
                    }
                    )(n, t) : _m[n.level].func(n, t);
                    if (3 !== i && 4 !== i || (n.status = hm),
                    1 === i || 3 === i)
                        return 0 === e.avail_out && (n.last_flush = -1),
                        Kf;
                    if (2 === i && (t === Vf ? Wf(n) : t !== Qf && (zf(n, 0, 0, !1),
                    t === Gf && (pm(n.head),
                    0 === n.lookahead && (n.strstart = 0,
                    n.block_start = 0,
                    n.insert = 0))),
                    gm(e),
                    0 === e.avail_out))
                        return n.last_flush = -1,
                        Kf
                }
                return t !== jf ? Kf : n.wrap <= 0 ? qf : (2 === n.wrap ? (wm(n, 255 & e.adler),
                wm(n, e.adler >> 8 & 255),
                wm(n, e.adler >> 16 & 255),
                wm(n, e.adler >> 24 & 255),
                wm(n, 255 & e.total_in),
                wm(n, e.total_in >> 8 & 255),
                wm(n, e.total_in >> 16 & 255),
                wm(n, e.total_in >> 24 & 255)) : (ym(n, e.adler >>> 16),
                ym(n, 65535 & e.adler)),
                gm(e),
                n.wrap > 0 && (n.wrap = -n.wrap),
                0 !== n.pending ? Kf : qf)
            }
            ,
            deflateEnd: e => {
                if (Cm(e))
                    return Yf;
                const t = e.state.status;
                return e.state = null,
                t === cm ? dm(e, Xf) : Kf
            }
            ,
            deflateSetDictionary: (e, t) => {
                let n = t.length;
                if (Cm(e))
                    return Yf;
                const i = e.state
                  , r = i.wrap;
                if (2 === r || 1 === r && i.status !== lm || i.lookahead)
                    return Yf;
                if (1 === r && (e.adler = Rf(e.adler, t, n, 0)),
                i.wrap = 0,
                n >= i.w_size) {
                    0 === r && (pm(i.head),
                    i.strstart = 0,
                    i.block_start = 0,
                    i.insert = 0);
                    let e = new Uint8Array(i.w_size);
                    e.set(t.subarray(n - i.w_size, n), 0),
                    t = e,
                    n = i.w_size
                }
                const a = e.avail_in
                  , s = e.next_in
                  , o = e.input;
                for (e.avail_in = n,
                e.next_in = 0,
                e.input = t,
                xm(i); i.lookahead >= 3; ) {
                    let e = i.strstart
                      , t = i.lookahead - 2;
                    do {
                        i.ins_h = mm(i, i.ins_h, i.window[e + 3 - 1]),
                        i.prev[e & i.w_mask] = i.head[i.ins_h],
                        i.head[i.ins_h] = e,
                        e++
                    } while (--t);
                    i.strstart = e,
                    i.lookahead = 2,
                    xm(i)
                }
                return i.strstart += i.lookahead,
                i.block_start = i.strstart,
                i.insert = i.lookahead,
                i.lookahead = 0,
                i.match_length = i.prev_length = 2,
                i.match_available = 0,
                e.next_in = s,
                e.input = o,
                e.avail_in = a,
                i.wrap = r,
                Kf
            }
            ,
            deflateInfo: "pako deflate (from Nodeca project)"
        };
        const Dm = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
        var Nm = function(e) {
            const t = Array.prototype.slice.call(arguments, 1);
            for (; t.length; ) {
                const n = t.shift();
                if (n) {
                    if ("object" != typeof n)
                        throw new TypeError(n + "must be non-object");
                    for (const t in n)
                        Dm(n, t) && (e[t] = n[t])
                }
            }
            return e
        }
          , Bm = e => {
            let t = 0;
            for (let n = 0, i = e.length; n < i; n++)
                t += e[n].length;
            const n = new Uint8Array(t);
            for (let t = 0, i = 0, r = e.length; t < r; t++) {
                let r = e[t];
                n.set(r, i),
                i += r.length
            }
            return n
        }
        ;
        let Um = !0;
        try {
            String.fromCharCode.apply(null, new Uint8Array(1))
        } catch (e) {
            Um = !1
        }
        const zm = new Uint8Array(256);
        for (let e = 0; e < 256; e++)
            zm[e] = e >= 252 ? 6 : e >= 248 ? 5 : e >= 240 ? 4 : e >= 224 ? 3 : e >= 192 ? 2 : 1;
        zm[254] = zm[254] = 1;
        var Om = e => {
            if ("function" == typeof TextEncoder && TextEncoder.prototype.encode)
                return (new TextEncoder).encode(e);
            let t, n, i, r, a, s = e.length, o = 0;
            for (r = 0; r < s; r++)
                n = e.charCodeAt(r),
                55296 == (64512 & n) && r + 1 < s && (i = e.charCodeAt(r + 1),
                56320 == (64512 & i) && (n = 65536 + (n - 55296 << 10) + (i - 56320),
                r++)),
                o += n < 128 ? 1 : n < 2048 ? 2 : n < 65536 ? 3 : 4;
            for (t = new Uint8Array(o),
            a = 0,
            r = 0; a < o; r++)
                n = e.charCodeAt(r),
                55296 == (64512 & n) && r + 1 < s && (i = e.charCodeAt(r + 1),
                56320 == (64512 & i) && (n = 65536 + (n - 55296 << 10) + (i - 56320),
                r++)),
                n < 128 ? t[a++] = n : n < 2048 ? (t[a++] = 192 | n >>> 6,
                t[a++] = 128 | 63 & n) : n < 65536 ? (t[a++] = 224 | n >>> 12,
                t[a++] = 128 | n >>> 6 & 63,
                t[a++] = 128 | 63 & n) : (t[a++] = 240 | n >>> 18,
                t[a++] = 128 | n >>> 12 & 63,
                t[a++] = 128 | n >>> 6 & 63,
                t[a++] = 128 | 63 & n);
            return t
        }
          , Fm = (e, t) => {
            const n = t || e.length;
            if ("function" == typeof TextDecoder && TextDecoder.prototype.decode)
                return (new TextDecoder).decode(e.subarray(0, t));
            let i, r;
            const a = new Array(2 * n);
            for (r = 0,
            i = 0; i < n; ) {
                let t = e[i++];
                if (t < 128) {
                    a[r++] = t;
                    continue
                }
                let s = zm[t];
                if (s > 4)
                    a[r++] = 65533,
                    i += s - 1;
                else {
                    for (t &= 2 === s ? 31 : 3 === s ? 15 : 7; s > 1 && i < n; )
                        t = t << 6 | 63 & e[i++],
                        s--;
                    s > 1 ? a[r++] = 65533 : t < 65536 ? a[r++] = t : (t -= 65536,
                    a[r++] = 55296 | t >> 10 & 1023,
                    a[r++] = 56320 | 1023 & t)
                }
            }
            return ( (e, t) => {
                if (t < 65534 && e.subarray && Um)
                    return String.fromCharCode.apply(null, e.length === t ? e : e.subarray(0, t));
                let n = "";
                for (let i = 0; i < t; i++)
                    n += String.fromCharCode(e[i]);
                return n
            }
            )(a, r)
        }
          , Wm = (e, t) => {
            (t = t || e.length) > e.length && (t = e.length);
            let n = t - 1;
            for (; n >= 0 && 128 == (192 & e[n]); )
                n--;
            return n < 0 || 0 === n ? t : n + zm[e[n]] > t ? n : t
        }
        ;
        var Hm = function() {
            this.input = null,
            this.next_in = 0,
            this.avail_in = 0,
            this.total_in = 0,
            this.output = null,
            this.next_out = 0,
            this.avail_out = 0,
            this.total_out = 0,
            this.msg = "",
            this.state = null,
            this.data_type = 2,
            this.adler = 0
        };
        const Vm = Object.prototype.toString
          , {Z_NO_FLUSH: Gm, Z_SYNC_FLUSH: jm, Z_FULL_FLUSH: Qm, Z_FINISH: Km, Z_OK: qm, Z_STREAM_END: Ym, Z_DEFAULT_COMPRESSION: Xm, Z_DEFAULT_STRATEGY: Zm, Z_DEFLATED: Jm} = Bf;
        function $m(e) {
            this.options = Nm({
                level: Xm,
                method: Jm,
                chunkSize: 16384,
                windowBits: 15,
                memLevel: 8,
                strategy: Zm
            }, e || {});
            let t = this.options;
            t.raw && t.windowBits > 0 ? t.windowBits = -t.windowBits : t.gzip && t.windowBits > 0 && t.windowBits < 16 && (t.windowBits += 16),
            this.err = 0,
            this.msg = "",
            this.ended = !1,
            this.chunks = [],
            this.strm = new Hm,
            this.strm.avail_out = 0;
            let n = Lm.deflateInit2(this.strm, t.level, t.method, t.windowBits, t.memLevel, t.strategy);
            if (n !== qm)
                throw new Error(Nf[n]);
            if (t.header && Lm.deflateSetHeader(this.strm, t.header),
            t.dictionary) {
                let e;
                if (e = "string" == typeof t.dictionary ? Om(t.dictionary) : "[object ArrayBuffer]" === Vm.call(t.dictionary) ? new Uint8Array(t.dictionary) : t.dictionary,
                n = Lm.deflateSetDictionary(this.strm, e),
                n !== qm)
                    throw new Error(Nf[n]);
                this._dict_set = !0
            }
        }
        function eg(e, t) {
            const n = new $m(t);
            if (n.push(e, !0),
            n.err)
                throw n.msg || Nf[n.err];
            return n.result
        }
        $m.prototype.push = function(e, t) {
            const n = this.strm
              , i = this.options.chunkSize;
            let r, a;
            if (this.ended)
                return !1;
            for (a = t === ~~t ? t : !0 === t ? Km : Gm,
            "string" == typeof e ? n.input = Om(e) : "[object ArrayBuffer]" === Vm.call(e) ? n.input = new Uint8Array(e) : n.input = e,
            n.next_in = 0,
            n.avail_in = n.input.length; ; )
                if (0 === n.avail_out && (n.output = new Uint8Array(i),
                n.next_out = 0,
                n.avail_out = i),
                (a === jm || a === Qm) && n.avail_out <= 6)
                    this.onData(n.output.subarray(0, n.next_out)),
                    n.avail_out = 0;
                else {
                    if (r = Lm.deflate(n, a),
                    r === Ym)
                        return n.next_out > 0 && this.onData(n.output.subarray(0, n.next_out)),
                        r = Lm.deflateEnd(this.strm),
                        this.onEnd(r),
                        this.ended = !0,
                        r === qm;
                    if (0 !== n.avail_out) {
                        if (a > 0 && n.next_out > 0)
                            this.onData(n.output.subarray(0, n.next_out)),
                            n.avail_out = 0;
                        else if (0 === n.avail_in)
                            break
                    } else
                        this.onData(n.output)
                }
            return !0
        }
        ,
        $m.prototype.onData = function(e) {
            this.chunks.push(e)
        }
        ,
        $m.prototype.onEnd = function(e) {
            e === qm && (this.result = Bm(this.chunks)),
            this.chunks = [],
            this.err = e,
            this.msg = this.strm.msg
        }
        ;
        var tg = function(e, t) {
            return (t = t || {}).raw = !0,
            eg(e, t)
        }
          , ng = function(e, t) {
            return (t = t || {}).gzip = !0,
            eg(e, t)
        }
          , ig = {
            Deflate: $m,
            deflate: eg,
            deflateRaw: tg,
            gzip: ng,
            constants: Bf
        };
        const rg = 16209;
        var ag = function(e, t) {
            let n, i, r, a, s, o, l, c, h, d, u, p, f, m, g, v, w, y, b, A, x, k, E, S;
            const M = e.state;
            n = e.next_in,
            E = e.input,
            i = n + (e.avail_in - 5),
            r = e.next_out,
            S = e.output,
            a = r - (t - e.avail_out),
            s = r + (e.avail_out - 257),
            o = M.dmax,
            l = M.wsize,
            c = M.whave,
            h = M.wnext,
            d = M.window,
            u = M.hold,
            p = M.bits,
            f = M.lencode,
            m = M.distcode,
            g = (1 << M.lenbits) - 1,
            v = (1 << M.distbits) - 1;
            e: do {
                p < 15 && (u += E[n++] << p,
                p += 8,
                u += E[n++] << p,
                p += 8),
                w = f[u & g];
                t: for (; ; ) {
                    if (y = w >>> 24,
                    u >>>= y,
                    p -= y,
                    y = w >>> 16 & 255,
                    0 === y)
                        S[r++] = 65535 & w;
                    else {
                        if (!(16 & y)) {
                            if (64 & y) {
                                if (32 & y) {
                                    M.mode = 16191;
                                    break e
                                }
                                e.msg = "invalid literal/length code",
                                M.mode = rg;
                                break e
                            }
                            w = f[(65535 & w) + (u & (1 << y) - 1)];
                            continue t
                        }
                        for (b = 65535 & w,
                        y &= 15,
                        y && (p < y && (u += E[n++] << p,
                        p += 8),
                        b += u & (1 << y) - 1,
                        u >>>= y,
                        p -= y),
                        p < 15 && (u += E[n++] << p,
                        p += 8,
                        u += E[n++] << p,
                        p += 8),
                        w = m[u & v]; ; ) {
                            if (y = w >>> 24,
                            u >>>= y,
                            p -= y,
                            y = w >>> 16 & 255,
                            16 & y) {
                                if (A = 65535 & w,
                                y &= 15,
                                p < y && (u += E[n++] << p,
                                p += 8,
                                p < y && (u += E[n++] << p,
                                p += 8)),
                                A += u & (1 << y) - 1,
                                A > o) {
                                    e.msg = "invalid distance too far back",
                                    M.mode = rg;
                                    break e
                                }
                                if (u >>>= y,
                                p -= y,
                                y = r - a,
                                A > y) {
                                    if (y = A - y,
                                    y > c && M.sane) {
                                        e.msg = "invalid distance too far back",
                                        M.mode = rg;
                                        break e
                                    }
                                    if (x = 0,
                                    k = d,
                                    0 === h) {
                                        if (x += l - y,
                                        y < b) {
                                            b -= y;
                                            do {
                                                S[r++] = d[x++]
                                            } while (--y);
                                            x = r - A,
                                            k = S
                                        }
                                    } else if (h < y) {
                                        if (x += l + h - y,
                                        y -= h,
                                        y < b) {
                                            b -= y;
                                            do {
                                                S[r++] = d[x++]
                                            } while (--y);
                                            if (x = 0,
                                            h < b) {
                                                y = h,
                                                b -= y;
                                                do {
                                                    S[r++] = d[x++]
                                                } while (--y);
                                                x = r - A,
                                                k = S
                                            }
                                        }
                                    } else if (x += h - y,
                                    y < b) {
                                        b -= y;
                                        do {
                                            S[r++] = d[x++]
                                        } while (--y);
                                        x = r - A,
                                        k = S
                                    }
                                    for (; b > 2; )
                                        S[r++] = k[x++],
                                        S[r++] = k[x++],
                                        S[r++] = k[x++],
                                        b -= 3;
                                    b && (S[r++] = k[x++],
                                    b > 1 && (S[r++] = k[x++]))
                                } else {
                                    x = r - A;
                                    do {
                                        S[r++] = S[x++],
                                        S[r++] = S[x++],
                                        S[r++] = S[x++],
                                        b -= 3
                                    } while (b > 2);
                                    b && (S[r++] = S[x++],
                                    b > 1 && (S[r++] = S[x++]))
                                }
                                break
                            }
                            if (64 & y) {
                                e.msg = "invalid distance code",
                                M.mode = rg;
                                break e
                            }
                            w = m[(65535 & w) + (u & (1 << y) - 1)]
                        }
                    }
                    break
                }
            } while (n < i && r < s);
            b = p >> 3,
            n -= b,
            p -= b << 3,
            u &= (1 << p) - 1,
            e.next_in = n,
            e.next_out = r,
            e.avail_in = n < i ? i - n + 5 : 5 - (n - i),
            e.avail_out = r < s ? s - r + 257 : 257 - (r - s),
            M.hold = u,
            M.bits = p
        };
        const sg = 15
          , og = new Uint16Array([3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0])
          , lg = new Uint8Array([16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78])
          , cg = new Uint16Array([1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0])
          , hg = new Uint8Array([16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]);
        var dg = (e, t, n, i, r, a, s, o) => {
            const l = o.bits;
            let c, h, d, u, p, f, m = 0, g = 0, v = 0, w = 0, y = 0, b = 0, A = 0, x = 0, k = 0, E = 0, S = null;
            const M = new Uint16Array(16)
              , _ = new Uint16Array(16);
            let T, C, P, I = null;
            for (m = 0; m <= sg; m++)
                M[m] = 0;
            for (g = 0; g < i; g++)
                M[t[n + g]]++;
            for (y = l,
            w = sg; w >= 1 && 0 === M[w]; w--)
                ;
            if (y > w && (y = w),
            0 === w)
                return r[a++] = 20971520,
                r[a++] = 20971520,
                o.bits = 1,
                0;
            for (v = 1; v < w && 0 === M[v]; v++)
                ;
            for (y < v && (y = v),
            x = 1,
            m = 1; m <= sg; m++)
                if (x <<= 1,
                x -= M[m],
                x < 0)
                    return -1;
            if (x > 0 && (0 === e || 1 !== w))
                return -1;
            for (_[1] = 0,
            m = 1; m < sg; m++)
                _[m + 1] = _[m] + M[m];
            for (g = 0; g < i; g++)
                0 !== t[n + g] && (s[_[t[n + g]]++] = g);
            if (0 === e ? (S = I = s,
            f = 20) : 1 === e ? (S = og,
            I = lg,
            f = 257) : (S = cg,
            I = hg,
            f = 0),
            E = 0,
            g = 0,
            m = v,
            p = a,
            b = y,
            A = 0,
            d = -1,
            k = 1 << y,
            u = k - 1,
            1 === e && k > 852 || 2 === e && k > 592)
                return 1;
            for (; ; ) {
                T = m - A,
                s[g] + 1 < f ? (C = 0,
                P = s[g]) : s[g] >= f ? (C = I[s[g] - f],
                P = S[s[g] - f]) : (C = 96,
                P = 0),
                c = 1 << m - A,
                h = 1 << b,
                v = h;
                do {
                    h -= c,
                    r[p + (E >> A) + h] = T << 24 | C << 16 | P
                } while (0 !== h);
                for (c = 1 << m - 1; E & c; )
                    c >>= 1;
                if (0 !== c ? (E &= c - 1,
                E += c) : E = 0,
                g++,
                0 == --M[m]) {
                    if (m === w)
                        break;
                    m = t[n + s[g]]
                }
                if (m > y && (E & u) !== d) {
                    for (0 === A && (A = y),
                    p += v,
                    b = m - A,
                    x = 1 << b; b + A < w && (x -= M[b + A],
                    !(x <= 0)); )
                        b++,
                        x <<= 1;
                    if (k += 1 << b,
                    1 === e && k > 852 || 2 === e && k > 592)
                        return 1;
                    d = E & u,
                    r[d] = y << 24 | b << 16 | p - a
                }
            }
            return 0 !== E && (r[p + E] = m - A << 24 | 64 << 16),
            o.bits = y,
            0
        }
        ;
        const {Z_FINISH: ug, Z_BLOCK: pg, Z_TREES: fg, Z_OK: mg, Z_STREAM_END: gg, Z_NEED_DICT: vg, Z_STREAM_ERROR: wg, Z_DATA_ERROR: yg, Z_MEM_ERROR: bg, Z_BUF_ERROR: Ag, Z_DEFLATED: xg} = Bf
          , kg = 16180
          , Eg = 16190
          , Sg = 16191
          , Mg = 16192
          , _g = 16194
          , Tg = 16199
          , Cg = 16200
          , Pg = 16206
          , Ig = 16209
          , Rg = e => (e >>> 24 & 255) + (e >>> 8 & 65280) + ((65280 & e) << 8) + ((255 & e) << 24);
        function Lg() {
            this.strm = null,
            this.mode = 0,
            this.last = !1,
            this.wrap = 0,
            this.havedict = !1,
            this.flags = 0,
            this.dmax = 0,
            this.check = 0,
            this.total = 0,
            this.head = null,
            this.wbits = 0,
            this.wsize = 0,
            this.whave = 0,
            this.wnext = 0,
            this.window = null,
            this.hold = 0,
            this.bits = 0,
            this.length = 0,
            this.offset = 0,
            this.extra = 0,
            this.lencode = null,
            this.distcode = null,
            this.lenbits = 0,
            this.distbits = 0,
            this.ncode = 0,
            this.nlen = 0,
            this.ndist = 0,
            this.have = 0,
            this.next = null,
            this.lens = new Uint16Array(320),
            this.work = new Uint16Array(288),
            this.lendyn = null,
            this.distdyn = null,
            this.sane = 0,
            this.back = 0,
            this.was = 0
        }
        const Dg = e => {
            if (!e)
                return 1;
            const t = e.state;
            return !t || t.strm !== e || t.mode < kg || t.mode > 16211 ? 1 : 0
        }
          , Ng = e => {
            if (Dg(e))
                return wg;
            const t = e.state;
            return e.total_in = e.total_out = t.total = 0,
            e.msg = "",
            t.wrap && (e.adler = 1 & t.wrap),
            t.mode = kg,
            t.last = 0,
            t.havedict = 0,
            t.flags = -1,
            t.dmax = 32768,
            t.head = null,
            t.hold = 0,
            t.bits = 0,
            t.lencode = t.lendyn = new Int32Array(852),
            t.distcode = t.distdyn = new Int32Array(592),
            t.sane = 1,
            t.back = -1,
            mg
        }
          , Bg = e => {
            if (Dg(e))
                return wg;
            const t = e.state;
            return t.wsize = 0,
            t.whave = 0,
            t.wnext = 0,
            Ng(e)
        }
          , Ug = (e, t) => {
            let n;
            if (Dg(e))
                return wg;
            const i = e.state;
            return t < 0 ? (n = 0,
            t = -t) : (n = 5 + (t >> 4),
            t < 48 && (t &= 15)),
            t && (t < 8 || t > 15) ? wg : (null !== i.window && i.wbits !== t && (i.window = null),
            i.wrap = n,
            i.wbits = t,
            Bg(e))
        }
          , zg = (e, t) => {
            if (!e)
                return wg;
            const n = new Lg;
            e.state = n,
            n.strm = e,
            n.window = null,
            n.mode = kg;
            const i = Ug(e, t);
            return i !== mg && (e.state = null),
            i
        }
        ;
        let Og, Fg, Wg = !0;
        const Hg = e => {
            if (Wg) {
                Og = new Int32Array(512),
                Fg = new Int32Array(32);
                let t = 0;
                for (; t < 144; )
                    e.lens[t++] = 8;
                for (; t < 256; )
                    e.lens[t++] = 9;
                for (; t < 280; )
                    e.lens[t++] = 7;
                for (; t < 288; )
                    e.lens[t++] = 8;
                for (dg(1, e.lens, 0, 288, Og, 0, e.work, {
                    bits: 9
                }),
                t = 0; t < 32; )
                    e.lens[t++] = 5;
                dg(2, e.lens, 0, 32, Fg, 0, e.work, {
                    bits: 5
                }),
                Wg = !1
            }
            e.lencode = Og,
            e.lenbits = 9,
            e.distcode = Fg,
            e.distbits = 5
        }
          , Vg = (e, t, n, i) => {
            let r;
            const a = e.state;
            return null === a.window && (a.wsize = 1 << a.wbits,
            a.wnext = 0,
            a.whave = 0,
            a.window = new Uint8Array(a.wsize)),
            i >= a.wsize ? (a.window.set(t.subarray(n - a.wsize, n), 0),
            a.wnext = 0,
            a.whave = a.wsize) : (r = a.wsize - a.wnext,
            r > i && (r = i),
            a.window.set(t.subarray(n - i, n - i + r), a.wnext),
            (i -= r) ? (a.window.set(t.subarray(n - i, n), 0),
            a.wnext = i,
            a.whave = a.wsize) : (a.wnext += r,
            a.wnext === a.wsize && (a.wnext = 0),
            a.whave < a.wsize && (a.whave += r))),
            0
        }
        ;
        var Gg = (e, t) => {
            let n, i, r, a, s, o, l, c, h, d, u, p, f, m, g, v, w, y, b, A, x, k, E = 0;
            const S = new Uint8Array(4);
            let M, _;
            const T = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
            if (Dg(e) || !e.output || !e.input && 0 !== e.avail_in)
                return wg;
            n = e.state,
            n.mode === Sg && (n.mode = Mg),
            s = e.next_out,
            r = e.output,
            l = e.avail_out,
            a = e.next_in,
            i = e.input,
            o = e.avail_in,
            c = n.hold,
            h = n.bits,
            d = o,
            u = l,
            k = mg;
            e: for (; ; )
                switch (n.mode) {
                case kg:
                    if (0 === n.wrap) {
                        n.mode = Mg;
                        break
                    }
                    for (; h < 16; ) {
                        if (0 === o)
                            break e;
                        o--,
                        c += i[a++] << h,
                        h += 8
                    }
                    if (2 & n.wrap && 35615 === c) {
                        0 === n.wbits && (n.wbits = 15),
                        n.check = 0,
                        S[0] = 255 & c,
                        S[1] = c >>> 8 & 255,
                        n.check = Df(n.check, S, 2, 0),
                        c = 0,
                        h = 0,
                        n.mode = 16181;
                        break
                    }
                    if (n.head && (n.head.done = !1),
                    !(1 & n.wrap) || (((255 & c) << 8) + (c >> 8)) % 31) {
                        e.msg = "incorrect header check",
                        n.mode = Ig;
                        break
                    }
                    if ((15 & c) !== xg) {
                        e.msg = "unknown compression method",
                        n.mode = Ig;
                        break
                    }
                    if (c >>>= 4,
                    h -= 4,
                    x = 8 + (15 & c),
                    0 === n.wbits && (n.wbits = x),
                    x > 15 || x > n.wbits) {
                        e.msg = "invalid window size",
                        n.mode = Ig;
                        break
                    }
                    n.dmax = 1 << n.wbits,
                    n.flags = 0,
                    e.adler = n.check = 1,
                    n.mode = 512 & c ? 16189 : Sg,
                    c = 0,
                    h = 0;
                    break;
                case 16181:
                    for (; h < 16; ) {
                        if (0 === o)
                            break e;
                        o--,
                        c += i[a++] << h,
                        h += 8
                    }
                    if (n.flags = c,
                    (255 & n.flags) !== xg) {
                        e.msg = "unknown compression method",
                        n.mode = Ig;
                        break
                    }
                    if (57344 & n.flags) {
                        e.msg = "unknown header flags set",
                        n.mode = Ig;
                        break
                    }
                    n.head && (n.head.text = c >> 8 & 1),
                    512 & n.flags && 4 & n.wrap && (S[0] = 255 & c,
                    S[1] = c >>> 8 & 255,
                    n.check = Df(n.check, S, 2, 0)),
                    c = 0,
                    h = 0,
                    n.mode = 16182;
                case 16182:
                    for (; h < 32; ) {
                        if (0 === o)
                            break e;
                        o--,
                        c += i[a++] << h,
                        h += 8
                    }
                    n.head && (n.head.time = c),
                    512 & n.flags && 4 & n.wrap && (S[0] = 255 & c,
                    S[1] = c >>> 8 & 255,
                    S[2] = c >>> 16 & 255,
                    S[3] = c >>> 24 & 255,
                    n.check = Df(n.check, S, 4, 0)),
                    c = 0,
                    h = 0,
                    n.mode = 16183;
                case 16183:
                    for (; h < 16; ) {
                        if (0 === o)
                            break e;
                        o--,
                        c += i[a++] << h,
                        h += 8
                    }
                    n.head && (n.head.xflags = 255 & c,
                    n.head.os = c >> 8),
                    512 & n.flags && 4 & n.wrap && (S[0] = 255 & c,
                    S[1] = c >>> 8 & 255,
                    n.check = Df(n.check, S, 2, 0)),
                    c = 0,
                    h = 0,
                    n.mode = 16184;
                case 16184:
                    if (1024 & n.flags) {
                        for (; h < 16; ) {
                            if (0 === o)
                                break e;
                            o--,
                            c += i[a++] << h,
                            h += 8
                        }
                        n.length = c,
                        n.head && (n.head.extra_len = c),
                        512 & n.flags && 4 & n.wrap && (S[0] = 255 & c,
                        S[1] = c >>> 8 & 255,
                        n.check = Df(n.check, S, 2, 0)),
                        c = 0,
                        h = 0
                    } else
                        n.head && (n.head.extra = null);
                    n.mode = 16185;
                case 16185:
                    if (1024 & n.flags && (p = n.length,
                    p > o && (p = o),
                    p && (n.head && (x = n.head.extra_len - n.length,
                    n.head.extra || (n.head.extra = new Uint8Array(n.head.extra_len)),
                    n.head.extra.set(i.subarray(a, a + p), x)),
                    512 & n.flags && 4 & n.wrap && (n.check = Df(n.check, i, p, a)),
                    o -= p,
                    a += p,
                    n.length -= p),
                    n.length))
                        break e;
                    n.length = 0,
                    n.mode = 16186;
                case 16186:
                    if (2048 & n.flags) {
                        if (0 === o)
                            break e;
                        p = 0;
                        do {
                            x = i[a + p++],
                            n.head && x && n.length < 65536 && (n.head.name += String.fromCharCode(x))
                        } while (x && p < o);
                        if (512 & n.flags && 4 & n.wrap && (n.check = Df(n.check, i, p, a)),
                        o -= p,
                        a += p,
                        x)
                            break e
                    } else
                        n.head && (n.head.name = null);
                    n.length = 0,
                    n.mode = 16187;
                case 16187:
                    if (4096 & n.flags) {
                        if (0 === o)
                            break e;
                        p = 0;
                        do {
                            x = i[a + p++],
                            n.head && x && n.length < 65536 && (n.head.comment += String.fromCharCode(x))
                        } while (x && p < o);
                        if (512 & n.flags && 4 & n.wrap && (n.check = Df(n.check, i, p, a)),
                        o -= p,
                        a += p,
                        x)
                            break e
                    } else
                        n.head && (n.head.comment = null);
                    n.mode = 16188;
                case 16188:
                    if (512 & n.flags) {
                        for (; h < 16; ) {
                            if (0 === o)
                                break e;
                            o--,
                            c += i[a++] << h,
                            h += 8
                        }
                        if (4 & n.wrap && c !== (65535 & n.check)) {
                            e.msg = "header crc mismatch",
                            n.mode = Ig;
                            break
                        }
                        c = 0,
                        h = 0
                    }
                    n.head && (n.head.hcrc = n.flags >> 9 & 1,
                    n.head.done = !0),
                    e.adler = n.check = 0,
                    n.mode = Sg;
                    break;
                case 16189:
                    for (; h < 32; ) {
                        if (0 === o)
                            break e;
                        o--,
                        c += i[a++] << h,
                        h += 8
                    }
                    e.adler = n.check = Rg(c),
                    c = 0,
                    h = 0,
                    n.mode = Eg;
                case Eg:
                    if (0 === n.havedict)
                        return e.next_out = s,
                        e.avail_out = l,
                        e.next_in = a,
                        e.avail_in = o,
                        n.hold = c,
                        n.bits = h,
                        vg;
                    e.adler = n.check = 1,
                    n.mode = Sg;
                case Sg:
                    if (t === pg || t === fg)
                        break e;
                case Mg:
                    if (n.last) {
                        c >>>= 7 & h,
                        h -= 7 & h,
                        n.mode = Pg;
                        break
                    }
                    for (; h < 3; ) {
                        if (0 === o)
                            break e;
                        o--,
                        c += i[a++] << h,
                        h += 8
                    }
                    switch (n.last = 1 & c,
                    c >>>= 1,
                    h -= 1,
                    3 & c) {
                    case 0:
                        n.mode = 16193;
                        break;
                    case 1:
                        if (Hg(n),
                        n.mode = Tg,
                        t === fg) {
                            c >>>= 2,
                            h -= 2;
                            break e
                        }
                        break;
                    case 2:
                        n.mode = 16196;
                        break;
                    case 3:
                        e.msg = "invalid block type",
                        n.mode = Ig
                    }
                    c >>>= 2,
                    h -= 2;
                    break;
                case 16193:
                    for (c >>>= 7 & h,
                    h -= 7 & h; h < 32; ) {
                        if (0 === o)
                            break e;
                        o--,
                        c += i[a++] << h,
                        h += 8
                    }
                    if ((65535 & c) != (c >>> 16 ^ 65535)) {
                        e.msg = "invalid stored block lengths",
                        n.mode = Ig;
                        break
                    }
                    if (n.length = 65535 & c,
                    c = 0,
                    h = 0,
                    n.mode = _g,
                    t === fg)
                        break e;
                case _g:
                    n.mode = 16195;
                case 16195:
                    if (p = n.length,
                    p) {
                        if (p > o && (p = o),
                        p > l && (p = l),
                        0 === p)
                            break e;
                        r.set(i.subarray(a, a + p), s),
                        o -= p,
                        a += p,
                        l -= p,
                        s += p,
                        n.length -= p;
                        break
                    }
                    n.mode = Sg;
                    break;
                case 16196:
                    for (; h < 14; ) {
                        if (0 === o)
                            break e;
                        o--,
                        c += i[a++] << h,
                        h += 8
                    }
                    if (n.nlen = 257 + (31 & c),
                    c >>>= 5,
                    h -= 5,
                    n.ndist = 1 + (31 & c),
                    c >>>= 5,
                    h -= 5,
                    n.ncode = 4 + (15 & c),
                    c >>>= 4,
                    h -= 4,
                    n.nlen > 286 || n.ndist > 30) {
                        e.msg = "too many length or distance symbols",
                        n.mode = Ig;
                        break
                    }
                    n.have = 0,
                    n.mode = 16197;
                case 16197:
                    for (; n.have < n.ncode; ) {
                        for (; h < 3; ) {
                            if (0 === o)
                                break e;
                            o--,
                            c += i[a++] << h,
                            h += 8
                        }
                        n.lens[T[n.have++]] = 7 & c,
                        c >>>= 3,
                        h -= 3
                    }
                    for (; n.have < 19; )
                        n.lens[T[n.have++]] = 0;
                    if (n.lencode = n.lendyn,
                    n.lenbits = 7,
                    M = {
                        bits: n.lenbits
                    },
                    k = dg(0, n.lens, 0, 19, n.lencode, 0, n.work, M),
                    n.lenbits = M.bits,
                    k) {
                        e.msg = "invalid code lengths set",
                        n.mode = Ig;
                        break
                    }
                    n.have = 0,
                    n.mode = 16198;
                case 16198:
                    for (; n.have < n.nlen + n.ndist; ) {
                        for (; E = n.lencode[c & (1 << n.lenbits) - 1],
                        g = E >>> 24,
                        v = E >>> 16 & 255,
                        w = 65535 & E,
                        !(g <= h); ) {
                            if (0 === o)
                                break e;
                            o--,
                            c += i[a++] << h,
                            h += 8
                        }
                        if (w < 16)
                            c >>>= g,
                            h -= g,
                            n.lens[n.have++] = w;
                        else {
                            if (16 === w) {
                                for (_ = g + 2; h < _; ) {
                                    if (0 === o)
                                        break e;
                                    o--,
                                    c += i[a++] << h,
                                    h += 8
                                }
                                if (c >>>= g,
                                h -= g,
                                0 === n.have) {
                                    e.msg = "invalid bit length repeat",
                                    n.mode = Ig;
                                    break
                                }
                                x = n.lens[n.have - 1],
                                p = 3 + (3 & c),
                                c >>>= 2,
                                h -= 2
                            } else if (17 === w) {
                                for (_ = g + 3; h < _; ) {
                                    if (0 === o)
                                        break e;
                                    o--,
                                    c += i[a++] << h,
                                    h += 8
                                }
                                c >>>= g,
                                h -= g,
                                x = 0,
                                p = 3 + (7 & c),
                                c >>>= 3,
                                h -= 3
                            } else {
                                for (_ = g + 7; h < _; ) {
                                    if (0 === o)
                                        break e;
                                    o--,
                                    c += i[a++] << h,
                                    h += 8
                                }
                                c >>>= g,
                                h -= g,
                                x = 0,
                                p = 11 + (127 & c),
                                c >>>= 7,
                                h -= 7
                            }
                            if (n.have + p > n.nlen + n.ndist) {
                                e.msg = "invalid bit length repeat",
                                n.mode = Ig;
                                break
                            }
                            for (; p--; )
                                n.lens[n.have++] = x
                        }
                    }
                    if (n.mode === Ig)
                        break;
                    if (0 === n.lens[256]) {
                        e.msg = "invalid code -- missing end-of-block",
                        n.mode = Ig;
                        break
                    }
                    if (n.lenbits = 9,
                    M = {
                        bits: n.lenbits
                    },
                    k = dg(1, n.lens, 0, n.nlen, n.lencode, 0, n.work, M),
                    n.lenbits = M.bits,
                    k) {
                        e.msg = "invalid literal/lengths set",
                        n.mode = Ig;
                        break
                    }
                    if (n.distbits = 6,
                    n.distcode = n.distdyn,
                    M = {
                        bits: n.distbits
                    },
                    k = dg(2, n.lens, n.nlen, n.ndist, n.distcode, 0, n.work, M),
                    n.distbits = M.bits,
                    k) {
                        e.msg = "invalid distances set",
                        n.mode = Ig;
                        break
                    }
                    if (n.mode = Tg,
                    t === fg)
                        break e;
                case Tg:
                    n.mode = Cg;
                case Cg:
                    if (o >= 6 && l >= 258) {
                        e.next_out = s,
                        e.avail_out = l,
                        e.next_in = a,
                        e.avail_in = o,
                        n.hold = c,
                        n.bits = h,
                        ag(e, u),
                        s = e.next_out,
                        r = e.output,
                        l = e.avail_out,
                        a = e.next_in,
                        i = e.input,
                        o = e.avail_in,
                        c = n.hold,
                        h = n.bits,
                        n.mode === Sg && (n.back = -1);
                        break
                    }
                    for (n.back = 0; E = n.lencode[c & (1 << n.lenbits) - 1],
                    g = E >>> 24,
                    v = E >>> 16 & 255,
                    w = 65535 & E,
                    !(g <= h); ) {
                        if (0 === o)
                            break e;
                        o--,
                        c += i[a++] << h,
                        h += 8
                    }
                    if (v && !(240 & v)) {
                        for (y = g,
                        b = v,
                        A = w; E = n.lencode[A + ((c & (1 << y + b) - 1) >> y)],
                        g = E >>> 24,
                        v = E >>> 16 & 255,
                        w = 65535 & E,
                        !(y + g <= h); ) {
                            if (0 === o)
                                break e;
                            o--,
                            c += i[a++] << h,
                            h += 8
                        }
                        c >>>= y,
                        h -= y,
                        n.back += y
                    }
                    if (c >>>= g,
                    h -= g,
                    n.back += g,
                    n.length = w,
                    0 === v) {
                        n.mode = 16205;
                        break
                    }
                    if (32 & v) {
                        n.back = -1,
                        n.mode = Sg;
                        break
                    }
                    if (64 & v) {
                        e.msg = "invalid literal/length code",
                        n.mode = Ig;
                        break
                    }
                    n.extra = 15 & v,
                    n.mode = 16201;
                case 16201:
                    if (n.extra) {
                        for (_ = n.extra; h < _; ) {
                            if (0 === o)
                                break e;
                            o--,
                            c += i[a++] << h,
                            h += 8
                        }
                        n.length += c & (1 << n.extra) - 1,
                        c >>>= n.extra,
                        h -= n.extra,
                        n.back += n.extra
                    }
                    n.was = n.length,
                    n.mode = 16202;
                case 16202:
                    for (; E = n.distcode[c & (1 << n.distbits) - 1],
                    g = E >>> 24,
                    v = E >>> 16 & 255,
                    w = 65535 & E,
                    !(g <= h); ) {
                        if (0 === o)
                            break e;
                        o--,
                        c += i[a++] << h,
                        h += 8
                    }
                    if (!(240 & v)) {
                        for (y = g,
                        b = v,
                        A = w; E = n.distcode[A + ((c & (1 << y + b) - 1) >> y)],
                        g = E >>> 24,
                        v = E >>> 16 & 255,
                        w = 65535 & E,
                        !(y + g <= h); ) {
                            if (0 === o)
                                break e;
                            o--,
                            c += i[a++] << h,
                            h += 8
                        }
                        c >>>= y,
                        h -= y,
                        n.back += y
                    }
                    if (c >>>= g,
                    h -= g,
                    n.back += g,
                    64 & v) {
                        e.msg = "invalid distance code",
                        n.mode = Ig;
                        break
                    }
                    n.offset = w,
                    n.extra = 15 & v,
                    n.mode = 16203;
                case 16203:
                    if (n.extra) {
                        for (_ = n.extra; h < _; ) {
                            if (0 === o)
                                break e;
                            o--,
                            c += i[a++] << h,
                            h += 8
                        }
                        n.offset += c & (1 << n.extra) - 1,
                        c >>>= n.extra,
                        h -= n.extra,
                        n.back += n.extra
                    }
                    if (n.offset > n.dmax) {
                        e.msg = "invalid distance too far back",
                        n.mode = Ig;
                        break
                    }
                    n.mode = 16204;
                case 16204:
                    if (0 === l)
                        break e;
                    if (p = u - l,
                    n.offset > p) {
                        if (p = n.offset - p,
                        p > n.whave && n.sane) {
                            e.msg = "invalid distance too far back",
                            n.mode = Ig;
                            break
                        }
                        p > n.wnext ? (p -= n.wnext,
                        f = n.wsize - p) : f = n.wnext - p,
                        p > n.length && (p = n.length),
                        m = n.window
                    } else
                        m = r,
                        f = s - n.offset,
                        p = n.length;
                    p > l && (p = l),
                    l -= p,
                    n.length -= p;
                    do {
                        r[s++] = m[f++]
                    } while (--p);
                    0 === n.length && (n.mode = Cg);
                    break;
                case 16205:
                    if (0 === l)
                        break e;
                    r[s++] = n.length,
                    l--,
                    n.mode = Cg;
                    break;
                case Pg:
                    if (n.wrap) {
                        for (; h < 32; ) {
                            if (0 === o)
                                break e;
                            o--,
                            c |= i[a++] << h,
                            h += 8
                        }
                        if (u -= l,
                        e.total_out += u,
                        n.total += u,
                        4 & n.wrap && u && (e.adler = n.check = n.flags ? Df(n.check, r, u, s - u) : Rf(n.check, r, u, s - u)),
                        u = l,
                        4 & n.wrap && (n.flags ? c : Rg(c)) !== n.check) {
                            e.msg = "incorrect data check",
                            n.mode = Ig;
                            break
                        }
                        c = 0,
                        h = 0
                    }
                    n.mode = 16207;
                case 16207:
                    if (n.wrap && n.flags) {
                        for (; h < 32; ) {
                            if (0 === o)
                                break e;
                            o--,
                            c += i[a++] << h,
                            h += 8
                        }
                        if (4 & n.wrap && c !== (4294967295 & n.total)) {
                            e.msg = "incorrect length check",
                            n.mode = Ig;
                            break
                        }
                        c = 0,
                        h = 0
                    }
                    n.mode = 16208;
                case 16208:
                    k = gg;
                    break e;
                case Ig:
                    k = yg;
                    break e;
                case 16210:
                    return bg;
                default:
                    return wg
                }
            return e.next_out = s,
            e.avail_out = l,
            e.next_in = a,
            e.avail_in = o,
            n.hold = c,
            n.bits = h,
            (n.wsize || u !== e.avail_out && n.mode < Ig && (n.mode < Pg || t !== ug)) && Vg(e, e.output, e.next_out, u - e.avail_out),
            d -= e.avail_in,
            u -= e.avail_out,
            e.total_in += d,
            e.total_out += u,
            n.total += u,
            4 & n.wrap && u && (e.adler = n.check = n.flags ? Df(n.check, r, u, e.next_out - u) : Rf(n.check, r, u, e.next_out - u)),
            e.data_type = n.bits + (n.last ? 64 : 0) + (n.mode === Sg ? 128 : 0) + (n.mode === Tg || n.mode === _g ? 256 : 0),
            (0 === d && 0 === u || t === ug) && k === mg && (k = Ag),
            k
        }
          , jg = e => {
            if (Dg(e))
                return wg;
            let t = e.state;
            return t.window && (t.window = null),
            e.state = null,
            mg
        }
          , Qg = (e, t) => {
            if (Dg(e))
                return wg;
            const n = e.state;
            return 2 & n.wrap ? (n.head = t,
            t.done = !1,
            mg) : wg
        }
          , Kg = (e, t) => {
            const n = t.length;
            let i, r, a;
            return Dg(e) ? wg : (i = e.state,
            0 !== i.wrap && i.mode !== Eg ? wg : i.mode === Eg && (r = 1,
            r = Rf(r, t, n, 0),
            r !== i.check) ? yg : (a = Vg(e, t, n, n),
            a ? (i.mode = 16210,
            bg) : (i.havedict = 1,
            mg)))
        }
          , qg = {
            inflateReset: Bg,
            inflateReset2: Ug,
            inflateResetKeep: Ng,
            inflateInit: e => zg(e, 15),
            inflateInit2: zg,
            inflate: Gg,
            inflateEnd: jg,
            inflateGetHeader: Qg,
            inflateSetDictionary: Kg,
            inflateInfo: "pako inflate (from Nodeca project)"
        };
        var Yg = function() {
            this.text = 0,
            this.time = 0,
            this.xflags = 0,
            this.os = 0,
            this.extra = null,
            this.extra_len = 0,
            this.name = "",
            this.comment = "",
            this.hcrc = 0,
            this.done = !1
        };
        const Xg = Object.prototype.toString
          , {Z_NO_FLUSH: Zg, Z_FINISH: Jg, Z_OK: $g, Z_STREAM_END: ev, Z_NEED_DICT: tv, Z_STREAM_ERROR: nv, Z_DATA_ERROR: iv, Z_MEM_ERROR: rv} = Bf;
        function av(e) {
            this.options = Nm({
                chunkSize: 65536,
                windowBits: 15,
                to: ""
            }, e || {});
            const t = this.options;
            t.raw && t.windowBits >= 0 && t.windowBits < 16 && (t.windowBits = -t.windowBits,
            0 === t.windowBits && (t.windowBits = -15)),
            !(t.windowBits >= 0 && t.windowBits < 16) || e && e.windowBits || (t.windowBits += 32),
            t.windowBits > 15 && t.windowBits < 48 && (15 & t.windowBits || (t.windowBits |= 15)),
            this.err = 0,
            this.msg = "",
            this.ended = !1,
            this.chunks = [],
            this.strm = new Hm,
            this.strm.avail_out = 0;
            let n = qg.inflateInit2(this.strm, t.windowBits);
            if (n !== $g)
                throw new Error(Nf[n]);
            if (this.header = new Yg,
            qg.inflateGetHeader(this.strm, this.header),
            t.dictionary && ("string" == typeof t.dictionary ? t.dictionary = Om(t.dictionary) : "[object ArrayBuffer]" === Xg.call(t.dictionary) && (t.dictionary = new Uint8Array(t.dictionary)),
            t.raw && (n = qg.inflateSetDictionary(this.strm, t.dictionary),
            n !== $g)))
                throw new Error(Nf[n])
        }
        function sv(e, t) {
            const n = new av(t);
            if (n.push(e),
            n.err)
                throw n.msg || Nf[n.err];
            return n.result
        }
        av.prototype.push = function(e, t) {
            const n = this.strm
              , i = this.options.chunkSize
              , r = this.options.dictionary;
            let a, s, o;
            if (this.ended)
                return !1;
            for (s = t === ~~t ? t : !0 === t ? Jg : Zg,
            "[object ArrayBuffer]" === Xg.call(e) ? n.input = new Uint8Array(e) : n.input = e,
            n.next_in = 0,
            n.avail_in = n.input.length; ; ) {
                for (0 === n.avail_out && (n.output = new Uint8Array(i),
                n.next_out = 0,
                n.avail_out = i),
                a = qg.inflate(n, s),
                a === tv && r && (a = qg.inflateSetDictionary(n, r),
                a === $g ? a = qg.inflate(n, s) : a === iv && (a = tv)); n.avail_in > 0 && a === ev && n.state.wrap > 0 && 0 !== e[n.next_in]; )
                    qg.inflateReset(n),
                    a = qg.inflate(n, s);
                switch (a) {
                case nv:
                case iv:
                case tv:
                case rv:
                    return this.onEnd(a),
                    this.ended = !0,
                    !1
                }
                if (o = n.avail_out,
                n.next_out && (0 === n.avail_out || a === ev))
                    if ("string" === this.options.to) {
                        let e = Wm(n.output, n.next_out)
                          , t = n.next_out - e
                          , r = Fm(n.output, e);
                        n.next_out = t,
                        n.avail_out = i - t,
                        t && n.output.set(n.output.subarray(e, e + t), 0),
                        this.onData(r)
                    } else
                        this.onData(n.output.length === n.next_out ? n.output : n.output.subarray(0, n.next_out));
                if (a !== $g || 0 !== o) {
                    if (a === ev)
                        return a = qg.inflateEnd(this.strm),
                        this.onEnd(a),
                        this.ended = !0,
                        !0;
                    if (0 === n.avail_in)
                        break
                }
            }
            return !0
        }
        ,
        av.prototype.onData = function(e) {
            this.chunks.push(e)
        }
        ,
        av.prototype.onEnd = function(e) {
            e === $g && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = Bm(this.chunks)),
            this.chunks = [],
            this.err = e,
            this.msg = this.strm.msg
        }
        ;
        var ov = function(e, t) {
            return (t = t || {}).raw = !0,
            sv(e, t)
        }
          , lv = {
            Inflate: av,
            inflate: sv,
            inflateRaw: ov,
            ungzip: sv,
            constants: Bf
        };
        const {Deflate: cv, deflate: hv, deflateRaw: dv, gzip: uv} = ig
          , {Inflate: pv, inflate: fv, inflateRaw: mv, ungzip: gv} = lv;
        var vv = {
            Deflate: cv,
            deflate: hv,
            deflateRaw: dv,
            gzip: uv,
            Inflate: pv,
            inflate: fv,
            inflateRaw: mv,
            ungzip: gv,
            constants: Bf
        };
        function wv(e) {
            let t;
            e = (e = e.replace(/-/g, "+")).replace(/_/g, "/");
            try {
                t = atob(e)
            } catch (e) {
                return null
            }
            const n = new Uint8Array(t.length);
            for (let e = 0; e < t.length; ++e) {
                const i = t.charCodeAt(e);
                if (i > 255)
                    return null;
                n[e] = i
            }
            return n
        }
        var yv, bv, Av, xv, kv, Ev, Sv, Mv, _v, Tv, Cv, Pv = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, Iv = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class Rv {
            constructor(e) {
                yv.add(this),
                Av.set(this, []),
                xv.set(this, []),
                kv.set(this, []),
                Ev.set(this, []),
                Sv.set(this, []),
                Mv.set(this, null),
                null != e && (Pv(this, Av, e.up, "f"),
                Pv(this, xv, e.right, "f"),
                Pv(this, kv, e.down, "f"),
                Pv(this, Ev, e.left, "f"),
                Pv(this, Sv, e.reset, "f"))
            }
            recordFrame(e, t) {
                if (e > bv.maxFrames)
                    throw new Error("Frame number exceeds maximum frame count.");
                if (null != Iv(this, Mv, "f") && e <= Iv(this, Mv, "f"))
                    throw new Error("Frame number must be greater than the previous recorded frame.");
                Pv(this, Mv, e, "f");
                const n = Iv(this, Av, "f").length % 2 != 0
                  , i = Iv(this, xv, "f").length % 2 != 0
                  , r = Iv(this, kv, "f").length % 2 != 0
                  , a = Iv(this, Ev, "f").length % 2 != 0
                  , s = Iv(this, Sv, "f").length % 2 != 0;
                t.up != n && Iv(this, Av, "f").push(e),
                t.right != i && Iv(this, xv, "f").push(e),
                t.down != r && Iv(this, kv, "f").push(e),
                t.left != a && Iv(this, Ev, "f").push(e),
                t.reset != s && Iv(this, Sv, "f").push(e)
            }
            getFrame(e) {
                return {
                    up: (Iv(this, yv, "m", _v).call(this, e, Iv(this, Av, "f")) + 1) % 2 != 0,
                    right: (Iv(this, yv, "m", _v).call(this, e, Iv(this, xv, "f")) + 1) % 2 != 0,
                    down: (Iv(this, yv, "m", _v).call(this, e, Iv(this, kv, "f")) + 1) % 2 != 0,
                    left: (Iv(this, yv, "m", _v).call(this, e, Iv(this, Ev, "f")) + 1) % 2 != 0,
                    reset: (Iv(this, yv, "m", _v).call(this, e, Iv(this, Sv, "f")) + 1) % 2 != 0
                }
            }
            serialize() {
                const e = new Uint8Array(3 + 3 * Iv(this, Av, "f").length + 3 + 3 * Iv(this, xv, "f").length + 3 + 3 * Iv(this, kv, "f").length + 3 + 3 * Iv(this, Ev, "f").length + 3 + 3 * Iv(this, Sv, "f").length);
                Iv(this, yv, "m", Tv).call(this, Iv(this, Av, "f"), e.subarray(0, 3 + 3 * Iv(this, Av, "f").length)),
                Iv(this, yv, "m", Tv).call(this, Iv(this, xv, "f"), e.subarray(3 + 3 * Iv(this, Av, "f").length, 3 + 3 * Iv(this, Av, "f").length + 3 + 3 * Iv(this, xv, "f").length)),
                Iv(this, yv, "m", Tv).call(this, Iv(this, kv, "f"), e.subarray(3 + 3 * Iv(this, Av, "f").length + 3 + 3 * Iv(this, xv, "f").length, 3 + 3 * Iv(this, Av, "f").length + 3 + 3 * Iv(this, xv, "f").length + 3 + 3 * Iv(this, kv, "f").length)),
                Iv(this, yv, "m", Tv).call(this, Iv(this, Ev, "f"), e.subarray(3 + 3 * Iv(this, Av, "f").length + 3 + 3 * Iv(this, xv, "f").length + 3 + 3 * Iv(this, kv, "f").length, 3 + 3 * Iv(this, Av, "f").length + 3 + 3 * Iv(this, xv, "f").length + 3 + 3 * Iv(this, kv, "f").length + 3 + 3 * Iv(this, Ev, "f").length)),
                Iv(this, yv, "m", Tv).call(this, Iv(this, Sv, "f"), e.subarray(3 + 3 * Iv(this, Av, "f").length + 3 + 3 * Iv(this, xv, "f").length + 3 + 3 * Iv(this, kv, "f").length + 3 + 3 * Iv(this, Ev, "f").length, 3 + 3 * Iv(this, Av, "f").length + 3 + 3 * Iv(this, xv, "f").length + 3 + 3 * Iv(this, kv, "f").length + 3 + 3 * Iv(this, Ev, "f").length + 3 + 3 * Iv(this, Sv, "f").length));
                const t = new vv.Deflate({
                    level: 9
                });
                return t.push(new Uint8Array(e), !0),
                function(e) {
                    let t = "";
                    for (const n of e)
                        t += String.fromCharCode(n);
                    let n = btoa(t);
                    return n = n.replace(/\+/g, "-"),
                    n = n.replace(/\//g, "_"),
                    n = n.replace(/=/g, ""),
                    n
                }(t.result)
            }
            static deserialize(e) {
                const t = wv(e);
                if (null == t)
                    return null;
                const n = new vv.Inflate;
                if (n.push(t, !0),
                n.err)
                    return null;
                const i = n.result;
                if (!(i instanceof Uint8Array))
                    return null;
                const r = Iv(bv, bv, "m", Cv).call(bv, i);
                if (null == r)
                    return null;
                const a = Iv(bv, bv, "m", Cv).call(bv, i.subarray(3 + 3 * r.length));
                if (null == a)
                    return null;
                const s = Iv(bv, bv, "m", Cv).call(bv, i.subarray(3 + 3 * r.length + 3 + 3 * a.length));
                if (null == s)
                    return null;
                const o = Iv(bv, bv, "m", Cv).call(bv, i.subarray(3 + 3 * r.length + 3 + 3 * a.length + 3 + 3 * s.length));
                if (null == o)
                    return null;
                const l = Iv(bv, bv, "m", Cv).call(bv, i.subarray(3 + 3 * r.length + 3 + 3 * a.length + 3 + 3 * s.length + 3 + 3 * o.length));
                return null == l ? null : new bv({
                    up: r,
                    right: a,
                    down: s,
                    left: o,
                    reset: l
                })
            }
        }
        bv = Rv,
        Av = new WeakMap,
        xv = new WeakMap,
        kv = new WeakMap,
        Ev = new WeakMap,
        Sv = new WeakMap,
        Mv = new WeakMap,
        yv = new WeakSet,
        _v = function(e, t) {
            let n = -1;
            for (let i = 0; i < t.length; ++i) {
                const r = t[i];
                if (r == e) {
                    n = i;
                    break
                }
                if (r > e)
                    break;
                n = i
            }
            return n
        }
        ,
        Tv = function(e, t) {
            t[0] = 255 & e.length,
            t[1] = e.length >>> 8 & 255,
            t[2] = e.length >>> 16 & 255;
            for (let n = 0; n < e.length; ++n) {
                let i;
                i = 0 == n ? e[n] : e[n] - e[n - 1],
                t[3 + 3 * n] = 255 & i,
                t[3 + 3 * n + 1] = i >>> 8 & 255,
                t[3 + 3 * n + 2] = i >>> 16 & 255
            }
        }
        ,
        Cv = function(e) {
            if (e.length < 3)
                return null;
            const t = e[0] | e[1] << 8 | e[2] << 16;
            if (e.length < 3 + 3 * t)
                return null;
            const n = [];
            for (let i = 0; i < t; ++i) {
                const t = e[3 + 3 * i] | e[3 + 3 * i + 1] << 8 | e[3 + 3 * i + 2] << 16;
                0 == i ? n.push(t) : n.push(n[i - 1] + t)
            }
            return n
        }
        ,
        Rv.maxFrames = 5999999;
        const Lv = Rv;
        var Dv, Nv, Bv, Uv, zv, Ov, Fv, Wv, Hv, Vv, Gv, jv, Qv, Kv, qv, Yv, Xv, Zv, Jv, $v, ew, tw, nw, iw, rw, aw, sw, ow, lw, cw, hw, dw, uw, pw, fw, mw, gw, vw, ww, yw, bw, Aw, xw, kw, Ew, Sw, Mw, _w, Tw, Cw, Pw, Iw, Rw, Lw, Dw, Nw, Bw, Uw, zw, Ow, Fw, Ww, Hw = function(e, t, n, i) {
            return new (n || (n = Promise))((function(r, a) {
                function s(e) {
                    try {
                        l(i.next(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function o(e) {
                    try {
                        l(i.throw(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(e) {
                    var t;
                    e.done ? r(e.value) : (t = e.value,
                    t instanceof n ? t : new n((function(e) {
                        e(t)
                    }
                    ))).then(s, o)
                }
                l((i = i.apply(e, t || [])).next())
            }
            ))
        }, Vw = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, Gw = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class jw {
            constructor(e, t, n, i, r, a, s, o, l) {
                var c;
                if (Dv.add(this),
                Bv.set(this, void 0),
                Uv.set(this, null),
                zv.set(this, 1),
                Ov.set(this, null),
                Fv.set(this, []),
                Wv.set(this, null),
                Hv.set(this, null),
                Vv.set(this, null),
                Gv.set(this, []),
                this.notificationAudioEnabled = !1,
                jv.set(this, void 0),
                Qv.set(this, void 0),
                Kv.set(this, void 0),
                qv.set(this, !1),
                Yv.set(this, void 0),
                Xv.set(this, void 0),
                Zv.set(this, void 0),
                Jv.set(this, void 0),
                nw.set(this, []),
                iw.set(this, []),
                rw.set(this, []),
                aw.set(this, [0, 0, 0, 0]),
                sw.set(this, [0, 0, 0, 0]),
                ow.set(this, [0, 0, 0, 0]),
                lw.set(this, void 0),
                cw.set(this, void 0),
                hw.set(this, null),
                dw.set(this, null),
                uw.set(this, []),
                pw.set(this, null),
                fw.set(this, void 0),
                mw.set(this, void 0),
                gw.set(this, void 0),
                vw.set(this, void 0),
                ww.set(this, void 0),
                yw.set(this, void 0),
                bw.set(this, []),
                Aw.set(this, null),
                xw.set(this, [.075, .075, .075, .075]),
                kw.set(this, void 0),
                Ew.set(this, null),
                Sw.set(this, void 0),
                Mw.set(this, !1),
                Vw(this, Bv, a, "f"),
                Vw(this, lw, r, "f"),
                Vw(this, vw, s, "f"),
                Vw(this, ww, o, "f"),
                Vw(this, yw, l, "f"),
                Vw(this, Kv, e, "f"),
                (null == l ? void 0 : l.getSettingBoolean(el.ParticlesEnabled)) ? Vw(this, kw, new Sp(r), "f") : Vw(this, kw, null, "f"),
                null != Gw(this, vw, "f") && null != Gw(this, ww, "f") && Vw(this, bw, [new Op(Gw(this, lw, "f")), new Op(Gw(this, lw, "f")), new Op(Gw(this, lw, "f")), new Op(Gw(this, lw, "f"))], "f"),
                Vw(this, jv, new pp, "f"),
                Gw(this, jv, "f").reset(t.position, t.quaternion),
                r.scene.add(Gw(this, jv, "f").camera),
                Vw(this, Qv, new ep, "f"),
                Gw(this, Qv, "f").reset(t.position, t.quaternion),
                r.scene.add(Gw(this, Qv, "f").camera),
                null == Nv.models)
                    throw new Error("Car model isn't loaded yet");
                if (null != Gw(this, Kv, "f") && null != Gw(this, vw, "f") && null != Gw(this, ww, "f"))
                    Vw(this, Yv, Gw(this, Kv, "f").createCar(t, Gw(this, vw, "f").getMountainVertices(), Gw(this, vw, "f").getMountainOffset(), Gw(this, ww, "f").getTrackData(), n, (e => {
                        this.setCarState(e)
                    }
                    )), "f");
                else {
                    const e = [new bn(.627909,.27 - Nv.suspensionResetLengthFront,1.3478).applyQuaternion(t.quaternion).add(t.position), new bn(-.627909,.27 - Nv.suspensionResetLengthFront,1.3478).applyQuaternion(t.quaternion).add(t.position), new bn(.720832,.27 - Nv.suspensionResetLengthRear,-1.52686).applyQuaternion(t.quaternion).add(t.position), new bn(-.720832,.27 - Nv.suspensionResetLengthRear,-1.52686).applyQuaternion(t.quaternion).add(t.position)]
                      , n = [(new yn).setFromEuler((new si).set(0, Math.PI, 0)).multiply(t.quaternion), (new yn).setFromEuler((new si).set(0, Math.PI, 0)).multiply(t.quaternion), (new yn).setFromEuler((new si).set(0, Math.PI, 0)).multiply(t.quaternion), (new yn).setFromEuler((new si).set(0, Math.PI, 0)).multiply(t.quaternion)];
                    Vw(this, Yv, {
                        id: 0,
                        frames: 0,
                        speedKmh: 0,
                        hasStarted: !1,
                        finishFrames: null,
                        nextCheckpointIndex: 0,
                        hasCheckpointToRespawnAt: !1,
                        position: {
                            x: t.position.x,
                            y: t.position.y,
                            z: t.position.z
                        },
                        quaternion: {
                            x: t.quaternion.x,
                            y: t.quaternion.y,
                            z: t.quaternion.z,
                            w: t.quaternion.w
                        },
                        collisionImpulses: [],
                        wheelContact: [null, null, null, null],
                        wheelSuspensionLength: [Nv.suspensionResetLengthFront, Nv.suspensionResetLengthFront, Nv.suspensionResetLengthRear, Nv.suspensionResetLengthRear],
                        wheelSuspensionVelocity: [0, 0, 0, 0],
                        wheelRotation: [0, 0, 0, 0],
                        wheelDeltaRotation: [0, 0, 0, 0],
                        wheelSkidInfo: [0, 0, 0, 0],
                        wheelPosition: e,
                        wheelQuaternion: n,
                        brakeLightEnabled: !1,
                        controls: {
                            up: !1,
                            right: !1,
                            down: !1,
                            left: !1,
                            reset: !1
                        }
                    }, "f")
                }
                if (Vw(this, Xv, i, "f"),
                null == n)
                    Vw(this, Zv, null != Gw(this, Xv, "f"), "f"),
                    Vw(this, Jv, new Lv, "f");
                else {
                    if (null != Gw(this, Xv, "f"))
                        throw new Error("Can't control car when recording is set");
                    Vw(this, Zv, !1, "f"),
                    Vw(this, Jv, n, "f")
                }
                Vw(this, gw, np.random(), "f"),
                Vw(this, fw, Nv.createTexture(r), "f"),
                Vw(this, mw, {
                    value: new bn(0,0,0)
                }, "f"),
                Vw(this, cw, new Br, "f"),
                Gw(this, cw, "f").add(Nv.models.chassis.clone()),
                Gw(this, cw, "f").add(Nv.models.suspension.clone()),
                Gw(this, cw, "f").add(Nv.models.wheelFL.clone()),
                Gw(this, cw, "f").add(Nv.models.wheelFR.clone()),
                Gw(this, cw, "f").add(Nv.models.wheelBL.clone()),
                Gw(this, cw, "f").add(Nv.models.wheelBR.clone());
                for (const e of Gw(this, cw, "f").children) {
                    const t = e;
                    let n;
                    Array.isArray(t.material) ? (n = t.material.map((e => e.clone())),
                    t.material = n) : (n = [t.material.clone()],
                    t.material = n[0]);
                    for (const e of n)
                        if ("Main" == e.name)
                            e.onBeforeCompile = e => {
                                e.fragmentShader = "uniform sampler2D carColorPattern;\nuniform vec3 carColorSecondary;\n" + e.fragmentShader,
                                e.fragmentShader = e.fragmentShader.replace("vec4 diffuseColor = vec4( diffuse, opacity );", "float colorSource = texture(carColorPattern, vUv).a;\nvec4 diffuseColor = vec4( carColorSecondary * colorSource + diffuse * (1.0 - colorSource), opacity );"),
                                e.uniforms.carColorPattern = {
                                    value: Gw(this, fw, "f")
                                },
                                e.uniforms.carColorSecondary = Gw(this, mw, "f"),
                                null == e.defines && (e.defines = {}),
                                e.defines.USE_UV = !0
                            }
                            ,
                            e.needsUpdate = !0;
                        else if ("Metal" == e.name)
                            e.needsUpdate = !0;
                        else if ("BrakeLight" == e.name) {
                            if (!(e instanceof Os))
                                throw new Error("Brake light material must be MeshStandardMaterial");
                            Vw(this, pw, e, "f")
                        }
                    t.castShadow = !0,
                    t.receiveShadow = !0,
                    t.frustumCulled = !1,
                    r.addMaterial(t.material)
                }
                Gw(this, lw, "f").scene.add(Gw(this, cw, "f")),
                Vw(this, hw, Gw(this, cw, "f").getObjectByName("Body"), "f"),
                Vw(this, dw, Gw(this, cw, "f").getObjectByName("Suspension"), "f"),
                Gw(this, dw, "f").geometry.morphAttributes.position = [];
                const h = Gw(this, dw, "f")
                  , d = Nv.models.suspensionFL
                  , u = Nv.models.suspensionFR
                  , p = Nv.models.suspensionBL
                  , f = Nv.models.suspensionBR;
                for (const e of Gw(this, cw, "f").children)
                    if (e != Gw(this, hw, "f") && e != Gw(this, dw, "f")) {
                        const t = e;
                        if (!(d.geometry.attributes.position instanceof Xi && u.geometry.attributes.position instanceof Xi && p.geometry.attributes.position instanceof Xi && f.geometry.attributes.position instanceof Xi))
                            throw new Error("Vertices must use BufferAttribute");
                        const n = d.geometry.attributes.position.array
                          , i = u.geometry.attributes.position.array
                          , r = p.geometry.attributes.position.array
                          , a = f.geometry.attributes.position.array
                          , s = h.geometry.morphAttributes.position;
                        if ("WheelFL" == t.name)
                            s.push(new Xi(n,3));
                        else if ("WheelFR" == t.name)
                            s.push(new Xi(i,3));
                        else if ("WheelBL" == t.name)
                            s.push(new Xi(r,3));
                        else {
                            if ("WheelBR" != t.name)
                                throw new Error("Unidentified wheel");
                            s.push(new Xi(a,3))
                        }
                        Gw(this, uw, "f").push(t)
                    }
                Gw(this, dw, "f").updateMorphTargets(),
                null != Gw(this, Xv, "f") && (null === (c = Gw(this, Kv, "f")) || void 0 === c || c.controlCar(Gw(this, Yv, "f").id, Gw(this, Xv, "f").up, Gw(this, Xv, "f").right, Gw(this, Xv, "f").down, Gw(this, Xv, "f").left, Gw(this, Xv, "f").reset),
                Gw(this, Xv, "f").addChangeCallback(Vw(this, Ew, (e => {
                    var t;
                    null === (t = Gw(this, Kv, "f")) || void 0 === t || t.controlCar(Gw(this, Yv, "f").id, e.up, e.right, e.down, e.left, e.reset)
                }
                ), "f"))),
                r.addContextRestoredEventListener(Vw(this, Sw, ( () => {
                    Gw(this, fw, "f").dispose(),
                    Vw(this, fw, Nv.createTexture(r), "f")
                }
                ), "f"))
            }
            dispose() {
                var e, t, n;
                Vw(this, Mw, !0, "f"),
                Gw(this, Dv, "m", _w).call(this),
                Gw(this, lw, "f").scene.remove(Gw(this, jv, "f").camera),
                Gw(this, lw, "f").scene.remove(Gw(this, Qv, "f").camera),
                null === (e = Gw(this, kw, "f")) || void 0 === e || e.dispose();
                for (const e of Gw(this, bw, "f"))
                    e.dispose();
                Gw(this, bw, "f").length = 0,
                Gw(this, lw, "f").scene.remove(Gw(this, cw, "f")),
                Gw(this, fw, "f").dispose();
                for (const e of Gw(this, cw, "f").children) {
                    if (!(e instanceof yr))
                        throw new Error("Mesh is not a THREE.Mesh");
                    Gw(this, lw, "f").removeMaterial(e.material)
                }
                null === (t = Gw(this, Kv, "f")) || void 0 === t || t.deleteCar(Gw(this, Yv, "f").id),
                null != Gw(this, Ew, "f") && (null === (n = Gw(this, Xv, "f")) || void 0 === n || n.removeChangeCallback(Gw(this, Ew, "f"))),
                Gw(this, lw, "f").removeContextRestoredEventListener(Gw(this, Sw, "f"))
            }
            addResetCallback(e) {
                Gw(this, nw, "f").push(e)
            }
            addCheckpointCallback(e) {
                Gw(this, iw, "f").push(e)
            }
            addFinishCallback(e) {
                Gw(this, rw, "f").push(e)
            }
            getChassisMatrix() {
                return null != Gw(this, hw, "f") ? Gw(this, hw, "f").matrix : null
            }
            getSpeedKmh() {
                return Gw(this, Yv, "f").speedKmh
            }
            start() {
                var e;
                null === (e = Gw(this, Kv, "f")) || void 0 === e || e.startCar(Gw(this, Yv, "f").id, null)
            }
            hasStarted() {
                return Gw(this, Yv, "f").hasStarted
            }
            hasFinished() {
                return null != Gw(this, Yv, "f").finishFrames
            }
            getFinishTime() {
                return null == Gw(this, Yv, "f").finishFrames ? null : new Gp(Gw(this, Yv, "f").finishFrames)
            }
            getRecording() {
                return Gw(this, Jv, "f")
            }
            getTime() {
                return new Gp(Gw(this, Yv, "f").frames)
            }
            getNextCheckpointIndex() {
                return Gw(this, Yv, "f").nextCheckpointIndex
            }
            hasCheckpointToRespawnAt() {
                return Gw(this, Yv, "f").hasCheckpointToRespawnAt
            }
            getPosition() {
                return new bn(Gw(this, Yv, "f").position.x,Gw(this, Yv, "f").position.y,Gw(this, Yv, "f").position.z)
            }
            getQuaternion() {
                return new yn(Gw(this, Yv, "f").quaternion.x,Gw(this, Yv, "f").quaternion.y,Gw(this, Yv, "f").quaternion.z,Gw(this, Yv, "f").quaternion.w)
            }
            getMatrix4() {
                const e = this.getPosition()
                  , t = this.getQuaternion()
                  , n = (new Xn).makeRotationFromQuaternion(t);
                return n.setPosition(e),
                n
            }
            get isPaused() {
                return Gw(this, qv, "f")
            }
            set isPaused(e) {
                var t;
                Gw(this, qv, "f") != e && (null === (t = Gw(this, Kv, "f")) || void 0 === t || t.pauseCar(Gw(this, Yv, "f").id, e),
                Vw(this, qv, e, "f"))
            }
            getControls() {
                return null != Gw(this, Xv, "f") ? Gw(this, Xv, "f").getControls() : Gw(this, Yv, "f").controls
            }
            getColors() {
                return Gw(this, gw, "f")
            }
            setColors(e) {
                if (Gw(this, mw, "f").value = (new bn).setFromColor(e.secondary),
                null != Gw(this, hw, "f") && Array.isArray(Gw(this, hw, "f").material))
                    for (const t of Gw(this, hw, "f").material)
                        "Main" == t.name ? t.color.set(e.primary) : "Metal" == t.name && t.color.set(e.frame);
                if (null != Gw(this, dw, "f") && !Array.isArray(Gw(this, dw, "f").material)) {
                    const t = Gw(this, dw, "f").material;
                    "Metal" == t.name && t.color.set(e.frame)
                }
                for (const t of Gw(this, uw, "f"))
                    if (Array.isArray(t.material))
                        for (const n of t.material)
                            "Metal" == n.name ? n.color.set(e.frame) : "Rim" == n.name && n.color.set(e.rims);
                Vw(this, gw, e, "f")
            }
            static createTexture(e) {
                if (null == Nv.images)
                    throw new Error("Car images are not loaded yet");
                const t = document.createElement("canvas");
                t.width = 2048,
                t.height = 2048;
                const n = t.getContext("2d");
                if (null == n)
                    throw new Error("Failed to get context for car texture");
                const i = new pn(t);
                return i.flipY = !1,
                i.anisotropy = e.getMaxAnisotropy(),
                i.needsUpdate = !0,
                n.clearRect(0, 0, n.canvas.width, n.canvas.height),
                n.drawImage(Nv.images.stripe, 0, 0, n.canvas.width, n.canvas.height),
                i.needsUpdate = !0,
                i
            }
            setOpacity(e) {
                for (const t of Gw(this, cw, "f").children) {
                    const n = t;
                    let i;
                    i = Array.isArray(n.material) ? n.material : [n.material];
                    for (const t of i) {
                        t.opacity = e;
                        const n = e < 1;
                        t.needsUpdate = n != t.transparent,
                        t.transparent = n
                    }
                }
            }
            setVisible(e) {
                Gw(this, cw, "f").visible = e
            }
            getCarState() {
                return Gw(this, Yv, "f")
            }
            setCarState(e) {
                var t;
                if (Gw(this, Mw, "f"))
                    return;
                const n = Gw(this, Yv, "f");
                Vw(this, Yv, e, "f");
                const i = Gw(this, Yv, "f").frames != n.frames && Gw(this, Yv, "f").frames != n.frames + 1
                  , r = .001;
                if (i) {
                    null === (t = Gw(this, kw, "f")) || void 0 === t || t.clear();
                    for (const e of Gw(this, bw, "f"))
                        e.clear()
                }
                if (this.getTime().numberOfFrames % 10 == 0 && Gw(this, Dv, "m", Iw).call(this, .01),
                i || !n.controls.reset && Gw(this, Yv, "f").controls.reset) {
                    Gw(this, jv, "f").reset(this.getPosition(), this.getQuaternion(), this.getSpeedKmh()),
                    Gw(this, Qv, "f").reset(this.getPosition(), this.getQuaternion(), this.getSpeedKmh());
                    for (const e of Gw(this, nw, "f"))
                        e()
                }
                if (Gw(this, Dv, "m", Dw).call(this, r),
                Gw(this, Dv, "m", Bw).call(this, r),
                Gw(this, Zv, "f") && Gw(this, Yv, "f").hasStarted && null == n.finishFrames && Gw(this, Jv, "f").recordFrame(n.frames, Gw(this, Yv, "f").controls),
                Gw(this, Yv, "f").nextCheckpointIndex > n.nextCheckpointIndex) {
                    this.notificationAudioEnabled && Gw(this, Dv, "m", Cw).call(this);
                    for (const e of Gw(this, iw, "f"))
                        e(n.nextCheckpointIndex)
                }
                if (null != Gw(this, Yv, "f").finishFrames && null == n.finishFrames) {
                    this.notificationAudioEnabled && Gw(this, Dv, "m", Pw).call(this);
                    for (const e of Gw(this, rw, "f"))
                        e(this)
                }
            }
            update(e) {
                var t, n;
                if (null != Gw(this, hw, "f") && null != Gw(this, dw, "f")) {
                    Gw(this, Dv, "m", Rw).call(this),
                    null === (t = Gw(this, kw, "f")) || void 0 === t || t.update(e);
                    const i = this.getMatrix4()
                      , r = this.getQuaternion();
                    Gw(this, hw, "f").matrixAutoUpdate = !1,
                    Gw(this, hw, "f").matrix.copy(i),
                    Gw(this, hw, "f").matrix.multiply((new Xn).makeTranslation(0, Nv.massOffset, 0)),
                    Gw(this, dw, "f").matrixAutoUpdate = !1,
                    Gw(this, dw, "f").matrix.copy(Gw(this, hw, "f").matrix);
                    const a = 4;
                    for (let t = 0; t < a; t++) {
                        const i = null != Gw(this, Yv, "f").wheelContact[t]
                          , a = Gw(this, Yv, "f").wheelDeltaRotation[t];
                        if (this.hasStarted()) {
                            if (i)
                                Gw(this, aw, "f")[t] = 1e3 * a,
                                Gw(this, sw, "f")[t] = 1e3 * a;
                            else {
                                const {up: n, down: i} = this.getControls()
                                  , r = 2 == t || 3 == t;
                                i ? Gw(this, Yv, "f").brakeLightEnabled ? Gw(this, sw, "f")[t] > 0 ? Gw(this, sw, "f")[t] = Math.max(0, Gw(this, sw, "f")[t] - 50 * e) : Gw(this, sw, "f")[t] < 0 && (Gw(this, sw, "f")[t] = Math.min(0, Gw(this, sw, "f")[t] + 50 * e)) : r && (Gw(this, aw, "f")[t] -= 25 * e,
                                Gw(this, sw, "f")[t] -= 25 * e) : n && r && (Gw(this, aw, "f")[t] += 25 * e,
                                Gw(this, sw, "f")[t] += 50 * e),
                                Gw(this, aw, "f")[t] *= Math.max(0, 1 - e),
                                Gw(this, sw, "f")[t] *= Math.max(0, 1 - e)
                            }
                            Gw(this, ow, "f")[t] += Gw(this, sw, "f")[t] * e
                        }
                        const s = Gw(this, Yv, "f").wheelPosition[t]
                          , o = new yn(Gw(this, Yv, "f").wheelQuaternion[t].x,Gw(this, Yv, "f").wheelQuaternion[t].y,Gw(this, Yv, "f").wheelQuaternion[t].z,Gw(this, Yv, "f").wheelQuaternion[t].w)
                          , l = Gw(this, Yv, "f").wheelRotation[t];
                        o.multiply((new yn).setFromAxisAngle(new bn(-1,0,0), Gw(this, ow, "f")[t] - l)),
                        Gw(this, uw, "f")[t].position.set(s.x, s.y, s.z),
                        Gw(this, uw, "f")[t].quaternion.set(o.x, o.y, o.z, o.w);
                        const c = Gw(this, Yv, "f").wheelSuspensionLength[t]
                          , h = Gw(this, Yv, "f").wheelSkidInfo[t];
                        if (Gw(this, dw, "f").morphTargetInfluences || (Gw(this, dw, "f").morphTargetInfluences = []),
                        Gw(this, dw, "f").morphTargetInfluences[t] = 2 * c + .06,
                        e > 0 && (null === (n = Gw(this, yw, "f")) || void 0 === n ? void 0 : n.getSettingBoolean(el.SkidmarksEnabled)) && t < Gw(this, bw, "f").length) {
                            const e = Gw(this, Yv, "f").wheelContact[t]
                              , n = Math.min(1, Math.abs(a) / Gw(Nv, Nv, "f", $v))
                              , i = Math.pow(n, Gw(Nv, Nv, "f", ew)) * Gw(Nv, Nv, "f", tw);
                            null != e && h < i && 0 == Gw(this, xw, "f")[t] && Gw(this, bw, "f")[t].spawn(new bn(s.x,s.y,s.z), r, new bn(e.position.x,e.position.y,e.position.z), new bn(e.normal.x,e.normal.y,e.normal.z))
                        }
                    }
                    Gw(this, Dv, "m", Ow).call(this, Gw(this, Yv, "f").brakeLightEnabled)
                }
            }
            updateCameras(e) {
                if (null == Gw(this, Yv, "f").finishFrames) {
                    const t = this.getPosition()
                      , n = this.getQuaternion()
                      , i = this.getSpeedKmh();
                    Gw(this, jv, "f").update(e, t, n, i),
                    Gw(this, Qv, "f").update(t, n, i)
                }
            }
            get cameraOrbit() {
                return Gw(this, jv, "f").camera
            }
            get cameraCockpit() {
                return Gw(this, Qv, "f").camera
            }
            set audioVolume(e) {
                Vw(this, zv, e, "f"),
                null != Gw(this, Uv, "f") && Gw(this, Uv, "f").gain.setTargetAtTime(Gw(this, zv, "f"), 0, .01)
            }
            static initResources() {
                return Hw(this, void 0, void 0, (function*() {
                    const e = yield new Promise(( (e, t) => {
                        (new Al).load("models/car.glb", (n => {
                            function i(e) {
                                const t = n.scene.getObjectByName(e);
                                if (null == t)
                                    throw new Error('Mesh "' + e + '" does not exist');
                                if (0 == t.children.length) {
                                    const e = t;
                                    return e.updateMatrixWorld(!0),
                                    e.geometry.applyMatrix4(e.matrix.clone()),
                                    e.matrix.identity(),
                                    e
                                }
                                const i = vl(t.children.map((e => e.geometry)), !0);
                                t.updateMatrixWorld(!0),
                                i.applyMatrix4(t.matrix.clone());
                                const r = t.children.map((e => e.material))
                                  , a = new yr(i,r);
                                return a.name = e,
                                a
                            }
                            function r(e) {
                                let t;
                                t = Array.isArray(e.material) ? e.material : [e.material];
                                for (const e of t)
                                    e.side = 0,
                                    e.shadowSide = 0;
                                return e
                            }
                            Nv.models = {
                                chassis: r(i("Body")),
                                suspension: r(i("Suspension")),
                                suspensionFL: r(i("SuspensionFL")),
                                suspensionFR: r(i("SuspensionFR")),
                                suspensionBL: r(i("SuspensionBL")),
                                suspensionBR: r(i("SuspensionBR")),
                                wheelFL: r(i("WheelFL")),
                                wheelFR: r(i("WheelFR")),
                                wheelBL: r(i("WheelBL")),
                                wheelBR: r(i("WheelBR")),
                                collisionShapeVertices: Gw(Nv, Nv, "m", Fw).call(Nv, i("Collision"))
                            },
                            Nv.models.wheelFL.geometry.translate(-.627909, .218824, -1.3478),
                            Nv.models.wheelFR.geometry.translate(.627909, .218824, -1.3478),
                            Nv.models.wheelBL.geometry.translate(-.720832, .218824, 1.52686),
                            Nv.models.wheelBR.geometry.translate(.720832, .218824, 1.52686),
                            Nv.models.wheelFL.geometry.rotateZ(Math.PI),
                            Nv.models.wheelFR.geometry.rotateZ(Math.PI),
                            Nv.models.wheelBL.geometry.rotateZ(Math.PI),
                            Nv.models.wheelBR.geometry.rotateZ(Math.PI),
                            Gw(Nv, Nv, "m", Ww).call(Nv).then((t => {
                                e(t)
                            }
                            )).catch(t)
                        }
                        ), void 0, t)
                    }
                    ));
                    return yield new Promise(( (e, t) => {
                        const n = new Image;
                        n.addEventListener("load", ( () => {
                            e()
                        }
                        )),
                        n.addEventListener("error", ( () => {
                            t(new Error("Failed to load image"))
                        }
                        )),
                        n.src = "images/car_stripe.svg",
                        Nv.images = {
                            stripe: n
                        }
                    }
                    )),
                    e
                }
                ))
            }
        }
        Nv = jw,
        Bv = new WeakMap,
        Uv = new WeakMap,
        zv = new WeakMap,
        Ov = new WeakMap,
        Fv = new WeakMap,
        Wv = new WeakMap,
        Hv = new WeakMap,
        Vv = new WeakMap,
        Gv = new WeakMap,
        jv = new WeakMap,
        Qv = new WeakMap,
        Kv = new WeakMap,
        qv = new WeakMap,
        Yv = new WeakMap,
        Xv = new WeakMap,
        Zv = new WeakMap,
        Jv = new WeakMap,
        nw = new WeakMap,
        iw = new WeakMap,
        rw = new WeakMap,
        aw = new WeakMap,
        sw = new WeakMap,
        ow = new WeakMap,
        lw = new WeakMap,
        cw = new WeakMap,
        hw = new WeakMap,
        dw = new WeakMap,
        uw = new WeakMap,
        pw = new WeakMap,
        fw = new WeakMap,
        mw = new WeakMap,
        gw = new WeakMap,
        vw = new WeakMap,
        ww = new WeakMap,
        yw = new WeakMap,
        bw = new WeakMap,
        Aw = new WeakMap,
        xw = new WeakMap,
        kw = new WeakMap,
        Ew = new WeakMap,
        Sw = new WeakMap,
        Mw = new WeakMap,
        Dv = new WeakSet,
        _w = function() {
            Gw(this, Dv, "m", Tw).call(this),
            setTimeout(( () => {
                if (null != Gw(this, Ov, "f") && (Gw(this, Ov, "f").source.stop(),
                Vw(this, Ov, null, "f")),
                null != Gw(this, Wv, "f")) {
                    for (const {source: e} of Gw(this, Wv, "f"))
                        e.stop();
                    Vw(this, Wv, null, "f")
                }
            }
            ), 200)
        }
        ,
        Tw = function() {
            if (null != Gw(this, Ov, "f") && (Gw(this, Ov, "f").source.playbackRate.setTargetAtTime(.7, 0, .15),
            Gw(this, Ov, "f").gain.gain.setTargetAtTime(0, 0, .15)),
            null != Gw(this, Wv, "f"))
                for (const e of Gw(this, Wv, "f"))
                    e.source.playbackRate.setTargetAtTime(.3, 0, .15),
                    e.gain.gain.setTargetAtTime(0, 0, .15);
            if (null != Gw(this, Aw, "f")) {
                for (const {source: e} of Gw(this, Aw, "f"))
                    e.stop();
                Vw(this, Aw, null, "f")
            }
        }
        ,
        Cw = function() {
            var e, t;
            const n = null !== (t = null === (e = Gw(this, yw, "f")) || void 0 === e ? void 0 : e.getSettingFloat(el.CheckpointVolume)) && void 0 !== t ? t : 0;
            let i = Math.min(Math.max(Gw(this, zv, "f") * n, 0), 1);
            if (Number.isNaN(i) && (i = 0),
            i > 0 && null != Gw(this, Bv, "f")) {
                const e = Gw(this, Bv, "f").getBuffer("checkpoint");
                if (null != e && null != Gw(this, Bv, "f").context && null != Gw(this, Bv, "f").destinationMaster) {
                    const t = Gw(this, Bv, "f").context.createBufferSource();
                    t.buffer = e,
                    t.playbackRate.value = 1.25;
                    const n = Gw(this, Bv, "f").context.createGain();
                    n.gain.value = .03 * i,
                    t.connect(n),
                    n.connect(Gw(this, Bv, "f").destinationMaster),
                    t.start(0)
                }
            }
        }
        ,
        Pw = function() {
            var e, t;
            const n = null !== (t = null === (e = Gw(this, yw, "f")) || void 0 === e ? void 0 : e.getSettingFloat(el.CheckpointVolume)) && void 0 !== t ? t : 0;
            let i = Math.min(Math.max(Gw(this, zv, "f") * n, 0), 1);
            if (Number.isNaN(i) && (i = 0),
            i > 0 && null != Gw(this, Bv, "f")) {
                const e = Gw(this, Bv, "f").getBuffer("finish");
                if (null != e && null != Gw(this, Bv, "f").context && null != Gw(this, Bv, "f").destinationMaster) {
                    const t = Gw(this, Bv, "f").context.createBufferSource();
                    t.buffer = e,
                    t.playbackRate.value = 1.25;
                    const n = Gw(this, Bv, "f").context.createGain();
                    n.gain.value = .03,
                    t.connect(n),
                    n.connect(Gw(this, Bv, "f").destinationMaster),
                    t.start(0)
                }
            }
        }
        ,
        Iw = function(e) {
            var t;
            for (let n = 0; n < 4; n++) {
                const i = Gw(this, Yv, "f").wheelPosition[n]
                  , r = null != Gw(this, Yv, "f").wheelContact[n]
                  , a = Gw(this, Yv, "f").wheelDeltaRotation[n]
                  , s = Gw(this, Yv, "f").wheelSkidInfo[n]
                  , o = Math.min(1, Math.abs(a) / Gw(Nv, Nv, "f", $v))
                  , l = Math.pow(o, Gw(Nv, Nv, "f", ew)) * Gw(Nv, Nv, "f", tw);
                r && s < l ? (n < Gw(this, bw, "f").length && (Gw(this, xw, "f")[n] = Math.max(0, Gw(this, xw, "f")[n] - e)),
                0 == Gw(this, xw, "f")[n] && null != Gw(this, kw, "f") && Gw(this, kw, "f").spawn(i.x, i.y, i.z)) : (n < Gw(this, bw, "f").length && (null === (t = Gw(this, yw, "f")) || void 0 === t ? void 0 : t.getSettingBoolean(el.SkidmarksEnabled)) && Gw(this, bw, "f")[n].break(),
                Gw(this, xw, "f")[n] = .075)
            }
        }
        ,
        Rw = function() {
            if (null != Gw(this, Bv, "f") && null != Gw(this, Bv, "f").context && null != Gw(this, Bv, "f").destinationSfx) {
                null == Gw(this, Uv, "f") && (Vw(this, Uv, Gw(this, Bv, "f").context.createGain(), "f"),
                Gw(this, Uv, "f").gain.value = Gw(this, zv, "f"),
                Gw(this, Uv, "f").connect(Gw(this, Bv, "f").destinationSfx)),
                null == Gw(this, Vv, "f") && (Vw(this, Vv, Gw(this, Bv, "f").context.createPanner(), "f"),
                Gw(this, Vv, "f").refDistance = 5,
                Gw(this, Vv, "f").connect(Gw(this, Uv, "f")));
                const e = this.getPosition();
                Gw(this, Vv, "f").positionX.value = e.x,
                Gw(this, Vv, "f").positionY.value = e.y,
                Gw(this, Vv, "f").positionZ.value = e.z;
                const t = 4;
                if (Gw(this, Gv, "f").length < t) {
                    Gw(this, Gv, "f").length = 0;
                    for (let e = 0; e < t; ++e) {
                        const e = Gw(this, Bv, "f").context.createPanner();
                        e.refDistance = 5,
                        e.connect(Gw(this, Uv, "f")),
                        Gw(this, Gv, "f").push(e)
                    }
                }
                for (let e = 0; e < t; ++e) {
                    const t = Gw(this, Gv, "f")[e]
                      , n = Gw(this, Yv, "f").wheelPosition[e];
                    t.positionX.value = n.x,
                    t.positionY.value = n.y,
                    t.positionZ.value = n.z
                }
                Gw(this, lw, "f").camera != Gw(this, jv, "f").camera && Gw(this, lw, "f").camera != Gw(this, Qv, "f").camera || Gw(this, Bv, "f").refreshListener(Gw(this, lw, "f")),
                Gw(this, Dv, "m", Lw).call(this),
                Gw(this, Dv, "m", Nw).call(this),
                Gw(this, Dv, "m", zw).call(this)
            }
        }
        ,
        Lw = function() {
            if (null == Gw(this, Ov, "f") && null != Gw(this, Vv, "f") && null != Gw(this, Bv, "f")) {
                const e = Gw(this, Bv, "f").getBuffer("engine");
                if (null != e && null != Gw(this, Bv, "f").context) {
                    const t = Gw(this, Bv, "f").context.createBufferSource();
                    t.buffer = e,
                    t.loop = !0,
                    t.playbackRate.value = .7;
                    const n = Gw(this, Bv, "f").context.createGain();
                    n.gain.value = 0,
                    t.connect(n),
                    n.connect(Gw(this, Vv, "f")),
                    t.start(0, 2 * Math.random()),
                    Vw(this, Ov, {
                        source: t,
                        gain: n
                    }, "f")
                }
            }
            if (null != Gw(this, Ov, "f")) {
                const e = (Gw(this, aw, "f")[0] + Gw(this, aw, "f")[1] + Gw(this, aw, "f")[2] + Gw(this, aw, "f")[3]) / 4
                  , t = .7 + Math.pow(Math.abs(e), 1 / 3) / 3
                  , n = null != Gw(this, Yv, "f").wheelContact[0] || null != Gw(this, Yv, "f").wheelContact[1] || null != Gw(this, Yv, "f").wheelContact[2] || null != Gw(this, Yv, "f").wheelContact[3]
                  , {up: i, down: r} = this.getControls()
                  , a = this.hasStarted() && !this.hasFinished() && (i && !(r && Gw(this, Yv, "f").brakeLightEnabled) || r && !Gw(this, Yv, "f").brakeLightEnabled);
                let s;
                s = n ? a ? t : Math.max(.7, t / 2) : a ? Math.max(.7, 1.15 * t) : Math.max(.7, t / 2),
                Gw(this, Ov, "f").source.playbackRate.setTargetAtTime(s, 0, .05),
                Gw(this, Ov, "f").gain.gain.setTargetAtTime(Math.min(.285, s / 14), 0, .05)
            }
        }
        ,
        Dw = function(e) {
            if (Gw(this, Fv, "f").length < 4) {
                Gw(this, Fv, "f").length = 0;
                for (let e = 0; e < 4; ++e)
                    Gw(this, Fv, "f").push(0)
            }
            for (let t = 0; t < 4 && t < Gw(this, Gv, "f").length; t++)
                if (Gw(this, Fv, "f")[t] -= e,
                Gw(this, Fv, "f")[t] <= 0) {
                    const e = Math.abs(Gw(this, Yv, "f").wheelSuspensionVelocity[t]);
                    if (e > 4 && null != Gw(this, Bv, "f")) {
                        const n = Gw(this, Bv, "f").getBuffer("suspension");
                        if (null != n && null != Gw(this, Bv, "f").context) {
                            const i = Gw(this, Bv, "f").context.createBufferSource();
                            i.buffer = n,
                            i.playbackRate.value = .7 + .1 * Math.random();
                            const r = Gw(this, Bv, "f").context.createGain();
                            r.gain.value = Math.min(.285, e / 140),
                            i.connect(r),
                            r.connect(Gw(this, Gv, "f")[t]),
                            i.start(Gw(this, Bv, "f").context.currentTime + .02 * Math.random()),
                            Gw(this, Fv, "f")[t] = .1
                        }
                    }
                }
        }
        ,
        Nw = function() {
            if (null == Gw(this, Wv, "f") && null != Gw(this, Bv, "f")) {
                const e = Gw(this, Bv, "f").getBuffer("tires");
                if (null != e && null != Gw(this, Bv, "f").context) {
                    Vw(this, Wv, [], "f");
                    const t = 4;
                    for (let n = 0; n < t; n++) {
                        const i = Gw(this, Bv, "f").context.createBufferSource();
                        i.buffer = e,
                        i.loop = !0,
                        i.playbackRate.value = .3;
                        const r = Gw(this, Bv, "f").context.createGain();
                        r.gain.value = 0,
                        i.connect(r),
                        r.connect(Gw(this, Gv, "f")[n]),
                        i.start(0, n / t * 3.5 + .25 * Math.random()),
                        Gw(this, Wv, "f").push({
                            source: i,
                            gain: r
                        })
                    }
                }
            }
            if (null != Gw(this, Wv, "f"))
                for (let e = 0; e < Gw(this, Wv, "f").length; ++e) {
                    const t = Gw(this, Wv, "f")[e];
                    if (null != Gw(this, Yv, "f").wheelContact[e]) {
                        const e = Math.min(3, Math.abs(this.getSpeedKmh()) / 110);
                        t.gain.gain.setTargetAtTime(e / 10.5, 0, .15)
                    } else
                        t.gain.gain.setTargetAtTime(0, 0, .15);
                    const n = .3 + Math.min(.4, Math.abs(this.getSpeedKmh()) / 800);
                    t.source.playbackRate.setTargetAtTime(n, 0, .15)
                }
        }
        ,
        Bw = function(e) {
            null != Gw(this, Hv, "f") && (Gw(this, Hv, "f").timeout -= e,
            Gw(this, Hv, "f").timeout <= 0 && Vw(this, Hv, null, "f"));
            const t = Gw(this, Yv, "f").collisionImpulses;
            for (const e of t)
                Gw(this, Dv, "m", Uw).call(this, e)
        }
        ,
        Uw = function(e) {
            if (e > 25 && null != Gw(this, Vv, "f") && null != Gw(this, Bv, "f") && (null == Gw(this, Hv, "f") || Gw(this, Hv, "f").impulse + 100 < e)) {
                Vw(this, Hv, {
                    timeout: .2,
                    impulse: e
                }, "f");
                const t = Gw(this, Bv, "f").getBuffer("collision");
                if (null != t && null != Gw(this, Bv, "f").context) {
                    const n = Gw(this, Bv, "f").context.createBufferSource();
                    n.buffer = t,
                    n.playbackRate.value = .1 + .15 * Math.min(e / 4e3, 1);
                    const i = Gw(this, Bv, "f").context.createGain();
                    i.gain.value = Math.max(.3, Math.min(e / 4e3, 1)) / 2.5,
                    n.connect(i),
                    i.connect(Gw(this, Vv, "f")),
                    n.start(0)
                }
            }
        }
        ,
        zw = function() {
            if (null == Gw(this, Aw, "f") && null != Gw(this, Bv, "f")) {
                const e = Gw(this, Bv, "f").getBuffer("skidding");
                if (null != e && null != Gw(this, Bv, "f").context) {
                    Vw(this, Aw, [], "f");
                    const t = 4;
                    for (let n = 0; n < t; ++n) {
                        const i = Gw(this, Bv, "f").context.createBufferSource();
                        i.buffer = e,
                        i.loop = !0,
                        i.playbackRate.value = .5;
                        const r = Gw(this, Bv, "f").context.createGain();
                        r.gain.value = 0,
                        i.connect(r),
                        r.connect(Gw(this, Gv, "f")[n]),
                        i.start(0, n / t * 3.5 + .25 * Math.random()),
                        Gw(this, Aw, "f").push({
                            source: i,
                            gain: r
                        })
                    }
                }
            }
            if (null != Gw(this, Aw, "f"))
                for (let e = 0; e < Gw(this, Aw, "f").length; ++e) {
                    const t = Gw(this, Aw, "f")[e];
                    0 == Gw(this, xw, "f")[e] ? t.gain.gain.setTargetAtTime(.75 / 3.5, 0, .1) : t.gain.gain.setTargetAtTime(0, 0, .1)
                }
        }
        ,
        Ow = function(e) {
            null != Gw(this, pw, "f") && (e ? Gw(this, pw, "f").emissive.setRGB(1, .4, .3) : Gw(this, pw, "f").emissive.setRGB(0, 0, 0))
        }
        ,
        Fw = function(e) {
            const t = e.geometry.toNonIndexed();
            if (!(t.attributes.position instanceof Xi))
                throw new Error("Vertices must use BufferAttribute");
            return Array.from(t.attributes.position.array)
        }
        ,
        Ww = function() {
            return Hw(this, void 0, void 0, (function*() {
                if (null == Nv.models)
                    throw new Error("Car models are not loaded yet");
                const e = new Float32Array(Nv.models.collisionShapeVertices)
                  , t = yield window.crypto.subtle.digest("SHA-256", e.buffer)
                  , n = Array.from(new Uint8Array(t)).map((e => e.toString(16).padStart(2, "0"))).join("")
                  , i = "dd663fb6330ed93725bf865d5eac2cd29ba19f74dbb3f67ae7f695ea1f68aed0";
                return n == i || console.error("Car collision model checksum mismatch: " + n + " != " + i),
                n == i
            }
            ))
        }
        ,
        jw.massOffset = .6,
        jw.detectorBoxCenter = new bn(0,.48,-.15),
        jw.detectorBoxSize = new bn(.89,.22,1.8),
        jw.suspensionResetLengthFront = .07809501004219055,
        jw.suspensionResetLengthRear = .0781289680480957,
        $v = {
            value: .08
        },
        ew = {
            value: 3
        },
        tw = {
            value: .5
        },
        jw.models = null,
        jw.images = null;
        const Qw = jw;
        var Kw = i(5959)
          , qw = {};
        qw.styleTagTransform = u(),
        qw.setAttributes = l(),
        qw.insert = s().bind(null, "head"),
        qw.domAPI = r(),
        qw.insertStyleElement = h();
        t()(Kw.A, qw);
        Kw.A && Kw.A.locals && Kw.A.locals;
        const Yw = {
            type: "change"
        }
          , Xw = {
            type: "start"
        }
          , Zw = {
            type: "end"
        }
          , Jw = new Yn
          , $w = new va
          , ey = Math.cos(70 * jt.DEG2RAD)
          , ty = new bn
          , ny = 2 * Math.PI
          , iy = -1
          , ry = 0
          , ay = 1
          , sy = 2
          , oy = 3
          , ly = 4
          , cy = 5
          , hy = 6
          , dy = 1e-6;
        class uy extends Zo {
            constructor(e, t=null) {
                super(e, t),
                this.state = iy,
                this.enabled = !0,
                this.target = new bn,
                this.cursor = new bn,
                this.minDistance = 0,
                this.maxDistance = 1 / 0,
                this.minZoom = 0,
                this.maxZoom = 1 / 0,
                this.minTargetRadius = 0,
                this.maxTargetRadius = 1 / 0,
                this.minPolarAngle = 0,
                this.maxPolarAngle = Math.PI,
                this.minAzimuthAngle = -1 / 0,
                this.maxAzimuthAngle = 1 / 0,
                this.enableDamping = !1,
                this.dampingFactor = .05,
                this.enableZoom = !0,
                this.zoomSpeed = 1,
                this.enableRotate = !0,
                this.rotateSpeed = 1,
                this.keyRotateSpeed = 1,
                this.enablePan = !0,
                this.panSpeed = 1,
                this.screenSpacePanning = !0,
                this.keyPanSpeed = 7,
                this.zoomToCursor = !1,
                this.autoRotate = !1,
                this.autoRotateSpeed = 2,
                this.keys = {
                    LEFT: "ArrowLeft",
                    UP: "ArrowUp",
                    RIGHT: "ArrowRight",
                    BOTTOM: "ArrowDown"
                },
                this.mouseButtons = {
                    LEFT: v,
                    MIDDLE: w,
                    RIGHT: y
                },
                this.touches = {
                    ONE: b,
                    TWO: x
                },
                this.target0 = this.target.clone(),
                this.position0 = this.object.position.clone(),
                this.zoom0 = this.object.zoom,
                this._domElementKeyEvents = null,
                this._lastPosition = new bn,
                this._lastQuaternion = new yn,
                this._lastTargetPosition = new bn,
                this._quat = (new yn).setFromUnitVectors(e.up, new bn(0,1,0)),
                this._quatInverse = this._quat.clone().invert(),
                this._spherical = new Yo,
                this._sphericalDelta = new Yo,
                this._scale = 1,
                this._panOffset = new bn,
                this._rotateStart = new Qt,
                this._rotateEnd = new Qt,
                this._rotateDelta = new Qt,
                this._panStart = new Qt,
                this._panEnd = new Qt,
                this._panDelta = new Qt,
                this._dollyStart = new Qt,
                this._dollyEnd = new Qt,
                this._dollyDelta = new Qt,
                this._dollyDirection = new bn,
                this._mouse = new Qt,
                this._performCursorZoom = !1,
                this._pointers = [],
                this._pointerPositions = {},
                this._controlActive = !1,
                this._onPointerMove = fy.bind(this),
                this._onPointerDown = py.bind(this),
                this._onPointerUp = my.bind(this),
                this._onContextMenu = xy.bind(this),
                this._onMouseWheel = wy.bind(this),
                this._onKeyDown = yy.bind(this),
                this._onTouchStart = by.bind(this),
                this._onTouchMove = Ay.bind(this),
                this._onMouseDown = gy.bind(this),
                this._onMouseMove = vy.bind(this),
                this._interceptControlDown = ky.bind(this),
                this._interceptControlUp = Ey.bind(this),
                null !== this.domElement && this.connect(),
                this.update()
            }
            connect() {
                this.domElement.addEventListener("pointerdown", this._onPointerDown),
                this.domElement.addEventListener("pointercancel", this._onPointerUp),
                this.domElement.addEventListener("contextmenu", this._onContextMenu),
                this.domElement.addEventListener("wheel", this._onMouseWheel, {
                    passive: !1
                });
                this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, {
                    passive: !0,
                    capture: !0
                }),
                this.domElement.style.touchAction = "none"
            }
            disconnect() {
                this.domElement.removeEventListener("pointerdown", this._onPointerDown),
                this.domElement.removeEventListener("pointermove", this._onPointerMove),
                this.domElement.removeEventListener("pointerup", this._onPointerUp),
                this.domElement.removeEventListener("pointercancel", this._onPointerUp),
                this.domElement.removeEventListener("wheel", this._onMouseWheel),
                this.domElement.removeEventListener("contextmenu", this._onContextMenu),
                this.stopListenToKeyEvents();
                this.domElement.getRootNode().removeEventListener("keydown", this._interceptControlDown, {
                    capture: !0
                }),
                this.domElement.style.touchAction = "auto"
            }
            dispose() {
                this.disconnect()
            }
            getPolarAngle() {
                return this._spherical.phi
            }
            getAzimuthalAngle() {
                return this._spherical.theta
            }
            getDistance() {
                return this.object.position.distanceTo(this.target)
            }
            listenToKeyEvents(e) {
                e.addEventListener("keydown", this._onKeyDown),
                this._domElementKeyEvents = e
            }
            stopListenToKeyEvents() {
                null !== this._domElementKeyEvents && (this._domElementKeyEvents.removeEventListener("keydown", this._onKeyDown),
                this._domElementKeyEvents = null)
            }
            saveState() {
                this.target0.copy(this.target),
                this.position0.copy(this.object.position),
                this.zoom0 = this.object.zoom
            }
            reset() {
                this.target.copy(this.target0),
                this.object.position.copy(this.position0),
                this.object.zoom = this.zoom0,
                this.object.updateProjectionMatrix(),
                this.dispatchEvent(Yw),
                this.update(),
                this.state = iy
            }
            update(e=null) {
                const t = this.object.position;
                ty.copy(t).sub(this.target),
                ty.applyQuaternion(this._quat),
                this._spherical.setFromVector3(ty),
                this.autoRotate && this.state === iy && this._rotateLeft(this._getAutoRotationAngle(e)),
                this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor,
                this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta,
                this._spherical.phi += this._sphericalDelta.phi);
                let n = this.minAzimuthAngle
                  , i = this.maxAzimuthAngle;
                isFinite(n) && isFinite(i) && (n < -Math.PI ? n += ny : n > Math.PI && (n -= ny),
                i < -Math.PI ? i += ny : i > Math.PI && (i -= ny),
                this._spherical.theta = n <= i ? Math.max(n, Math.min(i, this._spherical.theta)) : this._spherical.theta > (n + i) / 2 ? Math.max(n, this._spherical.theta) : Math.min(i, this._spherical.theta)),
                this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)),
                this._spherical.makeSafe(),
                !0 === this.enableDamping ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset),
                this.target.sub(this.cursor),
                this.target.clampLength(this.minTargetRadius, this.maxTargetRadius),
                this.target.add(this.cursor);
                let r = !1;
                if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
                    this._spherical.radius = this._clampDistance(this._spherical.radius);
                else {
                    const e = this._spherical.radius;
                    this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale),
                    r = e != this._spherical.radius
                }
                if (ty.setFromSpherical(this._spherical),
                ty.applyQuaternion(this._quatInverse),
                t.copy(this.target).add(ty),
                this.object.lookAt(this.target),
                !0 === this.enableDamping ? (this._sphericalDelta.theta *= 1 - this.dampingFactor,
                this._sphericalDelta.phi *= 1 - this.dampingFactor,
                this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0),
                this._panOffset.set(0, 0, 0)),
                this.zoomToCursor && this._performCursorZoom) {
                    let e = null;
                    if (this.object.isPerspectiveCamera) {
                        const t = ty.length();
                        e = this._clampDistance(t * this._scale);
                        const n = t - e;
                        this.object.position.addScaledVector(this._dollyDirection, n),
                        this.object.updateMatrixWorld(),
                        r = !!n
                    } else if (this.object.isOrthographicCamera) {
                        const t = new bn(this._mouse.x,this._mouse.y,0);
                        t.unproject(this.object);
                        const n = this.object.zoom;
                        this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)),
                        this.object.updateProjectionMatrix(),
                        r = n !== this.object.zoom;
                        const i = new bn(this._mouse.x,this._mouse.y,0);
                        i.unproject(this.object),
                        this.object.position.sub(i).add(t),
                        this.object.updateMatrixWorld(),
                        e = ty.length()
                    } else
                        console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),
                        this.zoomToCursor = !1;
                    null !== e && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position) : (Jw.origin.copy(this.object.position),
                    Jw.direction.set(0, 0, -1).transformDirection(this.object.matrix),
                    Math.abs(this.object.up.dot(Jw.direction)) < ey ? this.object.lookAt(this.target) : ($w.setFromNormalAndCoplanarPoint(this.object.up, this.target),
                    Jw.intersectPlane($w, this.target))))
                } else if (this.object.isOrthographicCamera) {
                    const e = this.object.zoom;
                    this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)),
                    e !== this.object.zoom && (this.object.updateProjectionMatrix(),
                    r = !0)
                }
                return this._scale = 1,
                this._performCursorZoom = !1,
                !!(r || this._lastPosition.distanceToSquared(this.object.position) > dy || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > dy || this._lastTargetPosition.distanceToSquared(this.target) > dy) && (this.dispatchEvent(Yw),
                this._lastPosition.copy(this.object.position),
                this._lastQuaternion.copy(this.object.quaternion),
                this._lastTargetPosition.copy(this.target),
                !0)
            }
            _getAutoRotationAngle(e) {
                return null !== e ? ny / 60 * this.autoRotateSpeed * e : ny / 60 / 60 * this.autoRotateSpeed
            }
            _getZoomScale(e) {
                const t = Math.abs(.01 * e);
                return Math.pow(.95, this.zoomSpeed * t)
            }
            _rotateLeft(e) {
                this._sphericalDelta.theta -= e
            }
            _rotateUp(e) {
                this._sphericalDelta.phi -= e
            }
            _panLeft(e, t) {
                ty.setFromMatrixColumn(t, 0),
                ty.multiplyScalar(-e),
                this._panOffset.add(ty)
            }
            _panUp(e, t) {
                !0 === this.screenSpacePanning ? ty.setFromMatrixColumn(t, 1) : (ty.setFromMatrixColumn(t, 0),
                ty.crossVectors(this.object.up, ty)),
                ty.multiplyScalar(e),
                this._panOffset.add(ty)
            }
            _pan(e, t) {
                const n = this.domElement;
                if (this.object.isPerspectiveCamera) {
                    const i = this.object.position;
                    ty.copy(i).sub(this.target);
                    let r = ty.length();
                    r *= Math.tan(this.object.fov / 2 * Math.PI / 180),
                    this._panLeft(2 * e * r / n.clientHeight, this.object.matrix),
                    this._panUp(2 * t * r / n.clientHeight, this.object.matrix)
                } else
                    this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / n.clientWidth, this.object.matrix),
                    this._panUp(t * (this.object.top - this.object.bottom) / this.object.zoom / n.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),
                    this.enablePan = !1)
            }
            _dollyOut(e) {
                this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale /= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),
                this.enableZoom = !1)
            }
            _dollyIn(e) {
                this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale *= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),
                this.enableZoom = !1)
            }
            _updateZoomParameters(e, t) {
                if (!this.zoomToCursor)
                    return;
                this._performCursorZoom = !0;
                const n = this.domElement.getBoundingClientRect()
                  , i = e - n.left
                  , r = t - n.top
                  , a = n.width
                  , s = n.height;
                this._mouse.x = i / a * 2 - 1,
                this._mouse.y = -r / s * 2 + 1,
                this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize()
            }
            _clampDistance(e) {
                return Math.max(this.minDistance, Math.min(this.maxDistance, e))
            }
            _handleMouseDownRotate(e) {
                this._rotateStart.set(e.clientX, e.clientY)
            }
            _handleMouseDownDolly(e) {
                this._updateZoomParameters(e.clientX, e.clientX),
                this._dollyStart.set(e.clientX, e.clientY)
            }
            _handleMouseDownPan(e) {
                this._panStart.set(e.clientX, e.clientY)
            }
            _handleMouseMoveRotate(e) {
                this._rotateEnd.set(e.clientX, e.clientY),
                this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
                const t = this.domElement;
                this._rotateLeft(ny * this._rotateDelta.x / t.clientHeight),
                this._rotateUp(ny * this._rotateDelta.y / t.clientHeight),
                this._rotateStart.copy(this._rotateEnd),
                this.update()
            }
            _handleMouseMoveDolly(e) {
                this._dollyEnd.set(e.clientX, e.clientY),
                this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart),
                this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)),
                this._dollyStart.copy(this._dollyEnd),
                this.update()
            }
            _handleMouseMovePan(e) {
                this._panEnd.set(e.clientX, e.clientY),
                this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed),
                this._pan(this._panDelta.x, this._panDelta.y),
                this._panStart.copy(this._panEnd),
                this.update()
            }
            _handleMouseWheel(e) {
                this._updateZoomParameters(e.clientX, e.clientY),
                e.deltaY < 0 ? this._dollyIn(this._getZoomScale(e.deltaY)) : e.deltaY > 0 && this._dollyOut(this._getZoomScale(e.deltaY)),
                this.update()
            }
            _handleKeyDown(e) {
                let t = !1;
                switch (e.code) {
                case this.keys.UP:
                    e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(ny * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed),
                    t = !0;
                    break;
                case this.keys.BOTTOM:
                    e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-ny * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed),
                    t = !0;
                    break;
                case this.keys.LEFT:
                    e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(ny * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0),
                    t = !0;
                    break;
                case this.keys.RIGHT:
                    e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-ny * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0),
                    t = !0
                }
                t && (e.preventDefault(),
                this.update())
            }
            _handleTouchStartRotate(e) {
                if (1 === this._pointers.length)
                    this._rotateStart.set(e.pageX, e.pageY);
                else {
                    const t = this._getSecondPointerPosition(e)
                      , n = .5 * (e.pageX + t.x)
                      , i = .5 * (e.pageY + t.y);
                    this._rotateStart.set(n, i)
                }
            }
            _handleTouchStartPan(e) {
                if (1 === this._pointers.length)
                    this._panStart.set(e.pageX, e.pageY);
                else {
                    const t = this._getSecondPointerPosition(e)
                      , n = .5 * (e.pageX + t.x)
                      , i = .5 * (e.pageY + t.y);
                    this._panStart.set(n, i)
                }
            }
            _handleTouchStartDolly(e) {
                const t = this._getSecondPointerPosition(e)
                  , n = e.pageX - t.x
                  , i = e.pageY - t.y
                  , r = Math.sqrt(n * n + i * i);
                this._dollyStart.set(0, r)
            }
            _handleTouchStartDollyPan(e) {
                this.enableZoom && this._handleTouchStartDolly(e),
                this.enablePan && this._handleTouchStartPan(e)
            }
            _handleTouchStartDollyRotate(e) {
                this.enableZoom && this._handleTouchStartDolly(e),
                this.enableRotate && this._handleTouchStartRotate(e)
            }
            _handleTouchMoveRotate(e) {
                if (1 == this._pointers.length)
                    this._rotateEnd.set(e.pageX, e.pageY);
                else {
                    const t = this._getSecondPointerPosition(e)
                      , n = .5 * (e.pageX + t.x)
                      , i = .5 * (e.pageY + t.y);
                    this._rotateEnd.set(n, i)
                }
                this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
                const t = this.domElement;
                this._rotateLeft(ny * this._rotateDelta.x / t.clientHeight),
                this._rotateUp(ny * this._rotateDelta.y / t.clientHeight),
                this._rotateStart.copy(this._rotateEnd)
            }
            _handleTouchMovePan(e) {
                if (1 === this._pointers.length)
                    this._panEnd.set(e.pageX, e.pageY);
                else {
                    const t = this._getSecondPointerPosition(e)
                      , n = .5 * (e.pageX + t.x)
                      , i = .5 * (e.pageY + t.y);
                    this._panEnd.set(n, i)
                }
                this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed),
                this._pan(this._panDelta.x, this._panDelta.y),
                this._panStart.copy(this._panEnd)
            }
            _handleTouchMoveDolly(e) {
                const t = this._getSecondPointerPosition(e)
                  , n = e.pageX - t.x
                  , i = e.pageY - t.y
                  , r = Math.sqrt(n * n + i * i);
                this._dollyEnd.set(0, r),
                this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)),
                this._dollyOut(this._dollyDelta.y),
                this._dollyStart.copy(this._dollyEnd);
                const a = .5 * (e.pageX + t.x)
                  , s = .5 * (e.pageY + t.y);
                this._updateZoomParameters(a, s)
            }
            _handleTouchMoveDollyPan(e) {
                this.enableZoom && this._handleTouchMoveDolly(e),
                this.enablePan && this._handleTouchMovePan(e)
            }
            _handleTouchMoveDollyRotate(e) {
                this.enableZoom && this._handleTouchMoveDolly(e),
                this.enableRotate && this._handleTouchMoveRotate(e)
            }
            _addPointer(e) {
                this._pointers.push(e.pointerId)
            }
            _removePointer(e) {
                delete this._pointerPositions[e.pointerId];
                for (let t = 0; t < this._pointers.length; t++)
                    if (this._pointers[t] == e.pointerId)
                        return void this._pointers.splice(t, 1)
            }
            _isTrackingPointer(e) {
                for (let t = 0; t < this._pointers.length; t++)
                    if (this._pointers[t] == e.pointerId)
                        return !0;
                return !1
            }
            _trackPointer(e) {
                let t = this._pointerPositions[e.pointerId];
                void 0 === t && (t = new Qt,
                this._pointerPositions[e.pointerId] = t),
                t.set(e.pageX, e.pageY)
            }
            _getSecondPointerPosition(e) {
                const t = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
                return this._pointerPositions[t]
            }
            _customWheelEvent(e) {
                const t = e.deltaMode
                  , n = {
                    clientX: e.clientX,
                    clientY: e.clientY,
                    deltaY: e.deltaY
                };
                switch (t) {
                case 1:
                    n.deltaY *= 16;
                    break;
                case 2:
                    n.deltaY *= 100
                }
                return e.ctrlKey && !this._controlActive && (n.deltaY *= 10),
                n
            }
        }
        function py(e) {
            !1 !== this.enabled && (0 === this._pointers.length && (this.domElement.setPointerCapture(e.pointerId),
            this.domElement.addEventListener("pointermove", this._onPointerMove),
            this.domElement.addEventListener("pointerup", this._onPointerUp)),
            this._isTrackingPointer(e) || (this._addPointer(e),
            "touch" === e.pointerType ? this._onTouchStart(e) : this._onMouseDown(e)))
        }
        function fy(e) {
            !1 !== this.enabled && ("touch" === e.pointerType ? this._onTouchMove(e) : this._onMouseMove(e))
        }
        function my(e) {
            switch (this._removePointer(e),
            this._pointers.length) {
            case 0:
                this.domElement.releasePointerCapture(e.pointerId),
                this.domElement.removeEventListener("pointermove", this._onPointerMove),
                this.domElement.removeEventListener("pointerup", this._onPointerUp),
                this.dispatchEvent(Zw),
                this.state = iy;
                break;
            case 1:
                const t = this._pointers[0]
                  , n = this._pointerPositions[t];
                this._onTouchStart({
                    pointerId: t,
                    pageX: n.x,
                    pageY: n.y
                })
            }
        }
        function gy(e) {
            let t;
            switch (e.button) {
            case 0:
                t = this.mouseButtons.LEFT;
                break;
            case 1:
                t = this.mouseButtons.MIDDLE;
                break;
            case 2:
                t = this.mouseButtons.RIGHT;
                break;
            default:
                t = -1
            }
            switch (t) {
            case w:
                if (!1 === this.enableZoom)
                    return;
                this._handleMouseDownDolly(e),
                this.state = ay;
                break;
            case v:
                if (e.ctrlKey || e.metaKey || e.shiftKey) {
                    if (!1 === this.enablePan)
                        return;
                    this._handleMouseDownPan(e),
                    this.state = sy
                } else {
                    if (!1 === this.enableRotate)
                        return;
                    this._handleMouseDownRotate(e),
                    this.state = ry
                }
                break;
            case y:
                if (e.ctrlKey || e.metaKey || e.shiftKey) {
                    if (!1 === this.enableRotate)
                        return;
                    this._handleMouseDownRotate(e),
                    this.state = ry
                } else {
                    if (!1 === this.enablePan)
                        return;
                    this._handleMouseDownPan(e),
                    this.state = sy
                }
                break;
            default:
                this.state = iy
            }
            this.state !== iy && this.dispatchEvent(Xw)
        }
        function vy(e) {
            switch (this.state) {
            case ry:
                if (!1 === this.enableRotate)
                    return;
                this._handleMouseMoveRotate(e);
                break;
            case ay:
                if (!1 === this.enableZoom)
                    return;
                this._handleMouseMoveDolly(e);
                break;
            case sy:
                if (!1 === this.enablePan)
                    return;
                this._handleMouseMovePan(e)
            }
        }
        function wy(e) {
            !1 !== this.enabled && !1 !== this.enableZoom && this.state === iy && (e.preventDefault(),
            this.dispatchEvent(Xw),
            this._handleMouseWheel(this._customWheelEvent(e)),
            this.dispatchEvent(Zw))
        }
        function yy(e) {
            !1 !== this.enabled && this._handleKeyDown(e)
        }
        function by(e) {
            switch (this._trackPointer(e),
            this._pointers.length) {
            case 1:
                switch (this.touches.ONE) {
                case b:
                    if (!1 === this.enableRotate)
                        return;
                    this._handleTouchStartRotate(e),
                    this.state = oy;
                    break;
                case A:
                    if (!1 === this.enablePan)
                        return;
                    this._handleTouchStartPan(e),
                    this.state = ly;
                    break;
                default:
                    this.state = iy
                }
                break;
            case 2:
                switch (this.touches.TWO) {
                case x:
                    if (!1 === this.enableZoom && !1 === this.enablePan)
                        return;
                    this._handleTouchStartDollyPan(e),
                    this.state = cy;
                    break;
                case k:
                    if (!1 === this.enableZoom && !1 === this.enableRotate)
                        return;
                    this._handleTouchStartDollyRotate(e),
                    this.state = hy;
                    break;
                default:
                    this.state = iy
                }
                break;
            default:
                this.state = iy
            }
            this.state !== iy && this.dispatchEvent(Xw)
        }
        function Ay(e) {
            switch (this._trackPointer(e),
            this.state) {
            case oy:
                if (!1 === this.enableRotate)
                    return;
                this._handleTouchMoveRotate(e),
                this.update();
                break;
            case ly:
                if (!1 === this.enablePan)
                    return;
                this._handleTouchMovePan(e),
                this.update();
                break;
            case cy:
                if (!1 === this.enableZoom && !1 === this.enablePan)
                    return;
                this._handleTouchMoveDollyPan(e),
                this.update();
                break;
            case hy:
                if (!1 === this.enableZoom && !1 === this.enableRotate)
                    return;
                this._handleTouchMoveDollyRotate(e),
                this.update();
                break;
            default:
                this.state = iy
            }
        }
        function xy(e) {
            !1 !== this.enabled && e.preventDefault()
        }
        function ky(e) {
            if ("Control" === e.key) {
                this._controlActive = !0;
                this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, {
                    passive: !0,
                    capture: !0
                })
            }
        }
        function Ey(e) {
            if ("Control" === e.key) {
                this._controlActive = !1;
                this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, {
                    passive: !0,
                    capture: !0
                })
            }
        }
        var Sy = i(5848)
          , My = {};
        My.styleTagTransform = u(),
        My.setAttributes = l(),
        My.insert = s().bind(null, "head"),
        My.domAPI = r(),
        My.insertStyleElement = h();
        t()(Sy.A, My);
        Sy.A && Sy.A.locals && Sy.A.locals;
        var _y, Ty, Cy, Py, Iy, Ry, Ly, Dy, Ny, By, Uy, zy, Oy, Fy, Wy, Hy, Vy, Gy, jy, Qy = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, Ky = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        Ty = new WeakMap,
        Cy = new WeakMap,
        Py = new WeakMap,
        Iy = new WeakMap,
        Ry = new WeakMap,
        Ly = new WeakMap,
        Dy = new WeakMap,
        Ny = new WeakMap,
        By = new WeakMap,
        Uy = new WeakMap,
        zy = new WeakMap,
        Oy = new WeakMap,
        Fy = new WeakMap,
        Wy = new WeakMap,
        Hy = new WeakMap,
        Vy = new WeakMap,
        _y = new WeakSet,
        Gy = function() {
            Ky(this, Ny, "f").style.left = "calc(" + (100 * Ky(this, Oy, "f") / 360).toString() + "% - 1px)",
            Ky(this, Iy, "f").style.backgroundImage = "linear-gradient(transparent, #000), linear-gradient(to right, transparent, hsla(" + Ky(this, Oy, "f").toString() + ", 100%, 50%, 1))"
        }
        ,
        jy = function() {
            Ky(this, Ry, "f").style.left = "calc(" + Ky(this, zy, "f").toString() + "% - 6px)",
            Ky(this, Ry, "f").style.top = "calc(" + (100 - Ky(this, Uy, "f")).toString() + "% - 6px)"
        }
        ;
        const qy = class {
            constructor(e, t) {
                _y.add(this),
                Ty.set(this, void 0),
                Cy.set(this, void 0),
                Py.set(this, void 0),
                Iy.set(this, void 0),
                Ry.set(this, void 0),
                Ly.set(this, !1),
                Dy.set(this, void 0),
                Ny.set(this, void 0),
                By.set(this, !1),
                Uy.set(this, 0),
                zy.set(this, 0),
                Oy.set(this, 0),
                Fy.set(this, void 0),
                Wy.set(this, void 0),
                Hy.set(this, void 0),
                Vy.set(this, void 0),
                Qy(this, Ty, e, "f"),
                Qy(this, Cy, t, "f"),
                Qy(this, Py, document.createElement("div"), "f"),
                Ky(this, Py, "f").className = "color-picker",
                Qy(this, Iy, document.createElement("div"), "f"),
                Ky(this, Iy, "f").className = "value-saturation-picker",
                Ky(this, Py, "f").appendChild(Ky(this, Iy, "f")),
                Qy(this, Ry, document.createElement("div"), "f"),
                Ky(this, Ry, "f").className = "marker",
                Ky(this, Iy, "f").appendChild(Ky(this, Ry, "f")),
                Qy(this, Dy, document.createElement("div"), "f"),
                Ky(this, Dy, "f").className = "hue-picker",
                Ky(this, Py, "f").appendChild(Ky(this, Dy, "f")),
                Qy(this, Ny, document.createElement("div"), "f"),
                Ky(this, Ny, "f").className = "marker",
                Ky(this, Dy, "f").appendChild(Ky(this, Ny, "f")),
                Ky(this, Ty, "f").appendChild(Ky(this, Py, "f"));
                Qy(this, Fy, (e => {
                    let n = null;
                    if (e instanceof MouseEvent ? Ky(this, Ly, "f") && (n = e) : e instanceof TouchEvent && e.targetTouches.length > 0 && (n = e.targetTouches[e.targetTouches.length - 1]),
                    null != n) {
                        const e = Ky(this, Iy, "f").getBoundingClientRect()
                          , i = Math.max(0, Math.min(1, (n.clientX - e.left) / e.width))
                          , r = Math.max(0, Math.min(1, (n.clientY - e.top) / e.height));
                        Qy(this, zy, 100 * i, "f"),
                        Qy(this, Uy, 100 * (1 - r), "f"),
                        Ky(this, _y, "m", jy).call(this),
                        t(this.color)
                    }
                }
                ), "f"),
                Qy(this, Wy, (e => {
                    0 == e.button && Qy(this, Ly, !1, "f")
                }
                ), "f"),
                Ky(this, Iy, "f").addEventListener("mousedown", (e => {
                    0 == e.button && Qy(this, Ly, !0, "f"),
                    Ky(this, Fy, "f").call(this, e)
                }
                )),
                window.addEventListener("mouseup", Ky(this, Wy, "f")),
                window.addEventListener("mousemove", Ky(this, Fy, "f")),
                Ky(this, Iy, "f").addEventListener("touchstart", Ky(this, Fy, "f")),
                Ky(this, Iy, "f").addEventListener("touchmove", Ky(this, Fy, "f")),
                Qy(this, Hy, (e => {
                    let n = null;
                    if (e instanceof MouseEvent ? Ky(this, By, "f") && (n = e) : e instanceof TouchEvent && e.targetTouches.length > 0 && (n = e.targetTouches[e.targetTouches.length - 1]),
                    null != n) {
                        const e = Ky(this, Dy, "f").getBoundingClientRect()
                          , i = Math.max(0, Math.min(1, (n.clientX - e.left) / e.width));
                        Qy(this, Oy, 360 * i, "f"),
                        Ky(this, _y, "m", Gy).call(this),
                        t(this.color)
                    }
                }
                ), "f"),
                Qy(this, Vy, (e => {
                    0 == e.button && Qy(this, By, !1, "f")
                }
                ), "f"),
                Ky(this, Dy, "f").addEventListener("mousedown", (e => {
                    0 == e.button && Qy(this, By, !0, "f"),
                    Ky(this, Hy, "f").call(this, e)
                }
                )),
                window.addEventListener("mouseup", Ky(this, Vy, "f")),
                window.addEventListener("mousemove", Ky(this, Hy, "f")),
                Ky(this, Dy, "f").addEventListener("touchstart", Ky(this, Hy, "f")),
                Ky(this, Dy, "f").addEventListener("touchmove", Ky(this, Hy, "f")),
                Ky(this, _y, "m", Gy).call(this),
                Ky(this, _y, "m", jy).call(this)
            }
            dispose() {
                window.removeEventListener("mouseup", Ky(this, Wy, "f")),
                window.removeEventListener("mousemove", Ky(this, Fy, "f")),
                window.removeEventListener("mouseup", Ky(this, Vy, "f")),
                window.removeEventListener("mousemove", Ky(this, Hy, "f"))
            }
            get color() {
                const e = Ky(this, zy, "f") / 100
                  , t = Ky(this, Uy, "f") / 100
                  , n = t - t * e / 2
                  , i = Math.min(n, 1 - n)
                  , r = 0 != i ? (t - n) / i : 0;
                return new Hi("hsl(" + Ky(this, Oy, "f").toString() + "," + (100 * r).toString() + "%," + (100 * n).toString() + "%)")
            }
            set color(e) {
                const {h: t, s: n, l: i} = e.getHSL({
                    h: 0,
                    s: 0,
                    l: 0
                }, vt)
                  , r = i + n * Math.min(i, 1 - i)
                  , a = 0 == r ? 0 : 2 * (1 - i / r);
                Qy(this, Oy, 360 * t, "f"),
                Qy(this, zy, 100 * a, "f"),
                Qy(this, Uy, 100 * r, "f"),
                Ky(this, _y, "m", Gy).call(this),
                Ky(this, _y, "m", jy).call(this),
                Ky(this, Cy, "f").call(this, this.color)
            }
        }
        ;
        var Yy, Xy, Zy, Jy, $y, eb, tb, nb, ib, rb, ab, sb, ob, lb, cb, hb, db, ub, pb, fb, mb, gb, vb, wb, yb, bb = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, Ab = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        Xy = new WeakMap,
        Zy = new WeakMap,
        Jy = new WeakMap,
        $y = new WeakMap,
        eb = new WeakMap,
        tb = new WeakMap,
        nb = new WeakMap,
        ib = new WeakMap,
        rb = new WeakMap,
        ab = new WeakMap,
        sb = new WeakMap,
        ob = new WeakMap,
        lb = new WeakMap,
        cb = new WeakMap,
        hb = new WeakMap,
        db = new WeakMap,
        ub = new WeakMap,
        Yy = new WeakSet,
        pb = function(e) {
            const t = document.createElement("div");
            t.className = "color",
            Ab(this, cb, "f").appendChild(t);
            const n = document.createElement("h2");
            n.textContent = e,
            t.appendChild(n);
            const i = document.createElement("input");
            i.type = "text",
            i.addEventListener("input", ( () => {
                let e = i.value;
                /^[0-9A-F]{6}$/i.test(e) && (e = "#" + e),
                r.color = new Hi(e),
                Ab(this, Xy, "f").setColors(Ab(this, Yy, "m", mb).call(this)),
                bb(this, db, !0, "f")
            }
            )),
            i.addEventListener("blur", ( () => {
                i.value = "#" + r.color.getHexString()
            }
            )),
            t.appendChild(i);
            const r = new qy(t,(e => {
                document.activeElement != i && (i.value = "#" + e.getHexString()),
                Ab(this, Xy, "f").setColors(Ab(this, Yy, "m", mb).call(this)),
                bb(this, db, !0, "f")
            }
            ));
            i.value = "#" + r.color.getHexString(),
            Ab(this, hb, "f").push(r)
        }
        ,
        fb = function() {
            const e = np.random();
            Ab(this, hb, "f")[0].color = e.primary.clone(),
            Ab(this, hb, "f")[1].color = e.secondary.clone(),
            Ab(this, hb, "f")[2].color = e.frame.clone(),
            Ab(this, hb, "f")[3].color = e.rims.clone()
        }
        ,
        mb = function() {
            return new np(Ab(this, hb, "f")[0].color.clone(),Ab(this, hb, "f")[1].color.clone(),Ab(this, hb, "f")[2].color.clone(),Ab(this, hb, "f")[3].color.clone())
        }
        ,
        gb = function(e) {
            Ab(this, hb, "f")[0].color = e.primary.clone(),
            Ab(this, hb, "f")[1].color = e.secondary.clone(),
            Ab(this, hb, "f")[2].color = e.frame.clone(),
            Ab(this, hb, "f")[3].color = e.rims.clone()
        }
        ,
        vb = function(e) {
            Ab(this, db, "f") ? Ab(this, tb, "f").showConfirm(Ab(this, Zy, "f").get("Are you sure you want to exit without saving?") + "\n\n" + Ab(this, Zy, "f").get("All changes will be lost!"), Ab(this, Zy, "f").get("Cancel"), Ab(this, Zy, "f").get("Confirm"), null, ( () => {
                e()
            }
            )) : e()
        }
        ,
        wb = function() {
            if (Ab(this, db, "f")) {
                const e = Ab(this, Yy, "m", mb).call(this);
                Ab(this, eb, "f").setCarColors(e),
                bb(this, db, !1, "f"),
                bb(this, ub, !0, "f")
            }
            Ab(this, Yy, "m", yb).call(this)
        }
        ,
        yb = function() {
            null != Ab(this, lb, "f") && (clearTimeout(Ab(this, lb, "f")),
            bb(this, lb, null, "f")),
            Ab(this, ob, "f").classList.remove("show"),
            Ab(this, ob, "f").classList.remove("hide"),
            bb(this, lb, window.setTimeout(( () => {
                Ab(this, ob, "f").textContent = Ab(this, Zy, "f").get("Car saved!"),
                Ab(this, ob, "f").classList.add("show"),
                bb(this, lb, window.setTimeout(( () => {
                    Ab(this, ob, "f").classList.remove("show"),
                    Ab(this, ob, "f").classList.add("hide")
                }
                ), 3e3), "f")
            }
            ), 0), "f")
        }
        ;
        const xb = class {
            constructor(e, t, n, i, r, a, s, o) {
                Yy.add(this),
                Xy.set(this, void 0),
                Zy.set(this, void 0),
                Jy.set(this, void 0),
                $y.set(this, void 0),
                eb.set(this, void 0),
                tb.set(this, void 0),
                nb.set(this, void 0),
                ib.set(this, void 0),
                rb.set(this, void 0),
                ab.set(this, void 0),
                sb.set(this, void 0),
                ob.set(this, void 0),
                lb.set(this, null),
                cb.set(this, void 0),
                hb.set(this, []),
                db.set(this, !1),
                ub.set(this, !1),
                bb(this, Xy, e, "f"),
                bb(this, Jy, n, "f"),
                bb(this, $y, r, "f"),
                bb(this, eb, a, "f"),
                bb(this, tb, s, "f"),
                bb(this, Zy, t, "f"),
                bb(this, rb, new Ir(70,1,.1,Qu.maxViewDistance), "f"),
                Ab(this, rb, "f").position.set(4, 3, 4),
                n.scene.add(Ab(this, rb, "f")),
                bb(this, ab, new uy(Ab(this, rb, "f"),n.canvas), "f"),
                Ab(this, ab, "f").target.set(0, .7, 1.2),
                Ab(this, ab, "f").update(),
                Ab(this, ab, "f").mouseButtons = {
                    LEFT: v,
                    MIDDLE: v,
                    RIGHT: v
                },
                Ab(this, ab, "f").enablePan = !1,
                Ab(this, ab, "f").minDistance = 2.5,
                Ab(this, ab, "f").maxDistance = 5.8,
                Ab(this, ab, "f").maxPolarAngle = Math.PI / 2 + .06;
                const l = document.getElementById("ui");
                if (null == l)
                    throw new Error("UI element not found");
                bb(this, nb, l, "f"),
                bb(this, sb, document.createElement("div"), "f"),
                Ab(this, sb, "f").className = "customization";
                const c = document.createElement("div");
                c.className = "safe-area-left",
                Ab(this, sb, "f").appendChild(c);
                const h = document.createElement("div");
                h.className = "top",
                Ab(this, sb, "f").appendChild(h);
                const d = document.createElement("button");
                d.className = "button",
                d.innerHTML = '<img class="button-icon" src="images/quit.svg"> ',
                d.append(document.createTextNode(t.get("Exit"))),
                d.addEventListener("click", ( () => {
                    i.playUIClick(),
                    Ab(this, Yy, "m", vb).call(this, o)
                }
                )),
                h.appendChild(d),
                window.addEventListener("keydown", bb(this, ib, (e => {
                    "Escape" == e.code && (Ab(this, Yy, "m", vb).call(this, o),
                    e.preventDefault())
                }
                ), "f"));
                const u = document.createElement("button");
                u.className = "button",
                u.innerHTML = '<img class="button-icon" src="images/save.svg"> ',
                u.append(document.createTextNode(t.get("Save"))),
                u.addEventListener("click", ( () => {
                    i.playUIClick(),
                    Ab(this, Yy, "m", wb).call(this)
                }
                )),
                h.appendChild(u);
                const p = document.createElement("button");
                p.className = "button",
                p.innerHTML = '<img class="button-icon" src="images/random.svg"> ',
                p.append(document.createTextNode(t.get("Random"))),
                p.addEventListener("click", ( () => {
                    i.playUIClick(),
                    Ab(this, Yy, "m", fb).call(this)
                }
                )),
                h.appendChild(p),
                bb(this, ob, document.createElement("div"), "f"),
                Ab(this, ob, "f").className = "save-message",
                Ab(this, sb, "f").appendChild(Ab(this, ob, "f")),
                bb(this, cb, document.createElement("div"), "f"),
                Ab(this, cb, "f").className = "colors",
                Ab(this, sb, "f").appendChild(Ab(this, cb, "f")),
                Ab(this, Yy, "m", pb).call(this, t.get("Primary")),
                Ab(this, Yy, "m", pb).call(this, t.get("Secondary")),
                Ab(this, Yy, "m", pb).call(this, t.get("Frame")),
                Ab(this, Yy, "m", pb).call(this, t.get("Rims")),
                Ab(this, nb, "f").appendChild(Ab(this, sb, "f"));
                const f = Ab(this, eb, "f").getCurrentUserProfile().carColors;
                Ab(this, Yy, "m", gb).call(this, f),
                Ab(this, Xy, "f").setColors(f),
                bb(this, db, !1, "f")
            }
            dispose() {
                for (const e of Ab(this, hb, "f"))
                    e.dispose();
                if (Ab(this, ub, "f")) {
                    const {token: e, nickname: t, carColors: n} = Ab(this, eb, "f").getCurrentUserProfile();
                    Ab(this, $y, "f").submitUserProfile(e, t, n).catch((e => {
                        console.warn(e)
                    }
                    ))
                }
                Ab(this, Jy, "f").scene.remove(Ab(this, rb, "f")),
                window.removeEventListener("keydown", Ab(this, ib, "f")),
                Ab(this, nb, "f").removeChild(Ab(this, sb, "f")),
                Ab(this, ab, "f").dispose(),
                Ab(this, Jy, "f").canvas.style.touchAction = ""
            }
            get camera() {
                return Ab(this, rb, "f")
            }
        }
        ;
        var kb;
        !function(e) {
            e[e.Default = 0] = "Default",
            e[e.Summer = 1] = "Summer",
            e[e.Winter = 2] = "Winter",
            e[e.Desert = 3] = "Desert",
            e[e.Custom0 = 32] = "Custom0",
            e[e.Custom1 = 33] = "Custom1",
            e[e.Custom2 = 34] = "Custom2",
            e[e.Custom3 = 35] = "Custom3",
            e[e.Custom4 = 36] = "Custom4",
            e[e.Custom5 = 37] = "Custom5",
            e[e.Custom6 = 38] = "Custom6",
            e[e.Custom7 = 39] = "Custom7",
            e[e.Custom8 = 40] = "Custom8"
        }(kb || (kb = {}));
        const Eb = kb;
        var Sb;
        !function(e) {
            e[e.Straight = 0] = "Straight",
            e[e.TurnSharp = 1] = "TurnSharp",
            e[e.SlopeUp = 2] = "SlopeUp",
            e[e.SlopeDown = 3] = "SlopeDown",
            e[e.Slope = 4] = "Slope",
            e[e.Start = 5] = "Start",
            e[e.Finish = 6] = "Finish",
            e[e.ToWideMiddle = 7] = "ToWideMiddle",
            e[e.ToWideLeft = 8] = "ToWideLeft",
            e[e.ToWideRight = 9] = "ToWideRight",
            e[e.StraightWide = 10] = "StraightWide",
            e[e.InnerCornerWide = 11] = "InnerCornerWide",
            e[e.OuterCornerWide = 12] = "OuterCornerWide",
            e[e.SlopeUpLeftWide = 13] = "SlopeUpLeftWide",
            e[e.SlopeUpRightWide = 14] = "SlopeUpRightWide",
            e[e.SlopeDownLeftWide = 15] = "SlopeDownLeftWide",
            e[e.SlopeDownRightWide = 16] = "SlopeDownRightWide",
            e[e.SlopeLeftWide = 17] = "SlopeLeftWide",
            e[e.SlopeRightWide = 18] = "SlopeRightWide",
            e[e.PillarTop = 19] = "PillarTop",
            e[e.PillarMiddle = 20] = "PillarMiddle",
            e[e.PillarBottom = 21] = "PillarBottom",
            e[e.PillarShort = 22] = "PillarShort",
            e[e.PlanePillarBottom = 23] = "PlanePillarBottom",
            e[e.PlanePillarShort = 24] = "PlanePillarShort",
            e[e.Plane = 25] = "Plane",
            e[e.PlaneWall = 26] = "PlaneWall",
            e[e.PlaneWallCorner = 27] = "PlaneWallCorner",
            e[e.PlaneWallInnerCorner = 28] = "PlaneWallInnerCorner",
            e[e.Block = 29] = "Block",
            e[e.WallTrackTop = 30] = "WallTrackTop",
            e[e.WallTrackMiddle = 31] = "WallTrackMiddle",
            e[e.WallTrackBottom = 32] = "WallTrackBottom",
            e[e.PlaneSlopeUp = 33] = "PlaneSlopeUp",
            e[e.PlaneSlopeDown = 34] = "PlaneSlopeDown",
            e[e.PlaneSlope = 35] = "PlaneSlope",
            e[e.TurnShort = 36] = "TurnShort",
            e[e.TurnLong = 37] = "TurnLong",
            e[e.SlopeUpLong = 38] = "SlopeUpLong",
            e[e.SlopeDownLong = 39] = "SlopeDownLong",
            e[e.SlopePillar = 40] = "SlopePillar",
            e[e.TurnSLeft = 41] = "TurnSLeft",
            e[e.TurnSRight = 42] = "TurnSRight",
            e[e.IntersectionT = 43] = "IntersectionT",
            e[e.IntersectionCross = 44] = "IntersectionCross",
            e[e.PillarBranch1 = 45] = "PillarBranch1",
            e[e.PillarBranch2 = 46] = "PillarBranch2",
            e[e.PillarBranch3 = 47] = "PillarBranch3",
            e[e.PillarBranch4 = 48] = "PillarBranch4",
            e[e.WallTrackBottomCorner = 49] = "WallTrackBottomCorner",
            e[e.WallTrackMiddleCorner = 50] = "WallTrackMiddleCorner",
            e[e.WallTrackTopCorner = 51] = "WallTrackTopCorner",
            e[e.Checkpoint = 52] = "Checkpoint",
            e[e.HalfBlock = 53] = "HalfBlock",
            e[e.QuarterBlock = 54] = "QuarterBlock",
            e[e.HalfPlane = 55] = "HalfPlane",
            e[e.QuarterPlane = 56] = "QuarterPlane",
            e[e.PlaneBridge = 57] = "PlaneBridge",
            e[e.SignArrowLeft = 58] = "SignArrowLeft",
            e[e.SignArrowRight = 59] = "SignArrowRight",
            e[e.SignArrowUp = 61] = "SignArrowUp",
            e[e.SignArrowDown = 62] = "SignArrowDown",
            e[e.SignWarning = 63] = "SignWarning",
            e[e.SignWrongWay = 64] = "SignWrongWay",
            e[e.CheckpointWide = 65] = "CheckpointWide",
            e[e.WallTrackCeiling = 66] = "WallTrackCeiling",
            e[e.WallTrackFloor = 67] = "WallTrackFloor",
            e[e.BlockSlopedDown = 68] = "BlockSlopedDown",
            e[e.BlockSlopedDownInnerCorner = 69] = "BlockSlopedDownInnerCorner",
            e[e.BlockSlopedDownOuterCorner = 70] = "BlockSlopedDownOuterCorner",
            e[e.BlockSlopedUp = 71] = "BlockSlopedUp",
            e[e.BlockSlopedUpInnerCorner = 72] = "BlockSlopedUpInnerCorner",
            e[e.BlockSlopedUpOuterCorner = 73] = "BlockSlopedUpOuterCorner",
            e[e.FinishWide = 74] = "FinishWide",
            e[e.PlaneCheckpoint = 75] = "PlaneCheckpoint",
            e[e.PlaneFinish = 76] = "PlaneFinish",
            e[e.PlaneCheckpointWide = 77] = "PlaneCheckpointWide",
            e[e.PlaneFinishWide = 78] = "PlaneFinishWide",
            e[e.WallTrackBottomInnerCorner = 79] = "WallTrackBottomInnerCorner",
            e[e.WallTrackInnerCorner = 80] = "WallTrackInnerCorner",
            e[e.WallTrackTopInnerCorner = 81] = "WallTrackTopInnerCorner",
            e[e.TurnLong2 = 82] = "TurnLong2",
            e[e.TurnLong3 = 83] = "TurnLong3",
            e[e.SlopePillarShort = 84] = "SlopePillarShort",
            e[e.BlockSlopeUp = 85] = "BlockSlopeUp",
            e[e.BlockSlopeDown = 86] = "BlockSlopeDown",
            e[e.BlockSlopeVerticalTop = 87] = "BlockSlopeVerticalTop",
            e[e.BlockSlopeVerticalBottom = 88] = "BlockSlopeVerticalBottom",
            e[e.PlaneSlopeVerticalBottom = 90] = "PlaneSlopeVerticalBottom",
            e[e.StartWide = 91] = "StartWide",
            e[e.PlaneStart = 92] = "PlaneStart",
            e[e.PlaneStartWide = 93] = "PlaneStartWide",
            e[e.TurnShortLeftWide = 94] = "TurnShortLeftWide",
            e[e.TurnShortRightWide = 95] = "TurnShortRightWide",
            e[e.TurnLongLeftWide = 96] = "TurnLongLeftWide",
            e[e.TurnLongRightWide = 97] = "TurnLongRightWide",
            e[e.SlopeUpVertical = 98] = "SlopeUpVertical",
            e[e.PlaneSlopePillar = 99] = "PlaneSlopePillar",
            e[e.PlaneSlopePillarShort = 100] = "PlaneSlopePillarShort",
            e[e.PillarBranch1Top = 101] = "PillarBranch1Top",
            e[e.PillarBranch1Bottom = 102] = "PillarBranch1Bottom",
            e[e.PillarBranch1Middle = 103] = "PillarBranch1Middle",
            e[e.PillarBranch2Top = 104] = "PillarBranch2Top",
            e[e.PillarBranch2Middle = 105] = "PillarBranch2Middle",
            e[e.PillarBranch2Bottom = 106] = "PillarBranch2Bottom",
            e[e.PillarBranch3Top = 107] = "PillarBranch3Top",
            e[e.PillarBranch3Middle = 108] = "PillarBranch3Middle",
            e[e.PillarBranch3Bottom = 109] = "PillarBranch3Bottom",
            e[e.PillarBranch4Top = 110] = "PillarBranch4Top",
            e[e.PillarBranch4Middle = 111] = "PillarBranch4Middle",
            e[e.PillarBranch4Bottom = 112] = "PillarBranch4Bottom",
            e[e.PillarBranch5 = 113] = "PillarBranch5",
            e[e.PillarBranch5Top = 114] = "PillarBranch5Top",
            e[e.PillarBranch5Middle = 115] = "PillarBranch5Middle",
            e[e.PillarBranch5Bottom = 116] = "PillarBranch5Bottom",
            e[e.ToWideDouble = 117] = "ToWideDouble",
            e[e.ToWideDiagonal = 118] = "ToWideDiagonal",
            e[e.StraightPillarBottom = 119] = "StraightPillarBottom",
            e[e.StraightPillarShort = 120] = "StraightPillarShort",
            e[e.TurnSharpPillarBottom = 121] = "TurnSharpPillarBottom",
            e[e.TurnSharpPillarShort = 122] = "TurnSharpPillarShort",
            e[e.IntersectionTPillarBottom = 123] = "IntersectionTPillarBottom",
            e[e.IntersectionTPillarShort = 124] = "IntersectionTPillarShort",
            e[e.IntersectionCrossPillarBottom = 125] = "IntersectionCrossPillarBottom",
            e[e.IntersectionCrossPillarShort = 126] = "IntersectionCrossPillarShort",
            e[e.PlaneBridgeCorner = 127] = "PlaneBridgeCorner",
            e[e.PlaneBridgeIntersectionT = 128] = "PlaneBridgeIntersectionT",
            e[e.PlaneBridgeIntersectionCross = 129] = "PlaneBridgeIntersectionCross",
            e[e.BlockBridge = 130] = "BlockBridge",
            e[e.BlockBridgeCorner = 131] = "BlockBridgeCorner",
            e[e.BlockBridgeIntersectionT = 132] = "BlockBridgeIntersectionT",
            e[e.BlockBridgeIntersectionCross = 133] = "BlockBridgeIntersectionCross",
            e[e.WallTrackCeilingCorner = 134] = "WallTrackCeilingCorner",
            e[e.WallTrackCeilingPlaneCorner = 135] = "WallTrackCeilingPlaneCorner",
            e[e.WallTrackFloorCorner = 136] = "WallTrackFloorCorner",
            e[e.WallTrackFloorPlaneCorner = 137] = "WallTrackFloorPlaneCorner",
            e[e.SlopeUpVerticalLeftWide = 138] = "SlopeUpVerticalLeftWide",
            e[e.SlopeUpVerticalRightWide = 139] = "SlopeUpVerticalRightWide",
            e[e.BlockSlopeVerticalCornerTop = 140] = "BlockSlopeVerticalCornerTop",
            e[e.BlockSlopeVerticalCornerBottom = 141] = "BlockSlopeVerticalCornerBottom",
            e[e.WallTrackSlopeToVertical = 142] = "WallTrackSlopeToVertical",
            e[e.PlaneSlopeToVertical = 143] = "PlaneSlopeToVertical",
            e[e.BlockSlopeToVertical = 144] = "BlockSlopeToVertical",
            e[e.PlaneSlopeUpLong = 145] = "PlaneSlopeUpLong",
            e[e.PlaneSlopeDownLong = 146] = "PlaneSlopeDownLong",
            e[e.SlopeUpLongLeftWide = 147] = "SlopeUpLongLeftWide",
            e[e.SlopeUpLongRightWide = 148] = "SlopeUpLongRightWide",
            e[e.SlopeDownLongLeftWide = 149] = "SlopeDownLongLeftWide",
            e[e.SlopeDownLongRightWide = 150] = "SlopeDownLongRightWide",
            e[e.BlockSlopeUpLong = 151] = "BlockSlopeUpLong",
            e[e.BlockSlopeDownLong = 152] = "BlockSlopeDownLong",
            e[e.BlockSlopeVerticalInnerCornerBottom = 153] = "BlockSlopeVerticalInnerCornerBottom",
            e[e.BlockSlopeVerticalInnerCornerTop = 154] = "BlockSlopeVerticalInnerCornerTop",
            e[e.BlockInnerCorner = 155] = "BlockInnerCorner"
        }(Sb || (Sb = {}));
        const Mb = Sb;
        var _b;
        !function(e) {
            e[e.YPositive = 0] = "YPositive",
            e[e.YNegative = 1] = "YNegative",
            e[e.XPositive = 2] = "XPositive",
            e[e.XNegative = 3] = "XNegative",
            e[e.ZPositive = 4] = "ZPositive",
            e[e.ZNegative = 5] = "ZNegative"
        }(_b || (_b = {}));
        const Tb = _b;
        var Cb, Pb, Ib, Rb, Lb, Db, Nb, Bb, Ub = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, zb = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        Cb = new WeakMap,
        Pb = new WeakMap,
        Ib = new WeakMap,
        Rb = new WeakMap,
        Lb = new WeakMap,
        Db = new WeakMap,
        Nb = new WeakMap,
        Bb = new WeakMap;
        const Ob = class {
            constructor(e, t, n, i, r, a, s, o, l, c, h) {
                Cb.set(this, void 0),
                Pb.set(this, void 0),
                Ib.set(this, void 0),
                Rb.set(this, void 0),
                Lb.set(this, void 0),
                Db.set(this, void 0),
                Nb.set(this, void 0),
                Bb.set(this, void 0),
                Ub(this, Cb, a, "f"),
                Ub(this, Pb, t, "f"),
                Ub(this, Ib, n, "f"),
                Ub(this, Rb, i, "f"),
                Ub(this, Lb, r, "f"),
                Ub(this, Db, o, "f");
                for (let e = -100; e < 100; ++e)
                    0 == e ? t.setPart(0, 0, 4 * e, Mb.Start, 2, Tb.YPositive, Eb.Default, null, 0) : t.setPart(0, 0, 4 * e, Mb.Straight, 0, Tb.YPositive, Eb.Default, null, null);
                t.generateMeshes(),
                n.generateMountains(t.getBounds());
                const d = t.getStartTransform();
                if (null == d)
                    throw new Error("Start transform is null");
                Ub(this, Bb, new Qw(null,d,null,null,r,a,n,t,o), "f"),
                zb(this, Bb, "f").audioVolume = 0,
                zb(this, Bb, "f").update(0),
                Ub(this, Nb, new xb(zb(this, Bb, "f"),e,r,a,l,s,c,h), "f"),
                r.setCamera(zb(this, Nb, "f").camera)
            }
            dispose() {
                zb(this, Pb, "f").clear(),
                zb(this, Ib, "f").clearMountains(),
                zb(this, Nb, "f").dispose(),
                zb(this, Bb, "f").dispose()
            }
            update(e) {
                zb(this, Ib, "f").update(zb(this, Pb, "f")),
                zb(this, Rb, "f").update(e, zb(this, Lb, "f").camera, zb(this, Pb, "f").sunDirection),
                zb(this, Cb, "f").update(e, !0, zb(this, Lb, "f"), zb(this, Db, "f")),
                zb(this, Lb, "f").update(zb(this, Pb, "f").sunDirection)
            }
        }
        ;
        var Fb = function(e, t, n, i) {
            return new (n || (n = Promise))((function(r, a) {
                function s(e) {
                    try {
                        l(i.next(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function o(e) {
                    try {
                        l(i.throw(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(e) {
                    var t;
                    e.done ? r(e.value) : (t = e.value,
                    t instanceof n ? t : new n((function(e) {
                        e(t)
                    }
                    ))).then(s, o)
                }
                l((i = i.apply(e, t || [])).next())
            }
            ))
        };
        const Wb = 2.718281828459045
          , Hb = 2.302585092994046
          , Vb = .6931471805599453
          , Gb = 1.4426950408889634
          , jb = .4342944819032518
          , Qb = 3.141592653589793
          , Kb = .7071067811865476
          , qb = 1.4142135623730951;
        function Yb(e) {
            throw new Error(e + ": Waiting for WASM to compile")
        }
        function Xb(e) {
            throw new Error(e + ": No deterministic implementation")
        }
        function Zb(e) {
            if (!Number.isFinite(e))
                return NaN;
            const t = (e = function(e) {
                return (e %= 2 * Math.PI) < 0 && (e += 2 * Math.PI),
                e
            }(e)) / (2 * Math.PI) * $b.length
              , n = Math.floor(t)
              , i = (n + 1) % $b.length
              , r = t - n;
            return $b[n] * (1 - r) + $b[i] * r
        }
        function Jb(e) {
            return Math.sin(e + Math.PI / 2)
        }
        Math = {
            E: Wb,
            LN10: Hb,
            LN2: Vb,
            LOG2E: Gb,
            LOG10E: jb,
            PI: Qb,
            SQRT1_2: Kb,
            SQRT2: qb,
            abs: Math.abs,
            acos: () => Yb("acos"),
            asin: () => Yb("asin"),
            atan: () => Yb("atan"),
            atan2: () => Yb("atan2"),
            ceil: Math.ceil,
            cos: Jb,
            exp: () => Yb("exp"),
            floor: Math.floor,
            log: () => Yb("log"),
            max: Math.max,
            min: Math.min,
            pow: () => Yb("pow"),
            random: Math.random,
            round: Math.round,
            sin: Zb,
            sqrt: () => Yb("sqrt"),
            tan: () => Yb("tan"),
            clz32: () => Xb("clz32"),
            imul: () => Xb("imul"),
            sign: Math.sign,
            log10: () => Yb("log10"),
            log2: () => Yb("log2"),
            log1p: () => Xb("log1p"),
            expm1: () => Xb("expm1"),
            cosh: () => Xb("cosh"),
            sinh: () => Xb("sinh"),
            tanh: () => Xb("tanh"),
            acosh: () => Xb("acosh"),
            asinh: () => Xb("asinh"),
            atanh: () => Xb("atanh"),
            hypot: () => Xb("hypot"),
            trunc: Math.trunc,
            cbrt: () => Xb("cbrt"),
            fround: Math.fround,
            [Symbol.toStringTag]: "Math"
        };
        const $b = [0, .01745240643728351, .03489949670250097, .05233595624294383, .0697564737441253, .08715574274765817, .10452846326765346, .12186934340514748, .13917310096006544, .15643446504023087, .17364817766693033, .1908089953765448, .20791169081775931, .22495105434386498, .24192189559966773, .25881904510252074, .27563735581699916, .2923717047227367, .3090169943749474, .3255681544571567, .3420201433256687, .35836794954530027, .374606593415912, .3907311284892737, .40673664307580015, .42261826174069944, .4383711467890774, .45399049973954675, .4694715627858908, .48480962024633706, .49999999999999994, .5150380749100542, .5299192642332049, .544639035015027, .5591929034707468, .573576436351046, .5877852522924731, .6018150231520483, .6156614753256583, .6293203910498375, .6427876096865393, .6560590289905073, .6691306063588582, .6819983600624985, .6946583704589973, .7071067811865475, .7193398003386511, .7313537016191705, .7431448254773942, .7547095802227719, .766044443118978, .7771459614569708, .7880107536067219, .7986355100472928, .8090169943749475, .8191520442889918, .8290375725550417, .8386705679454239, .848048096156426, .8571673007021122, .8660254037844386, .8746197071393957, .8829475928589269, .8910065241883678, .898794046299167, .9063077870366499, .9135454576426009, .9205048534524404, .9271838545667873, .9335804264972017, .9396926207859083, .9455185755993167, .9510565162951535, .9563047559630354, .9612616959383189, .9659258262890683, .9702957262759965, .9743700647852352, .9781476007338057, .981627183447664, .984807753012208, .9876883405951378, .9902680687415704, .992546151641322, .9945218953682733, .9961946980917455, .9975640502598242, .9986295347545738, .9993908270190958, .9998476951563913, 1, .9998476951563913, .9993908270190958, .9986295347545738, .9975640502598242, .9961946980917455, .9945218953682734, .9925461516413221, .9902680687415704, .9876883405951377, .984807753012208, .981627183447664, .9781476007338057, .9743700647852352, .9702957262759965, .9659258262890683, .9612616959383189, .9563047559630355, .9510565162951536, .9455185755993168, .9396926207859084, .9335804264972017, .9271838545667874, .9205048534524404, .913545457642601, .90630778703665, .8987940462991669, .8910065241883679, .8829475928589271, .8746197071393959, .8660254037844387, .8571673007021123, .8480480961564261, .8386705679454239, .8290375725550417, .819152044288992, .8090169943749475, .7986355100472927, .788010753606722, .777145961456971, .766044443118978, .7547095802227721, .7431448254773945, .7313537016191706, .7193398003386511, .7071067811865476, .6946583704589975, .6819983600624986, .669130606358858, .6560590289905073, .6427876096865395, .6293203910498374, .6156614753256584, .6018150231520486, .5877852522924732, .5735764363510459, .5591929034707469, .5446390350150273, .5299192642332049, .5150380749100544, .49999999999999994, .48480962024633717, .4694715627858907, .45399049973954686, .4383711467890777, .4226182617406995, .40673664307580004, .39073112848927377, .37460659341591224, .35836794954530066, .3420201433256689, .3255681544571566, .3090169943749475, .29237170472273705, .2756373558169992, .258819045102521, .24192189559966773, .2249510543438652, .20791169081775931, .19080899537654497, .1736481776669307, .15643446504023098, .13917310096006533, .12186934340514755, .10452846326765373, .0871557427476582, .06975647374412552, .05233595624294425, .03489949670250114, .01745240643728344, 12246467991473532e-32, -.017452406437283192, -.0348994967025009, -.052335956242943564, -.06975647374412483, -.08715574274765794, -.1045284632676535, -.12186934340514774, -.13917310096006552, -.15643446504023073, -.17364817766693047, -.19080899537654472, -.20791169081775907, -.22495105434386498, -.2419218955996675, -.25881904510252035, -.2756373558169986, -.29237170472273677, -.30901699437494773, -.32556815445715676, -.34202014332566866, -.35836794954530043, -.374606593415912, -.39073112848927355, -.4067366430757998, -.4226182617406993, -.43837114678907707, -.45399049973954625, -.4694715627858905, -.48480962024633734, -.5000000000000001, -.5150380749100542, -.5299192642332048, -.5446390350150271, -.5591929034707467, -.5735764363510458, -.587785252292473, -.601815023152048, -.6156614753256578, -.6293203910498372, -.6427876096865393, -.6560590289905074, -.6691306063588582, -.6819983600624984, -.6946583704589974, -.7071067811865475, -.7193398003386509, -.7313537016191705, -.743144825477394, -.7547095802227717, -.7660444431189779, -.7771459614569711, -.7880107536067221, -.7986355100472928, -.8090169943749473, -.8191520442889916, -.8290375725550414, -.838670567945424, -.848048096156426, -.8571673007021121, -.8660254037844384, -.8746197071393955, -.882947592858927, -.8910065241883678, -.8987940462991668, -.90630778703665, -.913545457642601, -.9205048534524403, -.9271838545667873, -.9335804264972016, -.9396926207859082, -.9455185755993168, -.9510565162951535, -.9563047559630353, -.961261695938319, -.9659258262890683, -.9702957262759965, -.9743700647852351, -.9781476007338056, -.981627183447664, -.984807753012208, -.9876883405951377, -.9902680687415703, -.992546151641322, -.9945218953682733, -.9961946980917455, -.9975640502598242, -.9986295347545739, -.9993908270190958, -.9998476951563913, -1, -.9998476951563913, -.9993908270190958, -.9986295347545739, -.9975640502598243, -.9961946980917455, -.9945218953682733, -.992546151641322, -.9902680687415704, -.9876883405951378, -.9848077530122081, -.9816271834476641, -.9781476007338056, -.9743700647852352, -.9702957262759966, -.9659258262890684, -.961261695938319, -.9563047559630354, -.9510565162951536, -.945518575599317, -.9396926207859083, -.9335804264972017, -.9271838545667874, -.9205048534524405, -.9135454576426011, -.9063077870366503, -.898794046299167, -.8910065241883679, -.8829475928589271, -.8746197071393956, -.8660254037844386, -.8571673007021123, -.8480480961564262, -.8386705679454243, -.8290375725550416, -.8191520442889918, -.8090169943749476, -.798635510047293, -.7880107536067223, -.7771459614569713, -.7660444431189781, -.7547095802227722, -.743144825477394, -.7313537016191703, -.7193398003386512, -.7071067811865477, -.6946583704589976, -.6819983600624989, -.6691306063588588, -.6560590289905074, -.6427876096865396, -.6293203910498372, -.6156614753256582, -.6018150231520483, -.5877852522924734, -.5735764363510465, -.5591929034707473, -.544639035015027, -.529919264233205, -.5150380749100545, -.5000000000000004, -.48480962024633767, -.4694715627858908, -.45399049973954697, -.4383711467890778, -.4226182617406992, -.40673664307580015, -.3907311284892739, -.37460659341591235, -.35836794954530077, -.34202014332566943, -.3255681544571567, -.3090169943749477, -.29237170472273716, -.27563735581699894, -.2588190451025207, -.24192189559966787, -.22495105434386534, -.20791169081775987, -.19080899537654467, -.1736481776669304, -.15643446504023112, -.13917310096006588, -.12186934340514811, -.1045284632676543, -.08715574274765832, -.06975647374412564, -.05233595624294348, -.034899496702500823, -.01745240643728356];
        var eA = i(4344)
          , tA = {};
        tA.styleTagTransform = u(),
        tA.setAttributes = l(),
        tA.insert = s().bind(null, "head"),
        tA.domAPI = r(),
        tA.insertStyleElement = h();
        t()(eA.A, tA);
        eA.A && eA.A.locals && eA.A.locals;
        var nA, iA, rA, aA, sA, oA, lA, cA = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, hA = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        iA = new WeakMap,
        rA = new WeakMap,
        aA = new WeakMap,
        sA = new WeakMap,
        oA = new WeakMap,
        nA = new WeakSet,
        lA = function() {
            if (null != hA(this, rA, "f")) {
                const e = "FPS: " + hA(this, oA, "f").toString();
                hA(this, rA, "f").textContent != e && (hA(this, rA, "f").textContent = e)
            }
        }
        ;
        const dA = class {
            constructor() {
                nA.add(this),
                iA.set(this, void 0),
                rA.set(this, null),
                aA.set(this, 0),
                sA.set(this, 0),
                oA.set(this, 0);
                const e = document.getElementById("ui");
                if (null == e)
                    throw new Error("UI element not found");
                cA(this, iA, e, "f")
            }
            show() {
                cA(this, rA, document.createElement("div"), "f"),
                hA(this, rA, "f").className = "debug",
                hA(this, iA, "f").appendChild(hA(this, rA, "f")),
                hA(this, nA, "m", lA).call(this)
            }
            hide() {
                null != hA(this, rA, "f") && (hA(this, iA, "f").removeChild(hA(this, rA, "f")),
                cA(this, rA, null, "f"))
            }
            toggle() {
                null != hA(this, rA, "f") ? this.hide() : this.show()
            }
            update(e) {
                cA(this, aA, hA(this, aA, "f") + e, "f"),
                cA(this, sA, hA(this, sA, "f") + 1, "f"),
                hA(this, aA, "f") >= 1 && (cA(this, oA, hA(this, sA, "f"), "f"),
                cA(this, aA, hA(this, aA, "f") - Math.trunc(hA(this, aA, "f")), "f"),
                cA(this, sA, 0, "f"),
                hA(this, nA, "m", lA).call(this))
            }
        }
        ;
        var uA = i(6057)
          , pA = {};
        pA.styleTagTransform = u(),
        pA.setAttributes = l(),
        pA.insert = s().bind(null, "head"),
        pA.domAPI = r(),
        pA.insertStyleElement = h();
        t()(uA.A, pA);
        uA.A && uA.A.locals && uA.A.locals;
        class fA extends uy {
            constructor(e, t) {
                super(e, t),
                this.screenSpacePanning = !1,
                this.mouseButtons = {
                    LEFT: y,
                    MIDDLE: w,
                    RIGHT: v
                },
                this.touches = {
                    ONE: A,
                    TWO: k
                }
            }
        }
        class mA extends po {
            constructor(e) {
                super(e)
            }
            load(e, t, n, i) {
                const r = this
                  , a = new go(this.manager);
                a.setPath(this.path),
                a.setRequestHeader(this.requestHeader),
                a.setWithCredentials(this.withCredentials),
                a.load(e, (function(e) {
                    const n = r.parse(JSON.parse(e));
                    t && t(n)
                }
                ), n, i)
            }
            parse(e) {
                return new gA(e)
            }
        }
        class gA {
            constructor(e) {
                this.isFont = !0,
                this.type = "Font",
                this.data = e
            }
            generateShapes(e, t=100) {
                const n = []
                  , i = function(e, t, n) {
                    const i = Array.from(e)
                      , r = t / n.resolution
                      , a = (n.boundingBox.yMax - n.boundingBox.yMin + n.underlineThickness) * r
                      , s = [];
                    let o = 0
                      , l = 0;
                    for (let e = 0; e < i.length; e++) {
                        const t = i[e];
                        if ("\n" === t)
                            o = 0,
                            l -= a;
                        else {
                            const e = vA(t, r, o, l, n);
                            o += e.offsetX,
                            s.push(e.path)
                        }
                    }
                    return s
                }(e, t, this.data);
                for (let e = 0, t = i.length; e < t; e++)
                    n.push(...i[e].toShapes());
                return n
            }
        }
        function vA(e, t, n, i, r) {
            const a = r.glyphs[e] || r.glyphs["?"];
            if (!a)
                return void console.error('THREE.Font: character "' + e + '" does not exists in font family ' + r.familyName + ".");
            const s = new Xo;
            let o, l, c, h, d, u, p, f;
            if (a.o) {
                const e = a._cachedOutline || (a._cachedOutline = a.o.split(" "));
                for (let r = 0, a = e.length; r < a; ) {
                    switch (e[r++]) {
                    case "m":
                        o = e[r++] * t + n,
                        l = e[r++] * t + i,
                        s.moveTo(o, l);
                        break;
                    case "l":
                        o = e[r++] * t + n,
                        l = e[r++] * t + i,
                        s.lineTo(o, l);
                        break;
                    case "q":
                        c = e[r++] * t + n,
                        h = e[r++] * t + i,
                        d = e[r++] * t + n,
                        u = e[r++] * t + i,
                        s.quadraticCurveTo(d, u, c, h);
                        break;
                    case "b":
                        c = e[r++] * t + n,
                        h = e[r++] * t + i,
                        d = e[r++] * t + n,
                        u = e[r++] * t + i,
                        p = e[r++] * t + n,
                        f = e[r++] * t + i,
                        s.bezierCurveTo(d, u, p, f, c, h)
                    }
                }
            }
            return {
                offsetX: a.ha * t,
                path: s
            }
        }
        var wA = i(1312);
        const yA = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
          , bA = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51];
        function AA(e) {
            let t = 0
              , n = "";
            for (; t < 8 * e.length; ) {
                const i = kA(e, t);
                let r;
                30 & ~i ? (r = i,
                t += 6) : (r = 31 & i,
                t += 5),
                n += yA[r]
            }
            return n
        }
        function xA(e) {
            let t = 0;
            const n = []
              , i = e.length;
            for (let r = 0; r < i; r++) {
                const a = e.charCodeAt(r);
                if (a >= bA.length)
                    return null;
                const s = bA[a];
                if (-1 == s)
                    return null;
                30 & ~s ? (EA(n, t, 6, s, r == i - 1),
                t += 6) : (EA(n, t, 5, s, r == i - 1),
                t += 5)
            }
            return new Uint8Array(n)
        }
        function kA(e, t) {
            if (t >= 8 * e.length)
                throw new Error("Out of range");
            const n = Math.floor(t / 8)
              , i = e[n]
              , r = t - 8 * n;
            if (r <= 2 || n >= e.length - 1)
                return (i & 63 << r) >>> r;
            return (i & 63 << r) >>> r | (e[n + 1] & 63 >>> 8 - r) << 8 - r
        }
        function EA(e, t, n, i, r) {
            const a = Math.floor(t / 8);
            for (; a >= e.length; )
                e.push(0);
            const s = t - 8 * a;
            if (e[a] |= i << s & 255,
            s > 8 - n && !r) {
                const t = a + 1;
                t >= e.length && e.push(0),
                e[t] |= i >> 8 - s
            }
        }
        var SA, MA = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, _A = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class TA {
            constructor(e=28) {
                if (SA.set(this, void 0),
                !(Number.isSafeInteger(e) && e >= 0 && e < 180))
                    throw new Error("Representation is not a safe integer or is out of range");
                MA(this, SA, e, "f")
            }
            clone() {
                return new TA(_A(this, SA, "f"))
            }
            toDegrees() {
                return 2 * _A(this, SA, "f")
            }
            static fromDegrees(e) {
                const t = Math.round(e / 2 % 180);
                return new TA(t)
            }
            getSunPosition() {
                const e = 2 * _A(this, SA, "f") * (Math.PI / 180)
                  , t = Math.cos(e)
                  , n = Math.sin(e);
                return new bn(t,.78,n).normalize()
            }
            get representation() {
                return _A(this, SA, "f")
            }
        }
        SA = new WeakMap;
        const CA = TA;
        var PA;
        !function(e) {
            e[e.Summer = 0] = "Summer",
            e[e.Winter = 1] = "Winter",
            e[e.Desert = 2] = "Desert"
        }(PA || (PA = {}));
        const IA = PA;
        var RA;
        !function(e) {
            e[e.Special = 0] = "Special",
            e[e.Road = 1] = "Road",
            e[e.RoadTurns = 2] = "RoadTurns",
            e[e.RoadWide = 3] = "RoadWide",
            e[e.Plane = 4] = "Plane",
            e[e.Block = 5] = "Block",
            e[e.WallTrack = 6] = "WallTrack",
            e[e.Pillar = 7] = "Pillar",
            e[e.Sign = 8] = "Sign"
        }(RA || (RA = {}));
        const LA = RA;
        var DA;
        !function(e) {
            e[e.Checkpoint = 0] = "Checkpoint",
            e[e.Finish = 1] = "Finish"
        }(DA || (DA = {}));
        const NA = DA;
        var BA, UA = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, zA = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class OA {
            constructor(e) {
                BA.set(this, void 0);
                const t = [];
                for (const [n,i,r] of e)
                    t.push([n, i, r]);
                UA(this, BA, t, "f")
            }
            rotated(e, t) {
                const n = t == Tb.YNegative || t == Tb.XNegative || t == Tb.ZNegative;
                return new OA(zA(this, BA, "f").map(( ([i,r,a]) => {
                    if (n)
                        switch (e) {
                        case 0:
                            break;
                        case 1:
                            [i,a] = [-a - 1, i];
                            break;
                        case 2:
                            [i,a] = [-i - 1, -a - 1];
                            break;
                        case 3:
                            [i,a] = [a, -i - 1];
                            break;
                        default:
                            throw new Error("Invalid rotation")
                        }
                    else
                        switch (e) {
                        case 0:
                            break;
                        case 1:
                            [i,a] = [a, -i - 1];
                            break;
                        case 2:
                            [i,a] = [-i - 1, -a - 1];
                            break;
                        case 3:
                            [i,a] = [-a - 1, i];
                            break;
                        default:
                            throw new Error("Invalid rotation")
                        }
                    return t == Tb.YPositive || (t == Tb.YNegative ? [i,r] = [-i - 1, -r - 1] : t == Tb.XPositive ? [i,r] = [r, -i - 1] : t == Tb.XNegative ? [i,r] = [-r - 1, i] : t == Tb.ZPositive ? [r,a] = [-a - 1, r] : [r,a] = [a, -r - 1]),
                    [i, r, a]
                }
                )))
            }
            forEach(e) {
                for (let t = 0; t < zA(this, BA, "f").length; t++) {
                    const [n,i,r] = zA(this, BA, "f")[t];
                    e(n, i, r, t)
                }
            }
            get length() {
                return zA(this, BA, "f").length
            }
        }
        BA = new WeakMap;
        const FA = OA
          , WA = [{
            id: Eb.Summer,
            colors: {}
        }, {
            id: Eb.Winter,
            colors: {
                Road: "#5077b2",
                RoadBarrier: "#898989",
                RoadEdgeWhite: "#ffffff",
                RoadEdgeRed: "#1f3d6b",
                BlockSurface: "#878787",
                Pillar: "#2b4d7f",
                PillarEdge: "#071428",
                WallTrack: "#5077b2",
                WallTrackBottom: "#878787",
                WallTrackSides: "#ffffff",
                PlaneWall: "#1f3d6b",
                PlaneWallDetail: "#878787",
                SignYellow: "#1b2a89",
                SignRed: "#841901",
                SignBlack: "#5077b2"
            }
        }, {
            id: Eb.Desert,
            colors: {
                Road: "#997240",
                RoadBarrier: "#211001",
                RoadEdgeRed: "#5b2424",
                RoadEdgeWhite: "#510808",
                BlockSurface: "#b78f5b",
                Pillar: "#99713d",
                PillarEdge: "#1c1105",
                WallTrack: "#260b0b",
                WallTrackBottom: "#160606",
                WallTrackSides: "#75562e",
                PlaneWall: "#633030",
                PlaneWallDetail: "#aa8a53",
                SignYellow: "#997240",
                SignRed: "#d80202",
                SignBlack: "#601d1d"
            }
        }]
          , HA = WA.concat([{
            id: Eb.Custom0,
            colors: {
                BlockSurface: "#131313"
            }
        }, {
            id: Eb.Custom1,
            colors: {
                BlockSurface: "#501b1b"
            }
        }, {
            id: Eb.Custom2,
            colors: {
                BlockSurface: "#7f4d2b"
            }
        }, {
            id: Eb.Custom3,
            colors: {
                BlockSurface: "#93862d"
            }
        }, {
            id: Eb.Custom4,
            colors: {
                BlockSurface: "#2a5e30"
            }
        }, {
            id: Eb.Custom5,
            colors: {
                BlockSurface: "#236363"
            }
        }, {
            id: Eb.Custom6,
            colors: {
                BlockSurface: "#20244b"
            }
        }, {
            id: Eb.Custom7,
            colors: {
                BlockSurface: "#592759"
            }
        }, {
            id: Eb.Custom8,
            colors: {
                BlockSurface: "#302318"
            }
        }]);
        class VA {
            constructor(e, t, n, i, r, a, s=null, o=null) {
                const l = [];
                for (const [e,t] of a)
                    for (let n = e[0]; n <= t[0]; n++)
                        for (let i = e[1]; i <= t[1]; i++)
                            for (let r = e[2]; r <= t[2]; r++) {
                                if (null != l.find(( ([e,t,a]) => e == n && t == i && a == r)))
                                    throw new Error("Duplicate tile in track part");
                                l.push([n, i, r])
                            }
                this.checksum = e,
                this.category = t,
                this.id = n,
                this.models = i,
                this.colors = r,
                this.tiles = new FA(l),
                this.detector = s,
                this.startOffset = o,
                Object.freeze(this)
            }
        }
        const GA = [new VA("6d94d798abd14dc3bce4e99c180309d993ad43adb5f2c90eef8e350eedafe7cf",LA.Special,Mb.Start,[["Road", "Start"]],WA,[[[-2, 0, -2], [1, 0, 1]]],null,new bn(0,.35,1.35)), new VA("f29e34b2e05e0a4751109ae564b03fe8878a79cc6b26288f1117ed296d09c5bb",LA.Special,Mb.StartWide,[["RoadWide", "StartWide"]],WA,[[[-2, 0, -2], [5, 0, 1]]],null,new bn(-10,.35,1.35)), new VA("3c304054f415fbede4f73a43517db04302f38b16fa2cd4e587082b37b75e20e5",LA.Special,Mb.PlaneStart,[["Planes", "PlaneStart"]],WA,[[[-2, 0, -2], [1, 0, 1]]],null,new bn(0,.35,1.35)), new VA("f08710416bdaa3d91d0d43f014e45d421fdb4587a334993bad0056f3dbbcb6bb",LA.Special,Mb.PlaneStartWide,[["Planes", "PlaneStartWide"]],WA,[[[-2, 0, -2], [5, 0, 1]]],null,new bn(-10,.35,1.35)), new VA("223fc87c72bb64b58677062ffa08ab7eafd78071bced7c53233606763cd5316b",LA.Special,Mb.Checkpoint,[["Road", "Checkpoint"]],WA,[[[-2, 0, -2], [1, 0, 1]]],{
            type: NA.Checkpoint,
            center: [0, 2.2, 0],
            size: [10.5, 3.8, 1]
        }), new VA("82d9a9879cee92c04c8d4ba2e16fc31bb1917a31f5802a3bb5177ca9a5cfee01",LA.Special,Mb.CheckpointWide,[["RoadWide", "CheckpointWide"]],WA,[[[-2, 0, -2], [5, 0, 1]]],{
            type: NA.Checkpoint,
            center: [10, 2.2, 0],
            size: [30.6, 3.8, 1]
        }), new VA("fe8946d7f09724b5e11f493eb5c2a5b5e3d502b15beaad003f8134ac63558948",LA.Special,Mb.PlaneCheckpoint,[["Planes", "PlaneCheckpoint"]],WA,[[[-2, 0, -2], [1, 0, 1]]],{
            type: NA.Checkpoint,
            center: [0, 2.2, 0],
            size: [18.25, 3.8, 1]
        }), new VA("d486d9b851db35dd44c15f9e0bb3bf582118daf7be514598a19307f61cf46678",LA.Special,Mb.PlaneCheckpointWide,[["Planes", "PlaneCheckpointWide"]],WA,[[[-2, 0, -2], [5, 0, 1]]],{
            type: NA.Checkpoint,
            center: [10, 2.2, 0],
            size: [38.25, 3.8, 1]
        }), new VA("c01200d573a3594a6a4cb73ebb600964d653e4a89267d3297f3969220742aa79",LA.Special,Mb.Finish,[["Road", "Finish"]],WA,[[[-2, 0, -2], [1, 0, 1]]],{
            type: NA.Finish,
            center: [0, 2.2, 0],
            size: [10.5, 3.8, 2]
        }), new VA("a9cefdff816e94a643210c58582c2809de0e3e0e0478b8d5baabd7fe81f13e73",LA.Special,Mb.FinishWide,[["RoadWide", "FinishWide"]],WA,[[[-2, 0, -2], [5, 0, 1]]],{
            type: NA.Finish,
            center: [10, 2.2, 0],
            size: [30.6, 3.8, 2]
        }), new VA("75e5f09fe8a18ecafaf1fb80929173ef0a7dc0b785596bbe0ccd85a934d79578",LA.Special,Mb.PlaneFinish,[["Planes", "PlaneFinish"]],WA,[[[-2, 0, -2], [1, 0, 1]]],{
            type: NA.Finish,
            center: [0, 2.2, 0],
            size: [18.25, 3.8, 2]
        }), new VA("5801b3268c75809728c63450d06000c5f6fcfd5d72691902f99d7d19d25e1d78",LA.Special,Mb.PlaneFinishWide,[["Planes", "PlaneFinishWide"]],WA,[[[-2, 0, -2], [5, 0, 1]]],{
            type: NA.Finish,
            center: [10, 2.2, 0],
            size: [38.25, 3.8, 2]
        }), new VA("3421096c1986d008da88b5fac64cd4c475603138c9bf8a98ab6d581dda6befa7",LA.Road,Mb.Straight,[["Road", "Straight"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("bdc3bcdafec9bc26835dc76159f7223da7da5babb3a5770129fa11046c748b69",LA.Road,Mb.StraightPillarBottom,[["Road", "Straight"], ["Pillar", "SurfacePillarBottom"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("2758e984d87b3170f6618c9c689554ef169fd5f80ea7f0df292ffd69792d414e",LA.Road,Mb.StraightPillarShort,[["Road", "Straight"], ["Pillar", "SurfacePillarShort"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("fb5a81784022cfc2d3d0007a032976c8dfd066e72a3bc92f671c98c5cca36aaa",LA.Road,Mb.TurnSharp,[["Road", "TurnSharp"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("3da2e9a93da06b1376c33486f30a5f02d8c2f125f5b7d8b41166049ecd95f269",LA.Road,Mb.TurnSharpPillarBottom,[["Road", "TurnSharp"], ["Pillar", "SurfacePillarBottom"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("c642122276547382e37dcb857b130088f4dc0d208dc7fdb6055b2a93080a3ffe",LA.Road,Mb.TurnSharpPillarShort,[["Road", "TurnSharp"], ["Pillar", "SurfacePillarShort"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("110efb0facc096e1c875e545b075b0effaa1b78d50b97f906aec44796501544b",LA.RoadTurns,Mb.TurnShort,[["Road", "TurnShort"]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 0, -1], [2, 0, -1]], [[-1, 0, -2], [3, 0, -2]], [[-1, 0, -3], [5, 0, -3]], [[0, 0, -4], [5, 0, -4]], [[1, 0, -5], [5, 0, -5]], [[3, 0, -6], [5, 0, -6]]]), new VA("20a164840b0e83f3eac96ba9e3650a30e3b3dec4bb635946e3e9e9a1b74820d2",LA.RoadTurns,Mb.TurnLong,[["Road", "TurnLong"]],WA,[[[-2, 0, -1], [1, 0, 1]], [[-1, 0, -2], [2, 0, -2]], [[-1, 0, -3], [2, 0, -3]], [[-1, 0, -4], [3, 0, -4]], [[0, 0, -5], [4, 0, -5]], [[1, 0, -6], [6, 0, -6]], [[2, 0, -7], [9, 0, -7]], [[3, 0, -8], [9, 0, -8]], [[4, 0, -9], [9, 0, -9]], [[7, 0, -10], [9, 0, -10]]]), new VA("c36dddde35a740c6f01227522bf35e1a450cddbfdd8bde1617873bef0d47c95c",LA.RoadTurns,Mb.TurnLong2,[["Road", "TurnLong2"]],WA,[[[-2, 0, -2], [1, 0, 1]], [[-1, 0, -4], [2, 0, -3]], [[-1, 0, -5], [3, 0, -5]], [[0, 0, -6], [4, 0, -6]], [[0, 0, -7], [5, 0, -7]], [[1, 0, -8], [6, 0, -8]], [[2, 0, -9], [7, 0, -9]], [[3, 0, -10], [9, 0, -10]], [[4, 0, -11], [13, 0, -11]], [[5, 0, -12], [13, 0, -12]], [[7, 0, -13], [13, 0, -13]], [[10, 0, -14], [13, 0, -14]]]), new VA("0ed20c04a941708c23fe6ced4af3f357c0e435f09278e06f3de2806786d44059",LA.RoadTurns,Mb.TurnLong3,[["Road", "TurnLong3"]],WA,[[[-2, 0, -2], [1, 0, 1]], [[-1, 0, -4], [2, 0, -3]], [[-1, 0, -5], [2, 0, -5]], [[0, 0, -6], [3, 0, -6]], [[0, 0, -7], [3, 0, -7]], [[0, 0, -8], [4, 0, -8]], [[1, 0, -9], [5, 0, -9]], [[2, 0, -10], [6, 0, -10]], [[2, 0, -11], [7, 0, -11]], [[3, 0, -12], [8, 0, -12]], [[4, 0, -13], [10, 0, -13]], [[5, 0, -14], [13, 0, -14]], [[7, 0, -15], [17, 0, -15]], [[8, 0, -16], [17, 0, -16]], [[11, 0, -17], [17, 0, -17]], [[14, 0, -18], [17, 0, -18]]]), new VA("034ef287319877f2fcc32fbd6f32415539a4c287dfcd620360386a781adad22a",LA.RoadTurns,Mb.TurnSLeft,[["Road", "TurnS", {
            flipX: !0
        }]],WA,[[[-2, 0, -1], [1, 0, 1]], [[-3, 0, -3], [0, 0, -2]], [[-4, 0, -4], [0, 0, -4]], [[-5, 0, -5], [-1, 0, -5]], [[-5, 0, -7], [-2, 0, -6]], [[-6, 0, -10], [-3, 0, -8]]]), new VA("0d49e9feb603d0899927c7e5184f4f4fdd4363d2e1fd296f0b7b3cf4dbbf0e8d",LA.RoadTurns,Mb.TurnSRight,[["Road", "TurnS"]],WA,[[[-2, 0, -1], [1, 0, 1]], [[-1, 0, -3], [2, 0, -2]], [[-1, 0, -4], [3, 0, -4]], [[0, 0, -5], [4, 0, -5]], [[1, 0, -7], [4, 0, -6]], [[2, 0, -10], [5, 0, -8]]]), new VA("26bca19e63867bc0b755ff6fcca65de296c9d1f109f87540103565eb88a0e03d",LA.RoadTurns,Mb.TurnShortLeftWide,[["RoadWide", "TurnShortLeftWide"]],WA,[[[-2, 0, -1], [1, 0, 1]], [[-1, 0, -2], [1, 0, -2]], [[-1, 0, -4], [5, 0, -3]], [[0, 0, -5], [5, 0, -5]], [[1, 0, -6], [5, 0, -6]], [[2, 0, -7], [9, 0, -7]], [[3, 0, -8], [9, 0, -8]], [[4, 0, -9], [9, 0, -9]], [[7, 0, -10], [9, 0, -10]]]), new VA("e3845854f85dafd8cec193bcbecdac6cb79f625066de29524d5c10c5580611c5",LA.RoadTurns,Mb.TurnShortRightWide,[["RoadWide", "TurnShortRightWide"]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 0, -1], [2, 0, -1]], [[-2, 0, -2], [3, 0, -2]], [[2, 0, -6], [5, 0, -3]]]), new VA("dc6088960a65a55c74353a1e7c8a1ca8ec99e683f6273bf666d6909b288bb84b",LA.RoadTurns,Mb.TurnLongLeftWide,[["RoadWide", "TurnLongLeftWide"]],WA,[[[-2, 0, -2], [1, 0, 1]], [[-1, 0, -5], [1, 0, -3]], [[0, 0, -6], [1, 0, -6]], [[0, 0, -7], [5, 0, -7]], [[1, 0, -8], [5, 0, -8]], [[2, 0, -9], [5, 0, -9]], [[3, 0, -10], [5, 0, -10]], [[4, 0, -11], [13, 0, -11]], [[5, 0, -12], [13, 0, -12]], [[7, 0, -13], [13, 0, -13]], [[10, 0, -14], [13, 0, -14]]]), new VA("0bbb8d6c1e4a325e10643cf45546da725c1ea18e92a3a95f753339629a06ef6c",LA.RoadTurns,Mb.TurnLongRightWide,[["RoadWide", "TurnLongRightWide"]],WA,[[[-2, 0, -1], [1, 0, 1]], [[-2, 0, -3], [2, 0, -2]], [[-2, 0, -4], [3, 0, -4]], [[-2, 0, -5], [4, 0, -5]], [[-2, 0, -6], [6, 0, -6]], [[2, 0, -10], [9, 0, -7]]]), new VA("7d8d1eed719515ba7e48b5ef4a53b6b4bb2bef42496b6b40d2551230435ecb66",LA.Road,Mb.SlopeUp,[["Road", "SlopeUp"]],WA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, -2], [1, 1, -2]]]), new VA("d6d54dbf283f7209032541fc6b924dc879d914f253e391cf8b34dde8354661be",LA.Road,Mb.SlopeUpLong,[["Road", "SlopeUpLong"]],WA,[[[-2, 0, -4], [1, 0, 1]], [[-2, 1, -5], [1, 1, -4]], [[-2, 1, -6], [1, 2, -6]]]), new VA("435e8cf33d28e52f75890cba1cb6529991148afd701f9b40e9ab876c11b2c448",LA.Road,Mb.SlopeDown,[["Road", "SlopeDown"]],WA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, 0], [1, 1, 1]]]), new VA("01990158f65e5d499030d8c6d0ce80d34c136189ae1a9430d4260ea7a85e91a9",LA.Road,Mb.SlopeDownLong,[["Road", "SlopeDownLong"]],WA,[[[-2, 0, -2], [1, 0, 0]], [[-2, 1, -1], [1, 1, 5]], [[-2, 2, 3], [1, 2, 5]]]), new VA("4afecc8b9bd7a3b074112008831fef6b11f9a55ab8c1e570e3e73c1e92b43c6d",LA.Road,Mb.Slope,[["Road", "Slope"]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 1, -2], [1, 1, 0]], [[-2, 2, -2], [1, 2, -2]]]), new VA("27f9b25126b1006514941bd148c8f19dc2d82022b0c1aa2358f36cb711d4b59c",LA.Road,Mb.SlopePillar,[["Road", "Slope"], ["Pillar", "PillarTopSlope"]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 1, -2], [1, 1, 0]], [[-2, 2, -2], [1, 2, -2]], [[-1, 0, -1], [0, 0, -1]]]), new VA("eb236f0ac4bd895c170db53cb518c8df5167a9db5af4bb4f33f73c02deec5265",LA.Road,Mb.SlopePillarShort,[["Road", "Slope"], ["Pillar", "PillarShortSlope"]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 1, -2], [1, 1, 0]], [[-2, 2, -2], [1, 2, -2]], [[-1, 0, -1], [0, 0, -1]]]), new VA("99cb9068cb3f97e7cbfdbb3f1edc1085ea37514f3d5dd8936bc32089cc066a5c",LA.Road,Mb.SlopeUpVertical,[["Road", "SlopeUpVertical"]],WA,[[[-2, 0, -1], [1, 0, 1]], [[-2, 1, -1], [1, 1, -1]], [[-2, 1, -2], [1, 3, -2]]]), new VA("63628b23e104a3eb3c2ba8189cd408a10fbb6ebcd6fa4359d981e3c3804c13d8",LA.Road,Mb.IntersectionT,[["Road", "IntersectionT"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("400dc4643653001d283bb13f740593fc2300c547bb4d2a962054ba6aabf3721c",LA.Road,Mb.IntersectionTPillarBottom,[["Road", "IntersectionT"], ["Pillar", "SurfacePillarBottom"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("60355388650d35fcbddaaac29e0d03bc2ae46db1a05cd23ddd3f2722ec2d409e",LA.Road,Mb.IntersectionTPillarShort,[["Road", "IntersectionT"], ["Pillar", "SurfacePillarShort"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("74197b3731c2befd03498bf5172859f0b3652f1972c19e43a99bb938769573df",LA.Road,Mb.IntersectionCross,[["Road", "IntersectionCross"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("464e69b5c4f2667c246ade9ed33fd3e50b49438ed0ab787a086dfe74c217ff6c",LA.Road,Mb.IntersectionCrossPillarBottom,[["Road", "IntersectionCross"], ["Pillar", "SurfacePillarBottom"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("90004caf354627289265314966f11b5656e6879ca7de10507e6c50cd95254b75",LA.Road,Mb.IntersectionCrossPillarShort,[["Road", "IntersectionCross"], ["Pillar", "SurfacePillarShort"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("2af8aa6050028dd6ee69b7150e83a6d8819e1848a7b1c782848d3f6448c5091a",LA.RoadWide,Mb.ToWideMiddle,[["RoadWide", "ToWideMiddle"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("26341cfe6bec34f46b10ffcd9a7706a8156b9ac41ed2cdfd166f9f8d3e9bc8f3",LA.RoadWide,Mb.ToWideLeft,[["RoadWide", "ToWideSide", {
            flipX: !0
        }]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("3f82ebd6c72110b532a20673f8b54c7b25ae5988a51d3793bf383fea8ffcffc3",LA.RoadWide,Mb.ToWideRight,[["RoadWide", "ToWideSide"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("f5cecce9870f41f8cba7a9fbe631c315370a7a82824d04977ec857dbb1dfed29",LA.RoadWide,Mb.ToWideDouble,[["RoadWide", "ToWideDouble"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("99dc726611397f81b47459d32c7bfb8232322d1ca976ba9a3e71cc15451d8cfb",LA.RoadWide,Mb.ToWideDiagonal,[["RoadWide", "ToWideDiagonal"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("47d7e3fb334681911e122babef127881a36a763fb22176854114495802d5ce84",LA.RoadWide,Mb.StraightWide,[["RoadWide", "StraightWide"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("521adc95ed5a4809eeff7eec872c3d6449e4d6a7e4941d672f1e06a50a6615de",LA.RoadWide,Mb.InnerCornerWide,[["RoadWide", "InnerCornerWide"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("d82274b362794e3c1772510002d5015dde345f1e72dd675c8bac41cf2331398b",LA.RoadWide,Mb.OuterCornerWide,[["RoadWide", "OuterCornerWide"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("9b1df4dd4687404adb5789f3b90af39ea6fa65ef741a07b116dc436dc14a2aa1",LA.RoadWide,Mb.SlopeUpLeftWide,[["RoadWide", "SlopeUpWide", {
            flipX: !0
        }]],WA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, -2], [1, 1, -2]]]), new VA("651d4e988913b84359ad10e0c4745965b6a388eaa8c9bfbba4b6a50ae6d4f592",LA.RoadWide,Mb.SlopeUpRightWide,[["RoadWide", "SlopeUpWide"]],WA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, -2], [1, 1, -2]]]), new VA("848d9930c58e66152090d7853af87c8bb7971e1771d3c337ac1a50aaa4975a78",LA.RoadWide,Mb.SlopeUpLongLeftWide,[["RoadWide", "SlopeUpLongWide", {
            flipX: !0
        }]],WA,[[[-2, 0, -4], [1, 0, 1]], [[-2, 1, -5], [1, 1, -4]], [[-2, 1, -6], [1, 2, -6]]]), new VA("e4d54c6c3b6011a1acfb6766b6b3e7ea0de6f9c6569a5ec88c47968ad4105b2a",LA.RoadWide,Mb.SlopeUpLongRightWide,[["RoadWide", "SlopeUpLongWide"]],WA,[[[-2, 0, -4], [1, 0, 1]], [[-2, 1, -5], [1, 1, -4]], [[-2, 1, -6], [1, 2, -6]]]), new VA("106ad1d4c5aded30cc3ef4cd1bdc40babab84464ce7dbce3b81cc20d55fd615f",LA.RoadWide,Mb.SlopeDownLeftWide,[["RoadWide", "SlopeDownWide", {
            flipX: !0
        }]],WA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, 0], [1, 1, 1]]]), new VA("23a693633b8453c7a531de9723e6ca14d0676b1d7a4df7f78278914467b90a27",LA.RoadWide,Mb.SlopeDownRightWide,[["RoadWide", "SlopeDownWide"]],WA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, 0], [1, 1, 1]]]), new VA("0f2e33a8b68667e30e80ceaefdb890a77643799d63c7f20672ca3185bbc04270",LA.RoadWide,Mb.SlopeDownLongLeftWide,[["RoadWide", "SlopeDownLongWide", {
            flipX: !0
        }]],WA,[[[-2, 0, -2], [1, 0, 0]], [[-2, 1, -1], [1, 1, 5]], [[-2, 2, 3], [1, 2, 5]]]), new VA("164903518c7efa4890a792017ea2b8125a2c3dae76bba4c6f1f56fb0f7e40ebc",LA.RoadWide,Mb.SlopeDownLongRightWide,[["RoadWide", "SlopeDownLongWide"]],WA,[[[-2, 0, -2], [1, 0, 0]], [[-2, 1, -1], [1, 1, 5]], [[-2, 2, 3], [1, 2, 5]]]), new VA("c20560fd35288c5cc74af61834b9a56efaeacdde55eb793d400b7c5b97904993",LA.RoadWide,Mb.SlopeLeftWide,[["RoadWide", "SlopeWide", {
            flipX: !0
        }]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 1, -2], [1, 1, 0]], [[-2, 2, -2], [1, 2, -2]]]), new VA("b6a26eb3cefee53d4deef24544e5b5c1ecd25e8e8bd7c3070c7947ada55c57c2",LA.RoadWide,Mb.SlopeRightWide,[["RoadWide", "SlopeWide"]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 1, -2], [1, 1, 0]], [[-2, 2, -2], [1, 2, -2]]]), new VA("b598ff14bda99600434b24a619132fec4bffcc535483b9b57b0c8c09c1be1f1b",LA.RoadWide,Mb.SlopeUpVerticalLeftWide,[["RoadWide", "SlopeUpVerticalWide"]],WA,[[[-2, 0, -1], [1, 0, 1]], [[-2, 1, -1], [1, 1, -1]], [[-2, 1, -2], [1, 3, -2]]]), new VA("4e0275d3a01eaca6ec5118b8b816ed292cb7172710cf9b7801068424ab684b22",LA.RoadWide,Mb.SlopeUpVerticalRightWide,[["RoadWide", "SlopeUpVerticalWide", {
            flipX: !0
        }]],WA,[[[-2, 0, -1], [1, 0, 1]], [[-2, 1, -1], [1, 1, -1]], [[-2, 1, -2], [1, 3, -2]]]), new VA("896b47675cc2ff58494979168f6fd36c27c43da29aed6a52fdf80f054630166a",LA.Plane,Mb.Plane,[["Planes", "Plane"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("dc9afb98a8bb998d3b76c3563385e58c1749e56ff43fbc7577b1f57ba8360702",LA.Plane,Mb.PlanePillarBottom,[["Planes", "Plane"], ["Pillar", "SurfacePillarBottom"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("f59ad95edd26814236ab30b73f6f4f68003885ef150201a4ace14b832abcf438",LA.Plane,Mb.PlanePillarShort,[["Planes", "Plane"], ["Pillar", "SurfacePillarShort"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("48247a66b232461083fa2aa36644e7e8779f5b426d474efd375ee7d21d009c9a",LA.Plane,Mb.HalfPlane,[["Planes", "HalfPlane"]],WA,[[[-2, 0, 1], [1, 0, 1]], [[-2, 0, 0], [0, 0, 0]], [[-2, 0, -1], [-1, 0, -1]], [[-2, 0, -2], [-2, 0, -2]]]), new VA("eac8530d1a025291674bf34b206f75700dc8626012d8d33ed398f7aed746dac8",LA.Plane,Mb.QuarterPlane,[["Planes", "QuarterPlane"]],WA,[[[-2, 0, 1], [-2, 0, 1]], [[-2, 0, -1], [-1, 0, 0]], [[-2, 0, -2], [-2, 0, -2]]]), new VA("1da4dcad366aa90a5977e1b20c5d79297106ed3b4f664be04b6b3f6370c105b4",LA.Plane,Mb.PlaneSlopeUp,[["Planes", "PlaneSlopeUp"]],WA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, -2], [1, 1, -2]]]), new VA("3e203219ec0ea114da510b37a4c392b90417af796e2b089da6d996e628c0a323",LA.Plane,Mb.PlaneSlopeUpLong,[["Planes", "PlaneSlopeUpLong"]],WA,[[[-2, 0, -4], [1, 0, 1]], [[-2, 1, -5], [1, 1, -4]], [[-2, 1, -6], [1, 2, -6]]]), new VA("053dbf6c03eea5102b67168ccb479d8364233b36c4210aff093928bbb83d859d",LA.Plane,Mb.PlaneSlopeDown,[["Planes", "PlaneSlopeDown"]],WA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, 0], [1, 1, 1]]]), new VA("d68121a3cb0ee19cab45adb136e0df6145f43ca9ecbde8a417c02a6d4a75a757",LA.Plane,Mb.PlaneSlopeDownLong,[["Planes", "PlaneSlopeDownLong"]],WA,[[[-2, 0, -2], [1, 0, 0]], [[-2, 1, -1], [1, 1, 5]], [[-2, 2, 3], [1, 2, 5]]]), new VA("67ec222e8fe770a8d728bb76ff571377c261d2f232134d4cb328c9ab772cf3ca",LA.Plane,Mb.PlaneSlope,[["Planes", "PlaneSlope"]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 1, -2], [1, 1, 0]], [[-2, 2, -2], [1, 2, -2]]]), new VA("a52c09d87d37088b68420db07626f274c74f792cb223764624d887a5ed145a2e",LA.Plane,Mb.PlaneSlopePillar,[["Planes", "PlaneSlope"], ["Pillar", "PillarTopSlope"]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 1, -2], [1, 1, 0]], [[-2, 2, -2], [1, 2, -2]], [[-1, 0, -1], [0, 0, -1]]]), new VA("57df805433e706ec946d767d7ff0881f163c2e36bb1db00b0e3259954a787dec",LA.Plane,Mb.PlaneSlopePillarShort,[["Planes", "PlaneSlope"], ["Pillar", "PillarShortSlope"]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 1, -2], [1, 1, 0]], [[-2, 2, -2], [1, 2, -2]], [[-1, 0, -1], [0, 0, -1]]]), new VA("ba0d6ec33647740bf4c60e542d1758095afa3ef451bdaec76c783dd32116e4cb",LA.Plane,Mb.PlaneSlopeVerticalBottom,[["Planes", "PlaneSlopeVertical"]],WA,[[[-2, 0, -1], [1, 0, 1]], [[-2, 1, -1], [1, 1, -1]], [[-2, 1, -2], [1, 3, -2]]]), new VA("78a372de15f3151f901cf7fa7a3983ee6513cf19fa8568f10946e195c5a62515",LA.Plane,Mb.PlaneSlopeToVertical,[["Planes", "PlaneSlopeToVertical"]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 1, -2], [1, 1, 0]], [[-2, 2, -2], [1, 3, -2]]]), new VA("5f6d1ece085d450643f1399af53673dcc6bbbf413094d8dd5ee6816d80e1c8ae",LA.Plane,Mb.PlaneBridge,[["Planes", "PlaneBridge"]],WA,[[[-1, 0, -2], [0, 0, 1]]]), new VA("32b91fc4cdf95f5b7a490d81058522bae14741601dd44c73cc110121aa1dd6e6",LA.Plane,Mb.PlaneBridgeCorner,[["Planes", "PlaneBridgeCorner"]],WA,[[[-1, 0, -1], [0, 0, 1]], [[1, 0, -1], [1, 0, 0]]]), new VA("2db870b1821fb655437bd0527569d5a6843718fa0775682701437432265a1a88",LA.Plane,Mb.PlaneBridgeIntersectionT,[["Planes", "PlaneBridgeIntersectionT"]],WA,[[[-1, 0, -1], [0, 0, 1]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]]]), new VA("33aa0e7524b74dcdae4aed89856c09d25248c4cab8f70dcc31b347f0a00fcb52",LA.Plane,Mb.PlaneBridgeIntersectionCross,[["Planes", "PlaneBridgeIntersectionCross"]],WA,[[[-1, 0, -1], [0, 0, 1]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]], [[-1, 0, -2], [0, 0, -2]]]), new VA("bd7cc4ab180fc0a6936fef828ae3a91566b3dd621b888fbcc57c9ac11dcb713b",LA.Plane,Mb.PlaneWall,[["Planes", "PlaneWall"]],WA,[[[-2, 0, 1], [1, 0, 1]]]), new VA("d92568164028bb2e65799abd9dc6ba66cfe8a28515c09fbe5ac175f5966af66a",LA.Plane,Mb.PlaneWallCorner,[["Planes", "PlaneWallCorner"]],WA,[[[-2, 0, 1], [1, 0, 1]], [[1, 0, -2], [1, 0, 0]]]), new VA("792ab5a6f0e2bf8e556575ef12731ec30755855d4394f98eb4ca7ec8b713933c",LA.Plane,Mb.PlaneWallInnerCorner,[["Planes", "PlaneWallInnerCorner"]],WA,[[[1, 0, 1], [1, 0, 1]]]), new VA("de0d588c4b2fe6b32d72a7e0e2984285955f805ccb86d3c269f7155401cd6b20",LA.Block,Mb.Block,[["Blocks", "Block"]],HA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("1ce6b585c0e99d71877fefe015ff16336ae62eb0caebeca62dd09d836092d7b6",LA.Block,Mb.HalfBlock,[["Blocks", "HalfBlock"]],HA,[[[-2, 0, 1], [1, 0, 1]], [[-2, 0, 0], [0, 0, 0]], [[-2, 0, -1], [-1, 0, -1]], [[-2, 0, -2], [-2, 0, -2]]]), new VA("0d5f0609c3c98f687d55d3a73313225c1642f6285ddaca3ed536db742c85958d",LA.Block,Mb.QuarterBlock,[["Blocks", "QuarterBlock"]],HA,[[[-2, 0, 1], [-2, 0, 1]], [[-2, 0, -1], [-1, 0, 0]], [[-2, 0, -2], [-2, 0, -2]]]), new VA("18fc1c569c6fc04f95f10174143d19e7a9ea4e387302363f4ae60883c1acd3f0",LA.Block,Mb.BlockSlopedDown,[["Blocks", "BlockSlopedDown"]],HA,[[[-2, 0, -2], [1, 0, -1]], [[-2, 1, -2], [1, 1, 1]]]), new VA("22dd5b2804c88994a4d283cb822f47de3c72f82376e4c9332d39feae85206c0f",LA.Block,Mb.BlockSlopedDownInnerCorner,[["Blocks", "BlockSlopedDownInnerCorner"]],HA,[[[-2, 0, -2], [-1, 0, 1]], [[0, 0, -2], [1, 0, -1]], [[-2, 1, -2], [1, 1, 1]]]), new VA("81a71b4cc6ef8520f20fd738457abc31b04258c97f9862f70190fd2a0ba91382",LA.Block,Mb.BlockSlopedDownOuterCorner,[["Blocks", "BlockSlopedDownOuterCorner"]],HA,[[[-2, 0, -2], [-1, 0, -1]], [[-2, 1, -2], [1, 1, 1]]]), new VA("f4e19d3bc49994a85fecd187b76c21d258e7f30f0506d90bc6f173336e11627d",LA.Block,Mb.BlockSlopedUp,[["Blocks", "BlockSlopedUp"]],HA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, -2], [1, 1, -1]]]), new VA("fd9309468e97131bbbd1404fac34a7137cb176327789b955c1aea30267e1cded",LA.Block,Mb.BlockSlopedUpInnerCorner,[["Blocks", "BlockSlopedUpInnerCorner"]],HA,[[[-2, 1, -2], [-1, 1, 1]], [[0, 1, -2], [1, 1, -1]], [[-2, 0, -2], [1, 0, 1]]]), new VA("1321fb07ece1b80b99dc4671b52673ac028fbf43322e9e652ad633ff6afac21b",LA.Block,Mb.BlockSlopedUpOuterCorner,[["Blocks", "BlockSlopedUpOuterCorner"]],HA,[[[-2, 1, -2], [-1, 1, -1]], [[-2, 0, -2], [1, 0, 1]]]), new VA("b97c17388fc38139f2f5a98a36d94831095f79db709dd97748ad2904bc54d689",LA.Block,Mb.BlockSlopeDown,[["Blocks", "BlockSlopeDown"]],HA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("50276826bbfb9fcb11a8519b8dae8a2b1cf82817d5431418d9a376664261be82",LA.Block,Mb.BlockSlopeUp,[["Blocks", "BlockSlopeUp"]],HA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("63fd3032796397f8e25669c1c1d3fc97b8ec0e5fc88bfcb5c00a2a2c2b517888",LA.Block,Mb.BlockSlopeDownLong,[["Blocks", "BlockSlopeDownLong"]],HA,[[[-2, 0, -2], [1, 0, 5]], [[-2, 1, 0], [1, 1, 5]]]), new VA("2d29131222a8d891b4350e6a2f335b114e001cf22e4e2f170dc9b86c4b2fd325",LA.Block,Mb.BlockSlopeUpLong,[["Blocks", "BlockSlopeUpLong"]],HA,[[[-2, 0, -6], [1, 0, 1]], [[-2, 1, -6], [1, 1, -4]]]), new VA("0bbcd96c91b69e6e8005bfae5b64455b0d6510cb1595f3fca7f77c86ddda4560",LA.Block,Mb.BlockSlopeVerticalTop,[["Blocks", "BlockSlopeVertical", {
            flipY: !0
        }]],HA,[[[-2, 3, -2], [1, 3, 1]], [[-2, 2, -2], [1, 2, -1]], [[-2, 0, -2], [1, 1, -2]]]), new VA("e81a123c0be3f8f168fb584d53e8aa038785569bbf2cd1c1cead2272889591e0",LA.Block,Mb.BlockSlopeVerticalBottom,[["Blocks", "BlockSlopeVertical"]],HA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, -2], [1, 1, -1]], [[-2, 2, -2], [1, 3, -2]]]), new VA("94e14468f31af7f39b9d7ba188a364089ae81da2bd6a9db2b8f5b1b8cedce741",LA.Block,Mb.BlockSlopeToVertical,[["Blocks", "BlockSlopeToVertical"]],HA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, -2], [1, 1, -1]], [[-2, 2, -2], [1, 3, -2]]]), new VA("3a2f05b1c2c2fd976997fa473f1adb3ba14495701dc5a998f8697798384c6946",LA.Block,Mb.BlockSlopeVerticalCornerTop,[["Blocks", "BlockSlopeVerticalCornerBottom", {
            flipY: !0
        }]],HA,[[[-2, 3, -2], [1, 3, 1]], [[-2, 2, -2], [0, 2, 0]], [[1, 2, -2], [1, 2, -1]], [[-2, 2, 1], [-1, 2, 1]], [[-2, 1, -2], [-1, 1, -1]], [[-2, 1, 0], [-1, 1, 0]], [[0, 1, -2], [0, 1, -1]], [[1, 1, -2], [1, 1, -2]], [[-2, 1, 1], [-2, 1, 1]], [[-2, 0, -2], [-1, 0, -1]], [[-2, 0, 0], [-2, 0, 1]], [[0, 0, -2], [1, 0, -2]]]), new VA("3e4fa43e69aa1dbee584e16451a95a16229bba8d638df2bf6f6c9ffb3a9629c9",LA.Block,Mb.BlockInnerCorner,[["Blocks", "BlockInnerCorner"]],HA,[[[-2, 0, 0], [-2, 0, 1]], [[-2, 0, -2], [-1, 0, -1]], [[0, 0, -2], [1, 0, -2]]]), new VA("cc9c95eef56def4cf013e4ac85b8013a2b4f4b4346f1f5dd41fa017de763ef17",LA.Block,Mb.BlockSlopeVerticalCornerBottom,[["Blocks", "BlockSlopeVerticalCornerBottom"]],HA,[[[-2, 0, -2], [1, 0, 1]], [[-2, 1, -2], [0, 1, 0]], [[1, 1, -2], [1, 1, -1]], [[-2, 1, 1], [-1, 1, 1]], [[-2, 2, -2], [-1, 2, -1]], [[-2, 2, 0], [-1, 2, 0]], [[0, 2, -2], [0, 2, -1]], [[1, 2, -2], [1, 2, -2]], [[-2, 2, 1], [-2, 2, 1]], [[-2, 3, -2], [-1, 3, -1]], [[-2, 3, 0], [-2, 3, 1]], [[0, 3, -2], [1, 3, -2]]]), new VA("e4c82c8e512d52269cb6588fa34b06c179340ea40e71f74cbadadc7e8353f5a2",LA.Block,Mb.BlockSlopeVerticalInnerCornerTop,[["Blocks", "BlockSlopeVerticalInnerCorner", {
            flipY: !0
        }]],HA,[[[-2, 3, -2], [0, 3, 1]], [[1, 3, -2], [1, 3, 0]], [[-2, 2, -2], [-2, 2, -1]], [[-1, 2, -2], [-1, 2, -2]], [[-2, 0, -2], [-2, 1, -2]]]), new VA("926fdc6e82ecd709cc535faea6bb8778c6e2e91edb39eb6ae6308076dca2ed18",LA.Block,Mb.BlockSlopeVerticalInnerCornerBottom,[["Blocks", "BlockSlopeVerticalInnerCorner"]],HA,[[[-2, 0, -2], [0, 0, 1]], [[1, 0, -2], [1, 0, 0]], [[-2, 1, -2], [-2, 1, -1]], [[-1, 1, -2], [-1, 1, -2]], [[-2, 2, -2], [-2, 3, -2]]]), new VA("1086515ba3c1d8e5ec76b378f0bdbc77fc5a57fc8eba8972f0d5e611be945235",LA.Block,Mb.BlockBridge,[["Blocks", "BlockBridge"]],HA,[[[-1, 0, -2], [0, 0, 1]]]), new VA("5426ad4ff64af3f1a0f0794ad30cfc20434dfffdf44d93010f5f98671c246ff3",LA.Block,Mb.BlockBridgeCorner,[["Blocks", "BlockBridgeCorner"]],HA,[[[-1, 0, -1], [0, 0, 1]], [[1, 0, -1], [1, 0, 0]]]), new VA("784b9b4459e838e5b8f74f6250769ffa52ec5cc3608abc24c380a2e792c3d338",LA.Block,Mb.BlockBridgeIntersectionT,[["Blocks", "BlockBridgeIntersectionT"]],HA,[[[-1, 0, -1], [0, 0, 1]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]]]), new VA("dfbcbc107a3c12217bfa3b224a5757d08e995705d1c122bb2c2665bbb8447b1c",LA.Block,Mb.BlockBridgeIntersectionCross,[["Blocks", "BlockBridgeIntersectionCross"]],HA,[[[-1, 0, -1], [0, 0, 1]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]], [[-1, 0, -2], [0, 0, -2]]]), new VA("5fe53442e559418b7cc9483315b0ac45b8797f9630d5ecc4c7604dab4be25584",LA.WallTrack,Mb.WallTrackTop,[["WallTrack", "WallTrackBottom", {
            flipY: !0
        }]],WA,[[[-2, 3, -1], [1, 3, 1]], [[-2, 2, -1], [1, 2, -1]], [[-2, 0, -2], [1, 2, -2]]]), new VA("010d187fbfbd399bfe880bbea1b548678c239eba0be2913e5cb8a69fbd17adf7",LA.WallTrack,Mb.WallTrackMiddle,[["WallTrack", "WallTrackMiddle"]],WA,[[[-2, 0, -2], [1, 0, -2]]]), new VA("33216a4dcb734511a80c5bf70ca6f66de555800426686eae5a2519d4c837090e",LA.WallTrack,Mb.WallTrackBottom,[["WallTrack", "WallTrackBottom"]],WA,[[[-2, 0, -1], [1, 0, 1]], [[-2, 1, -1], [1, 1, -1]], [[-2, 1, -2], [1, 3, -2]]]), new VA("1e306d2a6347b68d6e275bf4ccc9c8942e0a633bf625a3bba95fa9f98ecd50ff",LA.WallTrack,Mb.WallTrackSlopeToVertical,[["WallTrack", "WallTrackSlopeToVertical"]],WA,[[[-2, 0, 0], [1, 0, 1]], [[-2, 1, -2], [1, 1, 0]], [[-2, 2, -2], [1, 3, -2]]]), new VA("3ed21ddbc756a6644e05f5e1ca78ff8df6d51affc472c2d86e7f23d85911e273",LA.WallTrack,Mb.WallTrackTopCorner,[["WallTrack", "WallTrackBottomCorner", {
            flipY: !0
        }]],WA,[[[-2, 0, -1], [-2, 0, 1]], [[-1, 0, -1], [-1, 0, -1]], [[-1, 0, -2], [1, 0, -2]], [[-2, 1, -1], [-2, 1, 1]], [[-1, 1, -1], [-1, 1, 0]], [[0, 1, -1], [0, 1, -1]], [[-1, 1, -2], [1, 1, -2]], [[-2, 2, 0], [-2, 2, 1]], [[-1, 2, 1], [-1, 2, 1]], [[-1, 2, -1], [0, 2, 0]], [[1, 2, -1], [1, 2, -1]], [[0, 2, -2], [1, 2, -2]], [[0, 3, -1], [1, 3, 1]], [[-1, 3, 0], [-1, 3, 1]]]), new VA("4027a2439cc3e42ceda50ff3d427a31e127b25a6457b55edc2d498b474a296a7",LA.WallTrack,Mb.WallTrackMiddleCorner,[["WallTrack", "WallTrackMiddleCorner"]],WA,[[[-2, 0, -1], [-2, 0, 1]], [[-1, 0, -1], [-1, 0, -1]], [[-1, 0, -2], [1, 0, -2]]]), new VA("498286e062056a537a482ed3385fe0ac0343b399f29d470641df8f74c0532672",LA.WallTrack,Mb.WallTrackBottomCorner,[["WallTrack", "WallTrackBottomCorner"]],WA,[[[-2, 3, -1], [-2, 3, 1]], [[-1, 3, -1], [-1, 3, -1]], [[-1, 3, -2], [1, 3, -2]], [[-2, 2, -1], [-2, 2, 1]], [[-1, 2, -1], [-1, 2, 0]], [[0, 2, -1], [0, 2, -1]], [[-1, 2, -2], [1, 2, -2]], [[-2, 1, 0], [-2, 1, 1]], [[-1, 1, 1], [-1, 1, 1]], [[-1, 1, -1], [0, 1, 0]], [[1, 1, -1], [1, 1, -1]], [[0, 1, -2], [1, 1, -2]], [[0, 0, -1], [1, 0, 1]], [[-1, 0, 0], [-1, 0, 1]]]), new VA("ac09cd62c83af376f23d37dd88273614a2a11cc04a04bff6075fd749bb1ff421",LA.WallTrack,Mb.WallTrackTopInnerCorner,[["WallTrack", "WallTrackBottomInnerCorner", {
            flipY: !0
        }]],WA,[[[-2, 3, -1], [1, 3, 1]], [[-1, 3, -2], [1, 3, -2]], [[-2, 2, -2], [-1, 2, -1]], [[-2, 0, -2], [-2, 1, -2]]]), new VA("16c9c8ece47c097f60cfc7f8a2daa2f0e7ad0befb0ebfd185402013fd1ec8e0f",LA.WallTrack,Mb.WallTrackInnerCorner,[["WallTrack", "WallTrackInnerCorner"]],WA,[[[-2, 0, -2], [-2, 0, -2]]]), new VA("404e7506c2f7e9302acac39c31a659e7e09e7852786e5f0244f9827727a0bf1e",LA.WallTrack,Mb.WallTrackBottomInnerCorner,[["WallTrack", "WallTrackBottomInnerCorner"]],WA,[[[-2, 0, -1], [1, 0, 1]], [[-1, 0, -2], [1, 0, -2]], [[-2, 1, -2], [-1, 1, -1]], [[-2, 2, -2], [-2, 3, -2]]]), new VA("8b7023471502607ef19109760bee3b954ea3b3883c32f3960f75c6651c912ffd",LA.WallTrack,Mb.WallTrackFloor,[["WallTrack", "WallTrackFloor"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("59e7f31827236c71db8b16f3f1f259c4c82c87a37e4d57a5a097c0d527d128f3",LA.WallTrack,Mb.WallTrackFloorCorner,[["WallTrack", "WallTrackFloorCorner"]],WA,[[[-2, 0, 1], [1, 0, 1]], [[0, 0, 0], [1, 0, 0]], [[1, 0, -2], [1, 0, -1]]]), new VA("d58e3805b550b70940c845a807086865b21a4c36da74ffddedcfe5ce2d08e093",LA.WallTrack,Mb.WallTrackFloorPlaneCorner,[["WallTrack", "WallTrackFloorPlaneCorner"]],WA,[[[-2, 0, 1], [1, 0, 1]], [[0, 0, 0], [1, 0, 0]], [[1, 0, -2], [1, 0, -1]]]), new VA("a56b0c1cf964b213a38167cbbac6f33acd403978ad75746eb51bcfd8c6a36148",LA.WallTrack,Mb.WallTrackCeiling,[["WallTrack", "WallTrackCeiling"]],WA,[[[-2, 0, -2], [1, 0, 1]]]), new VA("f87b592d02120312e8e93d8a27c02dcda1095ac2f09879c6efafb2ca2b49d127",LA.WallTrack,Mb.WallTrackCeilingCorner,[["WallTrack", "WallTrackCeilingCorner"]],WA,[[[-2, 0, 1], [1, 0, 1]], [[0, 0, 0], [1, 0, 0]], [[1, 0, -2], [1, 0, -1]]]), new VA("cfce1fe50f8cd26393eadd475783830e02f0b39bad4c0e00f7aa69614b22decc",LA.WallTrack,Mb.WallTrackCeilingPlaneCorner,[["WallTrack", "WallTrackCeilingPlaneCorner"]],WA,[[[-2, 0, 1], [1, 0, 1]], [[0, 0, 0], [1, 0, 0]], [[1, 0, -2], [1, 0, -1]]]), new VA("19656d02145f1a4ba07dbf2f236f865d34c86f823741b247b5d444a36d61c316",LA.Pillar,Mb.PillarTop,[["Pillar", "PillarTop"]],WA,[[[-1, 0, -1], [0, 0, 0]]]), new VA("dde596d55ffc00f0f00d361667239d9f71c414f03304fecb6a7d11f6f5e702f1",LA.Pillar,Mb.PillarMiddle,[["Pillar", "PillarMiddle"]],WA,[[[-1, 0, -1], [0, 0, 0]]]), new VA("dced5202d9373f9dd81a39530a87a1a7036c93ae71604a4e26c3a191abf3c197",LA.Pillar,Mb.PillarBottom,[["Pillar", "PillarBottom"]],WA,[[[-1, 0, -1], [0, 0, 0]]]), new VA("af83eebf50c302880377e4f8c1fb3b2ef96ae193e8d03c17e1fd77c73a847e63",LA.Pillar,Mb.PillarShort,[["Pillar", "PillarShort"]],WA,[[[-1, 0, -1], [0, 0, 0]]]), new VA("25b41116fb04b1f3cdd3119f57e0000a6ea8cb12d435718ffd6bb765866c272f",LA.Pillar,Mb.PillarBranch1,[["Pillar", "PillarBranch1"]],WA,[[[-1, 0, -2], [0, 0, 0]]]), new VA("05ae39aea4f1ddd818fa57860e688c9cb875544f9b82eafe58a2eb9c19d8d91d",LA.Pillar,Mb.PillarBranch1Top,[["Pillar", "PillarBranch1Top"]],WA,[[[-1, 0, -2], [0, 0, 0]]]), new VA("06c29d92e42e0c32050af98d69eecc94ce15adf8ac81dbe53dfb577a83265f4e",LA.Pillar,Mb.PillarBranch1Middle,[["Pillar", "PillarBranch1Middle"]],WA,[[[-1, 0, -2], [0, 0, 0]]]), new VA("4a989027e0bd6db264f092bac729d9d450e012a710ea28d199f7ff52efd70fbd",LA.Pillar,Mb.PillarBranch1Bottom,[["Pillar", "PillarBranch1Bottom"]],WA,[[[-1, 0, -2], [0, 0, 0]]]), new VA("78b2ff83ad71e7f3d692abc35923fa20c2ae14c01e37d44ec430746ca1bac992",LA.Pillar,Mb.PillarBranch2,[["Pillar", "PillarBranch2"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]]]), new VA("b22c93bc73ec2da9dbff218da1676d7436527ed284e264f37294e48ef1307301",LA.Pillar,Mb.PillarBranch2Top,[["Pillar", "PillarBranch2Top"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]]]), new VA("79a456a8fa3da24bec6c033f6c736fa1c728745f9624ae78ca20b6a4a76afae8",LA.Pillar,Mb.PillarBranch2Middle,[["Pillar", "PillarBranch2Middle"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]]]), new VA("3b81b3f965cbc9fda4fe09e830ba25f1b96ce512d87b0146a1192a6cd0d07335",LA.Pillar,Mb.PillarBranch2Bottom,[["Pillar", "PillarBranch2Bottom"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]]]), new VA("27727678bbcac9d3b0172b165ca5c92b10f4b4584a3a18fef4c542f3e791f26f",LA.Pillar,Mb.PillarBranch3,[["Pillar", "PillarBranch3"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]]]), new VA("50c7ac511d30ab9e065c928b776652f038be7683d948082bbefc419ee049e505",LA.Pillar,Mb.PillarBranch3Top,[["Pillar", "PillarBranch3Top"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]]]), new VA("98b3bfe99e7132825f5aa93122e4e5fdec46eb2877c8eb91fa2648f709527b60",LA.Pillar,Mb.PillarBranch3Middle,[["Pillar", "PillarBranch3Middle"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]]]), new VA("7326bbb558f8bcc28d5875c43b1b8e3646caadb873a14fde3ab517f779aea345",LA.Pillar,Mb.PillarBranch3Bottom,[["Pillar", "PillarBranch3Bottom"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]]]), new VA("0e23c2615cfdb350bb3a700b6169589265a1d1079f61294fb497b8f80191d523",LA.Pillar,Mb.PillarBranch4,[["Pillar", "PillarBranch4"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]], [[-1, 0, 1], [0, 0, 1]]]), new VA("e62b55e111dbcb3faefed0a203eac5b55051a2b11911946660310e3df3588da3",LA.Pillar,Mb.PillarBranch4Top,[["Pillar", "PillarBranch4Top"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]], [[-1, 0, 1], [0, 0, 1]]]), new VA("4e2cfb89c1c591803a1440532a74c3ace37ec7fe78a526c1b57f6679c620df2e",LA.Pillar,Mb.PillarBranch4Middle,[["Pillar", "PillarBranch4Middle"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]], [[-1, 0, 1], [0, 0, 1]]]), new VA("e7807350788e4570c8bb74d4a635639ef731d83e52922fac5bc10f415f73f794",LA.Pillar,Mb.PillarBranch4Bottom,[["Pillar", "PillarBranch4Bottom"]],WA,[[[-1, 0, -2], [0, 0, 0]], [[1, 0, -1], [1, 0, 0]], [[-2, 0, -1], [-2, 0, 0]], [[-1, 0, 1], [0, 0, 1]]]), new VA("836bfd12791bfebd99aba70531da4c9bd6e332d16c1e120a8888ea54f59456f9",LA.Pillar,Mb.PillarBranch5,[["Pillar", "PillarBranch5"]],WA,[[[-2, 0, -1], [1, 0, 0]]]), new VA("ab85228116faf9ae7b1e6cb4a03530cbec808df3d3c1d7883eb41eb7cfe231d7",LA.Pillar,Mb.PillarBranch5Top,[["Pillar", "PillarBranch5Top"]],WA,[[[-2, 0, -1], [1, 0, 0]]]), new VA("db93d5cea4e523fd67a56f8d928084ab6355331a8e5d1899115c1841866006bb",LA.Pillar,Mb.PillarBranch5Middle,[["Pillar", "PillarBranch5Middle"]],WA,[[[-2, 0, -1], [1, 0, 0]]]), new VA("dd793efa234159e3a0ff28b064ecb715e6c8bb76e06acfe4bd0d9a2f2b9bba88",LA.Pillar,Mb.PillarBranch5Bottom,[["Pillar", "PillarBranch5Bottom"]],WA,[[[-2, 0, -1], [1, 0, 0]]]), new VA("350f7d3591ffd0b2cfb8204d1c6cd0022fd3bda81ea7e950fce3abea7ec89e1a",LA.Sign,Mb.SignArrowLeft,[["Signs", "SignArrowRight", {
            flipX: !0
        }]],WA,[[[-2, 0, -2], [1, 0, -2]]]), new VA("22e104e58bba0a609d379578e391ce50ca523c9eee1c3fddebb6d1bb2246a0b9",LA.Sign,Mb.SignArrowRight,[["Signs", "SignArrowRight"]],WA,[[[-2, 0, -2], [1, 0, -2]]]), new VA("acba0cfe380e625285b973e09344e61740e77d6f8cac8691ef3e0a0b0878040e",LA.Sign,Mb.SignArrowUp,[["Signs", "SignArrowUp"]],WA,[[[-2, 0, -2], [1, 0, -2]]]), new VA("8d0dbea0a26bdf3addd372f5d9a2fdecfd776a48f31218acdeb036129b248ca5",LA.Sign,Mb.SignArrowDown,[["Signs", "SignArrowUp", {
            flipY: !0
        }]],WA,[[[-2, 0, -2], [1, 0, -2]]]), new VA("e5e1b1ca69d7b230331171be07876c4b1bdebba557c19b18ab17d91eee2771d5",LA.Sign,Mb.SignWarning,[["Signs", "SignWarning"]],WA,[[[-2, 0, -2], [1, 0, -2]]]), new VA("64ed1fba4990a25bc774575ff8835117638d2c3e7c8f41bf0032d219e1083e4c",LA.Sign,Mb.SignWrongWay,[["Signs", "SignWrongWay"]],WA,[[[-2, 0, -2], [1, 0, -2]]])]
          , jA = new Map;
        for (const e of GA) {
            if (jA.has(e.id))
                throw new Error("Duplicate track part id " + e.id.toString());
            jA.set(e.id, e)
        }
        function QA(e) {
            const t = jA.get(e);
            if (null == t)
                throw new Error("Unknown track part id " + e.toString());
            return t
        }
        const KA = GA.filter((e => {
            var t;
            return (null === (t = e.detector) || void 0 === t ? void 0 : t.type) == NA.Checkpoint
        }
        )).map((e => e.id))
          , qA = GA.filter((e => null != e.startOffset)).map((e => e.id));
        function YA(e) {
            const t = e.parts;
            if ("object" != typeof t && null !== t && !Array.isArray(t))
                return null;
            const n = new hx(IA.Summer,new CA)
              , i = Object.keys(t);
            for (const e of i) {
                const i = parseInt(e, 10);
                if (!(i in Mb))
                    return null;
                {
                    const e = t[i];
                    if (!Array.isArray(e))
                        return null;
                    if (e.length % 4 != 0)
                        return null;
                    for (let t = 0; t < e.length; t += 4) {
                        const r = parseInt(e[t + 0], 10)
                          , a = parseInt(e[t + 1], 10)
                          , s = parseInt(e[t + 2], 10)
                          , o = parseInt(e[t + 3], 10);
                        if (isNaN(r) || isNaN(a) || isNaN(s) || isNaN(o))
                            return null;
                        if (!(o >= 0 && o <= 3 && Math.abs(r) <= 1e9 && a >= 0 && a <= 1e9 && Math.abs(s) <= 1e9))
                            return null;
                        {
                            if (KA.includes(i))
                                return null;
                            let e = null;
                            qA.includes(i) && (e = 0),
                            n.addPart(4 * r, a, 4 * s, i, o, Tb.YPositive, Eb.Default, null, e)
                        }
                    }
                }
            }
            return n
        }
        function XA(e) {
            let t, n;
            try {
                t = JSON.parse(e)
            } catch (e) {
                return console.warn(e),
                null
            }
            if ("string" != typeof t.name)
                return null;
            if ("string" != typeof t.track)
                return null;
            try {
                n = JSON.parse(t.track)
            } catch (e) {
                return console.warn(e),
                null
            }
            const i = YA(n);
            return null == i ? null : {
                trackMetadata: {
                    name: t.name,
                    author: null
                },
                trackData: i
            }
        }
        function ZA(e) {
            const t = wv(e);
            if (null == t)
                return null;
            const n = new hx(IA.Summer,new CA);
            let i = 0;
            for (; i < t.length; ) {
                if (t.length - i < 2)
                    return null;
                const e = t[i + 0] | t[i + 1] << 8;
                if (i += 2,
                !(e in Mb))
                    return null;
                if (t.length - i < 4)
                    return null;
                const r = t[i + 0] | t[i + 1] << 8 | t[i + 2] << 16 | t[i + 3] << 24;
                i += 4;
                for (let a = 0; a < r; ++a) {
                    if (t.length - i < 3)
                        return null;
                    const r = (t[i + 0] | t[i + 1] << 8 | t[i + 2] << 16) - Math.pow(2, 23);
                    if (i += 3,
                    t.length - i < 3)
                        return null;
                    const a = t[i + 0] | t[i + 1] << 8 | t[i + 2] << 16;
                    if (i += 3,
                    t.length - i < 3)
                        return null;
                    const s = (t[i + 0] | t[i + 1] << 8 | t[i + 2] << 16) - Math.pow(2, 23);
                    if (i += 3,
                    t.length - i < 1)
                        return null;
                    const o = 3 & t[i + 0];
                    if (i += 1,
                    o < 0 || o > 3)
                        return null;
                    if (KA.includes(e))
                        return null;
                    let l = null;
                    qA.includes(e) && (l = 0),
                    n.addPart(4 * r, a, 4 * s, e, o, Tb.YPositive, Eb.Default, null, l)
                }
            }
            return n
        }
        function JA(e) {
            const t = xA(e);
            if (null == t)
                return null;
            const n = new vv.Inflate;
            if (n.push(t, !0),
            n.err)
                return null;
            const i = n.result;
            if (!(i instanceof Uint8Array))
                return null;
            const r = new hx(IA.Summer,new CA);
            let a = 0;
            for (; a < i.length; ) {
                if (i.length - a < 2)
                    return null;
                const e = i[a + 0] | i[a + 1] << 8;
                if (a += 2,
                !(e in Mb))
                    return null;
                if (i.length - a < 4)
                    return null;
                const t = i[a + 0] | i[a + 1] << 8 | i[a + 2] << 16 | i[a + 3] << 24;
                a += 4;
                for (let n = 0; n < t; ++n) {
                    if (i.length - a < 3)
                        return null;
                    const t = (i[a + 0] | i[a + 1] << 8 | i[a + 2] << 16) - Math.pow(2, 23);
                    if (a += 3,
                    i.length - a < 3)
                        return null;
                    const n = i[a + 0] | i[a + 1] << 8 | i[a + 2] << 16;
                    if (a += 3,
                    i.length - a < 3)
                        return null;
                    const s = (i[a + 0] | i[a + 1] << 8 | i[a + 2] << 16) - Math.pow(2, 23);
                    if (a += 3,
                    i.length - a < 1)
                        return null;
                    const o = i[a + 0];
                    if (a += 1,
                    o < 0 || o > 3)
                        return null;
                    let l = null;
                    if (KA.includes(e)) {
                        if (i.length - a < 2)
                            return null;
                        l = i[a + 0] | i[a + 1] << 8,
                        a += 2
                    }
                    let c = null;
                    qA.includes(e) && (c = 0),
                    r.addPart(4 * t, n, 4 * s, e, o, Tb.YPositive, Eb.Default, l, c)
                }
            }
            return r
        }
        function $A(e) {
            const t = xA(e);
            if (null == t)
                return null;
            const n = new vv.Inflate;
            if (n.push(t, !0),
            n.err)
                return null;
            const i = n.result;
            if (!(i instanceof Uint8Array))
                return null;
            const r = new hx(IA.Summer,new CA);
            let a = 0;
            for (; a < i.length; ) {
                if (i.length - a < 2)
                    return null;
                let e = i[a + 0] | i[a + 1] << 8;
                a += 2;
                let t = Eb.Default;
                if (e >= 134 && e <= 178)
                    switch (e) {
                    case 134:
                        e = Mb.Block,
                        t = Eb.Custom1;
                        break;
                    case 135:
                        e = Mb.HalfBlock,
                        t = Eb.Custom1;
                        break;
                    case 136:
                        e = Mb.QuarterBlock,
                        t = Eb.Custom1;
                        break;
                    case 137:
                        e = Mb.BlockSlopedDown,
                        t = Eb.Custom1;
                        break;
                    case 138:
                        e = Mb.BlockSlopedDownInnerCorner,
                        t = Eb.Custom1;
                        break;
                    case 139:
                        e = Mb.BlockSlopedDownOuterCorner,
                        t = Eb.Custom1;
                        break;
                    case 140:
                        e = Mb.BlockSlopedUp,
                        t = Eb.Custom1;
                        break;
                    case 141:
                        e = Mb.BlockSlopedUpInnerCorner,
                        t = Eb.Custom1;
                        break;
                    case 142:
                        e = Mb.BlockSlopedUpOuterCorner,
                        t = Eb.Custom1;
                        break;
                    case 143:
                        e = Mb.BlockSlopeDown,
                        t = Eb.Custom1;
                        break;
                    case 144:
                        e = Mb.BlockSlopeUp,
                        t = Eb.Custom1;
                        break;
                    case 145:
                        e = Mb.BlockBridge,
                        t = Eb.Custom1;
                        break;
                    case 146:
                        e = Mb.BlockBridgeCorner,
                        t = Eb.Custom1;
                        break;
                    case 147:
                        e = Mb.BlockBridgeIntersectionT,
                        t = Eb.Custom1;
                        break;
                    case 148:
                        e = Mb.BlockBridgeIntersectionCross,
                        t = Eb.Custom1;
                        break;
                    case 149:
                        e = Mb.Block,
                        t = Eb.Custom6;
                        break;
                    case 150:
                        e = Mb.HalfBlock,
                        t = Eb.Custom6;
                        break;
                    case 151:
                        e = Mb.QuarterBlock,
                        t = Eb.Custom6;
                        break;
                    case 152:
                        e = Mb.BlockSlopedDown,
                        t = Eb.Custom6;
                        break;
                    case 153:
                        e = Mb.BlockSlopedDownInnerCorner,
                        t = Eb.Custom6;
                        break;
                    case 154:
                        e = Mb.BlockSlopedDownOuterCorner,
                        t = Eb.Custom6;
                        break;
                    case 155:
                        e = Mb.BlockSlopedUp,
                        t = Eb.Custom6;
                        break;
                    case 156:
                        e = Mb.BlockSlopedUpInnerCorner,
                        t = Eb.Custom6;
                        break;
                    case 157:
                        e = Mb.BlockSlopedUpOuterCorner,
                        t = Eb.Custom6;
                        break;
                    case 158:
                        e = Mb.BlockSlopeDown,
                        t = Eb.Custom6;
                        break;
                    case 159:
                        e = Mb.BlockSlopeUp,
                        t = Eb.Custom6;
                        break;
                    case 160:
                        e = Mb.BlockBridge,
                        t = Eb.Custom6;
                        break;
                    case 161:
                        e = Mb.BlockBridgeCorner,
                        t = Eb.Custom6;
                        break;
                    case 162:
                        e = Mb.BlockBridgeIntersectionT,
                        t = Eb.Custom6;
                        break;
                    case 163:
                        e = Mb.BlockBridgeIntersectionCross,
                        t = Eb.Custom6;
                        break;
                    case 164:
                        e = Mb.Block,
                        t = Eb.Custom0;
                        break;
                    case 165:
                        e = Mb.HalfBlock,
                        t = Eb.Custom0;
                        break;
                    case 166:
                        e = Mb.QuarterBlock,
                        t = Eb.Custom0;
                        break;
                    case 167:
                        e = Mb.BlockSlopedDown,
                        t = Eb.Custom0;
                        break;
                    case 168:
                        e = Mb.BlockSlopedDownInnerCorner,
                        t = Eb.Custom0;
                        break;
                    case 169:
                        e = Mb.BlockSlopedDownOuterCorner,
                        t = Eb.Custom0;
                        break;
                    case 170:
                        e = Mb.BlockSlopedUp,
                        t = Eb.Custom0;
                        break;
                    case 171:
                        e = Mb.BlockSlopedUpInnerCorner,
                        t = Eb.Custom0;
                        break;
                    case 172:
                        e = Mb.BlockSlopedUpOuterCorner,
                        t = Eb.Custom0;
                        break;
                    case 173:
                        e = Mb.BlockSlopeDown,
                        t = Eb.Custom0;
                        break;
                    case 174:
                        e = Mb.BlockSlopeUp,
                        t = Eb.Custom0;
                        break;
                    case 175:
                        e = Mb.BlockBridge,
                        t = Eb.Custom0;
                        break;
                    case 176:
                        e = Mb.BlockBridgeCorner,
                        t = Eb.Custom0;
                        break;
                    case 177:
                        e = Mb.BlockBridgeIntersectionT,
                        t = Eb.Custom0;
                        break;
                    case 178:
                        e = Mb.BlockBridgeIntersectionCross,
                        t = Eb.Custom0
                    }
                let n = null
                  , s = {
                    x: 0,
                    y: 0,
                    z: 0
                };
                if (79 == e)
                    n = Mb.WallTrackFloorPlaneCorner;
                else if (81 == e)
                    n = Mb.WallTrackCeilingPlaneCorner,
                    s = {
                        x: 0,
                        y: 3,
                        z: 0
                    };
                else if (e >= 87 && e <= 98)
                    switch (e) {
                    case 87:
                        e = Mb.Slope,
                        n = Mb.BlockSlopedUp;
                        break;
                    case 88:
                        e = Mb.SlopeUp,
                        n = Mb.BlockSlopeUp;
                        break;
                    case 89:
                        e = Mb.SlopeDown,
                        n = Mb.BlockSlopeDown;
                        break;
                    case 90:
                        e = Mb.SlopeUpLeftWide,
                        n = Mb.BlockSlopeUp;
                        break;
                    case 91:
                        e = Mb.SlopeUpRightWide,
                        n = Mb.BlockSlopeUp;
                        break;
                    case 92:
                        e = Mb.SlopeDownLeftWide,
                        n = Mb.BlockSlopeDown;
                        break;
                    case 93:
                        e = Mb.SlopeDownRightWide,
                        n = Mb.BlockSlopeDown;
                        break;
                    case 94:
                        e = Mb.SlopeLeftWide,
                        n = Mb.BlockSlopedUp;
                        break;
                    case 95:
                        e = Mb.SlopeRightWide,
                        n = Mb.BlockSlopedUp;
                        break;
                    case 96:
                        e = Mb.PlaneSlopeUp,
                        n = Mb.BlockSlopeUp;
                        break;
                    case 97:
                        e = Mb.PlaneSlopeDown,
                        n = Mb.BlockSlopeDown;
                        break;
                    case 98:
                        e = Mb.PlaneSlope,
                        n = Mb.BlockSlopedUp;
                        break;
                    default:
                        throw new Error("Invalid track part id")
                    }
                if (!(e in Mb))
                    return null;
                if (i.length - a < 4)
                    return null;
                const o = i[a + 0] | i[a + 1] << 8 | i[a + 2] << 16 | i[a + 3] << 24;
                a += 4;
                for (let l = 0; l < o; ++l) {
                    if (i.length - a < 3)
                        return null;
                    const o = (i[a + 0] | i[a + 1] << 8 | i[a + 2] << 16) - Math.pow(2, 23);
                    if (a += 3,
                    i.length - a < 3)
                        return null;
                    const l = i[a + 0] | i[a + 1] << 8 | i[a + 2] << 16;
                    if (a += 3,
                    i.length - a < 3)
                        return null;
                    const c = (i[a + 0] | i[a + 1] << 8 | i[a + 2] << 16) - Math.pow(2, 23);
                    if (a += 3,
                    i.length - a < 1)
                        return null;
                    const h = i[a + 0];
                    if (a += 1,
                    h < 0 || h > 3)
                        return null;
                    let d = null;
                    if (KA.includes(e)) {
                        if (i.length - a < 2)
                            return null;
                        d = i[a + 0] | i[a + 1] << 8,
                        a += 2
                    }
                    let u = null;
                    qA.includes(e) && (u = 0),
                    null != n && r.addPart(4 * o + s.x, l + s.y, 4 * c + s.z, n, h, Tb.YPositive, Eb.Default, null, u),
                    r.addPart(4 * o, l, 4 * c, e, h, Tb.YPositive, t, d, u)
                }
            }
            return r
        }
        function ex(e, t) {
            let n = e;
            if (t.length - n < 1)
                return null;
            const i = t[n];
            if (n += 1,
            !(i in IA))
                return null;
            if (t.length - n < 1)
                return null;
            const r = t[n];
            if (n += 1,
            !Number.isSafeInteger(r) || r < 0 || r >= 180)
                return null;
            const a = new hx(i,new CA(r));
            if (t.length - n < 9)
                return null;
            const s = t[n] | t[n + 1] << 8 | t[n + 2] << 16 | t[n + 3] << 24;
            n += 4;
            const o = t[n] | t[n + 1] << 8 | t[n + 2] << 16 | t[n + 3] << 24;
            n += 4;
            const l = t[n] | t[n + 1] << 8 | t[n + 2] << 16 | t[n + 3] << 24;
            n += 4;
            const c = 3 & t[n]
              , h = t[n] >> 2 & 3
              , d = t[n] >> 4 & 3;
            if (n += 1,
            c < 1 || c > 4 || h < 1 || h > 4 || d < 1 || d > 4)
                return null;
            for (; n < t.length; ) {
                if (t.length - n < 1)
                    return null;
                const e = t[n + 0];
                if (n += 1,
                !(e in Mb))
                    return null;
                if (t.length - n < 4)
                    return null;
                const i = t[n + 0] | t[n + 1] << 8 | t[n + 2] << 16 | t[n + 3] << 24;
                n += 4;
                for (let r = 0; r < i; ++r) {
                    if (t.length - n < c)
                        return null;
                    let i = 0;
                    for (let e = 0; e < c; ++e)
                        i |= t[n + e] << 8 * e;
                    if (i += s,
                    n += c,
                    t.length - n < h)
                        return null;
                    let r = 0;
                    for (let e = 0; e < h; ++e)
                        r |= t[n + e] << 8 * e;
                    if (r += o,
                    n += h,
                    t.length - n < d)
                        return null;
                    let u = 0;
                    for (let e = 0; e < d; ++e)
                        u |= t[n + e] << 8 * e;
                    if (u += l,
                    n += d,
                    t.length - n < 1)
                        return null;
                    const p = t[n + 0];
                    if (n += 1,
                    p < 0 || p > 3)
                        return null;
                    if (t.length - n < 1)
                        return null;
                    const f = t[n + 0];
                    if (n += 1,
                    !(f in Tb))
                        return null;
                    if (t.length - n < 1)
                        return null;
                    const m = t[n + 0];
                    if (n += 1,
                    !(m in Eb))
                        return null;
                    let g = null;
                    if (KA.includes(e)) {
                        if (t.length - n < 2)
                            return null;
                        g = t[n + 0] | t[n + 1] << 8,
                        n += 2
                    }
                    let v = null;
                    if (qA.includes(e)) {
                        if (t.length - n < 4)
                            return null;
                        v = t[n + 0] | t[n + 1] << 8 | t[n + 2] << 16 | t[n + 3] << 24,
                        n += 4
                    }
                    a.addPart(i, r, u, e, p, f, m, g, v)
                }
            }
            return a
        }
        const tx = [[new yn(0,0,0,1), new yn(0,.7071067811865475,0,.7071067811865476), new yn(0,1,0,0), new yn(0,.7071067811865476,0,-.7071067811865475)], [new yn(0,0,1,0), new yn(.7071067811865475,0,.7071067811865476,0), new yn(1,0,0,0), new yn(.7071067811865476,0,-.7071067811865475,0)], [new yn(0,0,-.7071067811865477,.7071067811865475), new yn(.5,.5,-.5,.5), new yn(.7071067811865475,.7071067811865477,0,0), new yn(.5,.5,.5,-.5)], [new yn(0,0,.7071067811865475,.7071067811865476), new yn(.5,-.5,.5,.5), new yn(.7071067811865476,-.7071067811865475,0,0), new yn(.5,-.5,-.5,-.5)], [new yn(.7071067811865475,0,0,.7071067811865476), new yn(.5,.5,.5,.5), new yn(0,.7071067811865476,.7071067811865475,0), new yn(-.5,.5,.5,-.5)], [new yn(-.7071067811865477,0,0,.7071067811865475), new yn(-.5,-.5,.5,.5), new yn(0,-.7071067811865475,.7071067811865477,0), new yn(.5,-.5,.5,-.5)]];
        function nx(e, t) {
            return tx[t][e].clone()
        }
        var ix, rx, ax, sx, ox, lx = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, cx = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        rx = new WeakMap,
        ax = new WeakMap,
        ix = new WeakSet,
        sx = function() {
            let e = -1 / 0
              , t = null;
            for (const [n,i] of cx(this, ax, "f")) {
                const r = QA(n).startOffset;
                if (i.length > 0 && null != r)
                    for (const n of i) {
                        if (null == n.startOrder)
                            throw new Error("Start part has no start order");
                        n.startOrder >= e && (e = n.startOrder,
                        t = {
                            part: n,
                            startOffset: r
                        })
                    }
            }
            return null != t ? {
                x: t.part.x,
                y: t.part.y,
                z: t.part.z,
                rotation: t.part.rotation,
                rotationAxis: t.part.rotationAxis,
                startOffset: t.startOffset.clone()
            } : null
        }
        ,
        ox = function() {
            const e = [];
            e.push(this.environment),
            e.push(cx(this, rx, "f").representation);
            let t = 1 / 0
              , n = 1 / 0
              , i = 1 / 0
              , r = -1 / 0
              , a = -1 / 0
              , s = -1 / 0;
            for (const [,e] of cx(this, ax, "f"))
                for (const o of e)
                    t = Math.min(o.x, t),
                    n = Math.min(o.y, n),
                    i = Math.min(o.z, i),
                    r = Math.max(o.x, r),
                    a = Math.max(o.y, a),
                    s = Math.max(o.z, s);
            Number.isFinite(t) && Number.isFinite(n) && Number.isFinite(i) && Number.isFinite(r) && Number.isFinite(a) && Number.isFinite(s) || (t = 0,
            n = 0,
            i = 0,
            r = 0,
            a = 0,
            s = 0);
            const o = r - t + 1
              , l = a - n + 1
              , c = s - i + 1
              , h = Math.max(1, Math.min(4, Math.ceil(Math.log2(o + 1) / 8)))
              , d = Math.max(1, Math.min(4, Math.ceil(Math.log2(l + 1) / 8)))
              , u = Math.max(1, Math.min(4, Math.ceil(Math.log2(c + 1) / 8)));
            e.push(255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & n, n >>> 8 & 255, n >>> 16 & 255, n >>> 24 & 255, 255 & i, i >>> 8 & 255, i >>> 16 & 255, i >>> 24 & 255, 255 & (h | d << 2 | u << 4));
            for (const [r,a] of cx(this, ax, "f")) {
                if (r < 0 || r > 255)
                    throw new Error("Type id is out of range");
                const s = a.length;
                e.push(255 & r, 255 & s, s >>> 8 & 255, s >>> 16 & 255, s >>> 24 & 255);
                for (const s of a) {
                    const a = s.x - t
                      , o = s.y - n
                      , l = s.z - i;
                    if (1 == h ? e.push(255 & a) : 2 == h ? e.push(255 & a, a >>> 8 & 255) : 3 == h ? e.push(255 & a, a >>> 8 & 255, a >>> 16 & 255) : 4 == h && e.push(255 & a, a >>> 8 & 255, a >>> 16 & 255, a >>> 24 & 255),
                    1 == d ? e.push(255 & o) : 2 == d ? e.push(255 & o, o >>> 8 & 255) : 3 == d ? e.push(255 & o, o >>> 8 & 255, o >>> 16 & 255) : 4 == d && e.push(255 & o, o >>> 8 & 255, o >>> 16 & 255, o >>> 24 & 255),
                    1 == u ? e.push(255 & l) : 2 == u ? e.push(255 & l, l >>> 8 & 255) : 3 == u ? e.push(255 & l, l >>> 8 & 255, l >>> 16 & 255) : 4 == u && e.push(255 & l, l >>> 8 & 255, l >>> 16 & 255, l >>> 24 & 255),
                    e.push(3 & s.rotation, 7 & s.rotationAxis, 255 & s.color),
                    KA.includes(r)) {
                        if (null == s.checkpointOrder)
                            throw new Error("Checkpoint has no checkpoint order");
                        e.push(255 & s.checkpointOrder, s.checkpointOrder >>> 8 & 255)
                    }
                    if (qA.includes(r)) {
                        if (null == s.startOrder)
                            throw new Error("Start has no start order");
                        e.push(255 & s.startOrder, s.startOrder >>> 8 & 255, s.startOrder >>> 16 & 255, s.startOrder >>> 24 & 255)
                    }
                }
            }
            return new Uint8Array(e)
        }
        ;
        const hx = class {
            constructor(e, t) {
                ix.add(this),
                rx.set(this, void 0),
                ax.set(this, new Map),
                this.environment = e,
                lx(this, rx, t.clone(), "f")
            }
            get sunDirection() {
                return cx(this, rx, "f").clone()
            }
            set sunDirection(e) {
                lx(this, rx, e.clone(), "f")
            }
            addPart(e, t, n, i, r, a, s, o, l) {
                const c = {
                    x: e,
                    y: t,
                    z: n,
                    rotation: r,
                    rotationAxis: a,
                    color: s,
                    checkpointOrder: o,
                    startOrder: l
                }
                  , h = cx(this, ax, "f").get(i);
                null != h ? h.push(c) : cx(this, ax, "f").set(i, [c])
            }
            forEachPart(e) {
                for (const [t,n] of cx(this, ax, "f"))
                    for (const i of n)
                        e(i.x, i.y, i.z, t, i.rotation, i.rotationAxis, i.color, i.checkpointOrder, i.startOrder)
            }
            getId() {
                return (0,
                wA.sha256)(cx(this, ix, "m", ox).call(this))
            }
            getBounds() {
                let e = 1 / 0
                  , t = 1 / 0
                  , n = -1 / 0
                  , i = -1 / 0;
                return this.forEachPart(( (r, a, s) => {
                    e = Math.min(r, e),
                    t = Math.min(s, t),
                    n = Math.max(r, n),
                    i = Math.max(s, i)
                }
                )),
                Number.isFinite(e) && Number.isFinite(t) && Number.isFinite(n) && Number.isFinite(i) ? {
                    min: new Qt(e,t),
                    max: new Qt(n,i)
                } : {
                    min: new Qt,
                    max: new Qt
                }
            }
            hasStartingPoint() {
                return null != cx(this, ix, "m", sx).call(this)
            }
            getStartTransform() {
                const e = cx(this, ix, "m", sx).call(this);
                if (null != e) {
                    const t = nx(e.rotation, e.rotationAxis).multiply((new yn).setFromEuler(new si(0,Math.PI,0)))
                      , n = e.startOffset;
                    return n.applyQuaternion(t),
                    {
                        position: new bn(e.x * Px.partSize + n.x,e.y * Px.partSize + n.y,e.z * Px.partSize + n.z),
                        quaternion: t
                    }
                }
                return null
            }
            toSaveString() {
                const e = cx(this, ix, "m", ox).call(this)
                  , t = new vv.Deflate({
                    level: 9,
                    windowBits: 9,
                    memLevel: 9
                });
                t.push(e, !0);
                const n = AA(t.result)
                  , i = new vv.Deflate({
                    level: 9,
                    windowBits: 15,
                    memLevel: 9
                });
                return i.push(n, !0),
                AA(i.result)
            }
            toExportString(e) {
                const t = (new TextEncoder).encode(e.name);
                let n, i;
                null != e.author ? (i = (new TextEncoder).encode(e.author),
                n = i.length) : (i = null,
                n = 0);
                const r = new Uint8Array(1 + t.length + 1 + n);
                r[0] = t.length,
                r.set(t, 1),
                r[1 + t.length] = n,
                null != i && r.set(i, 1 + t.length + 1);
                const a = cx(this, ix, "m", ox).call(this)
                  , s = new vv.Deflate({
                    level: 9,
                    windowBits: 9,
                    memLevel: 9
                });
                s.push(r, !1),
                s.push(a, !0);
                const o = AA(s.result)
                  , l = new vv.Deflate({
                    level: 9,
                    windowBits: 15,
                    memLevel: 9
                });
                return l.push(o, !0),
                "PolyTrack1" + AA(l.result)
            }
            static fromSaveString(e) {
                const t = function(e) {
                    const t = xA(e);
                    if (null == t)
                        return null;
                    const n = new vv.Inflate({
                        to: "string"
                    });
                    if (n.push(t, !0),
                    n.err)
                        return null;
                    const i = n.result;
                    if ("string" != typeof i)
                        return null;
                    const r = xA(i);
                    if (null == r)
                        return null;
                    const a = new vv.Inflate;
                    if (a.push(r, !0),
                    a.err)
                        return null;
                    const s = a.result;
                    return s instanceof Uint8Array ? ex(0, s) : null
                }(e);
                if (null != t)
                    return t;
                const n = $A(e);
                if (null != n)
                    return n;
                const i = JA(e);
                if (null != i)
                    return i;
                const r = ZA(e);
                if (null != r)
                    return r;
                const a = YA(e);
                return null != a ? a : null
            }
            static fromExportString(e) {
                const t = e.replace(/\s+/g, "")
                  , n = function(e) {
                    const t = "PolyTrack1";
                    if (!e.startsWith(t))
                        return null;
                    const n = xA(e.substring(10));
                    if (null == n)
                        return null;
                    const i = new vv.Inflate({
                        to: "string"
                    });
                    if (i.push(n, !0),
                    i.err)
                        return null;
                    const r = i.result;
                    if ("string" != typeof r)
                        return null;
                    const a = xA(r);
                    if (null == a)
                        return null;
                    const s = new vv.Inflate;
                    if (s.push(a, !0),
                    s.err)
                        return null;
                    const o = s.result;
                    if (!(o instanceof Uint8Array))
                        return null;
                    const l = o[0];
                    if (o.length < 1 + l)
                        return null;
                    const c = new TextDecoder("utf-8").decode(o.subarray(1, 1 + l))
                      , h = o[1 + l];
                    if (o.length < 1 + l + 1 + h)
                        return null;
                    let d;
                    d = h > 0 ? new TextDecoder("utf-8").decode(o.subarray(1 + l + 1, 1 + l + 1 + h)) : null;
                    const u = ex(1 + l + 1 + h, o);
                    return null == u ? null : {
                        trackMetadata: {
                            name: c,
                            author: d
                        },
                        trackData: u
                    }
                }(t);
                if (null != n)
                    return n;
                const i = function(e) {
                    if (!e.startsWith("v3"))
                        return null;
                    const t = xA(e.substring(2, 4));
                    if (null == t)
                        return null;
                    if (1 != t.length)
                        return null;
                    const n = t[0]
                      , i = xA(e.substring(4, 4 + n));
                    if (null == i)
                        return null;
                    let r;
                    try {
                        r = new TextDecoder("utf-8").decode(i)
                    } catch (e) {
                        return null
                    }
                    const a = $A(e.substring(4 + n));
                    return null == a ? null : {
                        trackMetadata: {
                            name: r,
                            author: null
                        },
                        trackData: a
                    }
                }(t);
                if (null != i)
                    return i;
                const r = function(e) {
                    if (!e.startsWith("v2"))
                        return null;
                    const t = xA(e.substring(2, 4));
                    if (null == t)
                        return null;
                    if (1 != t.length)
                        return null;
                    const n = t[0]
                      , i = Math.ceil(n / 3 * 4)
                      , r = xA(e.substring(4, 4 + i));
                    if (null == r)
                        return null;
                    let a;
                    try {
                        a = new TextDecoder("utf-8").decode(r)
                    } catch (e) {
                        return null
                    }
                    const s = JA(e.substring(4 + i));
                    return null == s ? null : {
                        trackMetadata: {
                            name: a,
                            author: null
                        },
                        trackData: s
                    }
                }(t);
                if (null != r)
                    return r;
                const a = function(e) {
                    if (!e.startsWith("v1n"))
                        return null;
                    const t = wv(e.substring(3, 5));
                    if (null == t)
                        return null;
                    if (1 != t.length)
                        return null;
                    const n = t[0]
                      , i = e.substring(5, 5 + n);
                    let r;
                    try {
                        r = decodeURIComponent(i)
                    } catch (e) {
                        return console.warn(e),
                        null
                    }
                    const a = ZA(e.substring(5 + n));
                    return null == a ? null : {
                        trackMetadata: {
                            name: r,
                            author: null
                        },
                        trackData: a
                    }
                }(t);
                if (null != a)
                    return a;
                const s = XA(e);
                return null != s ? s : null
            }
            createThumbnail() {
                let e = 1 / 0
                  , t = 1 / 0
                  , n = -1 / 0
                  , i = -1 / 0;
                this.forEachPart(( (r, a, s, o, l, c) => {
                    QA(o).tiles.rotated(l, c).forEach(( (a, o, l) => {
                        e = Math.min(e, Math.floor((r + a - 2) / 4)),
                        t = Math.min(t, Math.floor((s + l - 2) / 4)),
                        n = Math.max(n, Math.floor((r + a - 2) / 4)),
                        i = Math.max(i, Math.floor((s + l - 2) / 4))
                    }
                    ))
                }
                )),
                Number.isFinite(e) && Number.isFinite(t) && Number.isFinite(n) && Number.isFinite(i) || (e = 0,
                t = 0,
                n = 0,
                i = 0);
                const r = 10
                  , a = n - e + 1;
                a <= r && (n += Math.ceil((r - a) / 2),
                e -= Math.ceil((r - a) / 2));
                const s = i - t + 1;
                s <= r && (i += Math.ceil((r - s) / 2),
                t -= Math.ceil((r - s) / 2));
                const o = document.createElement("canvas");
                o.width = Math.min(1024, n - e + 1),
                o.height = Math.min(1024, i - t + 1);
                const l = o.getContext("2d");
                if (null == l)
                    throw new Error("Failed to get canvas context");
                const c = l.createImageData(o.width, o.height)
                  , h = []
                  , d = []
                  , u = [];
                let p, f, m;
                switch (this.environment) {
                case IA.Summer:
                    p = 255,
                    f = 255,
                    m = 255;
                    break;
                case IA.Winter:
                    p = 190,
                    f = 216,
                    m = 247;
                    break;
                case IA.Desert:
                    p = 237,
                    f = 226,
                    m = 175
                }
                this.forEachPart(( (n, i, r, a, s, l) => {
                    const g = QA(a);
                    g.tiles.rotated(s, l).forEach(( (i, a, s) => {
                        const l = Math.floor((n + i - 2) / 4) - e
                          , v = Math.floor((r + s - 2) / 4) - t
                          , w = 4 * (l + v * o.width);
                        c.data[w + 0] = p,
                        c.data[w + 1] = f,
                        c.data[w + 2] = m,
                        c.data[w + 3] = 255,
                        null != g.startOffset ? d.push([l, v]) : null != g.detector && g.detector.type == NA.Checkpoint ? h.push([l, v]) : null != g.detector && g.detector.type == NA.Finish && u.push([l, v])
                    }
                    ))
                }
                ));
                for (const [e,t] of h)
                    c.data[4 * (e + t * o.width) + 0] = 226,
                    c.data[4 * (e + t * o.width) + 1] = 192,
                    c.data[4 * (e + t * o.width) + 2] = 38,
                    c.data[4 * (e + t * o.width) + 3] = 255;
                for (const [e,t] of d)
                    c.data[4 * (e + t * o.width) + 0] = 51,
                    c.data[4 * (e + t * o.width) + 1] = 140,
                    c.data[4 * (e + t * o.width) + 2] = 224,
                    c.data[4 * (e + t * o.width) + 3] = 255;
                for (const [e,t] of u)
                    c.data[4 * (e + t * o.width) + 0] = 209,
                    c.data[4 * (e + t * o.width) + 1] = 41,
                    c.data[4 * (e + t * o.width) + 2] = 41,
                    c.data[4 * (e + t * o.width) + 3] = 255;
                return l.putImageData(c, 0, 0),
                o
            }
        }
        ;
        class dx extends pa {
            constructor(e, t) {
                const n = new Qi({
                    color: t,
                    depthWrite: !1
                });
                super(e.geometry, n, e.count);
                for (let t = 0; t < e.count; ++t) {
                    const n = new Xn;
                    e.getMatrixAt(t, n),
                    this.setMatrixAt(t, n)
                }
                this.meshMatrix = e.matrixWorld,
                this.frustumCulled = !1,
                this.matrixAutoUpdate = !1,
                this.renderOrder = -1
            }
            update(e, t) {
                var n = new Xn
                  , i = e.normal.x * t.x + e.normal.y * t.y + e.normal.z * t.z + -e.constant * t.w
                  , r = n.elements;
                r[0] = i - t.x * e.normal.x,
                r[4] = -t.x * e.normal.y,
                r[8] = -t.x * e.normal.z,
                r[12] = -t.x * -e.constant,
                r[1] = -t.y * e.normal.x,
                r[5] = i - t.y * e.normal.y,
                r[9] = -t.y * e.normal.z,
                r[13] = -t.y * -e.constant,
                r[2] = -t.z * e.normal.x,
                r[6] = -t.z * e.normal.y,
                r[10] = i - t.z * e.normal.z,
                r[14] = -t.z * -e.constant,
                r[3] = -t.w * e.normal.x,
                r[7] = -t.w * e.normal.y,
                r[11] = -t.w * e.normal.z,
                r[15] = i - t.w * -e.constant,
                this.matrix.multiplyMatrices(n, this.meshMatrix)
            }
        }
        var ux, px, fx, mx, gx, vx, wx, yx, bx, Ax, xx, kx, Ex, Sx, Mx = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, _x = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class Tx {
            constructor(e, t, n, i, r, a, s, o, l, c) {
                if (this.checkpointOrder = null,
                this.startOrder = null,
                this.x = e,
                this.y = t,
                this.z = n,
                this.rotation = i,
                this.rotationAxis = r,
                this.color = a,
                this.type = s,
                this.matrix = o,
                this.checkpointOrder = l,
                this.startOrder = c,
                null != s.configuration.detector && s.configuration.detector.type == NA.Checkpoint) {
                    if (null == l)
                        throw new Error("Checkpoint has no checkpoint order")
                } else if (null != l)
                    throw new Error("Non-checkpoint has checkpoint order");
                if (null != s.configuration.startOffset && null == c)
                    throw new Error("Start part has no start order");
                if (null == s.configuration.startOffset && null != c)
                    throw new Error("Non-start part has start order")
            }
        }
        class Cx {
            constructor(e, t, n) {
                ux.add(this),
                px.set(this, void 0),
                fx.set(this, void 0),
                mx.set(this, void 0),
                this.environment = IA.Summer,
                gx.set(this, new CA),
                vx.set(this, []),
                wx.set(this, new Map),
                yx.set(this, new Map),
                bx.set(this, {
                    min: new Qt(0,0),
                    max: new Qt(0,0)
                }),
                Ax.set(this, null),
                xx.set(this, []),
                Mx(this, px, e, "f"),
                Mx(this, fx, t, "f"),
                Mx(this, mx, n, "f")
            }
            get sunDirection() {
                return _x(this, gx, "f")
            }
            set sunDirection(e) {
                Mx(this, gx, e.clone(), "f")
            }
            getID() {
                return _x(this, Ax, "f")
            }
            clear() {
                Mx(this, Ax, null, "f"),
                _x(this, vx, "f").length = 0,
                _x(this, wx, "f").clear(),
                _x(this, yx, "f").clear(),
                _x(this, ux, "m", kx).call(this)
            }
            getPartsAt(e, t, n) {
                const i = _x(this, wx, "f").get(e.toString() + "|" + t.toString() + "|" + n.toString());
                return null == i ? [] : i.map((e => ({
                    id: e.type.configuration.id,
                    x: e.x,
                    y: e.y,
                    z: e.z,
                    rotation: e.rotation,
                    rotationAxis: e.rotationAxis,
                    color: e.color,
                    checkpointOrder: e.checkpointOrder,
                    startOrder: e.startOrder
                })))
            }
            setPart(e, t, n, i, r, a, s, o, l) {
                const c = _x(this, mx, "f").getPart(i);
                if (s != Eb.Default && !c.colors.has(s))
                    throw new Error("Track part color does not exist");
                const h = nx(r, a)
                  , d = new bn(e * Cx.partSize,t * Cx.partSize,n * Cx.partSize)
                  , u = (new Xn).compose(d, h, new bn(1,1,1))
                  , p = new Tx(e,t,n,r,a,s,c,u,o,l);
                _x(this, vx, "f").push(p);
                c.configuration.tiles.rotated(r, a).forEach(( (i, r, a) => {
                    const s = (e + i).toString() + "|" + (t + r).toString() + "|" + (n + a).toString();
                    if (t + r < 0)
                        throw new Error("Track part below ground");
                    {
                        const e = _x(this, wx, "f").get(s);
                        null == e ? _x(this, wx, "f").set(s, [p]) : e.push(p)
                    }
                }
                ));
                const f = _x(this, yx, "f").get(i);
                null == f ? _x(this, yx, "f").set(i, [p]) : f.push(p)
            }
            deleteSpecificPart(e, t, n, i, r, a) {
                for (const s of _x(this, vx, "f"))
                    if (s.type.configuration.id == e && s.x == t && s.y == n && s.z == i && s.rotation == r && s.rotationAxis == a)
                        return _x(this, ux, "m", Ex).call(this, s),
                        !0;
                return !1
            }
            getBounds() {
                return _x(this, bx, "f")
            }
            generateMeshes() {
                _x(this, ux, "m", kx).call(this);
                const e = _x(this, gx, "f").getSunPosition()
                  , t = new fn(e.x,e.y,e.z,0);
                let n, i = null;
                if (2 == _x(this, fx, "f").getSettingInteger(el.ShadowQuality))
                    switch (this.environment) {
                    case IA.Summer:
                        i = new Hi(2511171);
                        break;
                    case IA.Winter:
                        i = new Hi(7904713);
                        break;
                    case IA.Desert:
                        i = new Hi(7958351)
                    }
                switch (this.environment) {
                case IA.Summer:
                    n = Eb.Summer;
                    break;
                case IA.Winter:
                    n = Eb.Winter;
                    break;
                case IA.Desert:
                    n = Eb.Desert
                }
                const r = _x(this, px, "f").isTrackShadowsEnabled();
                for (const e of _x(this, mx, "f").getAllParts())
                    for (const [a,s] of e.colors) {
                        const o = [];
                        for (const t of _x(this, vx, "f")) {
                            let i = t.color;
                            i == Eb.Default && (i = n),
                            t.type == e && i == a && o.push(t)
                        }
                        if (o.length > 0) {
                            if (null == s)
                                throw new Error("Mesh is not loaded");
                            const e = new pa(s.geometry,s.material,o.length);
                            e.frustumCulled = !1,
                            e.castShadow = r,
                            e.receiveShadow = !0;
                            for (let t = 0; t < o.length; ++t)
                                e.setMatrixAt(t, o[t].matrix);
                            if (_x(this, px, "f").scene.add(e),
                            _x(this, xx, "f").push(e),
                            null != i) {
                                const n = new dx(e,i);
                                n.update(new va(new bn(0,1,0),0), t),
                                _x(this, px, "f").scene.add(n),
                                _x(this, xx, "f").push(n)
                            }
                        }
                    }
                _x(this, ux, "m", Sx).call(this)
            }
            getCheckpoints() {
                let e = [];
                const t = _x(this, mx, "f").getPartTypesWithDetector(NA.Checkpoint);
                for (const n of t) {
                    const t = _x(this, yx, "f").get(n);
                    null != t && (e = e.concat(t))
                }
                return e.map((e => {
                    if (null == e.checkpointOrder)
                        throw new Error("Checkpoint has no checkpoint order");
                    if (null == e.type.configuration.detector)
                        throw new Error("Checkpoint has no detector");
                    return {
                        x: e.x,
                        y: e.y,
                        z: e.z,
                        rotation: e.rotation,
                        rotationAxis: e.rotationAxis,
                        type: e.type.configuration.id,
                        checkpointOrder: e.checkpointOrder,
                        detector: e.type.configuration.detector
                    }
                }
                ))
            }
            getCheckpointOrders() {
                let e = [];
                const t = _x(this, mx, "f").getPartTypesWithDetector(NA.Checkpoint);
                for (const n of t) {
                    const t = _x(this, yx, "f").get(n);
                    null != t && (e = e.concat(t))
                }
                return e.map((e => {
                    if (null == e.checkpointOrder)
                        throw new Error("Checkpoint has no checkpoint order");
                    if (null == e.type.configuration.detector)
                        throw new Error("Checkpoint has no detector");
                    return e.checkpointOrder
                }
                ))
            }
            getTotalNumberOfCheckpointIndices() {
                let e = [];
                const t = _x(this, mx, "f").getPartTypesWithDetector(NA.Checkpoint);
                for (const n of t) {
                    const t = _x(this, yx, "f").get(n);
                    null != t && (e = e.concat(t))
                }
                return e.map((e => e.checkpointOrder)).filter(( (e, t, n) => n.indexOf(e) == t)).length
            }
            getStart() {
                let e = -1 / 0
                  , t = null;
                for (const [n,i] of _x(this, yx, "f")) {
                    const r = _x(this, mx, "f").getPartStartOffset(n);
                    if (i.length > 0 && null != r)
                        for (const n of i) {
                            if (null == n.startOrder)
                                throw new Error("Start part has no start order");
                            n.startOrder >= e && (e = n.startOrder,
                            t = {
                                part: n,
                                startOffset: r
                            })
                        }
                }
                return null != t ? {
                    x: t.part.x,
                    y: t.part.y,
                    z: t.part.z,
                    rotation: t.part.rotation,
                    rotationAxis: t.part.rotationAxis,
                    startOffset: t.startOffset
                } : null
            }
            getStartTransform() {
                const e = this.getStart();
                if (null != e) {
                    const t = nx(e.rotation, e.rotationAxis).multiply((new yn).setFromEuler(new si(0,Math.PI,0)))
                      , n = e.startOffset;
                    return n.applyQuaternion(t),
                    {
                        position: new bn(e.x * Cx.partSize + n.x,e.y * Cx.partSize + n.y,e.z * Cx.partSize + n.z),
                        quaternion: t
                    }
                }
                return null
            }
            getNextStartOrder() {
                let e = 0;
                for (const [t,n] of _x(this, yx, "f")) {
                    const i = _x(this, mx, "f").getPartStartOffset(t);
                    if (n.length > 0 && null != i)
                        for (const t of n) {
                            if (null == t.startOrder)
                                throw new Error("Start part has no start order");
                            e = Math.max(e, t.startOrder + 1)
                        }
                }
                return e
            }
            getTrackData() {
                const e = new hx(this.environment,_x(this, gx, "f"));
                for (const t of _x(this, vx, "f"))
                    e.addPart(t.x, t.y, t.z, t.type.configuration.id, t.rotation, t.rotationAxis, t.color, t.checkpointOrder, t.startOrder);
                return e
            }
            loadTrackData(e, t=!0) {
                return this.clear(),
                Mx(this, Ax, t ? e.getId() : null, "f"),
                this.environment = e.environment,
                this.sunDirection = e.sunDirection.clone(),
                e.forEachPart(( (e, t, n, i, r, a, s, o, l) => {
                    this.setPart(e, t, n, i, r, a, s, o, l)
                }
                )),
                !0
            }
        }
        px = new WeakMap,
        fx = new WeakMap,
        mx = new WeakMap,
        gx = new WeakMap,
        vx = new WeakMap,
        wx = new WeakMap,
        yx = new WeakMap,
        bx = new WeakMap,
        Ax = new WeakMap,
        xx = new WeakMap,
        ux = new WeakSet,
        kx = function() {
            for (const e of _x(this, xx, "f"))
                _x(this, px, "f").scene.remove(e);
            _x(this, xx, "f").length = 0
        }
        ,
        Ex = function(e) {
            const t = _x(this, vx, "f").indexOf(e);
            if (!(t >= 0))
                throw new Error("Track part missing from parts list");
            _x(this, vx, "f").splice(t, 1);
            e.type.configuration.tiles.rotated(e.rotation, e.rotationAxis).forEach(( (t, n, i) => {
                const r = (e.x + t).toString() + "|" + (e.y + n).toString() + "|" + (e.z + i).toString()
                  , a = _x(this, wx, "f").get(r);
                if (null == a)
                    throw new Error("Track part section missing");
                {
                    const t = a.indexOf(e);
                    if (!(t >= 0))
                        throw new Error("Track part missing from parts by position map");
                    a.splice(t, 1),
                    0 == a.length && _x(this, wx, "f").delete(r)
                }
            }
            ));
            const n = _x(this, yx, "f").get(e.type.configuration.id);
            if (null == n)
                throw new Error("Track part type is missing from parts by type map");
            for (let t = 0; t < n.length; ++t) {
                if (n[t] == e) {
                    n.splice(t, 1);
                    break
                }
                if (t == n.length - 1)
                    throw new Error("Track part is missing from parts by type map")
            }
        }
        ,
        Sx = function() {
            let e = 1 / 0
              , t = 1 / 0
              , n = -1 / 0
              , i = -1 / 0;
            for (const r of _x(this, vx, "f"))
                e = Math.min(r.x, e),
                t = Math.min(r.z, t),
                n = Math.max(r.x, n),
                i = Math.max(r.z, i);
            Number.isFinite(e) && Number.isFinite(t) && Number.isFinite(n) && Number.isFinite(i) ? Mx(this, bx, {
                min: new Qt(e,t),
                max: new Qt(n,i)
            }, "f") : Mx(this, bx, {
                min: new Qt,
                max: new Qt
            }, "f")
        }
        ,
        Cx.partSize = 5;
        const Px = Cx;
        var Ix, Rx, Lx, Dx, Nx, Bx = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, Ux = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class zx {
            constructor(e) {
                Rx.set(this, void 0),
                Lx.set(this, []),
                Dx.set(this, []),
                Bx(this, Rx, e, "f")
            }
            dispose() {
                for (const e of Ux(this, Lx, "f")) {
                    if (Array.isArray(e.material))
                        for (const t of e.material)
                            t.dispose();
                    else
                        e.material.dispose();
                    e.geometry.dispose(),
                    Ux(this, Rx, "f").scene.remove(e)
                }
                Ux(this, Lx, "f").length = 0
            }
            refresh(e) {
                const t = e.getCheckpoints();
                let n = !1;
                if (t.length == Ux(this, Dx, "f").length)
                    for (let e = 0; e < t.length; e++) {
                        const i = t[e]
                          , r = Ux(this, Dx, "f")[e];
                        if (i.x != r.x || i.y != r.y || i.z != r.z || i.rotation != r.rotation || i.rotationAxis != r.rotationAxis || i.type != r.type || i.checkpointOrder != r.checkpointOrder) {
                            n = !0;
                            break
                        }
                    }
                else
                    n = !0;
                if (n) {
                    this.dispose(),
                    Bx(this, Dx, t, "f");
                    const e = new Qi({
                        color: 16777215
                    });
                    for (const n of t) {
                        if (null == Ux(Ix, Ix, "f", Nx))
                            throw new Error("Font is not loaded yet");
                        const t = nx(n.rotation, n.rotationAxis)
                          , i = new bn(...n.detector.center).add(new bn(0,-1.3,0)).applyQuaternion(t);
                        i.add(new bn(n.x * Px.partSize,n.y * Px.partSize,n.z * Px.partSize));
                        const r = Ux(Ix, Ix, "f", Nx).generateShapes((n.checkpointOrder + 1).toString(), 4)
                          , a = new Us(r);
                        a.computeBoundingBox();
                        const s = a.boundingBox;
                        if (null == s)
                            throw new Error("Bounding box is null");
                        const o = -.5 * (s.max.x - s.min.x);
                        a.translate(o, 0, 0);
                        const l = new yr(a,e);
                        l.position.copy(i),
                        l.quaternion.copy(t),
                        Ux(this, Rx, "f").scene.add(l),
                        Ux(this, Lx, "f").push(l);
                        const c = new yr(a,e);
                        c.position.copy(i),
                        c.quaternion.copy(t).multiply((new yn).setFromEuler(new si(0,Math.PI,0))),
                        Ux(this, Rx, "f").scene.add(c),
                        Ux(this, Lx, "f").push(c)
                    }
                }
            }
            static initResources(e) {
                e.addResource();
                (new mA).load("forced_square.json", (t => {
                    Bx(this, Ix, t, "f", Nx),
                    e.loadedResource()
                }
                ))
            }
        }
        Ix = zx,
        Rx = new WeakMap,
        Lx = new WeakMap,
        Dx = new WeakMap,
        Nx = {
            value: null
        };
        const Ox = zx;
        var Fx = i(8909)
          , Wx = {};
        Wx.styleTagTransform = u(),
        Wx.setAttributes = l(),
        Wx.insert = s().bind(null, "head"),
        Wx.domAPI = r(),
        Wx.insertStyleElement = h();
        t()(Fx.A, Wx);
        Fx.A && Fx.A.locals && Fx.A.locals;
        var Hx, Vx, Gx, jx, Qx, Kx, qx, Yx, Xx, Zx, Jx = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, $x = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        Vx = new WeakMap,
        Gx = new WeakMap,
        jx = new WeakMap,
        Qx = new WeakMap,
        Kx = new WeakMap,
        qx = new WeakMap,
        Yx = new WeakMap,
        Hx = new WeakSet,
        Xx = function() {
            $x(this, Kx, "f").textContent = $x(this, Gx, "f").get("Checkpoint order") + ": " + (this.checkpointOrder + 1).toString()
        }
        ,
        Zx = function(e) {
            const t = e.getCheckpointOrders()
              , n = new Set;
            for (const e of t)
                n.add(e);
            for (let e = 0; e < 65535; e++)
                if (!n.has(e))
                    return e;
            return 65535
        }
        ;
        const ek = class {
            constructor(e, t, n, i) {
                Hx.add(this),
                Vx.set(this, void 0),
                Gx.set(this, void 0),
                jx.set(this, void 0),
                Qx.set(this, void 0),
                Kx.set(this, void 0),
                qx.set(this, 0),
                Yx.set(this, void 0),
                Jx(this, Vx, e, "f"),
                Jx(this, Gx, t, "f"),
                Jx(this, jx, i, "f"),
                Jx(this, Qx, document.createElement("div"), "f"),
                $x(this, Qx, "f").className = "hidden",
                e.appendChild($x(this, Qx, "f")),
                $x(this, jx, "f").addChangeListener(Jx(this, Yx, (e => {
                    e ? $x(this, Qx, "f").classList.add("touch") : $x(this, Qx, "f").classList.remove("touch")
                }
                ), "f"));
                const r = document.createElement("div");
                r.className = "buttons",
                $x(this, Qx, "f").appendChild(r);
                const a = document.createElement("button");
                a.addEventListener("click", ( () => {
                    n.playUIClick(),
                    this.checkpointOrder++
                }
                )),
                a.addEventListener("contextmenu", (e => {
                    e.preventDefault()
                }
                )),
                r.appendChild(a);
                const s = document.createElement("img");
                s.src = "images/arrow_up.svg",
                a.appendChild(s);
                const o = document.createElement("button");
                o.addEventListener("click", ( () => {
                    n.playUIClick(),
                    this.checkpointOrder--
                }
                )),
                o.addEventListener("contextmenu", (e => {
                    e.preventDefault()
                }
                )),
                r.appendChild(o);
                const l = document.createElement("img");
                l.src = "images/arrow_down.svg",
                o.appendChild(l),
                Jx(this, Kx, document.createElement("p"), "f"),
                $x(this, Qx, "f").appendChild($x(this, Kx, "f")),
                $x(this, Hx, "m", Xx).call(this)
            }
            dispose() {
                $x(this, Vx, "f").removeChild($x(this, Qx, "f")),
                $x(this, jx, "f").removeChangeListener($x(this, Yx, "f"))
            }
            hide() {
                $x(this, Qx, "f").classList.add("hidden"),
                $x(this, Qx, "f").classList.remove("editor-checkpoint-order")
            }
            show() {
                $x(this, Qx, "f").classList.remove("hidden"),
                $x(this, Qx, "f").classList.add("editor-checkpoint-order")
            }
            reset() {
                this.checkpointOrder = 0
            }
            get checkpointOrder() {
                return $x(this, qx, "f")
            }
            set checkpointOrder(e) {
                Jx(this, qx, Math.max(0, Math.min(65535, e)), "f"),
                $x(this, Hx, "m", Xx).call(this)
            }
            setFromExistingCheckpoints(e) {
                this.checkpointOrder = $x(this, Hx, "m", Zx).call(this, e)
            }
        }
        ;
        var tk = i(5007)
          , nk = {};
        nk.styleTagTransform = u(),
        nk.setAttributes = l(),
        nk.insert = s().bind(null, "head"),
        nk.domAPI = r(),
        nk.insertStyleElement = h();
        t()(tk.A, nk);
        tk.A && tk.A.locals && tk.A.locals;
        var ik, rk, ak, sk, ok, lk, ck, hk, dk, uk = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, pk = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        ik = new WeakMap,
        rk = new WeakMap,
        ak = new WeakMap,
        sk = new WeakMap,
        ok = new WeakMap,
        lk = new WeakMap,
        ck = new WeakMap,
        hk = new WeakMap,
        dk = new WeakMap;
        const fk = class {
            constructor(e, t, n, i, r) {
                ik.set(this, void 0),
                rk.set(this, void 0),
                ak.set(this, void 0),
                sk.set(this, void 0),
                ok.set(this, void 0),
                lk.set(this, void 0),
                ck.set(this, !1),
                hk.set(this, !1),
                dk.set(this, void 0),
                uk(this, ik, e, "f"),
                uk(this, rk, t, "f"),
                uk(this, ak, n, "f"),
                uk(this, sk, document.createElement("div"), "f"),
                pk(this, sk, "f").className = "editor-height-selector",
                e.appendChild(pk(this, sk, "f")),
                pk(this, ak, "f").addChangeListener(uk(this, lk, (e => {
                    e ? pk(this, sk, "f").classList.add("touch") : pk(this, sk, "f").classList.remove("touch")
                }
                ), "f")),
                uk(this, ok, document.createElement("p"), "f"),
                pk(this, sk, "f").appendChild(pk(this, ok, "f"));
                const a = document.createElement("div");
                a.className = "buttons",
                pk(this, sk, "f").appendChild(a);
                const s = document.createElement("button");
                s.addEventListener("pointerdown", ( () => {
                    if (i(),
                    !pk(this, ck, "f")) {
                        uk(this, ck, !0, "f");
                        const e = () => {
                            pk(this, ck, "f") && (i(),
                            setTimeout(e, 50))
                        }
                        ;
                        setTimeout(e, 500)
                    }
                }
                )),
                s.addEventListener("contextmenu", (e => {
                    e.preventDefault()
                }
                )),
                a.appendChild(s);
                const o = document.createElement("img");
                o.src = "images/arrow_up.svg",
                s.appendChild(o);
                const l = document.createElement("button");
                l.addEventListener("pointerdown", ( () => {
                    if (r(),
                    !pk(this, hk, "f")) {
                        uk(this, hk, !0, "f");
                        const e = () => {
                            pk(this, hk, "f") && (r(),
                            setTimeout(e, 50))
                        }
                        ;
                        setTimeout(e, 500)
                    }
                }
                )),
                l.addEventListener("contextmenu", (e => {
                    e.preventDefault()
                }
                )),
                a.appendChild(l);
                const c = document.createElement("img");
                c.src = "images/arrow_down.svg",
                l.appendChild(c),
                uk(this, dk, ( () => {
                    uk(this, ck, !1, "f"),
                    uk(this, hk, !1, "f")
                }
                ), "f"),
                window.addEventListener("pointerup", pk(this, dk, "f"))
            }
            refresh(e) {
                pk(this, ok, "f").textContent = pk(this, rk, "f").get("Height") + ": " + e.toString()
            }
            dispose() {
                pk(this, ik, "f").removeChild(pk(this, sk, "f")),
                pk(this, ak, "f").removeChangeListener(pk(this, lk, "f")),
                window.removeEventListener("pointerup", pk(this, dk, "f"))
            }
        }
        ;
        var mk;
        !function(e) {
            e[e.VehicleAccelerate = 0] = "VehicleAccelerate",
            e[e.VehicleTurnRight = 1] = "VehicleTurnRight",
            e[e.VehicleBrake = 2] = "VehicleBrake",
            e[e.VehicleTurnLeft = 3] = "VehicleTurnLeft",
            e[e.VehicleCheckpointReset = 4] = "VehicleCheckpointReset",
            e[e.VehicleStartReset = 5] = "VehicleStartReset",
            e[e.VehicleCockpitCamera = 6] = "VehicleCockpitCamera",
            e[e.ToggleUI = 7] = "ToggleUI",
            e[e.Pause = 8] = "Pause",
            e[e.EditorRotatePart = 9] = "EditorRotatePart",
            e[e.EditorHeightModifier = 10] = "EditorHeightModifier",
            e[e.EditorDelete = 11] = "EditorDelete",
            e[e.EditorMoveForwards = 12] = "EditorMoveForwards",
            e[e.EditorMoveRight = 13] = "EditorMoveRight",
            e[e.EditorMoveBackwards = 14] = "EditorMoveBackwards",
            e[e.EditorMoveLeft = 15] = "EditorMoveLeft",
            e[e.EditorRotateViewUp = 16] = "EditorRotateViewUp",
            e[e.EditorRotateViewDown = 17] = "EditorRotateViewDown",
            e[e.EditorRotateViewLeft = 18] = "EditorRotateViewLeft",
            e[e.EditorRotateViewRight = 19] = "EditorRotateViewRight",
            e[e.EditorMoveDown = 20] = "EditorMoveDown",
            e[e.EditorMoveUp = 21] = "EditorMoveUp",
            e[e.EditorTest = 22] = "EditorTest",
            e[e.EditorPick = 23] = "EditorPick",
            e[e.ToggleFpsCounter = 24] = "ToggleFpsCounter",
            e[e.ToggleSpectatorCamera = 25] = "ToggleSpectatorCamera",
            e[e.SpectatorMoveForwards = 26] = "SpectatorMoveForwards",
            e[e.SpectatorMoveRight = 27] = "SpectatorMoveRight",
            e[e.SpectatorMoveBackwards = 28] = "SpectatorMoveBackwards",
            e[e.SpectatorMoveLeft = 29] = "SpectatorMoveLeft",
            e[e.SpectatorSpeedModifier = 30] = "SpectatorSpeedModifier"
        }(mk || (mk = {}));
        const gk = mk;
        var vk = i(7687)
          , wk = {};
        wk.styleTagTransform = u(),
        wk.setAttributes = l(),
        wk.insert = s().bind(null, "head"),
        wk.domAPI = r(),
        wk.insertStyleElement = h();
        t()(vk.A, wk);
        vk.A && vk.A.locals && vk.A.locals;
        var yk, bk, Ak, xk, kk, Ek, Sk, Mk = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, _k = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        yk = new WeakMap,
        bk = new WeakMap,
        Ak = new WeakMap,
        xk = new WeakMap,
        kk = new WeakMap,
        Ek = new WeakMap,
        Sk = new WeakMap;
        const Tk = class {
            constructor(e, t, n, i, r, a, s, o) {
                yk.set(this, void 0),
                bk.set(this, void 0),
                Ak.set(this, void 0),
                xk.set(this, void 0),
                kk.set(this, void 0),
                Ek.set(this, void 0),
                Sk.set(this, void 0),
                Mk(this, yk, r, "f");
                const l = document.getElementById("ui");
                if (null == l)
                    throw new Error("UI element not found");
                Mk(this, bk, l, "f"),
                Mk(this, Ak, document.createElement("div"), "f"),
                _k(this, Ak, "f").className = "track-export",
                _k(this, bk, "f").appendChild(_k(this, Ak, "f"));
                const c = document.createElement("div");
                c.className = "background",
                _k(this, Ak, "f").appendChild(c);
                const h = document.createElement("div");
                h.className = "box",
                _k(this, Ak, "f").appendChild(h);
                const d = document.createElement("div");
                d.className = "bar",
                h.appendChild(d);
                const u = document.createElement("button");
                u.className = "button",
                u.innerHTML = '<img class="button-icon" src="images/back.svg"> ',
                u.append(document.createTextNode(r.get("Back"))),
                u.addEventListener("click", ( () => {
                    a.playUIClick(),
                    t()
                }
                )),
                d.appendChild(u),
                Mk(this, kk, document.createElement("button"), "f"),
                _k(this, kk, "f").className = "hidden",
                _k(this, kk, "f").innerHTML = '<img class="button-icon" src="images/copy.svg"> ',
                _k(this, kk, "f").append(document.createTextNode(r.get("Copy"))),
                _k(this, kk, "f").addEventListener("click", ( () => {
                    a.playUIClick();
                    try {
                        navigator.clipboard.writeText(_k(this, xk, "f").value).catch((e => {
                            console.error(e)
                        }
                        ))
                    } catch (e) {
                        console.error(e)
                    }
                }
                )),
                d.appendChild(_k(this, kk, "f")),
                Mk(this, Ek, document.createElement("button"), "f"),
                _k(this, Ek, "f").className = "hidden",
                _k(this, Ek, "f").innerHTML = '<img class="button-icon" src="images/import.svg"> ',
                _k(this, Ek, "f").append(document.createTextNode(r.get("Import"))),
                _k(this, Ek, "f").addEventListener("click", ( () => {
                    a.playUIClick();
                    const e = () => {
                        const e = _k(this, Ak, "f").className;
                        _k(this, Ak, "f").className = "hidden",
                        o.show(r.get("Failed to import track"), r.get("Ok"), ( () => {
                            _k(this, Ak, "f").className = e
                        }
                        ))
                    }
                      , i = _k(this, xk, "f").value
                      , l = hx.fromExportString(i);
                    if (null == l)
                        e();
                    else {
                        const {trackMetadata: i, trackData: a} = l
                          , c = a.getId()
                          , h = a.createThumbnail();
                        if (s.checkCustomTrackNameExists(i.name)) {
                            const l = _k(this, Ak, "f").className;
                            _k(this, Ak, "f").className = "hidden",
                            o.showConfirm(r.get('The track "{0}" already exists. Do you wish to overwrite it?', [i.name]), r.get("Cancel"), r.get("Overwrite"), ( () => {
                                _k(this, Ak, "f").className = l
                            }
                            ), ( () => {
                                _k(this, Ak, "f").className = l,
                                s.saveCustomTrack(i, a) ? null != n ? n(i, a, c, h) : t() : e()
                            }
                            ))
                        } else
                            s.saveCustomTrack(i, a) ? null != n ? n(i, a, c, h) : t() : e()
                    }
                }
                )),
                d.appendChild(_k(this, Ek, "f")),
                Mk(this, xk, document.createElement("textarea"), "f"),
                _k(this, xk, "f").spellcheck = !1,
                h.appendChild(_k(this, xk, "f")),
                i && (_k(this, xk, "f").placeholder = _k(this, yk, "f").get("Paste track data here...")),
                _k(this, xk, "f").value = e,
                _k(this, xk, "f").readOnly = !i,
                i ? (_k(this, kk, "f").className = "hidden",
                _k(this, Ek, "f").className = "button right") : (_k(this, kk, "f").className = "button right",
                _k(this, Ek, "f").className = "hidden"),
                window.addEventListener("keydown", Mk(this, Sk, (e => {
                    "Escape" == e.code && (t(),
                    e.preventDefault())
                }
                ), "f"))
            }
            dispose() {
                _k(this, bk, "f").removeChild(_k(this, Ak, "f")),
                window.removeEventListener("keydown", _k(this, Sk, "f"))
            }
        }
        ;
        var Ck = i(8353)
          , Pk = {};
        Pk.styleTagTransform = u(),
        Pk.setAttributes = l(),
        Pk.insert = s().bind(null, "head"),
        Pk.domAPI = r(),
        Pk.insertStyleElement = h();
        t()(Ck.A, Pk);
        Ck.A && Ck.A.locals && Ck.A.locals;
        var Ik = i(7479)
          , Rk = {};
        Rk.styleTagTransform = u(),
        Rk.setAttributes = l(),
        Rk.insert = s().bind(null, "head"),
        Rk.domAPI = r(),
        Rk.insertStyleElement = h();
        t()(Ik.A, Rk);
        Ik.A && Ik.A.locals && Ik.A.locals;
        var Lk, Dk, Nk, Bk, Uk, zk, Ok, Fk, Wk, Hk, Vk, Gk, jk, Qk, Kk, qk, Yk, Xk = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, Zk = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class Jk {
            constructor(e, t, n=!1) {
                Lk.set(this, void 0),
                Dk.set(this, void 0),
                Nk.set(this, void 0),
                Bk.set(this, void 0),
                Uk.set(this, null),
                zk.set(this, void 0),
                Ok.set(this, null),
                Fk.set(this, null),
                Wk.set(this, void 0),
                Hk.set(this, null),
                Vk.set(this, []),
                Gk.set(this, void 0),
                jk.set(this, void 0),
                Qk.set(this, void 0),
                Kk.set(this, null),
                qk.set(this, null),
                Yk.set(this, null),
                this.record = null,
                Xk(this, Lk, e, "f"),
                Xk(this, Dk, t, "f");
                const i = document.getElementById("ui");
                if (null == i)
                    throw new Error("UI element not found");
                if (Xk(this, Nk, i, "f"),
                Xk(this, Bk, document.createElement("div"), "f"),
                "off" == t.getSetting(el.Timer) ? Zk(this, Bk, "f").className = "timer hidden" : "top" == t.getSetting(el.Timer) ? Zk(this, Bk, "f").className = "timer up" : Zk(this, Bk, "f").className = "timer",
                n)
                    Xk(this, Gk, null, "f");
                else {
                    const t = document.createElement("div");
                    t.className = "left",
                    Zk(this, Bk, "f").appendChild(t);
                    const n = document.createElement("div");
                    n.className = "title-container",
                    t.appendChild(n),
                    Xk(this, Uk, document.createElement("h2"), "f"),
                    Zk(this, Uk, "f").className = "title",
                    Zk(this, Uk, "f").textContent = e.get("Record"),
                    n.appendChild(Zk(this, Uk, "f")),
                    Xk(this, Fk, document.createElement("h2"), "f"),
                    Zk(this, Fk, "f").className = "checkpoint-time",
                    n.appendChild(Zk(this, Fk, "f"));
                    const i = document.createElement("div");
                    i.className = "time",
                    t.appendChild(i),
                    Xk(this, Gk, document.createElement("p"), "f"),
                    Zk(this, Gk, "f").className = "small",
                    Zk(this, Gk, "f").textContent = "- - -",
                    i.appendChild(Zk(this, Gk, "f"))
                }
                const r = document.createElement("div");
                r.className = "center",
                Zk(this, Bk, "f").appendChild(r);
                const a = document.createElement("div");
                a.className = "title-container",
                r.appendChild(a),
                Xk(this, zk, document.createElement("h2"), "f"),
                Zk(this, zk, "f").className = "title",
                Zk(this, zk, "f").textContent = e.get("Current"),
                a.appendChild(Zk(this, zk, "f")),
                Xk(this, Wk, document.createElement("h2"), "f"),
                Zk(this, Wk, "f").className = "checkpoint-time",
                a.appendChild(Zk(this, Wk, "f"));
                const s = document.createElement("div");
                if (s.className = "time",
                r.appendChild(s),
                Xk(this, jk, document.createElement("p"), "f"),
                Zk(this, jk, "f").textContent = "- - -",
                s.appendChild(Zk(this, jk, "f")),
                n)
                    Xk(this, Qk, null, "f");
                else {
                    const t = document.createElement("div");
                    t.className = "right",
                    Zk(this, Bk, "f").appendChild(t);
                    const n = document.createElement("div");
                    n.className = "title-container",
                    t.appendChild(n),
                    Xk(this, Ok, document.createElement("h2"), "f"),
                    Zk(this, Ok, "f").className = "title",
                    Zk(this, Ok, "f").textContent = e.get("Difference"),
                    n.appendChild(Zk(this, Ok, "f")),
                    Xk(this, Hk, document.createElement("h2"), "f"),
                    Zk(this, Hk, "f").className = "checkpoint-time",
                    n.appendChild(Zk(this, Hk, "f"));
                    const i = document.createElement("div");
                    i.className = "time",
                    t.appendChild(i),
                    Xk(this, Qk, document.createElement("p"), "f"),
                    Zk(this, Qk, "f").className = "small",
                    Zk(this, Qk, "f").textContent = "- - -",
                    i.appendChild(Zk(this, Qk, "f"))
                }
                Zk(this, Nk, "f").appendChild(Zk(this, Bk, "f"))
            }
            dispose() {
                Zk(this, Nk, "f").removeChild(Zk(this, Bk, "f"))
            }
            setOverridePosition(e) {
                const t = Zk(this, Dk, "f").getSetting(el.Timer);
                Zk(this, Bk, "f").className = "off" == t ? "timer hidden" : (null != e ? e : "top" == t) ? "timer up" : "timer"
            }
            hideCheckpointTime() {
                for (const e of Zk(this, Vk, "f"))
                    e.cancel();
                Zk(this, Vk, "f").length = 0
            }
            showCheckpointTime(e, t) {
                if (this.hideCheckpointTime(),
                null != Zk(this, Fk, "f") && null != t && (Zk(this, Fk, "f").textContent = Jk.formatTimeString(t, !1),
                Zk(this, Vk, "f").push(Zk(this, Fk, "f").animate([{
                    opacity: 0,
                    transform: "translateX(20px)",
                    offset: 0,
                    easing: "ease-in-out"
                }, {
                    opacity: 1,
                    transform: "translateX(0)",
                    offset: 1 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 1,
                    transform: "translateX(0)",
                    offset: 27 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 0,
                    transform: "translateX(-10px)",
                    offset: 1,
                    easing: "ease-in-out"
                }], {
                    duration: 3500
                }))),
                Zk(this, Wk, "f").textContent = Jk.formatTimeString(e, !1),
                Zk(this, Vk, "f").push(Zk(this, Wk, "f").animate([{
                    opacity: 0,
                    transform: "translateX(20px)",
                    offset: 0,
                    easing: "ease-in-out"
                }, {
                    opacity: 1,
                    transform: "translateX(0)",
                    offset: 1 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 1,
                    transform: "translateX(0)",
                    offset: 27 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 0,
                    transform: "translateX(-10px)",
                    offset: 1,
                    easing: "ease-in-out"
                }], {
                    duration: 3500
                })),
                null != Zk(this, Hk, "f") && null != t) {
                    const n = e.difference(t);
                    Zk(this, Hk, "f").textContent = Jk.formatTimeString(n, !0),
                    n.isNegative() ? (Zk(this, Hk, "f").classList.remove("red"),
                    Zk(this, Hk, "f").classList.add("green")) : (Zk(this, Hk, "f").classList.add("red"),
                    Zk(this, Hk, "f").classList.remove("green")),
                    Zk(this, Vk, "f").push(Zk(this, Hk, "f").animate([{
                        opacity: 0,
                        transform: "translateX(20px)",
                        offset: 0,
                        easing: "ease-in-out"
                    }, {
                        opacity: 1,
                        transform: "translateX(0)",
                        offset: 1 / 28,
                        easing: "ease-in-out"
                    }, {
                        opacity: 1,
                        transform: "translateX(0)",
                        offset: 27 / 28,
                        easing: "ease-in-out"
                    }, {
                        opacity: 0,
                        transform: "translateX(-10px)",
                        offset: 1,
                        easing: "ease-in-out"
                    }], {
                        duration: 3500
                    }))
                }
                null != Zk(this, Uk, "f") && null != t && Zk(this, Vk, "f").push(Zk(this, Uk, "f").animate([{
                    opacity: 1,
                    offset: 0,
                    easing: "ease-in-out"
                }, {
                    opacity: 0,
                    offset: 1 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 0,
                    offset: 27 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 1,
                    offset: 1,
                    easing: "ease-in-out"
                }], {
                    duration: 3500
                })),
                Zk(this, Vk, "f").push(Zk(this, zk, "f").animate([{
                    opacity: 1,
                    offset: 0,
                    easing: "ease-in-out"
                }, {
                    opacity: 0,
                    offset: 1 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 0,
                    offset: 27 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 1,
                    offset: 1,
                    easing: "ease-in-out"
                }], {
                    duration: 3500
                })),
                null != Zk(this, Ok, "f") && null != t && Zk(this, Vk, "f").push(Zk(this, Ok, "f").animate([{
                    opacity: 1,
                    offset: 0,
                    easing: "ease-in-out"
                }, {
                    opacity: 0,
                    offset: 1 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 0,
                    offset: 27 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 1,
                    offset: 1,
                    easing: "ease-in-out"
                }], {
                    duration: 3500
                }))
            }
            static formatTimeString(e, t=!1) {
                if (null == e)
                    return "---";
                {
                    const n = Math.abs(e.numberOfFrames)
                      , i = Math.floor(n / 6e4)
                      , r = Math.floor((n - 6e4 * i) / 1e3)
                      , a = n - 6e4 * i - 1e3 * r;
                    let s;
                    return s = t ? e.isNegative() ? "-" : "+" : "",
                    s + i.toString().padStart(2, "0") + ":" + r.toString().padStart(2, "0") + "." + a.toString().padStart(3, "0")
                }
            }
            update(e) {
                var t;
                const n = null !== (t = e.getFinishTime()) && void 0 !== t ? t : e.getTime();
                let i;
                if (i = null != this.record ? n.difference(this.record) : null,
                null != Zk(this, Gk, "f")) {
                    const e = Jk.formatTimeString(this.record, !1);
                    if (e != Zk(this, Kk, "f")) {
                        Zk(this, Gk, "f").innerHTML = "";
                        for (const t of e) {
                            const e = document.createElement("span");
                            e.textContent = t,
                            Zk(this, Gk, "f").appendChild(e)
                        }
                        Xk(this, Kk, e, "f")
                    }
                    null == this.record ? "small center" != Zk(this, Gk, "f").className && (Zk(this, Gk, "f").className = "small center") : "small" != Zk(this, Gk, "f").className && (Zk(this, Gk, "f").className = "small")
                }
                const r = Jk.formatTimeString(n, !1);
                if (r != Zk(this, qk, "f")) {
                    Zk(this, jk, "f").innerHTML = "";
                    for (const e of r) {
                        const t = document.createElement("span");
                        t.textContent = e,
                        Zk(this, jk, "f").appendChild(t)
                    }
                    Xk(this, qk, r, "f")
                }
                if (null != Zk(this, Qk, "f")) {
                    const e = Jk.formatTimeString(i, !0);
                    if (e != Zk(this, Yk, "f")) {
                        Zk(this, Qk, "f").innerHTML = "";
                        for (let t = 0; t < e.length; ++t) {
                            const n = document.createElement("span");
                            0 == t && Number.isFinite(i) && (n.className = "sign"),
                            n.textContent = e[t],
                            Zk(this, Qk, "f").appendChild(n)
                        }
                        Xk(this, Yk, e, "f")
                    }
                    null == i ? "small center" != Zk(this, Qk, "f").className && (Zk(this, Qk, "f").className = "small center") : i.isNegative() ? "small green" != Zk(this, Qk, "f").className && (Zk(this, Qk, "f").className = "small green") : "small red" != Zk(this, Qk, "f").className && (Zk(this, Qk, "f").className = "small red")
                }
            }
            set nickname(e) {
                null != Zk(this, Uk, "f") ? Zk(this, Uk, "f").textContent = null != e ? '"' + e + '"' : Zk(this, Lk, "f").get("Record") : Zk(this, zk, "f").textContent = null != e ? '"' + e + '"' : Zk(this, Lk, "f").get("Current")
            }
        }
        Lk = new WeakMap,
        Dk = new WeakMap,
        Nk = new WeakMap,
        Bk = new WeakMap,
        Uk = new WeakMap,
        zk = new WeakMap,
        Ok = new WeakMap,
        Fk = new WeakMap,
        Wk = new WeakMap,
        Hk = new WeakMap,
        Vk = new WeakMap,
        Gk = new WeakMap,
        jk = new WeakMap,
        Qk = new WeakMap,
        Kk = new WeakMap,
        qk = new WeakMap,
        Yk = new WeakMap;
        const $k = Jk;
        var eE, tE, nE, iE, rE, aE, sE, oE, lE, cE, hE, dE, uE, pE, fE, mE, gE, vE, wE, yE, bE, AE, xE, kE, EE, SE, ME, _E, TE, CE, PE, IE, RE = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, LE = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        let DE = null
          , NE = 0
          , BE = 0
          , UE = 0;
        tE = new WeakMap,
        nE = new WeakMap,
        iE = new WeakMap,
        rE = new WeakMap,
        aE = new WeakMap,
        sE = new WeakMap,
        oE = new WeakMap,
        lE = new WeakMap,
        cE = new WeakMap,
        hE = new WeakMap,
        dE = new WeakMap,
        uE = new WeakMap,
        pE = new WeakMap,
        fE = new WeakMap,
        mE = new WeakMap,
        gE = new WeakMap,
        vE = new WeakMap,
        wE = new WeakMap,
        yE = new WeakMap,
        bE = new WeakMap,
        AE = new WeakMap,
        xE = new WeakMap,
        kE = new WeakMap,
        EE = new WeakMap,
        SE = new WeakMap,
        ME = new WeakMap,
        _E = new WeakMap,
        TE = new WeakMap,
        eE = new WeakSet,
        CE = function(e, t, n, i, r, a=null) {
            const s = document.createElement("div");
            let o;
            switch (s.className = "track",
            e) {
            case "official":
                o = LE(this, wE, "f");
                break;
            case "community":
                o = LE(this, yE, "f");
                break;
            case "custom":
                o = LE(this, bE, "f")
            }
            let l = o.get(n.environment);
            if (null == l) {
                let t, i, r, a;
                switch (e) {
                case "official":
                    t = LE(this, mE, "f");
                    break;
                case "community":
                    t = LE(this, gE, "f");
                    break;
                case "custom":
                    t = LE(this, vE, "f")
                }
                switch (l = document.createElement("div"),
                o.set(n.environment, l),
                n.environment) {
                case IA.Summer:
                    t.prepend(l);
                    break;
                case IA.Winter:
                    {
                        const e = o.get(IA.Desert);
                        null != e ? t.insertBefore(l, e) : t.appendChild(l);
                        break
                    }
                case IA.Desert:
                    t.appendChild(l)
                }
                switch (n.environment) {
                case IA.Summer:
                    i = "summer",
                    r = LE(this, nE, "f").get("Summer"),
                    a = "images/summer.svg";
                    break;
                case IA.Winter:
                    i = "winter",
                    r = LE(this, nE, "f").get("Winter"),
                    a = "images/winter_colored.svg";
                    break;
                case IA.Desert:
                    i = "desert",
                    r = LE(this, nE, "f").get("Desert"),
                    a = "images/desert_colored.svg"
                }
                const s = document.createElement("div");
                s.className = "environment-title " + i,
                s.textContent = r,
                l.appendChild(s);
                const c = document.createElement("img");
                c.src = a,
                s.prepend(c)
            }
            l.appendChild(s);
            const c = document.createElement("button");
            c.className = "button",
            c.addEventListener("click", ( () => {
                LE(this, iE, "f").playUIClick(),
                LE(this, hE, "f").call(this, t, n, e, i, r)
            }
            )),
            s.appendChild(c);
            const h = document.createElement("div");
            h.className = "track-title",
            c.appendChild(h);
            const d = document.createElement("p");
            let u;
            switch (d.textContent = t.name,
            h.appendChild(d),
            c.appendChild(r),
            n.environment) {
            case IA.Summer:
                u = "images/summer.svg";
                break;
            case IA.Winter:
                u = "images/winter.svg";
                break;
            case IA.Desert:
                u = "images/desert.svg"
            }
            const p = document.createElement("img");
            p.className = "environment",
            p.src = u,
            c.appendChild(p);
            const f = LE(this, rE, "f").getRecordTime(LE(this, sE, "f").profileSlot, i)
              , m = document.createElement("div");
            if (m.className = "record",
            m.textContent = null != f ? $k.formatTimeString(f) : LE(this, nE, "f").get("No record"),
            c.appendChild(m),
            null != a) {
                const e = document.createElement("button");
                e.className = "delete-button",
                e.innerHTML = '<img src="images/erase.svg">',
                e.addEventListener("click", ( () => {
                    LE(this, iE, "f").playUIClick(),
                    a()
                }
                )),
                s.appendChild(e)
            }
            LE(this, AE, "f").push({
                category: e,
                trackData: n,
                trackMetadata: t,
                buttonContainer: s
            })
        }
        ,
        PE = function(e) {
            DE = e,
            LE(this, lE, "f").saveTrackSelectionTab(DE),
            "official" == e ? (LE(this, uE, "f").classList.add("selected"),
            LE(this, pE, "f").classList.remove("selected"),
            LE(this, fE, "f").classList.remove("selected"),
            LE(this, mE, "f").classList.add("open"),
            LE(this, gE, "f").classList.remove("open"),
            LE(this, vE, "f").classList.remove("open")) : "community" == e ? (LE(this, uE, "f").classList.remove("selected"),
            LE(this, pE, "f").classList.add("selected"),
            LE(this, fE, "f").classList.remove("selected"),
            LE(this, mE, "f").classList.remove("open"),
            LE(this, gE, "f").classList.add("open"),
            LE(this, vE, "f").classList.remove("open")) : (LE(this, uE, "f").classList.remove("selected"),
            LE(this, pE, "f").classList.remove("selected"),
            LE(this, fE, "f").classList.add("selected"),
            LE(this, mE, "f").classList.remove("open"),
            LE(this, gE, "f").classList.remove("open"),
            LE(this, vE, "f").classList.add("open"))
        }
        ,
        IE = function() {
            var e;
            const t = LE(this, xE, "f").value.trim().toLowerCase();
            for (const n of LE(this, AE, "f"))
                n.trackMetadata.name.toLowerCase().includes(t) || (null === (e = n.trackMetadata.author) || void 0 === e ? void 0 : e.toLowerCase().includes(t)) ? n.buttonContainer.style.display = "" : n.buttonContainer.style.display = "none";
            for (const e of ["official", "community", "custom"]) {
                let t;
                switch (e) {
                case "official":
                    t = LE(this, wE, "f");
                    break;
                case "community":
                    t = LE(this, yE, "f");
                    break;
                case "custom":
                    t = LE(this, bE, "f")
                }
                for (const [n,i] of t.entries())
                    LE(this, AE, "f").some((t => t.category == e && t.trackData.environment == n && "none" != t.buttonContainer.style.display)) ? i.style.display = "" : i.style.display = "none"
            }
            if (null == DE && (DE = LE(this, lE, "f").loadTrackSelectionTab()),
            LE(this, AE, "f").filter((e => e.category == DE)).every((e => "none" == e.buttonContainer.style.display)))
                for (const e of ["official", "community", "custom"])
                    if (LE(this, AE, "f").some((t => t.category == e && "none" != t.buttonContainer.style.display))) {
                        LE(this, eE, "m", PE).call(this, e);
                        break
                    }
        }
        ;
        const zE = class {
            constructor(e, t, n, i, r, a, s, o, l, c, h) {
                eE.add(this),
                tE.set(this, void 0),
                nE.set(this, void 0),
                iE.set(this, void 0),
                rE.set(this, void 0),
                aE.set(this, void 0),
                sE.set(this, void 0),
                oE.set(this, void 0),
                lE.set(this, void 0),
                cE.set(this, void 0),
                hE.set(this, void 0),
                dE.set(this, void 0),
                uE.set(this, void 0),
                pE.set(this, void 0),
                fE.set(this, void 0),
                mE.set(this, void 0),
                gE.set(this, void 0),
                vE.set(this, void 0),
                wE.set(this, new Map),
                yE.set(this, new Map),
                bE.set(this, new Map),
                AE.set(this, []),
                xE.set(this, void 0),
                kE.set(this, null),
                EE.set(this, !1),
                SE.set(this, !1),
                ME.set(this, void 0),
                _E.set(this, void 0),
                TE.set(this, void 0),
                RE(this, tE, e, "f"),
                RE(this, nE, t, "f"),
                RE(this, iE, n, "f"),
                RE(this, rE, i, "f"),
                RE(this, aE, r, "f"),
                RE(this, sE, a, "f"),
                RE(this, oE, s, "f"),
                RE(this, lE, o, "f"),
                RE(this, cE, l, "f"),
                RE(this, hE, h, "f"),
                RE(this, dE, document.createElement("div"), "f"),
                LE(this, dE, "f").className = "hidden",
                e.appendChild(LE(this, dE, "f"));
                const d = document.createElement("div");
                d.className = "safe-area-left",
                LE(this, dE, "f").appendChild(d);
                const u = document.createElement("div");
                u.className = "safe-area-right",
                LE(this, dE, "f").appendChild(u);
                const p = document.createElement("div");
                p.className = "bar",
                LE(this, dE, "f").appendChild(p);
                const f = document.createElement("div");
                f.className = "category-container",
                LE(this, dE, "f").appendChild(f),
                RE(this, uE, document.createElement("button"), "f"),
                LE(this, uE, "f").className = "button official selected",
                LE(this, uE, "f").append(document.createTextNode(LE(this, nE, "f").get("Official tracks"))),
                LE(this, uE, "f").addEventListener("click", ( () => {
                    LE(this, iE, "f").playUIClick(),
                    LE(this, eE, "m", PE).call(this, "official")
                }
                )),
                f.appendChild(LE(this, uE, "f"));
                const m = document.createElement("div");
                m.className = "cover",
                LE(this, uE, "f").prepend(m),
                RE(this, pE, document.createElement("button"), "f"),
                LE(this, pE, "f").className = "button community",
                LE(this, pE, "f").append(document.createTextNode(LE(this, nE, "f").get("Community tracks"))),
                LE(this, pE, "f").addEventListener("click", ( () => {
                    LE(this, iE, "f").playUIClick(),
                    LE(this, eE, "m", PE).call(this, "community")
                }
                )),
                f.appendChild(LE(this, pE, "f"));
                const g = document.createElement("div");
                g.className = "cover",
                LE(this, pE, "f").prepend(g),
                RE(this, fE, document.createElement("button"), "f"),
                LE(this, fE, "f").className = "button custom",
                LE(this, fE, "f").append(document.createTextNode(LE(this, nE, "f").get("Custom tracks"))),
                LE(this, fE, "f").addEventListener("click", ( () => {
                    LE(this, iE, "f").playUIClick(),
                    LE(this, eE, "m", PE).call(this, "custom")
                }
                )),
                f.appendChild(LE(this, fE, "f"));
                const v = document.createElement("div");
                v.className = "cover",
                LE(this, fE, "f").prepend(v),
                RE(this, mE, document.createElement("div"), "f"),
                LE(this, mE, "f").className = "tracks-container open",
                LE(this, dE, "f").appendChild(LE(this, mE, "f")),
                RE(this, gE, document.createElement("div"), "f"),
                LE(this, gE, "f").className = "tracks-container",
                LE(this, dE, "f").appendChild(LE(this, gE, "f")),
                RE(this, vE, document.createElement("div"), "f"),
                LE(this, vE, "f").className = "tracks-container",
                LE(this, dE, "f").appendChild(LE(this, vE, "f"));
                let w = null;
                const y = e => {
                    w = 1 == e.touches.length ? {
                        x: e.touches[0].clientX,
                        y: e.touches[0].clientY,
                        time: Date.now()
                    } : null
                }
                  , b = e => {
                    if (null != w && 1 == e.changedTouches.length) {
                        const t = e.changedTouches[0].clientX - w.x
                          , n = e.changedTouches[0].clientY - w.y;
                        Date.now() - w.time < 500 && Math.abs(t) > 75 && Math.abs(n) < Math.abs(t) && (t > 0 ? "community" == DE ? LE(this, eE, "m", PE).call(this, "official") : "custom" == DE && LE(this, eE, "m", PE).call(this, "community") : "official" == DE ? LE(this, eE, "m", PE).call(this, "community") : "community" == DE && LE(this, eE, "m", PE).call(this, "custom"))
                    }
                    w = null
                }
                ;
                LE(this, mE, "f").addEventListener("touchstart", y, {
                    passive: !0
                }),
                LE(this, gE, "f").addEventListener("touchstart", y, {
                    passive: !0
                }),
                LE(this, vE, "f").addEventListener("touchstart", y, {
                    passive: !0
                }),
                LE(this, mE, "f").addEventListener("touchend", b, {
                    passive: !0
                }),
                LE(this, gE, "f").addEventListener("touchend", b, {
                    passive: !0
                }),
                LE(this, vE, "f").addEventListener("touchend", b, {
                    passive: !0
                });
                const A = document.createElement("button");
                A.className = "button",
                l ? (A.innerHTML = '<img class="button-icon" src="images/erase.svg"> ',
                A.append(document.createTextNode(LE(this, nE, "f").get("Cancel")))) : (A.innerHTML = '<img class="button-icon" src="images/back.svg"> ',
                A.append(document.createTextNode(LE(this, nE, "f").get("Back")))),
                A.addEventListener("click", ( () => {
                    LE(this, iE, "f").playUIClick(),
                    c()
                }
                )),
                p.appendChild(A);
                const x = document.createElement("div");
                x.className = "search-bar-container",
                p.appendChild(x),
                RE(this, xE, document.createElement("input"), "f"),
                LE(this, xE, "f").type = "text",
                LE(this, xE, "f").spellcheck = !1,
                LE(this, xE, "f").autocomplete = "off",
                LE(this, xE, "f").autocapitalize = "off",
                LE(this, xE, "f").enterKeyHint = "search",
                LE(this, xE, "f").placeholder = LE(this, nE, "f").get("Search by track or author..."),
                LE(this, xE, "f").addEventListener("input", ( () => {
                    LE(this, eE, "m", IE).call(this)
                }
                )),
                x.appendChild(LE(this, xE, "f"));
                const k = document.createElement("img");
                k.src = "images/search.svg",
                x.appendChild(k);
                const E = document.createElement("button");
                E.className = "button",
                E.innerHTML = '<img class="button-icon" src="images/import.svg"> ',
                E.append(document.createTextNode(LE(this, nE, "f").get("Import"))),
                E.addEventListener("click", ( () => {
                    LE(this, iE, "f").playUIClick(),
                    this.hide(),
                    RE(this, kE, new Tk("",( () => {
                        var e;
                        this.show(),
                        null === (e = LE(this, kE, "f")) || void 0 === e || e.dispose(),
                        RE(this, kE, null, "f")
                    }
                    ),( (e, t, n, i) => {
                        var r;
                        null === (r = LE(this, kE, "f")) || void 0 === r || r.dispose(),
                        RE(this, kE, null, "f"),
                        LE(this, eE, "m", PE).call(this, "custom"),
                        LE(this, hE, "f").call(this, e, t, "custom", n, i)
                    }
                    ),!0,t,n,r,s), "f")
                }
                )),
                p.appendChild(E),
                window.addEventListener("keydown", RE(this, ME, (e => {
                    LE(this, EE, "f") && "Escape" == e.code && (c(),
                    e.preventDefault())
                }
                ), "f")),
                LE(this, aE, "f").addCustomTracksChangedListener(RE(this, _E, ( () => {
                    LE(this, SE, "f") && this.refresh()
                }
                ), "f")),
                LE(this, mE, "f").addEventListener("scroll", ( () => {
                    NE = LE(this, mE, "f").scrollTop
                }
                ), {
                    passive: !0
                }),
                LE(this, gE, "f").addEventListener("scroll", ( () => {
                    BE = LE(this, gE, "f").scrollTop
                }
                ), {
                    passive: !0
                }),
                LE(this, vE, "f").addEventListener("scroll", ( () => {
                    UE = LE(this, vE, "f").scrollTop
                }
                ), {
                    passive: !0
                }),
                LE(this, rE, "f").addRecordChangedCallback(RE(this, TE, ( () => {
                    this.refresh()
                }
                ), "f"))
            }
            dispose() {
                var e;
                LE(this, tE, "f").removeChild(LE(this, dE, "f")),
                window.removeEventListener("keydown", LE(this, ME, "f")),
                null === (e = LE(this, kE, "f")) || void 0 === e || e.dispose(),
                RE(this, kE, null, "f"),
                LE(this, aE, "f").removeCustomTracksChangedListener(LE(this, _E, "f")),
                LE(this, rE, "f").removeRecordChangedCallback(LE(this, TE, "f"))
            }
            hide() {
                LE(this, dE, "f").className = "hidden",
                RE(this, EE, !1, "f")
            }
            show() {
                LE(this, cE, "f") ? LE(this, dE, "f").className = "track-selection editor-track-selection" : LE(this, dE, "f").className = "track-selection",
                RE(this, EE, !0, "f"),
                LE(this, SE, "f") || this.refresh(),
                null == DE && (DE = LE(this, lE, "f").loadTrackSelectionTab()),
                "official" == DE ? (LE(this, uE, "f").classList.add("selected"),
                LE(this, pE, "f").classList.remove("selected"),
                LE(this, fE, "f").classList.remove("selected"),
                LE(this, mE, "f").classList.add("open"),
                LE(this, gE, "f").classList.remove("open"),
                LE(this, vE, "f").classList.remove("open"),
                LE(this, mE, "f").scrollTop = NE) : "community" == DE ? (LE(this, uE, "f").classList.remove("selected"),
                LE(this, pE, "f").classList.add("selected"),
                LE(this, fE, "f").classList.remove("selected"),
                LE(this, mE, "f").classList.remove("open"),
                LE(this, gE, "f").classList.add("open"),
                LE(this, vE, "f").classList.remove("open"),
                LE(this, gE, "f").scrollTop = BE) : (LE(this, uE, "f").classList.remove("selected"),
                LE(this, pE, "f").classList.remove("selected"),
                LE(this, fE, "f").classList.add("selected"),
                LE(this, mE, "f").classList.remove("open"),
                LE(this, gE, "f").classList.remove("open"),
                LE(this, vE, "f").classList.add("open"),
                LE(this, vE, "f").scrollTop = UE)
            }
            get isOpen() {
                return LE(this, EE, "f") || null != LE(this, kE, "f")
            }
            refresh() {
                if (RE(this, AE, [], "f"),
                LE(this, mE, "f").innerHTML = "",
                LE(this, gE, "f").innerHTML = "",
                LE(this, vE, "f").innerHTML = "",
                LE(this, wE, "f").clear(),
                LE(this, yE, "f").clear(),
                LE(this, bE, "f").clear(),
                LE(this, aE, "f").forEachOfficialTrack(( (e, t, n, i) => {
                    LE(this, eE, "m", CE).call(this, "official", t, n, e, i)
                }
                )),
                LE(this, aE, "f").isCommunityTracksEmpty()) {
                    const e = document.createElement("div");
                    e.className = "empty";
                    const t = document.createElement("div");
                    t.className = "title",
                    t.textContent = LE(this, nE, "f").get("No community tracks"),
                    e.appendChild(t);
                    const n = document.createElement("div");
                    n.className = "description",
                    n.textContent = LE(this, nE, "f").get("Community tracks are coming soon"),
                    e.appendChild(n),
                    LE(this, gE, "f").appendChild(e)
                } else
                    LE(this, aE, "f").forEachCommunityTrack(( (e, t, n, i) => {
                        LE(this, eE, "m", CE).call(this, "community", t, n, e, i)
                    }
                    ));
                if (LE(this, aE, "f").isCustomTracksEmpty()) {
                    const e = document.createElement("div");
                    e.className = "empty";
                    const t = document.createElement("div");
                    t.className = "title",
                    t.textContent = LE(this, nE, "f").get("No custom tracks"),
                    e.appendChild(t);
                    const n = document.createElement("div");
                    n.className = "description",
                    n.textContent = LE(this, nE, "f").get("Create a track using the editor or import a track code"),
                    e.appendChild(n),
                    LE(this, vE, "f").appendChild(e)
                } else
                    LE(this, aE, "f").forEachCustomTrack(( (e, t, n, i) => {
                        LE(this, eE, "m", CE).call(this, "custom", t, n, e, i, ( () => {
                            this.hide(),
                            LE(this, oE, "f").showConfirm(LE(this, nE, "f").get('Are you sure you want to delete "{0}"?', [t.name]), LE(this, nE, "f").get("Cancel"), LE(this, nE, "f").get("Delete"), ( () => {
                                this.show()
                            }
                            ), ( () => {
                                LE(this, aE, "f").deleteCustomTrack(t.name),
                                this.show()
                            }
                            ))
                        }
                        ))
                    }
                    ));
                LE(this, eE, "m", IE).call(this),
                RE(this, SE, !0, "f")
            }
        }
        ;
        var OE = i(2346)
          , FE = {};
        FE.styleTagTransform = u(),
        FE.setAttributes = l(),
        FE.insert = s().bind(null, "head"),
        FE.domAPI = r(),
        FE.insertStyleElement = h();
        t()(OE.A, FE);
        OE.A && OE.A.locals && OE.A.locals;
        var WE, HE, VE, GE, jE, QE, KE, qE, YE = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, XE = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        WE = new WeakMap,
        HE = new WeakMap,
        VE = new WeakMap,
        GE = new WeakMap,
        jE = new WeakMap,
        QE = new WeakMap,
        KE = new WeakMap,
        qE = new WeakMap;
        const ZE = class {
            constructor(e, t, n, i, r, a, s) {
                WE.set(this, void 0),
                HE.set(this, void 0),
                VE.set(this, void 0),
                GE.set(this, void 0),
                jE.set(this, void 0),
                QE.set(this, void 0),
                KE.set(this, []),
                qE.set(this, void 0),
                YE(this, WE, e, "f"),
                YE(this, HE, n, "f"),
                YE(this, VE, document.createElement("div"), "f"),
                XE(this, VE, "f").className = "editor-side-toolbar",
                XE(this, WE, "f").appendChild(XE(this, VE, "f"));
                let o = !1;
                const l = document.createElement("button")
                  , c = document.createElement("img");
                c.src = "images/overlapping_disabled.svg",
                l.appendChild(c),
                l.addEventListener("click", ( () => {
                    t.playUIClick(),
                    o = !o,
                    c.src = o ? "images/overlapping_enabled.svg" : "images/overlapping_disabled.svg",
                    i(o)
                }
                )),
                XE(this, VE, "f").appendChild(l);
                let h = !0;
                const d = document.createElement("button")
                  , u = document.createElement("img");
                u.src = "images/grid_large.svg",
                d.appendChild(u),
                d.addEventListener("click", ( () => {
                    t.playUIClick(),
                    h = !h,
                    u.src = h ? "images/grid_large.svg" : "images/grid_small.svg",
                    r(h)
                }
                )),
                XE(this, VE, "f").appendChild(d);
                const p = document.createElement("div");
                p.className = "accordion",
                XE(this, VE, "f").appendChild(p),
                YE(this, QE, document.createElement("button"), "f"),
                XE(this, QE, "f").innerHTML = '<img src="images/rotation_axis_y_positive.svg">',
                XE(this, QE, "f").addEventListener("click", ( () => {
                    t.playUIClick(),
                    p.classList.toggle("open");
                    for (const e of p.children)
                        e != XE(this, QE, "f") && e instanceof HTMLButtonElement && (p.classList.contains("open") ? (e.inert = !1,
                        e.tabIndex = 0) : (e.inert = !0,
                        e.tabIndex = -1))
                }
                )),
                p.appendChild(XE(this, QE, "f"));
                for (const e of [Tb.YPositive, Tb.YNegative, Tb.XPositive, Tb.XNegative, Tb.ZPositive, Tb.ZNegative]) {
                    const n = document.createElement("button");
                    switch (n.inert = !0,
                    n.tabIndex = -1,
                    e) {
                    case Tb.YPositive:
                        n.innerHTML = '<img src="images/rotation_axis_y_positive.svg">';
                        break;
                    case Tb.YNegative:
                        n.innerHTML = '<img src="images/rotation_axis_y_negative.svg">';
                        break;
                    case Tb.XPositive:
                        n.innerHTML = '<img src="images/rotation_axis_x_positive.svg">';
                        break;
                    case Tb.XNegative:
                        n.innerHTML = '<img src="images/rotation_axis_x_negative.svg">';
                        break;
                    case Tb.ZPositive:
                        n.innerHTML = '<img src="images/rotation_axis_z_positive.svg">';
                        break;
                    case Tb.ZNegative:
                        n.innerHTML = '<img src="images/rotation_axis_z_negative.svg">'
                    }
                    n.addEventListener("click", ( () => {
                        t.playUIClick(),
                        a(e)
                    }
                    )),
                    e == Tb.YPositive && n.classList.add("selected"),
                    p.appendChild(n),
                    XE(this, KE, "f").push([e, n])
                }
                const f = document.createElement("button");
                f.className = "rotate",
                f.addEventListener("click", ( () => {
                    t.playUIClick(),
                    s()
                }
                )),
                XE(this, VE, "f").appendChild(f),
                YE(this, GE, document.createElement("div"), "f"),
                XE(this, GE, "f").innerHTML = '<img src="images/rotate.svg">',
                f.appendChild(XE(this, GE, "f")),
                YE(this, jE, document.createElement("span"), "f"),
                XE(this, jE, "f").textContent = "0°",
                f.appendChild(XE(this, jE, "f")),
                n.addChangeListener(YE(this, qE, (e => {
                    e ? XE(this, VE, "f").classList.add("touch") : XE(this, VE, "f").classList.remove("touch")
                }
                ), "f"))
            }
            dispose() {
                XE(this, WE, "f").removeChild(XE(this, VE, "f")),
                XE(this, HE, "f").removeChangeListener(XE(this, qE, "f"))
            }
            set rotation(e) {
                XE(this, GE, "f").style.transform = `rotate(${(90 * -e).toString()}deg)`,
                XE(this, jE, "f").textContent = (90 * e).toString() + "°"
            }
            set rotationAxis(e) {
                let t;
                switch (e) {
                case Tb.YPositive:
                    t = "images/rotation_axis_y_positive.svg";
                    break;
                case Tb.YNegative:
                    t = "images/rotation_axis_y_negative.svg";
                    break;
                case Tb.XPositive:
                    t = "images/rotation_axis_x_positive.svg";
                    break;
                case Tb.XNegative:
                    t = "images/rotation_axis_x_negative.svg";
                    break;
                case Tb.ZPositive:
                    t = "images/rotation_axis_z_positive.svg";
                    break;
                case Tb.ZNegative:
                    t = "images/rotation_axis_z_negative.svg"
                }
                XE(this, QE, "f").innerHTML = "";
                const n = document.createElement("img");
                n.src = t,
                XE(this, QE, "f").appendChild(n);
                for (const [t,n] of XE(this, KE, "f"))
                    t == e ? n.classList.add("selected") : n.classList.remove("selected")
            }
            hide() {
                XE(this, VE, "f").classList.add("hidden")
            }
            show() {
                XE(this, VE, "f").classList.remove("hidden")
            }
        }
        ;
        var JE = i(9242)
          , $E = {};
        $E.styleTagTransform = u(),
        $E.setAttributes = l(),
        $E.insert = s().bind(null, "head"),
        $E.domAPI = r(),
        $E.insertStyleElement = h();
        t()(JE.A, $E);
        JE.A && JE.A.locals && JE.A.locals;
        var eS, tS, nS, iS = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, rS = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        eS = new WeakMap,
        tS = new WeakMap,
        nS = new WeakMap;
        const aS = class {
            constructor(e, t, n, i, r, a, s, o) {
                eS.set(this, void 0),
                tS.set(this, void 0),
                nS.set(this, void 0);
                const l = document.getElementById("ui");
                if (null == l)
                    throw new Error("UI element not found");
                iS(this, eS, l, "f"),
                iS(this, tS, document.createElement("div"), "f"),
                rS(this, tS, "f").className = "editor-help",
                rS(this, eS, "f").appendChild(rS(this, tS, "f"));
                const c = document.createElement("div");
                c.className = "background",
                rS(this, tS, "f").appendChild(c);
                const h = document.createElement("section");
                h.className = "container",
                rS(this, tS, "f").appendChild(h);
                const d = document.createElement("h1");
                d.textContent = t.get("How to use the editor"),
                h.appendChild(d);
                const u = document.createElement("section");
                u.className = "content",
                h.appendChild(u);
                const p = document.createElement("h2");
                function f(e) {
                    const i = n.getKeyBindings(e).filter((e => null != e));
                    return 0 == i.length ? t.get("Not set") : i.map((e => "[" + e + "]")).join(" " + t.get("or") + " ")
                }
                p.textContent = t.get("Camera controls"),
                u.appendChild(p);
                let m = "";
                i.touchEnabled ? (m += t.get("The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.") + "\n\n",
                m += t.get("The edited height can be changed by using the height selection in the bottom left corner.")) : (m += t.get("The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.") + "\n\n",
                m += t.get("Alternatively, the camera can also be controlled using the following keyboard keys:") + "\n\n",
                m += "\t" + t.get("Move forwards:") + " " + f(gk.EditorMoveForwards) + "\n",
                m += "\t" + t.get("Move backwards:") + " " + f(gk.EditorMoveBackwards) + "\n",
                m += "\t" + t.get("Move left:") + " " + f(gk.EditorMoveLeft) + "\n",
                m += "\t" + t.get("Move right:") + " " + f(gk.EditorMoveRight) + "\n",
                m += "\t" + t.get("Rotate left:") + " " + f(gk.EditorRotateViewLeft) + "\n",
                m += "\t" + t.get("Rotate right:") + " " + f(gk.EditorRotateViewRight) + "\n\n",
                m += t.get("The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:") + "\n\n",
                m += "\t" + t.get("Move up:") + " " + f(gk.EditorMoveUp) + "\n",
                m += "\t" + t.get("Move down:") + " " + f(gk.EditorMoveDown));
                const g = document.createElement("p");
                g.textContent = m,
                u.appendChild(g);
                const v = document.createElement("h2");
                v.textContent = t.get("Editing"),
                u.appendChild(v);
                let w = "";
                i.touchEnabled ? (w += t.get("Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.") + "\n\n",
                w += t.get("The selected part can then be rotated by tapping the rotate button in the bottom left corner.") + "\n\n",
                w += t.get("Track parts can be deleted by using the delete tool in the right side menu.")) : (w += t.get("Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.") + "\n\n",
                w += t.get("Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:") + " " + f(gk.EditorPick) + "\n\n",
                w += t.get("The selected part can then be rotated using the following keyboard shortcut:") + " " + f(gk.EditorRotatePart) + "\n\n",
                w += t.get("Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:") + " " + f(gk.EditorDelete));
                const y = document.createElement("p");
                y.textContent = w,
                u.appendChild(y);
                const b = document.createElement("h2");
                b.textContent = t.get("Starting points, checkpoints and the finish line"),
                u.appendChild(b);
                let A = t.get("Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.") + "\n\n";
                A += t.get("Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.") + "\n\n",
                A += t.get("Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.") + "\n\n",
                A += t.get("The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.");
                const x = document.createElement("p");
                x.textContent = A,
                u.appendChild(x);
                const k = document.createElement("div");
                k.className = "part-images",
                u.appendChild(k);
                const E = document.createElement("div");
                k.appendChild(E);
                const S = document.createElement("img");
                S.className = "loading",
                r.then((e => {
                    S.className = "",
                    S.src = e
                }
                )).catch((e => {
                    console.error(e)
                }
                )),
                E.appendChild(S);
                const M = document.createElement("span");
                M.textContent = t.get("Starting point"),
                E.appendChild(M);
                const _ = document.createElement("div");
                k.appendChild(_);
                const T = document.createElement("img");
                T.className = "loading",
                a.then((e => {
                    T.className = "",
                    T.src = e
                }
                )).catch((e => {
                    console.error(e)
                }
                )),
                _.appendChild(T);
                const C = document.createElement("span");
                C.textContent = t.get("Checkpoint"),
                _.appendChild(C);
                const P = document.createElement("div");
                k.appendChild(P);
                const I = document.createElement("img");
                I.className = "loading",
                s.then((e => {
                    I.className = "",
                    I.src = e
                }
                )).catch((e => {
                    console.error(e)
                }
                )),
                P.appendChild(I);
                const R = document.createElement("span");
                R.textContent = t.get("Finish line"),
                P.appendChild(R);
                const L = document.createElement("h2");
                L.textContent = t.get("Exporting the track"),
                u.appendChild(L);
                const D = t.get("When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.") + "\n\n"
                  , N = document.createElement("p");
                N.textContent = D,
                u.appendChild(N);
                const B = document.createElement("div");
                B.className = "button-wrapper",
                h.appendChild(B);
                const U = document.createElement("button");
                U.className = "button",
                U.innerHTML = '<img class="button-icon" src="images/cancel.svg"> ',
                U.append(document.createTextNode(t.get("Close"))),
                U.addEventListener("click", ( () => {
                    e.playUIClick(),
                    o()
                }
                )),
                B.appendChild(U),
                window.addEventListener("keydown", iS(this, nS, (e => {
                    "Escape" == e.code && (o(),
                    e.preventDefault())
                }
                ), "f"))
            }
            dispose() {
                rS(this, eS, "f").removeChild(rS(this, tS, "f")),
                window.removeEventListener("keydown", rS(this, nS, "f"))
            }
        }
        ;
        var sS = i(1997)
          , oS = {};
        oS.styleTagTransform = u(),
        oS.setAttributes = l(),
        oS.insert = s().bind(null, "head"),
        oS.domAPI = r(),
        oS.insertStyleElement = h();
        t()(sS.A, oS);
        sS.A && sS.A.locals && sS.A.locals;
        var lS, cS, hS, dS, uS = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, pS = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        lS = new WeakMap,
        cS = new WeakMap,
        hS = new WeakMap,
        dS = new WeakMap;
        const fS = class {
            constructor(e, t, n, i, r, a, s, o, l) {
                lS.set(this, void 0),
                cS.set(this, void 0),
                hS.set(this, null),
                dS.set(this, void 0);
                const c = document.getElementById("ui");
                if (null == c)
                    throw new Error("UI element not found");
                uS(this, lS, c, "f"),
                uS(this, cS, document.createElement("div"), "f"),
                pS(this, cS, "f").className = "editor-track-settings",
                pS(this, lS, "f").appendChild(pS(this, cS, "f"));
                const h = document.createElement("div");
                h.className = "background",
                pS(this, cS, "f").appendChild(h);
                const d = document.createElement("section");
                d.className = "container",
                pS(this, cS, "f").appendChild(d);
                const u = document.createElement("h1");
                u.textContent = t.get("Track settings"),
                d.appendChild(u);
                const p = document.createElement("section");
                p.className = "content",
                d.appendChild(p);
                const f = document.createElement("div");
                f.className = "setting",
                p.appendChild(f);
                const m = document.createElement("label");
                m.className = "title",
                m.append(document.createTextNode(t.get("Track name"))),
                f.appendChild(m);
                const g = document.createElement("input");
                g.type = "text",
                g.maxLength = 64,
                g.spellcheck = !1,
                g.value = null != n ? n : "",
                g.addEventListener("input", ( () => {
                    0 == g.value.trim().length ? (null != pS(this, hS, "f") && (pS(this, hS, "f").disabled = !0),
                    f.classList.add("error")) : (null != pS(this, hS, "f") && (pS(this, hS, "f").disabled = !1),
                    f.classList.remove("error"))
                }
                )),
                f.appendChild(g),
                null != n && 0 != n.length || (f.classList.add("error"),
                g.focus());
                const v = document.createElement("div");
                v.className = "setting",
                p.appendChild(v);
                const w = document.createElement("label");
                w.className = "title",
                w.append(document.createTextNode(t.get("Author"))),
                v.appendChild(w);
                const y = document.createElement("input");
                y.type = "text",
                y.maxLength = 64,
                y.spellcheck = !1,
                y.value = null != i ? i : "",
                y.placeholder = t.get("Unknown"),
                y.addEventListener("input", ( () => {
                    const e = y.value.trim();
                    0 == e.length ? r.trackAuthor = null : r.trackAuthor = e
                }
                )),
                v.appendChild(y);
                const b = document.createElement("div");
                b.className = "setting",
                p.appendChild(b);
                const A = document.createElement("div");
                A.className = "title",
                A.append(document.createTextNode(t.get("Environment"))),
                b.appendChild(A);
                const x = document.createElement("button");
                x.className = "button environment-button",
                a.environment == IA.Summer && (x.classList.add("selected"),
                x.disabled = !0),
                x.innerHTML = '<img src="images/summer.svg"> ',
                x.append(document.createTextNode(t.get("Summer"))),
                x.addEventListener("click", ( () => {
                    e.playUIClick(),
                    s(IA.Summer),
                    x.classList.add("selected"),
                    k.classList.remove("selected"),
                    E.classList.remove("selected"),
                    x.disabled = !0,
                    k.disabled = !1,
                    E.disabled = !1
                }
                )),
                b.appendChild(x);
                const k = document.createElement("button");
                k.className = "button environment-button",
                a.environment == IA.Winter && (k.classList.add("selected"),
                k.disabled = !0),
                k.innerHTML = '<img src="images/winter.svg"> ',
                k.append(document.createTextNode(t.get("Winter"))),
                k.addEventListener("click", ( () => {
                    e.playUIClick(),
                    s(IA.Winter),
                    x.classList.remove("selected"),
                    k.classList.add("selected"),
                    E.classList.remove("selected"),
                    x.disabled = !1,
                    k.disabled = !0,
                    E.disabled = !1
                }
                )),
                b.appendChild(k);
                const E = document.createElement("button");
                E.className = "button environment-button",
                a.environment == IA.Desert && (E.classList.add("selected"),
                E.disabled = !0),
                E.innerHTML = '<img src="images/desert.svg"> ',
                E.append(document.createTextNode(t.get("Desert"))),
                E.addEventListener("click", ( () => {
                    e.playUIClick(),
                    s(IA.Desert),
                    x.classList.remove("selected"),
                    k.classList.remove("selected"),
                    E.classList.add("selected"),
                    x.disabled = !1,
                    k.disabled = !1,
                    E.disabled = !0
                }
                )),
                b.appendChild(E);
                const S = document.createElement("div");
                S.className = "setting",
                p.appendChild(S);
                const M = document.createElement("label");
                M.className = "title",
                M.append(document.createTextNode(t.get("Sun direction") + " (")),
                S.appendChild(M);
                const _ = document.createTextNode(a.sunDirection.toDegrees().toString());
                M.appendChild(_),
                M.append(document.createTextNode("°)"));
                let T = null;
                const C = document.createElement("input");
                C.type = "range",
                C.min = "0",
                C.max = "360",
                C.step = "2",
                C.value = a.sunDirection.toDegrees().toString(),
                C.addEventListener("input", ( () => {
                    a.sunDirection = CA.fromDegrees(parseInt(C.value, 10)),
                    _.textContent = C.value,
                    null == T && (T = setTimeout(( () => {
                        a.generateMeshes(),
                        T = null
                    }
                    ), 100))
                }
                )),
                S.appendChild(C);
                const P = document.createElement("div");
                P.className = "button-wrapper",
                d.appendChild(P);
                const I = document.createElement("button");
                I.className = "button",
                I.innerHTML = '<img class="button-icon" src="images/cancel.svg"> ',
                I.append(document.createTextNode(t.get("Close"))),
                I.addEventListener("click", ( () => {
                    e.playUIClick();
                    const t = g.value.trim();
                    0 == t.length ? o(null) : o(t)
                }
                )),
                P.appendChild(I),
                null != l && (uS(this, hS, document.createElement("button"), "f"),
                pS(this, hS, "f").disabled = null == n || 0 == n.length,
                pS(this, hS, "f").className = "button",
                pS(this, hS, "f").innerHTML = '<img class="button-icon" src="images/save.svg"> ',
                pS(this, hS, "f").append(document.createTextNode(t.get("Save"))),
                pS(this, hS, "f").addEventListener("click", ( () => {
                    e.playUIClick();
                    const t = g.value.trim();
                    0 == t.length || l(t)
                }
                )),
                P.appendChild(pS(this, hS, "f"))),
                window.addEventListener("keydown", uS(this, dS, (e => {
                    if ("Escape" == e.code) {
                        const t = g.value.trim();
                        0 == t.length ? o(null) : o(t),
                        e.preventDefault()
                    }
                }
                ), "f"))
            }
            dispose() {
                pS(this, lS, "f").removeChild(pS(this, cS, "f")),
                window.removeEventListener("keydown", pS(this, dS, "f"))
            }
        }
        ;
        var mS = function(e, t, n, i) {
            return new (n || (n = Promise))((function(r, a) {
                function s(e) {
                    try {
                        l(i.next(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function o(e) {
                    try {
                        l(i.throw(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(e) {
                    var t;
                    e.done ? r(e.value) : (t = e.value,
                    t instanceof n ? t : new n((function(e) {
                        e(t)
                    }
                    ))).then(s, o)
                }
                l((i = i.apply(e, t || [])).next())
            }
            ))
        };
        let gS = null
          , vS = null
          , wS = null
          , yS = null;
        function bS(e) {
            return mS(this, void 0, void 0, (function*() {
                for (; null != yS; )
                    yield yS;
                const t = function(e) {
                    return new Promise((t => {
                        setTimeout(( () => {
                            var n;
                            if (null == gS || null == vS || null == wS) {
                                const e = document.createElement("canvas");
                                e.width = 128,
                                e.height = 128,
                                gS = new eu({
                                    canvas: e,
                                    alpha: !0,
                                    preserveDrawingBuffer: !0,
                                    antialias: !0
                                }),
                                gS.outputColorSpace = wt,
                                wS = new Fr,
                                vS = new Ro(-1,1,1,-1,.5,Qu.maxViewDistance),
                                vS.position.set(1e3, 1e3, 1e3),
                                vS.lookAt(0, 0, 0),
                                wS.add(vS);
                                const t = new Do(16777215,4.7);
                                t.position.set(8, 10, 10),
                                wS.add(t)
                            }
                            e.geometry.computeBoundingSphere();
                            const i = null === (n = e.geometry.boundingSphere) || void 0 === n ? void 0 : n.clone();
                            if (null == i)
                                throw new Error("Bounding sphere is null");
                            vS.zoom = 1 / i.radius * .9,
                            vS.position.copy(i.center),
                            vS.position.addScalar(1e3),
                            vS.updateProjectionMatrix(),
                            gS.clear(),
                            wS.add(e),
                            gS.render(wS, vS),
                            wS.remove(e),
                            t(gS.domElement.toDataURL())
                        }
                        ), 25)
                    }
                    ))
                }(e);
                let n;
                yS = t;
                try {
                    n = yield t
                } finally {
                    yS = null
                }
                return n
            }
            ))
        }
        var AS, xS, kS, ES, SS, MS, _S, TS, CS, PS, IS, RS, LS, DS, NS, BS, US, zS, OS, FS, WS, HS, VS, GS, jS, QS, KS, qS, YS, XS, ZS, JS, $S, eM, tM, nM, iM, rM, aM, sM, oM, lM, cM, hM, dM, uM, pM, fM, mM, gM, vM, wM, yM, bM, AM, xM, kM, EM, SM, MM, _M, TM, CM, PM, IM, RM, LM, DM, NM, BM, UM, zM, OM, FM, WM, HM, VM, GM, jM, QM, KM, qM, YM, XM, ZM, JM, $M, e_, t_, n_, i_, r_, a_, s_, o_, l_, c_, h_, d_, u_, p_, f_, m_, g_, v_, w_, y_, b_ = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, A_ = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        xS = new WeakMap,
        kS = new WeakMap,
        ES = new WeakMap,
        SS = new WeakMap,
        MS = new WeakMap,
        _S = new WeakMap,
        TS = new WeakMap,
        CS = new WeakMap,
        PS = new WeakMap,
        IS = new WeakMap,
        RS = new WeakMap,
        LS = new WeakMap,
        DS = new WeakMap,
        NS = new WeakMap,
        BS = new WeakMap,
        US = new WeakMap,
        zS = new WeakMap,
        OS = new WeakMap,
        FS = new WeakMap,
        WS = new WeakMap,
        HS = new WeakMap,
        VS = new WeakMap,
        GS = new WeakMap,
        jS = new WeakMap,
        QS = new WeakMap,
        KS = new WeakMap,
        qS = new WeakMap,
        YS = new WeakMap,
        XS = new WeakMap,
        ZS = new WeakMap,
        JS = new WeakMap,
        $S = new WeakMap,
        eM = new WeakMap,
        tM = new WeakMap,
        nM = new WeakMap,
        iM = new WeakMap,
        rM = new WeakMap,
        aM = new WeakMap,
        sM = new WeakMap,
        oM = new WeakMap,
        lM = new WeakMap,
        cM = new WeakMap,
        hM = new WeakMap,
        dM = new WeakMap,
        uM = new WeakMap,
        pM = new WeakMap,
        fM = new WeakMap,
        mM = new WeakMap,
        gM = new WeakMap,
        vM = new WeakMap,
        wM = new WeakMap,
        yM = new WeakMap,
        bM = new WeakMap,
        AM = new WeakMap,
        xM = new WeakMap,
        kM = new WeakMap,
        EM = new WeakMap,
        SM = new WeakMap,
        MM = new WeakMap,
        _M = new WeakMap,
        TM = new WeakMap,
        CM = new WeakMap,
        PM = new WeakMap,
        IM = new WeakMap,
        RM = new WeakMap,
        LM = new WeakMap,
        DM = new WeakMap,
        NM = new WeakMap,
        BM = new WeakMap,
        UM = new WeakMap,
        zM = new WeakMap,
        OM = new WeakMap,
        FM = new WeakMap,
        WM = new WeakMap,
        HM = new WeakMap,
        VM = new WeakMap,
        GM = new WeakMap,
        jM = new WeakMap,
        QM = new WeakMap,
        KM = new WeakMap,
        qM = new WeakMap,
        YM = new WeakMap,
        XM = new WeakMap,
        ZM = new WeakMap,
        AS = new WeakSet,
        JM = function(e) {
            var t;
            b_(this, HM, e, "f"),
            A_(this, $S, "f").innerHTML = '<img class="button-icon" src="images/settings.svg"> ',
            A_(this, $S, "f").append(document.createTextNode(null !== (t = A_(this, HM, "f")) && void 0 !== t ? t : A_(this, ES, "f").get("Unnamed Track")))
        }
        ,
        $M = function(e) {
            const t = () => {
                A_(this, MS, "f").trigger(( () => {
                    b_(this, AM, !0, "f"),
                    A_(this, AS, "m", JM).call(this, null),
                    e(),
                    A_(this, zS, "f").inert = !1
                }
                ))
            }
            ;
            A_(this, AM, "f") ? t() : (A_(this, zS, "f").inert = !0,
            A_(this, LS, "f").showConfirm(A_(this, ES, "f").get("Are you sure you want to exit the editor?") + "\n\n" + A_(this, ES, "f").get("All unsaved data will be lost!"), A_(this, ES, "f").get("Cancel"), A_(this, ES, "f").get("Confirm"), ( () => {
                A_(this, zS, "f").inert = !1
            }
            ), ( () => {
                t()
            }
            )))
        }
        ,
        e_ = function() {
            if (null != A_(this, _S, "f").getStartTransform()) {
                if (null == A_(this, BS, "f"))
                    throw new Error("Test callback is null");
                A_(this, BS, "f").call(this)
            } else
                A_(this, AS, "m", r_).call(this, A_(this, ES, "f").get("Starting point is missing!"), !1)
        }
        ,
        t_ = function() {
            if (null != A_(this, NM, "f") && null != A_(this, qM, "f")) {
                const e = A_(this, KM, "f")[A_(this, qM, "f")]
                  , t = A_(this, AS, "m", g_).call(this, A_(this, NM, "f"), e.tiles);
                if (t.length > 0) {
                    let e;
                    e = A_(this, OM, "f") ? new bn(A_(this, NM, "f").x + 2,A_(this, NM, "f").y,A_(this, NM, "f").z + 2) : new bn(A_(this, NM, "f").x,A_(this, NM, "f").y,Math.floor(A_(this, NM, "f").z));
                    let n = t[0]
                      , i = e.distanceToSquared(new bn(n.x,n.y,n.z));
                    for (let r = 1; r < t.length; r++) {
                        const a = t[r]
                          , s = e.distanceToSquared(new bn(a.x,a.y,a.z));
                        s < i && (n = a,
                        i = s)
                    }
                    const r = n.parts[n.parts.length - 1]
                      , a = A_(this, KM, "f").findIndex((e => e.id == r.id));
                    if (a >= 0) {
                        const e = A_(this, KM, "f")[a];
                        b_(this, UM, r.rotation, "f"),
                        A_(this, XS, "f").rotation = A_(this, UM, "f"),
                        b_(this, zM, r.rotationAxis, "f"),
                        A_(this, XS, "f").rotationAxis = A_(this, zM, "f"),
                        b_(this, YM, r.color, "f"),
                        A_(this, AS, "m", c_).call(this, e.category),
                        A_(this, AS, "m", h_).call(this, a)
                    }
                }
            }
        }
        ,
        n_ = function() {
            var e;
            const t = A_(this, VM, "f").pop();
            if (null != t) {
                for (const e of t.added)
                    A_(this, _S, "f").deleteSpecificPart(e.id, e.x, e.y, e.z, e.rotation, e.rotationAxis);
                for (const e of t.removed)
                    A_(this, _S, "f").setPart(e.x, e.y, e.z, e.id, e.rotation, e.rotationAxis, e.color, e.checkpointOrder, e.startOrder);
                A_(this, _S, "f").generateMeshes(),
                null === (e = A_(this, QM, "f")) || void 0 === e || e.refresh(A_(this, _S, "f")),
                A_(this, KS, "f").setFromExistingCheckpoints(A_(this, _S, "f")),
                b_(this, AM, !1, "f"),
                A_(this, GM, "f").push(t)
            }
            A_(this, HS, "f").disabled = 0 == A_(this, VM, "f").length,
            A_(this, VS, "f").disabled = 0 == A_(this, GM, "f").length
        }
        ,
        i_ = function() {
            var e;
            const t = A_(this, GM, "f").pop();
            if (null != t) {
                for (const e of t.added)
                    A_(this, _S, "f").setPart(e.x, e.y, e.z, e.id, e.rotation, e.rotationAxis, e.color, e.checkpointOrder, e.startOrder);
                for (const e of t.removed)
                    A_(this, _S, "f").deleteSpecificPart(e.id, e.x, e.y, e.z, e.rotation, e.rotationAxis);
                A_(this, _S, "f").generateMeshes(),
                null === (e = A_(this, QM, "f")) || void 0 === e || e.refresh(A_(this, _S, "f")),
                A_(this, KS, "f").setFromExistingCheckpoints(A_(this, _S, "f")),
                b_(this, AM, !1, "f"),
                A_(this, VM, "f").push(t)
            }
            A_(this, HS, "f").disabled = 0 == A_(this, VM, "f").length,
            A_(this, VS, "f").disabled = 0 == A_(this, GM, "f").length
        }
        ,
        r_ = function(e, t) {
            null != A_(this, WS, "f") && (clearTimeout(A_(this, WS, "f")),
            b_(this, WS, null, "f")),
            t ? A_(this, FS, "f").classList.add("green") : A_(this, FS, "f").classList.remove("green"),
            A_(this, FS, "f").classList.remove("show"),
            A_(this, FS, "f").classList.remove("hide"),
            b_(this, WS, window.setTimeout(( () => {
                A_(this, FS, "f").textContent = e,
                A_(this, FS, "f").classList.add("show"),
                b_(this, WS, window.setTimeout(( () => {
                    A_(this, FS, "f").classList.remove("show"),
                    A_(this, FS, "f").classList.add("hide")
                }
                ), 3e3), "f")
            }
            ), 0), "f")
        }
        ,
        a_ = function() {
            var e;
            const t = A_(this, TS, "f").getAllParts();
            for (let n = 0; n < t.length; n++) {
                const i = t[n];
                let r = null === (e = A_(this, XM, "f").find((e => e.category == i.configuration.category))) || void 0 === e ? void 0 : e.partPanel;
                if (null == r) {
                    r = document.createElement("div"),
                    r.className = "part-panel hidden",
                    A_(this, GS, "f").prepend(r);
                    const e = A_(this, TS, "f").getCategoryMesh(i.configuration.category, A_(this, _S, "f").environment)
                      , t = document.createElement("button");
                    t.addEventListener("click", ( () => {
                        A_(this, AS, "m", c_).call(this, i.configuration.category),
                        A_(this, xS, "f").playUIClick()
                    }
                    )),
                    A_(this, jS, "f").appendChild(t);
                    const n = document.createElement("img");
                    n.className = "loading",
                    bS(e).then((e => {
                        n.src = e,
                        n.className = ""
                    }
                    )),
                    t.appendChild(n),
                    A_(this, XM, "f").push({
                        category: i.configuration.category,
                        button: t,
                        image: n,
                        partPanel: r,
                        selectedIndex: null
                    })
                }
                const a = document.createElement("button");
                a.addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick(),
                    A_(this, AS, "m", h_).call(this, 1 + n)
                }
                )),
                r.appendChild(a);
                const s = document.createElement("img");
                s.className = "loading",
                a.appendChild(s);
                const o = [];
                let l;
                if (i.colors.size <= 1)
                    l = null;
                else {
                    l = document.createElement("div"),
                    l.className = "color-panel hidden",
                    A_(this, GS, "f").prepend(l);
                    const e = [Eb.Default].concat(Array.from(i.colors.keys()));
                    for (const t of e) {
                        const e = document.createElement("button");
                        e.addEventListener("click", ( () => {
                            A_(this, xS, "f").playUIClick(),
                            b_(this, YM, t, "f"),
                            e.classList.add("selected");
                            const n = e.parentElement;
                            if (null == n)
                                throw new Error("Color panel not found");
                            for (const t of n.children)
                                t != e && t.classList.remove("selected")
                        }
                        )),
                        t == Eb.Default && e.classList.add("selected"),
                        l.appendChild(e);
                        const n = document.createElement("img");
                        n.className = "loading",
                        e.appendChild(n),
                        o.push([t, e, n])
                    }
                }
                const c = {
                    id: i.configuration.id,
                    trackPartData: i,
                    button: a,
                    image: s,
                    colorPanel: l,
                    colorButtons: o,
                    tiles: i.configuration.tiles,
                    isCheckpoint: null != i.configuration.detector && i.configuration.detector.type == NA.Checkpoint,
                    isStart: null != i.configuration.startOffset,
                    category: i.configuration.category
                };
                A_(this, KM, "f").push(c)
            }
        }
        ,
        s_ = function() {
            if (null == A_(this, qM, "f"))
                return Eb.Default;
            return A_(this, KM, "f")[A_(this, qM, "f")].colorButtons.some(( ([e]) => e == A_(this, YM, "f"))) ? A_(this, YM, "f") : Eb.Default
        }
        ,
        o_ = function(e) {
            A_(this, _S, "f").environment = e,
            A_(this, AS, "m", l_).call(this),
            A_(this, _S, "f").generateMeshes()
        }
        ,
        l_ = function() {
            for (const e of A_(this, XM, "f")) {
                const t = A_(this, TS, "f").getCategoryMesh(e.category, A_(this, _S, "f").environment);
                e.image.removeAttribute("src"),
                e.image.className = "loading",
                bS(t).then((t => {
                    e.image.src = t,
                    e.image.className = ""
                }
                ))
            }
            let e;
            switch (A_(this, _S, "f").environment) {
            case IA.Summer:
                e = Eb.Summer;
                break;
            case IA.Winter:
                e = Eb.Winter;
                break;
            case IA.Desert:
                e = Eb.Desert
            }
            for (const t of A_(this, KM, "f"))
                if (null != t.id)
                    if (t.category == A_(this, ZM, "f")) {
                        const n = A_(this, TS, "f").getPart(t.id).colors.get(e);
                        if (null == n)
                            throw new Error("Mesh is not loaded");
                        t.image.removeAttribute("src"),
                        t.image.className = "loading",
                        bS(n).then((e => {
                            t.image.src = e,
                            t.image.className = ""
                        }
                        ))
                    } else
                        t.image.removeAttribute("src"),
                        t.image.className = "loading"
        }
        ,
        c_ = function(e) {
            var t;
            if (A_(this, ZM, "f") != e || null == e) {
                b_(this, ZM, e, "f");
                for (const t of A_(this, XM, "f"))
                    t.category == e ? (t.button.classList.add("selected"),
                    t.partPanel.classList.remove("hidden")) : (t.button.classList.remove("selected"),
                    t.partPanel.classList.add("hidden"));
                if (null == e)
                    A_(this, AS, "m", h_).call(this, 0);
                else {
                    let n;
                    switch (A_(this, _S, "f").environment) {
                    case IA.Summer:
                        n = Eb.Summer;
                        break;
                    case IA.Winter:
                        n = Eb.Winter;
                        break;
                    case IA.Desert:
                        n = Eb.Desert
                    }
                    for (const t of A_(this, KM, "f"))
                        if (t.category == e && null != t.id && !t.image.hasAttribute("src")) {
                            const e = A_(this, TS, "f").getPart(t.id).colors.get(n);
                            if (null == e)
                                throw new Error("Mesh is not loaded");
                            t.image.className = "loading",
                            bS(e).then((e => {
                                t.image.src = e,
                                t.image.className = ""
                            }
                            ))
                        }
                    let i = null === (t = A_(this, XM, "f").find((t => t.category == e))) || void 0 === t ? void 0 : t.selectedIndex;
                    if (null == i && (i = A_(this, KM, "f").findIndex((t => t.category == e)),
                    i < 0))
                        throw new Error("Empty category");
                    A_(this, AS, "m", h_).call(this, i)
                }
            }
        }
        ,
        h_ = function(e) {
            var t;
            for (const e of A_(this, MM, "f"))
                if (A_(this, EM, "f").remove(e),
                e.geometry.dispose(),
                Array.isArray(e.material))
                    for (const t of e.material)
                        t.dispose();
                else
                    e.material.dispose();
            for (let n = 0; n < A_(this, KM, "f").length; n++) {
                const {trackPartData: i, button: r, colorPanel: a} = A_(this, KM, "f")[n];
                if (n == e) {
                    let e;
                    if (null == i) {
                        const t = new Ar(4 * Px.partSize,Px.partSize,4 * Px.partSize);
                        t.translate(0, Px.partSize / 2, 0),
                        e = new yr(t,A_(this, SM, "f"))
                    } else if (e = null === (t = i.colors.get(Eb.Summer)) || void 0 === t ? void 0 : t.clone(),
                    null == e)
                        throw new Error("Track part mesh has not loaded yet");
                    e.material = A_(this, SM, "f"),
                    A_(this, EM, "f").add(e),
                    A_(this, MM, "f").push(e),
                    r.className = "selected",
                    null == a || a.classList.remove("hidden")
                } else
                    r.className = "",
                    null == a || a.classList.add("hidden")
            }
            b_(this, qM, e, "f");
            const n = A_(this, XM, "f").find((e => e.category == A_(this, ZM, "f")));
            if (null != n && (n.selectedIndex = e),
            null != A_(this, CM, "f")) {
                if (A_(this, EM, "f").remove(A_(this, CM, "f")),
                A_(this, CM, "f").geometry.dispose(),
                Array.isArray(A_(this, CM, "f").material))
                    for (const e of A_(this, CM, "f").material)
                        e.dispose();
                else
                    A_(this, CM, "f").material.dispose();
                A_(this, CM, "f").dispose(),
                b_(this, CM, null, "f")
            }
            if (null != e && e >= 0 && e < A_(this, KM, "f").length) {
                const t = A_(this, KM, "f")[e];
                t.isCheckpoint ? A_(this, KS, "f").show() : A_(this, KS, "f").hide();
                const n = new pa(A_(this, TM, "f"),A_(this, _M, "f"),t.tiles.length);
                t.tiles.forEach(( (e, t, i, r) => {
                    const a = (new Xn).makeTranslation(e * Px.partSize, t * Px.partSize, i * Px.partSize);
                    n.setMatrixAt(r, a)
                }
                )),
                A_(this, EM, "f").add(n),
                b_(this, CM, n, "f");
                const i = A_(this, AS, "m", s_).call(this);
                if (null != t.id)
                    for (const [e,n,r] of t.colorButtons)
                        if (e == i ? n.classList.add("selected") : n.classList.remove("selected"),
                        !r.hasAttribute("src"))
                            if (e == Eb.Default)
                                r.src = "images/empty.svg",
                                r.className = "";
                            else {
                                const n = A_(this, TS, "f").getPart(t.id).colors.get(e);
                                if (null == n)
                                    throw new Error("Mesh is not loaded");
                                r.className = "loading",
                                bS(n).then((e => {
                                    r.src = e,
                                    r.className = ""
                                }
                                ))
                            }
            } else
                A_(this, KS, "f").hide();
            A_(this, AS, "m", p_).call(this)
        }
        ,
        d_ = function() {
            return Math.floor(A_(this, kM, "f").position.y / 5)
        }
        ,
        u_ = function(e) {
            const t = A_(this, AS, "a", d_);
            A_(this, kM, "f").position.y = 5 * e,
            A_(this, hM, "f").position.y += 5 * (e - t),
            A_(this, dM, "f").target.y = 5 * e,
            A_(this, QS, "f").refresh(e),
            A_(this, kM, "f").updateWorldMatrix(!0, !0),
            A_(this, dM, "f").update()
        }
        ,
        p_ = function() {
            if (null != A_(this, qM, "f") && A_(this, qM, "f") >= 0 && A_(this, qM, "f") < A_(this, KM, "f").length) {
                const e = A_(this, KM, "f")[A_(this, qM, "f")];
                b_(this, BM, 0, "f"),
                e.tiles.rotated(A_(this, UM, "f"), A_(this, zM, "f")).forEach(( (e, t) => {
                    b_(this, BM, Math.max(A_(this, BM, "f"), -t), "f")
                }
                ))
            } else
                b_(this, BM, 0, "f")
        }
        ,
        f_ = function() {
            const e = performance.now();
            if (e - A_(this, kS, "f") > 35) {
                const t = A_(this, xS, "f").getBuffer("editor_edit");
                if (null != t && null != A_(this, xS, "f").context && null != A_(this, xS, "f").destinationSfx) {
                    const e = A_(this, xS, "f").context.createBufferSource();
                    e.buffer = t,
                    e.playbackRate.value = .7;
                    const n = A_(this, xS, "f").context.createGain();
                    n.gain.value = .05,
                    e.connect(n),
                    n.connect(A_(this, xS, "f").destinationSfx),
                    e.start(0)
                }
                b_(this, kS, e, "f")
            }
        }
        ,
        m_ = function() {
            let e;
            if (A_(this, DS, "f").touchEnabled)
                e = new bn(A_(this, dM, "f").target.x / Px.partSize,A_(this, dM, "f").target.y / Px.partSize,A_(this, dM, "f").target.z / Px.partSize);
            else {
                let t;
                if (null != A_(this, RM, "f") ? (A_(this, xM, "f").setFromCamera(A_(this, RM, "f"), A_(this, SS, "f").camera),
                t = A_(this, xM, "f").intersectObjects([A_(this, kM, "f")])) : t = [],
                t.length > 0) {
                    const n = t[0];
                    e = n.point.distanceToSquared(A_(this, dM, "f").target) <= A_(this, jM, "f") * A_(this, jM, "f") ? new bn(Math.round(n.point.x / Px.partSize),Math.floor(A_(this, kM, "f").position.y / Px.partSize),Math.round(n.point.z / Px.partSize)) : null
                } else
                    e = null
            }
            if (null != e) {
                let t, n;
                t = A_(this, OM, "f") ? 4 : 1,
                n = A_(this, zM, "f") == Tb.XPositive || A_(this, zM, "f") == Tb.XNegative ? Math.round(e.x) : Math.round(e.x / t) * t;
                const i = Math.round(e.y) + A_(this, BM, "f");
                let r;
                return r = A_(this, zM, "f") == Tb.ZPositive || A_(this, zM, "f") == Tb.ZNegative ? Math.round(e.z) : Math.round(e.z / t) * t,
                new bn(n,i,r)
            }
            return null
        }
        ,
        g_ = function(e, t) {
            const n = [];
            return t.rotated(A_(this, UM, "f"), A_(this, zM, "f")).forEach(( (t, i, r) => {
                const a = e.x + t
                  , s = e.y + i
                  , o = e.z + r
                  , l = A_(this, _S, "f").getPartsAt(a, s, o);
                l.length > 0 && n.push({
                    x: a,
                    y: s,
                    z: o,
                    parts: l
                })
            }
            )),
            n
        }
        ,
        v_ = function(e, t) {
            var n;
            let i = !1;
            for (const n of e)
                for (const e of n.parts)
                    A_(this, _S, "f").deleteSpecificPart(e.id, e.x, e.y, e.z, e.rotation, e.rotationAxis) && (i = !0,
                    t.push({
                        id: e.id,
                        x: e.x,
                        y: e.y,
                        z: e.z,
                        rotation: e.rotation,
                        rotationAxis: e.rotationAxis,
                        color: e.color,
                        checkpointOrder: e.checkpointOrder,
                        startOrder: e.startOrder
                    }));
            i && (A_(this, AS, "m", f_).call(this),
            A_(this, _S, "f").generateMeshes(),
            null === (n = A_(this, QM, "f")) || void 0 === n || n.refresh(A_(this, _S, "f")),
            A_(this, KS, "f").setFromExistingCheckpoints(A_(this, _S, "f")),
            b_(this, AM, !1, "f"))
        }
        ,
        w_ = function(e) {
            const t = 4 * A_(this, dM, "f").getDistance();
            if (A_(this, US, "f") && A_(this, AS, "m", y_).call(this)) {
                const n = new bn;
                if (A_(this, pM, "f") && (n.z = -1),
                A_(this, fM, "f") && (n.x = 1),
                A_(this, mM, "f") && (n.z = 1),
                A_(this, gM, "f") && (n.x = -1),
                0 != n.x || 0 != n.z) {
                    const i = n.applyQuaternion(A_(this, hM, "f").quaternion)
                      , r = new Qt(i.x,i.z).normalize()
                      , a = new bn(r.x,0,r.y).multiplyScalar(t * e);
                    A_(this, hM, "f").position.add(a),
                    A_(this, dM, "f").target.add(a)
                }
                let i = 0;
                A_(this, vM, "f") && (i += 1.5 * Math.PI * e),
                A_(this, wM, "f") && (i -= 1.5 * Math.PI * e);
                let r = 0;
                if (A_(this, yM, "f") && (r += 1.5 * Math.PI * e),
                A_(this, bM, "f") && (r -= 1.5 * Math.PI * e),
                0 != i || 0 != r) {
                    const e = new Qt(A_(this, hM, "f").position.x,A_(this, hM, "f").position.z).distanceTo(new Qt(A_(this, dM, "f").target.x,A_(this, dM, "f").target.z))
                      , t = A_(this, hM, "f").position.y - A_(this, dM, "f").target.y
                      , n = Math.sqrt(e * e + t * t)
                      , a = Math.atan2(A_(this, hM, "f").position.z - A_(this, dM, "f").target.z, A_(this, hM, "f").position.x - A_(this, dM, "f").target.x) + r;
                    let s = Math.asin(t / n) + i;
                    s = Math.max(-Math.PI / 2 + .001, Math.min(Math.PI / 2 - .001, s)),
                    A_(this, hM, "f").position.x = A_(this, dM, "f").target.x + Math.cos(s) * Math.cos(a) * n,
                    A_(this, hM, "f").position.y = A_(this, dM, "f").target.y + Math.sin(s) * n,
                    A_(this, hM, "f").position.z = A_(this, dM, "f").target.z + Math.cos(s) * Math.sin(a) * n,
                    A_(this, dM, "f").update()
                }
            }
        }
        ,
        y_ = function() {
            return !!A_(this, US, "f") && (!A_(this, LS, "f").isOpen && null == A_(this, YS, "f") && !A_(this, qS, "f").isOpen && null == A_(this, ZS, "f") && null == A_(this, JS, "f"))
        }
        ;
        const x_ = class {
            constructor(e, t, n, i, r, a, s, o, l, c, h, d, u, p) {
                var f;
                AS.add(this),
                xS.set(this, void 0),
                kS.set(this, performance.now()),
                ES.set(this, void 0),
                SS.set(this, void 0),
                MS.set(this, void 0),
                _S.set(this, void 0),
                TS.set(this, void 0),
                CS.set(this, void 0),
                PS.set(this, void 0),
                IS.set(this, void 0),
                RS.set(this, void 0),
                LS.set(this, void 0),
                DS.set(this, void 0),
                NS.set(this, void 0),
                BS.set(this, null),
                US.set(this, !1),
                zS.set(this, void 0),
                OS.set(this, void 0),
                FS.set(this, void 0),
                WS.set(this, null),
                HS.set(this, void 0),
                VS.set(this, void 0),
                GS.set(this, void 0),
                jS.set(this, void 0),
                QS.set(this, void 0),
                KS.set(this, void 0),
                qS.set(this, void 0),
                YS.set(this, null),
                XS.set(this, void 0),
                ZS.set(this, null),
                JS.set(this, null),
                $S.set(this, void 0),
                eM.set(this, void 0),
                tM.set(this, void 0),
                nM.set(this, void 0),
                iM.set(this, void 0),
                rM.set(this, void 0),
                aM.set(this, void 0),
                sM.set(this, void 0),
                oM.set(this, void 0),
                lM.set(this, void 0),
                cM.set(this, void 0),
                hM.set(this, void 0),
                dM.set(this, void 0),
                uM.set(this, !1),
                pM.set(this, !1),
                fM.set(this, !1),
                mM.set(this, !1),
                gM.set(this, !1),
                vM.set(this, !1),
                wM.set(this, !1),
                yM.set(this, !1),
                bM.set(this, !1),
                AM.set(this, !0),
                xM.set(this, void 0),
                kM.set(this, void 0),
                EM.set(this, void 0),
                SM.set(this, void 0),
                MM.set(this, []),
                _M.set(this, void 0),
                TM.set(this, void 0),
                CM.set(this, null),
                PM.set(this, !1),
                IM.set(this, !1),
                RM.set(this, null),
                LM.set(this, null),
                DM.set(this, !1),
                NM.set(this, null),
                BM.set(this, 0),
                UM.set(this, 0),
                zM.set(this, Tb.YPositive),
                OM.set(this, !0),
                FM.set(this, !1),
                WM.set(this, null),
                HM.set(this, null),
                VM.set(this, []),
                GM.set(this, []),
                jM.set(this, 1e3),
                QM.set(this, null),
                KM.set(this, []),
                qM.set(this, null),
                YM.set(this, Eb.Default),
                XM.set(this, []),
                ZM.set(this, null),
                b_(this, ES, e, "f"),
                b_(this, xS, t, "f"),
                b_(this, SS, n, "f"),
                b_(this, MS, i, "f"),
                b_(this, _S, r, "f"),
                b_(this, TS, a, "f"),
                b_(this, IS, s, "f"),
                b_(this, RS, o, "f"),
                b_(this, CS, l, "f"),
                b_(this, PS, c, "f"),
                b_(this, LS, h, "f"),
                b_(this, DS, d, "f"),
                b_(this, NS, u, "f"),
                b_(this, hM, new Ir(70,1,.5,Qu.maxViewDistance), "f"),
                A_(this, hM, "f").position.set(40, 40, -40),
                n.scene.add(A_(this, hM, "f")),
                b_(this, dM, new fA(A_(this, hM, "f"),n.canvas), "f"),
                A_(this, dM, "f").mouseButtons = {
                    MIDDLE: v,
                    RIGHT: y
                },
                A_(this, dM, "f").minDistance = 4,
                A_(this, dM, "f").maxDistance = 600,
                b_(this, xM, new Qo, "f"),
                this.trackAuthor = o.getCurrentUserProfile().nickname,
                b_(this, SM, new Ws({
                    transparent: !0,
                    opacity: .3,
                    polygonOffset: !0,
                    polygonOffsetFactor: -.3,
                    depthWrite: !1
                }), "f"),
                b_(this, EM, new Br, "f"),
                A_(this, EM, "f").visible = !1,
                n.scene.add(A_(this, EM, "f")),
                n.addMaterial(A_(this, SM, "f")),
                b_(this, TM, (new or).setFromPoints([new bn(0,0,0), new bn(0,0,0), new bn(0,0,1), new bn(0,0,1), new bn(0,0,1), new bn(1,0,1), new bn(1,0,1), new bn(1,0,1), new bn(1,0,0), new bn(1,0,0), new bn(1,0,0), new bn(0,0,0), new bn(0,1,0), new bn(0,1,0), new bn(0,1,1), new bn(0,1,1), new bn(0,1,1), new bn(1,1,1), new bn(1,1,1), new bn(1,1,1), new bn(1,1,0), new bn(1,1,0), new bn(1,1,0), new bn(0,1,0), new bn(0,0,0), new bn(0,0,0), new bn(0,1,0), new bn(0,0,1), new bn(0,0,1), new bn(0,1,1), new bn(1,0,1), new bn(1,0,1), new bn(1,1,1), new bn(1,0,0), new bn(1,0,0), new bn(1,1,0)]).scale(Px.partSize, Px.partSize, Px.partSize), "f"),
                b_(this, _M, new Qi({
                    wireframe: !0
                }), "f"),
                b_(this, kM, new yr(new Bs(1e6,1e6),new Qi({
                    side: 2
                })), "f"),
                A_(this, kM, "f").rotation.x = -Math.PI / 2,
                A_(this, kM, "f").updateWorldMatrix(!0, !0),
                n.canvas.addEventListener("mousemove", b_(this, eM, (e => {
                    const t = e.clientX / window.innerWidth * 2 - 1
                      , n = -e.clientY / window.innerHeight * 2 + 1;
                    null == A_(this, RM, "f") ? b_(this, RM, new Qt(t,n), "f") : A_(this, RM, "f").set(t, n)
                }
                ), "f")),
                n.canvas.addEventListener("mousedown", b_(this, tM, (e => {
                    0 == e.button && b_(this, IM, !0, "f"),
                    1 == e.button && e.preventDefault()
                }
                ), "f")),
                window.addEventListener("mouseup", b_(this, nM, (e => {
                    0 == e.button && (b_(this, IM, !1, "f"),
                    b_(this, WM, null, "f"))
                }
                ), "f")),
                n.canvas.addEventListener("mouseout", b_(this, iM, ( () => {
                    b_(this, RM, null, "f")
                }
                ), "f")),
                n.canvas.addEventListener("touchstart", b_(this, rM, ( () => {
                    A_(this, DS, "f").touchEnabled && b_(this, LM, Date.now(), "f")
                }
                ), "f")),
                n.canvas.addEventListener("click", b_(this, aM, ( () => {
                    A_(this, DS, "f").touchEnabled && null != A_(this, LM, "f") && Date.now() - A_(this, LM, "f") < 200 && (b_(this, LM, null, "f"),
                    b_(this, DM, !0, "f"))
                }
                ), "f")),
                window.addEventListener("keydown", b_(this, sM, (e => {
                    A_(this, AS, "m", y_).call(this) && (A_(this, LS, "f").isOpen || A_(this, qS, "f").isOpen || null != A_(this, YS, "f") || null != A_(this, ZS, "f") || "Escape" == e.code && (A_(this, AS, "m", $M).call(this, p),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorHeightModifier) && (b_(this, uM, !0, "f"),
                    A_(this, dM, "f").enableZoom = !1,
                    e.preventDefault()),
                    e.ctrlKey ? ("KeyZ" == e.code && (A_(this, AS, "m", n_).call(this),
                    e.preventDefault()),
                    "KeyY" == e.code && (A_(this, AS, "m", i_).call(this),
                    e.preventDefault())) : (u.checkKeyBinding(e, gk.EditorRotatePart) && (b_(this, UM, (A_(this, UM, "f") + 1) % 4, "f"),
                    A_(this, XS, "f").rotation = A_(this, UM, "f"),
                    A_(this, AS, "m", p_).call(this),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorDelete) && (b_(this, PM, !0, "f"),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorMoveForwards) && (b_(this, pM, !0, "f"),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorMoveRight) && (b_(this, fM, !0, "f"),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorMoveBackwards) && (b_(this, mM, !0, "f"),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorMoveLeft) && (b_(this, gM, !0, "f"),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorRotateViewUp) && (b_(this, vM, !0, "f"),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorRotateViewDown) && (b_(this, wM, !0, "f"),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorRotateViewLeft) && (b_(this, yM, !0, "f"),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorRotateViewRight) && (b_(this, bM, !0, "f"),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorMoveDown) && (b_(this, AS, Math.max(0, A_(this, AS, "a", d_) - 1), "a", u_),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorMoveUp) && (b_(this, AS, A_(this, AS, "a", d_) + 1, "a", u_),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorTest) && (A_(this, AS, "m", e_).call(this),
                    e.preventDefault()),
                    u.checkKeyBinding(e, gk.EditorPick) && (A_(this, AS, "m", t_).call(this),
                    e.preventDefault())))
                }
                ), "f")),
                window.addEventListener("keyup", b_(this, oM, (e => {
                    u.checkKeyBinding(e, gk.EditorHeightModifier) && (b_(this, uM, !1, "f"),
                    A_(this, dM, "f").enableZoom = !0),
                    e.ctrlKey || (u.checkKeyBinding(e, gk.EditorDelete) && b_(this, PM, !1, "f"),
                    u.checkKeyBinding(e, gk.EditorMoveForwards) && b_(this, pM, !1, "f"),
                    u.checkKeyBinding(e, gk.EditorMoveRight) && b_(this, fM, !1, "f"),
                    u.checkKeyBinding(e, gk.EditorMoveBackwards) && b_(this, mM, !1, "f"),
                    u.checkKeyBinding(e, gk.EditorMoveLeft) && b_(this, gM, !1, "f"),
                    u.checkKeyBinding(e, gk.EditorRotateViewUp) && b_(this, vM, !1, "f"),
                    u.checkKeyBinding(e, gk.EditorRotateViewDown) && b_(this, wM, !1, "f"),
                    u.checkKeyBinding(e, gk.EditorRotateViewLeft) && b_(this, yM, !1, "f"),
                    u.checkKeyBinding(e, gk.EditorRotateViewRight) && b_(this, bM, !1, "f"))
                }
                ), "f")),
                window.addEventListener("wheel", b_(this, lM, (e => {
                    A_(this, uM, "f") && A_(this, US, "f") && (e.deltaY > 0 ? b_(this, AS, A_(this, AS, "a", d_) + 1, "a", u_) : e.deltaY < 0 && b_(this, AS, Math.max(0, A_(this, AS, "a", d_) - 1), "a", u_))
                }
                ), "f")),
                window.addEventListener("beforeunload", b_(this, cM, (e => !A_(this, AM, "f") && (e.preventDefault(),
                !0)), "f"));
                const m = document.getElementById("ui");
                if (null == m)
                    throw new Error("Failed to find UI element");
                b_(this, zS, document.createElement("div"), "f"),
                A_(this, zS, "f").className = "hidden",
                m.appendChild(A_(this, zS, "f"));
                const g = document.createElement("div");
                g.className = "safe-area-left",
                A_(this, zS, "f").appendChild(g);
                const w = document.createElement("div");
                w.className = "safe-area-right",
                A_(this, zS, "f").appendChild(w),
                b_(this, OS, document.createElement("div"), "f"),
                A_(this, OS, "f").className = "top",
                A_(this, zS, "f").appendChild(A_(this, OS, "f"));
                const b = document.createElement("div");
                b.className = "button-bar",
                A_(this, OS, "f").appendChild(b);
                const A = document.createElement("button");
                A.className = "button",
                A.innerHTML = '<img class="button-icon" src="images/quit.svg"> ',
                A.append(document.createTextNode(A_(this, ES, "f").get("Exit"))),
                A.addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick(),
                    A_(this, AS, "m", $M).call(this, p)
                }
                )),
                b.appendChild(A);
                const x = document.createElement("button");
                x.className = "button",
                x.innerHTML = '<img class="button-icon" src="images/test.svg"> ',
                x.append(A_(this, ES, "f").get("Test")),
                x.addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick(),
                    A_(this, AS, "m", e_).call(this)
                }
                )),
                b.appendChild(x);
                const k = document.createElement("button");
                k.className = "button",
                k.innerHTML = '<img class="button-icon" src="images/random.svg"> ',
                k.append(A_(this, ES, "f").get("Generate")),
                k.addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick();
                    const e = () => {
                        var e;
                        !function(e) {
                            let t;
                            e.clear();
                            do {
                                let n = 0
                                  , i = 0
                                  , r = 0
                                  , a = Math.floor(4 * Math.random());
                                Math.random() < .5 && (i = Math.floor(20 * Math.random()));
                                const s = new Map;
                                function o() {
                                    switch (a) {
                                    case 0:
                                        --r;
                                        break;
                                    case 1:
                                        --n;
                                        break;
                                    case 2:
                                        ++r;
                                        break;
                                    case 3:
                                        ++n
                                    }
                                }
                                function l() {
                                    switch (a) {
                                    case 0:
                                        ++r;
                                        break;
                                    case 1:
                                        ++n;
                                        break;
                                    case 2:
                                        --r;
                                        break;
                                    case 3:
                                        --n
                                    }
                                }
                                function c() {
                                    switch ((a + 1) % 4) {
                                    case 0:
                                        --r;
                                        break;
                                    case 1:
                                        --n;
                                        break;
                                    case 2:
                                        ++r;
                                        break;
                                    case 3:
                                        ++n
                                    }
                                }
                                function h() {
                                    switch (((a - 1) % 4 + 4) % 4) {
                                    case 0:
                                        --r;
                                        break;
                                    case 1:
                                        --n;
                                        break;
                                    case 2:
                                        ++r;
                                        break;
                                    case 3:
                                        ++n
                                    }
                                }
                                function d(e, n, i, r=null) {
                                    const a = e.toString() + "|" + n.toString() + "|" + i.toString();
                                    s.has(a) && (t = !0),
                                    null != r && (r.x = e,
                                    r.y = n,
                                    r.z = i,
                                    "direction"in r && (r.direction = (r.direction % 4 + 4) % 4)),
                                    s.set(a, r)
                                }
                                function u(e, t, n) {
                                    return !!s.has(e.toString() + "|" + t.toString() + "|" + n.toString())
                                }
                                function p() {
                                    let e = !1;
                                    for (let t = 0; t < i; ++t)
                                        if (u(n, t, r)) {
                                            e = !0;
                                            break
                                        }
                                    if (!e)
                                        for (let e = 0; e < i; ++e) {
                                            let t;
                                            t = 0 == e && e == i - 1 ? 22 : 0 == e ? 21 : e == i - 1 ? 19 : 20,
                                            d(n, e, r, {
                                                type: t,
                                                direction: 0
                                            })
                                        }
                                }
                                function f(e) {
                                    e > 0 ? (--e,
                                    Math.random() < .2 ? E(e) : Math.random() < .6 ? g(e) : Math.random() < .5 ? y(e, i < 2 || Math.random() < .5) : Math.random() < .5 ? v(e) : w(e)) : x()
                                }
                                function m(e) {
                                    e > 0 ? (--e,
                                    Math.random() < .1 ? S(e) : Math.random() < .6 ? M(e) : Math.random() < .5 ? C(e, i < 2 || Math.random() < .5) : Math.random() < .5 ? _(e) : T(e)) : S(e)
                                }
                                function g(e) {
                                    d(n, i, r, {
                                        type: 0,
                                        direction: a
                                    }),
                                    p(),
                                    o(),
                                    f(e)
                                }
                                function v(e) {
                                    d(n, i, r, {
                                        type: 1,
                                        direction: a - 1
                                    }),
                                    p(),
                                    a = (a + 1) % 4,
                                    o(),
                                    e > 0 ? (--e,
                                    Math.random() < .4 ? g(e) : Math.random() < .5 ? v(e) : w(e)) : x()
                                }
                                function w(e) {
                                    d(n, i, r, {
                                        type: 1,
                                        direction: a
                                    }),
                                    p(),
                                    a = ((a - 1) % 4 + 4) % 4,
                                    o(),
                                    e > 0 ? (--e,
                                    Math.random() < .4 ? g(e) : Math.random() < .5 ? v(e) : w(e)) : x()
                                }
                                function y(e, t) {
                                    let s;
                                    s = t ? 2 : 3,
                                    t || --i,
                                    d(n, i + 1, r),
                                    d(n, i, r, {
                                        type: s,
                                        direction: a
                                    }),
                                    o(),
                                    t && ++i,
                                    e > 0 ? (--e,
                                    Math.random() < .4 || i <= 3 ? b(e, t) : A(e, t)) : b(e, t)
                                }
                                function b(e, t) {
                                    let s;
                                    t || --i,
                                    d(n, i + 1, r),
                                    s = t ? 3 : 2,
                                    d(n, i, r, {
                                        type: s,
                                        direction: a + 2
                                    }),
                                    o(),
                                    t && ++i,
                                    e > 0 ? f(--e) : x()
                                }
                                function A(e, t) {
                                    let s;
                                    t || (i -= 2),
                                    d(n, i + 1, r),
                                    d(n, i + 2, r),
                                    s = t ? a : a + 2,
                                    d(n, i, r, {
                                        type: 4,
                                        direction: s
                                    }),
                                    o(),
                                    t && (i += 2),
                                    e > 0 ? (--e,
                                    Math.random() < .4 || i <= 3 ? b(e, t) : A(e, t)) : b(e, t)
                                }
                                function x() {
                                    d(n, i, r, {
                                        type: 6,
                                        direction: a
                                    })
                                }
                                function k(e) {
                                    d(n, i, r, {
                                        type: 5,
                                        direction: a
                                    }),
                                    p(),
                                    o(),
                                    f(e)
                                }
                                function E(e) {
                                    Math.random() < .5 ? (d(n, i, r, {
                                        type: 8,
                                        direction: a
                                    }),
                                    p(),
                                    h(),
                                    d(n, i, r, {
                                        type: 12,
                                        direction: a + 2
                                    }),
                                    p(),
                                    o()) : (d(n, i, r, {
                                        type: 9,
                                        direction: a
                                    }),
                                    p(),
                                    c(),
                                    d(n, i, r, {
                                        type: 12,
                                        direction: a + 1
                                    }),
                                    p(),
                                    o(),
                                    h()),
                                    m(e)
                                }
                                function S(e) {
                                    Math.random() < .5 ? (d(n, i, r, {
                                        type: 12,
                                        direction: a + 3
                                    }),
                                    p(),
                                    c(),
                                    d(n, i, r, {
                                        type: 9,
                                        direction: a + 2
                                    }),
                                    p(),
                                    o()) : (d(n, i, r, {
                                        type: 8,
                                        direction: a + 2
                                    }),
                                    p(),
                                    c(),
                                    d(n, i, r, {
                                        type: 12,
                                        direction: a
                                    }),
                                    p(),
                                    o(),
                                    h()),
                                    f(e)
                                }
                                function M(e) {
                                    d(n, i, r, {
                                        type: 10,
                                        direction: a
                                    }),
                                    p(),
                                    c(),
                                    d(n, i, r, {
                                        type: 10,
                                        direction: a + 2
                                    }),
                                    p(),
                                    h(),
                                    o(),
                                    m(e)
                                }
                                function _(e) {
                                    d(n, i, r, {
                                        type: 10,
                                        direction: a
                                    }),
                                    p(),
                                    o(),
                                    d(n, i, r, {
                                        type: 12,
                                        direction: a + 3
                                    }),
                                    p(),
                                    c(),
                                    d(n, i, r, {
                                        type: 10,
                                        direction: a + 1
                                    }),
                                    p(),
                                    l(),
                                    d(n, i, r, {
                                        type: 11,
                                        direction: a + 3
                                    }),
                                    p(),
                                    o(),
                                    a = (a + 1) % 4,
                                    o(),
                                    m(e)
                                }
                                function T(e) {
                                    d(n, i, r, {
                                        type: 11,
                                        direction: a
                                    }),
                                    p(),
                                    c(),
                                    d(n, i, r, {
                                        type: 10,
                                        direction: a + 2
                                    }),
                                    p(),
                                    o(),
                                    d(n, i, r, {
                                        type: 12,
                                        direction: a
                                    }),
                                    p(),
                                    h(),
                                    d(n, i, r, {
                                        type: 10,
                                        direction: a + 1
                                    }),
                                    p(),
                                    l(),
                                    a = ((a - 1) % 4 + 4) % 4,
                                    o(),
                                    m(e)
                                }
                                function C(e, t) {
                                    let s, l;
                                    t ? (s = 13,
                                    l = 14) : (s = 15,
                                    l = 16),
                                    t || --i,
                                    c(),
                                    d(n, i + 1, r),
                                    d(n, i, r, {
                                        type: s,
                                        direction: a
                                    }),
                                    h(),
                                    d(n, i + 1, r),
                                    d(n, i, r, {
                                        type: l,
                                        direction: a
                                    }),
                                    o(),
                                    t && ++i,
                                    e > 0 ? (--e,
                                    Math.random() < .4 || i <= 3 ? P(e, t) : I(e, t)) : P(e, t)
                                }
                                function P(e, t) {
                                    let s, l;
                                    t || --i,
                                    t ? (s = 16,
                                    l = 15) : (s = 14,
                                    l = 13),
                                    c(),
                                    d(n, i + 1, r),
                                    d(n, i, r, {
                                        type: s,
                                        direction: a + 2
                                    }),
                                    h(),
                                    d(n, i + 1, r),
                                    d(n, i, r, {
                                        type: l,
                                        direction: a + 2
                                    }),
                                    o(),
                                    t && ++i,
                                    m(e)
                                }
                                function I(e, t) {
                                    t || (i -= 2),
                                    t ? (c(),
                                    d(n, i + 1, r),
                                    d(n, i + 2, r),
                                    d(n, i, r, {
                                        type: 17,
                                        direction: a
                                    }),
                                    h(),
                                    d(n, i + 1, r),
                                    d(n, i + 2, r),
                                    d(n, i, r, {
                                        type: 18,
                                        direction: a
                                    })) : (c(),
                                    d(n, i + 1, r),
                                    d(n, i + 2, r),
                                    d(n, i, r, {
                                        type: 18,
                                        direction: a + 2
                                    }),
                                    h(),
                                    d(n, i + 1, r),
                                    d(n, i + 2, r),
                                    d(n, i, r, {
                                        type: 17,
                                        direction: a + 2
                                    })),
                                    o(),
                                    t && (i += 2),
                                    e > 0 ? (--e,
                                    Math.random() < .4 || i <= 3 ? P(e, t) : I(e, t)) : P(e, t)
                                }
                                if (t = !1,
                                k(50),
                                !t)
                                    for (const R of s.values())
                                        if (null != R) {
                                            let L = null;
                                            R.type == Mb.Start && (L = 0),
                                            e.setPart(4 * R.x, R.y, 4 * R.z, R.type, R.direction, Tb.YPositive, Eb.Default, null, L)
                                        }
                            } while (t)
                        }(A_(this, _S, "f")),
                        A_(this, _S, "f").generateMeshes(),
                        null === (e = A_(this, QM, "f")) || void 0 === e || e.refresh(A_(this, _S, "f")),
                        A_(this, KS, "f").setFromExistingCheckpoints(A_(this, _S, "f")),
                        A_(this, VM, "f").length = 0,
                        A_(this, GM, "f").length = 0,
                        A_(this, HS, "f").disabled = !0,
                        A_(this, VS, "f").disabled = !0,
                        b_(this, AM, !0, "f")
                    }
                    ;
                    A_(this, AM, "f") ? e() : (A_(this, zS, "f").inert = !0,
                    A_(this, LS, "f").showConfirm(A_(this, ES, "f").get("Are you sure you want to generate a new track?\n\nYour current track will be lost!"), A_(this, ES, "f").get("Cancel"), A_(this, ES, "f").get("Confirm"), ( () => {
                        A_(this, zS, "f").inert = !1
                    }
                    ), ( () => {
                        e(),
                        A_(this, zS, "f").inert = !1
                    }
                    )))
                }
                )),
                b.appendChild(k),
                b_(this, qS, new zE(m,A_(this, ES, "f"),A_(this, xS, "f"),A_(this, CS, "f"),A_(this, PS, "f"),A_(this, RS, "f"),A_(this, LS, "f"),A_(this, IS, "f"),!0,( () => {
                    A_(this, zS, "f").className = "editor",
                    A_(this, qS, "f").hide()
                }
                ),( (e, t) => {
                    var n;
                    const i = A_(this, _S, "f").environment;
                    A_(this, _S, "f").loadTrackData(t, !1),
                    A_(this, _S, "f").environment != i && A_(this, AS, "m", l_).call(this),
                    A_(this, _S, "f").generateMeshes(),
                    null === (n = A_(this, QM, "f")) || void 0 === n || n.refresh(A_(this, _S, "f")),
                    A_(this, KS, "f").setFromExistingCheckpoints(A_(this, _S, "f")),
                    b_(this, AM, !0, "f"),
                    A_(this, VM, "f").length = 0,
                    A_(this, GM, "f").length = 0,
                    A_(this, HS, "f").disabled = !0,
                    A_(this, VS, "f").disabled = !0,
                    A_(this, AS, "m", JM).call(this, e.name),
                    this.trackAuthor = e.author;
                    const r = A_(this, _S, "f").getStart();
                    if (null != r)
                        this.resetView(r.x, r.y, r.z);
                    else {
                        const e = A_(this, _S, "f").getBounds();
                        this.resetView(e.min.x + Math.floor((e.max.x - e.min.x) / 2), 0, e.min.y + Math.floor((e.max.y - e.min.y) / 2))
                    }
                    A_(this, zS, "f").className = "editor",
                    A_(this, qS, "f").hide()
                }
                )), "f"),
                b_(this, XS, new ZE(A_(this, zS, "f"),A_(this, xS, "f"),A_(this, DS, "f"),(e => {
                    b_(this, FM, e, "f")
                }
                ),(e => {
                    b_(this, OM, e, "f")
                }
                ),(e => {
                    b_(this, zM, e, "f"),
                    A_(this, XS, "f").rotationAxis = A_(this, zM, "f"),
                    A_(this, AS, "m", p_).call(this)
                }
                ),( () => {
                    b_(this, UM, (A_(this, UM, "f") + 1) % 4, "f"),
                    A_(this, XS, "f").rotation = A_(this, UM, "f"),
                    A_(this, AS, "m", p_).call(this)
                }
                )), "f");
                const E = document.createElement("button");
                E.className = "button",
                E.innerHTML = '<img class="button-icon" src="images/load.svg"> ',
                E.append(document.createTextNode(A_(this, ES, "f").get("Load"))),
                E.addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick(),
                    A_(this, AM, "f") ? (A_(this, qS, "f").show(),
                    A_(this, zS, "f").className = "hidden") : (A_(this, zS, "f").inert = !0,
                    A_(this, LS, "f").showConfirm(A_(this, ES, "f").get("Are you sure you want to load a new track?\n\nYour current track will be lost!"), A_(this, ES, "f").get("Cancel"), A_(this, ES, "f").get("Confirm"), ( () => {
                        A_(this, zS, "f").inert = !1
                    }
                    ), ( () => {
                        A_(this, qS, "f").show(),
                        A_(this, zS, "f").className = "hidden",
                        A_(this, zS, "f").inert = !1
                    }
                    )))
                }
                )),
                b.appendChild(E);
                const S = document.createElement("button");
                S.className = "button",
                S.innerHTML = '<img class="button-icon" src="images/save.svg"> ',
                S.append(document.createTextNode(A_(this, ES, "f").get("Save"))),
                S.addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick();
                    const e = e => {
                        const t = {
                            name: e,
                            author: this.trackAuthor
                        }
                          , n = A_(this, _S, "f").getTrackData();
                        A_(this, PS, "f").saveCustomTrack(t, n) ? (A_(this, AS, "m", r_).call(this, A_(this, ES, "f").get("Track saved!"), !0),
                        b_(this, AM, !0, "f")) : A_(this, AS, "m", r_).call(this, A_(this, ES, "f").get("Failed to save!"), !1)
                    }
                      , t = this.getTrackName();
                    if (null == t)
                        A_(this, zS, "f").className = "hidden",
                        b_(this, JS, new fS(A_(this, xS, "f"),A_(this, ES, "f"),A_(this, HM, "f"),this.trackAuthor,this,A_(this, _S, "f"),(e => {
                            A_(this, AS, "m", o_).call(this, e)
                        }
                        ),(e => {
                            var t;
                            A_(this, AS, "m", JM).call(this, e),
                            null === (t = A_(this, JS, "f")) || void 0 === t || t.dispose(),
                            b_(this, JS, null, "f"),
                            A_(this, zS, "f").className = "editor"
                        }
                        ),(t => {
                            var n;
                            A_(this, AS, "m", JM).call(this, t),
                            null === (n = A_(this, JS, "f")) || void 0 === n || n.dispose(),
                            b_(this, JS, null, "f"),
                            e(t),
                            A_(this, zS, "f").className = "editor"
                        }
                        )), "f");
                    else {
                        A_(this, PS, "f").checkCustomTrackNameExists(t) ? (A_(this, zS, "f").inert = !0,
                        A_(this, LS, "f").showConfirm(A_(this, ES, "f").get('Are you sure you want to overwrite "{0}"?', [t]), A_(this, ES, "f").get("Cancel"), A_(this, ES, "f").get("Confirm"), ( () => {
                            A_(this, zS, "f").inert = !1
                        }
                        ), ( () => {
                            e(t),
                            A_(this, zS, "f").inert = !1
                        }
                        ))) : e(t)
                    }
                }
                )),
                b.appendChild(S);
                const M = document.createElement("button");
                M.className = "button",
                M.innerHTML = '<img class="button-icon" src="images/export.svg"> ',
                M.append(document.createTextNode(A_(this, ES, "f").get("Export"))),
                M.addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick();
                    const e = this.getTrackName();
                    if (null == e)
                        A_(this, zS, "f").className = "hidden",
                        b_(this, JS, new fS(A_(this, xS, "f"),A_(this, ES, "f"),A_(this, HM, "f"),this.trackAuthor,this,A_(this, _S, "f"),(e => {
                            A_(this, AS, "m", o_).call(this, e)
                        }
                        ),(e => {
                            var t;
                            A_(this, AS, "m", JM).call(this, e),
                            null === (t = A_(this, JS, "f")) || void 0 === t || t.dispose(),
                            b_(this, JS, null, "f"),
                            A_(this, zS, "f").className = "editor"
                        }
                        ),(e => {
                            var t;
                            A_(this, AS, "m", JM).call(this, e),
                            null === (t = A_(this, JS, "f")) || void 0 === t || t.dispose(),
                            b_(this, JS, null, "f");
                            const n = {
                                name: e,
                                author: this.trackAuthor
                            }
                              , i = A_(this, _S, "f").getTrackData().toExportString(n);
                            b_(this, YS, new Tk(i,( () => {
                                var e;
                                null === (e = A_(this, YS, "f")) || void 0 === e || e.dispose(),
                                b_(this, YS, null, "f"),
                                A_(this, zS, "f").className = "editor"
                            }
                            ),null,!1,A_(this, ES, "f"),A_(this, xS, "f"),A_(this, PS, "f"),A_(this, LS, "f")), "f")
                        }
                        )), "f");
                    else {
                        A_(this, zS, "f").className = "hidden";
                        const t = {
                            name: e,
                            author: this.trackAuthor
                        }
                          , n = A_(this, _S, "f").getTrackData().toExportString(t);
                        b_(this, YS, new Tk(n,( () => {
                            var e;
                            null === (e = A_(this, YS, "f")) || void 0 === e || e.dispose(),
                            b_(this, YS, null, "f"),
                            A_(this, zS, "f").className = "editor"
                        }
                        ),null,!1,A_(this, ES, "f"),A_(this, xS, "f"),A_(this, PS, "f"),A_(this, LS, "f")), "f")
                    }
                }
                )),
                b.appendChild(M);
                const _ = document.createElement("button");
                _.className = "button",
                _.innerHTML = '<img class="button-icon" src="images/help.svg"> ',
                _.append(document.createTextNode(A_(this, ES, "f").get("Help"))),
                _.addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick();
                    const e = A_(this, TS, "f").getPart(Mb.Start).colors.get(Eb.Summer);
                    if (null == e)
                        throw new Error("Starting point mesh is null");
                    const t = bS(e)
                      , n = A_(this, TS, "f").getPart(Mb.Checkpoint).colors.get(Eb.Summer);
                    if (null == n)
                        throw new Error("Checkpoint mesh is null");
                    const i = bS(n)
                      , r = A_(this, TS, "f").getPart(Mb.Finish).colors.get(Eb.Summer);
                    if (null == r)
                        throw new Error("Finish line mesh is null");
                    const a = bS(r);
                    A_(this, zS, "f").className = "hidden",
                    b_(this, ZS, new aS(A_(this, xS, "f"),A_(this, ES, "f"),A_(this, NS, "f"),A_(this, DS, "f"),t,i,a,( () => {
                        var e;
                        null === (e = A_(this, ZS, "f")) || void 0 === e || e.dispose(),
                        b_(this, ZS, null, "f"),
                        A_(this, zS, "f").className = "editor"
                    }
                    )), "f")
                }
                )),
                b.appendChild(_);
                const T = document.createElement("div");
                T.className = "track-settings-container",
                A_(this, OS, "f").appendChild(T),
                b_(this, $S, document.createElement("button"), "f"),
                A_(this, $S, "f").className = "button",
                A_(this, $S, "f").innerHTML = '<img class="button-icon" src="images/settings.svg"> ',
                A_(this, $S, "f").append(document.createTextNode(null !== (f = A_(this, HM, "f")) && void 0 !== f ? f : A_(this, ES, "f").get("Unnamed Track"))),
                A_(this, $S, "f").addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick(),
                    A_(this, zS, "f").className = "hidden",
                    b_(this, JS, new fS(A_(this, xS, "f"),A_(this, ES, "f"),A_(this, HM, "f"),this.trackAuthor,this,A_(this, _S, "f"),(e => {
                        A_(this, AS, "m", o_).call(this, e)
                    }
                    ),(e => {
                        var t;
                        A_(this, AS, "m", JM).call(this, e),
                        null === (t = A_(this, JS, "f")) || void 0 === t || t.dispose(),
                        b_(this, JS, null, "f"),
                        A_(this, zS, "f").className = "editor"
                    }
                    ),null), "f")
                }
                )),
                T.appendChild(A_(this, $S, "f")),
                b_(this, FS, document.createElement("div"), "f"),
                A_(this, FS, "f").className = "message",
                A_(this, zS, "f").appendChild(A_(this, FS, "f"));
                const C = document.createElement("side");
                C.className = "side",
                A_(this, zS, "f").appendChild(C);
                const P = document.createElement("div");
                P.className = "container",
                C.appendChild(P);
                const I = document.createElement("div");
                I.className = "undo-container",
                P.appendChild(I),
                b_(this, HS, document.createElement("button"), "f"),
                A_(this, HS, "f").disabled = !0,
                A_(this, HS, "f").className = "button",
                A_(this, HS, "f").innerHTML = '<img class="button-icon" src="images/undo.svg">',
                A_(this, HS, "f").addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick(),
                    A_(this, AS, "m", n_).call(this)
                }
                )),
                I.appendChild(A_(this, HS, "f")),
                b_(this, VS, document.createElement("button"), "f"),
                A_(this, VS, "f").disabled = !0,
                A_(this, VS, "f").className = "button",
                A_(this, VS, "f").innerHTML = '<img class="button-icon" src="images/redo.svg">',
                A_(this, VS, "f").addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick(),
                    A_(this, AS, "m", i_).call(this)
                }
                )),
                I.appendChild(A_(this, VS, "f")),
                b_(this, KS, new ek(P,A_(this, ES, "f"),A_(this, xS, "f"),A_(this, DS, "f")), "f"),
                b_(this, GS, document.createElement("div"), "f"),
                A_(this, GS, "f").className = "side-panel",
                C.appendChild(A_(this, GS, "f")),
                b_(this, jS, document.createElement("div"), "f"),
                A_(this, jS, "f").className = "category-panel",
                A_(this, GS, "f").appendChild(A_(this, jS, "f"));
                const R = document.createElement("button");
                R.addEventListener("click", ( () => {
                    A_(this, xS, "f").playUIClick(),
                    A_(this, AS, "m", c_).call(this, null)
                }
                )),
                A_(this, jS, "f").appendChild(R);
                const L = document.createElement("img");
                L.src = "images/erase.svg",
                R.appendChild(L),
                A_(this, KM, "f").push({
                    id: null,
                    trackPartData: null,
                    button: R,
                    image: L,
                    colorPanel: null,
                    colorButtons: [],
                    tiles: new FA([[-2, 0, -2], [-1, 0, -2], [0, 0, -2], [1, 0, -2], [-2, 0, -1], [-1, 0, -1], [0, 0, -1], [1, 0, -1], [-2, 0, 0], [-1, 0, 0], [0, 0, 0], [1, 0, 0], [-2, 0, 1], [-1, 0, 1], [0, 0, 1], [1, 0, 1]]),
                    isCheckpoint: !1,
                    isStart: !1,
                    category: null
                }),
                b_(this, QS, new fk(A_(this, zS, "f"),A_(this, ES, "f"),A_(this, DS, "f"),( () => {
                    A_(this, xS, "f").playUIClick(),
                    b_(this, AS, A_(this, AS, "a", d_) + 1, "a", u_)
                }
                ),( () => {
                    A_(this, xS, "f").playUIClick(),
                    b_(this, AS, Math.max(0, A_(this, AS, "a", d_) - 1), "a", u_)
                }
                )), "f"),
                A_(this, QS, "f").refresh(A_(this, AS, "a", d_))
            }
            dispose() {
                var e, t, n;
                b_(this, US, !1, "f"),
                null === (e = A_(this, QM, "f")) || void 0 === e || e.dispose(),
                A_(this, QS, "f").dispose(),
                A_(this, KS, "f").dispose(),
                null === (t = A_(this, YS, "f")) || void 0 === t || t.dispose(),
                b_(this, YS, null, "f"),
                A_(this, qS, "f").dispose(),
                A_(this, XS, "f").dispose(),
                null === (n = A_(this, ZS, "f")) || void 0 === n || n.dispose(),
                b_(this, ZS, null, "f");
                const i = document.getElementById("ui");
                if (null == i)
                    throw new Error("Failed to find UI element");
                i.removeChild(A_(this, zS, "f")),
                A_(this, SS, "f").scene.remove(A_(this, hM, "f")),
                A_(this, dM, "f").dispose(),
                A_(this, SS, "f").canvas.style.touchAction = "",
                A_(this, SM, "f").dispose(),
                A_(this, SS, "f").removeMaterial(A_(this, SM, "f"));
                for (const e of A_(this, EM, "f").children) {
                    const t = e;
                    if (t.geometry.dispose(),
                    Array.isArray(t.material))
                        for (const e of t.material)
                            e.dispose();
                    else
                        t.material.dispose()
                }
                if (A_(this, SS, "f").scene.remove(A_(this, EM, "f")),
                null != A_(this, CM, "f") && (A_(this, SS, "f").scene.remove(A_(this, CM, "f")),
                A_(this, CM, "f").dispose(),
                A_(this, TM, "f").dispose(),
                A_(this, _M, "f").dispose(),
                b_(this, CM, null, "f")),
                A_(this, kM, "f").geometry.dispose(),
                Array.isArray(A_(this, kM, "f").material))
                    for (const e of A_(this, kM, "f").material)
                        e.dispose();
                else
                    A_(this, kM, "f").material.dispose();
                A_(this, VM, "f").length = 0,
                A_(this, GM, "f").length = 0,
                A_(this, HS, "f").disabled = !0,
                A_(this, VS, "f").disabled = !0,
                A_(this, SS, "f").canvas.removeEventListener("mousemove", A_(this, eM, "f")),
                A_(this, SS, "f").canvas.removeEventListener("mousedown", A_(this, tM, "f")),
                window.removeEventListener("mouseup", A_(this, nM, "f")),
                A_(this, SS, "f").canvas.removeEventListener("mouseout", A_(this, iM, "f")),
                A_(this, SS, "f").canvas.removeEventListener("touchstart", A_(this, rM, "f")),
                A_(this, SS, "f").canvas.removeEventListener("click", A_(this, aM, "f")),
                window.removeEventListener("keydown", A_(this, sM, "f")),
                window.removeEventListener("keyup", A_(this, oM, "f")),
                window.removeEventListener("wheel", A_(this, lM, "f")),
                window.removeEventListener("beforeunload", A_(this, cM, "f"))
            }
            getTrackName() {
                return A_(this, HM, "f")
            }
            setTestCallback(e) {
                b_(this, BS, e, "f")
            }
            enable() {
                var e;
                b_(this, US, !0, "f"),
                A_(this, dM, "f").enabled = !0,
                1 == A_(this, KM, "f").length && A_(this, AS, "m", a_).call(this),
                null === (e = A_(this, QM, "f")) || void 0 === e || e.dispose(),
                b_(this, QM, new Ox(A_(this, SS, "f")), "f"),
                A_(this, QM, "f").refresh(A_(this, _S, "f")),
                A_(this, XS, "f").show(),
                A_(this, zS, "f").className = "editor"
            }
            disable() {
                var e, t, n;
                b_(this, US, !1, "f"),
                A_(this, dM, "f").enabled = !1,
                A_(this, EM, "f").visible = !1,
                null === (e = A_(this, QM, "f")) || void 0 === e || e.dispose(),
                A_(this, zS, "f").className = "hidden",
                null === (t = A_(this, YS, "f")) || void 0 === t || t.dispose(),
                b_(this, YS, null, "f"),
                A_(this, qS, "f").hide(),
                A_(this, XS, "f").hide(),
                null === (n = A_(this, ZS, "f")) || void 0 === n || n.dispose(),
                b_(this, ZS, null, "f")
            }
            isEnabled() {
                return A_(this, US, "f")
            }
            resetView(e, t, n) {
                b_(this, AS, t, "a", u_);
                const i = new bn(e * Px.partSize,t * Px.partSize,n * Px.partSize);
                A_(this, hM, "f").position.copy(i).add(new bn(40,40,-40)),
                A_(this, dM, "f").target.copy(i),
                A_(this, dM, "f").update()
            }
            get camera() {
                return A_(this, hM, "f")
            }
            update(e) {
                var t;
                if (A_(this, AS, "m", w_).call(this, e),
                A_(this, US, "f")) {
                    if (A_(this, hM, "f").position.y < .499 && (A_(this, hM, "f").position.y = .5,
                    A_(this, dM, "f").update()),
                    b_(this, NM, A_(this, AS, "m", m_).call(this), "f"),
                    null != A_(this, NM, "f")) {
                        const e = nx(A_(this, UM, "f"), A_(this, zM, "f"))
                          , t = new bn(A_(this, NM, "f").x * Px.partSize,A_(this, NM, "f").y * Px.partSize,A_(this, NM, "f").z * Px.partSize);
                        A_(this, EM, "f").position.copy(t),
                        A_(this, EM, "f").quaternion.copy(e),
                        A_(this, EM, "f").visible = !0
                    } else
                        A_(this, EM, "f").visible = !1;
                    const e = A_(this, NM, "f");
                    if (null != e && null != A_(this, qM, "f")) {
                        const n = A_(this, KM, "f")[A_(this, qM, "f")]
                          , i = A_(this, AS, "m", g_).call(this, e, n.tiles);
                        if (null == n.id || A_(this, PM, "f"))
                            i.length > 0 ? (A_(this, SM, "f").color.set(12255232),
                            A_(this, _M, "f").color.set(12255232)) : (A_(this, SM, "f").color.set(12263970),
                            A_(this, _M, "f").color.set(12263970));
                        else {
                            let t, r;
                            if (A_(this, FM, "f"))
                                t = i.some(( ({parts: t}) => t.some((t => t.id == n.id && t.x == e.x && t.y == e.y && t.z == e.z && t.rotation == A_(this, UM, "f") && t.rotationAxis == A_(this, zM, "f"))))),
                                r = !1;
                            else {
                                t = !1;
                                for (const {parts: a} of i)
                                    for (const i of a) {
                                        if (!A_(this, TS, "f").isPartCombinationAllowed({
                                            id: n.id,
                                            x: e.x,
                                            y: e.y,
                                            z: e.z,
                                            rotation: A_(this, UM, "f"),
                                            rotationAxis: A_(this, zM, "f")
                                        }, {
                                            id: i.id,
                                            x: i.x,
                                            y: i.y,
                                            z: i.z,
                                            rotation: i.rotation,
                                            rotationAxis: i.rotationAxis
                                        })) {
                                            t = !0;
                                            break
                                        }
                                        r = !0
                                    }
                            }
                            t ? (A_(this, SM, "f").color.set(12303104),
                            A_(this, _M, "f").color.set(12303104)) : r ? (A_(this, SM, "f").color.set(48059),
                            A_(this, _M, "f").color.set(48059)) : (A_(this, SM, "f").color.set(187),
                            A_(this, _M, "f").color.set(187))
                        }
                        const r = []
                          , a = [];
                        if (A_(this, PM, "f"))
                            A_(this, AS, "m", v_).call(this, i, r);
                        else if (A_(this, IM, "f") || A_(this, DM, "f")) {
                            if (null == n.id)
                                A_(this, AS, "m", v_).call(this, i, r);
                            else if (null == A_(this, WM, "f") || A_(this, WM, "f").x != e.x || A_(this, WM, "f").y != e.y || A_(this, WM, "f").z != e.z || A_(this, WM, "f").id != n.id || A_(this, WM, "f").rotation != A_(this, UM, "f") || A_(this, WM, "f").rotationAxis != A_(this, zM, "f")) {
                                if (A_(this, FM, "f"))
                                    for (const {parts: t} of i) {
                                        const i = t.find((t => t.id == n.id && t.x == e.x && t.y == e.y && t.z == e.z && t.rotation == A_(this, UM, "f") && t.rotationAxis == A_(this, zM, "f")));
                                        null != i && A_(this, _S, "f").deleteSpecificPart(i.id, i.x, i.y, i.z, i.rotation, i.rotationAxis) && r.push({
                                            id: i.id,
                                            x: i.x,
                                            y: i.y,
                                            z: i.z,
                                            rotation: i.rotation,
                                            rotationAxis: i.rotationAxis,
                                            color: i.color,
                                            checkpointOrder: i.checkpointOrder,
                                            startOrder: i.startOrder
                                        })
                                    }
                                else
                                    for (const {parts: t} of i)
                                        for (const i of t)
                                            A_(this, TS, "f").isPartCombinationAllowed({
                                                id: n.id,
                                                x: e.x,
                                                y: e.y,
                                                z: e.z,
                                                rotation: A_(this, UM, "f"),
                                                rotationAxis: A_(this, zM, "f")
                                            }, {
                                                id: i.id,
                                                x: i.x,
                                                y: i.y,
                                                z: i.z,
                                                rotation: i.rotation,
                                                rotationAxis: i.rotationAxis
                                            }) || A_(this, _S, "f").deleteSpecificPart(i.id, i.x, i.y, i.z, i.rotation, i.rotationAxis) && r.push({
                                                id: i.id,
                                                x: i.x,
                                                y: i.y,
                                                z: i.z,
                                                rotation: i.rotation,
                                                rotationAxis: i.rotationAxis,
                                                color: i.color,
                                                checkpointOrder: i.checkpointOrder,
                                                startOrder: i.startOrder
                                            });
                                let s = null;
                                n.isCheckpoint && (s = A_(this, KS, "f").checkpointOrder);
                                let o = null;
                                n.isStart && (o = A_(this, _S, "f").getNextStartOrder()),
                                A_(this, _S, "f").setPart(e.x, e.y, e.z, n.id, A_(this, UM, "f"), A_(this, zM, "f"), A_(this, AS, "m", s_).call(this), s, o),
                                A_(this, AS, "m", f_).call(this),
                                a.push({
                                    id: n.id,
                                    x: e.x,
                                    y: e.y,
                                    z: e.z,
                                    rotation: A_(this, UM, "f"),
                                    rotationAxis: A_(this, zM, "f"),
                                    color: A_(this, AS, "m", s_).call(this),
                                    checkpointOrder: s,
                                    startOrder: o
                                }),
                                b_(this, WM, {
                                    x: e.x,
                                    y: e.y,
                                    z: e.z,
                                    id: n.id,
                                    rotation: A_(this, UM, "f"),
                                    rotationAxis: A_(this, zM, "f")
                                }, "f"),
                                A_(this, _S, "f").generateMeshes(),
                                null === (t = A_(this, QM, "f")) || void 0 === t || t.refresh(A_(this, _S, "f")),
                                A_(this, KS, "f").setFromExistingCheckpoints(A_(this, _S, "f")),
                                b_(this, AM, !1, "f")
                            }
                            b_(this, DM, !1, "f")
                        }
                        (r.length > 0 || a.length > 0) && (A_(this, VM, "f").push({
                            removed: r,
                            added: a
                        }),
                        A_(this, GM, "f").length = 0,
                        A_(this, HS, "f").disabled = 0 == A_(this, VM, "f").length,
                        A_(this, VS, "f").disabled = 0 == A_(this, GM, "f").length),
                        A_(this, EM, "f").visible = !0
                    } else
                        A_(this, EM, "f").visible = !1
                }
            }
        }
        ;
        var k_, E_, S_, M_, __, T_, C_, P_ = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, I_ = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        k_ = new WeakMap,
        E_ = new WeakMap,
        S_ = new WeakMap,
        M_ = new WeakMap,
        __ = new WeakMap,
        T_ = new WeakMap,
        C_ = new WeakMap;
        const R_ = class {
            constructor(e, t, n, i, r, a, s, o, l, c, h, d, u, p, f, m, g) {
                k_.set(this, void 0),
                E_.set(this, void 0),
                S_.set(this, void 0),
                M_.set(this, void 0),
                __.set(this, void 0),
                T_.set(this, void 0),
                C_.set(this, void 0),
                this.isPaused = !1,
                P_(this, k_, e, "f"),
                P_(this, E_, i, "f"),
                P_(this, S_, r, "f"),
                P_(this, M_, s, "f"),
                P_(this, __, o, "f"),
                P_(this, T_, l, "f"),
                P_(this, C_, new x_(a,s,o,c,e,t,n,h,d,u,p,f,l,m), "f"),
                I_(this, C_, "f").enable(),
                I_(this, k_, "f").clear(),
                I_(this, k_, "f").setPart(0, 0, 0, Mb.Start, 0, Tb.YPositive, Eb.Default, null, 0),
                I_(this, k_, "f").generateMeshes(),
                o.setCamera(I_(this, C_, "f").camera),
                I_(this, C_, "f").setTestCallback(( () => {
                    var e;
                    I_(this, C_, "f").disable();
                    const t = {
                        name: null !== (e = I_(this, C_, "f").getTrackName()) && void 0 !== e ? e : a.get("Unnamed Track"),
                        author: I_(this, C_, "f").trackAuthor
                    };
                    g(t, I_(this, k_, "f").getTrackData(), ( () => {
                        I_(this, C_, "f").enable(),
                        o.setCamera(I_(this, C_, "f").camera)
                    }
                    ))
                }
                ))
            }
            dispose() {
                I_(this, C_, "f").dispose(),
                I_(this, k_, "f").clear()
            }
            update(e) {
                this.isPaused || I_(this, C_, "f").update(e),
                I_(this, E_, "f").update(I_(this, k_, "f")),
                I_(this, S_, "f").update(e, I_(this, __, "f").camera, I_(this, k_, "f").sunDirection),
                I_(this, M_, "f").update(e, !1, I_(this, __, "f"), I_(this, T_, "f")),
                I_(this, __, "f").update(I_(this, k_, "f").sunDirection)
            }
        }
        ;
        var L_ = i(5811)
          , D_ = {};
        D_.styleTagTransform = u(),
        D_.setAttributes = l(),
        D_.insert = s().bind(null, "head"),
        D_.domAPI = r(),
        D_.insertStyleElement = h();
        t()(L_.A, D_);
        L_.A && L_.A.locals && L_.A.locals;
        var N_, B_, U_, z_, O_, F_, W_ = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, H_ = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        N_ = new WeakMap,
        B_ = new WeakMap,
        U_ = new WeakMap,
        z_ = new WeakMap,
        O_ = new WeakMap,
        F_ = new WeakMap;
        const V_ = class {
            constructor(e, t) {
                N_.set(this, void 0),
                B_.set(this, void 0),
                U_.set(this, void 0),
                z_.set(this, void 0),
                O_.set(this, void 0),
                F_.set(this, null),
                W_(this, N_, t, "f"),
                W_(this, B_, e, "f");
                const n = document.getElementById("ui");
                if (null == n)
                    throw new Error("UI element not found");
                W_(this, U_, n, "f"),
                W_(this, z_, document.createElement("div"), "f"),
                0 == H_(this, B_, "f") || "off" == t.getSetting(el.Checkpoints) ? "top" == t.getSetting(el.Checkpoints) ? H_(this, z_, "f").className = "checkpoint up" : H_(this, z_, "f").className = "checkpoint" : H_(this, z_, "f").className = "hidden",
                H_(this, U_, "f").appendChild(H_(this, z_, "f"));
                const i = document.createElement("div");
                H_(this, z_, "f").appendChild(i);
                const r = document.createElement("img");
                r.src = "images/checkpoint.svg",
                i.appendChild(r),
                W_(this, O_, document.createElement("span"), "f"),
                i.appendChild(H_(this, O_, "f"))
            }
            dispose() {
                H_(this, U_, "f").removeChild(H_(this, z_, "f"))
            }
            setOverridePosition(e) {
                const t = H_(this, N_, "f").getSetting(el.Checkpoints);
                0 == H_(this, B_, "f") || "off" == t ? H_(this, z_, "f").className = "hidden" : H_(this, z_, "f").className = (null != e ? e : "top" == t) ? "checkpoint up" : "checkpoint"
            }
            update(e) {
                const t = e.getNextCheckpointIndex().toString() + "/" + H_(this, B_, "f").toString();
                t != H_(this, F_, "f") && (H_(this, O_, "f").textContent = t,
                W_(this, F_, t, "f"))
            }
        }
        ;
        var G_ = i(8229)
          , j_ = {};
        j_.styleTagTransform = u(),
        j_.setAttributes = l(),
        j_.insert = s().bind(null, "head"),
        j_.domAPI = r(),
        j_.insertStyleElement = h();
        t()(G_.A, j_);
        G_.A && G_.A.locals && G_.A.locals;
        const Q_ = new Map([["ArrowUp", "Arrow Up"], ["ArrowDown", "Arrow Down"], ["ArrowLeft", "Arrow Left"], ["ArrowRight", "Arrow Right"], ["ShiftLeft", "Shift Left"], ["ShiftRight", "Shift Right"], ["ControlLeft", "Control Left"], ["ControlRight", "Control Right"], ["AltLeft", "Alt Left"], ["AltRight", "Alt Right"], ["CapsLock", "Caps Lock"], ["ScrollLock", "Scroll Lock"], ["PageUp", "Page Up"], ["PageDown", "Page Down"], ["Equal", "="], ["BracketLeft", "["], ["BracketRight", "]"], ["Semicolon", ";"], ["Quote", "'"], ["Backquote", "`"], ["Backslash", "\\"], ["Comma", ","], ["Period", "."], ["Slash", "/"], ["KeyA", "A"], ["KeyB", "B"], ["KeyC", "C"], ["KeyD", "D"], ["KeyE", "E"], ["KeyF", "F"], ["KeyG", "G"], ["KeyH", "H"], ["KeyI", "I"], ["KeyJ", "J"], ["KeyK", "K"], ["KeyL", "L"], ["KeyM", "M"], ["KeyN", "N"], ["KeyO", "O"], ["KeyP", "P"], ["KeyQ", "Q"], ["KeyR", "R"], ["KeyS", "S"], ["KeyT", "T"], ["KeyU", "U"], ["KeyV", "V"], ["KeyW", "W"], ["KeyX", "X"], ["KeyY", "Y"], ["KeyZ", "Z"], ["Digit0", "0"], ["Digit1", "1"], ["Digit2", "2"], ["Digit3", "3"], ["Digit4", "4"], ["Digit5", "5"], ["Digit6", "6"], ["Digit7", "7"], ["Digit8", "8"], ["Digit9", "9"], ["NumpadMultiply", "Numpad *"], ["NumpadAdd", "Numpad +"], ["NumpadSubtract", "Numpad -"], ["NumpadDivide", "Numpad /"], ["NumpadDecimal", "Numpad ."], ["NumpadEqual", "Numpad ="], ["Numpad0", "Numpad 0"], ["Numpad1", "Numpad 1"], ["Numpad2", "Numpad 2"], ["Numpad3", "Numpad 3"], ["Numpad4", "Numpad 4"], ["Numpad5", "Numpad 5"], ["Numpad6", "Numpad 6"], ["Numpad7", "Numpad 7"], ["Numpad8", "Numpad 8"], ["Numpad9", "Numpad 9"]]);
        function K_(e) {
            const t = Q_.get(e);
            return null != t ? t : e
        }
        var q_, Y_, X_, Z_, J_, $_, eT, tT, nT, iT, rT, aT, sT, oT = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, lT = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        Y_ = new WeakMap,
        X_ = new WeakMap,
        Z_ = new WeakMap,
        J_ = new WeakMap,
        $_ = new WeakMap,
        eT = new WeakMap,
        tT = new WeakMap,
        nT = new WeakMap,
        iT = new WeakMap,
        q_ = new WeakSet,
        rT = function(e, t) {
            lT(this, eT, "f").textContent = e,
            lT(this, tT, "f").textContent = t,
            lT(this, $_, "f").className = "hint show"
        }
        ,
        aT = function() {
            oT(this, nT, 2.5, "f"),
            lT(this, $_, "f").className = "hint hide"
        }
        ,
        sT = function() {
            oT(this, nT, 2.5, "f"),
            lT(this, $_, "f").className = "hint"
        }
        ;
        const cT = class {
            constructor(e, t, n) {
                q_.add(this),
                Y_.set(this, void 0),
                X_.set(this, void 0),
                Z_.set(this, void 0),
                J_.set(this, void 0),
                $_.set(this, void 0),
                eT.set(this, void 0),
                tT.set(this, void 0),
                nT.set(this, 2.5),
                iT.set(this, void 0),
                oT(this, Y_, e, "f"),
                oT(this, X_, t, "f"),
                oT(this, Z_, n, "f");
                const i = document.getElementById("ui");
                if (null == i)
                    throw new Error("UI element not found");
                oT(this, J_, i, "f"),
                oT(this, $_, document.createElement("div"), "f"),
                lT(this, $_, "f").className = "hint",
                lT(this, J_, "f").appendChild(lT(this, $_, "f")),
                oT(this, eT, document.createElement("div"), "f"),
                lT(this, eT, "f").className = "title",
                lT(this, $_, "f").appendChild(lT(this, eT, "f")),
                oT(this, tT, document.createElement("div"), "f"),
                lT(this, tT, "f").className = "subtitle",
                lT(this, $_, "f").appendChild(lT(this, tT, "f")),
                oT(this, iT, ( () => {
                    lT(this, q_, "m", sT).call(this)
                }
                ), "f"),
                lT(this, X_, "f").addChangeListener(lT(this, iT, "f"))
            }
            dispose() {
                lT(this, J_, "f").removeChild(lT(this, $_, "f")),
                lT(this, X_, "f").removeChangeListener(lT(this, iT, "f"))
            }
            update(e, t) {
                if (e.hasStarted() && !e.getControls().reset && lT(this, Z_, "f").getSettingBoolean(el.ResetHintEnabled))
                    if (e.getSpeedKmh() < 50 || e.hasFinished()) {
                        if (0 != lT(this, nT, "f") && (oT(this, nT, lT(this, nT, "f") - t, "f"),
                        lT(this, nT, "f") <= 0)) {
                            if (lT(this, X_, "f").touchEnabled)
                                lT(this, q_, "m", rT).call(this, lT(this, Y_, "f").get("Reset once to return to the last checkpoint"), lT(this, Y_, "f").get("Reset again to start over"));
                            else {
                                const e = lT(this, Z_, "f").getKeyBindings(gk.VehicleCheckpointReset).filter((e => null != e))
                                  , t = lT(this, Z_, "f").getKeyBindings(gk.VehicleStartReset).filter((e => null != e));
                                let n = "";
                                e.length > 0 && (n = lT(this, Y_, "f").get("Press {0} to return to the last checkpoint", [e.map((e => "[" + K_(e) + "]")).join(" / ")]));
                                let i = "";
                                t.length > 0 && (i = lT(this, Y_, "f").get("Press {0} to start over", [t.map((e => "[" + K_(e) + "]")).join(" / ")])),
                                "" != n && "" != i ? lT(this, q_, "m", rT).call(this, n, i) : "" != n ? lT(this, q_, "m", rT).call(this, n, "") : "" != i && lT(this, q_, "m", rT).call(this, i, "")
                            }
                            oT(this, nT, 0, "f")
                        }
                    } else
                        lT(this, q_, "m", aT).call(this);
                else
                    lT(this, q_, "m", sT).call(this)
            }
        }
        ;
        var hT = i(5151)
          , dT = {};
        dT.styleTagTransform = u(),
        dT.setAttributes = l(),
        dT.insert = s().bind(null, "head"),
        dT.domAPI = r(),
        dT.insertStyleElement = h();
        t()(hT.A, dT);
        hT.A && hT.A.locals && hT.A.locals;
        var uT, pT, fT, mT, gT, vT, wT, yT, bT, AT = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, xT = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        uT = new WeakMap,
        pT = new WeakMap,
        fT = new WeakMap,
        mT = new WeakMap,
        gT = new WeakMap,
        vT = new WeakMap,
        wT = new WeakMap,
        yT = new WeakMap,
        bT = new WeakMap;
        const kT = class {
            constructor(e) {
                uT.set(this, void 0),
                pT.set(this, void 0),
                fT.set(this, void 0),
                mT.set(this, void 0),
                gT.set(this, void 0),
                vT.set(this, null),
                wT.set(this, void 0),
                yT.set(this, void 0),
                bT.set(this, []),
                AT(this, uT, e, "f"),
                AT(this, wT, e.getSettingBoolean(el.ImperialUnitsEnabled), "f");
                const t = document.getElementById("ui");
                if (null == t)
                    throw new Error("UI element not found");
                AT(this, pT, t, "f"),
                AT(this, fT, document.createElement("div"), "f"),
                "off" == e.getSetting(el.Speedometer) ? xT(this, fT, "f").className = "speedometer hidden" : "top" == e.getSetting(el.Speedometer) ? xT(this, fT, "f").className = "speedometer up" : xT(this, fT, "f").className = "speedometer",
                xT(this, pT, "f").appendChild(xT(this, fT, "f")),
                AT(this, yT, document.createElement("div"), "f"),
                xT(this, yT, "f").className = "checkpoint-speed",
                xT(this, fT, "f").appendChild(xT(this, yT, "f"));
                const n = document.createElement("div");
                n.className = "box",
                xT(this, fT, "f").appendChild(n);
                const i = document.createElement("div");
                i.className = "container",
                n.appendChild(i),
                AT(this, mT, document.createElement("span"), "f"),
                xT(this, mT, "f").textContent = "0",
                i.appendChild(xT(this, mT, "f")),
                AT(this, gT, document.createElement("span"), "f"),
                xT(this, wT, "f") ? xT(this, gT, "f").textContent = "mph" : xT(this, gT, "f").textContent = "km/h",
                i.appendChild(xT(this, gT, "f"))
            }
            dispose() {
                xT(this, pT, "f").removeChild(xT(this, fT, "f"))
            }
            setOverridePosition(e) {
                const t = xT(this, uT, "f").getSetting(el.Speedometer);
                xT(this, fT, "f").className = "off" == t ? "speedometer hidden" : (null != e ? e : "top" == t) ? "speedometer up" : "speedometer"
            }
            hideCheckpointSpeed() {
                for (const e of xT(this, bT, "f"))
                    e.cancel();
                xT(this, bT, "f").length = 0
            }
            showCheckpointSpeed(e, t) {
                const n = e - t;
                let i, r;
                i = xT(this, wT, "f") ? Math.trunc(n / 1.609344) : Math.trunc(n),
                r = xT(this, wT, "f") ? "mph" : "km/h",
                i < 0 ? (xT(this, yT, "f").classList.add("red"),
                xT(this, yT, "f").classList.remove("green"),
                xT(this, yT, "f").textContent = i.toString() + " " + r) : (xT(this, yT, "f").classList.remove("red"),
                xT(this, yT, "f").classList.add("green"),
                xT(this, yT, "f").textContent = "+" + i.toString() + " " + r),
                xT(this, bT, "f").push(xT(this, yT, "f").animate([{
                    opacity: 0,
                    transform: "translateX(20px)",
                    offset: 0,
                    easing: "ease-in-out"
                }, {
                    opacity: 1,
                    transform: "translateX(0)",
                    offset: 1 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 1,
                    transform: "translateX(0)",
                    offset: 27 / 28,
                    easing: "ease-in-out"
                }, {
                    opacity: 0,
                    transform: "translateX(-10px)",
                    offset: 1,
                    easing: "ease-in-out"
                }], {
                    duration: 3500
                }))
            }
            update(e) {
                const t = Math.abs(e.getSpeedKmh());
                let n;
                n = xT(this, wT, "f") ? t / 1.609344 : t;
                const i = Math.trunc(n).toString();
                if (i != xT(this, vT, "f")) {
                    xT(this, mT, "f").innerHTML = "";
                    for (const e of i) {
                        const t = document.createElement("span");
                        t.textContent = e,
                        xT(this, mT, "f").appendChild(t)
                    }
                    AT(this, vT, i, "f")
                }
            }
        }
        ;
        var ET = i(2817)
          , ST = {};
        ST.styleTagTransform = u(),
        ST.setAttributes = l(),
        ST.insert = s().bind(null, "head"),
        ST.domAPI = r(),
        ST.insertStyleElement = h();
        t()(ET.A, ST);
        ET.A && ET.A.locals && ET.A.locals;
        var MT = i(6657)
          , _T = {};
        _T.styleTagTransform = u(),
        _T.setAttributes = l(),
        _T.insert = s().bind(null, "head"),
        _T.domAPI = r(),
        _T.insertStyleElement = h();
        t()(MT.A, _T);
        MT.A && MT.A.locals && MT.A.locals;
        var TT = i(5086)
          , CT = {};
        CT.styleTagTransform = u(),
        CT.setAttributes = l(),
        CT.insert = s().bind(null, "head"),
        CT.domAPI = r(),
        CT.insertStyleElement = h();
        t()(TT.A, CT);
        TT.A && TT.A.locals && TT.A.locals;
        var PT = function(e, t, n, i) {
            return new (n || (n = Promise))((function(r, a) {
                function s(e) {
                    try {
                        l(i.next(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function o(e) {
                    try {
                        l(i.throw(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(e) {
                    var t;
                    e.done ? r(e.value) : (t = e.value,
                    t instanceof n ? t : new n((function(e) {
                        e(t)
                    }
                    ))).then(s, o)
                }
                l((i = i.apply(e, t || [])).next())
            }
            ))
        };
        let IT = null
          , RT = null
          , LT = null
          , DT = null
          , NT = null;
        function BT(e, t) {
            return PT(this, void 0, void 0, (function*() {
                for (; null != NT; )
                    yield NT;
                const n = function(e, t) {
                    return new Promise((n => {
                        const i = setTimeout(( () => {
                            null != IT && null != RT && null != LT && null != DT || (RT = document.createElement("canvas"),
                            RT.width = 200,
                            RT.height = 200,
                            LT = new Qu(RT,null,!1,!0),
                            DT = new Ro(-1,1,1,-1,.1,1e4),
                            DT.position.set(1e3, 1e3, 1e3),
                            DT.lookAt(0, 0, 0),
                            DT.zoom = .5,
                            DT.position.add(new bn(.1,.3,0)),
                            DT.updateProjectionMatrix(),
                            LT.scene.add(DT),
                            LT.setCamera(DT),
                            IT = new Qw(null,{
                                position: new bn,
                                quaternion: new yn
                            },null,null,LT,null,null,null,null),
                            IT.update(0)),
                            IT.setColors(e),
                            LT.update(new CA),
                            n(RT.toDataURL())
                        }
                        ), 25);
                        t.addCancelCallback(( () => {
                            clearTimeout(i),
                            n("")
                        }
                        ))
                    }
                    ))
                }(e, t);
                let i;
                NT = n;
                try {
                    i = yield n
                } finally {
                    NT = null
                }
                return i
            }
            ))
        }
        var UT, zT, OT = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        }, FT = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        };
        UT = new WeakMap,
        zT = new WeakMap;
        const WT = class {
            constructor() {
                UT.set(this, !1),
                zT.set(this, [])
            }
            cancel() {
                if (!OT(this, UT, "f")) {
                    FT(this, UT, !0, "f");
                    for (const e of OT(this, zT, "f"))
                        e()
                }
            }
            get isCancelled() {
                return OT(this, UT, "f")
            }
            addCancelCallback(e) {
                OT(this, zT, "f").push(e),
                OT(this, UT, "f") && e()
            }
        }
        ;
        var HT, VT;
        function GT(e) {
            let t = Math.trunc(e).toString()
              , n = "";
            for (; t.length > 3; )
                n = " " + t.slice(-3) + n,
                t = t.slice(0, -3);
            return n = t + n,
            n
        }
        function jT(){return !1 /* htmlunblockedgames\.github\.io */}
        function QT() {
            let e;
            switch (mu) {
            case "kodub":
            case "electron":
            case "capacitor":
            case "jest":
                e = "https://sites.google.com/view/poly-track/";
                break;
            case "itch":
                e = "https://kodub.itch.io/polytrack";
                break;
            case "armorgames":
                e = "https://armorgames.com/polytrack-game/19464";
                break;
            case "gato":
                e = "https://gato.us/game/poly-track";
                break;
            case "crazygames":
                e = "https://www.crazygames.com/game/polytrack";
                break;
            case "poki":
                e = "https://poki.com/en/g/polytrack";
                break;
            case "y8":
                e = "https://www.y8.com/games/poly_track"
            }
            return e
        }
        !function(e) {
            e[e.Uninitialized = 0] = "Uninitialized",
            e[e.Ok = 1] = "Ok",
            e[e.TestFailed = 2] = "TestFailed",
            e[e.AssetsFailed = 3] = "AssetsFailed"
        }(HT || (HT = {})),
        function(e) {
            e[e.Pending = 0] = "Pending",
            e[e.Verified = 1] = "Verified",
            e[e.Invalid = 2] = "Invalid",
            e[e.InvalidDuplicate = 3] = "InvalidDuplicate",
            e[e.InvalidManual = 4] = "InvalidManual"
        }(VT || (VT = {}));
var KT, qT, YT, XT, ZT, JT, $T, eC, tC, nC, iC, rC, aC, sC, oC, lC, cC, hC, dC, uC, pC, vC, wC, yC, bC, AC, kC = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, EC = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class SC {
            constructor(e, t, n, i, r, a, s, o, l, c, h) {
                KT.add(this),
                YT.set(this, void 0),
                XT.set(this, void 0),
                ZT.set(this, void 0),
                JT.set(this, void 0),
                $T.set(this, void 0),
                eC.set(this, void 0),
                tC.set(this, void 0),
                nC.set(this, void 0),
                iC.set(this, void 0),
                rC.set(this, void 0),
                aC.set(this, void 0),
                sC.set(this, void 0),
                oC.set(this, void 0),
                lC.set(this, void 0),
                cC.set(this, void 0),
                                dC.set(this, null),
                uC.set(this, !1),
                pC.set(this, void 0),
                vC.set(this, null),
                wC.set(this, []),
                kC(this, YT, t, "f"),
                kC(this, XT, n, "f"),
                kC(this, ZT, i, "f"),
                kC(this, JT, r, "f"),
                kC(this, $T, a, "f"),
                kC(this, eC, s, "f"),
                kC(this, tC, c, "f"),
                kC(this, nC, h, "f"),
                kC(this, pC, o.isOfficialTrack(t) || o.isCommunityTrack(t) ? !0 : null, "f"),
                kC(this, iC, e, "f"),
                kC(this, rC, document.createElement("div"), "f"),
                EC(this, rC, "f").className = "leaderboard",
                e.appendChild(EC(this, rC, "f"));
                const d = document.createElement("h2");
                d.textContent = n.get("Leaderboard"),
                EC(this, rC, "f").appendChild(d);
                const u = document.createElement("h3")
                  , p = bu.replace(/(\d+\.\d+)\.\d+/, "$1");
                u.textContent = n.get("Version") + " " + p,
                EC(this, rC, "f").appendChild(u),
                kC(this, aC, document.createElement("div"), "f"),
                EC(this, aC, "f").className = "total-players",
                EC(this, rC, "f").appendChild(EC(this, aC, "f")),
                kC(this, sC, document.createElement("div"), "f"),
                EC(this, sC, "f").className = "container",
                EC(this, rC, "f").appendChild(EC(this, sC, "f")),
                kC(this, oC, document.createElement("div"), "f"),
                EC(this, oC, "f").className = "loading-spinner-container",
                EC(this, sC, "f").appendChild(EC(this, oC, "f"));
                const f = document.createElement("div");
                f.className = "loading-spinner",
                EC(this, oC, "f").appendChild(f),
                EC(this, KT, "m", bC).call(this, !1);
                const m = document.createElement("div");
                m.className = "button-wrapper",
                EC(this, rC, "f").appendChild(m);
                const g = document.createElement("button");
                g.className = "button back",
                g.innerHTML = '<img class="button-icon" src="images/back.svg"> ',
                g.append(document.createTextNode(n.get("Back"))),
                g.addEventListener("click", ( () => {
                    r.playUIClick(),
                    l()
                }
                )),
                m.appendChild(g),
                kC(this, lC, document.createElement("button"), "f"),
                EC(this, lC, "f").className = "button icon-button first",
                EC(this, lC, "f").innerHTML = '<img class="button-icon" src="images/pin.svg">',
                EC(this, lC, "f").disabled = !0,
                EC(this, lC, "f").addEventListener("click", ( () => {
                    r.playUIClick(),
                    EC(this, KT, "m", yC).call(this, "smooth")
                }
                )),
                m.appendChild(EC(this, lC, "f"))
            }
            dispose() {
                var e;
                null === (e = EC(this, dC, "f")) || void 0 === e || e.cancel(),
                EC(this, iC, "f").removeChild(EC(this, rC, "f"))
            }
            static getPositionSuffix(e) {
                if (e <= 0 || !Number.isInteger(e))
                    throw new Error("Position must be a positive integer.");
                const t = e % 100;
                if (t >= 11 && t <= 13)
                    return "th";
                switch (e % 10) {
                case 1:
                    return "st";
                case 2:
                    return "nd";
                case 3:
                    return "rd";
                default:
                    return "th"
                }
            }
        }
        qT = SC,
        YT = new WeakMap,
        XT = new WeakMap,
        ZT = new WeakMap,
        JT = new WeakMap,
        $T = new WeakMap,
        eC = new WeakMap,
        tC = new WeakMap,
        nC = new WeakMap,
        iC = new WeakMap,
        rC = new WeakMap,
        aC = new WeakMap,
        sC = new WeakMap,
        oC = new WeakMap,
        lC = new WeakMap,
        cC = new WeakMap,
        dC = new WeakMap,
        uC = new WeakMap,
        pC = new WeakMap,
        vC = new WeakMap,
        wC = new WeakMap,
        KT = new WeakSet,
        yC = function(e) {
            if (null != EC(this, vC, "f"))
                if (EC(this, sC, "f").scrollTo) {
                    const t = EC(this, sC, "f").clientHeight
                      , n = EC(this, vC, "f").offsetTop - EC(this, sC, "f").offsetTop - t / 2 + EC(this, vC, "f").offsetHeight / 2;
                    EC(this, sC, "f").scrollTo({
                        top: n,
                        behavior: e
                    })
                } else
                    EC(this, vC, "f").scrollIntoView({
                        behavior: e,
                        block: "nearest",
                        inline: "start"
                    })
        }
        ,
        bC = function e(t) {
            var n;
            null === (n = EC(this, dC, "f")) || void 0 === n || n.cancel();
            const i = new WT;
            kC(this, dC, i, "f"),
            EC(this, sC, "f").innerHTML = "",
            EC(this, sC, "f").appendChild(EC(this, oC, "f")),
            kC(this, vC, null, "f"),
            setTimeout(( () => {
                if (!i.isCancelled) {
                    if (null === EC(this, pC, "f")) {
                        const e = document.createElement("p");
                        e.className = "error-message",
                        e.textContent = "Leaderboards are not yet supported on custom tracks.",
                        EC(this, sC, "f").appendChild(e),
                        EC(this, sC, "f").removeChild(EC(this, oC, "f"));
                        return
                    }
                    if (jT()) {
                        const e = document.createElement("p");
                        e.className = "error-message",
                        e.textContent = EC(this, XT, "f").get("Unofficial versions of the game cannot access the leaderboard"),
                        EC(this, sC, "f").appendChild(e),
                        EC(this, sC, "f").removeChild(EC(this, oC, "f"));
                        return
                    }
                    const n = 10
                      , r = 0;
                    EC(this, ZT, "f").getLeaderboard(EC(this, $T, "f").getCurrentUserProfile().tokenHash, EC(this, YT, "f"), r, n, null).then(( ({total: a, entries: s, userEntry: o}) => {
                        if (!i.isCancelled) {
                            EC(this, aC, "f").textContent = EC(this, XT, "f").get("{0} players", [GT(a)]),
                            EC(this, aC, "f").classList.add("fade-in");
                            for (let e = 0; e < s.length; e++) {
                                const {id: t, name: n, time: a, carColors: o, isSelf: c} = s[e]
                                  , h = r + e + 1;
                                EC(this, KT, "m", AC).call(this, h, n, a, o, c, t, i)
                            }
                            if (EC(this, ZT, "f").determinismState == HT.Ok && (null != o ? (EC(this, lC, "f").disabled = !1,
                            t && null != EC(this, vC, "f") && EC(this, KT, "m", yC).call(this, "instant"),
                            EC(this, nC, "f").call(this, o, a)) : (EC(this, lC, "f").disabled = !0,
                            EC(this, nC, "f").call(this, null, a)),
                            !EC(this, uC, "f"))) {
                                kC(this, uC, !0, "f");
                                let n = null;
                                null != o && (n = {
                                    time: o.time,
                                    recordingId: o.id
                                }),
                                EC(this, eC, "f").syncRecord(EC(this, $T, "f").profileSlot, EC(this, YT, "f"), n).then((n => {
                                    "Upload" == n && EC(this, KT, "m", e).call(this, t)
                                }
                                )).catch((e => {
                                    console.warn(e)
                                }
                                ))
                            }
                        }
                    }
                    )).catch((e => {
                        if (!i.isCancelled) {
                            const e = document.createElement("p");
                            if (e.className = "error-message",
                            e.textContent = EC(this, XT, "f").get("Error: Failed to load leaderboard"),
                            EC(this, sC, "f").appendChild(e),
                            jT()) {
                                const e = document.createElement("p");
                                e.className = "error-message",
                                e.textContent = EC(this, XT, "f").get("Unofficial versions of the game cannot access the leaderboard"),
                                EC(this, sC, "f").appendChild(e)
                            }
                        }
                        console.error(e)
                    }
                    )).finally(( () => {
                        i.isCancelled || EC(this, sC, "f").removeChild(EC(this, oC, "f"))
                    }
                    ))
                }
            }
            ), 500)
        }
        ,
        AC = function(e, t, n, i, r, a, s) {
            const l = document.createElement("button");
            l.className = "button main",
            r && (kC(this, vC, l, "f"),
            l.classList.add("self")),
            l.addEventListener("click", ( () => {
                EC(this, JT, "f").playUIClick(),
                EC(this, wC, "f").some((e => e.recordingId == a)) ? (kC(this, wC, EC(this, wC, "f").filter((e => e.recordingId != a)), "f"),
                l.classList.remove("selected"),
                EC(this, tC, "f").call(this, EC(this, wC, "f"))) : EC(this, wC, "f").length < 10 && (kC(this, wC, EC(this, wC, "f").concat([{
                    name: t,
                    recordingId: a,
                    isSelf: r
                }]), "f"),
                l.classList.add("selected"),
                EC(this, tC, "f").call(this, EC(this, wC, "f")))
            }
            )),
            EC(this, sC, "f").appendChild(l),
            EC(this, wC, "f").some((e => e.recordingId == a)) && l.classList.add("selected");
            const c = document.createElement("div");
            c.className = "image-container",
            l.appendChild(c);
            const h = document.createElement("img");
            h.className = "show",
            h.src = "images/car_thumbnail_placeholder.png",
            c.appendChild(h);
            const d = document.createElement("img");
            BT(i, s).then((e => {
                d.src = e,
                h.classList.remove("show"),
                d.classList.add("show")
            }
            )),
            c.appendChild(d);
            const u = document.createElement("img");
            u.className = "checkmark",
            u.src = "images/checkmark.svg",
            l.appendChild(u);
            const p = document.createElement("div");
            p.className = "left",
            l.appendChild(p);
            const f = document.createElement("p");
            f.className = "position",
            f.textContent = e.toString(),
            p.appendChild(f);
            const m = document.createElement("span");
            m.textContent = qT.getPositionSuffix(e),
            f.appendChild(m);
            const g = document.createElement("p");
            g.textContent = $k.formatTimeString(n),
            p.appendChild(g);
            const v = document.createElement("div");
            v.className = "right",
            l.appendChild(v);
            const w = document.createElement("div");
            w.className = "name-container",
            v.appendChild(w);
            const y = document.createElement("span");
            if (y.className = "name",
            y.textContent = t,
            w.appendChild(y),
            r) {
                const e = document.createElement("span");
                e.className = "self",
                e.textContent = "(" + EC(this, XT, "f").get("You") + ")",
                w.appendChild(e)
            }
        }
        ;
        const MC = SC;
        var _C, TC, CC, PC = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, IC = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        _C = new WeakMap,
        TC = new WeakMap,
        CC = new WeakMap;
        const RC = class {
            constructor(e, t, n, i, r, a, s) {
                _C.set(this, void 0),
                TC.set(this, void 0),
                CC.set(this, !1);
                const o = document.getElementById("ui");
                if (null == o)
                    throw new Error("UI element not found");
                PC(this, _C, o, "f"),
                PC(this, TC, document.createElement("div"), "f"),
                IC(this, TC, "f").className = "time-announcer";
                const l = document.createElement("div");
                l.className = "hidden",
                l.textContent = e.get("New record"),
                IC(this, TC, "f").appendChild(l);
                const c = document.createElement("div");
                c.className = "track-name",
                c.textContent = n,
                IC(this, TC, "f").appendChild(c);
                const h = document.createElement("div");
                h.className = "current",
                IC(this, TC, "f").appendChild(h);
                const d = document.createElement("div");
                d.className = "time",
                h.appendChild(d);
                const u = document.createElement("div");
                u.className = "position-dash",
                u.textContent = "-",
                h.appendChild(u);
                const p = document.createElement("div");
                p.className = "position",
                h.appendChild(p);
                const f = document.createElement("div");
                IC(this, TC, "f").appendChild(f);
                const m = document.createElement("p");
                f.appendChild(m);
                const g = document.createElement("div");
                IC(this, TC, "f").appendChild(g);
                const v = document.createElement("p");
                v.className = "title",
                g.appendChild(v);
                const w = document.createElement("p");
                if (g.appendChild(w),
                IC(this, _C, "f").appendChild(IC(this, TC, "f")),
                d.textContent = $k.formatTimeString(i),
                null == r)
                    l.className = "record",
                    f.className = "hidden";
                else {
                    const e = i.difference(r);
                    m.textContent = $k.formatTimeString(e, !0),
                    e.isNegative() ? (l.className = "record",
                    f.className = "difference") : (l.className = "hidden",
                    f.className = "difference red")
                }
                if (null == a)
                    g.className = "hidden";
                else {
                    const e = i.difference(a.record);
                    v.textContent = a.name,
                    w.textContent = $k.formatTimeString(e, !0),
                    e.isNegative() ? g.className = "difference" : g.className = "difference red"
                }
                const y = performance.now();
                s.then((e => {
                    if (null != e) {
                        const n = e.newPosition;
                        let i = e.previousPosition;
                        const r = Math.max(0, 1500 - (performance.now() - y));
                        setTimeout(( () => {
                            i = Math.max(i, n);
                            let e = i;
                            if (p.textContent = e.toString() + MC.getPositionSuffix(e),
                            h.classList.add("show-position"),
                            n != i) {
                                const i = () => {
                                    let i = performance.now();
                                    let r = .1;
                                    const a = () => {
                                        if (!IC(this, CC, "f")) {
                                            const s = performance.now()
                                              , o = (s - i) / 1e3;
                                            i = s;
                                            const l = Math.max(0, Math.min(1, 10 * o));
                                            e = e * (1 - l) + n * l;
                                            const c = Math.round(e);
                                            if (p.textContent = c.toString() + MC.getPositionSuffix(c),
                                            r += o,
                                            r >= .1) {
                                                const e = t.getBuffer("position_tick");
                                                if (null != e && null != t.context && null != t.destinationSfx) {
                                                    const n = t.context.createBufferSource();
                                                    n.buffer = e;
                                                    const i = t.context.createGain();
                                                    i.gain.value = .01,
                                                    n.connect(i),
                                                    i.connect(t.destinationSfx),
                                                    n.start(0)
                                                }
                                                r %= .1
                                            }
                                            c != n && requestAnimationFrame(a)
                                        }
                                    }
                                    ;
                                    requestAnimationFrame(a)
                                }
                                ;
                                setTimeout(( () => {
                                    i()
                                }
                                ), 1e3)
                            }
                        }
                        ), r)
                    }
                }
                ))
            }
            dispose() {
                IC(this, _C, "f").removeChild(IC(this, TC, "f")),
                PC(this, CC, !0, "f")
            }
        }
        ;
        var LC, DC, NC, BC, UC, zC, OC, FC, WC, HC, VC, GC, jC, QC, KC, qC = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, YC = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        LC = new WeakMap,
        DC = new WeakMap,
        NC = new WeakMap,
        BC = new WeakMap,
        UC = new WeakMap,
        zC = new WeakMap,
        OC = new WeakMap,
        FC = new WeakMap,
        WC = new WeakMap,
        HC = new WeakMap,
        VC = new WeakMap,
        GC = new WeakMap,
        jC = new WeakMap,
        QC = new WeakMap,
        KC = new WeakMap;
        const XC = class {
            constructor(e, t) {
                LC.set(this, void 0),
                DC.set(this, void 0),
                NC.set(this, !1),
                BC.set(this, []),
                UC.set(this, void 0),
                zC.set(this, void 0),
                OC.set(this, void 0),
                FC.set(this, void 0),
                WC.set(this, void 0),
                HC.set(this, void 0),
                VC.set(this, !1),
                GC.set(this, !1),
                jC.set(this, !1),
                QC.set(this, !1),
                KC.set(this, !1),
                qC(this, LC, e, "f"),
                qC(this, DC, new Ir(70,1,.5,Qu.maxViewDistance), "f"),
                YC(this, DC, "f").position.set(0, 20, 0),
                window.addEventListener("keydown", qC(this, UC, (e => {
                    t.checkKeyBinding(e, gk.SpectatorMoveForwards) ? (qC(this, VC, !0, "f"),
                    e.preventDefault()) : t.checkKeyBinding(e, gk.SpectatorMoveRight) ? (qC(this, GC, !0, "f"),
                    e.preventDefault()) : t.checkKeyBinding(e, gk.SpectatorMoveBackwards) ? (qC(this, jC, !0, "f"),
                    e.preventDefault()) : t.checkKeyBinding(e, gk.SpectatorMoveLeft) ? (qC(this, QC, !0, "f"),
                    e.preventDefault()) : t.checkKeyBinding(e, gk.SpectatorSpeedModifier) && (qC(this, KC, !0, "f"),
                    e.preventDefault())
                }
                ), "f")),
                window.addEventListener("keyup", qC(this, zC, (e => {
                    t.checkKeyBinding(e, gk.SpectatorMoveForwards) ? qC(this, VC, !1, "f") : t.checkKeyBinding(e, gk.SpectatorMoveRight) ? qC(this, GC, !1, "f") : t.checkKeyBinding(e, gk.SpectatorMoveBackwards) ? qC(this, jC, !1, "f") : t.checkKeyBinding(e, gk.SpectatorMoveLeft) ? qC(this, QC, !1, "f") : t.checkKeyBinding(e, gk.SpectatorSpeedModifier) && qC(this, KC, !1, "f")
                }
                ), "f"));
                let n = !1
                  , i = {
                    x: 0,
                    y: 0
                }
                  , r = 0
                  , a = 0;
                e.canvas.addEventListener("mousedown", qC(this, OC, (e => {
                    n = !0;
                    const t = (new si).setFromQuaternion(YC(this, DC, "f").quaternion, "YXZ");
                    r = t.y,
                    a = t.x,
                    i = {
                        x: e.clientX,
                        y: e.clientY
                    }
                }
                ), "f")),
                window.addEventListener("mouseup", qC(this, FC, ( () => {
                    n = !1
                }
                ), "f")),
                window.addEventListener("mousemove", qC(this, WC, (e => {
                    if (n) {
                        const t = Math.max(window.innerWidth, window.innerHeight)
                          , n = (e.clientX - i.x) / t
                          , s = (e.clientY - i.y) / t;
                        i = {
                            x: e.clientX,
                            y: e.clientY
                        };
                        const o = 10;
                        r -= n * o,
                        a -= s * o,
                        r %= 2 * Math.PI,
                        a = Math.max(-Math.PI / 2, Math.min(Math.PI / 2, a)),
                        r = Math.round(1e4 * r) / 1e4,
                        a = Math.round(1e4 * a) / 1e4;
                        const l = (new yn).setFromAxisAngle(new bn(1,0,0), a)
                          , c = (new yn).setFromAxisAngle(new bn(0,1,0), r);
                        YC(this, DC, "f").quaternion.copy(c).multiply(l)
                    }
                }
                ), "f")),
                window.addEventListener("contextmenu", qC(this, HC, (e => {
                    YC(this, NC, "f") && e.preventDefault()
                }
                ), "f"))
            }
            dispose() {
                window.removeEventListener("keydown", YC(this, UC, "f")),
                window.removeEventListener("keyup", YC(this, zC, "f")),
                YC(this, LC, "f").canvas.removeEventListener("mousedown", YC(this, OC, "f")),
                window.removeEventListener("mouseup", YC(this, FC, "f")),
                window.removeEventListener("mousemove", YC(this, WC, "f")),
                window.removeEventListener("contextmenu", YC(this, HC, "f"))
            }
            addToggleListener(e) {
                YC(this, BC, "f").push(e)
            }
            get isEnabled() {
                return YC(this, NC, "f")
            }
            set isEnabled(e) {
                if (YC(this, NC, "f") != e) {
                    qC(this, NC, e, "f");
                    for (const e of YC(this, BC, "f"))
                        e(YC(this, NC, "f"))
                }
            }
            toggle() {
                this.isEnabled = !YC(this, NC, "f")
            }
            update(e) {
                if (YC(this, NC, "f")) {
                    let t;
                    if (t = YC(this, KC, "f") ? 400 * e : 50 * e,
                    YC(this, VC, "f")) {
                        const e = new bn(0,0,-1).applyQuaternion(YC(this, DC, "f").quaternion);
                        YC(this, DC, "f").position.add(e.multiplyScalar(t))
                    }
                    if (YC(this, GC, "f")) {
                        const e = new bn(1,0,0).applyQuaternion(YC(this, DC, "f").quaternion);
                        YC(this, DC, "f").position.add(e.multiplyScalar(t))
                    }
                    if (YC(this, jC, "f")) {
                        const e = new bn(0,0,1).applyQuaternion(YC(this, DC, "f").quaternion);
                        YC(this, DC, "f").position.add(e.multiplyScalar(t))
                    }
                    if (YC(this, QC, "f")) {
                        const e = new bn(-1,0,0).applyQuaternion(YC(this, DC, "f").quaternion);
                        YC(this, DC, "f").position.add(e.multiplyScalar(t))
                    }
                }
            }
            get camera() {
                return YC(this, DC, "f")
            }
        }
        ;
        var ZC = i(3571)
          , JC = {};
        JC.styleTagTransform = u(),
        JC.setAttributes = l(),
        JC.insert = s().bind(null, "head"),
        JC.domAPI = r(),
        JC.insertStyleElement = h();
        t()(ZC.A, JC);
        ZC.A && ZC.A.locals && ZC.A.locals;
        i(3693);
        (0,
        m.F3)("Haptics", {
            web: () => i.e(789).then(i.bind(i, 3789)).then((e => new e.HapticsWeb))
        });
        var $C, eP, tP, nP, iP, rP, aP, sP = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, oP = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        eP = new WeakMap,
        tP = new WeakMap,
        nP = new WeakMap,
        iP = new WeakMap,
        rP = new WeakMap,
        $C = new WeakSet,
        aP = function() {
            if (oP(this, eP, "f").getSettingBoolean(el.VibrationEnabled))
                try {
                    navigator.vibrate && navigator.vibrate(11)
                } catch (e) {
                    console.error(e)
                }
        }
        ;
        const lP = class {
            constructor(e, t, n, i, r, a) {
                $C.add(this),
                eP.set(this, void 0),
                tP.set(this, void 0),
                nP.set(this, void 0),
                iP.set(this, void 0),
                rP.set(this, void 0),
                sP(this, eP, n, "f");
                const s = document.getElementById("ui");
                if (null == s)
                    throw new Error("UI element not found");
                sP(this, tP, s, "f"),
                sP(this, nP, document.createElement("div"), "f"),
                oP(this, nP, "f").className = "hidden",
                oP(this, tP, "f").appendChild(oP(this, nP, "f"));
                const o = document.createElement("button");
                o.className = "camera",
                o.innerHTML = '<img src="images/preview.svg">',
                o.addEventListener("touchstart", ( () => {
                    oP(this, $C, "m", aP).call(this),
                    o.classList.add("active"),
                    i()
                }
                )),
                o.addEventListener("touchend", ( () => {
                    o.classList.remove("active"),
                    r()
                }
                )),
                oP(this, nP, "f").appendChild(o),
                sP(this, iP, document.createElement("button"), "f"),
                oP(this, iP, "f").className = "reset",
                oP(this, iP, "f").innerHTML = '<img src="images/reset.svg">',
                oP(this, iP, "f").addEventListener("touchstart", ( () => {
                    t.playUIClick(),
                    oP(this, $C, "m", aP).call(this),
                    oP(this, iP, "f").classList.add("active"),
                    a()
                }
                )),
                oP(this, iP, "f").addEventListener("touchend", ( () => {
                    oP(this, iP, "f").classList.remove("active")
                }
                )),
                oP(this, nP, "f").appendChild(oP(this, iP, "f"));
                const l = document.createElement("div");
                l.className = "left-container",
                oP(this, nP, "f").appendChild(l);
                const c = document.createElement("div");
                c.innerHTML = '<img src="images/arrow_up.svg">';
                const h = document.createElement("div");
                h.innerHTML = '<img src="images/arrow_down.svg">';
                const d = document.createElement("div");
                d.className = "right-container",
                oP(this, nP, "f").appendChild(d);
                const u = document.createElement("div");
                u.innerHTML = '<img src="images/arrow_left.svg">';
                const p = document.createElement("div");
                p.innerHTML = '<img src="images/arrow_right.svg">',
                n.getSettingBoolean(el.TouchSteeringSide) ? (l.appendChild(c),
                l.appendChild(h),
                d.classList.add("steering"),
                d.appendChild(u),
                d.appendChild(p)) : (l.classList.add("steering"),
                l.appendChild(u),
                l.appendChild(p),
                d.appendChild(c),
                d.appendChild(h)),
                sP(this, rP, (t => {
                    let n = !1
                      , i = !1
                      , r = !1
                      , a = !1;
                    for (let e = 0; e < t.touches.length; e++) {
                        const s = t.touches.item(e);
                        if (null != s) {
                            switch (document.elementFromPoint(s.clientX, s.clientY)) {
                            case c:
                                n = !0;
                                break;
                            case p:
                                i = !0;
                                break;
                            case h:
                                r = !0;
                                break;
                            case u:
                                a = !0
                            }
                        }
                    }
                    e.up == n && e.right == i && e.down == r && e.left == a || oP(this, $C, "m", aP).call(this),
                    e.up = n,
                    e.right = i,
                    e.down = r,
                    e.left = a,
                    c.className = n ? "active" : "",
                    p.className = i ? "active" : "",
                    h.className = r ? "active" : "",
                    u.className = a ? "active" : "",
                    t.target instanceof HTMLButtonElement || t.preventDefault()
                }
                ), "f"),
                window.addEventListener("touchstart", oP(this, rP, "f"), {
                    passive: !1
                }),
                window.addEventListener("touchmove", oP(this, rP, "f"), {
                    passive: !1
                }),
                window.addEventListener("touchend", oP(this, rP, "f"), {
                    passive: !1
                })
            }
            setEnabled(e) {
                oP(this, nP, "f").className = e ? "touch-controls" : "hidden"
            }
            setResetCheckpointAvailable(e) {
                e ? oP(this, iP, "f").classList.add("checkpoint-available") : oP(this, iP, "f").classList.remove("checkpoint-available")
            }
            dispose() {
                oP(this, tP, "f").removeChild(oP(this, nP, "f")),
                window.removeEventListener("touchstart", oP(this, rP, "f")),
                window.removeEventListener("touchmove", oP(this, rP, "f")),
                window.removeEventListener("touchend", oP(this, rP, "f"))
            }
        }
        ;
        var cP, hP, dP, uP, pP, fP, mP, gP, vP = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, wP = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        cP = new WeakMap,
        hP = new WeakMap,
        dP = new WeakMap,
        uP = new WeakMap,
        pP = new WeakMap,
        fP = new WeakMap,
        mP = new WeakMap,
        gP = new WeakMap;
        const yP = class {
            constructor(e) {
                cP.set(this, !1),
                hP.set(this, !1),
                dP.set(this, !1),
                uP.set(this, !1),
                pP.set(this, !1),
                fP.set(this, void 0),
                mP.set(this, void 0),
                gP.set(this, []),
                window.addEventListener("keydown", vP(this, fP, (t => {
                    e.checkKeyBinding(t, gk.VehicleAccelerate) ? (this.up = !0,
                    t.preventDefault()) : e.checkKeyBinding(t, gk.VehicleTurnRight) ? (this.right = !0,
                    t.preventDefault()) : e.checkKeyBinding(t, gk.VehicleBrake) ? (this.down = !0,
                    t.preventDefault()) : e.checkKeyBinding(t, gk.VehicleTurnLeft) && (this.left = !0,
                    t.preventDefault())
                }
                ), "f")),
                window.addEventListener("keyup", vP(this, mP, (t => {
                    e.checkKeyBinding(t, gk.VehicleAccelerate) ? this.up = !1 : e.checkKeyBinding(t, gk.VehicleTurnRight) ? this.right = !1 : e.checkKeyBinding(t, gk.VehicleBrake) ? this.down = !1 : e.checkKeyBinding(t, gk.VehicleTurnLeft) && (this.left = !1)
                }
                ), "f"))
            }
            get up() {
                return wP(this, cP, "f")
            }
            set up(e) {
                if (wP(this, cP, "f") != e) {
                    vP(this, cP, e, "f");
                    for (const e of wP(this, gP, "f"))
                        e(this)
                }
            }
            get right() {
                return wP(this, hP, "f")
            }
            set right(e) {
                if (wP(this, hP, "f") != e) {
                    vP(this, hP, e, "f");
                    for (const e of wP(this, gP, "f"))
                        e(this)
                }
            }
            get down() {
                return wP(this, dP, "f")
            }
            set down(e) {
                if (wP(this, dP, "f") != e) {
                    vP(this, dP, e, "f");
                    for (const e of wP(this, gP, "f"))
                        e(this)
                }
            }
            get left() {
                return wP(this, uP, "f")
            }
            set left(e) {
                if (wP(this, uP, "f") != e) {
                    vP(this, uP, e, "f");
                    for (const e of wP(this, gP, "f"))
                        e(this)
                }
            }
            get reset() {
                return wP(this, pP, "f")
            }
            set reset(e) {
                if (wP(this, pP, "f") != e) {
                    vP(this, pP, e, "f");
                    for (const e of wP(this, gP, "f"))
                        e(this)
                }
            }
            addChangeCallback(e) {
                wP(this, gP, "f").push(e)
            }
            removeChangeCallback(e) {
                const t = wP(this, gP, "f").indexOf(e);
                t >= 0 && wP(this, gP, "f").splice(t, 1)
            }
            dispose() {
                window.removeEventListener("keydown", wP(this, fP, "f")),
                window.removeEventListener("keyup", wP(this, mP, "f"))
            }
            getControls() {
                return {
                    up: this.up,
                    right: this.right,
                    down: this.down,
                    left: this.left,
                    reset: this.reset
                }
            }
        }
        ;
        var bP, AP = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        bP = new WeakMap;
        const xP = class {
            constructor() {
                bP.set(this, [])
            }
            push(e) {
                if (AP(this, bP, "f").length > 0) {
                    if (e.frames != AP(this, bP, "f")[AP(this, bP, "f").length - 1].frames + 1)
                        throw new Error("Car states are not continuous")
                } else if (e.frames > 0)
                    throw new Error("First frame must be zero");
                AP(this, bP, "f").push(e)
            }
            getFrame(e) {
                return e >= 0 && e < AP(this, bP, "f").length ? AP(this, bP, "f")[e] : null
            }
            getLastFrame() {
                return 0 == AP(this, bP, "f").length ? new Gp(0) : new Gp(AP(this, bP, "f")[AP(this, bP, "f").length - 1].frames)
            }
        }
        ;
        var kP = i(4804)
          , EP = {};
        EP.styleTagTransform = u(),
        EP.setAttributes = l(),
        EP.insert = s().bind(null, "head"),
        EP.domAPI = r(),
        EP.insertStyleElement = h();
        t()(kP.A, EP);
        kP.A && kP.A.locals && kP.A.locals;
        var SP, MP, _P, TP, CP, PP, IP, RP, LP, DP, NP = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, BP = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        MP = new WeakMap,
        _P = new WeakMap,
        TP = new WeakMap,
        CP = new WeakMap,
        PP = new WeakMap,
        IP = new WeakMap,
        RP = new WeakMap,
        LP = new WeakMap,
        SP = new WeakSet,
        DP = function() {
            "top" == BP(this, _P, "f").getSetting(el.Checkpoints) || BP(this, TP, "f").touchEnabled ? BP(this, CP, "f").classList.remove("up") : BP(this, CP, "f").classList.add("up"),
            BP(this, TP, "f").touchEnabled ? BP(this, CP, "f").classList.add("touch") : BP(this, CP, "f").classList.remove("touch")
        }
        ;
        const UP = class {
            constructor(e, t, n, i, r, a) {
                SP.add(this),
                MP.set(this, void 0),
                _P.set(this, void 0),
                TP.set(this, void 0),
                CP.set(this, void 0),
                PP.set(this, void 0),
                IP.set(this, void 0),
                RP.set(this, !0),
                LP.set(this, void 0),
                NP(this, _P, n, "f"),
                NP(this, TP, i, "f");
                const s = document.getElementById("ui");
                if (null == s)
                    throw new Error("UI element not found");
                NP(this, MP, s, "f"),
                NP(this, CP, document.createElement("div"), "f"),
                BP(this, CP, "f").className = "game-toolbar visible",
                BP(this, SP, "m", DP).call(this),
                BP(this, TP, "f").addChangeListener(NP(this, LP, ( () => {
                    BP(this, SP, "m", DP).call(this)
                }
                ), "f")),
                NP(this, PP, document.createElement("button"), "f"),
                BP(this, PP, "f").className = "button",
                BP(this, PP, "f").innerHTML = '<img class="button-icon" src="images/quit.svg"> ',
                BP(this, PP, "f").append(document.createTextNode(t.get("Exit"))),
                BP(this, PP, "f").addEventListener("click", ( () => {
                    e.playUIClick(),
                    r()
                }
                )),
                BP(this, CP, "f").appendChild(BP(this, PP, "f")),
                NP(this, IP, document.createElement("button"), "f"),
                BP(this, IP, "f").className = "button",
                BP(this, IP, "f").innerHTML = '<img class="button-icon" src="images/preview.svg"> ',
                BP(this, IP, "f").append(document.createTextNode(t.get("Watch"))),
                BP(this, IP, "f").addEventListener("click", ( () => {
                    e.playUIClick(),
                    a()
                }
                )),
                BP(this, CP, "f").appendChild(BP(this, IP, "f")),
                BP(this, MP, "f").appendChild(BP(this, CP, "f"))
            }
            dispose() {
                BP(this, MP, "f").removeChild(BP(this, CP, "f")),
                BP(this, TP, "f").removeChangeListener(BP(this, LP, "f"))
            }
            setWatchButtonEnabled(e) {
                BP(this, IP, "f").disabled = !e
            }
            setVisible(e) {
                BP(this, RP, "f") != e && (e ? BP(this, CP, "f").classList.add("visible") : BP(this, CP, "f").classList.remove("visible"),
                NP(this, RP, e, "f"))
            }
            hasFocus() {
                return document.activeElement == BP(this, PP, "f") || document.activeElement == BP(this, IP, "f")
            }
        }
        ;
        var zP, OP = function(e, t, n, i) {
            return new (n || (n = Promise))((function(r, a) {
                function s(e) {
                    try {
                        l(i.next(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function o(e) {
                    try {
                        l(i.throw(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(e) {
                    var t;
                    e.done ? r(e.value) : (t = e.value,
                    t instanceof n ? t : new n((function(e) {
                        e(t)
                    }
                    ))).then(s, o)
                }
                l((i = i.apply(e, t || [])).next())
            }
            ))
        };
        !function(e) {
            e[e.Loading = 0] = "Loading",
            e[e.Error = 1] = "Error",
            e[e.Ready = 2] = "Ready"
        }(zP || (zP = {}));
        let FP = zP.Loading
          , WP = !1
          , HP = !1;
        function VP() {
            return OP(this, void 0, void 0, (function*() {
                try {
                    FP = zP.Ready
                } catch (e) {
                    FP = zP.Error,
                    console.error(e)
                }
            }
            ))
        }
        function GP() {
            if (FP == zP.Ready && !WP)
                try {
                    window.CrazyGames ? window.CrazyGames.SDK.game.gameplayStart() : window.PokiSDK ? window.PokiSDK.gameplayStart() : window.adsbygoogle,
                    WP = !0
                } catch (e) {
                    console.error(e)
                }
        }
        function jP() {
            if (FP == zP.Ready && WP)
                try {
                    window.CrazyGames ? window.CrazyGames.SDK.game.gameplayStop() : window.PokiSDK ? window.PokiSDK.gameplayStop() : window.adsbygoogle,
                    WP = !1
                } catch (e) {
                    console.error(e)
                }
        }
        function QP() {
            if (FP == zP.Ready && !HP)
                try {
                    window.CrazyGames ? window.CrazyGames.SDK.game.loadingStart() : window.PokiSDK || window.adsbygoogle,
                    HP = !0
                } catch (e) {
                    console.error(e)
                }
        }
        function KP() {
            if (FP == zP.Ready && HP)
                try {
                    window.CrazyGames ? window.CrazyGames.SDK.game.loadingStop() : window.PokiSDK || window.adsbygoogle,
                    HP = !1
                } catch (e) {
                    console.error(e)
                }
        }
        function qP() {
            if (FP == zP.Ready)
                try {
                    window.CrazyGames ? window.CrazyGames.SDK.game.loadingStop() : window.PokiSDK ? window.PokiSDK.gameLoadingFinished() : window.adsbygoogle
                } catch (e) {
                    console.error(e)
                }
        }
        function YP(e, t) {
            return OP(this, void 0, void 0, (function*() {
                if (FP == zP.Ready)
                    try {
                        if (window.CrazyGames) {
                            const t = window.CrazyGames;
                            yield new Promise(( (n, i) => {
                                t.SDK.ad.requestAd("midgame", {
                                    adFinished: n,
                                    adError: i,
                                    adStarted: e
                                })
                            }
                            ))
                        } else if (window.PokiSDK)
                            yield window.PokiSDK.commercialBreak();
                        else if (window.adsbygoogle) {
                            const n = window.adsbygoogle;
                            yield new Promise((i => {
                                n.push({
                                    type: "start",
                                    name: t,
                                    beforeAd: e,
                                    adBreakDone: i
                                })
                            }
                            ))
                        }
                    } catch (e) {
                        console.error(e)
                    }
            }
            ))
        }
        var XP = i(4538)
          , ZP = {};
        ZP.styleTagTransform = u(),
        ZP.setAttributes = l(),
        ZP.insert = s().bind(null, "head"),
        ZP.domAPI = r(),
        ZP.insertStyleElement = h();
        t()(XP.A, ZP);
        XP.A && XP.A.locals && XP.A.locals;
        var JP, $P, eI, tI = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, nI = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        JP = new WeakMap,
        $P = new WeakMap,
        eI = new WeakMap;
        const iI = class {
            constructor(e) {
                JP.set(this, void 0),
                $P.set(this, void 0),
                eI.set(this, !1);
                const t = document.getElementById("ui");
                if (null == t)
                    throw new Error("UI element not found");
                tI(this, JP, t, "f"),
                tI(this, $P, document.createElement("div"), "f"),
                nI(this, $P, "f").className = "pause-screen",
                nI(this, JP, "f").appendChild(nI(this, $P, "f"));
                const n = document.createElement("div");
                n.className = "title",
                n.textContent = e.get("Paused"),
                nI(this, $P, "f").appendChild(n)
            }
            dispose() {
                nI(this, JP, "f").removeChild(nI(this, $P, "f"))
            }
            startFadeOut(e) {
                nI(this, eI, "f") || (tI(this, eI, !0, "f"),
                nI(this, $P, "f").classList.add("fade-out"),
                setTimeout(e, 250))
            }
        }
        ;
        var rI = i(4239)
          , aI = {};
        aI.styleTagTransform = u(),
        aI.setAttributes = l(),
        aI.insert = s().bind(null, "head"),
        aI.domAPI = r(),
        aI.insertStyleElement = h();
        t()(rI.A, aI);
        rI.A && rI.A.locals && rI.A.locals;
        var sI, oI, lI, cI, hI = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, dI = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        sI = new WeakMap,
        oI = new WeakMap,
        lI = new WeakMap,
        cI = new WeakMap;
        const uI = class {
            constructor(e, t) {
                sI.set(this, void 0),
                oI.set(this, void 0),
                lI.set(this, void 0),
                cI.set(this, void 0),
                hI(this, sI, t, "f");
                const n = document.getElementById("ui");
                if (null == n)
                    throw new Error("UI element not found");
                hI(this, oI, n, "f"),
                hI(this, lI, document.createElement("div"), "f"),
                dI(this, lI, "f").className = "ghost-loading-ui",
                dI(this, lI, "f").textContent = e.get("Loading replay"),
                dI(this, oI, "f").appendChild(dI(this, lI, "f")),
                hI(this, cI, document.createElement("span"), "f"),
                dI(this, cI, "f").className = "percentage",
                dI(this, lI, "f").appendChild(dI(this, cI, "f")),
                this.update(1)
            }
            dispose() {
                dI(this, oI, "f").removeChild(dI(this, lI, "f"))
            }
            setOverridePosition(e) {
                const t = dI(this, sI, "f").getSetting(el.Speedometer);
                (null != e ? e : "top" == t) ? dI(this, lI, "f").classList.add("down") : dI(this, lI, "f").classList.remove("down")
            }
            update(e) {
                dI(this, cI, "f").textContent = Math.floor(100 * e).toString() + "%",
                e >= 1 ? dI(this, lI, "f").classList.add("hide") : dI(this, lI, "f").classList.remove("hide")
            }
        }
        ;
        new WeakMap,
        new WeakMap,
        new WeakMap,
        new WeakMap,
        new WeakMap,
        new WeakMap,
        new WeakMap;
        var pI, fI, mI, gI, vI, wI, yI, bI, AI, xI, kI, EI, SI, MI, _I, TI, CI, PI, II, RI, LI, DI, NI, BI, UI, zI, OI, FI, WI, HI, VI, GI, jI, QI, KI, qI, YI, XI, ZI, JI, $I, eR, tR, nR, iR, rR, aR, sR, oR, lR, cR, hR, dR, uR, pR, fR, mR, gR, vR = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, wR = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        fI = new WeakMap,
        mI = new WeakMap,
        gI = new WeakMap,
        vI = new WeakMap,
        wI = new WeakMap,
        yI = new WeakMap,
        bI = new WeakMap,
        AI = new WeakMap,
        xI = new WeakMap,
        kI = new WeakMap,
        EI = new WeakMap,
        SI = new WeakMap,
        MI = new WeakMap,
        _I = new WeakMap,
        TI = new WeakMap,
        CI = new WeakMap,
        PI = new WeakMap,
        II = new WeakMap,
        RI = new WeakMap,
        LI = new WeakMap,
        DI = new WeakMap,
        NI = new WeakMap,
        BI = new WeakMap,
        UI = new WeakMap,
        zI = new WeakMap,
        OI = new WeakMap,
        FI = new WeakMap,
        WI = new WeakMap,
        HI = new WeakMap,
        VI = new WeakMap,
        GI = new WeakMap,
        jI = new WeakMap,
        QI = new WeakMap,
        KI = new WeakMap,
        qI = new WeakMap,
        YI = new WeakMap,
        XI = new WeakMap,
        ZI = new WeakMap,
        JI = new WeakMap,
        $I = new WeakMap,
        eR = new WeakMap,
        tR = new WeakMap,
        nR = new WeakMap,
        iR = new WeakMap,
        rR = new WeakMap,
        aR = new WeakMap,
        sR = new WeakMap,
        pI = new WeakSet,
        oR = function(e) {
            var t, n, i, r, a, s, o, l, c;
            if (e) {
                const e = wR(this, pI, "m", fR).call(this);
                vR(this, DI, new cT(wR(this, yI, "f"),wR(this, MI, "f"),wR(this, kI, "f")), "f"),
                vR(this, NI, new uI(wR(this, yI, "f"),wR(this, kI, "f")), "f"),
                vR(this, BI, new V_(wR(this, gI, "f").getTotalNumberOfCheckpointIndices(),wR(this, kI, "f")), "f"),
                vR(this, UI, new kT(wR(this, kI, "f")), "f"),
                vR(this, zI, new $k(wR(this, yI, "f"),wR(this, kI, "f")), "f"),
                null == e || e.settings.isSelf || (wR(this, zI, "f").nickname = e.settings.name),
                vR(this, FI, new UP(wR(this, AI, "f"),wR(this, yI, "f"),wR(this, kI, "f"),wR(this, MI, "f"),wR(this, TI, "f"),( () => {
                    wR(this, YI, "f").length > 0 && null != wR(this, CI, "f") && wR(this, CI, "f").call(this, wR(this, PI, "f"), wR(this, II, "f"), wR(this, RI, "f"), wR(this, YI, "f").map((e => e.settings)))
                }
                )), "f"),
                wR(this, FI, "f").setWatchButtonEnabled(wR(this, YI, "f").length > 0 && null != wR(this, CI, "f")),
                wR(this, FI, "f").setVisible(!(null !== (n = null === (t = wR(this, qI, "f")) || void 0 === t ? void 0 : t.hasStarted()) && void 0 !== n && n)),
                wR(this, MI, "f").touchEnabled ? (wR(this, NI, "f").setOverridePosition(!0),
                wR(this, BI, "f").setOverridePosition(!0),
                wR(this, zI, "f").setOverridePosition(!0),
                wR(this, UI, "f").setOverridePosition(!0)) : (wR(this, NI, "f").setOverridePosition(null),
                wR(this, BI, "f").setOverridePosition(null),
                wR(this, zI, "f").setOverridePosition(null),
                wR(this, UI, "f").setOverridePosition(null)),
                wR(this, VI, "f").setEnabled(wR(this, MI, "f").touchEnabled),
                wR(this, pI, "m", gR).call(this)
            } else
                null === (i = wR(this, DI, "f")) || void 0 === i || i.dispose(),
                vR(this, DI, null, "f"),
                null === (r = wR(this, NI, "f")) || void 0 === r || r.dispose(),
                vR(this, NI, null, "f"),
                null === (a = wR(this, BI, "f")) || void 0 === a || a.dispose(),
                vR(this, BI, null, "f"),
                null === (s = wR(this, UI, "f")) || void 0 === s || s.dispose(),
                vR(this, UI, null, "f"),
                null === (o = wR(this, zI, "f")) || void 0 === o || o.dispose(),
                vR(this, zI, null, "f"),
                null === (l = wR(this, OI, "f")) || void 0 === l || l.dispose(),
                vR(this, OI, null, "f"),
                null === (c = wR(this, FI, "f")) || void 0 === c || c.dispose(),
                vR(this, FI, null, "f")
        }
        ,
        lR = function() {
            return null != wR(this, qI, "f") && !(wR(this, qI, "f").hasFinished() || !wR(this, qI, "f").hasCheckpointToRespawnAt() || !wR(this, jI, "f") || null != wR(this, KI, "f") && (new Date).getTime() - wR(this, KI, "f").getTime() < 250)
        }
        ,
        cR = function() {
            null == wR(this, WI, "f") && (null == wR(this, qI, "f") || wR(this, qI, "f").hasFinished() || (wR(this, kI, "f").getSettingBoolean(el.CockpitCameraToggle) ? wR(this, bI, "f").camera == wR(this, qI, "f").cameraOrbit ? wR(this, bI, "f").setCamera(wR(this, qI, "f").cameraCockpit) : wR(this, bI, "f").setCamera(wR(this, qI, "f").cameraOrbit) : wR(this, kI, "f").getSettingBoolean(el.DefaultCameraMode) ? wR(this, bI, "f").setCamera(wR(this, qI, "f").cameraOrbit) : wR(this, bI, "f").setCamera(wR(this, qI, "f").cameraCockpit)))
        }
        ,
        hR = function() {
            wR(this, nR, "f").isEnabled || null == wR(this, qI, "f") || wR(this, qI, "f").hasFinished() || wR(this, kI, "f").getSettingBoolean(el.CockpitCameraToggle) || (wR(this, kI, "f").getSettingBoolean(el.DefaultCameraMode) ? wR(this, bI, "f").setCamera(wR(this, qI, "f").cameraCockpit) : wR(this, bI, "f").setCamera(wR(this, qI, "f").cameraOrbit))
        }
        ,
        dR = function() {
            var e;
            wR(this, aR, "f") || ((null === (e = wR(this, qI, "f")) || void 0 === e ? void 0 : e.hasFinished()) ? (vR(this, aR, !0, "f"),
            YP(( () => {
                wR(this, AI, "f").isAdPlaying = !0
            }
            ), "game-finish-reset").finally(( () => {
                vR(this, aR, !1, "f"),
                wR(this, AI, "f").isAdPlaying = !1,
                wR(this, pI, "m", uR).call(this),
                wR(this, pI, "m", pR).call(this)
            }
            ))) : (wR(this, pI, "m", uR).call(this),
            wR(this, pI, "m", pR).call(this)))
        }
        ,
        uR = function() {
            var e, t, n;
            const i = wR(this, xI, "f").getCurrentUserProfile();
            let r = !1;
            null != wR(this, qI, "f") ? (r = wR(this, bI, "f").camera == wR(this, qI, "f").cameraCockpit,
            wR(this, pI, "m", gR).call(this),
            wR(this, qI, "f").dispose(),
            vR(this, qI, null, "f")) : r = wR(this, kI, "f").getSettingBoolean(el.DefaultCameraMode);
            const a = wR(this, gI, "f").getStartTransform();
            if (null == a)
                throw new Error("Start transform is null");
            vR(this, qI, new Qw(wR(this, fI, "f"),a,null,wR(this, QI, "f"),wR(this, bI, "f"),wR(this, AI, "f"),wR(this, vI, "f"),wR(this, gI, "f"),wR(this, kI, "f")), "f"),
            wR(this, qI, "f").notificationAudioEnabled = !0,
            wR(this, qI, "f").addResetCallback(( () => {
                wR(this, QI, "f").reset = !1,
                null == wR(this, qI, "f") ? vR(this, jI, !1, "f") : (vR(this, jI, wR(this, qI, "f").getControls().up || wR(this, qI, "f").getControls().down, "f"),
                wR(this, jI, "f") && vR(this, KI, new Date, "f"))
            }
            )),
            wR(this, qI, "f").addCheckpointCallback((e => {
                if (null == wR(this, qI, "f"))
                    return;
                const t = wR(this, pI, "m", fR).call(this);
                if (null != wR(this, zI, "f")) {
                    const n = wR(this, qI, "f").getTime();
                    let i = null;
                    null != t && t.checkpoints.length > e && (i = t.checkpoints[e].time),
                    wR(this, zI, "f").showCheckpointTime(n, i)
                }
                if (null != wR(this, UI, "f") && null != t && t.checkpoints.length > e) {
                    const n = t.checkpoints[e].speedKmh;
                    wR(this, UI, "f").showCheckpointSpeed(wR(this, qI, "f").getSpeedKmh(), n)
                }
            }
            )),
            wR(this, qI, "f").addFinishCallback((e => {
                var t, n;
                const r = e.getTime()
                  , a = e.getRecording()
                  , s = e.getColors();
                let o;
                const l = wR(this, $I, "f");
                if (null == wR(this, $I, "f") || r.lessThan(wR(this, $I, "f"))) {
                    if (o = wR(this, _I, "f").call(this, wR(this, gI, "f").getID(), a, r),
                    0 == wR(this, YI, "f").length)
                        wR(this, YI, "f").push({
                            car: null,
                            carId: null,
                            hasEnded: !1,
                            loadedFrames: 0,
                            maxFrames: 0,
                            settings: {
                                recording: a,
                                carColors: s,
                                name: i.nickname,
                                time: r,
                                isSelf: !0
                            },
                            replay: null,
                            checkpoints: []
                        }),
                        null === (t = wR(this, FI, "f")) || void 0 === t || t.setWatchButtonEnabled(null != wR(this, CI, "f"));
                    else {
                        const e = wR(this, YI, "f").find((e => e.settings.isSelf));
                        null != e && (e.settings = {
                            recording: a,
                            carColors: s,
                            name: i.nickname,
                            time: r,
                            isSelf: !0
                        }),
                        null === (n = wR(this, FI, "f")) || void 0 === n || n.setWatchButtonEnabled(null != wR(this, CI, "f"))
                    }
                    vR(this, $I, r, "f")
                } else
                    o = Promise.resolve(null);
                let c = null;
                const h = wR(this, pI, "m", fR).call(this);
                null == h || h.settings.isSelf || (c = {
                    record: h.settings.time,
                    name: h.settings.name
                }),
                vR(this, OI, new RC(wR(this, yI, "f"),wR(this, AI, "f"),wR(this, PI, "f").name,r,l,c,o), "f")
            }
            )),
            wR(this, qI, "f").setColors(i.carColors),
            r ? wR(this, bI, "f").setCamera(wR(this, qI, "f").cameraCockpit) : wR(this, bI, "f").setCamera(wR(this, qI, "f").cameraOrbit),
            wR(this, nR, "f").isEnabled = !1,
            null === (e = wR(this, OI, "f")) || void 0 === e || e.dispose(),
            vR(this, OI, null, "f"),
            null === (t = wR(this, zI, "f")) || void 0 === t || t.hideCheckpointTime(),
            null === (n = wR(this, UI, "f")) || void 0 === n || n.hideCheckpointSpeed(),
            wR(this, QI, "f").reset = !1,
            vR(this, jI, !1, "f"),
            vR(this, KI, null, "f")
        }
        ,
        pR = function() {
            var e;
            if (wR(this, kI, "f").getSettingBoolean(el.GhostCarEnabled))
                for (const t of wR(this, YI, "f")) {
                    null != t.car && (t.car.dispose(),
                    t.car = null);
                    const n = wR(this, gI, "f").getStartTransform();
                    if (null == n)
                        throw new Error("Start transform is null");
                    if (t.settings.recording != (null === (e = t.replay) || void 0 === e ? void 0 : e.recording) && (null != t.carId && (wR(this, mI, "f").deleteCar(t.carId),
                    t.carId = null),
                    t.replay = null),
                    null == t.replay) {
                        const e = t.settings.time.numberOfFrames + wR(this, sR, "f")
                          , i = new xP
                          , r = [];
                        let a = 0;
                        const s = wR(this, mI, "f").createCar(n, wR(this, vI, "f").getMountainVertices(), wR(this, vI, "f").getMountainOffset(), wR(this, gI, "f").getTrackData(), t.settings.recording, (n => {
                            i.push(n),
                            n.nextCheckpointIndex > a && (r.push({
                                time: new Gp(n.frames),
                                speedKmh: n.speedKmh
                            }),
                            a = n.nextCheckpointIndex),
                            n.frames >= e && null != t.carId && (null != n.finishFrames && n.finishFrames == t.settings.time.numberOfFrames || vR(this, JI, !0, "f"),
                            wR(this, mI, "f").deleteCar(t.carId),
                            t.carId = null),
                            t.loadedFrames = n.frames,
                            t.maxFrames = e
                        }
                        ));
                        i.push(s),
                        wR(this, mI, "f").startCar(s.id, new Gp(e)),
                        t.carId = s.id,
                        t.loadedFrames = 0,
                        t.maxFrames = e,
                        t.replay = {
                            replay: i,
                            recording: t.settings.recording
                        },
                        t.checkpoints = r
                    }
                    const i = new Qw(null,n,t.settings.recording,null,wR(this, bI, "f"),wR(this, AI, "f"),wR(this, vI, "f"),wR(this, gI, "f"),wR(this, kI, "f"));
                    i.setColors(t.settings.carColors),
                    i.audioVolume = .35,
                    wR(this, pI, "m", mR).call(this),
                    t.car = i,
                    t.hasEnded = !1
                }
        }
        ,
        fR = function() {
            let e = null;
            for (const t of wR(this, YI, "f"))
                (null == e || t.settings.time.lessThan(e.settings.time) || t.settings.time.equals(e.settings.time) && t.settings.isSelf) && (e = t);
            return e
        }
        ,
        mR = function() {
            if (null != wR(this, qI, "f"))
                for (const e of wR(this, YI, "f"))
                    if (null != e.car) {
                        const t = e.car.getPosition().distanceTo(wR(this, qI, "f").getPosition())
                          , n = Math.max(0, Math.min(1, t / 5));
                        e.car.setOpacity(n)
                    }
        }
        ,
        gR = function() {
            var e;
            if (null != wR(this, zI, "f")) {
                const t = wR(this, pI, "m", fR).call(this);
                wR(this, zI, "f").record = null !== (e = null == t ? void 0 : t.settings.time) && void 0 !== e ? e : null,
                null == t || t.settings.isSelf ? wR(this, zI, "f").nickname = null : wR(this, zI, "f").nickname = t.settings.name
            }
        }
        ;
        const yR = class {
            constructor(e, t, n, i, r, a, s, o, l, c, h, d, u, p, f, m, g, v, w, y, b, A) {
                if (pI.add(this),
                fI.set(this, void 0),
                mI.set(this, void 0),
                gI.set(this, void 0),
                vI.set(this, void 0),
                wI.set(this, void 0),
                yI.set(this, void 0),
                bI.set(this, void 0),
                AI.set(this, void 0),
                xI.set(this, void 0),
                kI.set(this, void 0),
                EI.set(this, void 0),
                SI.set(this, void 0),
                MI.set(this, void 0),
                _I.set(this, void 0),
                TI.set(this, void 0),
                CI.set(this, void 0),
                PI.set(this, void 0),
                II.set(this, void 0),
                RI.set(this, void 0),
                LI.set(this, !0),
                DI.set(this, null),
                NI.set(this, null),
                BI.set(this, null),
                UI.set(this, null),
                zI.set(this, null),
                OI.set(this, null),
                FI.set(this, null),
                WI.set(this, null),
                HI.set(this, null),
                VI.set(this, void 0),
                GI.set(this, void 0),
                jI.set(this, !1),
                QI.set(this, void 0),
                KI.set(this, null),
                qI.set(this, null),
                YI.set(this, []),
                XI.set(this, void 0),
                ZI.set(this, []),
                JI.set(this, !1),
                $I.set(this, void 0),
                eR.set(this, void 0),
                tR.set(this, void 0),
                nR.set(this, void 0),
                iR.set(this, null),
                rR.set(this, null),
                aR.set(this, !1),
                this.isPaused = !1,
                sR.set(this, 1e4),
                vR(this, fI, e, "f"),
                vR(this, mI, t, "f"),
                vR(this, gI, n, "f"),
                vR(this, vI, i, "f"),
                vR(this, wI, r, "f"),
                vR(this, yI, a, "f"),
                vR(this, bI, s, "f"),
                vR(this, AI, o, "f"),
                vR(this, xI, l, "f"),
                vR(this, kI, c, "f"),
                vR(this, EI, h, "f"),
                vR(this, SI, d, "f"),
                vR(this, MI, u, "f"),
                vR(this, _I, y, "f"),
                vR(this, TI, b, "f"),
                vR(this, CI, A, "f"),
                vR(this, $I, v, "f"),
                vR(this, PI, p, "f"),
                vR(this, II, f, "f"),
                vR(this, RI, m, "f"),
                n.loadTrackData(f),
                n.generateMeshes(),
                i.generateMountains(n.getBounds()),
                vR(this, YI, g.map((e => ({
                    car: null,
                    carId: null,
                    hasEnded: !1,
                    loadedFrames: 0,
                    maxFrames: 0,
                    settings: e,
                    replay: null,
                    checkpoints: []
                }))), "f"),
                vR(this, QI, new yP(c), "f"),
                wR(this, QI, "f").addChangeCallback((e => {
                    null == wR(this, qI, "f") || !e.up && !e.down || wR(this, jI, "f") || (vR(this, jI, !0, "f"),
                    vR(this, KI, new Date, "f"))
                }
                )),
                h.setCursorHiddenWhenInactive(!0),
                vR(this, VI, new lP(wR(this, QI, "f"),wR(this, AI, "f"),wR(this, kI, "f"),( () => {
                    wR(this, pI, "m", cR).call(this)
                }
                ),( () => {
                    wR(this, pI, "m", hR).call(this)
                }
                ),( () => {
                    var e;
                    !wR(this, aR, "f") && (null === (e = wR(this, qI, "f")) || void 0 === e ? void 0 : e.hasStarted()) && (wR(this, pI, "m", lR).call(this) ? wR(this, QI, "f").reset = !0 : (wR(this, pI, "m", dR).call(this),
                    wR(this, QI, "f").reset = !1))
                }
                )), "f"),
                wR(this, VI, "f").setEnabled(wR(this, MI, "f").touchEnabled),
                wR(this, pI, "m", oR).call(this, !0),
                wR(this, pI, "m", gR).call(this),
                vR(this, nR, new XC(s,c), "f"),
                wR(this, nR, "f").addToggleListener((e => {
                    e ? (wR(this, pI, "m", oR).call(this, !1),
                    s.setCamera(wR(this, nR, "f").camera)) : null != wR(this, qI, "f") && (wR(this, pI, "m", oR).call(this, wR(this, LI, "f")),
                    wR(this, kI, "f").getSettingBoolean(el.DefaultCameraMode) ? wR(this, bI, "f").setCamera(wR(this, qI, "f").cameraCockpit) : wR(this, bI, "f").setCamera(wR(this, qI, "f").cameraOrbit))
                }
                )),
                wR(this, MI, "f").addChangeListener(vR(this, GI, (e => {
                    var t, n, i, r, a, s, o, l;
                    e ? (null === (t = wR(this, NI, "f")) || void 0 === t || t.setOverridePosition(!0),
                    null === (n = wR(this, BI, "f")) || void 0 === n || n.setOverridePosition(!0),
                    null === (i = wR(this, zI, "f")) || void 0 === i || i.setOverridePosition(!0),
                    null === (r = wR(this, UI, "f")) || void 0 === r || r.setOverridePosition(!0)) : (null === (a = wR(this, NI, "f")) || void 0 === a || a.setOverridePosition(null),
                    null === (s = wR(this, BI, "f")) || void 0 === s || s.setOverridePosition(null),
                    null === (o = wR(this, zI, "f")) || void 0 === o || o.setOverridePosition(null),
                    null === (l = wR(this, UI, "f")) || void 0 === l || l.setOverridePosition(null)),
                    wR(this, VI, "f").setEnabled(e)
                }
                ), "f")),
                wR(this, pI, "m", uR).call(this),
                wR(this, pI, "m", pR).call(this),
                vR(this, XI, w, "f"),
                null != wR(this, XI, "f") && wR(this, XI, "f").addCarUpdateCallback((e => {
                    for (let t = 0; t < e.length; t++) {
                        const {carColors: n, carState: i} = e[t];
                        if (t >= wR(this, ZI, "f").length) {
                            const e = new Qw(null,{
                                position: new bn,
                                quaternion: new yn
                            },null,null,wR(this, bI, "f"),wR(this, AI, "f"),wR(this, vI, "f"),wR(this, gI, "f"),wR(this, kI, "f"));
                            wR(this, ZI, "f").push(e)
                        }
                        const r = wR(this, ZI, "f")[t];
                        r.setColors(n),
                        r.setCarState(i)
                    }
                    if (wR(this, ZI, "f").length > e.length) {
                        for (let t = e.length; t < wR(this, ZI, "f").length; t++)
                            wR(this, ZI, "f")[t].dispose();
                        wR(this, ZI, "f").splice(e.length)
                    }
                }
                )),
                window.addEventListener("keydown", vR(this, eR, (e => {
                    var t, n;
                    if (!wR(this, aR, "f")) {
                        if (wR(this, nR, "f").isEnabled)
                            "Escape" == e.code && (wR(this, nR, "f").isEnabled = !1);
                        else if (wR(this, kI, "f").checkKeyBinding(e, gk.VehicleCheckpointReset))
                            e.repeat || null == wR(this, WI, "f") && (null === (t = wR(this, qI, "f")) || void 0 === t ? void 0 : t.hasStarted()) && (wR(this, pI, "m", lR).call(this) ? wR(this, QI, "f").reset = !0 : (wR(this, pI, "m", dR).call(this),
                            wR(this, QI, "f").reset = !1)),
                            e.preventDefault();
                        else if (wR(this, kI, "f").checkKeyBinding(e, gk.VehicleStartReset))
                            e.repeat || null == wR(this, WI, "f") && (null === (n = wR(this, qI, "f")) || void 0 === n ? void 0 : n.hasStarted()) && wR(this, pI, "m", dR).call(this),
                            e.preventDefault();
                        else if (wR(this, kI, "f").checkKeyBinding(e, gk.VehicleCockpitCamera))
                            e.repeat || wR(this, pI, "m", cR).call(this),
                            e.preventDefault();
                        else if (c.checkKeyBinding(e, gk.ToggleUI))
                            vR(this, LI, !wR(this, LI, "f"), "f"),
                            wR(this, pI, "m", oR).call(this, wR(this, LI, "f")),
                            e.preventDefault();
                        else if (c.checkKeyBinding(e, gk.Pause)) {
                            if (null == wR(this, WI, "f")) {
                                if (null != wR(this, qI, "f") && wR(this, qI, "f").hasStarted() && !wR(this, qI, "f").hasFinished()) {
                                    const e = new Date;
                                    (null == wR(this, HI, "f") || Math.abs(e.getTime() - wR(this, HI, "f").getTime()) > 1e3) && (jP(),
                                    vR(this, WI, new iI(a), "f"),
                                    vR(this, HI, e, "f"))
                                }
                            } else
                                wR(this, WI, "f").startFadeOut(( () => {
                                    var e;
                                    GP(),
                                    null === (e = wR(this, WI, "f")) || void 0 === e || e.dispose(),
                                    vR(this, WI, null, "f")
                                }
                                ));
                            e.preventDefault()
                        } else
                            "Escape" == e.code && (null != wR(this, WI, "f") ? wR(this, WI, "f").startFadeOut(( () => {
                                var e;
                                null === (e = wR(this, WI, "f")) || void 0 === e || e.dispose(),
                                vR(this, WI, null, "f")
                            }
                            )) : b(),
                            e.preventDefault());
                        if (c.checkKeyBinding(e, gk.ToggleSpectatorCamera) && null != wR(this, qI, "f")) {
                            if (null == wR(this, WI, "f") && !wR(this, qI, "f").hasFinished()) {
                                wR(this, nR, "f").camera.position.copy(wR(this, bI, "f").camera.position);
                                const e = new si(0,0,0,"YXZ").setFromQuaternion(wR(this, bI, "f").camera.quaternion);
                                e.x = Math.round(1e4 * e.x) / 1e4,
                                e.y = Math.round(1e4 * e.y) / 1e4,
                                e.z = 0,
                                wR(this, nR, "f").camera.quaternion.setFromEuler(e),
                                wR(this, nR, "f").toggle()
                            }
                            e.preventDefault()
                        }
                    }
                }
                ), "f")),
                window.addEventListener("keyup", vR(this, tR, (e => {
                    wR(this, kI, "f").checkKeyBinding(e, gk.VehicleCockpitCamera) && wR(this, pI, "m", hR).call(this)
                }
                ), "f")),
                "official" == m)
                    if ("Summer 1" == p.name) {
                        let e = !1
                          , t = null;
                        (new Al).load("data:application/octet-stream;base64,Z2xURgIAAABABQAAtAIAAEpTT057ImFzc2V0Ijp7ImdlbmVyYXRvciI6Iktocm9ub3MgZ2xURiBCbGVuZGVyIEkvTyB2NC4zLjQ3IiwidmVyc2lvbiI6IjIuMCJ9LCJzY2VuZSI6MCwic2NlbmVzIjpbeyJuYW1lIjoiU2NlbmUiLCJub2RlcyI6WzBdfV0sIm5vZGVzIjpbeyJtZXNoIjowLCJuYW1lIjoiVGltIn1dLCJtZXNoZXMiOlt7Im5hbWUiOiJJY29zcGhlcmUiLCJwcmltaXRpdmVzIjpbeyJhdHRyaWJ1dGVzIjp7IlBPU0lUSU9OIjowfSwiaW5kaWNlcyI6MX1dfV0sImFjY2Vzc29ycyI6W3siYnVmZmVyVmlldyI6MCwiY29tcG9uZW50VHlwZSI6NTEyNiwiY291bnQiOjQwLCJtYXgiOlsxLjkyMjk4MTczOTA0NDE4OTUsMC45Nzk5NTkyNDk0OTY0NiwxLjkyMzk4MzIxNjI4NTcwNTZdLCJtaW4iOlstMS42MTkzMzUxNzQ1NjA1NDY5LC0wLjAwMjY1NzAwMzcwMDczMzE4NSwtMS45MjM5ODMyMTYyODU3MDU2XSwidHlwZSI6IlZFQzMifSx7ImJ1ZmZlclZpZXciOjEsImNvbXBvbmVudFR5cGUiOjUxMjMsImNvdW50Ijo3MiwidHlwZSI6IlNDQUxBUiJ9XSwiYnVmZmVyVmlld3MiOlt7ImJ1ZmZlciI6MCwiYnl0ZUxlbmd0aCI6NDgwLCJieXRlT2Zmc2V0IjowLCJ0YXJnZXQiOjM0OTYyfSx7ImJ1ZmZlciI6MCwiYnl0ZUxlbmd0aCI6MTQ0LCJieXRlT2Zmc2V0Ijo0ODAsInRhcmdldCI6MzQ5NjN9XSwiYnVmZmVycyI6W3siYnl0ZUxlbmd0aCI6NjI0fV19IHACAABCSU4AYEbPv2KYkj0AAACAVHJ2vwDMGrnP99++pLydPwDMGrk24B2/RCT2PwDMGrkAAACAV3+OP6V5DT8AAACAUM+Fvs+7Sz4Yv+C9RFdmvi6DTT5GfDa+MSy1vwQnJD2OQq2/RVCtv35EKz2hUrO/EL9cPcD2DT44Hmy+lw8GPigmDT7YbnW+soYBvkD287rCHfO/fZtKvSAhLrvWR/S/a+9QP9nDJT70Gmy+jsBkP4VDJj7YG2e+tHeIPwD7eDoVRfa/MSSSP4BTvDp4CfS/slywP3B5qj5wHtq9IVfXP5zeej9eSjG/sqqyP941lz5w8BC+IaXZP9Q8cT+sQjq/urH2vakt/T4AAACAVHJ2vwDMGrnP998+pLydPwDMGrk24B0/UM+Fvs+7Sz4Yv+A9RFdmvi6DTT5GfDY+MSy1vwQnJD2OQq0/RVCtv35EKz2hUrM/EL9cPcD2DT44Hmw+lw8GPigmDT7YbnU+soYBvkD287rCHfM/fZtKvSAhLrvWR/Q/a+9QP9nDJT70Gmw+jsBkP4VDJj7YG2c+tHeIPwD7eDoVRfY/MSSSP4BTvDp4CfQ/slywP3B5qj5wHto9IVfXP5zeej9eSjE/sqqyP941lz5w8BA+IaXZP9Q8cT+sQjo/AgABAAQAAwACAAQAFQABAAAABgAHAAUACgALAAkADgAPAA0AEgATABEAFQAEAAEABgAIAAcACgAMAAsADgAQAA8AEgAUABMAFwAEABYAAwAEABcAFQAAABYAGQAYABoAHQAcAB4AIQAgACIAJQAkACYAFQAWAAQAGQAaABsAHQAeAB8AIQAiACMAJQAmACcA", (n => {
                            if (n.scene.children.length > 1)
                                throw new Error("Model contains more than one object");
                            if (!(n.scene.children[0]instanceof yr))
                                throw new Error("Model is not a mesh");
                            e ? (t = n.scene.children[0],
                            t.geometry.dispose(),
                            t.material.dispose(),
                            t = null) : (t = n.scene.children[0],
                            t.geometry.computeVertexNormals(),
                            t.material = new Ws({
                                color: 4464662,
                                side: 2
                            }),
                            t.position.set(-155.65, .209, -21.87),
                            t.rotation.set(0, -2, 0),
                            t.scale.set(.05, .05, .05),
                            s.scene.add(t),
                            s.addMaterial(t.material))
                        }
                        )),
                        vR(this, iR, {
                            dispose: () => {
                                null != t && (wR(this, bI, "f").scene.remove(t),
                                t.geometry.dispose(),
                                t.material.dispose(),
                                s.removeMaterial(t.material)),
                                e = !0
                            }
                            ,
                            update: () => {
                                null != t && (t.visible = !wR(this, nR, "f").isEnabled)
                            }
                        }, "f")
                    } else if ("Summer 3" == p.name) {
                        const e = (new wo).load("data:image/png;base64, ")
                          , t = new Qi({
                            map: e
                        })
                          , n = new Bs(136 / 157 * 2,2)
                          , i = new yr(n,t);
                        i.position.set(-640, 2, -249.95),
                        i.visible = !1,
                        s.scene.add(i),
                        vR(this, iR, {
                            dispose: () => {
                                wR(this, bI, "f").scene.remove(i),
                                n.dispose(),
                                t.dispose(),
                                e.dispose()
                            }
                            ,
                            update: () => {
                                i.visible = !wR(this, nR, "f").isEnabled
                            }
                        }, "f")
                    }
            }
            dispose(e=!0) {
                var t, n, i, r, a, s;
                null === (t = wR(this, XI, "f")) || void 0 === t || t.dispose(),
                vR(this, XI, null, "f"),
                wR(this, EI, "f").setCursorHiddenWhenInactive(!1),
                wR(this, SI, "f").hide(),
                wR(this, pI, "m", oR).call(this, !1),
                wR(this, VI, "f").dispose(),
                wR(this, MI, "f").removeChangeListener(wR(this, GI, "f")),
                null === (n = wR(this, WI, "f")) || void 0 === n || n.dispose(),
                vR(this, WI, null, "f"),
                e && wR(this, gI, "f").clear(),
                wR(this, vI, "f").clearMountains(),
                wR(this, QI, "f").dispose(),
                null === (i = wR(this, qI, "f")) || void 0 === i || i.dispose();
                for (const e of wR(this, YI, "f"))
                    null === (r = e.car) || void 0 === r || r.dispose(),
                    e.car = null,
                    null != e.carId && (wR(this, mI, "f").deleteCar(e.carId),
                    e.carId = null),
                    e.replay = null;
                for (const e of wR(this, ZI, "f"))
                    e.dispose();
                wR(this, ZI, "f").length = 0,
                window.removeEventListener("keydown", wR(this, eR, "f")),
                window.removeEventListener("keyup", wR(this, tR, "f")),
                wR(this, nR, "f").dispose(),
                null === (a = wR(this, iR, "f")) || void 0 === a || a.dispose(),
                null === (s = wR(this, rR, "f")) || void 0 === s || s.dispose()
            }
            update(e) {
                var t, n, i, r, a, s, o, l, c, h, d, u;
                let p;
                if (p = null == wR(this, qI, "f") || wR(this, nR, "f").isEnabled || this.isPaused || wR(this, aR, "f") || null != wR(this, WI, "f") ? 0 : e,
                this.isPaused || null != wR(this, WI, "f") || wR(this, aR, "f")) {
                    null != wR(this, qI, "f") && (wR(this, qI, "f").isPaused = !0,
                    wR(this, qI, "f").audioVolume = 0,
                    wR(this, qI, "f").update(p),
                    wR(this, qI, "f").updateCameras(p));
                    for (const e of wR(this, YI, "f"))
                        null != e.car && (e.car.isPaused = !0,
                        e.car.audioVolume = 0,
                        e.car.update(p));
                    null === (d = wR(this, FI, "f")) || void 0 === d || d.setVisible(!wR(this, aR, "f"))
                } else {
                    if (null != wR(this, qI, "f")) {
                        if (wR(this, qI, "f").update(p),
                        wR(this, qI, "f").updateCameras(p),
                        wR(this, nR, "f").isEnabled)
                            wR(this, qI, "f").isPaused = !0,
                            wR(this, qI, "f").audioVolume = 0;
                        else {
                            wR(this, qI, "f").isPaused = !1,
                            wR(this, qI, "f").audioVolume = 1;
                            const o = wR(this, QI, "f").getControls();
                            (o.up || o.down) && (wR(this, qI, "f").hasStarted() || wR(this, qI, "f").start()),
                            wR(this, qI, "f").hasStarted() && !wR(this, qI, "f").hasFinished() ? GP() : jP(),
                            wR(this, qI, "f").hasStarted() || wR(this, JI, "f") && (wR(this, SI, "f").show(wR(this, yI, "f").get("Invalid replay detected!"), wR(this, yI, "f").get("Ok"), ( () => {
                                wR(this, SI, "f").hide()
                            }
                            )),
                            vR(this, JI, !1, "f"));
                            const l = wR(this, YI, "f").reduce(( (e, t) => e + t.loadedFrames), 0)
                              , c = wR(this, YI, "f").reduce(( (e, t) => e + t.maxFrames), 0);
                            let h;
                            h = c > 0 ? l / c : 1,
                            null === (t = wR(this, DI, "f")) || void 0 === t || t.update(wR(this, qI, "f"), e),
                            null === (n = wR(this, NI, "f")) || void 0 === n || n.update(h),
                            null === (i = wR(this, UI, "f")) || void 0 === i || i.update(wR(this, qI, "f")),
                            null === (r = wR(this, zI, "f")) || void 0 === r || r.update(wR(this, qI, "f")),
                            null === (a = wR(this, BI, "f")) || void 0 === a || a.update(wR(this, qI, "f")),
                            null === (s = wR(this, FI, "f")) || void 0 === s || s.setVisible(!wR(this, qI, "f").hasStarted() || wR(this, qI, "f").hasFinished() || !wR(this, jI, "f") || wR(this, MI, "f").touchEnabled || !wR(this, EI, "f").isCursorHidden || wR(this, FI, "f").hasFocus())
                        }
                        wR(this, qI, "f").getTime().numberOfFrames >= Lv.maxFrames && wR(this, pI, "m", dR).call(this),
                        null === (o = wR(this, rR, "f")) || void 0 === o || o.updateCar(wR(this, qI, "f"))
                    }
                    for (const e of wR(this, YI, "f"))
                        if (null != e.car) {
                            if (!e.hasEnded) {
                                const t = null === (l = wR(this, qI, "f")) || void 0 === l ? void 0 : l.getTime().numberOfFrames;
                                if (null != t) {
                                    for (let n = e.car.getTime().numberOfFrames + 1; n <= t; n++) {
                                        const t = null === (c = e.replay) || void 0 === c ? void 0 : c.replay.getFrame(n);
                                        if (null == t) {
                                            e.hasEnded = !0,
                                            e.car.setVisible(!1);
                                            break
                                        }
                                        e.car.setCarState(t)
                                    }
                                }
                                e.car.update(p)
                            }
                            e.hasEnded || wR(this, nR, "f").isEnabled ? e.car.audioVolume = 0 : e.car.audioVolume = .35
                        }
                    null != wR(this, qI, "f") && (null === (h = wR(this, XI, "f")) || void 0 === h || h.sendCarUpdate(wR(this, qI, "f").getCarState()));
                    for (const e of wR(this, ZI, "f"))
                        e.update(p);
                    wR(this, pI, "m", mR).call(this),
                    wR(this, nR, "f").update(e)
                }
                null != wR(this, qI, "f") && wR(this, VI, "f").setResetCheckpointAvailable(wR(this, pI, "m", lR).call(this)),
                null === (u = wR(this, iR, "f")) || void 0 === u || u.update(),
                wR(this, vI, "f").update(wR(this, gI, "f")),
                wR(this, wI, "f").update(p, wR(this, bI, "f").camera, wR(this, gI, "f").sunDirection),
                wR(this, AI, "f").update(e, !1, wR(this, bI, "f"), wR(this, kI, "f")),
                wR(this, bI, "f").update(wR(this, gI, "f").sunDirection)
            }
        }
        ;
        var bR, AR, xR, kR = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        }, ER = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        };
        class SR {
            constructor(e) {
                if (AR.set(this, void 0),
                null != e) {
                    if (!Number.isInteger(e))
                        throw new Error("Seed must be an integer");
                    ER(this, AR, e % kR(bR, bR, "f", xR).length, "f")
                } else
                    ER(this, AR, 0, "f")
            }
            next() {
                var e;
                return ER(this, AR, (e = kR(this, AR, "f"),
                ++e), "f"),
                kR(this, AR, "f") >= kR(bR, bR, "f", xR).length && ER(this, AR, 0, "f"),
                kR(bR, bR, "f", xR)[kR(this, AR, "f")]
            }
        }
        bR = SR,
        AR = new WeakMap,
        xR = {
            value: [.12047764760664692, .19645762332790628, .5525629082262744, .41272626379209965, .7795036003541387, .13367266027110114, .7999601557377349, .9519714253374205, .1735048382917752, .7513367084489158, .6531386724839523, .9026427867068505, .8543272738216994, .11176849958868162, .6705698284858437, .26628732081296946, .31140322993719605, .45170300835470933, .12615515120247944, .0610638094525735, .291990923385425, .4613983868623317, .6615759832726253, .4373182881232056, .7432890501246443, .39316710322388837, .49444122821563297, .5994296685114344, .060050119050233386, .4165885432422003, .43974364800990084, .1628314496954224, .05787972729968116, .225388541259955, .6075775236386991, .8908354370882479, .47072983115144584, .7662003453186828, .20651036895645647, .03724062137286044, .17110277274376795, .7626426077793496, .8372112804261309, .8761690804447455, .13887024930406633, .8287513367412203, .9794446290917873, .807658524448803, .8465629116398186, .5187285629536083, .33962953580139277, .9798419666114342, .6777071959103609, .5388899884934379, .7863389168762325, .4274591420924474, .25631366937500566, .5695289062505289, .026841382754547727, .18267938207996903, .9853642975717878, .24428485895234409, .5322028747608949, .9655065842019517, .043810183244384016, .541216190236913, .05897981610006209, .2849168541804703, .5349823008832073, .9655676144971486, .22831812764497283, .7698701658704175, .4103995069939841, .25782763124411856, .8490222628872495, .39280879489916987, .31999467883347554, .2860820872456349, .9684928577493004, .9973831481899462, .2930912094664657, .4847128131859766, .7218400909709828, .40407009594106236, .7059298060123587, .45362146566562744, .4640974655488792, .16076769483252273, .5989453525750241, .585759299589679, .9417035568973537, .20117930667657413, .5777873180244959, .1991854396549344, .8743781441651348, .624666386634513, .38720573630932886, .9967931526923675, .49817894572849486, .24585267823751833, .8639168275132305, .2865624029759799, .6163605496913385, .5864748073339972, .8781049154377354, .7497547608938613, .7864098057445887, .0334170452332867, .4875588105294657, .6737395339380896, .21851121231639659, .2923739650597854, .6073797612662293, .41823228947229896, .8531029420136382, .3260916332061783, .6306262204574675, .5268576689601923, .3516570914484707, .8659366375222706, .8447448461834428, .3794548980890986, .9832775904115916, .8442256760399809, .3006550591973338, .9718660619781394, .5103245035851833, .794319831388071]
        };
        const MR = SR;
        var _R, TR, CR, PR, IR, RR, LR, DR, NR, BR, UR = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, zR = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class OR {
            constructor(e) {
                _R.add(this),
                CR.set(this, void 0),
                PR.set(this, IA.Summer),
                IR.set(this, void 0),
                RR.set(this, void 0),
                LR.set(this, void 0),
                DR.set(this, null),
                UR(this, CR, e, "f"),
                UR(this, IR, new Ws({
                    depthWrite: !1
                }), "f"),
                e.addMaterial(zR(this, IR, "f")),
                UR(this, RR, new Ws, "f"),
                e.addMaterial(zR(this, RR, "f"));
                UR(this, LR, new yr(new Bs(6 * Qu.maxViewDistance,6 * Qu.maxViewDistance,10,10),zR(this, IR, "f")), "f"),
                zR(this, LR, "f").rotation.x = -Math.PI / 2,
                zR(this, LR, "f").renderOrder = -2,
                zR(this, LR, "f").receiveShadow = !0,
                e.scene.add(zR(this, LR, "f")),
                zR(this, _R, "m", BR).call(this, IA.Summer)
            }
            clearMountains() {
                null != zR(this, DR, "f") && (zR(this, DR, "f").material.dispose(),
                zR(this, DR, "f").geometry.dispose(),
                zR(this, CR, "f").scene.remove(zR(this, DR, "f")),
                UR(this, DR, null, "f"))
            }
            generateMountains(e) {
                this.clearMountains();
                const {vertices: t, offset: n} = TR.createMountainVertices(e)
                  , i = new or;
                i.setAttribute("position", new Xi(new Float32Array(t),3)),
                i.computeVertexNormals();
                const r = new yr(i,zR(this, RR, "f"));
                r.position.copy(n),
                r.receiveShadow = !0,
                zR(this, CR, "f").scene.add(r),
                UR(this, DR, r, "f")
            }
            static createMountainVertices(e) {
                const t = new MR
                  , n = Math.max(200, 160 + Math.max(Math.abs(e.max.x - e.min.x) * Px.partSize / 2 * Math.SQRT2, Math.abs(e.max.y - e.min.y) * Px.partSize / 2 * Math.SQRT2))
                  , i = new Qt((e.min.x + (e.max.x - e.min.x) / 2) * Px.partSize,(e.min.y + (e.max.y - e.min.y) / 2) * Px.partSize);
                if (n > 4500)
                    return {
                        vertices: [],
                        offset: new bn
                    };
                const r = Math.floor(n / 10)
                  , a = [];
                for (let e = 0; e < r; ++e) {
                    const e = [];
                    for (let n = 0; n < 8; ++n)
                        0 == n || 7 == n || 1 == n && t.next() < .5 ? e.push(0) : e.push(t.next());
                    a.push(e)
                }
                const s = 100
                  , o = [];
                for (let e = 0; e < a.length; ++e) {
                    const t = e / a.length * Math.PI * 2
                      , i = (e + 1) / a.length * Math.PI * 2
                      , r = a[e];
                    let l;
                    l = e + 1 < a.length ? a[e + 1] : a[0];
                    for (let e = 0; e < r.length - 1; ++e) {
                        const a = n + 100 * e
                          , c = n + 100 * (e + 1);
                        o.push(Math.cos(t) * a, r[e] * s, Math.sin(t) * a),
                        o.push(Math.cos(i) * a, l[e] * s, Math.sin(i) * a),
                        o.push(Math.cos(i) * c, l[e + 1] * s, Math.sin(i) * c),
                        o.push(Math.cos(t) * a, r[e] * s, Math.sin(t) * a),
                        o.push(Math.cos(i) * c, l[e + 1] * s, Math.sin(i) * c),
                        o.push(Math.cos(t) * c, r[e + 1] * s, Math.sin(t) * c)
                    }
                }
                return {
                    vertices: o,
                    offset: new bn(i.x,0,i.y)
                }
            }
            getMountainVertices() {
                if (null == zR(this, DR, "f"))
                    return [];
                const e = zR(this, DR, "f").geometry;
                if (!(e.attributes.position instanceof Xi))
                    throw new Error("Vertices must use BufferAttribute");
                return Array.from(e.attributes.position.array)
            }
            getMountainOffset() {
                return null == zR(this, DR, "f") ? new bn : zR(this, DR, "f").position.clone()
            }
            update(e) {
                e.environment != zR(this, PR, "f") && zR(this, _R, "m", BR).call(this, e.environment);
                const t = new bn
                  , n = new yn
                  , i = new bn;
                zR(this, CR, "f").camera.matrix.decompose(t, n, i),
                zR(this, LR, "f").position.set(t.x, 0, t.z)
            }
        }
        TR = OR,
        CR = new WeakMap,
        PR = new WeakMap,
        IR = new WeakMap,
        RR = new WeakMap,
        LR = new WeakMap,
        DR = new WeakMap,
        _R = new WeakSet,
        NR = function(e) {
            let t;
            switch (e) {
            case IA.Summer:
                t = new Hi(3495480);
                break;
            case IA.Winter:
                t = new Hi(11053224);
                break;
            case IA.Desert:
                t = new Hi(11171394)
            }
            return t
        }
        ,
        BR = function(e) {
            UR(this, PR, e, "f");
            const t = zR(TR, TR, "m", NR).call(TR, e);
            zR(this, IR, "f").color.copy(t),
            zR(this, RR, "f").color.copy(t)
        }
        ;
        const FR = OR;
        var WR = i(2915)
          , HR = {};
        HR.styleTagTransform = u(),
        HR.setAttributes = l(),
        HR.insert = s().bind(null, "head"),
        HR.domAPI = r(),
        HR.insertStyleElement = h();
        t()(WR.A, HR);
        WR.A && WR.A.locals && WR.A.locals;
        var VR = i(2927)
          , GR = {};
        GR.styleTagTransform = u(),
        GR.setAttributes = l(),
        GR.insert = s().bind(null, "head"),
        GR.domAPI = r(),
        GR.insertStyleElement = h();
        t()(VR.A, GR);
        VR.A && VR.A.locals && VR.A.locals;
        var jR, QR, KR = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, qR = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        jR = new WeakMap,
        QR = new WeakMap;
        const YR = class {
            constructor(e, t, n) {
                jR.set(this, void 0),
                QR.set(this, void 0),
                KR(this, jR, e, "f"),
                KR(this, QR, document.createElement("div"), "f"),
                qR(this, QR, "f").className = "loading-ui",
                e.appendChild(qR(this, QR, "f"));
                const i = document.createElement("p");
                i.textContent = t.get("Loading") + "...",
                qR(this, QR, "f").appendChild(i);
                const r = document.createElement("div");
                qR(this, QR, "f").appendChild(r);
                const a = document.createElement("div");
                r.appendChild(a);
                const s = document.createElement("div");
                a.appendChild(s),
                n.addProgressListener((e => {
                    s.style.width = (100 * e).toString() + "%"
                }
                ))
            }
            fadeOut(e) {
                qR(this, QR, "f").classList.add("fade-out"),
                setTimeout(e, 250)
            }
            dispose() {
                qR(this, jR, "f").removeChild(qR(this, QR, "f"))
            }
        }
        ;
        var XR = i(1643)
          , ZR = {};
        ZR.styleTagTransform = u(),
        ZR.setAttributes = l(),
        ZR.insert = s().bind(null, "head"),
        ZR.domAPI = r(),
        ZR.insertStyleElement = h();
        t()(XR.A, ZR);
        XR.A && XR.A.locals && XR.A.locals;
        var JR, $R, eL, tL, nL, iL, rL, aL, sL, oL, lL, cL, hL, dL, uL, pL, fL, mL, gL, vL, wL, yL, bL = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, AL = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        $R = new WeakMap,
        eL = new WeakMap,
        tL = new WeakMap,
        nL = new WeakMap,
        iL = new WeakMap,
        rL = new WeakMap,
        aL = new WeakMap,
        sL = new WeakMap,
        oL = new WeakMap,
        lL = new WeakMap,
        cL = new WeakMap,
        hL = new WeakMap,
        dL = new WeakMap,
        JR = new WeakSet,
        uL = function() {
            AL(this, sL, "f").className = "hidden"
        }
        ,
        pL = function() {
            AL(this, sL, "f").className = "settings-menu"
        }
        ,
        fL = function() {
            AL(this, oL, "f").innerHTML = "",
            AL(this, JR, "m", mL).call(this, AL(this, eL, "f").get("Language")),
            AL(this, JR, "m", vL).call(this, null, [{
                title: "العربية",
                value: "ar"
            }, {
                title: "Deutsch",
                value: "de-DE"
            }, {
                title: "English",
                value: "en-US"
            }, {
                title: "Español",
                value: "es-ES"
            }, {
                title: "Français",
                value: "fr-FR"
            }, {
                title: "Italiano",
                value: "it-IT"
            }, {
                title: "日本語",
                value: "ja-JP"
            }, {
                title: "한국어",
                value: "ko-KR"
            }, {
                title: "Polski",
                value: "pl-PL"
            }, {
                title: "Português (BR)",
                value: "pt-BR"
            }, {
                title: "Português (PT)",
                value: "pt-PT"
            }, {
                title: "Русский",
                value: "ru-RU"
            }, {
                title: "Türkçe",
                value: "tr-TR"
            }, {
                title: "Українська",
                value: "uk-UA"
            }, {
                title: "简体中文",
                value: "zh-CN"
            }, {
                title: "繁體中文",
                value: "zh-TW"
            }], el.Language),
            AL(this, JR, "m", mL).call(this, AL(this, eL, "f").get("Gameplay")),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Units"), [{
                title: AL(this, eL, "f").get("Metric"),
                value: "false"
            }, {
                title: AL(this, eL, "f").get("Imperial"),
                value: "true"
            }], el.ImperialUnitsEnabled),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Reset hint"), [{
                title: AL(this, eL, "f").get("Disabled"),
                value: "false"
            }, {
                title: AL(this, eL, "f").get("Enabled"),
                value: "true"
            }], el.ResetHintEnabled),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Ghost car"), [{
                title: AL(this, eL, "f").get("Disabled"),
                value: "false"
            }, {
                title: AL(this, eL, "f").get("Enabled"),
                value: "true"
            }], el.GhostCarEnabled),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Default camera"), [{
                title: AL(this, eL, "f").get("Default"),
                value: "false"
            }, {
                title: AL(this, eL, "f").get("Cockpit"),
                value: "true"
            }], el.DefaultCameraMode),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Cockpit camera mode"), [{
                title: AL(this, eL, "f").get("Hold"),
                value: "false"
            }, {
                title: AL(this, eL, "f").get("Toggle"),
                value: "true"
            }], el.CockpitCameraToggle),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Checkpoints"), [{
                title: AL(this, eL, "f").get("Off"),
                value: "off"
            }, {
                title: AL(this, eL, "f").get("Bottom"),
                value: "bottom"
            }, {
                title: AL(this, eL, "f").get("Top"),
                value: "top"
            }], el.Checkpoints),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Timer"), [{
                title: AL(this, eL, "f").get("Off"),
                value: "off"
            }, {
                title: AL(this, eL, "f").get("Bottom"),
                value: "bottom"
            }, {
                title: AL(this, eL, "f").get("Top"),
                value: "top"
            }], el.Timer),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Speedometer"), [{
                title: AL(this, eL, "f").get("Off"),
                value: "off"
            }, {
                title: AL(this, eL, "f").get("Bottom"),
                value: "bottom"
            }, {
                title: AL(this, eL, "f").get("Top"),
                value: "top"
            }], el.Speedometer),
            AL(this, JR, "m", gL).call(this, AL(this, eL, "f").get("Mobile")),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Vibration"), [{
                title: AL(this, eL, "f").get("Off"),
                value: "false"
            }, {
                title: AL(this, eL, "f").get("On"),
                value: "true"
            }], el.VibrationEnabled),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Steering control side"), [{
                title: AL(this, eL, "f").get("Left"),
                value: "false"
            }, {
                title: AL(this, eL, "f").get("Right"),
                value: "true"
            }], el.TouchSteeringSide),
            AL(this, JR, "m", mL).call(this, AL(this, eL, "f").get("Graphics")),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Shadows"), [{
                title: AL(this, eL, "f").get("Off"),
                value: "0",
                available: AL(this, nL, "f").isShadowQualitySupported(0)
            }, {
                title: AL(this, eL, "f").get("Minimal"),
                value: "1",
                available: AL(this, nL, "f").isShadowQualitySupported(1)
            }, {
                title: AL(this, eL, "f").get("Low"),
                value: "2",
                available: AL(this, nL, "f").isShadowQualitySupported(2)
            }, {
                title: AL(this, eL, "f").get("Medium"),
                value: "3",
                available: AL(this, nL, "f").isShadowQualitySupported(3)
            }, {
                title: AL(this, eL, "f").get("High"),
                value: "4",
                available: AL(this, nL, "f").isShadowQualitySupported(4)
            }, {
                title: AL(this, eL, "f").get("Ultra"),
                value: "5",
                available: AL(this, nL, "f").isShadowQualitySupported(5)
            }], el.ShadowQuality, ( () => {
                AL(this, rL, "f").generateMeshes()
            }
            )),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Clouds"), [{
                title: AL(this, eL, "f").get("Off"),
                value: "false"
            }, {
                title: AL(this, eL, "f").get("On"),
                value: "true"
            }], el.CloudsEnabled),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Particles"), [{
                title: AL(this, eL, "f").get("Off"),
                value: "false"
            }, {
                title: AL(this, eL, "f").get("On"),
                value: "true"
            }], el.ParticlesEnabled),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Skidmarks"), [{
                title: AL(this, eL, "f").get("Off"),
                value: "false"
            }, {
                title: AL(this, eL, "f").get("On"),
                value: "true"
            }], el.SkidmarksEnabled),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Render scale"), [{
                title: "25%",
                value: "0.25"
            }, {
                title: "50%",
                value: "0.5"
            }, {
                title: "100%",
                value: "1"
            }, {
                title: "150%",
                value: "1.5"
            }, {
                title: "200%",
                value: "2"
            }], el.RenderScale),
            AL(this, JR, "m", vL).call(this, AL(this, eL, "f").get("Anti-aliasing (requires restart)"), [{
                title: AL(this, eL, "f").get("Off"),
                value: "false"
            }, {
                title: AL(this, eL, "f").get("On"),
                value: "true"
            }], el.Antialiasing),
            AL(this, JR, "m", mL).call(this, AL(this, eL, "f").get("Audio")),
            AL(this, JR, "m", wL).call(this, AL(this, eL, "f").get("Sound effect volume"), el.SoundEffectVolume),
            AL(this, JR, "m", wL).call(this, AL(this, eL, "f").get("Music volume"), el.MusicVolume),
            AL(this, JR, "m", wL).call(this, AL(this, eL, "f").get("Checkpoint volume"), el.CheckpointVolume),
            AL(this, JR, "m", mL).call(this, AL(this, eL, "f").get("Controls")),
            AL(this, JR, "m", gL).call(this, AL(this, eL, "f").get("Vehicle")),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Accelerate"), gk.VehicleAccelerate),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Brake"), gk.VehicleBrake),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Turn left"), gk.VehicleTurnLeft),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Turn right"), gk.VehicleTurnRight),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Checkpoint reset"), gk.VehicleCheckpointReset),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Start reset"), gk.VehicleStartReset),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Cockpit camera"), gk.VehicleCockpitCamera),
            AL(this, JR, "m", gL).call(this, AL(this, eL, "f").get("Editor")),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Rotate part"), gk.EditorRotatePart),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Height modifier"), gk.EditorHeightModifier),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Delete part"), gk.EditorDelete),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Move forwards"), gk.EditorMoveForwards),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Move backwards"), gk.EditorMoveBackwards),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Move left"), gk.EditorMoveLeft),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Move right"), gk.EditorMoveRight),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Rotate view up"), gk.EditorRotateViewUp),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Rotate view down"), gk.EditorRotateViewDown),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Rotate view left"), gk.EditorRotateViewLeft),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Rotate view right"), gk.EditorRotateViewRight),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Move down"), gk.EditorMoveDown),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Move up"), gk.EditorMoveUp),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Test track"), gk.EditorTest),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Pick part"), gk.EditorPick),
            AL(this, JR, "m", gL).call(this, AL(this, eL, "f").get("Spectator")),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Move forwards"), gk.SpectatorMoveForwards),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Move backwards"), gk.SpectatorMoveBackwards),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Move left"), gk.SpectatorMoveLeft),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Move right"), gk.SpectatorMoveRight),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Speed modifier"), gk.SpectatorSpeedModifier),
            AL(this, JR, "m", gL).call(this, AL(this, eL, "f").get("Other")),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Hide UI"), gk.ToggleUI),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Pause"), gk.Pause),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Toggle FPS counter"), gk.ToggleFpsCounter),
            AL(this, JR, "m", yL).call(this, AL(this, eL, "f").get("Toggle spectator camera"), gk.ToggleSpectatorCamera)
        }
        ,
        mL = function(e) {
            const t = document.createElement("h2");
            t.textContent = e,
            AL(this, oL, "f").appendChild(t)
        }
        ,
        gL = function(e) {
            const t = document.createElement("h3");
            t.textContent = e,
            AL(this, oL, "f").appendChild(t)
        }
        ,
        vL = function(e, t, n, i) {
            var r;
            const a = null !== (r = AL(this, hL, "f").get(n)) && void 0 !== r ? r : AL(this, iL, "f").getSetting(n)
              , s = document.createElement("div");
            if (s.className = "setting",
            null != e) {
                const t = document.createElement("p");
                t.textContent = e,
                s.appendChild(t)
            } else
                s.classList.add("wrappable");
            const o = document.createElement("div");
            o.className = "button-wrapper",
            s.appendChild(o);
            const l = [];
            for (const {title: e, value: r, available: s} of t) {
                const t = document.createElement("button");
                t.className = r == a ? "button selected" : "button",
                t.disabled = !1 === s,
                t.textContent = e,
                t.addEventListener("click", ( () => {
                    AL(this, tL, "f").playUIClick();
                    for (const e of l)
                        e.className = "button";
                    t.className = "button selected",
                    AL(this, hL, "f").set(n, r),
                    AL(this, iL, "f").updateSettings(Array.from(AL(this, hL, "f"))),
                    null != i && i()
                }
                )),
                o.appendChild(t),
                l.push(t)
            }
            AL(this, oL, "f").appendChild(s)
        }
        ,
        wL = function(e, t, n=0, i=1) {
            var r;
            let a = parseFloat(null !== (r = AL(this, hL, "f").get(t)) && void 0 !== r ? r : AL(this, iL, "f").getSetting(t));
            Number.isNaN(a) && (a = 0);
            const s = document.createElement("div");
            s.className = "setting";
            const o = document.createElement("p");
            o.textContent = e,
            s.appendChild(o);
            const l = document.createElement("input");
            l.type = "range",
            l.min = (20 * n).toString(),
            l.max = (20 * i).toString(),
            l.value = (20 * a).toString(),
            l.addEventListener("input", ( () => {
                const e = parseFloat(l.value) / 20;
                AL(this, hL, "f").set(t, e.toString()),
                AL(this, iL, "f").updateSettings(Array.from(AL(this, hL, "f")))
            }
            )),
            s.appendChild(l),
            AL(this, oL, "f").appendChild(s)
        }
        ,
        yL = function(e, t) {
            var n, i, r;
            const a = document.createElement("div");
            a.className = "setting key-binding";
            const s = document.createElement("p");
            s.textContent = e,
            a.appendChild(s);
            const o = document.createElement("div");
            o.className = "button-wrapper",
            a.appendChild(o);
            const l = null !== (n = AL(this, dL, "f").get(t)) && void 0 !== n ? n : AL(this, iL, "f").getKeyBindings(t)
              , c = document.createElement("button");
            c.className = "button",
            c.textContent = K_(null !== (i = l[0]) && void 0 !== i ? i : ""),
            c.addEventListener("click", ( () => {
                AL(this, tL, "f").playUIClick(),
                AL(this, JR, "m", uL).call(this);
                const e = t => {
                    "Escape" == t.code || "Tab" == t.code || "Enter" == t.code && null != document.activeElement && document.activeElement != document.body || (AL(this, aL, "f").hide(),
                    l[0] = t.code,
                    c.textContent = K_(t.code),
                    AL(this, JR, "m", pL).call(this),
                    window.removeEventListener("keydown", e),
                    t.preventDefault())
                }
                ;
                window.addEventListener("keydown", e),
                AL(this, aL, "f").showConfirm(AL(this, eL, "f").get("Press any key...\n\nPress [Escape] to cancel."), AL(this, eL, "f").get("Cancel"), AL(this, eL, "f").get("Clear"), ( () => {
                    AL(this, JR, "m", pL).call(this),
                    window.removeEventListener("keydown", e)
                }
                ), ( () => {
                    c.textContent = "",
                    l[0] = null,
                    window.removeEventListener("keydown", e),
                    AL(this, JR, "m", pL).call(this)
                }
                ))
            }
            )),
            o.appendChild(c);
            const h = document.createElement("button");
            h.className = "button",
            h.textContent = K_(null !== (r = l[1]) && void 0 !== r ? r : ""),
            h.addEventListener("click", ( () => {
                AL(this, tL, "f").playUIClick(),
                AL(this, JR, "m", uL).call(this);
                const e = t => {
                    "Escape" == t.code || "Tab" == t.code || "Enter" == t.code && null != document.activeElement && document.activeElement != document.body || (AL(this, aL, "f").hide(),
                    l[1] = t.code,
                    h.textContent = K_(t.code),
                    AL(this, JR, "m", pL).call(this),
                    window.removeEventListener("keydown", e),
                    t.preventDefault())
                }
                ;
                window.addEventListener("keydown", e),
                AL(this, aL, "f").showConfirm(AL(this, eL, "f").get("Press any key...\n\nPress [Escape] to cancel."), AL(this, eL, "f").get("Cancel"), AL(this, eL, "f").get("Clear"), ( () => {
                    AL(this, JR, "m", pL).call(this),
                    window.removeEventListener("keydown", e)
                }
                ), ( () => {
                    h.textContent = "",
                    l[1] = null,
                    window.removeEventListener("keydown", e),
                    AL(this, JR, "m", pL).call(this)
                }
                ))
            }
            )),
            o.appendChild(h),
            AL(this, oL, "f").appendChild(a)
        }
        ;
        const xL = class {
            constructor(e, t, n, i, r, a, s, o) {
                JR.add(this),
                $R.set(this, void 0),
                eL.set(this, void 0),
                tL.set(this, void 0),
                nL.set(this, void 0),
                iL.set(this, void 0),
                rL.set(this, void 0),
                aL.set(this, void 0),
                sL.set(this, void 0),
                oL.set(this, void 0),
                lL.set(this, void 0),
                cL.set(this, new Map),
                hL.set(this, new Map),
                dL.set(this, new Map),
                bL(this, $R, e, "f"),
                bL(this, eL, t, "f"),
                bL(this, tL, n, "f"),
                bL(this, nL, i, "f"),
                bL(this, iL, r, "f"),
                bL(this, rL, a, "f"),
                bL(this, aL, s, "f"),
                bL(this, sL, document.createElement("div"), "f"),
                AL(this, sL, "f").className = "settings-menu",
                e.appendChild(AL(this, sL, "f"));
                const l = document.createElement("h2");
                l.textContent = t.get("Settings"),
                AL(this, sL, "f").appendChild(l),
                bL(this, oL, document.createElement("div"), "f"),
                AL(this, oL, "f").className = "container",
                AL(this, sL, "f").appendChild(AL(this, oL, "f")),
                bL(this, cL, new Map(r.getSettings()), "f"),
                AL(this, JR, "m", fL).call(this);
                const c = document.createElement("div");
                c.className = "button-wrapper",
                AL(this, sL, "f").appendChild(c);
                const h = document.createElement("button");
                h.className = "button cancel",
                h.innerHTML = '<img class="button-icon" src="images/cancel.svg"> ',
                h.append(document.createTextNode(t.get("Cancel"))),
                h.addEventListener("click", ( () => {
                    n.playUIClick(),
                    r.updateSettings(Array.from(AL(this, cL, "f"))),
                    a.generateMeshes(),
                    o()
                }
                )),
                c.appendChild(h);
                const d = document.createElement("button");
                d.className = "button reset",
                d.innerHTML = '<img class="button-icon" src="images/reset_settings.svg"> ',
                d.append(document.createTextNode(t.get("Reset"))),
                d.addEventListener("click", ( () => {
                    n.playUIClick(),
                    bL(this, hL, AL(this, iL, "f").defaultSettings(), "f"),
                    r.updateSettings(Array.from(AL(this, hL, "f"))),
                    bL(this, dL, AL(this, iL, "f").defaultKeyBindings(), "f"),
                    a.generateMeshes(),
                    AL(this, JR, "m", fL).call(this)
                }
                )),
                c.appendChild(d);
                const u = document.createElement("button");
                u.className = "button apply",
                u.append(document.createTextNode(t.get("Apply"))),
                u.innerHTML += ' <img class="button-icon" src="images/apply.svg">',
                u.addEventListener("click", ( () => {
                    n.playUIClick(),
                    r.updateSettings(Array.from(AL(this, hL, "f"))),
                    r.saveSettings(),
                    r.setKeyBindings(Array.from(AL(this, dL, "f"))),
                    a.generateMeshes(),
                    t.language = r.getSetting(el.Language),
                    o()
                }
                )),
                c.appendChild(u),
                window.addEventListener("keydown", bL(this, lL, (e => {
                    "Escape" == e.code && (o(),
                    e.preventDefault())
                }
                ), "f"))
            }
            dispose() {
                AL(this, $R, "f").removeChild(AL(this, sL, "f")),
                window.removeEventListener("keydown", AL(this, lL, "f"))
            }
        }
        ;
        var kL = i(5586)
          , EL = {};
        EL.styleTagTransform = u(),
        EL.setAttributes = l(),
        EL.insert = s().bind(null, "head"),
        EL.domAPI = r(),
        EL.insertStyleElement = h();
        t()(kL.A, EL);
        kL.A && kL.A.locals && kL.A.locals;
        var SL, ML, _L, TL, CL, PL, IL, RL, LL, DL, NL, BL, UL, zL, OL, FL, WL, HL, VL = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, GL = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        ML = new WeakMap,
        _L = new WeakMap,
        TL = new WeakMap,
        CL = new WeakMap,
        PL = new WeakMap,
        IL = new WeakMap,
        RL = new WeakMap,
        LL = new WeakMap,
        DL = new WeakMap,
        NL = new WeakMap,
        BL = new WeakMap,
        UL = new WeakMap,
        zL = new WeakMap,
        OL = new WeakMap,
        FL = new WeakMap,
        SL = new WeakSet,
        WL = function(e, t) {
            GL(this, DL, "f").innerHTML = "";
            const n = document.createElement("div");
            n.innerHTML = '<img src="images/timer.svg">';
            const i = document.createElement("span");
            null == e && (i.className = "faded"),
            i.textContent = $k.formatTimeString(e),
            n.appendChild(i),
            GL(this, DL, "f").appendChild(n);
            const r = document.createElement("div");
            if (r.innerHTML = '<img src="images/trophy.svg">',
            null != t) {
                r.appendChild(document.createTextNode(t.position.toString() + MC.getPositionSuffix(t.position)));
                const e = t.position / t.total * 100;
                let n;
                n = e < 1e-4 ? "0.0001" : e < 10 ? e.toFixed(4) : e < 100 ? e.toFixed(3) : e.toFixed(2);
                const i = document.createElement("span");
                i.className = "faded",
                i.textContent = " (" + n + "%)",
                r.appendChild(i)
            } else {
                const e = document.createElement("span");
                e.className = "faded",
                e.textContent = "---",
                r.appendChild(e)
            }
            GL(this, DL, "f").appendChild(r)
        }
        ,
        HL = function() {
            GL(this, FL, "f").length > 0 ? (GL(this, NL, "f").classList.remove("no-opponents"),
            1 == GL(this, FL, "f").length ? GL(this, NL, "f").textContent = GL(this, ML, "f").get("{0} opponent selected", [GL(this, FL, "f").length.toString()]) : GL(this, NL, "f").textContent = GL(this, ML, "f").get("{0} opponents selected", [GL(this, FL, "f").length.toString()])) : (GL(this, NL, "f").classList.add("no-opponents"),
            GL(this, NL, "f").textContent = GL(this, ML, "f").get("Select opponents to race against from the leaderboard on the left")),
            GL(this, BL, "f").disabled = 0 == GL(this, FL, "f").length && null == GL(this, TL, "f").getRecord(GL(this, CL, "f").profileSlot, GL(this, PL, "f"))
        }
        ;
        const jL = class {
            constructor(e, t, n, i, r, a, s, o, l, c, h, d, u, p, f, m, g) {
                var v, w;
                SL.add(this),
                ML.set(this, void 0),
                _L.set(this, void 0),
                TL.set(this, void 0),
                CL.set(this, void 0),
                PL.set(this, void 0),
                IL.set(this, void 0),
                RL.set(this, void 0),
                LL.set(this, void 0),
                DL.set(this, void 0),
                NL.set(this, void 0),
                BL.set(this, void 0),
                UL.set(this, void 0),
                zL.set(this, void 0),
                OL.set(this, null),
                FL.set(this, []),
                VL(this, ML, t, "f"),
                VL(this, _L, n, "f"),
                VL(this, TL, r, "f"),
                VL(this, CL, i, "f"),
                VL(this, PL, c, "f"),
                VL(this, IL, e, "f"),
                VL(this, RL, document.createElement("div"), "f"),
                GL(this, RL, "f").className = "track-info",
                e.appendChild(GL(this, RL, "f"));
                const y = r.getRecord(i.profileSlot, c);
                VL(this, UL, new MC(GL(this, RL, "f"),c,t,n,a,i,r,d,u,(e => {
                    VL(this, FL, e, "f"),
                    GL(this, SL, "m", HL).call(this)
                }
                ),( (e, t) => {
                    var n;
                    null == e || null != y && !e.time.lessOrEqual(y.time) ? GL(this, SL, "m", WL).call(this, null !== (n = null == y ? void 0 : y.time) && void 0 !== n ? n : null, null) : GL(this, SL, "m", WL).call(this, e.time, {
                        position: e.position,
                        total: t
                    })
                }
                )), "f"),
                VL(this, LL, document.createElement("div"), "f"),
                GL(this, LL, "f").className = "side-panel",
                GL(this, RL, "f").appendChild(GL(this, LL, "f"));
                const b = document.createElement("h2");
                b.textContent = o.name,
                GL(this, LL, "f").appendChild(b);
                const A = document.createElement("canvas");
                A.width = h.width,
                A.height = h.height;
                const x = A.getContext("2d");
                null == x ? console.error("Failed to get 2D context for thumbnail canvas") : x.drawImage(h, 0, 0);
                const k = document.createElement("div");
                k.className = "thumbnail",
                k.appendChild(A),
                GL(this, LL, "f").appendChild(k);
                const E = document.createElement("button");
                let S;
                switch (E.className = "button share",
                E.innerHTML = '<img src="images/share.svg">',
                E.addEventListener("click", ( () => {
                    a.playUIClick(),
                    GL(this, RL, "f").className = "hidden";
                    const e = l.toExportString(o);
                    VL(this, OL, new Tk(e,( () => {
                        var e;
                        null === (e = GL(this, OL, "f")) || void 0 === e || e.dispose(),
                        VL(this, OL, null, "f"),
                        GL(this, RL, "f").className = "track-info"
                    }
                    ),null,!1,t,a,d,s), "f")
                }
                )),
                k.appendChild(E),
                l.environment) {
                case IA.Summer:
                    S = "images/summer.svg";
                    break;
                case IA.Winter:
                    S = "images/winter.svg";
                    break;
                case IA.Desert:
                    S = "images/desert.svg"
                }
                const M = document.createElement("img");
                M.className = "environment",
                M.src = S,
                k.appendChild(M);
                const _ = document.createElement("div");
                _.className = "track-author",
                _.textContent = t.get("Author") + ": " + (null !== (v = o.author) && void 0 !== v ? v : t.get("Unknown")),
                GL(this, LL, "f").appendChild(_);
                const T = document.createElement("div");
                T.className = "divider",
                GL(this, LL, "f").appendChild(T);
                const C = document.createElement("div");
                C.className = "personal-best-title",
                C.textContent = t.get("Personal best"),
                GL(this, LL, "f").appendChild(C),
                VL(this, DL, document.createElement("div"), "f"),
                GL(this, DL, "f").className = "personal-best",
                GL(this, LL, "f").appendChild(GL(this, DL, "f")),
                GL(this, SL, "m", WL).call(this, null !== (w = null == y ? void 0 : y.time.clone()) && void 0 !== w ? w : null, null);
                const P = document.createElement("div");
                P.className = "divider",
                GL(this, LL, "f").appendChild(P);
                const I = document.createElement("div");
                I.className = "opponents-title",
                I.textContent = t.get("Opponents"),
                GL(this, LL, "f").appendChild(I),
                VL(this, NL, document.createElement("div"), "f"),
                GL(this, NL, "f").className = "opponents-container",
                GL(this, LL, "f").appendChild(GL(this, NL, "f")),
                VL(this, BL, document.createElement("button"), "f"),
                GL(this, BL, "f").className = "button watch",
                GL(this, BL, "f").innerHTML = '<img src="images/preview.svg">',
                GL(this, BL, "f").disabled = !0,
                GL(this, BL, "f").prepend(document.createTextNode(t.get("Watch"))),
                GL(this, BL, "f").addEventListener("click", ( () => {
                    if (a.playUIClick(),
                    l.hasStartingPoint()) {
                        const e = GL(this, FL, "f");
                        if (e.length > 0)
                            m(GL(this, _L, "f").getRecordings(e.map((e => e.recordingId))).then((t => {
                                if (t.some((e => null == e)))
                                    throw new Error("Failed to load at least one recording.");
                                return t.filter((e => null != e)).map(( (t, n) => ({
                                    recording: t.recording,
                                    carColors: t.carColors,
                                    name: e[n].name,
                                    time: t.time,
                                    isSelf: e[n].isSelf
                                })))
                            }
                            )));
                        else {
                            const e = r.getRecord(i.profileSlot, c);
                            if (null != e) {
                                const t = i.getCurrentUserProfile();
                                g([{
                                    recording: e.recording,
                                    carColors: t.carColors,
                                    name: t.nickname,
                                    time: e.time,
                                    isSelf: !0
                                }])
                            }
                        }
                    } else
                        GL(this, RL, "f").classList.add("hidden"),
                        s.show(t.get("Track is missing starting point"), t.get("Ok"), ( () => {
                            GL(this, RL, "f").classList.remove("hidden")
                        }
                        ))
                }
                )),
                GL(this, LL, "f").appendChild(GL(this, BL, "f")),
                GL(this, SL, "m", HL).call(this);
                const R = document.createElement("button");
                R.className = "button play",
                R.innerHTML = '<img src="images/play.svg">',
                R.prepend(document.createTextNode(t.get("Play"))),
                R.addEventListener("click", ( () => {
                    if (a.playUIClick(),
                    l.hasStartingPoint()) {
                        const e = GL(this, FL, "f");
                        if (e.length > 0)
                            p(GL(this, _L, "f").getRecordings(e.map((e => e.recordingId))).then((t => {
                                if (t.some((e => null == e)))
                                    throw new Error("Failed to load at least one recording.");
                                return t.filter((e => null != e)).map(( (t, n) => ({
                                    recording: t.recording,
                                    carColors: t.carColors,
                                    name: e[n].name,
                                    time: t.time,
                                    isSelf: e[n].isSelf
                                })))
                            }
                            )));
                        else {
                            const e = r.getRecord(i.profileSlot, c);
                            if (null != e) {
                                const t = i.getCurrentUserProfile();
                                f([{
                                    recording: e.recording,
                                    carColors: t.carColors,
                                    name: t.nickname,
                                    time: e.time,
                                    isSelf: !0
                                }])
                            } else
                                f([])
                        }
                    } else
                        GL(this, RL, "f").classList.add("hidden"),
                        s.show(t.get("Track is missing starting point"), t.get("Ok"), ( () => {
                            GL(this, RL, "f").classList.remove("hidden")
                        }
                        ))
                }
                )),
                GL(this, LL, "f").appendChild(R),
                window.addEventListener("keydown", VL(this, zL, (e => {
                    "Escape" == e.code && (u(),
                    e.preventDefault())
                }
                ), "f"))
            }
            dispose() {
                GL(this, UL, "f").dispose(),
                GL(this, IL, "f").removeChild(GL(this, RL, "f")),
                window.removeEventListener("keydown", GL(this, zL, "f"))
            }
        }
        ;
        var QL = i(5140)
          , KL = {};
        KL.styleTagTransform = u(),
        KL.setAttributes = l(),
        KL.insert = s().bind(null, "head"),
        KL.domAPI = r(),
        KL.insertStyleElement = h();
        t()(QL.A, KL);
        QL.A && QL.A.locals && QL.A.locals;
        var qL, YL, XL, ZL, JL, $L, eD, tD, nD, iD, rD = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, aD = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        YL = new WeakMap,
        XL = new WeakMap,
        ZL = new WeakMap,
        JL = new WeakMap,
        $L = new WeakMap,
        eD = new WeakMap,
        tD = new WeakMap,
        nD = new WeakMap,
        qL = new WeakSet,
        iD = function(e, t) {
            const n = aD(this, JL, "f").getUserProfile(e)
              , i = document.createElement("div");
            i.className = "slot";
            const r = document.createElement("button");
            if (r.className = "button main",
            e == aD(this, JL, "f").profileSlot && r.classList.add("selected"),
            r.addEventListener("click", ( () => {
                aD(this, ZL, "f").playUIClick();
                for (const e of aD(this, eD, "f"))
                    e.classList.remove("selected");
                r.classList.add("selected"),
                t(e)
            }
            )),
            i.appendChild(r),
            aD(this, eD, "f").push(r),
            null != n) {
                const e = document.createElement("div");
                e.className = "image-container",
                r.appendChild(e);
                const t = document.createElement("img");
                t.className = "placeholder show",
                t.src = "images/car_thumbnail_placeholder.png",
                e.appendChild(t);
                const i = document.createElement("img");
                BT(n.carColors, aD(this, nD, "f")).then((e => {
                    i.src = e,
                    t.classList.remove("show"),
                    i.classList.add("show")
                }
                )),
                e.appendChild(i);
                const a = document.createElement("p");
                a.className = "name",
                a.textContent = n.nickname,
                r.appendChild(a)
            } else {
                const e = document.createElement("div");
                e.className = "image-container",
                r.appendChild(e);
                const t = document.createElement("img");
                t.className = "show",
                t.src = "images/car_thumbnail_placeholder.png",
                e.appendChild(t);
                const n = document.createElement("p");
                n.className = "name empty",
                n.textContent = aD(this, XL, "f").get("Empty"),
                r.appendChild(n)
            }
            aD(this, $L, "f").appendChild(i)
        }
        ;
        const sD = class {
            constructor(e, t, n, i, r, a) {
                qL.add(this),
                YL.set(this, void 0),
                XL.set(this, void 0),
                ZL.set(this, void 0),
                JL.set(this, void 0),
                $L.set(this, void 0),
                eD.set(this, []),
                tD.set(this, void 0),
                nD.set(this, new WT);
                const s = document.getElementById("ui");
                if (null == s)
                    throw new Error("UI element not found");
                rD(this, YL, s, "f"),
                rD(this, XL, e, "f"),
                rD(this, ZL, t, "f"),
                rD(this, JL, n, "f"),
                rD(this, $L, document.createElement("div"), "f"),
                aD(this, $L, "f").className = "profile-selection",
                aD(this, YL, "f").appendChild(aD(this, $L, "f"));
                const o = document.createElement("div");
                o.className = "top-bar",
                aD(this, $L, "f").appendChild(o);
                const l = document.createElement("h2");
                l.textContent = e.get("Profiles"),
                o.appendChild(l);
                for (let e = 0; e < 3; e++)
                    aD(this, qL, "m", iD).call(this, e, a);
                const c = document.createElement("div");
                c.className = "bottom-bar",
                aD(this, $L, "f").appendChild(c);
                const h = document.createElement("button");
                h.className = "button",
                h.innerHTML = '<img class="button-icon" src="images/back.svg"> ',
                h.append(document.createTextNode(e.get("Back"))),
                h.addEventListener("click", ( () => {
                    t.playUIClick(),
                    i()
                }
                )),
                c.appendChild(h);
                const d = document.createElement("button");
                d.className = "button right",
                d.innerHTML = '<img class="button-icon" src="images/import.svg"> ',
                d.append(document.createTextNode(e.get("Import"))),
                d.addEventListener("click", ( () => {
                    t.playUIClick(),
                    r()
                }
                )),
                c.appendChild(d),
                window.addEventListener("keydown", rD(this, tD, (e => {
                    "Escape" == e.code && (i(),
                    e.preventDefault())
                }
                ), "f"))
            }
            dispose() {
                aD(this, nD, "f").cancel(),
                aD(this, YL, "f").removeChild(aD(this, $L, "f")),
                window.removeEventListener("keydown", aD(this, tD, "f"))
            }
        }
        ;
        var oD = i(6474)
          , lD = {};
        lD.styleTagTransform = u(),
        lD.setAttributes = l(),
        lD.insert = s().bind(null, "head"),
        lD.domAPI = r(),
        lD.insertStyleElement = h();
        t()(oD.A, lD);
        oD.A && oD.A.locals && oD.A.locals;
        class cD {
            constructor(e=AD.createToken(), t=AD.defaultNickname, n=np.random()) {
                this.token = e,
                this.nickname = t,
                this.carColors = n
            }
            get tokenHash() {
                return (0,
                wA.sha256)(this.token)
            }
            clone() {
                return new cD(this.token,this.nickname,this.carColors)
            }
        }
        const hD = cD;
        var dD, uD, pD, fD, mD, gD, vD, wD = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, yD = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class bD {
            constructor(e) {
                var t;
                dD.add(this),
                pD.set(this, void 0),
                fD.set(this, void 0),
                mD.set(this, void 0),
                wD(this, pD, e, "f"),
                wD(this, fD, null !== (t = yD(this, pD, "f").loadUserProfileSlot()) && void 0 !== t ? t : 0, "f"),
                wD(this, mD, yD(this, dD, "m", vD).call(this, yD(this, fD, "f")), "f")
            }
            static createToken() {
                let e = "";
                try {
                    const t = new Uint8Array(32);
                    crypto.getRandomValues(t),
                    e += t.toString()
                } catch (e) {}
                try {
                    e += crypto.randomUUID()
                } catch (e) {}
                if (0 == e.length)
                    throw new Error("Failed to generate user token");
                return (0,
                wA.sha256)(e)
            }
            createProfile(e, t, n, i) {
                return !!this.isValidToken(t) && (yD(this, pD, "f").saveUserProfile(e, t, n, i),
                null != yD(this, pD, "f").loadUserProfile(e))
            }
            isValidToken(e) {
                return !(!/^[0-9a-f]*$/.test(e) || 64 != e.length)
            }
            hasDuplicateToken(e) {
                var t;
                for (let n = 0; n < 3; n++)
                    if ((null === (t = yD(this, pD, "f").loadUserProfile(n)) || void 0 === t ? void 0 : t.token) == e)
                        return !0;
                return !1
            }
            firstOccupiedProfileSlot() {
                for (let e = 0; e < 3; e++)
                    if (null != yD(this, pD, "f").loadUserProfile(e))
                        return e;
                return null
            }
            firstFreeProfileSlot() {
                for (let e = 0; e < 3; e++)
                    if (null == yD(this, pD, "f").loadUserProfile(e))
                        return e;
                return null
            }
            deleteProfileSlot(e) {
                yD(this, pD, "f").deleteAllRecords(e),
                yD(this, pD, "f").deleteUserProfile(e)
            }
            setProfileSlot(e) {
                if (!Number.isSafeInteger(e) || e < 0)
                    throw new Error("Profile slot is invalid");
                wD(this, fD, e, "f"),
                wD(this, mD, yD(this, dD, "m", vD).call(this, yD(this, fD, "f")), "f"),
                yD(this, pD, "f").saveUserProfileSlot(yD(this, fD, "f"))
            }
            setNickname(e, t=yD(this, fD, "f")) {
                let n;
                n = t == yD(this, fD, "f") ? yD(this, mD, "f") : yD(this, dD, "m", vD).call(this, t),
                n.nickname = e,
                yD(this, pD, "f").saveUserProfile(t, n.token, n.nickname, n.carColors)
            }
            setCarColors(e, t=yD(this, fD, "f")) {
                let n;
                n = t == yD(this, fD, "f") ? yD(this, mD, "f") : yD(this, dD, "m", vD).call(this, t),
                n.carColors = e,
                yD(this, pD, "f").saveUserProfile(t, n.token, n.nickname, n.carColors)
            }
            get profileSlot() {
                return yD(this, fD, "f")
            }
            getCurrentUserProfile() {
                return yD(this, mD, "f").clone()
            }
            getUserProfile(e) {
                if (e == yD(this, fD, "f"))
                    return this.getCurrentUserProfile();
                {
                    const t = yD(this, pD, "f").loadUserProfile(e);
                    return null == t ? null : new hD(t.token,t.nickname,t.carColors)
                }
            }
            syncUserProfile(e) {
                const t = this.getCurrentUserProfile();
                e.getUser(t.token).then((e => {
                    if (null == e)
                        return;
                    const n = this.getCurrentUserProfile();
                    n.token == t.token && n.nickname == t.nickname && n.carColors.serialize() == t.carColors.serialize() && (this.setNickname(e.name),
                    this.setCarColors(e.carColors))
                }
                )).catch((e => {
                    console.error(e)
                }
                ))
            }
        }
        uD = bD,
        pD = new WeakMap,
        fD = new WeakMap,
        mD = new WeakMap,
        dD = new WeakSet,
        gD = function(e) {
            const t = uD.createToken()
              , n = uD.defaultNickname
              , i = np.random();
            yD(this, pD, "f").saveUserProfile(e, t, n, i)
        }
        ,
        vD = function(e) {
            null == yD(this, pD, "f").loadUserProfile(e) && yD(this, dD, "m", gD).call(this, e);
            const t = yD(this, pD, "f").loadUserProfile(e);
            return null == t ? new hD : new hD(t.token,t.nickname,t.carColors)
        }
        ,
        bD.defaultNickname = "Anonymous";
        const AD = bD;
        function xD(e) {
            return new Blob([e]).size
        }
        var kD, ED, SD, MD, _D, TD, CD, PD, ID, RD = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, LD = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        ED = new WeakMap,
        SD = new WeakMap,
        MD = new WeakMap,
        _D = new WeakMap,
        TD = new WeakMap,
        CD = new WeakMap,
        PD = new WeakMap,
        kD = new WeakSet,
        ID = function() {
            let e = LD(this, _D, "f").value;
            return /\S/.test(e) || (e = "Anonymous"),
            e
        }
        ;
        const DD = class {
            constructor(e, t, n, i, r, a, s, o, l, c) {
                kD.add(this),
                ED.set(this, void 0),
                SD.set(this, !1),
                MD.set(this, void 0),
                _D.set(this, void 0),
                TD.set(this, null),
                CD.set(this, null),
                PD.set(this, void 0);
                const h = document.getElementById("ui");
                if (null == h)
                    throw new Error("UI element not found");
                RD(this, ED, h, "f"),
                RD(this, MD, document.createElement("div"), "f"),
                LD(this, MD, "f").className = "nickname",
                LD(this, ED, "f").appendChild(LD(this, MD, "f"));
                const d = document.createElement("h1");
                d.textContent = e.get("Nickname"),
                LD(this, MD, "f").appendChild(d),
                RD(this, _D, document.createElement("input"), "f"),
                LD(this, _D, "f").type = "text",
                LD(this, _D, "f").placeholder = AD.defaultNickname,
                LD(this, _D, "f").spellcheck = !1,
                null != r ? LD(this, _D, "f").value = r : null != i && i.nickname != LD(this, _D, "f").placeholder && (LD(this, _D, "f").value = i.nickname),
                LD(this, MD, "f").appendChild(LD(this, _D, "f")),
                LD(this, _D, "f").focus(),
                LD(this, _D, "f").addEventListener("input", ( () => {
                    let e = LD(this, _D, "f").value;
                    for (; xD(e) >= 50; )
                        e = e.substring(0, e.length - 1);
                    LD(this, _D, "f").value = e
                }
                )),
                LD(this, _D, "f").addEventListener("keydown", (e => {
                    "Enter" == e.code && (o(LD(this, kD, "m", ID).call(this)),
                    e.preventDefault())
                }
                ));
                const u = document.createElement("p");
                u.textContent = e.get("Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time."),
                LD(this, MD, "f").appendChild(u);
                const p = document.createElement("button");
                p.className = "button delete",
                p.innerHTML = ' <img class="button-icon" src="images/delete.svg"> ',
                p.append(e.get("Delete")),
                p.addEventListener("click", ( () => {
                    t.playUIClick(),
                    a(LD(this, kD, "m", ID).call(this))
                }
                )),
                LD(this, MD, "f").appendChild(p);
                const f = document.createElement("button");
                f.className = "button",
                f.innerHTML = '<img class="button-icon" src="images/export.svg"> ',
                f.append(e.get("Export")),
                f.addEventListener("click", ( () => {
                    var e;
                    t.playUIClick(),
                    s(LD(this, kD, "m", ID).call(this), null !== (e = null == i ? void 0 : i.token) && void 0 !== e ? e : "")
                }
                )),
                LD(this, MD, "f").appendChild(f);
                const m = document.createElement("button");
                m.className = "button",
                m.textContent = e.get("Ok"),
                m.addEventListener("click", ( () => {
                    t.playUIClick(),
                    o(LD(this, kD, "m", ID).call(this))
                }
                )),
                LD(this, MD, "f").appendChild(m),
                null != i && n.getUser(i.token).then((e => {
                    const n = 1 == (null == e ? void 0 : e.isVerifier);
                    if (!LD(this, SD, "f") && n) {
                        RD(this, TD, document.createElement("div"), "f"),
                        LD(this, TD, "f").className = "nickname-admin-button-container",
                        LD(this, ED, "f").appendChild(LD(this, TD, "f"));
                        const e = document.createElement("button");
                        e.className = "button",
                        e.textContent = "Verifier",
                        e.addEventListener("click", ( () => {
                            t.playUIClick(),
                            l(i.token)
                        }
                        )),
                        LD(this, TD, "f").appendChild(e);
                        const n = document.createElement("button");
                        n.className = "button",
                        n.textContent = "Admin",
                        n.addEventListener("click", ( () => {
                            t.playUIClick(),
                            c(i.token)
                        }
                        )),
                        LD(this, TD, "f").appendChild(n)
                    }
                }
                )).catch((e => {
                    console.error(e)
                }
                )),
                null != (null == i ? void 0 : i.tokenHash) && (RD(this, CD, document.createElement("p"), "f"),
                LD(this, CD, "f").className = "nickname-user-token",
                LD(this, CD, "f").textContent = e.get("User ID") + ": " + i.tokenHash,
                LD(this, ED, "f").appendChild(LD(this, CD, "f"))),
                window.addEventListener("keydown", RD(this, PD, (e => {
                    "Escape" == e.code && (o(LD(this, kD, "m", ID).call(this)),
                    e.preventDefault())
                }
                ), "f"))
            }
            dispose() {
                LD(this, ED, "f").removeChild(LD(this, MD, "f")),
                null != LD(this, TD, "f") && LD(this, ED, "f").removeChild(LD(this, TD, "f")),
                null != LD(this, CD, "f") && LD(this, ED, "f").removeChild(LD(this, CD, "f")),
                window.removeEventListener("keydown", LD(this, PD, "f")),
                RD(this, SD, !0, "f")
            }
        }
        ;
        var ND = i(7818)
          , BD = {};
        BD.styleTagTransform = u(),
        BD.setAttributes = l(),
        BD.insert = s().bind(null, "head"),
        BD.domAPI = r(),
        BD.insertStyleElement = h();
        t()(ND.A, BD);
        ND.A && ND.A.locals && ND.A.locals;
        var UD, zD, OD, FD = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, WD = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        UD = new WeakMap,
        zD = new WeakMap,
        OD = new WeakMap;
        const HD = class {
            constructor(e, t, n, i, r) {
                UD.set(this, void 0),
                zD.set(this, void 0),
                OD.set(this, void 0);
                const a = document.getElementById("ui");
                if (null == a)
                    throw new Error("UI element not found");
                FD(this, UD, a, "f"),
                FD(this, zD, document.createElement("div"), "f"),
                WD(this, zD, "f").className = "user-export",
                WD(this, UD, "f").appendChild(WD(this, zD, "f"));
                const s = document.createElement("textarea");
                s.value = n,
                s.readOnly = null == r,
                s.placeholder = "Paste user token here...",
                WD(this, zD, "f").appendChild(s);
                const o = document.createElement("div");
                o.className = "bar",
                WD(this, zD, "f").appendChild(o);
                const l = document.createElement("button");
                if (l.className = "button",
                l.innerHTML = '<img class="button-icon" src="images/back.svg"> ',
                l.append(document.createTextNode(t.get("Back"))),
                l.addEventListener("click", ( () => {
                    e.playUIClick(),
                    i()
                }
                )),
                o.appendChild(l),
                null != r) {
                    const n = document.createElement("button");
                    n.className = "button right",
                    n.innerHTML = '<img class="button-icon" src="images/import.svg"> ',
                    n.append(document.createTextNode(t.get("Import"))),
                    n.addEventListener("click", ( () => {
                        e.playUIClick(),
                        r(s.value)
                    }
                    )),
                    o.appendChild(n)
                } else {
                    const n = document.createElement("button");
                    n.className = "button right",
                    n.innerHTML = '<img class="button-icon" src="images/copy.svg"> ',
                    n.append(document.createTextNode(t.get("Copy"))),
                    n.addEventListener("click", ( () => {
                        e.playUIClick();
                        try {
                            navigator.clipboard.writeText(s.value).catch((e => {
                                console.error(e)
                            }
                            ))
                        } catch (e) {
                            console.error(e)
                        }
                    }
                    )),
                    o.appendChild(n)
                }
                window.addEventListener("keydown", FD(this, OD, (e => {
                    "Escape" == e.code && (i(),
                    e.preventDefault())
                }
                ), "f"))
            }
            dispose() {
                WD(this, UD, "f").removeChild(WD(this, zD, "f")),
                window.removeEventListener("keydown", WD(this, OD, "f"))
            }
        }
        ;
        try {
            if (void 0 !== window.BroadcastChannel) {
                const e = new window.BroadcastChannel("polytrack-single-instance");
                e.addEventListener("message", (t => {
                    "new-instance" == t.data && VD && e.postMessage("conflict"),
                    "conflict" == t.data && (VD = !1)
                }
                )),
                e.postMessage("new-instance"),
                window.addEventListener("beforeunload", ( () => {
                    e.close()
                }
                ))
            }
        } catch (e) {
            console.error(e)
        }
        let VD = !0;
        var GD, jD, QD, KD, qD, YD, XD, ZD, JD, $D, eN, tN, nN, iN, rN, aN, sN, oN, lN, cN, hN, dN, uN, pN, fN, mN, gN, vN, wN, yN, bN, AN, xN = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, kN = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        jD = new WeakMap,
        QD = new WeakMap,
        KD = new WeakMap,
        qD = new WeakMap,
        YD = new WeakMap,
        XD = new WeakMap,
        ZD = new WeakMap,
        JD = new WeakMap,
        $D = new WeakMap,
        eN = new WeakMap,
        tN = new WeakMap,
        nN = new WeakMap,
        iN = new WeakMap,
        rN = new WeakMap,
        aN = new WeakMap,
        sN = new WeakMap,
        oN = new WeakMap,
        lN = new WeakMap,
        cN = new WeakMap,
        hN = new WeakMap,
        dN = new WeakMap,
        uN = new WeakMap,
        pN = new WeakMap,
        GD = new WeakSet,
        fN = function(e, t, n, i, r, a, s, o, l, c) {
            return new zE(kN(this, YD, "f"),e,t,n,i,r,a,s,!1,( () => {
                kN(this, eN, "f").hide(),
                kN(this, GD, "m", wN).call(this),
                kN(this, GD, "m", bN).call(this)
            }
            ),( (s, h, d, u, p) => {
                kN(this, eN, "f").hide();
                const f = () => {
                    var e;
                    kN(this, eN, "f").show(),
                    null === (e = kN(this, tN, "f")) || void 0 === e || e.dispose(),
                    xN(this, tN, null, "f")
                }
                  , m = e => {
                    var t;
                    null === (t = kN(this, tN, "f")) || void 0 === t || t.dispose(),
                    xN(this, tN, null, "f"),
                    l(s, h, d, e)
                }
                  , g = c => {
                    var y;
                    null === (y = kN(this, tN, "f")) || void 0 === y || y.dispose(),
                    xN(this, tN, null, "f"),
                    o.determinismState != HT.Ok ? a.show(e.get("Cannot load recordings due to non-determinism"), e.get("Ok"), ( () => {
                        xN(this, tN, new jL(kN(this, YD, "f"),e,o,r,n,t,a,s,h,u,p,i,f,g,m,v,w), "f")
                    }
                    )) : c.then((e => {
                        l(s, h, d, e)
                    }
                    )).catch(( () => {
                        a.show(e.get("Failed to load recordings"), e.get("Ok"), ( () => {
                            xN(this, tN, new jL(kN(this, YD, "f"),e,o,r,n,t,a,s,h,u,p,i,f,g,m,v,w), "f")
                        }
                        ))
                    }
                    ))
                }
                  , v = l => {
                    var y;
                    null === (y = kN(this, tN, "f")) || void 0 === y || y.dispose(),
                    xN(this, tN, null, "f"),
                    o.determinismState != HT.Ok ? a.show(e.get("Cannot load recordings due to non-determinism"), e.get("Ok"), ( () => {
                        xN(this, tN, new jL(kN(this, YD, "f"),e,o,r,n,t,a,s,h,u,p,i,f,g,m,v,w), "f")
                    }
                    )) : l.then((e => {
                        c(s, h, d, e)
                    }
                    )).catch(( () => {
                        a.show(e.get("Failed to load recordings"), e.get("Ok"), ( () => {
                            xN(this, tN, new jL(kN(this, YD, "f"),e,o,r,n,t,a,s,h,u,p,i,f,g,m,v,w), "f")
                        }
                        ))
                    }
                    ))
                }
                  , w = e => {
                    var t;
                    null === (t = kN(this, tN, "f")) || void 0 === t || t.dispose(),
                    xN(this, tN, null, "f"),
                    c(s, h, d, e)
                }
                ;
                xN(this, tN, new jL(kN(this, YD, "f"),e,o,r,n,t,a,s,h,u,p,i,f,g,m,v,w), "f"),
                kN(this, GD, "m", yN).call(this)
            }
            ))
        }
        ,
        mN = function e(t, n, i, r, a, s, o, l, c, h, d, u, p, f, m, g, v) {
            for (const e of kN(this, lN, "f"))
                kN(this, oN, "f").removeChild(e);
            xN(this, lN, [], "f");
            for (const e of kN(this, hN, "f"))
                kN(this, cN, "f").removeChild(e);
            xN(this, hN, [], "f");
            const w = document.createElement("button");
            w.className = "button button-image",
            w.innerHTML = '<img src="images/customize.svg">',
            w.addEventListener("click", ( () => {
                n.playUIClick(),
                u()
            }
            ));
            const y = document.createElement("p");
            y.textContent = t.get("Customize"),
            w.appendChild(y),
            kN(this, oN, "f").appendChild(w),
            kN(this, lN, "f").push(w);
            const b = document.createElement("button");
            b.className = "button button-image",
            b.innerHTML = '<img src="images/editor.svg">',
            b.addEventListener("click", ( () => {
                n.playUIClick(),
                p()
            }
            ));
            const A = document.createElement("p");
            A.textContent = t.get("Editor"),
            b.appendChild(A),
            kN(this, oN, "f").appendChild(b),
            kN(this, lN, "f").push(b);
            const x = document.createElement("button");
            x.className = "button button-image",
            x.innerHTML = '<img src="images/settings.svg">',
            x.addEventListener("click", ( () => {
                n.playUIClick(),
                kN(this, GD, "m", vN).call(this),
                kN(this, GD, "m", yN).call(this),
                xN(this, nN, new xL(kN(this, YD, "f"),t,n,i,r,a,d,( () => {
                    var w;
                    null === (w = kN(this, nN, "f")) || void 0 === w || w.dispose(),
                    xN(this, nN, null, "f"),
                    kN(this, eN, "f").dispose(),
                    xN(this, eN, kN(this, GD, "m", fN).call(this, t, n, l, s, o, d, c, h, f, m), "f"),
                    kN(this, GD, "m", gN).call(this, t),
                    kN(this, GD, "m", e).call(this, t, n, i, r, a, s, o, l, c, h, d, u, p, f, m, g, v),
                    kN(this, GD, "m", wN).call(this),
                    kN(this, GD, "m", bN).call(this)
                }
                )), "f")
            }
            ));
            const k = document.createElement("p");
            k.textContent = t.get("Settings"),
            x.appendChild(k),
            kN(this, oN, "f").appendChild(x),
            kN(this, lN, "f").push(x);
            const E = document.createElement("button");
            E.className = "button button-image",
            E.innerHTML = '<img src="images/helmet.svg">',
            E.addEventListener("click", ( () => {
                n.playUIClick(),
                kN(this, GD, "m", vN).call(this);
                const e = (i, a) => {
                    xN(this, aN, new HD(n,t,a,( () => {
                        var e;
                        null === (e = kN(this, aN, "f")) || void 0 === e || e.dispose(),
                        xN(this, aN, null, "f"),
                        r()
                    }
                    ),(n => {
                        var a;
                        null === (a = kN(this, aN, "f")) || void 0 === a || a.dispose(),
                        xN(this, aN, null, "f"),
                        o.hasDuplicateToken(n) ? d.show(t.get("You cannot have duplicate user profiles"), t.get("Ok"), ( () => {
                            e(i, n)
                        }
                        )) : o.isValidToken(n) ? h.getUser(n).then((a => {
                            null != a ? o.createProfile(i, n, a.name, a.carColors) ? (o.setProfileSlot(i),
                            kN(this, eN, "f").refresh(),
                            r()) : d.show(t.get("Failed to create user profile"), t.get("Ok"), ( () => {
                                e(i, n)
                            }
                            )) : d.show(t.get("This user profile does not exist on the server"), t.get("Ok"), ( () => {
                                e(i, n)
                            }
                            ))
                        }
                        )).catch((r => {
                            console.error(r),
                            d.show(t.get("Failed to download user profile from the server"), t.get("Ok"), ( () => {
                                e(i, n)
                            }
                            ))
                        }
                        )) : d.show(t.get("User token is invalid"), t.get("Ok"), ( () => {
                            e(i, n)
                        }
                        ))
                    }
                    )), "f")
                }
                  , i = (e, a) => {
                    var s;
                    null === (s = kN(this, iN, "f")) || void 0 === s || s.dispose(),
                    xN(this, iN, null, "f");
                    const l = o.getUserProfile(e);
                    xN(this, rN, new DD(t,n,h,l,a,(n => {
                        var a;
                        null === (a = kN(this, rN, "f")) || void 0 === a || a.dispose(),
                        xN(this, rN, null, "f"),
                        d.showConfirm(t.get('Are you sure you would like to delete "{0}"?', [n]), t.get("Cancel"), t.get("Confirm"), ( () => {
                            i(e, n)
                        }
                        ), ( () => {
                            var t;
                            o.deleteProfileSlot(e),
                            e == o.profileSlot && (o.setProfileSlot(null !== (t = o.firstOccupiedProfileSlot()) && void 0 !== t ? t : 0),
                            kN(this, eN, "f").refresh()),
                            r()
                        }
                        ))
                    }
                    ),( (r, a) => {
                        var s;
                        null === (s = kN(this, rN, "f")) || void 0 === s || s.dispose(),
                        xN(this, rN, null, "f"),
                        d.showConfirm(t.get("Are you sure you want to display your private key?") + "\n\n" + t.get("DO NOT SHARE THIS KEY WITH ANYONE."), t.get("Cancel"), t.get("Confirm"), ( () => {
                            i(e, r)
                        }
                        ), ( () => {
                            xN(this, aN, new HD(n,t,a,( () => {
                                var t;
                                null === (t = kN(this, aN, "f")) || void 0 === t || t.dispose(),
                                xN(this, aN, null, "f"),
                                i(e, r)
                            }
                            ),null), "f")
                        }
                        ))
                    }
                    ),(t => {
                        var n;
                        if (null === (n = kN(this, rN, "f")) || void 0 === n || n.dispose(),
                        xN(this, rN, null, "f"),
                        t != (null == l ? void 0 : l.nickname)) {
                            o.setNickname(t, e);
                            const n = o.getUserProfile(e);
                            null != n && h.submitUserProfile(n.token, n.nickname, n.carColors).catch((e => {
                                console.warn(e)
                            }
                            ))
                        }
                        o.setProfileSlot(e),
                        kN(this, eN, "f").refresh(),
                        r()
                    }
                    ),(e => {
                        var t;
                        null === (t = kN(this, rN, "f")) || void 0 === t || t.dispose(),
                        xN(this, rN, null, "f"),
                        g(e),
                        kN(this, GD, "m", wN).call(this)
                    }
                    ),(e => {
                        var t;
                        null === (t = kN(this, rN, "f")) || void 0 === t || t.dispose(),
                        xN(this, rN, null, "f"),
                        v(e),
                        kN(this, GD, "m", wN).call(this)
                    }
                    )), "f")
                }
                  , r = () => {
                    xN(this, iN, new sD(t,n,o,( () => {
                        var e;
                        null === (e = kN(this, iN, "f")) || void 0 === e || e.dispose(),
                        xN(this, iN, null, "f"),
                        kN(this, GD, "m", wN).call(this)
                    }
                    ),( () => {
                        var n;
                        null === (n = kN(this, iN, "f")) || void 0 === n || n.dispose(),
                        xN(this, iN, null, "f");
                        const i = o.firstFreeProfileSlot();
                        null == i ? d.show(t.get("You need a free user profile slot to import a new user profile"), t.get("Ok"), ( () => {
                            r()
                        }
                        )) : e(i, "")
                    }
                    ),(e => {
                        i(e, null)
                    }
                    )), "f")
                }
                ;
                r()
            }
            ));
            const S = document.createElement("p");
            S.textContent = t.get("Profile"),
            E.appendChild(S),
            kN(this, oN, "f").appendChild(E),
            kN(this, lN, "f").push(E);
            const M = document.createElement("button");
            M.className = "button button-image",
            M.innerHTML = '<img src="images/play.svg">',
            M.addEventListener("click", ( () => {
                n.playUIClick(),
                kN(this, GD, "m", vN).call(this),
                kN(this, GD, "m", yN).call(this),
                kN(this, eN, "f").show()
            }
            ));
            const _ = document.createElement("p");
            if (_.textContent = t.get("Play"),
            M.appendChild(_),
            kN(this, oN, "f").appendChild(M),
            kN(this, lN, "f").push(M),
            window.electron) {
                const e = document.createElement("button");
                e.className = "button small",
                e.innerHTML = '<img src="images/quit.svg">',
                e.appendChild(document.createTextNode(" " + t.get("Quit"))),
                e.addEventListener("click", ( () => {
                    var e;
                    n.playUIClick(),
                    null === (e = window.electron) || void 0 === e || e.quit()
                }
                )),
                kN(this, cN, "f").appendChild(e),
                kN(this, hN, "f").push(e)
            }
            {
                const e = document.createElement("button");
                e.className = "button small",
                i.isFullscreen ? (e.innerHTML = '<img src="images/windowed.svg">',
                e.appendChild(document.createTextNode(" " + t.get("Windowed")))) : (e.innerHTML = '<img src="images/fullscreen.svg">',
                e.appendChild(document.createTextNode(" " + t.get("Fullscreen")))),
                null != kN(this, pN, "f") && i.removeFullscreenChangeListener(kN(this, pN, "f")),
                i.addFullscreenChangeListener(xN(this, pN, ( () => {
                    i.isFullscreen ? (e.innerHTML = '<img src="images/windowed.svg">',
                    e.appendChild(document.createTextNode(" " + t.get("Windowed")))) : (e.innerHTML = '<img src="images/fullscreen.svg">',
                    e.appendChild(document.createTextNode(" " + t.get("Fullscreen"))))
                }
                ), "f")),
                e.addEventListener("click", ( () => {
                    n.playUIClick(),
                    i.toggleFullscreen().catch((e => {
                        console.error(e)
                    }
                    ))
                }
                )),
                kN(this, cN, "f").appendChild(e),
                kN(this, hN, "f").push(e)
            }
        }
        ,
gN = function(e) {
            kN(this, JD, "f").innerHTML = "";
            const t = document.createElement("a");
            t.href = "https://www.sites.google.com/view/poly-track",
            t.textContent = "sites.google.com/view/poly-track",
            kN(this, JD, "f").appendChild(t);
            const n = document.createElement("a");
            n.href = "https://opengameart.org/content/sci-fi-theme-1",
            n.target = "_blank",
            n.textContent = 'OpenGameArt.org "Sci-fi Theme" by Maou (CC-BY 4.0)',
            kN(this, JD, "f").appendChild(n)
        }
        ,
        vN = function() {
            var e;
            null === (e = kN(this, sN, "f")) || void 0 === e || e.classList.add("hidden"),
            kN(this, oN, "f").classList.add("hidden");
            for (const e of kN(this, lN, "f"))
                e.classList.remove("button-spawn");
            for (const e of kN(this, hN, "f"))
                e.classList.add("hidden");
            kN(this, JD, "f").className = "hidden"
        }
        ,
        wN = function() {
            if (null != kN(this, sN, "f")) {
                const e = "https://www.sites.google.com/view/poly-track"
                  , t = jT()
                  , n = kN(this, sN, "f");
                t ? n.textContent = kN(this, jD, "f").get("It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:", ["PolyTrack"]) + " " : n.textContent = "",
                n.className = t ? "warning-message" : "warning-message official-link";
                const i = document.createElement("a");
                i.href = e,
                i.textContent = e,
                n.appendChild(i),
                n.classList.remove("hidden")
            }
            kN(this, oN, "f").classList.remove("hidden");
            for (const e of kN(this, hN, "f"))
                e.classList.remove("hidden");
            kN(this, JD, "f").className = "info"
        }
        ,
        yN = function() {
            kN(this, XD, "f").className = "hidden"
        }
        ,
        bN = function() {
            kN(this, XD, "f").className = "logo"
        }
        ,
        AN = function() {
            const e = kN(this, KD, "f").getBounds()
              , t = new Qt((e.min.x + (e.max.x - e.min.x) / 2) * Px.partSize,(e.min.y + (e.max.y - e.min.y) / 2) * Px.partSize);
            kN(this, dN, "f").position.set(t.x + 250 * Math.cos(kN(this, uN, "f")), 100, t.y - 250 * Math.sin(kN(this, uN, "f"))),
            kN(this, dN, "f").rotation.y = kN(this, uN, "f") + Math.PI / 2
        }
        ;
        const EN = class {
            constructor(e, t, n, i, r, a, s, o, l, c, h, d, u, p, f, m, g, v, w) {
                GD.add(this),
                jD.set(this, void 0),
                QD.set(this, void 0),
                KD.set(this, void 0),
                qD.set(this, void 0),
                YD.set(this, void 0),
                XD.set(this, void 0),
                ZD.set(this, void 0),
                JD.set(this, void 0),
                $D.set(this, null),
                eN.set(this, void 0),
                tN.set(this, null),
                nN.set(this, null),
                iN.set(this, null),
                rN.set(this, null),
                aN.set(this, null),
                sN.set(this, void 0),
                oN.set(this, void 0),
                lN.set(this, []),
                cN.set(this, void 0),
                hN.set(this, []),
                dN.set(this, void 0),
                uN.set(this, Math.random() * Math.PI * 2),
                pN.set(this, null),
                xN(this, jD, e, "f"),
                xN(this, QD, n, "f"),
                xN(this, KD, r, "f");
                const y = document.getElementById("ui");
                if (null == y)
                    throw new Error("UI element not found");
                xN(this, qD, y, "f"),
                xN(this, YD, document.createElement("div"), "f"),
                kN(this, YD, "f").className = "menu",
                kN(this, qD, "f").appendChild(kN(this, YD, "f")),
                xN(this, XD, document.createElement("img"), "f"),
                kN(this, XD, "f").className = "logo",
                i.hasLoaded() || (kN(this, XD, "f").classList.add("hidden"),
                kN(this, XD, "f").addEventListener("load", ( () => {
                    kN(this, XD, "f").classList.remove("hidden")
                }
                ))),
                kN(this, XD, "f").src = "images/logo.svg",
                kN(this, YD, "f").appendChild(kN(this, XD, "f")),
                xN(this, sN, document.createElement("div"), "f"),
                kN(this, sN, "f").className = "warning-message",
                kN(this, YD, "f").appendChild(kN(this, sN, "f")),
                xN(this, eN, kN(this, GD, "m", fN).call(this, e, t, s, c, a, d, o, l, m, g, v, w, C, P, I, R), "f"),
                xN(this, JD, document.createElement("div"), "f"),
                kN(this, JD, "f").className = "info",
                kN(this, YD, "f").appendChild(kN(this, JD, "f")),
                kN(this, GD, "m", gN).call(this, e),
                xN(this, oN, document.createElement("div"), "f"),
                kN(this, oN, "f").className = "main-buttons-container hidden",
                kN(this, YD, "f").appendChild(kN(this, oN, "f")),
                xN(this, cN, document.createElement("div"), "f"),
                kN(this, cN, "f").className = "bottom-buttons",
                kN(this, YD, "f").appendChild(kN(this, cN, "f")),
                kN(this, GD, "m", mN).call(this, e, t, n, h, r, c, a, s, o, l, d, p, f, m, g, v, w),
                i.hasLoaded() ? kN(this, GD, "m", wN).call(this) : (kN(this, YD, "f").classList.add("loading-screen"),
                xN(this, $D, new YR(kN(this, YD, "f"),e,i), "f"),
                i.addCompleteListener(( () => {
                    kN(this, YD, "f").classList.remove("loading-screen");
                    const t = kN(this, $D, "f");
                    null == t || t.fadeOut(( () => {
                        t.dispose();
                        const n = () => {
                            kN(this, QD, "f").isUsingSoftwareRenderer ? d.show(e.get("Hardware acceleration is disabled. Performance may be reduced.") + "\n\n" + e.get("Please make sure hardware acceleration is enabled in your browser settings."), e.get("Ok"), ( () => {
                                kN(this, GD, "m", bN).call(this),
                                kN(this, GD, "m", wN).call(this)
                            }
                            )) : (kN(this, GD, "m", bN).call(this),
                            kN(this, GD, "m", wN).call(this))
                        }
                        ;
                        VD ? l.determinismState == HT.Ok ? n() : l.determinismState == HT.AssetsFailed ? (kN(this, GD, "m", yN).call(this),
                        d.show(e.get("Non-deterministic game assets found.") + " " + e.get("Some leaderboard features are disabled.") + "\n\n" + e.get("Please try clearing your browser cache."), e.get("Ok"), ( () => {
                            n()
                        }
                        ))) : (kN(this, GD, "m", yN).call(this),
                        d.show(e.get("Computer determinism check failed.") + " " + e.get("Some leaderboard features are disabled.") + "\n\n" + e.get("Please try another browser or device."), e.get("Ok"), ( () => {
                            n()
                        }
                        ))) : d.showNoButtons(e.get("You already have another instance of PolyTrack open.") + "\n\n" + e.get("Please switch to that tab or window to continue."));
                        for (let e = 0; e < kN(this, lN, "f").length; e++) {
                            const t = kN(this, lN, "f")[e];
                            t.classList.add("button-spawn"),
                            t.style.animationDelay = (.3 + .1 * e).toString() + "s"
                        }
                    }
                    )),
                    xN(this, $D, null, "f")
                }
                ))),
                u && (kN(this, GD, "m", vN).call(this),
                kN(this, GD, "m", yN).call(this),
                kN(this, eN, "f").show()),
                xN(this, dN, new Ir(70,1,.5,Qu.maxViewDistance), "f"),
                n.scene.add(kN(this, dN, "f")),
                kN(this, GD, "m", AN).call(this)
            }
            dispose() {
                var e;
                kN(this, qD, "f").removeChild(kN(this, YD, "f")),
                kN(this, eN, "f").dispose(),
                null === (e = kN(this, tN, "f")) || void 0 === e || e.dispose(),
                xN(this, tN, null, "f"),
                null != kN(this, pN, "f") && kN(this, QD, "f").removeFullscreenChangeListener(kN(this, pN, "f"))
            }
            get camera() {
                return kN(this, dN, "f")
            }
            update(e) {
                xN(this, uN, kN(this, uN, "f") + .05 * e, "f"),
                kN(this, GD, "m", AN).call(this)
            }
        }
        ;
        var SN, MN, _N, TN, CN, PN, IN, RN, LN, DN, NN, BN, UN, zN, ON = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, FN = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        MN = new WeakMap,
        _N = new WeakMap,
        TN = new WeakMap,
        CN = new WeakMap,
        PN = new WeakMap,
        IN = new WeakMap,
        RN = new WeakMap,
        LN = new WeakMap,
        DN = new WeakMap,
        NN = new WeakMap,
        BN = new WeakMap,
        UN = new WeakMap,
        SN = new WeakSet,
        zN = function() {
            FN(this, _N, "f").loadTrackData(FN(this, PN, "f").getRandomOfficialTrackData()),
            FN(this, _N, "f").generateMeshes(),
            FN(this, TN, "f").generateMountains(FN(this, _N, "f").getBounds());
            let e = null;
            const t = FN(this, _N, "f").getID();
            if (null != t) {
                const n = FN(this, IN, "f").getRecord(FN(this, NN, "f").profileSlot, t);
                null != n && (e = n.recording)
            }
            if (null != e) {
                const t = FN(this, _N, "f").getStartTransform();
                if (null == t)
                    throw new Error("Start transform is null");
                ON(this, UN, new Qw(FN(this, MN, "f"),t,e,null,FN(this, LN, "f"),FN(this, DN, "f"),FN(this, TN, "f"),FN(this, _N, "f"),FN(this, RN, "f")), "f"),
                FN(this, UN, "f").audioVolume = 0,
                FN(this, UN, "f").start()
            }
        }
        ;
        const WN = class {
            constructor(e, t, n, i, r, a, s, o, l, c, h, d, u, p, f, m, g, v, w, y, b, A) {
                SN.add(this),
                MN.set(this, void 0),
                _N.set(this, void 0),
                TN.set(this, void 0),
                CN.set(this, void 0),
                PN.set(this, void 0),
                IN.set(this, void 0),
                RN.set(this, void 0),
                LN.set(this, void 0),
                DN.set(this, void 0),
                NN.set(this, void 0),
                BN.set(this, void 0),
                UN.set(this, null),
                ON(this, MN, e, "f"),
                ON(this, _N, t, "f"),
                ON(this, TN, n, "f"),
                ON(this, CN, i, "f"),
                ON(this, PN, r, "f"),
                ON(this, IN, l, "f"),
                ON(this, RN, u, "f"),
                ON(this, LN, c, "f"),
                ON(this, DN, h, "f"),
                ON(this, NN, o, "f"),
                ON(this, BN, new EN(a,h,c,f,t,o,l,d,p,r,u,s,m,g,v,w,y,b,A), "f"),
                c.setCamera(FN(this, BN, "f").camera),
                f.hasLoaded() ? FN(this, SN, "m", zN).call(this) : f.addCompleteListener(( () => {
                    FN(this, SN, "m", zN).call(this)
                }
                ))
            }
            dispose() {
                var e;
                null === (e = FN(this, UN, "f")) || void 0 === e || e.dispose(),
                FN(this, BN, "f").dispose(),
                FN(this, _N, "f").clear(),
                FN(this, TN, "f").clearMountains()
            }
            update(e) {
                var t;
                null === (t = FN(this, UN, "f")) || void 0 === t || t.update(e),
                FN(this, BN, "f").update(e),
                FN(this, TN, "f").update(FN(this, _N, "f")),
                FN(this, CN, "f").update(e, FN(this, LN, "f").camera, FN(this, _N, "f").sunDirection),
                FN(this, DN, "f").update(e, !0, FN(this, LN, "f"), FN(this, RN, "f")),
                FN(this, LN, "f").update(FN(this, _N, "f").sunDirection)
            }
        }
        ;
        var HN = i(5437)
          , VN = {};
        VN.styleTagTransform = u(),
        VN.setAttributes = l(),
        VN.insert = s().bind(null, "head"),
        VN.domAPI = r(),
        VN.insertStyleElement = h();
        t()(HN.A, VN);
        HN.A && HN.A.locals && HN.A.locals;
        var GN, jN, QN, KN, qN, YN, XN, ZN, JN, $N, eB, tB, nB, iB = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, rB = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        jN = new WeakMap,
        QN = new WeakMap,
        KN = new WeakMap,
        qN = new WeakMap,
        YN = new WeakMap,
        XN = new WeakMap,
        ZN = new WeakMap,
        JN = new WeakMap,
        $N = new WeakMap,
        GN = new WeakSet,
        eB = function() {
            null == rB(this, $N, "f") && window.addEventListener("keydown", iB(this, $N, (e => {
                this.isOpen && ("Escape" == e.code ? (null != rB(this, ZN, "f") && rB(this, ZN, "f").call(this),
                this.hide(),
                e.stopImmediatePropagation(),
                e.preventDefault()) : "Enter" == e.code && "message" == rB(this, jN, "f") && (null != rB(this, JN, "f") && rB(this, JN, "f").call(this),
                this.hide(),
                e.stopImmediatePropagation(),
                e.preventDefault()))
            }
            ), "f"))
        }
        ,
        tB = function() {
            null != rB(this, $N, "f") && (window.removeEventListener("keydown", rB(this, $N, "f")),
            iB(this, $N, null, "f"))
        }
        ,
        nB = function() {
            const e = Math.max(.01, Math.min(window.innerWidth, 1.4375 * window.innerHeight) / 1150);
            rB(this, KN, "f").style.transform = e < 1 ? "scale(" + e.toString() + ")" : ""
        }
        ;
        const aB = class {
            constructor(e) {
                GN.add(this),
                jN.set(this, null),
                QN.set(this, void 0),
                KN.set(this, void 0),
                qN.set(this, void 0),
                YN.set(this, void 0),
                XN.set(this, void 0),
                ZN.set(this, null),
                JN.set(this, null),
                $N.set(this, null),
                iB(this, QN, document.createElement("dialog"), "f"),
                rB(this, QN, "f").className = "hidden",
                document.body.appendChild(rB(this, QN, "f")),
                iB(this, KN, document.createElement("div"), "f"),
                rB(this, QN, "f").appendChild(rB(this, KN, "f")),
                iB(this, qN, document.createElement("p"), "f"),
                rB(this, KN, "f").appendChild(rB(this, qN, "f")),
                iB(this, YN, document.createElement("button"), "f"),
                rB(this, YN, "f").className = "button",
                rB(this, YN, "f").addEventListener("click", ( () => {
                    e.playUIClick();
                    const t = rB(this, ZN, "f");
                    this.hide(),
                    null != t && t()
                }
                )),
                rB(this, KN, "f").appendChild(rB(this, YN, "f")),
                iB(this, XN, document.createElement("button"), "f"),
                rB(this, XN, "f").className = "button",
                rB(this, XN, "f").addEventListener("click", ( () => {
                    e.playUIClick();
                    const t = rB(this, JN, "f");
                    this.hide(),
                    null != t && t()
                }
                )),
                rB(this, KN, "f").appendChild(rB(this, XN, "f")),
                window.addEventListener("resize", ( () => {
                    rB(this, GN, "m", nB).call(this)
                }
                )),
                rB(this, GN, "m", nB).call(this)
            }
            get isOpen() {
                return null != rB(this, jN, "f")
            }
            show(e, t, n) {
                iB(this, jN, "message", "f"),
                rB(this, QN, "f").className = "message-box message",
                rB(this, QN, "f").showModal(),
                rB(this, qN, "f").textContent = e,
                rB(this, YN, "f").textContent = "",
                rB(this, XN, "f").textContent = t,
                rB(this, YN, "f").blur(),
                rB(this, XN, "f").blur(),
                iB(this, ZN, n, "f"),
                iB(this, JN, n, "f"),
                rB(this, GN, "m", eB).call(this)
            }
            showConfirm(e, t, n, i, r) {
                iB(this, jN, "confirm", "f"),
                rB(this, QN, "f").className = "message-box confirm",
                rB(this, QN, "f").showModal(),
                rB(this, qN, "f").textContent = e,
                rB(this, YN, "f").textContent = t,
                rB(this, XN, "f").textContent = n,
                rB(this, YN, "f").blur(),
                rB(this, XN, "f").blur(),
                iB(this, ZN, i, "f"),
                iB(this, JN, r, "f"),
                rB(this, GN, "m", eB).call(this)
            }
            showNoButtons(e) {
                iB(this, jN, "no-buttons", "f"),
                rB(this, QN, "f").className = "message-box no-buttons",
                rB(this, QN, "f").showModal(),
                rB(this, qN, "f").textContent = e,
                rB(this, YN, "f").textContent = "",
                rB(this, XN, "f").textContent = "",
                rB(this, YN, "f").blur(),
                rB(this, XN, "f").blur(),
                iB(this, ZN, null, "f"),
                iB(this, JN, null, "f"),
                rB(this, GN, "m", eB).call(this)
            }
            hide() {
                iB(this, jN, null, "f"),
                rB(this, QN, "f").className = "hidden",
                rB(this, QN, "f").close(),
                rB(this, qN, "f").textContent = "",
                rB(this, YN, "f").textContent = "",
                rB(this, XN, "f").textContent = "",
                iB(this, ZN, null, "f"),
                iB(this, JN, null, "f"),
                rB(this, GN, "m", tB).call(this)
            }
        }
        ;
        var sB, oB, lB, cB, hB = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        }, dB = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        };
        sB = new WeakMap,
        oB = new WeakMap,
        lB = new WeakMap,
        cB = new WeakMap;
        const uB = class {
            constructor() {
                sB.set(this, 0),
                oB.set(this, 0),
                lB.set(this, []),
                cB.set(this, [])
            }
            hasLoaded() {
                return hB(this, oB, "f") == hB(this, sB, "f")
            }
            getProgress() {
                return hB(this, oB, "f") / hB(this, sB, "f")
            }
            addResource() {
                var e;
                dB(this, sB, (e = hB(this, sB, "f"),
                ++e), "f")
            }
            loadedResource() {
                var e;
                dB(this, oB, (e = hB(this, oB, "f"),
                ++e), "f");
                for (const e of hB(this, lB, "f"))
                    e(this.getProgress());
                if (this.hasLoaded())
                    for (const e of hB(this, cB, "f"))
                        e()
            }
            addProgressListener(e) {
                hB(this, lB, "f").push(e)
            }
            addCompleteListener(e) {
                hB(this, cB, "f").push(e)
            }
            preloadImage(e) {
                this.addResource();
                const t = new Image;
                t.addEventListener("load", ( () => {
                    this.loadedResource()
                }
                )),
                t.addEventListener("error", ( () => {
                    console.error("Failed to preload image: " + e)
                }
                )),
                t.src = e
            }
        }
        ;
        var pB, fB, mB, gB, vB, wB, yB, bB, AB = function(e, t, n, i) {
            return new (n || (n = Promise))((function(r, a) {
                function s(e) {
                    try {
                        l(i.next(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function o(e) {
                    try {
                        l(i.throw(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(e) {
                    var t;
                    e.done ? r(e.value) : (t = e.value,
                    t instanceof n ? t : new n((function(e) {
                        e(t)
                    }
                    ))).then(s, o)
                }
                l((i = i.apply(e, t || [])).next())
            }
            ))
        }, xB = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, kB = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        fB = new WeakMap,
        mB = new WeakMap,
        gB = new WeakMap,
        vB = new WeakMap,
        wB = new WeakMap,
        pB = new WeakSet,
        yB = function(e, t, n, i, r) {
            return AB(this, void 0, void 0, (function*() {
                var a, s;
                if (kB(this, mB, "f").determinismState != HT.Ok)
                    return null;
                const o = kB(this, gB, "f").getUserProfile(e);
                if (null == o)
                    return null;
                const l = e.toString() + "_" + t
                  , c = (null !== (a = kB(this, vB, "f").get(l)) && void 0 !== a ? a : 0) + 1;
                kB(this, vB, "f").set(l, c);
                const {uploadId: h, positionChange: d} = yield kB(this, mB, "f").submitLeaderboard(o.token, o.nickname, o.carColors, t, n, i, r);
                return kB(this, vB, "f").get(l) == c && (null === (s = kB(this, gB, "f").getUserProfile(e)) || void 0 === s ? void 0 : s.token) == o.token && kB(this, fB, "f").saveRecord(e, o.tokenHash, t, h, i, r, kB(this, mB, "f").determinismState),
                d
            }
            ))
        }
        ,
        bB = function(e, t, n) {
            return AB(this, void 0, void 0, (function*() {
                var i, r;
                if (kB(this, mB, "f").determinismState != HT.Ok)
                    return;
                const a = kB(this, gB, "f").getUserProfile(e);
                if (null == a)
                    return;
                const s = e.toString() + "_" + t
                  , o = (null !== (i = kB(this, vB, "f").get(s)) && void 0 !== i ? i : 0) + 1;
                kB(this, vB, "f").set(s, o);
                const l = yield kB(this, mB, "f").getRecordings([n]);
                if (l.length < 1 || null == l[0])
                    throw new Error("Record not found");
                const c = l[0];
                if (kB(this, vB, "f").get(s) == o && (null === (r = kB(this, gB, "f").getUserProfile(e)) || void 0 === r ? void 0 : r.token) == a.token) {
                    const i = this.getRecordTime(e, t);
                    if (null == i || c.time.lessThan(i)) {
                        kB(this, fB, "f").saveRecord(e, a.tokenHash, t, n, c.time, c.recording, kB(this, mB, "f").determinismState);
                        for (const e of kB(this, wB, "f"))
                            e()
                    }
                }
            }
            ))
        }
        ;
        const EB = class {
            constructor(e, t, n) {
                pB.add(this),
                fB.set(this, void 0),
                mB.set(this, void 0),
                gB.set(this, void 0),
                vB.set(this, new Map),
                wB.set(this, []),
                xB(this, fB, e, "f"),
                xB(this, mB, t, "f"),
                xB(this, gB, n, "f")
            }
            addRecordChangedCallback(e) {
                kB(this, wB, "f").push(e)
            }
            removeRecordChangedCallback(e) {
                const t = kB(this, wB, "f").indexOf(e);
                t >= 0 && kB(this, wB, "f").splice(t, 1)
            }
            setRecord(e, t, n, i, r) {
                return AB(this, void 0, void 0, (function*() {
                    const a = kB(this, gB, "f").getUserProfile(e);
                    if (null == a)
                        return null;
                    kB(this, fB, "f").saveRecord(e, a.tokenHash, t, null, i, r, kB(this, mB, "f").determinismState);
                    let s = null;
                    if (null != n)
                        s = yield kB(this, pB, "m", yB).call(this, e, t, n, i, r).catch((e => (console.warn(e),
                        null)));
                    for (const e of kB(this, wB, "f"))
                        e();
                    return s
                }
                ))
            }
            syncRecord(e, t, n) {
                return AB(this, void 0, void 0, (function*() {
                    if (kB(this, mB, "f").determinismState != HT.Ok)
                        return null;
                    const i = this.getRecord(e, t);
                    return null != i && (null == n || i.uploadId != n.recordingId && i.time.lessThan(n.time)) ? (yield kB(this, pB, "m", yB).call(this, e, t, null, i.time, i.recording),
                    "Upload") : null != n && (null == i || i.uploadId != n.recordingId && n.time.lessThan(i.time)) ? (yield kB(this, pB, "m", bB).call(this, e, t, n.recordingId),
                    "Download") : null
                }
                ))
            }
            getRecordTime(e, t) {
                const n = this.getRecord(e, t);
                return null == n ? null : n.time
            }
            getRecord(e, t) {
                const n = kB(this, gB, "f").getUserProfile(e);
                return null == n ? null : kB(this, fB, "f").loadRecord(e, n.tokenHash, t, kB(this, mB, "f").determinismState)
            }
        }
        ;
        var SB, MB, _B, TB, CB, PB, IB, RB, LB, DB, NB, BB = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, UB = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        MB = new WeakMap,
        _B = new WeakMap,
        TB = new WeakMap,
        CB = new WeakMap,
        PB = new WeakMap,
        SB = new WeakSet,
        IB = function(e, t) {
            return UB(this, SB, "m", LB).call(this, "tracks/official/" + e, t)
        }
        ,
        RB = function(e, t) {
            return UB(this, SB, "m", LB).call(this, "tracks/community/" + e, t)
        }
        ,
        LB = function(e, t) {
            return t.addResource(),
            new Promise((n => {
                const i = new XMLHttpRequest;
                i.overrideMimeType("text/plain"),
                i.onreadystatechange = () => {
                    if (4 == i.readyState && 200 == i.status) {
                        t.loadedResource();
                        const e = hx.fromExportString(i.responseText);
                        if (null == e)
                            throw new Error("Failed to load bundled track");
                        const {trackMetadata: r, trackData: a} = e;
                        n({
                            id: a.getId(),
                            trackMetadata: r,
                            trackData: a,
                            thumbnail: a.createThumbnail(),
                            saveTime: null
                        })
                    }
                }
                ,
                i.open("GET", e, !0),
                i.send()
            }
            ))
        }
        ,
        DB = function(e) {
            return new Promise((t => {
                setTimeout(( () => {
                    const n = UB(this, CB, "f").loadCustomTrack(e);
                    if (null != n) {
                        const {trackMetadata: e, trackData: i, saveTime: r} = n
                          , a = {
                            id: i.getId(),
                            trackMetadata: e,
                            trackData: i,
                            thumbnail: i.createThumbnail(),
                            saveTime: r
                        };
                        t(a)
                    } else
                        t(null)
                }
                ))
            }
            ))
        }
        ,
        NB = function() {
            for (const e of UB(this, PB, "f"))
                e()
        }
        ;
        const trackDirectoryLoader = function(e, t) {
            return new Promise((n => {
                const i = new XMLHttpRequest;
                i.overrideMimeType("text/plain"),
                i.onreadystatechange = () => {
                    if (i.readyState == XMLHttpRequest.DONE) {
                        if (200 == i.status) {
                            const r = /href="([^"]+\.track)"/gi
                              , a = new Set
                              , s = [];
                            let o;
                            for (; null !== (o = r.exec(i.responseText)); ) {
                                const e = o[1].split("/").pop();
                                if (!e)
                                    continue;
                                const t = decodeURIComponent(e);
                                a.has(t) || (a.add(t),
                                s.push(t))
                            }
                            if (s.length > 0)
                                return s.sort(),
                                void n(s)
                        }
                        n(t.slice())
                    }
                }
                ;
                try {
                    i.open("GET", e, !0),
                    i.send()
                } catch (r) {
                    n(t.slice())
                }
            }
            ))
        }
          , officialTrackFallbacks = ["desert1.track", "desert2.track", "desert3.track", "desert4.track", "summer1.track", "summer2.track", "summer3.track", "summer4.track", "summer5.track", "summer6.track", "summer7.track", "winter1.track", "winter2.track", "winter3.track", "winter4.track"]
          , communityTrackFallbacks = ["90_reset.track", "Nurenburgring_GP.track", "alpine_descent.track", "anubis.track", "arabica.track", "asguardia.track", "clay_temples.track", "cogware.track", "concrete_jungle.track", "desert_stallion.track", "flying_dreams.track", "fractured_shore.track", "frozen_in_time.track", "ghost_city.track", "hyperions_sanctuary.track", "japan.track", "joenail_jones.track", "land_of_the_rising_sun.track", "las_calles.track", "last_remnant.track", "launch_control.track", "lu_muvimento.track", "malformations.track", "midas_metropolis.track", "mos_espa.track", "natsujo.track", "natures_sanctuary.track", "opal_place_ii.track", "oxygen_not_included.track", "pavlova_dip.track", "re_akina.track", "sandline_ultimatum.track", "shrouded_oasis.track", "snow_park.track", "starry_tropics.track", "winter_hollow.track", "winterfell.track", "zealot.track"];
        const zB = class {
            constructor(e, t) {
                SB.add(this),
                MB.set(this, []),
                _B.set(this, []),
                TB.set(this, []),
                CB.set(this, void 0),
                PB.set(this, []),
                BB(this, CB, t, "f");
                trackDirectoryLoader("tracks/official/", officialTrackFallbacks).then((t => Promise.all(t.map((t => UB(this, SB, "m", IB).call(this, t, e)))))).then((e => {
                    BB(this, MB, e, "f")
                }
                )).catch((e => {
                    console.error(e)
                }
                ));
                trackDirectoryLoader("tracks/community/", communityTrackFallbacks).then((t => Promise.all(t.map((t => UB(this, SB, "m", RB).call(this, t, e)))))).then((e => {
                    BB(this, _B, e, "f")
                }
                )).catch((e => {
                    console.error(e)
                }
                ));
                const n = UB(this, CB, "f").getAllCustomTrackNames();
                if (null != n) {
                    const e = [];
                    for (const t of n)
                        e.push(UB(this, SB, "m", DB).call(this, t));
                    Promise.all(e).then((e => {
                        BB(this, TB, e.filter((e => null != e)).sort(( (e, t) => {
                            var n, i;
                            return (null !== (n = t.saveTime) && void 0 !== n ? n : -1 / 0) - (null !== (i = e.saveTime) && void 0 !== i ? i : -1 / 0)
                        }
                        )), "f")
                    }
                    )).catch((e => {
                        console.error(e)
                    }
                    ))
                }
            }
            saveCustomTrack(e, t) {
                const n = new Date;
                if (UB(this, CB, "f").saveCustomTrack(e, t, n)) {
                    const i = {
                        id: t.getId(),
                        trackMetadata: e,
                        trackData: t,
                        thumbnail: t.createThumbnail(),
                        saveTime: n.getTime()
                    }
                      , r = UB(this, TB, "f").findIndex((t => t.trackMetadata.name == e.name));
                    return r >= 0 ? UB(this, TB, "f")[r] = i : UB(this, TB, "f").unshift(i),
                    UB(this, SB, "m", NB).call(this),
                    !0
                }
                return !1
            }
            deleteCustomTrack(e) {
                if (UB(this, CB, "f").deleteCustomTrack(e)) {
                    const t = UB(this, TB, "f").findIndex((t => t.trackMetadata.name == e));
                    if (t >= 0) {
                        const e = UB(this, TB, "f")[t];
                        UB(this, CB, "f").deleteAllRecordsForTrack(e.id),
                        UB(this, TB, "f").splice(t, 1)
                    }
                    return UB(this, SB, "m", NB).call(this),
                    !0
                }
                return !1
            }
            checkCustomTrackNameExists(e) {
                return UB(this, TB, "f").some((t => t.trackMetadata.name == e))
            }
            addCustomTracksChangedListener(e) {
                UB(this, PB, "f").push(e)
            }
            removeCustomTracksChangedListener(e) {
                const t = UB(this, PB, "f").indexOf(e);
                t >= 0 && UB(this, PB, "f").splice(t, 1)
            }
            isCommunityTracksEmpty() {
                return 0 == UB(this, _B, "f").length
            }
            isCustomTracksEmpty() {
                return 0 == UB(this, TB, "f").length
            }
            forEachTrack(e) {
                this.forEachOfficialTrack(e),
                this.forEachCommunityTrack(e),
                this.forEachCustomTrack(e)
            }
            forEachOfficialTrack(e) {
                for (const t of UB(this, MB, "f"))
                    e(t.id, t.trackMetadata, t.trackData, t.thumbnail)
            }
            forEachCommunityTrack(e) {
                for (const t of UB(this, _B, "f"))
                    e(t.id, t.trackMetadata, t.trackData, t.thumbnail)
            }
            forEachCustomTrack(e) {
                for (const t of UB(this, TB, "f"))
                    e(t.id, t.trackMetadata, t.trackData, t.thumbnail)
            }
            getRandomOfficialTrackData() {
                return UB(this, MB, "f")[Math.floor(Math.random() * UB(this, MB, "f").length)].trackData
            }
            getTrackByName(e) {
                const t = UB(this, MB, "f").find((t => t.trackMetadata.name == e));
                if (null != t)
                    return {
                        id: t.id,
                        trackMetadata: t.trackMetadata,
                        trackData: t.trackData,
                        trackCategory: "official"
                    };
                const n = UB(this, _B, "f").find((t => t.trackMetadata.name == e));
                if (null != n)
                    return {
                        id: n.id,
                        trackMetadata: n.trackMetadata,
                        trackData: n.trackData,
                        trackCategory: "community"
                    };
                const i = UB(this, TB, "f").find((t => t.trackMetadata.name == e));
                return null != i ? {
                    id: i.id,
                    trackMetadata: i.trackMetadata,
                    trackData: i.trackData,
                    trackCategory: "custom"
                } : null
            }
            isOfficialTrack(e) {
                return UB(this, MB, "f").some((t => t.id == e))
            }
            isCommunityTrack(e) {
                return UB(this, _B, "f").some((t => t.id == e))
            }
        }
          , OB = new WeakMap;
        class FB extends po {
            constructor(e) {
                super(e),
                this.decoderPath = "",
                this.decoderConfig = {},
                this.decoderBinary = null,
                this.decoderPending = null,
                this.workerLimit = 4,
                this.workerPool = [],
                this.workerNextTaskID = 1,
                this.workerSourceURL = "",
                this.defaultAttributeIDs = {
                    position: "POSITION",
                    normal: "NORMAL",
                    color: "COLOR",
                    uv: "TEX_COORD"
                },
                this.defaultAttributeTypes = {
                    position: "Float32Array",
                    normal: "Float32Array",
                    color: "Float32Array",
                    uv: "Float32Array"
                }
            }
            setDecoderPath(e) {
                return this.decoderPath = e,
                this
            }
            setDecoderConfig(e) {
                return this.decoderConfig = e,
                this
            }
            setWorkerLimit(e) {
                return this.workerLimit = e,
                this
            }
            load(e, t, n, i) {
                const r = new go(this.manager);
                r.setPath(this.path),
                r.setResponseType("arraybuffer"),
                r.setRequestHeader(this.requestHeader),
                r.setWithCredentials(this.withCredentials),
                r.load(e, (e => {
                    this.parse(e, t, i)
                }
                ), n, i)
            }
            parse(e, t, n= () => {}
            ) {
                this.decodeDracoFile(e, t, null, null, vt, n).catch(n)
            }
            decodeDracoFile(e, t, n, i, r=wt, a= () => {}
            ) {
                const s = {
                    attributeIDs: n || this.defaultAttributeIDs,
                    attributeTypes: i || this.defaultAttributeTypes,
                    useUniqueIDs: !!n,
                    vertexColorSpace: r
                };
                return this.decodeGeometry(e, s).then(t).catch(a)
            }
            decodeGeometry(e, t) {
                const n = JSON.stringify(t);
                if (OB.has(e)) {
                    const t = OB.get(e);
                    if (t.key === n)
                        return t.promise;
                    if (0 === e.byteLength)
                        throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")
                }
                let i;
                const r = this.workerNextTaskID++
                  , a = e.byteLength
                  , s = this._getWorker(r, a).then((n => (i = n,
                new Promise(( (n, a) => {
                    i._callbacks[r] = {
                        resolve: n,
                        reject: a
                    },
                    i.postMessage({
                        type: "decode",
                        id: r,
                        taskConfig: t,
                        buffer: e
                    }, [e])
                }
                ))))).then((e => this._createGeometry(e.geometry)));
                return s.catch(( () => !0)).then(( () => {
                    i && r && this._releaseTask(i, r)
                }
                )),
                OB.set(e, {
                    key: n,
                    promise: s
                }),
                s
            }
            _createGeometry(e) {
                const t = new or;
                e.index && t.setIndex(new Xi(e.index.array,1));
                for (let n = 0; n < e.attributes.length; n++) {
                    const i = e.attributes[n]
                      , r = i.name
                      , a = i.array
                      , s = i.itemSize
                      , o = new Xi(a,s);
                    "color" === r && (this._assignVertexColorSpace(o, i.vertexColorSpace),
                    o.normalized = a instanceof Float32Array == !1),
                    t.setAttribute(r, o)
                }
                return t
            }
            _assignVertexColorSpace(e, t) {
                if (t !== vt)
                    return;
                const n = new Hi;
                for (let t = 0, i = e.count; t < i; t++)
                    n.fromBufferAttribute(e, t),
                    rn.toWorkingColorSpace(n, vt),
                    e.setXYZ(t, n.r, n.g, n.b)
            }
            _loadLibrary(e, t) {
                const n = new go(this.manager);
                return n.setPath(this.decoderPath),
                n.setResponseType(t),
                n.setWithCredentials(this.withCredentials),
                new Promise(( (t, i) => {
                    n.load(e, t, void 0, i)
                }
                ))
            }
            preload() {
                return this._initDecoder(),
                this
            }
            _initDecoder() {
                if (this.decoderPending)
                    return this.decoderPending;
                const e = "object" != typeof WebAssembly || "js" === this.decoderConfig.type
                  , t = [];
                return e ? t.push(this._loadLibrary("draco_decoder.js", "text")) : (t.push(this._loadLibrary("draco_wasm_wrapper.js", "text")),
                t.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))),
                this.decoderPending = Promise.all(t).then((t => {
                    const n = t[0];
                    e || (this.decoderConfig.wasmBinary = t[1]);
                    const i = WB.toString()
                      , r = ["/* draco decoder */", n, "", "/* worker */", i.substring(i.indexOf("{") + 1, i.lastIndexOf("}"))].join("\n");
                    this.workerSourceURL = URL.createObjectURL(new Blob([r]))
                }
                )),
                this.decoderPending
            }
            _getWorker(e, t) {
                return this._initDecoder().then(( () => {
                    if (this.workerPool.length < this.workerLimit) {
                        const e = new Worker(this.workerSourceURL);
                        e._callbacks = {},
                        e._taskCosts = {},
                        e._taskLoad = 0,
                        e.postMessage({
                            type: "init",
                            decoderConfig: this.decoderConfig
                        }),
                        e.onmessage = function(t) {
                            const n = t.data;
                            switch (n.type) {
                            case "decode":
                                e._callbacks[n.id].resolve(n);
                                break;
                            case "error":
                                e._callbacks[n.id].reject(n);
                                break;
                            default:
                                console.error('THREE.DRACOLoader: Unexpected message, "' + n.type + '"')
                            }
                        }
                        ,
                        this.workerPool.push(e)
                    } else
                        this.workerPool.sort((function(e, t) {
                            return e._taskLoad > t._taskLoad ? -1 : 1
                        }
                        ));
                    const n = this.workerPool[this.workerPool.length - 1];
                    return n._taskCosts[e] = t,
                    n._taskLoad += t,
                    n
                }
                ))
            }
            _releaseTask(e, t) {
                e._taskLoad -= e._taskCosts[t],
                delete e._callbacks[t],
                delete e._taskCosts[t]
            }
            debug() {
                console.log("Task load: ", this.workerPool.map((e => e._taskLoad)))
            }
            dispose() {
                for (let e = 0; e < this.workerPool.length; ++e)
                    this.workerPool[e].terminate();
                return this.workerPool.length = 0,
                "" !== this.workerSourceURL && URL.revokeObjectURL(this.workerSourceURL),
                this
            }
        }
        function WB() {
            let e, t;
            function n(e, t, n, i, r, a) {
                const s = a.num_components()
                  , o = n.num_points() * s
                  , l = o * r.BYTES_PER_ELEMENT
                  , c = function(e, t) {
                    switch (t) {
                    case Float32Array:
                        return e.DT_FLOAT32;
                    case Int8Array:
                        return e.DT_INT8;
                    case Int16Array:
                        return e.DT_INT16;
                    case Int32Array:
                        return e.DT_INT32;
                    case Uint8Array:
                        return e.DT_UINT8;
                    case Uint16Array:
                        return e.DT_UINT16;
                    case Uint32Array:
                        return e.DT_UINT32
                    }
                }(e, r)
                  , h = e._malloc(l);
                t.GetAttributeDataArrayForAllPoints(n, a, c, l, h);
                const d = new r(e.HEAPF32.buffer,h,o).slice();
                return e._free(h),
                {
                    name: i,
                    array: d,
                    itemSize: s
                }
            }
            onmessage = function(i) {
                const r = i.data;
                switch (r.type) {
                case "init":
                    e = r.decoderConfig,
                    t = new Promise((function(t) {
                        e.onModuleLoaded = function(e) {
                            t({
                                draco: e
                            })
                        }
                        ,
                        DracoDecoderModule(e)
                    }
                    ));
                    break;
                case "decode":
                    const i = r.buffer
                      , a = r.taskConfig;
                    t.then((e => {
                        const t = e.draco
                          , s = new t.Decoder;
                        try {
                            const e = function(e, t, i, r) {
                                const a = r.attributeIDs
                                  , s = r.attributeTypes;
                                let o, l;
                                const c = t.GetEncodedGeometryType(i);
                                if (c === e.TRIANGULAR_MESH)
                                    o = new e.Mesh,
                                    l = t.DecodeArrayToMesh(i, i.byteLength, o);
                                else {
                                    if (c !== e.POINT_CLOUD)
                                        throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
                                    o = new e.PointCloud,
                                    l = t.DecodeArrayToPointCloud(i, i.byteLength, o)
                                }
                                if (!l.ok() || 0 === o.ptr)
                                    throw new Error("THREE.DRACOLoader: Decoding failed: " + l.error_msg());
                                const h = {
                                    index: null,
                                    attributes: []
                                };
                                for (const i in a) {
                                    const l = self[s[i]];
                                    let c, d;
                                    if (r.useUniqueIDs)
                                        d = a[i],
                                        c = t.GetAttributeByUniqueId(o, d);
                                    else {
                                        if (d = t.GetAttributeId(o, e[a[i]]),
                                        -1 === d)
                                            continue;
                                        c = t.GetAttribute(o, d)
                                    }
                                    const u = n(e, t, o, i, l, c);
                                    "color" === i && (u.vertexColorSpace = r.vertexColorSpace),
                                    h.attributes.push(u)
                                }
                                c === e.TRIANGULAR_MESH && (h.index = function(e, t, n) {
                                    const i = n.num_faces()
                                      , r = 3 * i
                                      , a = 4 * r
                                      , s = e._malloc(a);
                                    t.GetTrianglesUInt32Array(n, a, s);
                                    const o = new Uint32Array(e.HEAPF32.buffer,s,r).slice();
                                    return e._free(s),
                                    {
                                        array: o,
                                        itemSize: 1
                                    }
                                }(e, t, o));
                                return e.destroy(o),
                                h
                            }(t, s, new Int8Array(i), a)
                              , o = e.attributes.map((e => e.array.buffer));
                            e.index && o.push(e.index.array.buffer),
                            self.postMessage({
                                type: "decode",
                                id: r.id,
                                geometry: e
                            }, o)
                        } catch (e) {
                            console.error(e),
                            self.postMessage({
                                type: "error",
                                id: r.id,
                                error: e.message
                            })
                        } finally {
                            t.destroy(s)
                        }
                    }
                    ))
                }
            }
        }
        var HB, VB, GB, jB, QB, KB = function(e, t, n, i) {
            return new (n || (n = Promise))((function(r, a) {
                function s(e) {
                    try {
                        l(i.next(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function o(e) {
                    try {
                        l(i.throw(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(e) {
                    var t;
                    e.done ? r(e.value) : (t = e.value,
                    t instanceof n ? t : new n((function(e) {
                        e(t)
                    }
                    ))).then(s, o)
                }
                l((i = i.apply(e, t || [])).next())
            }
            ))
        }, qB = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class YB {
            constructor() {
                HB.add(this),
                VB.set(this, new Map),
                GB.set(this, new Map)
            }
            init(e, t) {
                return KB(this, void 0, void 0, (function*() {
                    const n = new Al
                      , i = new FB;
                    i.setDecoderPath("lib/draco/"),
                    n.setDRACOLoader(i);
                    const r = (a = ["models/blocks.glb", "models/pillar.glb", "models/planes.glb", "models/road.glb", "models/road_wide.glb", "models/signs.glb", "models/wall_track.glb"],
                    Promise.all(a.map((e => {
                        return t = e,
                        new Promise((e => {
                            n.load(t, (t => {
                                e(t)
                            }
                            ))
                        }
                        ));
                        var t
                    }
                    ))));
                    var a;
                    const s = new Ws({
                        vertexColors: !0
                    });
                    e.addMaterial(s);
                    const o = e => KB(this, void 0, void 0, (function*() {
                        var n, i, a;
                        if (t.addResource(),
                        qB(this, VB, "f").has(e.id))
                            throw new Error("Track part types have same Id");
                        const o = {
                            configuration: e,
                            colors: new Map(e.colors.map(( ({id: e}) => [e, null]))),
                            physicsShapeVertices: null
                        };
                        qB(this, VB, "f").set(e.id, o);
                        const l = yield r;
                        function c(e, t, n, i, r, a) {
                            const s = l.find((t => t.scene.name == e));
                            if (null == s)
                                throw new Error('Scene "' + e + '" does not exist');
                            const o = s.scene.getObjectByName(t);
                            if (null == o)
                                throw new Error('Mesh "' + t + '" does not exist in scene "' + e + '"');
                            let c;
                            if (0 == o.children.length) {
                                const e = o
                                  , t = h(e, a);
                                e.updateMatrixWorld(!0),
                                t.applyMatrix4(e.matrix),
                                c = [t]
                            } else {
                                c = o.children.map((e => h(e, a))),
                                o.updateMatrixWorld(!0);
                                for (const e of c)
                                    e.applyMatrix4(o.matrix)
                            }
                            let d = -1 / 0;
                            if (i)
                                for (const e of c)
                                    for (let t = 0; t < e.attributes.position.array.length; t += 3)
                                        d = Math.max(d, e.attributes.position.array[t + 1]);
                            for (const e of c) {
                                if (e.applyMatrix4((new Xn).makeScale(n ? -1 : 1, i ? -1 : 1, r ? -1 : 1)),
                                n || i || r) {
                                    const t = e.index;
                                    if (null != t)
                                        for (let e = 0; e < t.count; e += 3) {
                                            const n = t.getX(e)
                                              , i = t.getX(e + 1)
                                              , r = t.getX(e + 2);
                                            t.setXYZ(e, n, r, i)
                                        }
                                    else {
                                        const t = e.attributes.position;
                                        for (let e = 0; e < t.count; e += 3) {
                                            const n = e
                                              , i = e + 1
                                              , r = e + 2
                                              , a = t.getX(n)
                                              , s = t.getY(n)
                                              , o = t.getZ(n)
                                              , l = t.getX(i)
                                              , c = t.getY(i)
                                              , h = t.getZ(i)
                                              , d = t.getX(r)
                                              , u = t.getY(r)
                                              , p = t.getZ(r);
                                            t.setXYZ(n, a, s, o),
                                            t.setXYZ(i, d, u, p),
                                            t.setXYZ(r, l, c, h)
                                        }
                                    }
                                }
                                i && e.translate(0, d, 0)
                            }
                            return c
                        }
                        function h(e, t) {
                            const n = e.material;
                            if (!(n instanceof Os))
                                throw new Error("Material is not a MeshStandardMaterial");
                            let i, r, a;
                            if (Object.prototype.hasOwnProperty.call(t, n.name)) {
                                const e = new Hi(t[n.name]);
                                i = e.r,
                                r = e.g,
                                a = e.b
                            } else
                                i = n.color.r,
                                r = n.color.g,
                                a = n.color.b;
                            const s = e.geometry.clone()
                              , o = new Float32Array(s.attributes.position.array.length);
                            for (let e = 0; e < o.length; e += 3)
                                o[e + 0] = i,
                                o[e + 1] = r,
                                o[e + 2] = a;
                            return s.attributes.color = new Xi(o,3),
                            s
                        }
                        let d = null;
                        for (const t of e.colors) {
                            const r = [];
                            for (const [s,o,l] of e.models) {
                                const e = c(s, o, null !== (n = null == l ? void 0 : l.flipX) && void 0 !== n && n, null !== (i = null == l ? void 0 : l.flipY) && void 0 !== i && i, null !== (a = null == l ? void 0 : l.flipZ) && void 0 !== a && a, t.colors);
                                for (const t of e)
                                    r.push(t)
                            }
                            const l = vl(r, !0).toNonIndexed();
                            l.computeVertexNormals();
                            const h = yl(l)
                              , u = new yr(h,s);
                            o.colors.set(t.id, u),
                            null != d || (d = l)
                        }
                        if (null == d)
                            throw new Error("Physics geometry is missing");
                        if (!(d.attributes.position instanceof Xi))
                            throw new Error("Vertices must use BufferAttribute");
                        o.physicsShapeVertices = new Float32Array(d.attributes.position.array),
                        t.loadedResource()
                    }
                    ))
                      , l = yield Promise.all(GA.map((e => o(e)))).then(( () => KB(this, void 0, void 0, (function*() {
                        return yield qB(this, HB, "m", QB).call(this)
                    }
                    ))))
                      , c = (e, t, n=null) => {
                        let i = qB(this, GB, "f").get(e);
                        null == i && (i = new Map,
                        qB(this, GB, "f").set(e, i)),
                        null == n && (n = (e, t) => e.x == t.x && e.y == t.y && e.z == t.z && e.rotation == t.rotation && e.rotationAxis == t.rotationAxis),
                        i.set(t, n)
                    }
                    ;
                    c(Mb.BlockSlopeUp, Mb.SlopeUp),
                    c(Mb.BlockSlopeUp, Mb.SlopeUpLeftWide),
                    c(Mb.BlockSlopeUp, Mb.SlopeUpRightWide),
                    c(Mb.BlockSlopeUp, Mb.PlaneSlopeUp),
                    c(Mb.BlockSlopedUp, Mb.Slope),
                    c(Mb.BlockSlopedUp, Mb.SlopeLeftWide),
                    c(Mb.BlockSlopedUp, Mb.SlopeRightWide),
                    c(Mb.BlockSlopedUp, Mb.PlaneSlope),
                    c(Mb.BlockSlopeDown, Mb.SlopeDown),
                    c(Mb.BlockSlopeDown, Mb.SlopeDownLeftWide),
                    c(Mb.BlockSlopeDown, Mb.SlopeDownRightWide),
                    c(Mb.BlockSlopeDown, Mb.PlaneSlopeDown),
                    c(Mb.BlockSlopeDownLong, Mb.SlopeDownLong),
                    c(Mb.BlockSlopeDownLong, Mb.SlopeDownLongLeftWide),
                    c(Mb.BlockSlopeDownLong, Mb.SlopeDownLongRightWide),
                    c(Mb.BlockSlopeDownLong, Mb.PlaneSlopeDownLong),
                    c(Mb.BlockSlopeUpLong, Mb.SlopeUpLong),
                    c(Mb.BlockSlopeUpLong, Mb.SlopeUpLongLeftWide),
                    c(Mb.BlockSlopeUpLong, Mb.SlopeUpLongRightWide),
                    c(Mb.BlockSlopeUpLong, Mb.PlaneSlopeUpLong),
                    c(Mb.BlockSlopeVerticalTop, Mb.WallTrackTop),
                    c(Mb.BlockSlopeVerticalInnerCornerTop, Mb.WallTrackTopInnerCorner),
                    c(Mb.BlockSlopeVerticalInnerCornerBottom, Mb.WallTrackBottomInnerCorner),
                    c(Mb.BlockInnerCorner, Mb.WallTrackMiddleCorner);
                    const h = (e, t) => e.x == t.x && e.y == t.y && e.z == t.z && e.rotation == t.rotation && e.rotationAxis == t.rotationAxis || e.x == t.x && e.y == t.y + 3 && e.z == t.z && e.rotation == t.rotation && (e.rotationAxis == Tb.YPositive && t.rotationAxis == Tb.YNegative || e.rotationAxis == Tb.YNegative && t.rotationAxis == Tb.YPositive || e.rotationAxis == Tb.XPositive && t.rotationAxis == Tb.XNegative || e.rotationAxis == Tb.XNegative && t.rotationAxis == Tb.XPositive || e.rotationAxis == Tb.ZPositive && t.rotationAxis == Tb.ZNegative || e.rotationAxis == Tb.ZNegative && t.rotationAxis == Tb.ZPositive);
                    return c(Mb.BlockSlopeVerticalBottom, Mb.PlaneSlopeVerticalBottom, h),
                    c(Mb.BlockSlopeVerticalBottom, Mb.WallTrackBottom, h),
                    c(Mb.BlockSlopeVerticalBottom, Mb.SlopeUpVertical, h),
                    c(Mb.BlockSlopeVerticalBottom, Mb.SlopeUpVerticalLeftWide, h),
                    c(Mb.BlockSlopeVerticalBottom, Mb.SlopeUpVerticalRightWide, h),
                    c(Mb.BlockSlopeVerticalCornerBottom, Mb.WallTrackBottomCorner),
                    c(Mb.BlockSlopeVerticalCornerTop, Mb.WallTrackTopCorner),
                    c(Mb.BlockSlopeToVertical, Mb.PlaneSlopeToVertical),
                    c(Mb.BlockSlopeToVertical, Mb.WallTrackSlopeToVertical),
                    c(Mb.HalfBlock, Mb.HalfBlock, ( (e, t) => e.rotation == (t.rotation + 2) % 4 && e.x == t.x && e.y == t.y && e.z == t.z && e.rotationAxis == t.rotationAxis)),
                    c(Mb.HalfBlock, Mb.HalfPlane, ( (e, t) => e.rotation == (t.rotation + 2) % 4 && e.x == t.x && e.y == t.y && e.z == t.z && e.rotationAxis == t.rotationAxis)),
                    c(Mb.HalfBlock, Mb.QuarterBlock, ( (e, t) => e.rotation != t.rotation && (e.rotation + 1) % 4 != t.rotation && e.x == t.x && e.y == t.y && e.z == t.z && e.rotationAxis == t.rotationAxis)),
                    c(Mb.HalfBlock, Mb.QuarterPlane, ( (e, t) => e.rotation != t.rotation && (e.rotation + 1) % 4 != t.rotation && e.x == t.x && e.y == t.y && e.z == t.z && e.rotationAxis == t.rotationAxis)),
                    c(Mb.QuarterBlock, Mb.QuarterBlock, ( (e, t) => e.rotation != t.rotation && e.x == t.x && e.y == t.y && e.z == t.z && e.rotationAxis == t.rotationAxis)),
                    c(Mb.QuarterBlock, Mb.HalfPlane, ( (e, t) => e.rotation != t.rotation && e.rotation != (t.rotation + 1) % 4 && e.x == t.x && e.y == t.y && e.z == t.z && e.rotationAxis == t.rotationAxis)),
                    c(Mb.QuarterBlock, Mb.QuarterPlane, ( (e, t) => e.rotation != t.rotation && e.x == t.x && e.y == t.y && e.z == t.z && e.rotationAxis == t.rotationAxis)),
                    c(Mb.HalfPlane, Mb.HalfPlane, ( (e, t) => e.rotation == (t.rotation + 2) % 4 && e.x == t.x && e.y == t.y && e.z == t.z && e.rotationAxis == t.rotationAxis)),
                    c(Mb.HalfPlane, Mb.QuarterPlane, ( (e, t) => e.rotation != t.rotation && (e.rotation + 1) % 4 != t.rotation && e.x == t.x && e.y == t.y && e.z == t.z && e.rotationAxis == t.rotationAxis)),
                    c(Mb.QuarterPlane, Mb.QuarterPlane, ( (e, t) => e.rotation != t.rotation && e.x == t.x && e.y == t.y && e.z == t.z && e.rotationAxis == t.rotationAxis)),
                    c(Mb.WallTrackTopInnerCorner, Mb.WallTrackCeilingCorner, ( (e, t) => {
                        let n;
                        switch (e.rotationAxis) {
                        case Tb.YPositive:
                            n = new bn(0,1,0);
                            break;
                        case Tb.YNegative:
                            n = new bn(0,-1,0);
                            break;
                        case Tb.XPositive:
                            n = new bn(1,0,0);
                            break;
                        case Tb.XNegative:
                            n = new bn(-1,0,0);
                            break;
                        case Tb.ZPositive:
                            n = new bn(0,0,1);
                            break;
                        case Tb.ZNegative:
                            n = new bn(0,0,-1);
                            break;
                        default:
                            throw new Error("Invalid rotation axis")
                        }
                        return e.rotation == t.rotation && e.x + 3 * n.x == t.x && e.y + 3 * n.y == t.y && e.z + 3 * n.z == t.z && e.rotationAxis == t.rotationAxis
                    }
                    )),
                    c(Mb.WallTrackTopInnerCorner, Mb.WallTrackCeilingPlaneCorner, ( (e, t) => {
                        let n;
                        switch (e.rotationAxis) {
                        case Tb.YPositive:
                            n = new bn(0,1,0);
                            break;
                        case Tb.YNegative:
                            n = new bn(0,-1,0);
                            break;
                        case Tb.XPositive:
                            n = new bn(1,0,0);
                            break;
                        case Tb.XNegative:
                            n = new bn(-1,0,0);
                            break;
                        case Tb.ZPositive:
                            n = new bn(0,0,1);
                            break;
                        case Tb.ZNegative:
                            n = new bn(0,0,-1);
                            break;
                        default:
                            throw new Error("Invalid rotation axis")
                        }
                        return e.rotation == t.rotation && e.x + 3 * n.x == t.x && e.y + 3 * n.y == t.y && e.z + 3 * n.z == t.z && e.rotationAxis == t.rotationAxis
                    }
                    )),
                    c(Mb.WallTrackBottomInnerCorner, Mb.WallTrackFloorCorner),
                    c(Mb.WallTrackBottomInnerCorner, Mb.WallTrackFloorPlaneCorner),
                    l
                }
                ))
            }
            isPartCombinationAllowed(e, t) {
                const n = qB(this, HB, "m", jB).call(this, e.id, t.id);
                if (null == n ? void 0 : n(e, t))
                    return !0;
                const i = qB(this, HB, "m", jB).call(this, t.id, e.id);
                return !!(null == i ? void 0 : i(t, e))
            }
            getPhysicsParts() {
                var e, t;
                const n = [];
                for (const {configuration: i, physicsShapeVertices: r} of qB(this, VB, "f").values()) {
                    if (null == r)
                        throw new Error("Part model has not been loaded yet");
                    n.push({
                        id: i.id,
                        vertices: r,
                        detector: i.detector,
                        startOffset: null !== (t = null === (e = i.startOffset) || void 0 === e ? void 0 : e.toArray()) && void 0 !== t ? t : null
                    })
                }
                return n
            }
            hasPart(e) {
                return qB(this, VB, "f").has(e)
            }
            getPart(e) {
                const t = qB(this, VB, "f").get(e);
                if (null == t)
                    throw new Error('Track part with the id "' + e.toString() + '" does not exist');
                return t
            }
            getAllParts() {
                return Array.from(qB(this, VB, "f").values())
            }
            getPartStartOffset(e) {
                var t, n;
                const i = qB(this, VB, "f").get(e);
                if (null == i)
                    throw new Error('Track part with the id "' + e.toString() + '" does not exist');
                return null !== (n = null === (t = i.configuration.startOffset) || void 0 === t ? void 0 : t.clone()) && void 0 !== n ? n : null
            }
            getPartTypesWithDetector(e) {
                const t = [];
                for (const [n,i] of qB(this, VB, "f").entries())
                    null != i.configuration.detector && i.configuration.detector.type == e && t.push(n);
                return t
            }
            getStartPartTypes() {
                const e = [];
                for (const [t,n] of qB(this, VB, "f").entries())
                    null != n.configuration.startOffset && e.push(t);
                return e
            }
            getCategoryMesh(e, t) {
                let n, i;
                switch (e) {
                case LA.Special:
                    n = this.getPart(Mb.Start);
                    break;
                case LA.Road:
                    n = this.getPart(Mb.Straight);
                    break;
                case LA.RoadTurns:
                    n = this.getPart(Mb.TurnShort);
                    break;
                case LA.RoadWide:
                    n = this.getPart(Mb.OuterCornerWide);
                    break;
                case LA.Plane:
                    n = this.getPart(Mb.Plane);
                    break;
                case LA.Block:
                    n = this.getPart(Mb.Block);
                    break;
                case LA.WallTrack:
                    n = this.getPart(Mb.WallTrackBottom);
                    break;
                case LA.Pillar:
                    n = this.getPart(Mb.PillarShort);
                    break;
                case LA.Sign:
                    n = this.getPart(Mb.SignArrowLeft)
                }
                switch (t) {
                case IA.Summer:
                    i = Eb.Summer;
                    break;
                case IA.Winter:
                    i = Eb.Winter;
                    break;
                case IA.Desert:
                    i = Eb.Desert
                }
                const r = n.colors.get(i);
                if (null == r)
                    throw new Error("Category mesh is not loaded");
                return r
            }
        }
        VB = new WeakMap,
        GB = new WeakMap,
        HB = new WeakSet,
        jB = function(e, t) {
            var n;
            const i = qB(this, GB, "f").get(e);
            return null == i ? null : null !== (n = i.get(t)) && void 0 !== n ? n : null
        }
        ,
        QB = function() {
            return KB(this, void 0, void 0, (function*() {
                const e = Object.values(Mb).filter((e => "string" != typeof e));
                let t = !0;
                for (const n of e) {
                    const e = qB(this, VB, "f").get(n);
                    if (null == e)
                        throw new Error("Part with id " + n.toString() + " does not exist");
                    const i = e.physicsShapeVertices;
                    if (null == i)
                        throw new Error("Part model with id " + n.toString() + " has not been loaded yet");
                    const r = yield window.crypto.subtle.digest("SHA-256", i)
                      , a = Array.from(new Uint8Array(r)).map((e => e.toString(16).padStart(2, "0"))).join("");
                    a != e.configuration.checksum && (console.error("Part id " + n.toString() + " " + Mb[n] + " checksum mismatch: " + a + " != " + e.configuration.checksum),
                    t = !1)
                }
                return t
            }
            ))
        }
        ;
        var XB = i(9207)
          , ZB = {};
        ZB.styleTagTransform = u(),
        ZB.setAttributes = l(),
        ZB.insert = s().bind(null, "head"),
        ZB.domAPI = r(),
        ZB.insertStyleElement = h();
        t()(XB.A, ZB);
        XB.A && XB.A.locals && XB.A.locals;
        var JB, $B, eU = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        }, tU = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        };
        JB = new WeakMap,
        $B = new WeakMap;
        const nU = class {
            constructor() {
                JB.set(this, document.getElementById("transition-layer")),
                $B.set(this, null)
            }
            trigger(e) {
                const t = eU(this, JB, "f");
                if (null == t)
                    throw new Error("Failed to find transition layer");
                null == eU(this, $B, "f") && (t.style.opacity = "1",
                setTimeout(( () => {
                    if (null != eU(this, $B, "f")) {
                        const e = eU(this, $B, "f").call(this);
                        null == e ? (t.style.opacity = "0",
                        tU(this, $B, null, "f")) : e.finally(( () => {
                            t.style.opacity = "0",
                            tU(this, $B, null, "f")
                        }
                        ))
                    }
                }
                ), 250)),
                tU(this, $B, e, "f")
            }
        }
        ;
        var iU, rU, aU, sU, oU = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, lU = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        iU = new WeakMap,
        rU = new WeakMap,
        aU = new WeakMap,
        sU = new WeakMap;
        const cU = class {
            constructor(e, t, n) {
                iU.set(this, void 0),
                rU.set(this, void 0),
                aU.set(this, new Qt(100 * Math.random(),100 * Math.random())),
                sU.set(this, new Qt(100 * Math.random(),100 * Math.random())),
                oU(this, iU, t, "f"),
                n.addResource();
                const i = (new wo).load("images/clouds.jpg", ( () => {
                    n.loadedResource()
                }
                ));
                i.wrapT = ae,
                i.wrapS = ae;
                const r = new zs(1e6,5,2,0,2 * Math.PI,0,Math.PI)
                  , a = new Mr({
                    defines: {
                        CLOUDS_ENABLED: t.getSettingBoolean(el.CloudsEnabled)
                    },
                    uniforms: {
                        scrollA: {
                            value: lU(this, aU, "f")
                        },
                        scrollB: {
                            value: lU(this, sU, "f")
                        },
                        sampler: {
                            value: i
                        },
                        cloudDensity: {
                            value: .6
                        },
                        cloudLight: {
                            value: new bn(.75,.75,.75)
                        },
                        sunPosition: {
                            value: new bn
                        }
                    },
                    vertexShader: "\n\t\t\t\tvarying vec3 fPos;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewPosition;\n\t\t\t\t\tgl_Position.z = 0.0;\n\t\t\t\t\tfPos = position;\n\t\t\t\t}\n\t\t\t",
                    fragmentShader: "\n\t\t\t\tvarying vec3 fPos;\n\n\t\t\t\tuniform vec2 offset;\n\t\t\t\tuniform vec2 scrollA;\n\t\t\t\tuniform vec2 scrollB;\n\t\t\t\tuniform sampler2D sampler;\n\n\t\t\t\tuniform float cloudDensity;\n\t\t\t\tuniform vec3 cloudLight;\n\n\t\t\t\tuniform vec3 sunPosition;\n\n\t\t\t\tvoid main()\n\t\t\t\t{\n\t\t\t\t\t#ifdef CLOUDS_ENABLED\n\t\t\t\t\t\tfloat c00 = texture2D(sampler, vec2(fPos.x / ((fPos.y + 0.06) / 0.1) - scrollB.x * 0.981, fPos.z / ((fPos.y + 0.06) / 0.1) - scrollB.y * 1.041) + scrollA).r;\n\t\t\t\t\t\tfloat c10 = texture2D(sampler, vec2(fPos.x / ((fPos.y + 0.06) / 0.1) + scrollB.x * 0.821, fPos.z / ((fPos.y + 0.06) / 0.1) - scrollB.y * 0.951) + scrollA).r;\n\t\t\t\t\t\tfloat c01 = texture2D(sampler, vec2(fPos.x / ((fPos.y + 0.06) / 0.1) - scrollB.x * 1.043, fPos.z / ((fPos.y + 0.06) / 0.1) + scrollB.y * 0.899) + scrollA).r;\n\t\t\t\t\t\tfloat c11 = texture2D(sampler, vec2(fPos.x / ((fPos.y + 0.06) / 0.1) + scrollB.x * 0.901, fPos.z / ((fPos.y + 0.06) / 0.1) + scrollB.y * 1.045) + scrollA).r;\n\t\t\t\t\t\tfloat cloud = min(1.0, max(0.0, (c00 + c10 + c01 + c11) / 4.0 - (1.0 - cloudDensity)) * 3.0);\n\n\t\t\t\t\t\tvec3 cloudColor = vec3(min(1.0, (c00 + c10 + c01 + c11) / 4.0 - (1.0 - cloudDensity)) * 4.0 + cloudDensity) * cloudLight;\n\t\t\t\t\t\tfloat cloudIntensity = cloud * min(1.0, max(0.0, fPos.y * 2.0 / 1000000.0));\n\t\t\t\t\t#else\n\t\t\t\t\t\tvec3 cloudColor = vec3(0.0);\n\t\t\t\t\t\tfloat cloudIntensity = 0.0;\n\t\t\t\t\t#endif\n\t\t\t\t\t\n\t\t\t\t\tvec3 horizonColor = vec3(255.0 / 255.0, 255.0 / 255.0, 255.0 / 255.0);\n\t\t\t\t\tvec3 zenithColor = vec3(5.0 / 255.0, 140.0 / 255.0, 255.0 / 255.0);\n\t\t\t\t\tfloat h = pow(clamp(fPos.y / 1000000.0, 0.01, 1.0), 0.2);\n\t\t\t\t\tvec3 skyColor = zenithColor * h + horizonColor * (1.0 - h);\n\n\t\t\t\t\tvec3 normal = normalize(-fPos);\n\t\t\t\t\tfloat sun = pow(max(0.0, max(0.0, dot(normal, sunPosition)) - 0.999), 4.0) * 60000000000.0;\n\t\t\t\t\tvec3 sunColor = vec3(20.0 * sun, 20.0 * sun, 19.0 * sun);\n\n\t\t\t\t\tgl_FragColor = vec4((skyColor * (1.0 - cloudIntensity) + cloudColor * cloudIntensity) * max(vec3(0.0), vec3(1.0) - sunColor) + sunColor, 1.0);\n\t\t\t\t}\n\t\t\t"
                });
                a.side = 1,
                a.depthWrite = !1,
                oU(this, rU, new yr(r,a), "f"),
                lU(this, rU, "f").renderOrder = -3,
                lU(this, rU, "f").matrixAutoUpdate = !1,
                lU(this, rU, "f").updateMatrix(),
                e.scene.add(lU(this, rU, "f"))
            }
            update(e, t, n) {
                lU(this, iU, "f").getSettingBoolean(el.CloudsEnabled) ? (lU(this, aU, "f").x += .00226 * e,
                lU(this, aU, "f").y += .001646 * e,
                lU(this, sU, "f").x += .001752 * e,
                lU(this, sU, "f").y += .001057 * e,
                1 != lU(this, rU, "f").material.defines.CLOUDS_ENABLED && (lU(this, rU, "f").material.defines.CLOUDS_ENABLED = !0,
                lU(this, rU, "f").material.needsUpdate = !0)) : 0 != lU(this, rU, "f").material.defines.CLOUDS_ENABLED && (lU(this, rU, "f").material.defines.CLOUDS_ENABLED = !1,
                lU(this, rU, "f").material.needsUpdate = !0);
                const i = n.getSunPosition();
                lU(this, rU, "f").material.uniforms.sunPosition.value.copy(i.negate()),
                lU(this, rU, "f").position.copy(t.position),
                lU(this, rU, "f").updateMatrix()
            }
        }
        ;
        (0,
        m.F3)("CapacitorSQLite", {
            web: () => i.e(57).then(i.bind(i, 8438)).then((e => new e.CapacitorSQLiteWeb)),
            electron: () => window.CapacitorCustomPlatform.plugins.CapacitorSQLite
        });
        var hU, dU, uU, pU, fU, mU, gU, vU, wU, yU, bU, AU, xU, kU, EU, SU, MU, _U, TU, CU, PU = function(e, t, n, i) {
            return new (n || (n = Promise))((function(r, a) {
                function s(e) {
                    try {
                        l(i.next(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function o(e) {
                    try {
                        l(i.throw(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(e) {
                    var t;
                    e.done ? r(e.value) : (t = e.value,
                    t instanceof n ? t : new n((function(e) {
                        e(t)
                    }
                    ))).then(s, o)
                }
                l((i = i.apply(e, t || [])).next())
            }
            ))
        }, IU = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, RU = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class LU {
            constructor() {
                hU.add(this),
                uU.set(this, {
                    getItem: () => {
                        throw new Error("Storage not initialized")
                    }
                    ,
                    setItem: () => {
                        throw new Error("Storage not initialized")
                    }
                    ,
                    removeItem: () => {
                        throw new Error("Storage not initialized")
                    }
                    ,
                    getAllKeys: () => {
                        throw new Error("Storage not initialized")
                    }
                })
            }
            initialize(e) {
                return PU(this, void 0, void 0, (function*() {
                    IU(this, uU, null != e ? e : {
                        getItem: e => window.localStorage.getItem(e),
                        setItem: (e, t) => {
                            window.localStorage.setItem(e, t)
                        }
                        ,
                        removeItem: e => {
                            window.localStorage.removeItem(e)
                        }
                        ,
                        getAllKeys: () => Object.keys(window.localStorage)
                    }, "f")
                }
                ))
            }
            migrate() {
                const e = RU(this, hU, "m", xU).call(this);
                "v4" == e || ("v3" == e ? (RU(this, hU, "m", vU).call(this),
                RU(this, hU, "m", AU).call(this)) : (RU(this, hU, "m", fU).call(this),
                RU(this, hU, "m", mU).call(this),
                RU(this, hU, "m", gU).call(this),
                RU(this, hU, "m", vU).call(this),
                RU(this, hU, "m", AU).call(this)))
            }
            saveRecord(e, t, n, i, r, a, s) {
                if (!Number.isSafeInteger(e) || e < 0)
                    throw new Error("Profile slot is invalid");
                try {
                    let o;
                    o = s == HT.Ok ? RU(dU, dU, "f", kU) + e.toString() + "_default_" + n : RU(dU, dU, "f", kU) + e.toString() + "_undeterministic_" + n,
                    RU(this, uU, "f").setItem(o, JSON.stringify({
                        uploadId: i,
                        tokenHash: t,
                        frames: r.numberOfFrames.toString(),
                        recording: a.serialize()
                    }))
                } catch (e) {
                    console.error(e)
                }
            }
            loadRecord(e, t, n, i) {
                if (!Number.isSafeInteger(e) || e < 0)
                    throw new Error("Profile slot is invalid");
                try {
                    let r;
                    r = i == HT.Ok ? RU(dU, dU, "f", kU) + e.toString() + "_default_" + n : RU(dU, dU, "f", kU) + e.toString() + "_undeterministic_" + n;
                    const a = RU(this, uU, "f").getItem(r);
                    if (null == a)
                        return null;
                    const s = JSON.parse(a);
                    if ("object" != typeof s)
                        return null;
                    if (!("uploadId"in s))
                        return null;
                    let o;
                    if (null == s.uploadId)
                        o = null;
                    else if (o = Number.parseInt(s.uploadId, 10),
                    !Number.isSafeInteger(o))
                        return null;
                    if (!("tokenHash"in s))
                        return null;
                    const l = s.tokenHash;
                    if ("string" != typeof l)
                        return null;
                    if (l != t)
                        return null;
                    if (!("frames"in s))
                        return null;
                    const c = Number.parseInt(s.frames, 10);
                    if (!Number.isSafeInteger(c))
                        return null;
                    const h = new Gp(c);
                    if (!("recording"in s))
                        return null;
                    const d = Lv.deserialize(s.recording);
                    return null == d ? null : {
                        uploadId: o,
                        time: h,
                        recording: d
                    }
                } catch (e) {
                    console.error(e)
                }
                return null
            }
            deleteAllRecords(e) {
                if (!Number.isSafeInteger(e) || e < 0)
                    throw new Error("Profile slot is invalid");
                try {
                    const t = RU(this, uU, "f").getAllKeys();
                    for (const n of t)
                        n.startsWith(RU(dU, dU, "f", kU) + e.toString() + "_") && RU(this, uU, "f").removeItem(n)
                } catch (e) {
                    console.error(e)
                }
            }
            deleteAllRecordsForTrack(e) {
                for (let t = 0; t < 3; t++)
                    try {
                        RU(this, uU, "f").removeItem(RU(dU, dU, "f", kU) + t.toString() + "_" + e)
                    } catch (e) {
                        console.error(e)
                    }
            }
            saveCustomTrack(e, t, n) {
                const i = t.toExportString(e);
                try {
                    return RU(this, uU, "f").setItem(RU(dU, dU, "f", EU) + e.name, JSON.stringify({
                        data: i,
                        saveTime: n.getTime()
                    })),
                    !0
                } catch (e) {
                    return console.error(e),
                    !1
                }
            }
            loadCustomTrack(e) {
                let t, n;
                try {
                    const i = RU(this, uU, "f").getItem(RU(dU, dU, "f", EU) + e);
                    if (null == i)
                        return null;
                    const r = JSON.parse(i);
                    if ("string" != typeof r.data)
                        return null;
                    if ("number" != typeof r.saveTime)
                        return null;
                    t = r.data,
                    n = r.saveTime
                } catch (e) {
                    return console.error(e),
                    null
                }
                const i = hx.fromExportString(t);
                return null == i ? null : {
                    trackMetadata: i.trackMetadata,
                    trackData: i.trackData,
                    saveTime: n
                }
            }
            deleteCustomTrack(e) {
                try {
                    return RU(this, uU, "f").removeItem(RU(dU, dU, "f", EU) + e),
                    !0
                } catch (e) {
                    return console.error(e),
                    !1
                }
            }
            getAllCustomTrackNames() {
                let e;
                try {
                    e = RU(this, uU, "f").getAllKeys()
                } catch (e) {
                    return console.error(e),
                    null
                }
                return e.filter((e => e.startsWith(RU(dU, dU, "f", EU)))).map((e => e.substring(RU(dU, dU, "f", EU).length)))
            }
            saveUserProfileSlot(e) {
                if (!Number.isSafeInteger(e) || e < 0)
                    throw new Error("Profile slot is invalid");
                try {
                    RU(this, uU, "f").setItem(RU(dU, dU, "f", SU), JSON.stringify(e))
                } catch (e) {
                    console.error(e)
                }
            }
            loadUserProfileSlot() {
                try {
                    const e = RU(this, uU, "f").getItem(RU(dU, dU, "f", SU));
                    if (null != e)
                        try {
                            const t = JSON.parse(e);
                            if (!Number.isSafeInteger(t) || t < 0)
                                throw new Error("Profile slot is invalid");
                            return t
                        } catch (e) {
                            console.error(e)
                        }
                } catch (e) {
                    console.error(e)
                }
                return null
            }
            saveUserProfile(e, t, n, i) {
                if (!Number.isSafeInteger(e) || e < 0)
                    throw new Error("Profile slot is invalid");
                try {
                    RU(this, uU, "f").setItem(RU(dU, dU, "f", MU) + e.toString(), JSON.stringify({
                        token: t,
                        nickname: n,
                        carColors: i.serialize()
                    }))
                } catch (e) {
                    console.error(e)
                }
            }
            loadUserProfile(e) {
                if (!Number.isSafeInteger(e) || e < 0)
                    throw new Error("Profile slot is invalid");
                try {
                    const t = RU(this, uU, "f").getItem(RU(dU, dU, "f", MU) + e.toString());
                    if (null != t) {
                        const e = JSON.parse(t);
                        if ("object" != typeof e)
                            throw new Error("User profile is not an object");
                        if ("string" != typeof e.token)
                            throw new Error("User profile token field has invalid type");
                        if ("string" != typeof e.nickname)
                            throw new Error("User profile nickname field has invalid type");
                        if ("string" != typeof e.carColors)
                            throw new Error("User profile carColors field has invalid type");
                        return {
                            token: e.token,
                            nickname: e.nickname,
                            carColors: np.deserialize(e.carColors)
                        }
                    }
                } catch (e) {
                    console.error(e)
                }
                return null
            }
            deleteUserProfile(e) {
                try {
                    RU(this, uU, "f").removeItem(RU(dU, dU, "f", MU) + e.toString())
                } catch (e) {
                    console.error(e)
                }
            }
            saveSettings(e) {
                try {
                    const t = [];
                    for (const [n,i] of e.entries())
                        t.push([el[n], i]);
                    RU(this, uU, "f").setItem(RU(dU, dU, "f", _U), JSON.stringify(t))
                } catch (e) {
                    console.error(e)
                }
            }
            loadSettings() {
                try {
                    const e = RU(this, uU, "f").getItem(RU(dU, dU, "f", _U));
                    if (null == e)
                        return null;
                    const t = JSON.parse(e);
                    if (!Array.isArray(t))
                        return null;
                    const n = [];
                    for (const e of t) {
                        if (!Array.isArray(e))
                            continue;
                        if (2 != e.length)
                            continue;
                        if ("string" != typeof e[0])
                            continue;
                        const t = e[0];
                        if (!(t in el))
                            continue;
                        const i = el[t]
                          , r = e[1];
                        "string" == typeof e[1] && n.push([i, r])
                    }
                    return n
                } catch (e) {
                    console.error(e)
                }
                return null
            }
            saveKeyBindings(e) {
                try {
                    const t = [];
                    for (const [n,i] of e.entries())
                        t.push([gk[n], i]);
                    RU(this, uU, "f").setItem(RU(dU, dU, "f", TU), JSON.stringify(t))
                } catch (e) {
                    console.error(e)
                }
            }
            loadKeyBindings() {
                try {
                    const e = RU(this, uU, "f").getItem(RU(dU, dU, "f", TU));
                    if (null == e)
                        return null;
                    const t = JSON.parse(e);
                    if (!Array.isArray(t))
                        return null;
                    const n = [];
                    for (const e of t) {
                        if (!Array.isArray(e))
                            continue;
                        if (2 != e.length)
                            continue;
                        if ("string" != typeof e[0])
                            continue;
                        const t = e[0];
                        if (!(t in gk))
                            continue;
                        const i = gk[t]
                          , r = e[1];
                        Array.isArray(r) && (2 == r.length && (null !== r[0] && "string" != typeof r[0] || null !== r[1] && "string" != typeof r[1] || n.push([i, r])))
                    }
                    return n
                } catch (e) {
                    console.error(e)
                }
                return null
            }
            saveTrackSelectionTab(e) {
                try {
                    RU(this, uU, "f").setItem(RU(dU, dU, "f", CU), e)
                } catch (e) {
                    console.error(e)
                }
            }
            loadTrackSelectionTab() {
                try {
                    const e = RU(this, uU, "f").getItem(RU(dU, dU, "f", CU));
                    if ("official" == e || "community" == e || "custom" == e)
                        return e
                } catch (e) {
                    console.error(e)
                }
                return "official"
            }
        }
        dU = LU,
        uU = new WeakMap,
        hU = new WeakSet,
        fU = function() {
            try {
                const e = RU(this, uU, "f").getAllKeys();
                try {
                    const e = RU(this, uU, "f").getItem("car_colors");
                    if (null != e) {
                        const t = JSON.parse(e)
                          , n = new np(new Hi(t[0]),new Hi(t[1]),new Hi(t[2]),new Hi(t[3]));
                        RU(this, hU, "m", yU).call(this, n),
                        RU(this, uU, "f").removeItem("car_colors")
                    }
                } catch (e) {
                    console.error(e)
                }
                for (const t of e) {
                    if (t.startsWith("record_"))
                        try {
                            RU(this, uU, "f").removeItem(t)
                        } catch (e) {
                            console.error(e)
                        }
                    if (t.startsWith("custom_track_"))
                        try {
                            const e = RU(this, uU, "f").getItem(t);
                            if (null != e) {
                                const n = XA(e);
                                if (null != n) {
                                    const {trackMetadata: e, trackData: i} = n;
                                    this.saveCustomTrack(e, i, new Date) && RU(this, uU, "f").removeItem(t)
                                }
                            }
                        } catch (e) {
                            console.error(e)
                        }
                }
            } catch (e) {
                console.error(e)
            }
        }
        ,
        mU = function() {
            try {
                const e = RU(this, uU, "f").getAllKeys();
                try {
                    const e = RU(this, uU, "f").getItem("v1_car");
                    if (null != e) {
                        const t = JSON.parse(e)
                          , n = new np(new Hi(t[0]),new Hi(t[1]),new Hi(t[2]),new Hi(t[3]));
                        RU(this, hU, "m", yU).call(this, n),
                        RU(this, uU, "f").removeItem("v1_car")
                    }
                } catch (e) {
                    console.error(e)
                }
                for (const t of e) {
                    if (t.startsWith("v1_record_"))
                        try {
                            RU(this, uU, "f").removeItem(t)
                        } catch (e) {
                            console.error(e)
                        }
                    if (t.startsWith("v1_track_"))
                        try {
                            const e = RU(this, uU, "f").getItem(t);
                            if (null != e) {
                                const n = {
                                    name: t.substring(9),
                                    author: null
                                }
                                  , i = ZA(e);
                                if (null == i)
                                    throw new Error("Failed to load v1 track for migration");
                                if (!this.saveCustomTrack(n, i, new Date))
                                    throw new Error("Failed to save v1 track for migration");
                                RU(this, uU, "f").removeItem(t)
                            }
                        } catch (e) {
                            console.error(e)
                        }
                }
            } catch (e) {
                console.error(e)
            }
        }
        ,
        gU = function() {
            try {
                const e = RU(this, uU, "f").getAllKeys();
                try {
                    const e = RU(this, uU, "f").getItem("v2_user");
                    if (null != e) {
                        const t = JSON.parse(e);
                        if (Array.isArray(t) || "object" != typeof t)
                            throw new Error("User profile is not an object");
                        const n = t.token;
                        if (null != n && "string" != typeof n)
                            throw new Error("User profile token is not a string or null");
                        const i = t.nickname;
                        if ("string" != typeof i)
                            throw new Error("User profile nickname is not a string");
                        const r = np.random();
                        RU(this, hU, "m", wU).call(this, n, i, r),
                        RU(this, uU, "f").removeItem("v2_user")
                    }
                } catch (e) {
                    console.error(e)
                }
                try {
                    const e = RU(this, uU, "f").getItem("v2_car");
                    if (null != e) {
                        const t = np.deserialize(e);
                        RU(this, hU, "m", yU).call(this, t),
                        RU(this, uU, "f").removeItem("v2_car")
                    }
                } catch (e) {
                    console.error(e)
                }
                try {
                    RU(this, uU, "f").removeItem("v2_settings")
                } catch (e) {
                    console.error(e)
                }
                try {
                    RU(this, uU, "f").removeItem("v2_key_bindings")
                } catch (e) {
                    console.error(e)
                }
                for (const t of e)
                    if (t.startsWith("v2_record_"))
                        try {
                            RU(this, uU, "f").removeItem(t)
                        } catch (e) {
                            console.error(e)
                        }
                    else if (t.startsWith("v2_track_"))
                        try {
                            const e = RU(this, uU, "f").getItem(t);
                            if (null != e) {
                                const n = {
                                    name: t.substring(9),
                                    author: null
                                }
                                  , i = JA(e);
                                if (null == i)
                                    throw new Error("Failed to load v2 track for migration");
                                if (!this.saveCustomTrack(n, i, new Date))
                                    throw new Error("Failed to save v2 track for migration");
                                RU(this, uU, "f").removeItem(t)
                            }
                        } catch (e) {
                            console.error(e)
                        }
            } catch (e) {
                console.error(e)
            }
        }
        ,
        vU = function() {
            try {
                const e = RU(this, uU, "f").getAllKeys();
                try {
                    const e = RU(this, uU, "f").getItem("polytrack_v3_user_slot");
                    if (null != e) {
                        const t = Number.parseInt(e, 10);
                        Number.isSafeInteger(t) && t >= 0 && t <= 2 && (this.saveUserProfileSlot(t),
                        RU(this, uU, "f").removeItem("polytrack_v3_user_slot"))
                    }
                } catch (e) {
                    console.error(e)
                }
                try {
                    const e = RU(this, uU, "f").getItem("polytrack_v3_settings");
                    if (null != e) {
                        const t = JSON.parse(e);
                        if (Array.isArray(t)) {
                            const e = new Map;
                            for (const n of t) {
                                if (!Array.isArray(n) || 2 != n.length)
                                    continue;
                                const t = n[0];
                                if ("string" != typeof t || !(t in el))
                                    continue;
                                const i = n[1];
                                "string" == typeof i && e.set(el[t], i)
                            }
                            this.saveSettings(e),
                            RU(this, uU, "f").removeItem("polytrack_v3_settings")
                        }
                    }
                } catch (e) {
                    console.error(e)
                }
                try {
                    const e = RU(this, uU, "f").getItem("polytrack_v3_key_bindings");
                    if (null != e) {
                        const t = JSON.parse(e);
                        if (Array.isArray(t)) {
                            const e = new Map;
                            for (const n of t) {
                                if (!Array.isArray(n) || 2 != n.length)
                                    continue;
                                const t = n[0];
                                if ("string" != typeof t || !(t in gk))
                                    continue;
                                const i = n[1];
                                if (!Array.isArray(i) || 2 != i.length)
                                    continue;
                                const r = i[0];
                                if (null !== r && "string" != typeof r)
                                    continue;
                                const a = i[1];
                                null !== a && "string" != typeof a || e.set(gk[t], [r, a])
                            }
                            this.saveKeyBindings(e),
                            RU(this, uU, "f").removeItem("polytrack_v3_key_bindings")
                        }
                    }
                } catch (e) {
                    console.error(e)
                }
                for (const t of e)
                    if (t.startsWith("polytrack_v3_user_")) {
                        let e;
                        switch (t) {
                        case "polytrack_v3_user_0":
                            e = 0;
                            break;
                        case "polytrack_v3_user_1":
                            e = 1;
                            break;
                        case "polytrack_v3_user_2":
                            e = 2;
                            break;
                        default:
                            e = null
                        }
                        if (null != e)
                            try {
                                const n = RU(this, uU, "f").getItem(t);
                                if (null != n) {
                                    const i = JSON.parse(n);
                                    if ("object" != typeof i)
                                        throw new Error("User profile is not an object");
                                    if (null != i.token && "string" != typeof i.token)
                                        throw new Error("User profile token field has invalid type");
                                    if ("string" != typeof i.nickname)
                                        throw new Error("User profile nickname field has invalid type");
                                    if ("string" != typeof i.carColors)
                                        throw new Error("User profile carColors field has invalid type");
                                    const r = i.token
                                      , a = i.nickname
                                      , s = np.deserialize(i.carColors);
                                    this.saveUserProfile(e, null != r ? r : AD.createToken(), a, s),
                                    RU(this, uU, "f").removeItem(t)
                                }
                            } catch (e) {
                                console.error(e)
                            }
                    } else if (t.startsWith("polytrack_v3_record_"))
                        try {
                            RU(this, uU, "f").removeItem(t)
                        } catch (e) {
                            console.error(e)
                        }
                    else if (t.startsWith("polytrack_v3_track_"))
                        try {
                            const e = RU(this, uU, "f").getItem(t);
                            if (null != e) {
                                const n = {
                                    name: t.substring(19),
                                    author: null
                                }
                                  , i = JSON.parse(e);
                                if (null == i || "object" != typeof i)
                                    throw new Error("Track data is not an object");
                                if (null == i.data || "string" != typeof i.data)
                                    throw new Error("Track data field is invalid");
                                if (null == i.saveTime || "number" != typeof i.saveTime || !Number.isSafeInteger(i.saveTime) || i.saveTime < 0)
                                    throw new Error("Track save time field is invalid");
                                const r = $A(i.data);
                                if (null == r)
                                    throw new Error("Failed to load v2 track for migration");
                                if (!this.saveCustomTrack(n, r, new Date(i.saveTime)))
                                    throw new Error("Failed to save v2 track for migration");
                                RU(this, uU, "f").removeItem(t)
                            }
                        } catch (e) {
                            console.error(e)
                        }
                try {
                    RU(this, uU, "f").removeItem("polytrack_v3_migrated")
                } catch (e) {
                    console.error(e)
                }
            } catch (e) {
                console.error(e)
            }
        }
        ,
        wU = function(e, t, n) {
            null == this.loadUserProfile(0) && this.saveUserProfile(0, null != e ? e : AD.createToken(), t, n)
        }
        ,
        yU = function(e) {
            const t = this.loadUserProfile(0);
            null == t ? this.saveUserProfile(0, AD.createToken(), AD.defaultNickname, e) : this.saveUserProfile(0, t.token, t.nickname, e)
        }
        ,
        AU = function() {
            try {
                RU(this, uU, "f").setItem(RU(dU, dU, "f", bU), "")
            } catch (e) {
                console.error(e)
            }
        }
        ,
        xU = function() {
            try {
                if (null != RU(this, uU, "f").getItem(RU(dU, dU, "f", bU)))
                    return "v4";
                if (null != RU(this, uU, "f").getItem("polytrack_v3_migrated"))
                    return "v3"
            } catch (e) {
                console.error(e)
            }
            return null
        }
        ,
        pU = {
            value: ( () => {
                let e = "polytrack_v4_";
                return e += "prod_",
                e
            }
            )()
        },
        bU = {
            value: RU(dU, dU, "f", pU) + "migrated"
        },
        kU = {
            value: RU(dU, dU, "f", pU) + "record_"
        },
        EU = {
            value: RU(dU, dU, "f", pU) + "track_"
        },
        SU = {
            value: RU(dU, dU, "f", pU) + "user_slot"
        },
        MU = {
            value: RU(dU, dU, "f", pU) + "user_"
        },
        _U = {
            value: RU(dU, dU, "f", pU) + "settings"
        },
        TU = {
            value: RU(dU, dU, "f", pU) + "key_bindings"
        },
        CU = {
            value: RU(dU, dU, "f", pU) + "selected_track_tab"
        };
        const DU = LU;
        var NU, BU, UU, zU, OU, FU, WU, HU, VU, GU = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, jU = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class QU {
            constructor() {
                NU.add(this),
                UU.set(this, void 0),
                zU.set(this, !1),
                OU.set(this, null),
                FU.set(this, !1);
                const e = document.getElementById("ui");
                if (null == e)
                    throw new Error("Failed to find UI element");
                GU(this, UU, e, "f"),
                window.addEventListener("mousemove", ( () => {
                    document.body.classList.remove("hide-cursor"),
                    GU(this, FU, !1, "f"),
                    jU(this, zU, "f") && (null != jU(this, OU, "f") && clearTimeout(jU(this, OU, "f")),
                    GU(this, OU, setTimeout(( () => {
                        document.body.classList.add("hide-cursor"),
                        GU(this, FU, !0, "f"),
                        GU(this, OU, null, "f")
                    }
                    ), jU(BU, BU, "f", WU)), "f"))
                }
                )),
                document.addEventListener("gesturestart", (function(e) {
                    e.preventDefault()
                }
                )),
                window.addEventListener("resize", ( () => {
                    jU(this, NU, "m", VU).call(this)
                }
                )),
                jU(this, NU, "m", VU).call(this)
            }
            setCursorHiddenWhenInactive(e) {
                GU(this, zU, e, "f"),
                e ? GU(this, OU, setTimeout(( () => {
                    document.body.classList.add("hide-cursor"),
                    GU(this, FU, !0, "f"),
                    GU(this, OU, null, "f")
                }
                ), jU(BU, BU, "f", WU)), "f") : (document.body.classList.remove("hide-cursor"),
                null != jU(this, OU, "f") && (clearTimeout(jU(this, OU, "f")),
                GU(this, FU, !1, "f"),
                GU(this, OU, null, "f")))
            }
            get isCursorHidden() {
                return jU(this, FU, "f")
            }
        }
        BU = QU,
        UU = new WeakMap,
        zU = new WeakMap,
        OU = new WeakMap,
        FU = new WeakMap,
        NU = new WeakSet,
        HU = function() {
            return Math.max(.01, Math.min(1, Math.min(window.innerWidth, 1.4375 * window.innerHeight) / 1150))
        }
        ,
        VU = function() {
            const e = jU(this, NU, "m", HU).call(this);
            e < 1 ? (jU(this, UU, "f").style.width = "calc(100% / " + e.toString() + ")",
            jU(this, UU, "f").style.height = "calc(100% / " + e.toString() + ")",
            jU(this, UU, "f").style.transform = "scale(" + e.toString() + ")",
            document.documentElement.style.setProperty("--ui-scale-factor", e.toString())) : (jU(this, UU, "f").style.width = "",
            jU(this, UU, "f").style.height = "",
            jU(this, UU, "f").style.transform = "",
            document.documentElement.style.setProperty("--ui-scale-factor", "1.0"));
            const t = window.getComputedStyle(document.documentElement).getPropertyValue("--safe-area-left-unscaled")
              , n = window.getComputedStyle(document.documentElement).getPropertyValue("--safe-area-right-unscaled");
            "0px" != t && "0.0px" != t && "0" != t || "0px" != n && "0.0px" != n && "0" != n ? jU(this, UU, "f").classList.add("has-safe-area-horizontal") : jU(this, UU, "f").classList.remove("has-safe-area-horizontal")
        }
        ,
        WU = {
            value: 1e3
        };
        const KU = QU;
        var qU, YU, XU = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        qU = new WeakMap,
        YU = new WeakMap;
        const ZU = class {
            constructor() {
                this.determinismState = HT.Uninitialized,
                qU.set(this, 2e4),
                YU.set(this, 1e4)
            }
            getLeaderboard(e, t, n, i, r) {
                let a = vu + "leaderboard?version=" + bu + "&trackId=" + t + "&skip=" + n.toString() + "&amount=" + i.toString();
                null != r && (a += "&onlyVerified=" + r.toString());
                return this.determinismState == HT.Ok && (a += "&userTokenHash=" + encodeURIComponent(e)),
                new Promise(( (t, n) => {
                    const i = new XMLHttpRequest;
                    i.timeout = XU(this, qU, "f"),
                    i.overrideMimeType("text/plain"),
                    i.onreadystatechange = () => {
                        if (i.readyState == XMLHttpRequest.DONE)
                            if (200 == i.status)
                                try {
                                    const r = JSON.parse(i.responseText)
                                      , a = r.total;
                                    if ("number" != typeof a)
                                        return void n(new Error("Total is not a number"));
                                    if (!Number.isSafeInteger(a))
                                        return void n(new Error("Total is not a safe integer"));
                                    const s = r.entries;
                                    if (!Array.isArray(s))
                                        return void n(new Error("Entries is not an array"));
                                    const o = [];
                                    for (const t of s) {
                                        if (null == t)
                                            return void n(new Error("Entry is missing"));
                                        if (!Object.prototype.hasOwnProperty.call(t, "id"))
                                            return void n(new Error('Entry is missing "id" field'));
                                        if (!Object.prototype.hasOwnProperty.call(t, "userId"))
                                            return void n(new Error('Entry is missing "userId" field'));
                                        if (!Object.prototype.hasOwnProperty.call(t, "name"))
                                            return void n(new Error('Entry is missing "name" field'));
                                        if (!Object.prototype.hasOwnProperty.call(t, "frames"))
                                            return void n(new Error('Entry is missing "frames" field'));
                                        if (!Object.prototype.hasOwnProperty.call(t, "carColors"))
                                            return void n(new Error('Entry is missing "carColors" field'));
                                        if ("number" != typeof t.id)
                                            return void n(new Error('"id" field has incorrect type'));
                                        if ("string" != typeof t.userId)
                                            return void n(new Error('"userId" field has incorrect type'));
                                        if ("string" != typeof t.name)
                                            return void n(new Error('"name" field has incorrect type'));
                                        if ("number" != typeof t.frames)
                                            return void n(new Error('"frames" field has incorrect type'));
                                        if (!Number.isSafeInteger(t.frames) || t.frames <= 0 || t.frames > Lv.maxFrames)
                                            return void n(new Error('"frames" field has an invalid value'));
                                        if ("string" != typeof t.carColors)
                                            return void n(new Error('"carColors" field has incorrect type'));
                                        o.push({
                                            id: t.id,
                                            name: t.name,
                                            time: new Gp(t.frames),
                                            carColors: np.deserialize(t.carColors),
                                            isSelf: t.userId == e
                                        })
                                    }
                                    let l = null;
                                    if (null != r.userEntry) {
                                        const e = r.userEntry.position;
                                        if ("number" != typeof e)
                                            return void n(new Error("User position is not a number"));
                                        if (!Number.isSafeInteger(e))
                                            return void n(new Error("User position is not a safe integer"));
                                        const t = r.userEntry.frames;
                                        if ("number" != typeof t)
                                            return void n(new Error("User frames is not a number"));
                                        if (!Number.isSafeInteger(t))
                                            return void n(new Error("User frames is not a safe integer"));
                                        const i = new Gp(t)
                                          , a = r.userEntry.id;
                                        if ("number" != typeof a)
                                            return void n(new Error("User record id is not a number"));
                                        if (!Number.isSafeInteger(a))
                                            return void n(new Error("User record id is not a safe integer"));
                                        l = {
                                            position: e,
                                            time: i,
                                            id: a
                                        }
                                    }
                                    t({
                                        total: a,
                                        entries: o,
                                        userEntry: l
                                    })
                                } catch (e) {
                                    n(new Error("Unknown error: " + String(e)))
                                }
                            else
                                n(new Error("Failed to connect to server"))
                    }
                    ,
                    i.open("GET", a, !0),
                    i.send()
                }
                ))
            }
            getRecordings(e) {
                const t = vu + "recordings?version=" + bu + "&recordingIds=" + e.join(",");
                return new Promise(( (e, n) => {
                    if (this.determinismState != HT.Ok)
                        n(new Error("Getting recordings not allowed"));
                    else {
                        const i = new XMLHttpRequest;
                        i.timeout = XU(this, qU, "f"),
                        i.overrideMimeType("text/plain"),
                        i.onreadystatechange = () => {
                            if (i.readyState == XMLHttpRequest.DONE)
                                if (200 == i.status)
                                    try {
                                        const t = JSON.parse(i.responseText);
                                        if (!Array.isArray(t))
                                            return void n(new Error("Response is not an array"));
                                        const r = [];
                                        for (const e of t) {
                                            if (null == e) {
                                                r.push(null);
                                                continue
                                            }
                                            if ("object" != typeof e || Array.isArray(e))
                                                return void n(new Error("JSON item is not an object"));
                                            if ("string" != typeof e.recording)
                                                return void n(new Error("JSON item recording field has incorrect type"));
                                            const t = Lv.deserialize(e.recording);
                                            if (null == t)
                                                return void n(new Error("Failed to deserialize recording"));
                                            if ("number" != typeof e.verifiedState)
                                                return void n(new Error("JSON item verifiedState field has incorrect type"));
                                            const i = e.verifiedState;
                                            if (!Number.isSafeInteger(i) || i < 0)
                                                return void n(new Error("JSON item verifiedState is not a safe integer"));
                                            if ("number" != typeof e.frames)
                                                return void n(new Error("JSON item frames field has incorrect type"));
                                            const a = e.frames;
                                            if (!Number.isSafeInteger(a) || a <= 0 || a > Lv.maxFrames)
                                                return void n(new Error("JSON item frames is not a safe integer"));
                                            const s = new Gp(a);
                                            if ("string" != typeof e.carColors)
                                                return void n(new Error("JSON item carColors field has incorrect type"));
                                            const o = np.deserialize(e.carColors);
                                            r.push({
                                                recording: t,
                                                time: s,
                                                verifiedState: i,
                                                carColors: o
                                            })
                                        }
                                        e(r)
                                    } catch (e) {
                                        n(new Error("Unknown error: " + String(e)))
                                    }
                                else
                                    n(new Error("Failed to connect to server"))
                        }
                        ,
                        i.open("GET", t, !0),
                        i.send()
                    }
                }
                ))
            }
            submitLeaderboard(e, t, n, i, r, a, s) {
                return new Promise(( (o, l) => {
                    if (this.determinismState != HT.Ok)
                        l(new Error("Submit not allowed"));
                    else {
                        const c = s.serialize();
                        if (c.length >= XU(this, YU, "f"))
                            l(new Error("Recording is too large"));
                        else {
                            const u = () => {
                                const s = vu + "leaderboard";
                                let u = "version=" + bu + "&userToken=" + encodeURIComponent(e) + "&name=" + encodeURIComponent(t) + "&carColors=" + n.serialize() + "&trackId=" + i + "&frames=" + a.numberOfFrames.toString() + "&recording=" + c;
                                null != r && (u += "&onlyVerified=" + r.toString());
                                const d = new XMLHttpRequest;
                            d.timeout = XU(this, qU, "f"),
                            d.overrideMimeType("text/plain"),
                            d.onreadystatechange = () => {
                                if (4 == d.readyState)
                                    if (200 == d.status)
                                        try {
                                            const e = JSON.parse(d.responseText);
                                            if ("number" == typeof e || null == e) {
                                                const t = e;
                                                if (null !== t && "number" != typeof t)
                                                    return void l(new Error("UploadId is not a number or null"));
                                                if (!Number.isSafeInteger(t))
                                                    return void l(new Error("UploadId is not a safe integer"));
                                                o({
                                                    uploadId: t,
                                                    positionChange: null
                                                })
                                            } else {
                                                if ("object" != typeof e)
                                                    return void l(new Error("Response is not an object"));
                                                if (!("uploadId"in e))
                                                    return void l(new Error('Field "uploadId" does not exist'));
                                                if ("number" != typeof e.uploadId && null !== e.uploadId)
                                                    return void l(new Error('Field "uploadId" is not a number or null'));
                                                const t = e.uploadId;
                                                if (null !== t && "number" != typeof t)
                                                    return void l(new Error("UploadId is not a number or null"));
                                                if (!Number.isSafeInteger(t))
                                                    return void l(new Error("UploadId is not a safe integer"));
                                                if (!("previousPosition"in e))
                                                    return void l(new Error('Field "previousPosition" does not exist'));
                                                if ("number" != typeof e.previousPosition && null !== e.previousPosition)
                                                    return void l(new Error('Field "previousPosition" is not a number or null'));
                                                const n = e.previousPosition;
                                                if ("number" != typeof n || !Number.isSafeInteger(n) || n < 0)
                                                    return void l(new Error("PreviousPosition is not a safe positive integer"));
                                                if (!("newPosition"in e))
                                                    return void l(new Error('Field "newPosition" does not exist'));
                                                if ("number" != typeof e.newPosition && null !== e.newPosition)
                                                    return void l(new Error('Field "newPosition" is not a number or null'));
                                                const i = e.newPosition;
                                                if ("number" != typeof i || !Number.isSafeInteger(i) || i < 0)
                                                    return void l(new Error("NewPosition is not a safe positive integer"));
                                                o({
                                                    uploadId: t,
                                                    positionChange: {
                                                        previousPosition: n,
                                                        newPosition: i
                                                    }
                                                })
                                            }
                                        } catch (e) {
                                            l(new Error("Unknown error: " + String(e)))
                                        }
                                    else
                                        l(new Error("Failed to connect to server"))
                            }
                            ,
                            d.open("POST", s, !0),
                            d.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"),
                            d.send(u)
                            };
                            const h = this;
                            const f = () => {
                                h.getLeaderboard("", i, 0, 10, null).then((e => {
                                    if (e && Array.isArray(e.entries) && e.entries.length >= 10) {
                                        const t = e.entries[Math.min(9, e.entries.length - 1)];
                                        if (t && "number" == typeof t.frames && a.numberOfFrames >= t.frames)
                                            return void o({
                                                uploadId: null,
                                                positionChange: null
                                            })
                                    }
                                    u()
                                }
                                )).catch(( () => {
                                    u()
                                }
                                ))
                            };
                            try {
                                f()
                            } catch (e) {
                                u()
                            }
                        }
                    }
                }
                ))
            }
            submitUserProfile(e, t, n) {
                return new Promise(( (i, r) => {
                    const a = vu + "user"
                      , s = "version=" + bu + "&userToken=" + encodeURIComponent(e) + "&name=" + encodeURIComponent(t) + "&carColors=" + n.serialize()
                      , o = new XMLHttpRequest;
                    o.timeout = XU(this, qU, "f"),
                    o.overrideMimeType("text/plain"),
                    o.onreadystatechange = () => {
                        4 == o.readyState && (200 == o.status ? i() : r(new Error("Failed to connect to server")))
                    }
                    ,
                    o.open("POST", a, !0),
                    o.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"),
                    o.send(s)
                }
                ))
            }
            verifyRecordings(e, t, n, i, r) {
                return new Promise(( (a, s) => {
                    if (this.determinismState != HT.Ok)
                        s(new Error("Submit not allowed"));
                    else {
                        const o = vu + "verifyRecordings"
                          , l = "version=" + bu + "&userToken=" + encodeURIComponent(e) + (null != t ? "&trackId=" + t : "") + "&maxFrames=" + n.toString() + "&getEstimatedRemaining=" + i.toString() + "&recordings=" + encodeURIComponent(JSON.stringify(r))
                          , c = new XMLHttpRequest;
                        c.timeout = XU(this, qU, "f"),
                        c.overrideMimeType("text/plain"),
                        c.onreadystatechange = () => {
                            if (4 == c.readyState)
                                if (200 == c.status)
                                    try {
                                        if ("" == c.responseText)
                                            return void a({
                                                unverifiedRecordings: [],
                                                exhaustive: !0,
                                                estimatedRemaining: 0
                                            });
                                        const e = JSON.parse(c.responseText);
                                        if (!("exhaustive"in e))
                                            return void s(new Error('Field "exhaustive" does not exist'));
                                        const t = 1 == e.exhaustive;
                                        if (!("estimatedRemaining"in e))
                                            return void s(new Error('Field "estimatedRemaining" does not exist'));
                                        let n;
                                        if (null == e.estimatedRemaining)
                                            n = null;
                                        else if (n = parseInt(e.estimatedRemaining, 10),
                                        !Number.isSafeInteger(n) || n < 0)
                                            return void s(new Error("Estimated remaining is not a valid integer"));
                                        if (!("unverifiedRecordings"in e))
                                            return void s(new Error('Field "unverifiedRecordings" does not exist'));
                                        const i = e.unverifiedRecordings;
                                        if (!Array.isArray(i))
                                            return void s(new Error('Field "unverifiedRecordings" is not an array'));
                                        for (const e of i) {
                                            if ("object" != typeof e)
                                                return void s(new Error("Recording is not an object"));
                                            if ("number" != typeof e.id || !Number.isSafeInteger(e.id))
                                                return void s(new Error("Recording id is not a valid integer"));
                                            if ("string" != typeof e.recording)
                                                return void s(new Error("Recording recording is not a string"));
                                            if ("number" != typeof e.frames || !Number.isSafeInteger(e.frames) || e.frames <= 0 || e.frames > Lv.maxFrames)
                                                return void s(new Error("Recording frames is not a valid integer"))
                                        }
                                        a({
                                            unverifiedRecordings: i,
                                            exhaustive: t,
                                            estimatedRemaining: n
                                        })
                                    } catch (e) {
                                        s(new Error("Unknown error: " + String(e)))
                                    }
                                else
                                    403 == c.status ? s(new Error("User is not a verifier")) : s(new Error("Failed to connect to server"))
                        }
                        ,
                        c.open("POST", o, !0),
                        c.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"),
                        c.send(l)
                    }
                }
                ))
            }
            getUser(e) {
                return new Promise(( (t, n) => {
                    const i = vu + "user?version=" + bu + "&userToken=" + encodeURIComponent(e)
                      , r = new XMLHttpRequest;
                    r.timeout = XU(this, qU, "f"),
                    r.overrideMimeType("text/plain"),
                    r.onreadystatechange = () => {
                        if (r.readyState == XMLHttpRequest.DONE)
                            if (200 == r.status)
                                try {
                                    const e = JSON.parse(r.responseText);
                                    if (null == e)
                                        return void t(null);
                                    const i = e.name;
                                    if ("string" != typeof i)
                                        return void n(new Error("Name is not a string"));
                                    const a = xD(i);
                                    if (0 == a || a > 50)
                                        return void n(new Error("Name as invalid length"));
                                    const s = e.carColors;
                                    if ("string" != typeof s)
                                        return void n(new Error("CarColors data is not a string"));
                                    const o = np.deserialize(s)
                                      , l = e.isVerifier;
                                    if ("boolean" != typeof l)
                                        return void n(new Error("IsVerifier is not a boolean"));
                                    t({
                                        name: i,
                                        carColors: o,
                                        isVerifier: l
                                    })
                                } catch (e) {
                                    n(new Error("Unknown error: " + String(e)))
                                }
                            else
                                n(new Error("Failed to connect to server"))
                    }
                    ,
                    r.open("GET", i, !0),
                    r.send()
                }
                ))
            }
        }
        ;
        var JU, $U, ez, tz, nz, iz = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, rz = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        $U = new WeakMap,
        ez = new WeakMap,
        tz = new WeakMap,
        JU = new WeakSet,
        nz = function(e) {
            for (const [t,n] of e) {
                if (!rz(this, tz, "f").has(t))
                    throw new Error("Key binding is missing");
                rz(this, tz, "f").set(t, n)
            }
        }
        ;
        const az = class {
            constructor(e) {
                JU.add(this),
                $U.set(this, void 0),
                ez.set(this, this.defaultSettings()),
                tz.set(this, this.defaultKeyBindings()),
                iz(this, $U, e, "f");
                const t = e.loadSettings();
                null != t && this.updateSettings(t);
                const n = e.loadKeyBindings();
                null != n && rz(this, JU, "m", nz).call(this, n)
            }
            defaultSettings() {
                return new Map([[el.ImperialUnitsEnabled, "false"], [el.ResetHintEnabled, "true"], [el.GhostCarEnabled, "true"], [el.DefaultCameraMode, "false"], [el.CockpitCameraToggle, "true"], [el.Checkpoints, "bottom"], [el.Timer, "bottom"], [el.Speedometer, "bottom"], [el.Language, "en-US"], [el.ShadowQuality, "2"], [el.CloudsEnabled, "true"], [el.ParticlesEnabled, "true"], [el.SkidmarksEnabled, "true"], [el.RenderScale, "1"], [el.Antialiasing, "true"], [el.SoundEffectVolume, "1"], [el.MusicVolume, "1"], [el.CheckpointVolume, "1"], [el.VibrationEnabled, "false"], [el.TouchSteeringSide, "true"]])
            }
            defaultKeyBindings() {
                return new Map([[gk.VehicleAccelerate, ["KeyW", "ArrowUp"]], [gk.VehicleTurnRight, ["KeyD", "ArrowRight"]], [gk.VehicleBrake, ["KeyS", "ArrowDown"]], [gk.VehicleTurnLeft, ["KeyA", "ArrowLeft"]], [gk.VehicleCheckpointReset, ["KeyR", "Enter"]], [gk.VehicleStartReset, ["KeyT", "Backspace"]], [gk.VehicleCockpitCamera, ["KeyC", "KeyM"]], [gk.ToggleUI, ["KeyH", null]], [gk.Pause, ["KeyP", "Space"]], [gk.EditorRotatePart, ["KeyR", "Space"]], [gk.EditorHeightModifier, ["ShiftLeft", "ShiftRight"]], [gk.EditorDelete, ["Delete", "KeyX"]], [gk.EditorMoveForwards, ["KeyW", "ArrowUp"]], [gk.EditorMoveRight, ["KeyD", "ArrowRight"]], [gk.EditorMoveBackwards, ["KeyS", "ArrowDown"]], [gk.EditorMoveLeft, ["KeyA", "ArrowLeft"]], [gk.EditorRotateViewUp, ["KeyY", null]], [gk.EditorRotateViewDown, ["KeyH", null]], [gk.EditorRotateViewLeft, ["KeyQ", null]], [gk.EditorRotateViewRight, ["KeyE", null]], [gk.EditorMoveDown, ["KeyZ", null]], [gk.EditorMoveUp, ["KeyC", null]], [gk.EditorTest, ["KeyT", null]], [gk.EditorPick, ["KeyG", null]], [gk.ToggleFpsCounter, ["Comma", null]], [gk.ToggleSpectatorCamera, ["Period", null]], [gk.SpectatorMoveForwards, ["KeyW", "ArrowUp"]], [gk.SpectatorMoveRight, ["KeyD", "ArrowRight"]], [gk.SpectatorMoveBackwards, ["KeyS", "ArrowDown"]], [gk.SpectatorMoveLeft, ["KeyA", "ArrowLeft"]], [gk.SpectatorSpeedModifier, ["ShiftLeft", "ShiftRight"]]])
            }
            getSettings() {
                return Array.from(rz(this, ez, "f"))
            }
            getSetting(e) {
                const t = rz(this, ez, "f").get(e);
                if (null == t)
                    throw new Error("Setting name is missing");
                return t
            }
            getSettingBoolean(e) {
                return "true" == this.getSetting(e)
            }
            getSettingFloat(e) {
                return parseFloat(this.getSetting(e))
            }
            getSettingInteger(e) {
                return parseInt(this.getSetting(e), 10)
            }
            updateSettings(e) {
                for (const [t,n] of e) {
                    if (!rz(this, ez, "f").has(t))
                        throw new Error("Setting name is missing");
                    rz(this, ez, "f").set(t, n)
                }
            }
            saveSettings() {
                rz(this, $U, "f").saveSettings(rz(this, ez, "f"))
            }
            getKeyBindings(e) {
                var t;
                return null !== (t = rz(this, tz, "f").get(e)) && void 0 !== t ? t : [null, null]
            }
            setKeyBindings(e) {
                rz(this, JU, "m", nz).call(this, e),
                rz(this, $U, "f").saveKeyBindings(rz(this, tz, "f"))
            }
            checkKeyBinding(e, t) {
                var n;
                const i = null !== (n = rz(this, tz, "f").get(t)) && void 0 !== n ? n : [];
                for (const t of i)
                    if (null != t && e.code == t)
                        return !0;
                return !1
            }
        }
        ;
        var sz;
        !function(e) {
            e[e.Init = 0] = "Init",
            e[e.Verify = 1] = "Verify",
            e[e.TestDeterminism = 2] = "TestDeterminism",
            e[e.CreateCar = 3] = "CreateCar",
            e[e.DeleteCar = 4] = "DeleteCar",
            e[e.StartCar = 5] = "StartCar",
            e[e.ControlCar = 6] = "ControlCar",
            e[e.PauseCar = 7] = "PauseCar",
            e[e.VerifyResult = 8] = "VerifyResult",
            e[e.DeterminismResult = 9] = "DeterminismResult",
            e[e.UpdateResult = 10] = "UpdateResult"
        }(sz || (sz = {}));
        const oz = sz;
        var lz, cz, hz, dz, uz, pz, fz, mz = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, gz = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        cz = new WeakMap,
        hz = new WeakMap,
        dz = new WeakMap,
        uz = new WeakMap,
        pz = new WeakMap,
        lz = new WeakSet,
        fz = function(e, t) {
            const n = t.getPhysicsParts();
            gz(this, hz, "f").postMessage({
                messageType: oz.Init,
                isRealtime: e,
                trackParts: n
            })
        }
        ;
        const vz = class {
            constructor(e, t, n) {
                lz.add(this),
                cz.set(this, void 0),
                hz.set(this, void 0),
                dz.set(this, !1),
                uz.set(this, 0),
                pz.set(this, new Map),
                mz(this, hz, new Worker("simulation_worker.bundle.js"), "f"),
                null != t && null != n ? (mz(this, cz, t, "f"),
                n.hasLoaded() ? gz(this, lz, "m", fz).call(this, e, t) : n.addCompleteListener(( () => {
                    gz(this, lz, "m", fz).call(this, e, t)
                }
                ))) : mz(this, cz, null, "f")
            }
            dispose() {
                gz(this, hz, "f").terminate(),
                mz(this, dz, !0, "f")
            }
            validate(e, t, n) {
                return new Promise(( (i, r) => {
                    var a, s;
                    if (null == gz(this, cz, "f"))
                        throw new Error("TrackPartManager is not initialized");
                    if (null == e.getStartTransform())
                        i(!1);
                    else {
                        const o = FR.createMountainVertices(e.getBounds());
                        if (null == Qw.models)
                            throw new Error("Car collision model not loaded");
                        const l = (mz(this, uz, (s = gz(this, uz, "f"),
                        a = s++,
                        s), "f"),
                        a)
                          , c = setInterval(( () => {
                            gz(this, dz, "f") && (clearInterval(c),
                            r(new Error("Simulation has been disposed")))
                        }
                        ), 10)
                          , h = e => {
                            e.data.messageType == oz.VerifyResult && e.data.carId == l && (clearInterval(c),
                            gz(this, hz, "f").removeEventListener("message", h),
                            i(e.data.result))
                        }
                        ;
                        gz(this, hz, "f").addEventListener("message", h),
                        gz(this, hz, "f").postMessage({
                            messageType: oz.Verify,
                            mountainVertices: o.vertices,
                            mountainOffset: {
                                x: o.offset.x,
                                y: o.offset.y,
                                z: o.offset.z
                            },
                            trackData: e.toSaveString(),
                            carId: l,
                            carCollisionShapeVertices: Qw.models.collisionShapeVertices,
                            carMassOffset: Qw.massOffset,
                            carRecording: t.serialize(),
                            targetFrames: n.numberOfFrames
                        })
                    }
                }
                ))
            }
            testDeterminism() {
                return new Promise((e => {
                    const t = n => {
                        if (n.data.messageType === oz.DeterminismResult)
                            gz(this, hz, "f").removeEventListener("message", t),
                            e(n.data.isDeterminstic)
                    }
                    ;
                    gz(this, hz, "f").addEventListener("message", t),
                    gz(this, hz, "f").postMessage({
                        messageType: oz.TestDeterminism
                    })
                }
                ))
            }
            createCar(e, t, n, i, r, a) {
                var s, o;
                if (null == gz(this, cz, "f"))
                    throw new Error("TrackPartManager is not initialized");
                if (null == Qw.models)
                    throw new Error("Car collision model not loaded");
                const l = (mz(this, uz, (o = gz(this, uz, "f"),
                s = o++,
                o), "f"),
                s)
                  , c = e => {
                    if (e.data.messageType == oz.UpdateResult) {
                        const t = e.data.carStates;
                        for (const e of t)
                            e.id == l && a(e)
                    }
                }
                ;
                gz(this, hz, "f").addEventListener("message", c),
                gz(this, pz, "f").set(l, c),
                gz(this, hz, "f").postMessage({
                    messageType: oz.CreateCar,
                    mountainVertices: t,
                    mountainOffset: {
                        x: n.x,
                        y: n.y,
                        z: n.z
                    },
                    trackData: i.toSaveString(),
                    carId: l,
                    carCollisionShapeVertices: Qw.models.collisionShapeVertices,
                    carMassOffset: Qw.massOffset,
                    carRecording: null == r ? void 0 : r.serialize()
                });
                const h = [new bn(.627909,.27 - Qw.suspensionResetLengthFront,1.3478).applyQuaternion(e.quaternion).add(e.position), new bn(-.627909,.27 - Qw.suspensionResetLengthFront,1.3478).applyQuaternion(e.quaternion).add(e.position), new bn(.720832,.27 - Qw.suspensionResetLengthRear,-1.52686).applyQuaternion(e.quaternion).add(e.position), new bn(-.720832,.27 - Qw.suspensionResetLengthRear,-1.52686).applyQuaternion(e.quaternion).add(e.position)]
                  , d = [(new yn).setFromEuler((new si).set(0, Math.PI, 0)).multiply(e.quaternion), (new yn).setFromEuler((new si).set(0, Math.PI, 0)).multiply(e.quaternion), (new yn).setFromEuler((new si).set(0, Math.PI, 0)).multiply(e.quaternion), (new yn).setFromEuler((new si).set(0, Math.PI, 0)).multiply(e.quaternion)];
                return {
                    id: l,
                    frames: 0,
                    speedKmh: 0,
                    hasStarted: !1,
                    finishFrames: null,
                    nextCheckpointIndex: 0,
                    hasCheckpointToRespawnAt: !1,
                    position: {
                        x: e.position.x,
                        y: e.position.y,
                        z: e.position.z
                    },
                    quaternion: {
                        x: e.quaternion.x,
                        y: e.quaternion.y,
                        z: e.quaternion.z,
                        w: e.quaternion.w
                    },
                    collisionImpulses: [],
                    wheelContact: [null, null, null, null],
                    wheelSuspensionLength: [Qw.suspensionResetLengthFront, Qw.suspensionResetLengthFront, Qw.suspensionResetLengthRear, Qw.suspensionResetLengthRear],
                    wheelSuspensionVelocity: [0, 0, 0, 0],
                    wheelRotation: [0, 0, 0, 0],
                    wheelDeltaRotation: [0, 0, 0, 0],
                    wheelSkidInfo: [0, 0, 0, 0],
                    wheelPosition: h,
                    wheelQuaternion: d,
                    brakeLightEnabled: !1,
                    controls: {
                        up: !1,
                        right: !1,
                        down: !1,
                        left: !1,
                        reset: !1
                    }
                }
            }
            deleteCar(e) {
                gz(this, hz, "f").postMessage({
                    messageType: oz.DeleteCar,
                    carId: e
                });
                const t = gz(this, pz, "f").get(e);
                if (null == t)
                    throw new Error("Deleting non-existant car");
                gz(this, hz, "f").removeEventListener("message", t),
                gz(this, pz, "f").delete(e)
            }
            startCar(e, t) {
                gz(this, hz, "f").postMessage({
                    messageType: oz.StartCar,
                    carId: e,
                    targetSimulationTimeFrames: null == t ? void 0 : t.numberOfFrames
                })
            }
            controlCar(e, t, n, i, r, a) {
                gz(this, hz, "f").postMessage({
                    messageType: oz.ControlCar,
                    carId: e,
                    up: t,
                    right: n,
                    down: i,
                    left: r,
                    reset: a
                })
            }
            pauseCar(e, t) {
                gz(this, hz, "f").postMessage({
                    messageType: oz.PauseCar,
                    carId: e,
                    isPaused: t
                })
            }
        }
        ;
        var wz = i(2796)
          , yz = {};
        yz.styleTagTransform = u(),
        yz.setAttributes = l(),
        yz.insert = s().bind(null, "head"),
        yz.domAPI = r(),
        yz.insertStyleElement = h();
        t()(wz.A, yz);
        wz.A && wz.A.locals && wz.A.locals;
        var bz, Az, xz, kz, Ez, Sz, Mz, _z = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, Tz = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        bz = new WeakMap,
        Az = new WeakMap,
        xz = new WeakMap,
        kz = new WeakMap,
        Ez = new WeakMap,
        Sz = new WeakMap,
        Mz = new WeakMap;
        const Cz = class {
            constructor(e, t, n, i, r, a) {
                bz.set(this, void 0),
                Az.set(this, void 0),
                xz.set(this, void 0),
                kz.set(this, void 0),
                Ez.set(this, void 0),
                Sz.set(this, void 0),
                Mz.set(this, new Map);
                const s = document.getElementById("ui");
                if (null == s)
                    throw new Error("UI element not found");
                _z(this, bz, s, "f"),
                _z(this, Az, document.createElement("div"), "f"),
                Tz(this, Az, "f").className = "verifier-ui",
                Tz(this, bz, "f").appendChild(Tz(this, Az, "f")),
                _z(this, xz, document.createElement("p"), "f"),
                Tz(this, Az, "f").appendChild(Tz(this, xz, "f"));
                const o = document.createElement("p");
                o.textContent = "Number of threads: " + t.toString(),
                Tz(this, Az, "f").appendChild(o);
                const l = document.createElement("input");
                l.type = "range",
                l.min = "0",
                l.max = t.toString(),
                l.value = t.toString(),
                l.addEventListener("change", ( () => {
                    const e = parseInt(l.value, 10);
                    o.textContent = "Number of threads: " + e.toString(),
                    r(e)
                }
                )),
                Tz(this, Az, "f").appendChild(l);
                const c = document.createElement("p");
                c.textContent = "Max time: " + Math.floor(n / 60 / 1e3).toString() + " minutes",
                Tz(this, Az, "f").appendChild(c);
                const h = document.createElement("input");
                h.type = "range",
                h.min = 6e4 .toString(),
                h.max = Lv.maxFrames.toString(),
                h.value = n.toString(),
                h.addEventListener("input", ( () => {
                    const e = parseInt(h.value, 10);
                    c.textContent = "Max time: " + Math.floor(e / 60 / 1e3).toString() + " minutes",
                    a(e)
                }
                )),
                Tz(this, Az, "f").appendChild(h);
                const d = document.createElement("table");
                Tz(this, Az, "f").appendChild(d),
                _z(this, kz, d.createTHead(), "f"),
                _z(this, Ez, d.createTBody(), "f");
                const u = Tz(this, kz, "f").insertRow();
                for (const e of ["Track", "State", "Verified", "Invalid", "Estimated remaining"]) {
                    const t = document.createElement("th");
                    t.textContent = e,
                    u.appendChild(t)
                }
                const p = document.createElement("button");
                p.className = "button",
                p.textContent = "Stop",
                p.addEventListener("click", ( () => {
                    e.playUIClick(),
                    i()
                }
                )),
                Tz(this, Az, "f").appendChild(p),
                window.addEventListener("keydown", _z(this, Sz, (e => {
                    "Escape" == e.code && (i(),
                    e.preventDefault())
                }
                ), "f"))
            }
            dispose() {
                Tz(this, bz, "f").removeChild(Tz(this, Az, "f")),
                window.removeEventListener("keydown", Tz(this, Sz, "f"))
            }
            setText(e) {
                Tz(this, xz, "f").textContent = e
            }
            setTracks(e) {
                for (const t of e) {
                    let e = Tz(this, Mz, "f").get(t.id);
                    if (null == e) {
                        e = {
                            element: Tz(this, Ez, "f").insertRow(),
                            name: t.name,
                            exhausted: t.exhausted,
                            recordingsVerified: t.recordingsVerified,
                            invalidRecordings: t.invalidRecordings,
                            estimatedRemaining: t.estimatedRemaining
                        },
                        Tz(this, Mz, "f").set(t.id, e);
                        e.element.insertCell().textContent = t.name;
                        e.element.insertCell().textContent = t.exhausted ? "Empty" : "Processing";
                        e.element.insertCell().textContent = t.recordingsVerified.toString();
                        e.element.insertCell().textContent = t.invalidRecordings.toString();
                        const n = e.element.insertCell();
                        null != t.estimatedRemaining ? n.textContent = t.estimatedRemaining.toString() : n.textContent = "?"
                    } else
                        e.name != t.name && (e.element.cells[0].textContent = t.name,
                        e.name = t.name),
                        e.exhausted != t.exhausted && (e.element.cells[1].textContent = t.exhausted ? "Empty" : "Processing",
                        e.exhausted = t.exhausted),
                        e.recordingsVerified != t.recordingsVerified && (e.element.cells[2].textContent = t.recordingsVerified.toString(),
                        e.recordingsVerified = t.recordingsVerified),
                        e.invalidRecordings != t.invalidRecordings && (e.element.cells[3].textContent = t.invalidRecordings.toString(),
                        e.invalidRecordings = t.invalidRecordings),
                        e.estimatedRemaining != t.estimatedRemaining && (null != t.estimatedRemaining ? e.element.cells[4].textContent = t.estimatedRemaining.toString() : e.element.cells[4].textContent = "?",
                        e.estimatedRemaining = t.estimatedRemaining)
                }
            }
        }
        ;
        var Pz, Iz, Rz, Lz, Dz, Nz, Bz, Uz, zz, Oz, Fz, Wz, Hz, Vz, Gz, jz, Qz, Kz, qz, Yz, Xz, Zz, Jz, $z, eO, tO, nO, iO, rO, aO, sO, oO, lO, cO, hO, dO = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, uO = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        class pO {
            constructor(e, t, n, i, r, a, s, o, l) {
                Pz.add(this),
                Rz.set(this, void 0),
                Lz.set(this, void 0),
                Dz.set(this, void 0),
                Nz.set(this, void 0),
                Bz.set(this, void 0),
                Uz.set(this, void 0),
                zz.set(this, void 0),
                Oz.set(this, []),
                Fz.set(this, []),
                Wz.set(this, []),
                Hz.set(this, !1),
                Vz.set(this, new Date),
                Gz.set(this, []),
                jz.set(this, !0),
                Qz.set(this, void 0),
                Kz.set(this, !1),
                qz.set(this, new Date),
                Yz.set(this, 0),
                Xz.set(this, 0),
                Zz.set(this, 0),
                Jz.set(this, 0),
                $z.set(this, 100),
                eO.set(this, 100),
                tO.set(this, 1e3),
                nO.set(this, 36e5),
                iO.set(this, 6e5),
                rO.set(this, 4),
                aO.set(this, void 0),
                sO.set(this, null),
                dO(this, Rz, e, "f"),
                dO(this, Lz, t, "f"),
                dO(this, Dz, a, "f"),
                dO(this, Nz, n, "f"),
                dO(this, Bz, s, "f"),
                dO(this, Uz, o, "f"),
                "undefined" != typeof navigator && "hardwareConcurrency"in navigator && navigator.hardwareConcurrency > 0 && dO(this, rO, navigator.hardwareConcurrency, "f"),
                dO(this, aO, uO(this, rO, "f"), "f"),
                t.clear(),
                dO(this, zz, new Cz(e,uO(this, rO, "f"),uO(this, iO, "f"),l,(e => {
                    for (dO(this, aO, e, "f"); uO(this, Oz, "f").length < uO(this, aO, "f"); )
                        uO(this, Oz, "f").push({
                            simulation: new vz(!1,r,s),
                            isBusy: !1,
                            isDisposed: !1
                        });
                    for (; uO(this, Oz, "f").length > uO(this, aO, "f"); ) {
                        const e = uO(this, Oz, "f").pop();
                        null != e && (e.simulation.dispose(),
                        e.isDisposed = !0)
                    }
                }
                ),(e => {
                    dO(this, iO, e, "f");
                    for (const e of uO(this, Fz, "f"))
                        e.timeout = new Date,
                        e.estimatedRemaining = null
                }
                )), "f");
                for (let e = 0; e < uO(this, aO, "f"); e++)
                    uO(this, Oz, "f").push({
                        simulation: new vz(!1,r,uO(this, Bz, "f")),
                        isBusy: !1,
                        isDisposed: !1
                    });
                i.forEachTrack(( (e, t, n) => {
                    uO(this, Fz, "f").push({
                        id: e,
                        name: t.name,
                        data: n,
                        timeout: new Date,
                        recordingsVerified: 0,
                        invalidRecordings: 0,
                        estimatedRemaining: null,
                        lastEstimatedRemainingTime: null
                    })
                }
                )),
                dO(this, Qz, setInterval(( () => {
                    uO(this, Pz, "m", cO).call(this)
                }
                ), 10), "f");
                try {
                    navigator.wakeLock.request("screen").then((e => {
                        uO(this, Kz, "f") ? e.release().catch((e => {
                            console.error(e)
                        }
                        )) : dO(this, sO, e, "f")
                    }
                    )).catch((e => {
                        console.warn(e)
                    }
                    ))
                } catch (e) {
                    console.error(e)
                }
            }
            dispose() {
                dO(this, Kz, !0, "f"),
                uO(this, zz, "f").dispose();
                for (const e of uO(this, Oz, "f"))
                    e.simulation.dispose(),
                    e.isDisposed = !0;
                uO(this, Oz, "f").length = 0,
                clearInterval(uO(this, Qz, "f")),
                null != uO(this, sO, "f") && uO(this, sO, "f").release().catch((e => {
                    console.error(e)
                }
                ))
            }
            update(e) {
                if (uO(this, Bz, "f").hasLoaded()) {
                    const e = new Date
                      , t = (e.getTime() - uO(this, qz, "f").getTime()) / 1e3;
                    let n = "";
                    uO(this, jz, "f") ? n += "Recordings are being verified...\n" : n += "Error: User is no longer a verifier\n",
                    n += "\nBacklog: " + uO(this, Gz, "f").length.toString(),
                    n += "\nProcessing: " + uO(this, Yz, "f").toString(),
                    n += "\nRecordings verified: " + uO(this, Xz, "f").toString(),
                    n += "\nInvalid recordings found: " + uO(this, Zz, "f").toString(),
                    n += "\n";
                    const i = uO(this, Xz, "f") / t;
                    n += "\nVerifications per second: " + i.toFixed(2),
                    n += "\nSimulated frames per second: " + Math.floor(uO(this, Jz, "f") / t).toString(),
                    n += "\n";
                    const r = uO(this, Fz, "f").reduce(( (e, t) => null != t.estimatedRemaining ? e + t.estimatedRemaining : e), 0);
                    n += "\nTotal estimated remaining: " + r.toString(),
                    n += "\nTotal estimated remaining time: " + uO(Iz, Iz, "m", hO).call(Iz, r / i),
                    uO(this, zz, "f").setTracks(uO(this, Fz, "f").map(( ({id: t, name: n, timeout: i, recordingsVerified: r, invalidRecordings: a, estimatedRemaining: s}) => ({
                        id: t,
                        name: n,
                        exhausted: i > e,
                        recordingsVerified: r,
                        invalidRecordings: a,
                        estimatedRemaining: s
                    })))),
                    uO(this, zz, "f").setText(n)
                }
                uO(this, Rz, "f").update(e, !1, uO(this, Lz, "f"), uO(this, Dz, "f"))
            }
        }
        Iz = pO,
        Rz = new WeakMap,
        Lz = new WeakMap,
        Dz = new WeakMap,
        Nz = new WeakMap,
        Bz = new WeakMap,
        Uz = new WeakMap,
        zz = new WeakMap,
        Oz = new WeakMap,
        Fz = new WeakMap,
        Wz = new WeakMap,
        Hz = new WeakMap,
        Vz = new WeakMap,
        Gz = new WeakMap,
        jz = new WeakMap,
        Qz = new WeakMap,
        Kz = new WeakMap,
        qz = new WeakMap,
        Yz = new WeakMap,
        Xz = new WeakMap,
        Zz = new WeakMap,
        Jz = new WeakMap,
        $z = new WeakMap,
        eO = new WeakMap,
        tO = new WeakMap,
        nO = new WeakMap,
        iO = new WeakMap,
        rO = new WeakMap,
        aO = new WeakMap,
        sO = new WeakMap,
        Pz = new WeakSet,
        oO = function(e) {
            const t = uO(this, Fz, "f").slice();
            do {
                const n = Math.floor(Math.random() * t.length)
                  , i = t.splice(n, 1)[0];
                if (e > i.timeout)
                    return i
            } while (t.length > 0);
            return null
        }
        ,
        lO = function() {
            var e;
            const t = new Date;
            if (!uO(this, Hz, "f") && uO(this, Gz, "f").length < uO(this, eO, "f") && Math.abs(t.getTime() - uO(this, Vz, "f").getTime()) >= uO(this, tO, "f")) {
                dO(this, Hz, !0, "f"),
                dO(this, Vz, t, "f");
                const n = uO(this, Pz, "m", oO).call(this, t);
                if (null != n || uO(this, Wz, "f").length > 0 && 0 == uO(this, Gz, "f").length || uO(this, Wz, "f").length > uO(this, $z, "f")) {
                    const i = uO(this, Wz, "f");
                    dO(this, Wz, [], "f");
                    const r = null != n && (null == n.lastEstimatedRemainingTime || Math.abs(t.getTime() - n.lastEstimatedRemainingTime.getTime()) >= uO(this, nO, "f"));
                    uO(this, Nz, "f").verifyRecordings(uO(this, Uz, "f"), null !== (e = null == n ? void 0 : n.id) && void 0 !== e ? e : null, uO(this, iO, "f"), r, i).then(( ({unverifiedRecordings: e, exhaustive: i, estimatedRemaining: r}) => {
                        null != n && (dO(this, Gz, uO(this, Gz, "f").concat(e.map(( ({id: e, recording: t, frames: i}) => ({
                            track: n,
                            trackData: n.data,
                            recordingId: e,
                            recording: Lv.deserialize(t),
                            time: new Gp(i)
                        })))), "f"),
                        i ? (n.timeout = new Date(t.getTime() + Math.floor(432e5 + 12 * Math.random() * 60 * 60 * 1e3)),
                        n.estimatedRemaining = e.length,
                        n.lastEstimatedRemainingTime = t) : null != r && (n.estimatedRemaining = r,
                        n.lastEstimatedRemainingTime = t))
                    }
                    )).catch((e => {
                        console.error(e),
                        uO(this, Nz, "f").getUser(uO(this, Uz, "f")).then((e => {
                            (null == e ? void 0 : e.isVerifier) || dO(this, jz, !1, "f")
                        }
                        )).catch((e => {
                            console.warn(e)
                        }
                        ))
                    }
                    )).finally(( () => {
                        dO(this, Hz, !1, "f")
                    }
                    ))
                } else
                    dO(this, Hz, !1, "f")
            }
        }
        ,
        cO = function() {
            var e, t, n;
            if (uO(this, Bz, "f").hasLoaded() && uO(this, jz, "f")) {
                uO(this, Pz, "m", lO).call(this);
                for (const i of uO(this, Oz, "f"))
                    if (!i.isBusy && uO(this, Gz, "f").length > 0) {
                        i.isBusy = !0;
                        const {track: r, trackData: a, recordingId: s, recording: o, time: l} = uO(this, Gz, "f").splice(0, 1)[0];
                        null == o ? (dO(this, Xz, (e = uO(this, Xz, "f"),
                        ++e), "f"),
                        r.recordingsVerified++,
                        dO(this, Zz, (t = uO(this, Zz, "f"),
                        ++t), "f"),
                        r.invalidRecordings++,
                        null != r.estimatedRemaining && (r.estimatedRemaining = Math.max(0, r.estimatedRemaining - 1),
                        0 == r.estimatedRemaining && (r.lastEstimatedRemainingTime = null)),
                        uO(this, Wz, "f").push({
                            id: s,
                            verifiedState: VT.Invalid
                        }),
                        i.isBusy = !1) : (dO(this, Yz, (n = uO(this, Yz, "f"),
                        ++n), "f"),
                        i.simulation.validate(a, o, l).then((e => {
                            var t, n;
                            dO(this, Xz, (t = uO(this, Xz, "f"),
                            ++t), "f"),
                            r.recordingsVerified++,
                            e || (dO(this, Zz, (n = uO(this, Zz, "f"),
                            ++n), "f"),
                            r.invalidRecordings++),
                            null != r.estimatedRemaining && (r.estimatedRemaining = Math.max(0, r.estimatedRemaining - 1),
                            0 == r.estimatedRemaining && (r.lastEstimatedRemainingTime = null)),
                            dO(this, Jz, uO(this, Jz, "f") + l.numberOfFrames, "f"),
                            uO(this, Wz, "f").push({
                                id: s,
                                verifiedState: e ? VT.Verified : VT.Invalid
                            })
                        }
                        )).catch((e => {
                            if (!i.isDisposed)
                                throw e
                        }
                        )).finally(( () => {
                            var e;
                            i.isBusy = !1,
                            dO(this, Yz, (e = uO(this, Yz, "f"),
                            --e), "f")
                        }
                        )))
                    }
            }
        }
        ,
        hO = function(e) {
            if (e <= 0 || !Number.isFinite(e))
                return "0s";
            if (e < 60)
                return e.toFixed(0) + "s";
            if (e < 3600) {
                const t = e % 60;
                return Math.floor(e / 60).toString() + "m " + t.toFixed(0) + "s"
            }
            if (e < 86400) {
                const t = Math.floor(e / 3600)
                  , n = Math.floor(e % 3600 / 60)
                  , i = e % 60;
                return t.toString() + "h " + n.toString() + "m " + i.toFixed(0) + "s"
            }
            {
                const t = Math.floor(e / 86400)
                  , n = Math.floor(e % 86400 / 3600)
                  , i = Math.floor(e % 3600 / 60)
                  , r = e % 60;
                return t.toString() + "d " + n.toString() + "h " + i.toString() + "m " + r.toFixed(0) + "s"
            }
        }
        ;
        const fO = pO
          , mO = {
            "Checkpoint order": "ترتيب النقاط التفتيشية",
            Height: "الارتفاع",
            Exit: "خروج",
            Random: "عشوائي",
            Primary: "أساسي",
            Secondary: "ثانوي",
            Frame: "الإطار",
            Rims: "الجنوط",
            "Are you sure you want to exit without saving?": "هل أنت متأكد من أنك تريد الخروج دون حفظ؟",
            "All changes will be lost!": "سيتم فقدان جميع التغييرات!",
            "Car saved!": "تم حفظ السيارة!",
            Test: "اختبار",
            "Starting point is missing!": "نقطة البداية مفقودة!",
            Generate: "إنشاء",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "هل أنت متأكد من أنك تريد إنشاء مسار جديد؟\n\nسيتم فقدان المسار الحالي!",
            Load: "تحميل",
            Save: "حفظ",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "هل أنت متأكد من أنك تريد تحميل مسار جديد؟\n\nسيتم فقدان المسار الحالي!",
            "Track saved!": "تم حفظ المسار!",
            "Failed to save!": "فشل الحفظ!",
            'Are you sure you want to overwrite "{0}"?': 'هل أنت متأكد من أنك تريد الكتابة فوق "{0}"؟',
            Export: "تصدير",
            Help: "مساعدة",
            "Are you sure you want to exit the editor?": "هل أنت متأكد من أنك تريد الخروج من المحرر؟",
            "All unsaved data will be lost!": "سيتم فقدان جميع البيانات غير المحفوظة!",
            "Track settings": "إعدادات المسار",
            "Unnamed Track": "مسار بدون اسم",
            "Track name": "اسم المسار",
            Author: "المؤلف",
            Unknown: "غير معروف",
            Environment: "البيئة",
            Summer: "الصيف",
            Winter: "الشتاء",
            Desert: "الصحراء",
            "Sun direction": "اتجاه الشمس",
            "How to use the editor": "كيفية استخدام المحرر",
            "Camera controls": "ضوابط الكاميرا",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "يمكن تحريك الكاميرا بالنقر بزر الماوس الأيمن وسحب الماوس. قم بتدوير الكاميرا بالنقر على زر الماوس الأوسط (عجلة الماوس) أو بالضغط على مفتاح التحكم والنقر بزر الماوس الأيمن وسحب الماوس. قم بالتكبير والتصغير عن طريق تمرير عجلة الماوس.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "بدلاً من ذلك، يمكن أيضًا التحكم في الكاميرا باستخدام مفاتيح لوحة المفاتيح التالية:",
            "Move forwards:": "تحرك للأمام:",
            "Move backwards:": "تحرك للخلف:",
            "Move left:": "تحرك لليسار:",
            "Move right:": "تحرك لليمين:",
            "Rotate left:": "تدوير لليسار:",
            "Rotate right:": "تدوير لليمين:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "يمكن تغيير الارتفاع المحرر إما باستخدام اختيار الارتفاع في الزاوية السفلية اليسرى، أو بالضغط على مفتاح Shift وتمرير عجلة الماوس. بدلاً من ذلك، يمكنك استخدام مفاتيح لوحة المفاتيح التالية:",
            "Move up:": "تحرك لأعلى:",
            "Move down:": "تحرك لأسفل:",
            Editing: "تحرير",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "يمكن اختيار أجزاء المسار في القائمة الموجودة على اليمين وبعد ذلك يمكن وضعها بالنقر بزر الماوس الأيسر.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "بدلاً من ذلك، يمكن اختيار جزء المسار الذي يتم تحويمه حاليًا بواسطة الماوس باستخدام اختصار لوحة المفاتيح التالي:",
            "The selected part can then be rotated using the following keyboard shortcut:": "يمكن بعد ذلك تدوير الجزء المحدد باستخدام اختصار لوحة المفاتيح التالي:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "يمكن حذف أجزاء المسار باستخدام أداة الحذف في القائمة الجانبية اليمنى أو بالضغط على المفتاح التالي:",
            "Starting points, checkpoints and the finish line": "نقاط البداية ونقاط التفتيش وخط النهاية",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "يمكن اختيار نقاط البداية ونقاط التفتيش وخطوط النهاية جميعها في الفئة العليا في القائمة الجانبية اليمنى.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "يجب أن يحتوي كل مسار على نقطة بداية واحدة على الأقل. إذا كانت هناك نقاط بداية متعددة، فسيتم استخدام آخر نقطة تم وضعها.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "يجب وضع نقاط التفتيش بين نقطة البداية وخط النهاية. عند اختيار جزء مسار نقطة التفتيش، سيكون هناك أداة في الزاوية السفلية اليمنى لاختيار ترتيب نقطة التفتيش. يحدد هذا الترتيب الذي يجب أن تمر به نقاط التفتيش قبل القيادة إلى خط النهاية. لاحظ أنه من الممكن أن يكون هناك نقاط تفتيش متعددة بنفس ترتيب نقطة التفتيش.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "خط النهاية هو المكان الذي ينتهي فيه المسار ولكنه سيصبح نشطًا فقط بعد اجتياز جميع نقاط التفتيش. من الممكن أيضًا أن يكون هناك خطوط نهاية متعددة.",
            "Starting point": "نقطة البداية",
            Checkpoint: "نقطة التفتيش",
            "Finish line": "خط النهاية",
            "Exporting the track": "تصدير المسار",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "عند الانتهاء من المسار، يمكن إدخال اسم للمسار في الزاوية العلوية اليسرى وبعد ذلك يمكن تصدير المسار باستخدام زر التصدير. سيظهر رمز المسار الذي يمكن إرساله إلى مستخدمين آخرين حتى يتمكنوا من استيراد وتشغيل المسار.",
            Close: "إغلاق",
            "Not set": "غير محدد",
            or: "أو",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "يمكن تحريك الكاميرا بالنقر بزر الماوس الأيمن وسحب الماوس. قم بتدوير الكاميرا بالنقر على زر الماوس الأوسط (عجلة الماوس) أو بالضغط على مفتاح التحكم والنقر بزر الماوس الأيمن وسحب الماوس. قم بالتكبير والتصغير عن طريق تمرير عجلة الماوس.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "يمكن تغيير الارتفاع المحرر باستخدام اختيار الارتفاع في الزاوية السفلية اليسرى.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "يمكن اختيار أجزاء المسار في القائمة الموجودة على اليمين وبعد ذلك يمكن وضعها بالنقر على الشاشة.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "يمكن بعد ذلك تدوير الجزء المحدد بالنقر على زر الدوران في الزاوية السفلية اليسرى.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "يمكن حذف أجزاء المسار باستخدام أداة الحذف في القائمة الجانبية اليمنى.",
            Watch: "مشاهدة",
            "Loading replay": "جاري تحميل التسجيل",
            "Press {0} to return to the last checkpoint": "اضغط {0} للعودة إلى آخر نقطة تفتيش",
            "Press {0} to start over": "اضغط {0} للبدء من جديد",
            "Reset once to return to the last checkpoint": "إعادة تعيين مرة واحدة للعودة إلى آخر نقطة تفتيش",
            "Reset again to start over": "إعادة تعيين مرة أخرى للبدء من جديد",
            Leaderboard: "التصنيف",
            "{0} players": "{0} لاعبون",
            Back: "عودة",
            "Error: Failed to load leaderboard": "خطأ: فشل تحميل التصنيف",
            "Unofficial versions of the game cannot access the leaderboard": "الإصدارات غير الرسمية من اللعبة لا يمكنها الوصول إلى التصنيف",
            Pending: "قيد الانتظار",
            Verified: "تم التحقق",
            Invalid: "غير صالح",
            Duplicate: "مكرر",
            You: "أنت",
            "Only verified": "المحققون فقط",
            Loading: "جاري التحميل",
            "Failed to load recordings": "فشل تحميل التسجيلات",
            "Cannot load recordings due to non-determinism": "لا يمكن تحميل التسجيلات بسبب عدم التحديد",
            Ok: "موافق",
            "Track is missing starting point": "المسار يفتقد نقطة البداية",
            "Some leaderboard features are disabled.": "تم تعطيل بعض ميزات التصنيف.",
            "Please try another browser or device.": "يرجى محاولة متصفح أو جهاز آخر.",
            "You already have another instance of PolyTrack open.": "لديك بالفعل نسخة أخرى من PolyTrack مفتوحة.",
            "Please switch to that tab or window to continue.": "يرجى التبديل إلى تلك التبويب أو النافذة للمتابعة.",
            "Computer determinism check failed.": "فشل فحص التحديد الحاسوبي.",
            "Non-deterministic game assets found.": "تم العثور على موارد اللعبة غير الحاسوبية.",
            "Please try clearing your browser cache.": "يرجى محاولة مسح ذاكرة التخزين المؤقت للمتصفح.",
            "Hardware acceleration is disabled. Performance may be reduced.": "تم تعطيل تسريع الأجهزة. قد يتم تقليل الأداء.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "يرجى التأكد من تمكين تسريع الأجهزة في إعدادات المتصفح الخاص بك.",
            Customize: "تخصيص",
            Editor: "المحرر",
            Settings: "الإعدادات",
            Profile: "الملف الشخصي",
            Play: "إلعب",
            Version: "الإصدار",
            "You cannot have duplicate user profiles": "لا يمكنك امتلاك ملفات تعريف مستخدم مكررة",
            "Failed to create user profile": "فشل في إنشاء ملف تعريف المستخدم",
            "This user profile does not exist on the server": "هذا الملف الشخصي للمستخدم غير موجود على الخادم",
            "Failed to download user profile from the server": "فشل في تحميل ملف تعريف المستخدم من الخادم",
            "User token is invalid": "رمز المستخدم غير صالح",
            "Are you sure you want to display your private key?": "هل أنت متأكد أنك تريد عرض المفتاح الخاص؟",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "لا تشارك هذا المفتاح مع أي شخص.",
            "You need a free user profile slot to import a new user profile": "تحتاج إلى فتحة ملف تعريف مستخدم فارغة لاستيراد ملف تعريف مستخدم جديد",
            Quit: "الخروج",
            Fullscreen: "ملء الشاشة",
            Windowed: "نافذة",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "يبدو أنك تلعب نسخة غير رسمية من {0}. للحصول على أحدث إصدار يرجى زيارة المصدر الأصلي:",
            Nickname: "اسم المستخدم",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "اختر اسم مستخدم ليظهر في التصنيف. يمكنك تغيير اسم المستخدم في أي وقت.",
            Cancel: "إلغاء",
            Confirm: "تأكيد",
            "User ID": "معرف المستخدم",
            Paused: "متوقف",
            "Switch car": "تبديل السيارة",
            Profiles: "الملفات",
            'Are you sure you would like to delete "{0}"?': 'هل أنت متأكد أنك تريد حذف "{0}"؟',
            Empty: "فارغ",
            Reset: "إعادة تعيين",
            Apply: "تطبيق",
            Gameplay: "أسلوب اللعب",
            Units: "الوحدات",
            Metric: "متري",
            Imperial: "إمبراطوري",
            "Reset hint": "إعادة تعيين التلميح",
            Disabled: "معطل",
            Enabled: "مفعل",
            "Ghost car": "سيارة الشبح",
            "Default camera": "الكاميرا الافتراضية",
            Default: "افتراضي",
            Cockpit: "القمرة",
            "Cockpit camera mode": "وضع الكاميرا في القمرة",
            Hold: "استمرار",
            Toggle: "تبديل",
            Checkpoints: "نقاط التفتيش",
            Timer: "المؤقت",
            Speedometer: "عداد السرعة",
            Bottom: "أسفل",
            Top: "أعلى",
            Language: "اللغة",
            Graphics: "الجرافيكس",
            Shadows: "الظلال",
            Off: "إيقاف",
            On: "تشغيل",
            Minimal: "أدنى",
            Low: "منخفض",
            Medium: "متوسط",
            High: "عالي",
            Ultra: "فائق",
            Clouds: "السحب",
            Particles: "الجسيمات",
            Skidmarks: "علامات الانزلاق",
            "Render scale": "مقياس الرسم",
            "Anti-aliasing (requires restart)": "تمويه الحواف (يتطلب إعادة التشغيل)",
            Audio: "الصوت",
            "Sound effect volume": "مستوى تأثير الصوت",
            "Music volume": "مستوى الموسيقى",
            "Checkpoint volume": "مستوى نقطة التفتيش",
            Mobile: "الجوال",
            Vibration: "الاهتزاز",
            "Steering control side": "جانب التحكم في التوجيه",
            Left: "يسار",
            Right: "يمين",
            Controls: "التحكم",
            Vehicle: "المركبة",
            Accelerate: "التسارع",
            Brake: "الفرامل",
            "Turn left": "الدوران لليسار",
            "Turn right": "الدوران لليمين",
            "Checkpoint reset": "إعادة تعيين نقطة التفتيش",
            "Start reset": "إعادة تعيين البداية",
            "Cockpit camera": "كاميرا القمرة",
            "Rotate part": "تدوير الجزء",
            "Height modifier": "معدل الارتفاع",
            "Delete part": "حذف الجزء",
            "Move forwards": "تحرك للأمام",
            "Move backwards": "تحرك للخلف",
            "Move left": "تحرك لليسار",
            "Move right": "تحرك لليمين",
            "Rotate view up": "تدوير العرض لأعلى",
            "Rotate view down": "تدوير العرض لأسفل",
            "Rotate view left": "تدوير العرض لليسار",
            "Rotate view right": "تدوير العرض لليمين",
            "Move down": "تحرك لأسفل",
            "Move up": "تحرك لأعلى",
            "Test track": "اختبار المسار",
            "Pick part": "اختيار الجزء",
            Spectator: "المشاهد",
            "Speed modifier": "معدل السرعة",
            Other: "أخرى",
            "Hide UI": "إخفاء واجهة المستخدم",
            Pause: "إيقاف مؤقت",
            "Toggle FPS counter": "تبديل عداد الإطارات في الثانية",
            "Toggle spectator camera": "تبديل كاميرا المشاهد",
            "Press any key...\n\nPress [Escape] to cancel.": "اضغط على أي مفتاح...\n\nاضغط [إلغاء] للإلغاء.",
            Clear: "مسح",
            "New record": "رقم قياسي جديد",
            Record: "الرقم القياسي",
            Current: "الحالي",
            Difference: "الفرق",
            Copy: "نسخ",
            Import: "استيراد",
            "Failed to import track": "فشل استيراد المسار",
            'The track "{0}" already exists. Do you wish to overwrite it?': 'المسار "{0}" موجود بالفعل. هل ترغب في الكتابة فوقه؟',
            Overwrite: "الكتابة فوقه",
            "Paste track data here...": "الصق بيانات المسار هنا...",
            Rank: "التصنيف",
            "Personal best": "الرقم القياسي الشخصي",
            Opponents: "المنافسون",
            "{0} opponent selected": "{0} منافس محدد",
            "{0} opponents selected": "{0} منافسين محددين",
            "Select opponents to race against from the leaderboard on the left": "اختر المنافسين للسباق ضدهم من لوحة المتصدرين على اليسار",
            "No record": "لا يوجد تسجيل",
            "Official tracks": "المسارات الرسمية",
            "Community tracks": "المسارات المجتمعية",
            "Custom tracks": "المسارات المخصصة",
            'Are you sure you want to delete "{0}"?': 'هل أنت متأكد من أنك تريد حذف "{0}"؟',
            Delete: "حذف",
            "No community tracks": "لا توجد مسارات مجتمعية",
            "Community tracks are coming soon": "المسارات المجتمعية قادمة قريبًا",
            "No custom tracks": "لا توجد مسارات مخصصة",
            "Create a track using the editor or import a track code": "أنشئ مسارًا باستخدام المحرر أو استورد رمز مسار",
            "Search by track or author...": "ابحث عن المسار أو المؤلف...",
            "Invalid replay detected!": "تم اكتشاف تسجيل غير صالح!"
        }
          , gO = {
            "Checkpoint order": "Kontrollpunktreihenfolge",
            Height: "Höhe",
            Exit: "Beenden",
            Random: "Zufällig",
            Primary: "Primär",
            Secondary: "Sekundär",
            Frame: "Rahmen",
            Rims: "Felgen",
            "Are you sure you want to exit without saving?": "Sind Sie sicher, dass Sie ohne Speichern beenden möchten?",
            "All changes will be lost!": "Alle Änderungen gehen verloren!",
            "Car saved!": "Auto gespeichert!",
            Test: "Test",
            "Starting point is missing!": "Startpunkt fehlt!",
            Generate: "Generieren",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "Sind Sie sicher, dass Sie eine neue Strecke generieren möchten?\n\nIhre aktuelle Strecke geht verloren!",
            Load: "Laden",
            Save: "Speichern",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "Sind Sie sicher, dass Sie eine neue Strecke laden möchten?\n\nIhre aktuelle Strecke geht verloren!",
            "Track saved!": "Strecke gespeichert!",
            "Failed to save!": "Speichern fehlgeschlagen!",
            'Are you sure you want to overwrite "{0}"?': 'Sind Sie sicher, dass Sie "{0}" überschreiben möchten?',
            Export: "Exportieren",
            Help: "Hilfe",
            "Are you sure you want to exit the editor?": "Sind Sie sicher, dass Sie den Editor verlassen möchten?",
            "All unsaved data will be lost!": "Alle nicht gespeicherten Daten gehen verloren!",
            "Track settings": "Streckeneinstellungen",
            "Unnamed Track": "Unbenannte Strecke",
            "Track name": "Streckenname",
            Author: "Autor",
            Unknown: "Unbekannt",
            Environment: "Umgebung",
            Summer: "Sommer",
            Winter: "Winter",
            Desert: "Wüste",
            "Sun direction": "Sonnenrichtung",
            "How to use the editor": "Wie man den Editor benutzt",
            "Camera controls": "Kamerasteuerung",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "Die Kamera kann durch Rechtsklick und Ziehen der Maus bewegt werden. Drehen Sie die Kamera, indem Sie die mittlere Maustaste (Mausrad) klicken oder die Steuerungstaste gedrückt halten und mit der rechten Maustaste ziehen. Zoomen Sie mit dem Mausrad rein und raus.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "Alternativ kann die Kamera auch mit den folgenden Tasten gesteuert werden:",
            "Move forwards:": "Nach vorne bewegen:",
            "Move backwards:": "Nach hinten bewegen:",
            "Move left:": "Nach links bewegen:",
            "Move right:": "Nach rechts bewegen:",
            "Rotate left:": "Nach links drehen:",
            "Rotate right:": "Nach rechts drehen:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "Die bearbeitete Höhe kann entweder durch Verwendung der Höhenauswahl in der unteren linken Ecke geändert werden oder indem Sie die Umschalttaste gedrückt halten und das Mausrad scrollen. Alternativ können Sie die folgenden Tasten verwenden:",
            "Move up:": "Nach oben bewegen:",
            "Move down:": "Nach unten bewegen:",
            Editing: "Bearbeiten",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "Streckenteile können im Menü auf der rechten Seite ausgewählt werden, danach können sie durch Linksklick mit der Maus platziert werden.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "Alternativ kann das Streckenteil, über das die Maus gerade schwebt, mit der folgenden Tastenkombination ausgewählt werden:",
            "The selected part can then be rotated using the following keyboard shortcut:": "Das ausgewählte Teil kann dann mit der folgenden Tastenkombination gedreht werden:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "Streckenteile können mit dem Löschwerkzeug im Menü auf der rechten Seite gelöscht werden oder indem Sie die folgende Taste gedrückt halten:",
            "Starting points, checkpoints and the finish line": "Startpunkte, Kontrollpunkte und die Ziellinie",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "Startpunkte, Kontrollpunkte und Ziellinien können alle in der obersten Kategorie im Menü auf der rechten Seite ausgewählt werden.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "Jede Strecke muss mindestens einen Startpunkt haben. Wenn es mehrere Startpunkte gibt, wird der zuletzt platzierte verwendet.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "Kontrollpunkte sollten zwischen dem Startpunkt und der Ziellinie platziert werden. Wenn ein Kontrollpunkt-Streckenteil ausgewählt ist, gibt es unten rechts ein Werkzeug, um die Reihenfolge des Kontrollpunkts auszuwählen. Dies bestimmt die Reihenfolge, in der die Kontrollpunkte passiert werden müssen, bevor man zur Ziellinie fährt. Beachten Sie, dass es möglich ist, mehrere Kontrollpunkte mit derselben Kontrollpunkt-Reihenfolge zu haben.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "Die Ziellinie ist der Ort, an dem die Strecke endet, wird aber erst aktiv, nachdem alle Kontrollpunkte passiert wurden. Es ist auch möglich, mehrere Ziellinien zu haben.",
            "Starting point": "Startpunkt",
            Checkpoint: "Kontrollpunkt",
            "Finish line": "Ziellinie",
            "Exporting the track": "Exportieren der Strecke",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "Wenn die Strecke fertig ist, kann oben links ein Name für die Strecke eingegeben werden, danach kann die Strecke mit dem Export-Button exportiert werden. Dadurch wird ein Streckencode angezeigt, der an andere Benutzer gesendet werden kann, damit sie die Strecke importieren und spielen können.",
            Close: "Schließen",
            "Not set": "Nicht festgelegt",
            or: "oder",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "Die Kamera kann durch Ziehen mit einem Finger bewegt werden. Drehen Sie die Kamera, indem Sie mit zwei Fingern ziehen. Zoomen Sie rein und raus, indem Sie kneifen.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "Die bearbeitete Höhe kann durch Verwendung der Höhenauswahl in der unteren linken Ecke geändert werden.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "Streckenteile können im Menü auf der rechten Seite ausgewählt werden, danach können sie durch Antippen des Bildschirms platziert werden.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "Das ausgewählte Teil kann dann durch Antippen der Drehen-Schaltfläche in der unteren linken Ecke gedreht werden.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "Streckenteile können mit dem Löschwerkzeug im Menü auf der rechten Seite gelöscht werden.",
            Watch: "Zuschauen",
            "Loading replay": "Wiederholung laden",
            "Press {0} to return to the last checkpoint": "Drücken Sie {0}, um zum letzten Kontrollpunkt zurückzukehren",
            "Press {0} to start over": "Drücken Sie {0}, um von vorne zu beginnen",
            "Reset once to return to the last checkpoint": "Einmal zurücksetzen, um zum letzten Kontrollpunkt zurückzukehren",
            "Reset again to start over": "Erneut zurücksetzen, um von vorne zu beginnen",
            Leaderboard: "Bestenliste",
            "{0} players": "{0} Spieler",
            Back: "Zurück",
            "Error: Failed to load leaderboard": "Fehler: Laden der Bestenliste fehlgeschlagen",
            "Unofficial versions of the game cannot access the leaderboard": "Inoffizielle Versionen des Spiels können nicht auf die Bestenliste zugreifen",
            Pending: "Ausstehend",
            Verified: "Verifiziert",
            Invalid: "Ungültig",
            Duplicate: "Duplikat",
            You: "Sie",
            "Only verified": "Nur verifizierte",
            Loading: "Laden",
            "Failed to load recordings": "Aufnahmen konnten nicht geladen werden",
            "Cannot load recordings due to non-determinism": "Aufgrund von Nicht-Determinismus können keine Aufnahmen geladen werden",
            Ok: "Ok",
            "Track is missing starting point": "Strecke hat keinen Startpunkt",
            "Some leaderboard features are disabled.": "Einige Bestenlistenfunktionen sind deaktiviert.",
            "Please try another browser or device.": "Bitte versuchen Sie einen anderen Browser oder ein anderes Gerät.",
            "You already have another instance of PolyTrack open.": "Sie haben bereits eine andere Instanz von PolyTrack geöffnet.",
            "Please switch to that tab or window to continue.": "Bitte wechseln Sie zu diesem Tab oder Fenster, um fortzufahren.",
            "Computer determinism check failed.": "Der Computer-Determinismus-Check ist fehlgeschlagen.",
            "Non-deterministic game assets found.": "Nicht-deterministische Spiel-Assets gefunden.",
            "Please try clearing your browser cache.": "Bitte versuchen Sie, Ihren Browser-Cache zu löschen.",
            "Hardware acceleration is disabled. Performance may be reduced.": "Hardware-Beschleunigung ist deaktiviert. Die Leistung kann beeinträchtigt sein.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "Bitte stellen Sie sicher, dass die Hardware-Beschleunigung in Ihren Browsereinstellungen aktiviert ist.",
            Customize: "Anpassen",
            Editor: "Editor",
            Settings: "Einstellungen",
            Profile: "Profil",
            Play: "Spielen",
            Version: "Version",
            "You cannot have duplicate user profiles": "Sie können keine doppelten Benutzerprofile haben",
            "Failed to create user profile": "Benutzerprofil konnte nicht erstellt werden",
            "This user profile does not exist on the server": "Dieses Benutzerprofil existiert nicht auf dem Server",
            "Failed to download user profile from the server": "Benutzerprofil konnte nicht vom Server heruntergeladen werden",
            "User token is invalid": "Benutzertoken ist ungültig",
            "Are you sure you want to display your private key?": "Möchten Sie Ihren privaten Schlüssel wirklich anzeigen?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "TEILEN SIE DIESEN SCHLÜSSEL NICHT MIT JEMANDEM.",
            "You need a free user profile slot to import a new user profile": "Sie benötigen einen freien Benutzerprofil-Slot, um ein neues Benutzerprofil zu importieren",
            Quit: "Beenden",
            Fullscreen: "Vollbild",
            Windowed: "Fenstermodus",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "Es scheint, dass Sie eine inoffizielle Version von {0} spielen. Für die aktuellste Version besuchen Sie bitte die Originalquelle:",
            Nickname: "Spitzname",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "Wählen Sie einen Spitznamen, der in der Bestenliste angezeigt wird. Ihr Spitzname kann jederzeit geändert werden.",
            Cancel: "Abbrechen",
            Confirm: "Bestätigen",
            "User ID": "Benutzer-ID",
            Paused: "Pausiert",
            "Switch car": "Auto wechseln",
            Profiles: "Profile",
            'Are you sure you would like to delete "{0}"?': 'Möchten Sie "{0}" wirklich löschen?',
            Empty: "Leer",
            Reset: "Zurücksetzen",
            Apply: "Anwenden",
            Gameplay: "Spielablauf",
            Units: "Einheiten",
            Metric: "Metrisch",
            Imperial: "Imperial",
            "Reset hint": "Hinweis zurücksetzen",
            Disabled: "Deaktiviert",
            Enabled: "Aktiviert",
            "Ghost car": "Geisterauto",
            "Default camera": "Standardkamera",
            Default: "Standard",
            Cockpit: "Cockpit",
            "Cockpit camera mode": "Cockpit-Kameramodus",
            Hold: "Halten",
            Toggle: "Umschalten",
            Checkpoints: "Kontrollpunkte",
            Timer: "Timer",
            Speedometer: "Tachometer",
            Bottom: "Unten",
            Top: "Oben",
            Language: "Sprache",
            Graphics: "Grafik",
            Shadows: "Schatten",
            Off: "Aus",
            On: "An",
            Minimal: "Minimal",
            Low: "Niedrig",
            Medium: "Mittel",
            High: "Hoch",
            Ultra: "Ultra",
            Clouds: "Wolken",
            Particles: "Partikel",
            Skidmarks: "Reifenspuren",
            "Render scale": "Render-Skalierung",
            "Anti-aliasing (requires restart)": "Antialiasing (erfordert Neustart)",
            Audio: "Audio",
            "Sound effect volume": "Lautstärke Soundeffekte",
            "Music volume": "Lautstärke Musik",
            "Checkpoint volume": "Lautstärke Kontrollpunkt",
            Mobile: "Mobil",
            Vibration: "Vibration",
            "Steering control side": "Steuerungsseite",
            Left: "Links",
            Right: "Rechts",
            Controls: "Steuerung",
            Vehicle: "Fahrzeug",
            Accelerate: "Beschleunigen",
            Brake: "Bremsen",
            "Turn left": "Nach links lenken",
            "Turn right": "Nach rechts lenken",
            "Checkpoint reset": "Kontrollpunkt zurücksetzen",
            "Start reset": "Start zurücksetzen",
            "Cockpit camera": "Cockpit-Kamera",
            "Rotate part": "Teil drehen",
            "Height modifier": "Höhenmodifikator",
            "Delete part": "Teil löschen",
            "Move forwards": "Nach vorne bewegen",
            "Move backwards": "Nach hinten bewegen",
            "Move left": "Nach links bewegen",
            "Move right": "Nach rechts bewegen",
            "Rotate view up": "Ansicht nach oben drehen",
            "Rotate view down": "Ansicht nach unten drehen",
            "Rotate view left": "Ansicht nach links drehen",
            "Rotate view right": "Ansicht nach rechts drehen",
            "Move down": "Nach unten bewegen",
            "Move up": "Nach oben bewegen",
            "Test track": "Strecke testen",
            "Pick part": "Teil auswählen",
            Spectator: "Zuschauer",
            "Speed modifier": "Geschwindigkeitsmodifikator",
            Other: "Sonstiges",
            "Hide UI": "UI ausblenden",
            Pause: "Pause",
            "Toggle FPS counter": "FPS-Zähler umschalten",
            "Toggle spectator camera": "Zuschauerkamera umschalten",
            "Press any key...\n\nPress [Escape] to cancel.": "Drücken Sie eine beliebige Taste...\n\nDrücken Sie [Escape], um abzubrechen.",
            Clear: "Löschen",
            "New record": "Neuer Rekord",
            Record: "Rekord",
            Current: "Aktuell",
            Difference: "Differenz",
            Copy: "Kopieren",
            Import: "Importieren",
            "Failed to import track": "Import der Strecke fehlgeschlagen",
            'The track "{0}" already exists. Do you wish to overwrite it?': 'Die Strecke "{0}" existiert bereits. Möchten Sie sie überschreiben?',
            Overwrite: "Überschreiben",
            "Paste track data here...": "Streckendaten hier einfügen...",
            Rank: "Rang",
            "Personal best": "Persönlicher Rekord",
            Opponents: "Gegner",
            "{0} opponent selected": "{0} Gegner ausgewählt",
            "{0} opponents selected": "{0} Gegner ausgewählt",
            "Select opponents to race against from the leaderboard on the left": "Wählen Sie Gegner aus der Bestenliste links aus, gegen die Sie antreten möchten",
            "No record": "Kein Rekord",
            "Official tracks": "Offizielle Strecken",
            "Community tracks": "Community-Strecken",
            "Custom tracks": "Benutzerdefinierte Strecken",
            'Are you sure you want to delete "{0}"?': 'Sind Sie sicher, dass Sie "{0}" löschen möchten?',
            Delete: "Löschen",
            "No community tracks": "Keine Community-Strecken",
            "Community tracks are coming soon": "Community-Strecken kommen bald",
            "No custom tracks": "Keine benutzerdefinierten Strecken",
            "Create a track using the editor or import a track code": "Erstellen Sie eine Strecke mit dem Editor oder importieren Sie einen Streckencode",
            "Search by track or author...": "Suche nach Strecke oder Autor...",
            "Invalid replay detected!": "Ungültige Wiederholung erkannt!"
        }
          , vO = {
            "Checkpoint order": "Checkpoint order",
            Height: "Height",
            Exit: "Exit",
            Random: "Random",
            Primary: "Primary",
            Secondary: "Secondary",
            Frame: "Frame",
            Rims: "Rims",
            "Are you sure you want to exit without saving?": "Are you sure you want to exit without saving?",
            "All changes will be lost!": "All changes will be lost!",
            "Car saved!": "Car saved!",
            Test: "Test",
            "Starting point is missing!": "Starting point is missing!",
            Generate: "Generate",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "Are you sure you want to generate a new track?\n\nYour current track will be lost!",
            Load: "Load",
            Save: "Save",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "Are you sure you want to load a new track?\n\nYour current track will be lost!",
            "Track saved!": "Track saved!",
            "Failed to save!": "Failed to save!",
            'Are you sure you want to overwrite "{0}"?': 'Are you sure you want to overwrite "{0}"?',
            Export: "Export",
            Help: "Help",
            "Are you sure you want to exit the editor?": "Are you sure you want to exit the editor?",
            "All unsaved data will be lost!": "All unsaved data will be lost!",
            "Track settings": "Track settings",
            "Unnamed Track": "Unnamed Track",
            "Track name": "Track name",
            Author: "Author",
            Unknown: "Unknown",
            Environment: "Environment",
            Summer: "Summer",
            Winter: "Winter",
            Desert: "Desert",
            "Sun direction": "Sun direction",
            "How to use the editor": "How to use the editor",
            "Camera controls": "Camera controls",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "Alternatively, the camera can also be controlled using the following keyboard keys:",
            "Move forwards:": "Move forwards:",
            "Move backwards:": "Move backwards:",
            "Move left:": "Move left:",
            "Move right:": "Move right:",
            "Rotate left:": "Rotate left:",
            "Rotate right:": "Rotate right:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:",
            "Move up:": "Move up:",
            "Move down:": "Move down:",
            Editing: "Editing",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:",
            "The selected part can then be rotated using the following keyboard shortcut:": "The selected part can then be rotated using the following keyboard shortcut:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:",
            "Starting points, checkpoints and the finish line": "Starting points, checkpoints and the finish line",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.",
            "Starting point": "Starting point",
            Checkpoint: "Checkpoint",
            "Finish line": "Finish line",
            "Exporting the track": "Exporting the track",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.",
            Close: "Close",
            "Not set": "Not set",
            or: "or",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "The edited height can be changed by using the height selection in the bottom left corner.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "The selected part can then be rotated by tapping the rotate button in the bottom left corner.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "Track parts can be deleted by using the delete tool in the right side menu.",
            Watch: "Watch",
            "Loading replay": "Loading replay",
            "Press {0} to return to the last checkpoint": "Press {0} to return to the last checkpoint",
            "Press {0} to start over": "Press {0} to start over",
            "Reset once to return to the last checkpoint": "Reset once to return to the last checkpoint",
            "Reset again to start over": "Reset again to start over",
            Leaderboard: "Leaderboard",
            "{0} players": "{0} players",
            Back: "Back",
            "Error: Failed to load leaderboard": "Error: Failed to load leaderboard",
            "Unofficial versions of the game cannot access the leaderboard": "Unofficial versions of the game cannot access the leaderboard",
            Pending: "Pending",
            Verified: "Verified",
            Invalid: "Invalid",
            Duplicate: "Duplicate",
            You: "You",
            "Only verified": "Only verified",
            Loading: "Loading",
            "Failed to load recordings": "Failed to load recordings",
            "Cannot load recordings due to non-determinism": "Cannot load recordings due to non-determinism",
            Ok: "Ok",
            "Track is missing starting point": "Track is missing starting point",
            "Some leaderboard features are disabled.": "Some leaderboard features are disabled.",
            "Please try another browser or device.": "Please try another browser or device.",
            "You already have another instance of PolyTrack open.": "You already have another instance of PolyTrack open.",
            "Please switch to that tab or window to continue.": "Please switch to that tab or window to continue.",
            "Computer determinism check failed.": "Computer determinism check failed.",
            "Non-deterministic game assets found.": "Non-deterministic game assets found.",
            "Please try clearing your browser cache.": "Please try clearing your browser cache.",
            "Hardware acceleration is disabled. Performance may be reduced.": "Hardware acceleration is disabled. Performance may be reduced.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "Please make sure hardware acceleration is enabled in your browser settings.",
            Customize: "Customize",
            Editor: "Editor",
            Settings: "Settings",
            Profile: "Profile",
            Play: "Play",
            Version: "Version",
            "You cannot have duplicate user profiles": "You cannot have duplicate user profiles",
            "Failed to create user profile": "Failed to create user profile",
            "This user profile does not exist on the server": "This user profile does not exist on the server",
            "Failed to download user profile from the server": "Failed to download user profile from the server",
            "User token is invalid": "User token is invalid",
            "Are you sure you want to display your private key?": "Are you sure you want to display your private key?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "DO NOT SHARE THIS KEY WITH ANYONE.",
            "You need a free user profile slot to import a new user profile": "You need a free user profile slot to import a new user profile",
            Quit: "Quit",
            Fullscreen: "Fullscreen",
            Windowed: "Windowed",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:",
            Nickname: "Nickname",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.",
            Cancel: "Cancel",
            Confirm: "Confirm",
            "User ID": "User ID",
            Paused: "Paused",
            "Switch car": "Switch car",
            Profiles: "Profiles",
            'Are you sure you would like to delete "{0}"?': 'Are you sure you would like to delete "{0}"?',
            Empty: "Empty",
            Reset: "Reset",
            Apply: "Apply",
            Gameplay: "Gameplay",
            Units: "Units",
            Metric: "Metric",
            Imperial: "Imperial",
            "Reset hint": "Reset hint",
            Disabled: "Disabled",
            Enabled: "Enabled",
            "Ghost car": "Ghost car",
            "Default camera": "Default camera",
            Default: "Default",
            Cockpit: "Cockpit",
            "Cockpit camera mode": "Cockpit camera mode",
            Hold: "Hold",
            Toggle: "Toggle",
            Checkpoints: "Checkpoints",
            Timer: "Timer",
            Speedometer: "Speedometer",
            Bottom: "Bottom",
            Top: "Top",
            Language: "Language",
            Graphics: "Graphics",
            Shadows: "Shadows",
            Off: "Off",
            On: "On",
            Minimal: "Minimal",
            Low: "Low",
            Medium: "Medium",
            High: "High",
            Ultra: "Ultra",
            Clouds: "Clouds",
            Particles: "Particles",
            Skidmarks: "Skidmarks",
            "Render scale": "Render scale",
            "Anti-aliasing (requires restart)": "Anti-aliasing (requires restart)",
            Audio: "Audio",
            "Sound effect volume": "Sound effect volume",
            "Music volume": "Music volume",
            "Checkpoint volume": "Checkpoint volume",
            Mobile: "Mobile",
            Vibration: "Vibration",
            "Steering control side": "Steering control side",
            Left: "Left",
            Right: "Right",
            Controls: "Controls",
            Vehicle: "Vehicle",
            Accelerate: "Accelerate",
            Brake: "Brake",
            "Turn left": "Turn left",
            "Turn right": "Turn right",
            "Checkpoint reset": "Checkpoint reset",
            "Start reset": "Start reset",
            "Cockpit camera": "Cockpit camera",
            "Rotate part": "Rotate part",
            "Height modifier": "Height modifier",
            "Delete part": "Delete part",
            "Move forwards": "Move forwards",
            "Move backwards": "Move backwards",
            "Move left": "Move left",
            "Move right": "Move right",
            "Rotate view up": "Rotate view up",
            "Rotate view down": "Rotate view down",
            "Rotate view left": "Rotate view left",
            "Rotate view right": "Rotate view right",
            "Move down": "Move down",
            "Move up": "Move up",
            "Test track": "Test track",
            "Pick part": "Pick part",
            Spectator: "Spectator",
            "Speed modifier": "Speed modifier",
            Other: "Other",
            "Hide UI": "Hide UI",
            Pause: "Pause",
            "Toggle FPS counter": "Toggle FPS counter",
            "Toggle spectator camera": "Toggle spectator camera",
            "Press any key...\n\nPress [Escape] to cancel.": "Press any key...\n\nPress [Escape] to cancel.",
            Clear: "Clear",
            "New record": "New record",
            Record: "Record",
            Current: "Current",
            Difference: "Difference",
            Copy: "Copy",
            Import: "Import",
            "Failed to import track": "Failed to import track",
            'The track "{0}" already exists. Do you wish to overwrite it?': 'The track "{0}" already exists. Do you wish to overwrite it?',
            Overwrite: "Overwrite",
            "Paste track data here...": "Paste track data here...",
            Rank: "Rank",
            "Personal best": "Personal best",
            Opponents: "Opponents",
            "{0} opponent selected": "{0} opponent selected",
            "{0} opponents selected": "{0} opponents selected",
            "Select opponents to race against from the leaderboard on the left": "Select opponents to race against from the leaderboard on the left",
            "No record": "No record",
            "Official tracks": "Official tracks",
            "Community tracks": "Community tracks",
            "Custom tracks": "Custom tracks",
            'Are you sure you want to delete "{0}"?': 'Are you sure you want to delete "{0}"?',
            Delete: "Delete",
            "No community tracks": "No community tracks",
            "Community tracks are coming soon": "Community tracks are coming soon",
            "No custom tracks": "No custom tracks",
            "Create a track using the editor or import a track code": "Create a track using the editor or import a track code",
            "Search by track or author...": "Search by track or author...",
            "Invalid replay detected!": "Invalid replay detected!"
        }
          , wO = {
            "Checkpoint order": "Orden de puntos de control",
            Height: "Altura",
            Exit: "Salir",
            Random: "Aleatorio",
            Primary: "Primario",
            Secondary: "Secundario",
            Frame: "Marco",
            Rims: "Llantas",
            "Are you sure you want to exit without saving?": "¿Estás seguro de que deseas salir sin guardar?",
            "All changes will be lost!": "¡Todos los cambios se perderán!",
            "Car saved!": "¡Coche guardado!",
            Test: "Prueba",
            "Starting point is missing!": "¡Falta el punto de inicio!",
            Generate: "Generar",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "¿Estás seguro de que deseas generar una nueva pista?\n\n¡Tu pista actual se perderá!",
            Load: "Cargar",
            Save: "Guardar",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "¿Estás seguro de que deseas cargar una nueva pista?\n\n¡Tu pista actual se perderá!",
            "Track saved!": "¡Pista guardada!",
            "Failed to save!": "Error al guardar!",
            'Are you sure you want to overwrite "{0}"?': '¿Estás seguro de que deseas sobrescribir "{0}"?',
            Export: "Exportar",
            Help: "Ayuda",
            "Are you sure you want to exit the editor?": "¿Estás seguro de que deseas salir del editor?",
            "All unsaved data will be lost!": "¡Se perderán todos los datos no guardados!",
            "Track settings": "Configuración de la pista",
            "Unnamed Track": "Pista sin nombre",
            "Track name": "Nombre de la pista",
            Author: "Autor",
            Unknown: "Desconocido",
            Environment: "Entorno",
            Summer: "Verano",
            Winter: "Invierno",
            Desert: "Desierto",
            "Sun direction": "Dirección del sol",
            "How to use the editor": "Cómo usar el editor",
            "Camera controls": "Controles de la cámara",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "La cámara se puede mover haciendo clic derecho y arrastrando el ratón. Gira la cámara haciendo clic con el botón central del ratón (rueda del ratón) o manteniendo presionada la tecla de control y haciendo clic derecho y arrastrando el ratón. Acércate y aléjate desplazando la rueda del ratón.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "Alternativamente, la cámara también se puede controlar usando las siguientes teclas del teclado:",
            "Move forwards:": "Mover hacia adelante:",
            "Move backwards:": "Mover hacia atrás:",
            "Move left:": "Mover a la izquierda:",
            "Move right:": "Mover a la derecha:",
            "Rotate left:": "Girar a la izquierda:",
            "Rotate right:": "Girar a la derecha:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "La altura editada se puede cambiar ya sea usando la selección de altura en la esquina inferior izquierda, o manteniendo presionada la tecla de mayúsculas y desplazando la rueda del ratón. Alternativamente, puedes usar las siguientes teclas del teclado:",
            "Move up:": "Mover hacia arriba:",
            "Move down:": "Mover hacia abajo:",
            Editing: "Edición",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "Las partes de la pista se pueden seleccionar en el menú de la derecha, después de lo cual se pueden colocar haciendo clic izquierdo con el ratón.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "Alternativamente, la parte de la pista actualmente sobrevolada por el ratón se puede seleccionar con el siguiente atajo de teclado:",
            "The selected part can then be rotated using the following keyboard shortcut:": "La parte seleccionada se puede girar usando el siguiente atajo de teclado:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "Las partes de la pista se pueden eliminar usando la herramienta de eliminación en el menú del lado derecho o manteniendo presionada la siguiente tecla:",
            "Starting points, checkpoints and the finish line": "Puntos de inicio, puntos de control y la línea de meta",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "Los puntos de inicio, puntos de control y líneas de meta se pueden seleccionar en la categoría superior del menú del lado derecho.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "Cada pista debe tener al menos un punto de inicio. Si hay varios puntos de inicio, se usará el último colocado.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "Los puntos de control deben colocarse entre el punto de inicio y la línea de meta. Cuando se selecciona una parte de la pista de punto de control, habrá una herramienta en la parte inferior derecha para seleccionar el orden del punto de control. Esto determina el orden en que se deben pasar los puntos de control antes de conducir hacia la línea de meta. Ten en cuenta que es posible tener varios puntos de control con el mismo orden de punto de control.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "La línea de meta es donde termina la pista, pero solo se activará después de que se hayan pasado todos los puntos de control. También es posible tener varias líneas de meta.",
            "Starting point": "Punto de inicio",
            Checkpoint: "Punto de control",
            "Finish line": "Línea de meta",
            "Exporting the track": "Exportando la pista",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "Cuando la pista esté terminada, se puede ingresar un nombre para la pista en la parte superior izquierda, después de lo cual se puede exportar la pista usando el botón de exportación. Esto revelará un código de pista que se puede enviar a otros usuarios para que puedan importar y jugar la pista.",
            Close: "Cerrar",
            "Not set": "No establecido",
            or: "o",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "La cámara se puede mover arrastrando con un dedo. Gira la cámara arrastrando con dos dedos. Acércate y aléjate pellizcando.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "La altura editada se puede cambiar usando la selección de altura en la esquina inferior izquierda.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "Las partes de la pista se pueden seleccionar en el menú de la derecha, después de lo cual se pueden colocar tocando la pantalla.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "La parte seleccionada se puede girar tocando el botón de rotación en la esquina inferior izquierda.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "Las partes de la pista se pueden eliminar usando la herramienta de eliminación en el menú del lado derecho.",
            Watch: "Ver",
            "Loading replay": "Cargando repetición",
            "Press {0} to return to the last checkpoint": "Presiona {0} para volver al último punto de control",
            "Press {0} to start over": "Presiona {0} para empezar de nuevo",
            "Reset once to return to the last checkpoint": "Restablecer una vez para volver al último punto de control",
            "Reset again to start over": "Restablecer de nuevo para empezar de nuevo",
            Leaderboard: "Tabla de clasificación",
            "{0} players": "{0} jugadores",
            Back: "Volver",
            "Error: Failed to load leaderboard": "Error: No se pudo cargar la tabla de clasificación",
            "Unofficial versions of the game cannot access the leaderboard": "Las versiones no oficiales del juego no pueden acceder a la tabla de clasificación",
            Pending: "Pendiente",
            Verified: "Verificado",
            Invalid: "Inválido",
            Duplicate: "Duplicado",
            You: "Tú",
            "Only verified": "Solo verificados",
            Loading: "Cargando",
            "Failed to load recordings": "Error al cargar las grabaciones",
            "Cannot load recordings due to non-determinism": "No se pueden cargar las grabaciones debido a la no determinismo",
            Ok: "Aceptar",
            "Track is missing starting point": "Falta el punto de inicio en la pista",
            "Some leaderboard features are disabled.": "Algunas funciones de la tabla de clasificación están desactivadas.",
            "Please try another browser or device.": "Por favor, prueba otro navegador o dispositivo.",
            "You already have another instance of PolyTrack open.": "Ya tienes otra instancia de PolyTrack abierta.",
            "Please switch to that tab or window to continue.": "Por favor, cambia a esa pestaña o ventana para continuar.",
            "Computer determinism check failed.": "Falló la comprobación de determinismo del ordenador.",
            "Non-deterministic game assets found.": "Se encontraron activos de juego no deterministas.",
            "Please try clearing your browser cache.": "Por favor, intenta borrar la caché de tu navegador.",
            "Hardware acceleration is disabled. Performance may be reduced.": "La aceleración de hardware está desactivada. El rendimiento puede verse reducido.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "Por favor, asegúrate de que la aceleración de hardware esté habilitada en la configuración de tu navegador.",
            Customize: "Personalizar",
            Editor: "Editor",
            Settings: "Configuración",
            Profile: "Perfil",
            Play: "Jugar",
            Version: "Versión",
            "You cannot have duplicate user profiles": "No puedes tener perfiles de usuario duplicados",
            "Failed to create user profile": "No se pudo crear el perfil de usuario",
            "This user profile does not exist on the server": "Este perfil de usuario no existe en el servidor",
            "Failed to download user profile from the server": "No se pudo descargar el perfil de usuario desde el servidor",
            "User token is invalid": "El token de usuario no es válido",
            "Are you sure you want to display your private key?": "¿Estás seguro de que quieres mostrar tu clave privada?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "NO COMPARTAS ESTA CLAVE CON NADIE.",
            "You need a free user profile slot to import a new user profile": "Necesitas un espacio libre de perfil de usuario para importar un nuevo perfil de usuario",
            Quit: "Salir",
            Fullscreen: "Pantalla completa",
            Windowed: "Ventana",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "Parece que estás jugando una versión no oficial de {0}. Para la versión más actualizada, visita la fuente original:",
            Nickname: "Apodo",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "Elige un apodo para que aparezca en la tabla de clasificación. Puedes cambiar tu apodo en cualquier momento.",
            Cancel: "Cancelar",
            Confirm: "Confirmar",
            "User ID": "ID de usuario",
            Paused: "Pausado",
            "Switch car": "Cambiar coche",
            Profiles: "Perfiles",
            'Are you sure you would like to delete "{0}"?': '¿Estás seguro de que quieres eliminar "{0}"?',
            Empty: "Vacío",
            Reset: "Restablecer",
            Apply: "Aplicar",
            Gameplay: "Jugabilidad",
            Units: "Unidades",
            Metric: "Métrico",
            Imperial: "Imperial",
            "Reset hint": "Restablecer pista",
            Disabled: "Desactivado",
            Enabled: "Activado",
            "Ghost car": "Coche fantasma",
            "Default camera": "Cámara predeterminada",
            Default: "Predeterminado",
            Cockpit: "Cabina",
            "Cockpit camera mode": "Modo de cámara en la cabina",
            Hold: "Mantener",
            Toggle: "Alternar",
            Checkpoints: "Puntos de control",
            Timer: "Temporizador",
            Speedometer: "Velocímetro",
            Bottom: "Inferior",
            Top: "Superior",
            Language: "Idioma",
            Graphics: "Gráficos",
            Shadows: "Sombras",
            Off: "Apagar",
            On: "Encender",
            Minimal: "Mínimo",
            Low: "Bajo",
            Medium: "Medio",
            High: "Alto",
            Ultra: "Ultra",
            Clouds: "Nubes",
            Particles: "Partículas",
            Skidmarks: "Marcas de derrape",
            "Render scale": "Escala de renderizado",
            "Anti-aliasing (requires restart)": "Anti-aliasing (requiere reinicio)",
            Audio: "Audio",
            "Sound effect volume": "Volumen de efectos de sonido",
            "Music volume": "Volumen de música",
            "Checkpoint volume": "Volumen de puntos de control",
            Mobile: "Dispositivo móvil",
            Vibration: "Vibración",
            "Steering control side": "Lado de control de dirección",
            Left: "Izquierda",
            Right: "Derecha",
            Controls: "Controles",
            Vehicle: "Vehículo",
            Accelerate: "Acelerar",
            Brake: "Frenar",
            "Turn left": "Girar a la izquierda",
            "Turn right": "Girar a la derecha",
            "Checkpoint reset": "Restablecer punto de control",
            "Start reset": "Restablecer inicio",
            "Cockpit camera": "Cámara en la cabina",
            "Rotate part": "Girar parte",
            "Height modifier": "Modificador de altura",
            "Delete part": "Eliminar parte",
            "Move forwards": "Mover hacia adelante",
            "Move backwards": "Mover hacia atrás",
            "Move left": "Mover a la izquierda",
            "Move right": "Mover a la derecha",
            "Rotate view up": "Girar vista hacia arriba",
            "Rotate view down": "Girar vista hacia abajo",
            "Rotate view left": "Girar vista a la izquierda",
            "Rotate view right": "Girar vista a la derecha",
            "Move down": "Mover hacia abajo",
            "Move up": "Mover hacia arriba",
            "Test track": "Probar pista",
            "Pick part": "Seleccionar parte",
            Spectator: "Espectador",
            "Speed modifier": "Modificador de velocidad",
            Other: "Otro",
            "Hide UI": "Ocultar IU",
            Pause: "Pausa",
            "Toggle FPS counter": "Alternar contador de FPS",
            "Toggle spectator camera": "Alternar cámara de espectador",
            "Press any key...\n\nPress [Escape] to cancel.": "Presiona cualquier tecla...\n\nPresiona [Escape] para cancelar.",
            Clear: "Borrar",
            "New record": "Nuevo récord",
            Record: "Récord",
            Current: "Actual",
            Difference: "Diferencia",
            Copy: "Copiar",
            Import: "Importar",
            "Failed to import track": "Error al importar la pista",
            'The track "{0}" already exists. Do you wish to overwrite it?': 'La pista "{0}" ya existe. ¿Deseas sobrescribirla?',
            Overwrite: "Sobrescribir",
            "Paste track data here...": "Pegar datos de la pista aquí...",
            Rank: "Rango",
            "Personal best": "Mejor marca personal",
            Opponents: "Oponentes",
            "{0} opponent selected": "{0} oponente seleccionado",
            "{0} opponents selected": "{0} oponente seleccionado",
            "Select opponents to race against from the leaderboard on the left": "Selecciona oponentes con los que competir en la tabla de clasificación de la izquierda",
            "No record": "Sin récord",
            "Official tracks": "Pistas oficiales",
            "Community tracks": "Pistas de la comunidad",
            "Custom tracks": "Pistas personalizadas",
            'Are you sure you want to delete "{0}"?': '¿Estás seguro de que deseas eliminar "{0}"?',
            Delete: "Eliminar",
            "No community tracks": "No hay pistas de la comunidad",
            "Community tracks are coming soon": "Las pistas de la comunidad llegarán pronto",
            "No custom tracks": "No hay pistas personalizadas",
            "Create a track using the editor or import a track code": "Crea una pista usando el editor o importa un código de pista",
            "Search by track or author...": "Buscar por pista o autor...",
            "Invalid replay detected!": "¡Se detectó una repetición no válida!"
        }
          , yO = {
            "Checkpoint order": "Ordre des points de contrôle",
            Height: "Hauteur",
            Exit: "Quitter",
            Random: "Aléatoire",
            Primary: "Principal",
            Secondary: "Secondaire",
            Frame: "Cadre",
            Rims: "Jantes",
            "Are you sure you want to exit without saving?": "Êtes-vous sûr de vouloir quitter sans sauvegarder ?",
            "All changes will be lost!": "Tous les changements seront perdus !",
            "Car saved!": "Voiture sauvegardée !",
            Test: "Test",
            "Starting point is missing!": "Point de départ manquant !",
            Generate: "Générer",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "Êtes-vous sûr de vouloir générer une nouvelle piste ?\n\nVotre piste actuelle sera perdue !",
            Load: "Charger",
            Save: "Enregistrer",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "Êtes-vous sûr de vouloir charger une nouvelle piste ?\n\nVotre piste actuelle sera perdue !",
            "Track saved!": "Piste enregistrée !",
            "Failed to save!": "Échec de l'enregistrement !",
            'Are you sure you want to overwrite "{0}"?': 'Êtes-vous sûr de vouloir écraser "{0}" ?',
            Export: "Exporter",
            Help: "Aide",
            "Are you sure you want to exit the editor?": "Êtes-vous sûr de vouloir quitter l'éditeur ?",
            "All unsaved data will be lost!": "Toutes les données non sauvegardées seront perdues !",
            "Track settings": "Paramètres de la piste",
            "Unnamed Track": "Piste sans nom",
            "Track name": "Nom de la piste",
            Author: "Auteur",
            Unknown: "Inconnu",
            Environment: "Environnement",
            Summer: "Été",
            Winter: "Hiver",
            Desert: "Désert",
            "Sun direction": "Direction du soleil",
            "How to use the editor": "Comment utiliser l'éditeur",
            "Camera controls": "Contrôles de la caméra",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "La caméra peut être déplacée en cliquant avec le bouton droit et en faisant glisser la souris. Faites pivoter la caméra en cliquant sur le bouton central de la souris (molette) ou en maintenant la touche de contrôle enfoncée et en cliquant avec le bouton droit et en faisant glisser la souris. Zoomez en avant et en arrière en faisant défiler la molette de la souris.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "Alternativement, la caméra peut également être contrôlée en utilisant les touches de clavier suivantes :",
            "Move forwards:": "Avancer :",
            "Move backwards:": "Reculer :",
            "Move left:": "Déplacer à gauche :",
            "Move right:": "Déplacer à droite :",
            "Rotate left:": "Pivoter à gauche :",
            "Rotate right:": "Pivoter à droite :",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "La hauteur modifiée peut être changée en utilisant la sélection de hauteur dans le coin inférieur gauche, ou en maintenant la touche Maj enfoncée et en faisant défiler la molette de la souris. Alternativement, vous pouvez utiliser les touches de clavier suivantes :",
            "Move up:": "Monter :",
            "Move down:": "Descendre :",
            Editing: "Édition",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "Les parties de la piste peuvent être sélectionnées dans le menu de droite, après quoi elles peuvent être placées en cliquant avec le bouton gauche de la souris.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "Alternativement, la partie de la piste actuellement survolée par la souris peut être sélectionnée avec le raccourci clavier suivant :",
            "The selected part can then be rotated using the following keyboard shortcut:": "La partie sélectionnée peut ensuite être pivotée en utilisant le raccourci clavier suivant :",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "Les parties de la piste peuvent être supprimées en utilisant l'outil de suppression dans le menu de droite ou en maintenant la touche suivante enfoncée :",
            "Starting points, checkpoints and the finish line": "Points de départ, points de contrôle et ligne d'arrivée",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "Les points de départ, les points de contrôle et les lignes d'arrivée peuvent tous être sélectionnés dans la catégorie la plus haute du menu de droite.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "Chaque piste doit avoir au moins un point de départ. S'il y a plusieurs points de départ, le dernier placé sera utilisé.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "Les points de contrôle doivent être placés entre le point de départ et la ligne d'arrivée. Lorsqu'une partie de la piste de point de contrôle est sélectionnée, il y aura un outil en bas à droite pour sélectionner l'ordre du point de contrôle. Cela détermine l'ordre dans lequel les points de contrôle doivent être passés avant de conduire jusqu'à la ligne d'arrivée. Notez qu'il est possible d'avoir plusieurs points de contrôle avec le même ordre de point de contrôle.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "La ligne d'arrivée est l'endroit où la piste se termine mais ne deviendra active qu'après que tous les points de contrôle aient été passés. Il est également possible d'avoir plusieurs lignes d'arrivée.",
            "Starting point": "Point de départ",
            Checkpoint: "Point de contrôle",
            "Finish line": "Ligne d'arrivée",
            "Exporting the track": "Exportation de la piste",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "Lorsque la piste est terminée, un nom pour la piste peut être entré en haut à gauche, après quoi la piste peut être exportée en utilisant le bouton d'exportation. Cela révélera un code de piste qui peut être envoyé à d'autres utilisateurs afin qu'ils puissent importer et jouer la piste.",
            Close: "Fermer",
            "Not set": "Non défini",
            or: "ou",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "La caméra peut être déplacée en faisant glisser un doigt. Faites pivoter la caméra en faisant glisser deux doigts. Zoomez avant et arrière en pinçant.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "La hauteur modifiée peut être changée en utilisant la sélection de hauteur dans le coin inférieur gauche.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "Les parties de la piste peuvent être sélectionnées dans le menu de droite, après quoi elles peuvent être placées en tapant sur l'écran.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "La partie sélectionnée peut ensuite être pivotée en tapant sur le bouton de rotation dans le coin inférieur gauche.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "Les parties de la piste peuvent être supprimées en utilisant l'outil de suppression dans le menu de droite.",
            Watch: "Regarder",
            "Loading replay": "Chargement de l'enregistrement",
            "Press {0} to return to the last checkpoint": "Appuyez sur {0} pour retourner au dernier point de contrôle",
            "Press {0} to start over": "Appuyez sur {0} pour recommencer",
            "Reset once to return to the last checkpoint": "Réinitialisez une fois pour retourner au dernier point de contrôle",
            "Reset again to start over": "Réinitialisez à nouveau pour recommencer",
            Leaderboard: "Classement",
            "{0} players": "{0} joueurs",
            Back: "Retour",
            "Error: Failed to load leaderboard": "Erreur : Échec du chargement du classement",
            "Unofficial versions of the game cannot access the leaderboard": "Les versions non officielles du jeu ne peuvent pas accéder au classement",
            Pending: "En attente",
            Verified: "Vérifié",
            Invalid: "Invalide",
            Duplicate: "Doublon",
            You: "Vous",
            "Only verified": "Uniquement vérifiés",
            Loading: "Chargement",
            "Failed to load recordings": "Échec du chargement des enregistrements",
            "Cannot load recordings due to non-determinism": "Impossible de charger les enregistrements en raison du non-déterminisme",
            Ok: "OK",
            "Track is missing starting point": "La piste n'a pas de point de départ",
            "Some leaderboard features are disabled.": "Certaines fonctionnalités du classement sont désactivées.",
            "Please try another browser or device.": "Veuillez essayer un autre navigateur ou appareil.",
            "You already have another instance of PolyTrack open.": "Vous avez déjà une autre instance de PolyTrack ouverte.",
            "Please switch to that tab or window to continue.": "Veuillez basculer vers cet onglet ou cette fenêtre pour continuer.",
            "Computer determinism check failed.": "Échec de la vérification du déterminisme de l'ordinateur.",
            "Non-deterministic game assets found.": "Actifs de jeu non déterministes trouvés.",
            "Please try clearing your browser cache.": "Veuillez essayer de vider le cache de votre navigateur.",
            "Hardware acceleration is disabled. Performance may be reduced.": "L'accélération matérielle est désactivée. Les performances peuvent être réduites.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "Veuillez vous assurer que l'accélération matérielle est activée dans les paramètres de votre navigateur.",
            Customize: "Personnaliser",
            Editor: "Éditeur",
            Settings: "Paramètres",
            Profile: "Profil",
            Play: "Jouer",
            Version: "Version",
            "You cannot have duplicate user profiles": "Vous ne pouvez pas avoir de profils d'utilisateur en double",
            "Failed to create user profile": "Échec de la création du profil utilisateur",
            "This user profile does not exist on the server": "Ce profil utilisateur n'existe pas sur le serveur",
            "Failed to download user profile from the server": "Échec du téléchargement du profil utilisateur depuis le serveur",
            "User token is invalid": "Le jeton utilisateur n'est pas valide",
            "Are you sure you want to display your private key?": "Êtes-vous sûr de vouloir afficher votre clé privée ?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "NE PARTAGEZ PAS CETTE CLÉ AVEC PERSONNE.",
            "You need a free user profile slot to import a new user profile": "Vous avez besoin d'un emplacement de profil utilisateur libre pour importer un nouveau profil utilisateur",
            Quit: "Quitter",
            Fullscreen: "Plein écran",
            Windowed: "Fenêtré",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "Il semble que vous jouiez à une version non officielle de {0}. Pour la version la plus récente, veuillez visiter la source originale :",
            Nickname: "Pseudonyme",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "Choisissez un pseudonyme à afficher dans le classement. Vous pouvez changer votre pseudonyme à tout moment.",
            Cancel: "Annuler",
            Confirm: "Confirmer",
            "User ID": "ID utilisateur",
            Paused: "En pause",
            "Switch car": "Changer de voiture",
            Profiles: "Profils",
            'Are you sure you would like to delete "{0}"?': 'Êtes-vous sûr de vouloir supprimer "{0}"?',
            Empty: "Vide",
            Reset: "Réinitialiser",
            Apply: "Appliquer",
            Gameplay: "Jouabilité",
            Units: "Unités",
            Metric: "Métrique",
            Imperial: "Impérial",
            "Reset hint": "Réinitialiser l'astuce",
            Disabled: "Désactivé",
            Enabled: "Activé",
            "Ghost car": "Voiture fantôme",
            "Default camera": "Caméra par défaut",
            Default: "Défaut",
            Cockpit: "Cockpit",
            "Cockpit camera mode": "Mode caméra cockpit",
            Hold: "Maintenir",
            Toggle: "Basculer",
            Checkpoints: "Points de contrôle",
            Timer: "Minuteur",
            Speedometer: "Compteur de vitesse",
            Bottom: "Bas",
            Top: "Haut",
            Language: "Langue",
            Graphics: "Graphismes",
            Shadows: "Ombres",
            Off: "Désactivé",
            On: "Activé",
            Minimal: "Minimal",
            Low: "Faible",
            Medium: "Moyen",
            High: "Élevé",
            Ultra: "Ultra",
            Clouds: "Nuages",
            Particles: "Particules",
            Skidmarks: "Marques de dérapage",
            "Render scale": "Échelle de rendu",
            "Anti-aliasing (requires restart)": "Anticrénelage (nécessite un redémarrage)",
            Audio: "Audio",
            "Sound effect volume": "Volume des effets sonores",
            "Music volume": "Volume de la musique",
            "Checkpoint volume": "Volume des points de contrôle",
            Mobile: "Mobile",
            Vibration: "Vibration",
            "Steering control side": "Côté de contrôle de la direction",
            Left: "Gauche",
            Right: "Droite",
            Controls: "Commandes",
            Vehicle: "Véhicule",
            Accelerate: "Accélérer",
            Brake: "Freiner",
            "Turn left": "Tourner à gauche",
            "Turn right": "Tourner à droite",
            "Checkpoint reset": "Réinitialisation du point de contrôle",
            "Start reset": "Réinitialisation du départ",
            "Cockpit camera": "Caméra cockpit",
            "Rotate part": "Pivoter la partie",
            "Height modifier": "Modificateur de hauteur",
            "Delete part": "Supprimer la partie",
            "Move forwards": "Avancer",
            "Move backwards": "Reculer",
            "Move left": "Déplacer à gauche",
            "Move right": "Déplacer à droite",
            "Rotate view up": "Pivoter la vue vers le haut",
            "Rotate view down": "Pivoter la vue vers le bas",
            "Rotate view left": "Pivoter la vue à gauche",
            "Rotate view right": "Pivoter la vue à droite",
            "Move down": "Descendre",
            "Move up": "Monter",
            "Test track": "Tester la piste",
            "Pick part": "Choisir la partie",
            Spectator: "Spectateur",
            "Speed modifier": "Modificateur de vitesse",
            Other: "Autre",
            "Hide UI": "Masquer l'interface utilisateur",
            Pause: "Pause",
            "Toggle FPS counter": "Basculer le compteur FPS",
            "Toggle spectator camera": "Basculer la caméra spectateur",
            "Press any key...\n\nPress [Escape] to cancel.": "Appuyez sur n'importe quelle touche...\n\nAppuyez sur [Échap] pour annuler.",
            Clear: "Effacer",
            "New record": "Nouveau record",
            Record: "Record",
            Current: "Actuel",
            Difference: "Différence",
            Copy: "Copier",
            Import: "Importer",
            "Failed to import track": "Échec de l'importation de la piste",
            'The track "{0}" already exists. Do you wish to overwrite it?': 'La piste "{0}" existe déjà. Souhaitez-vous l\'écraser ?',
            Overwrite: "Écraser",
            "Paste track data here...": "Collez les données de la piste ici...",
            Rank: "Classement",
            "Personal best": "Meilleur temps personnel",
            Opponents: "Adversaires",
            "{0} opponent selected": "{0} adversaire sélectionné",
            "{0} opponents selected": "{0} adversaires sélectionnés",
            "Select opponents to race against from the leaderboard on the left": "Sélectionnez des adversaires contre lesquels courir dans le classement sur la gauche",
            "No record": "Pas de record",
            "Official tracks": "Pistes officielles",
            "Community tracks": "Pistes communautaires",
            "Custom tracks": "Pistes personnalisées",
            'Are you sure you want to delete "{0}"?': 'Êtes-vous sûr de vouloir supprimer "{0}" ?',
            Delete: "Supprimer",
            "No community tracks": "Pas de pistes communautaires",
            "Community tracks are coming soon": "Les pistes communautaires arrivent bientôt",
            "No custom tracks": "Pas de pistes personnalisées",
            "Create a track using the editor or import a track code": "Créez une piste en utilisant l'éditeur ou importez un code de piste",
            "Search by track or author...": "Rechercher par piste ou auteur...",
            "Invalid replay detected!": "Rejouer invalide détecté!"
        }
          , bO = {
            "Checkpoint order": "Ordine dei checkpoint",
            Height: "Altezza",
            Exit: "Esci",
            Random: "Casuale",
            Primary: "Primario",
            Secondary: "Secondario",
            Frame: "Telaio",
            Rims: "Cerchioni",
            "Are you sure you want to exit without saving?": "Sei sicuro di voler uscire senza salvare?",
            "All changes will be lost!": "Tutte le modifiche andranno perse!",
            "Car saved!": "Auto salvata!",
            Test: "Test",
            "Starting point is missing!": "Punto di partenza mancante!",
            Generate: "Genera",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "Sei sicuro di voler generare un nuovo percorso?\n\nIl tuo percorso attuale verrà perso!",
            Load: "Carica",
            Save: "Salva",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "Sei sicuro di voler caricare un nuovo percorso?\n\nIl tuo percorso attuale verrà perso!",
            "Track saved!": "Percorso salvato!",
            "Failed to save!": "Salvataggio non riuscito!",
            'Are you sure you want to overwrite "{0}"?': 'Sei sicuro di voler sovrascrivere "{0}"?',
            Export: "Esporta",
            Help: "Aiuto",
            "Are you sure you want to exit the editor?": "Sei sicuro di voler uscire dall'editor?",
            "All unsaved data will be lost!": "Tutti i dati non salvati andranno persi!",
            "Track settings": "Impostazioni del percorso",
            "Unnamed Track": "Percorso senza nome",
            "Track name": "Nome del percorso",
            Author: "Autore",
            Unknown: "Sconosciuto",
            Environment: "Ambiente",
            Summer: "Estate",
            Winter: "Inverno",
            Desert: "Deserto",
            "Sun direction": "Direzione del sole",
            "How to use the editor": "Come usare l'editor",
            "Camera controls": "Controlli della telecamera",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "La telecamera può essere spostata facendo clic con il tasto destro del mouse e trascinando. Ruota la telecamera facendo clic con il pulsante centrale del mouse (rotella) o tenendo premuto il tasto di controllo e facendo clic con il tasto destro del mouse e trascinando. Zoom avanti e indietro scorrendo la rotella del mouse.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "In alternativa, la telecamera può essere controllata utilizzando i seguenti tasti della tastiera:",
            "Move forwards:": "Muovi avanti:",
            "Move backwards:": "Muovi indietro:",
            "Move left:": "Muovi a sinistra:",
            "Move right:": "Muovi a destra:",
            "Rotate left:": "Ruota a sinistra:",
            "Rotate right:": "Ruota a destra:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "L'altezza modificata può essere cambiata utilizzando la selezione dell'altezza nell'angolo in basso a sinistra, o tenendo premuto il tasto shift e scorrendo la rotella del mouse. In alternativa, puoi utilizzare i seguenti tasti della tastiera:",
            "Move up:": "Muovi su:",
            "Move down:": "Muovi giù:",
            Editing: "Modifica",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "Le parti del percorso possono essere selezionate nel menu a destra, dopodiché possono essere posizionate facendo clic con il tasto sinistro del mouse.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "In alternativa, la parte del percorso attualmente sotto il cursore del mouse può essere selezionata con la seguente scorciatoia da tastiera:",
            "The selected part can then be rotated using the following keyboard shortcut:": "La parte selezionata può quindi essere ruotata utilizzando la seguente scorciatoia da tastiera:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "Le parti del percorso possono essere eliminate utilizzando lo strumento di eliminazione nel menu a destra o tenendo premuto il seguente tasto:",
            "Starting points, checkpoints and the finish line": "Punti di partenza, checkpoint e linea di arrivo",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "I punti di partenza, i checkpoint e le linee di arrivo possono essere selezionati nella categoria più alta nel menu a destra.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "Ogni percorso deve avere almeno un punto di partenza. Se ci sono più punti di partenza, verrà utilizzato l'ultimo posizionato.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "I checkpoint devono essere posizionati tra il punto di partenza e la linea di arrivo. Quando viene selezionata una parte del percorso checkpoint, ci sarà uno strumento in basso a destra per selezionare l'ordine del checkpoint. Questo determina l'ordine in cui i checkpoint devono essere superati prima di arrivare alla linea di arrivo. Nota che è possibile avere più checkpoint con lo stesso ordine di checkpoint.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "La linea di arrivo è dove finisce il percorso, ma diventerà attiva solo dopo che tutti i checkpoint sono stati superati. È anche possibile avere più linee di arrivo.",
            "Starting point": "Punto di partenza",
            Checkpoint: "Checkpoint",
            "Finish line": "Linea di arrivo",
            "Exporting the track": "Esportazione del percorso",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "Quando il percorso è terminato, è possibile inserire un nome per il percorso in alto a sinistra, dopodiché il percorso può essere esportato utilizzando il pulsante di esportazione. Questo rivelerà un codice del percorso che può essere inviato ad altri utenti in modo che possano importare e giocare il percorso.",
            Close: "Chiudi",
            "Not set": "Non impostato",
            or: "o",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "La telecamera può essere spostata trascinando con un dito. Ruota la telecamera trascinando con due dita. Zoom avanti e indietro pizzicando.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "L'altezza modificata può essere cambiata utilizzando la selezione dell'altezza nell'angolo in basso a sinistra.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "Le parti del percorso possono essere selezionate nel menu a destra, dopodiché possono essere posizionate toccando lo schermo.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "La parte selezionata può quindi essere ruotata toccando il pulsante di rotazione nell'angolo in basso a sinistra.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "Le parti del percorso possono essere eliminate utilizzando lo strumento di eliminazione nel menu a destra.",
            Watch: "Guarda",
            "Loading replay": "Caricamento riproduzione",
            "Press {0} to return to the last checkpoint": "Premi {0} per tornare all'ultimo checkpoint",
            "Press {0} to start over": "Premi {0} per ricominciare",
            "Reset once to return to the last checkpoint": "Resetta una volta per tornare all'ultimo checkpoint",
            "Reset again to start over": "Resetta di nuovo per ricominciare",
            Leaderboard: "Classifica",
            "{0} players": "{0} giocatori",
            Back: "Indietro",
            "Error: Failed to load leaderboard": "Errore: impossibile caricare la classifica",
            "Unofficial versions of the game cannot access the leaderboard": "Le versioni non ufficiali del gioco non possono accedere alla classifica",
            Pending: "In sospeso",
            Verified: "Verificato",
            Invalid: "Non valido",
            Duplicate: "Duplicato",
            You: "Tu",
            "Only verified": "Solo verificati",
            Loading: "Caricamento",
            "Failed to load recordings": "Impossibile caricare le registrazioni",
            "Cannot load recordings due to non-determinism": "Impossibile caricare le registrazioni a causa del non determinismo",
            Ok: "Ok",
            "Track is missing starting point": "Il percorso non ha un punto di partenza",
            "Some leaderboard features are disabled.": "Alcune funzionalità della classifica sono disabilitate.",
            "Please try another browser or device.": "Si prega di provare un altro browser o dispositivo.",
            "You already have another instance of PolyTrack open.": "Hai già un'altra istanza di PolyTrack aperta.",
            "Please switch to that tab or window to continue.": "Si prega di passare a quella scheda o finestra per continuare.",
            "Computer determinism check failed.": "Verifica del determinismo del computer fallita.",
            "Non-deterministic game assets found.": "Asset di gioco non deterministici trovati.",
            "Please try clearing your browser cache.": "Si prega di provare a cancellare la cache del browser.",
            "Hardware acceleration is disabled. Performance may be reduced.": "L'accelerazione hardware è disabilitata. Le prestazioni potrebbero essere ridotte.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "Si prega di assicurarsi che l'accelerazione hardware sia abilitata nelle impostazioni del browser.",
            Customize: "Personalizza",
            Editor: "Editor",
            Settings: "Impostazioni",
            Profile: "Profilo",
            Play: "Gioca",
            Version: "Versione",
            "You cannot have duplicate user profiles": "Non è possibile avere profili utente duplicati",
            "Failed to create user profile": "Impossibile creare il profilo utente",
            "This user profile does not exist on the server": "Questo profilo utente non esiste sul server",
            "Failed to download user profile from the server": "Impossibile scaricare il profilo utente dal server",
            "User token is invalid": "Token utente non valido",
            "Are you sure you want to display your private key?": "Sei sicuro di voler mostrare la tua chiave privata?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "NON CONDIVIDERE QUESTA CHIAVE CON NESSUNO.",
            "You need a free user profile slot to import a new user profile": "Hai bisogno di uno slot di profilo utente libero per importare un nuovo profilo utente",
            Quit: "Esci",
            Fullscreen: "Schermo intero",
            Windowed: "Finestra",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "Sembra che tu stia giocando a una versione non ufficiale di {0}. Per la versione più aggiornata visita la fonte originale:",
            Nickname: "Nickname",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "Scegli un nickname da mostrare nella classifica. Puoi cambiarlo in qualsiasi momento.",
            Cancel: "Annulla",
            Confirm: "Conferma",
            "User ID": "ID Utente",
            Paused: "In pausa",
            "Switch car": "Cambia auto",
            Profiles: "Profili",
            'Are you sure you would like to delete "{0}"?': 'Sei sicuro di voler eliminare "{0}"?',
            Empty: "Vuoto",
            Reset: "Resetta",
            Apply: "Applica",
            Gameplay: "Modalità di gioco",
            Units: "Unità",
            Metric: "Metrico",
            Imperial: "Imperiale",
            "Reset hint": "Resetta suggerimento",
            Disabled: "Disattivato",
            Enabled: "Attivato",
            "Ghost car": "Auto fantasma",
            "Default camera": "Telecamera predefinita",
            Default: "Predefinita",
            Cockpit: "Cabina",
            "Cockpit camera mode": "Modalità telecamera cabina",
            Hold: "Tieni",
            Toggle: "Attiva/Disattiva",
            Checkpoints: "Checkpoint",
            Timer: "Timer",
            Speedometer: "Contachilometri",
            Bottom: "In basso",
            Top: "In alto",
            Language: "Lingua",
            Graphics: "Grafica",
            Shadows: "Ombre",
            Off: "Disattivato",
            On: "Attivato",
            Minimal: "Minimale",
            Low: "Basso",
            Medium: "Medio",
            High: "Alto",
            Ultra: "Ultra",
            Clouds: "Nuvole",
            Particles: "Particelle",
            Skidmarks: "Segni di frenata",
            "Render scale": "Scala di rendering",
            "Anti-aliasing (requires restart)": "Anti-aliasing (richiede riavvio)",
            Audio: "Audio",
            "Sound effect volume": "Volume degli effetti sonori",
            "Music volume": "Volume della musica",
            "Checkpoint volume": "Volume dei checkpoint",
            Mobile: "Mobile",
            Vibration: "Vibrazione",
            "Steering control side": "Lato del controllo dello sterzo",
            Left: "Sinistra",
            Right: "Destra",
            Controls: "Controlli",
            Vehicle: "Veicolo",
            Accelerate: "Accelerare",
            Brake: "Frenare",
            "Turn left": "Svolta a sinistra",
            "Turn right": "Svolta a destra",
            "Checkpoint reset": "Reset checkpoint",
            "Start reset": "Reset partenza",
            "Cockpit camera": "Telecamera cabina",
            "Rotate part": "Ruota parte",
            "Height modifier": "Modificatore altezza",
            "Delete part": "Elimina parte",
            "Move forwards": "Muovi avanti",
            "Move backwards": "Muovi indietro",
            "Move left": "Muovi a sinistra",
            "Move right": "Muovi a destra",
            "Rotate view up": "Ruota vista in alto",
            "Rotate view down": "Ruota vista in basso",
            "Rotate view left": "Ruota vista a sinistra",
            "Rotate view right": "Ruota vista a destra",
            "Move down": "Muovi giù",
            "Move up": "Muovi su",
            "Test track": "Test percorso",
            "Pick part": "Seleziona parte",
            Spectator: "Spettatore",
            "Speed modifier": "Modificatore velocità",
            Other: "Altro",
            "Hide UI": "Nascondi UI",
            Pause: "Pausa",
            "Toggle FPS counter": "Attiva/Disattiva contatore FPS",
            "Toggle spectator camera": "Attiva/Disattiva telecamera spettatore",
            "Press any key...\n\nPress [Escape] to cancel.": "Premi un tasto qualsiasi...\n\nPremi [Esc] per annullare.",
            Clear: "Cancella",
            "New record": "Nuovo record",
            Record: "Record",
            Current: "Attuale",
            Difference: "Differenza",
            Copy: "Copia",
            Import: "Importa",
            "Failed to import track": "Importazione percorso non riuscita",
            'The track "{0}" already exists. Do you wish to overwrite it?': 'Il percorso "{0}" esiste già. Vuoi sovrascriverlo?',
            Overwrite: "Sovrascrivi",
            "Paste track data here...": "Incolla dati del percorso qui...",
            Rank: "Posizione",
            "Personal best": "Miglior tempo personale",
            Opponents: "Avversari",
            "{0} opponent selected": "{0} avversario selezionato",
            "{0} opponents selected": "{0} avversari selezionati",
            "Select opponents to race against from the leaderboard on the left": "Seleziona gli avversari con cui gareggiare dalla classifica a sinistra",
            "No record": "Nessun record",
            "Official tracks": "Percorsi ufficiali",
            "Community tracks": "Percorsi della community",
            "Custom tracks": "Percorsi personalizzati",
            'Are you sure you want to delete "{0}"?': 'Sei sicuro di voler eliminare "{0}"?',
            Delete: "Elimina",
            "No community tracks": "Nessun percorso della community",
            "Community tracks are coming soon": "I percorsi della community arriveranno presto",
            "No custom tracks": "Nessun percorso personalizzato",
            "Create a track using the editor or import a track code": "Crea un percorso utilizzando l'editor o importa un codice percorso",
            "Search by track or author...": "Cerca per percorso o autore...",
            "Invalid replay detected!": "Riproduzione non valida rilevata!"
        }
          , AO = {
            "Checkpoint order": "チェックポイントの順序",
            Height: "高さ",
            Exit: "終了",
            Random: "ランダム",
            Primary: "プライマリ",
            Secondary: "セカンダリ",
            Frame: "フレーム",
            Rims: "リム",
            "Are you sure you want to exit without saving?": "保存せずに終了してもよろしいですか？",
            "All changes will be lost!": "すべての変更が失われます！",
            "Car saved!": "車両が保存されました！",
            Test: "テスト",
            "Starting point is missing!": "スタート地点がありません！",
            Generate: "生成",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "新しいトラックを生成してもよろしいですか？\n\n現在のトラックは失われます！",
            Load: "読み込み",
            Save: "保存",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "新しいトラックを読み込んでもよろしいですか？\n\n現在のトラックは失われます！",
            "Track saved!": "トラックが保存されました！",
            "Failed to save!": "保存に失敗しました！",
            'Are you sure you want to overwrite "{0}"?': '"{0}" を上書きしてもよろしいですか？',
            Export: "エクスポート",
            Help: "ヘルプ",
            "Are you sure you want to exit the editor?": "エディタを終了してもよろしいですか？",
            "All unsaved data will be lost!": "保存されていないデータはすべて失われます！",
            "Track settings": "トラック設定",
            "Unnamed Track": "無名のトラック",
            "Track name": "トラック名",
            Author: "作者",
            Unknown: "不明",
            Environment: "環境",
            Summer: "サマー",
            Winter: "ウィンター",
            Desert: "デザート",
            "Sun direction": "太陽の方向",
            "How to use the editor": "エディタの使い方",
            "Camera controls": "カメラの操作方法",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "カメラは右クリックしてマウスをドラッグすることで移動できます。カメラを回転させるには、マウスの中ボタン（マウスホイール）をクリックするか、コントロールキーを押しながら右クリックしてマウスをドラッグします。マウスホイールをスクロールすることでズームインとズームアウトができます。",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "また、以下のキーボードのキーを使用してカメラを制御することもできます:",
            "Move forwards:": "前に移動:",
            "Move backwards:": "後ろに移動:",
            "Move left:": "左に移動:",
            "Move right:": "右に移動:",
            "Rotate left:": "左に回転:",
            "Rotate right:": "右に回転:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "編集された高さは、左下隅の高さ選択を使用するか、Shiftキーを押しながらマウスホイールをスクロールすることで変更できます。また、以下のキーボードキーを使用することもできます:",
            "Move up:": "上に移動:",
            "Move down:": "下に移動:",
            Editing: "編集",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "トラックパーツは、右側のメニューで選択してから、マウスで左クリックすることで配置できます。",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "また、マウスで現在ホバーしているトラックパーツは、以下のキーボードショートカットで選択できます:",
            "The selected part can then be rotated using the following keyboard shortcut:": "選択したパーツは、以下のキーボードショートカットを使用して回転させることができます:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "トラックパーツは、右側のメニューの削除ツールを使用するか、以下のキーを押しながら削除することができます:",
            "Starting points, checkpoints and the finish line": "スタート地点、チェックポイント、フィニッシュライン",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "スタート地点、チェックポイント、フィニッシュラインは、右側のメニューの最上位カテゴリで選択できます。",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "各トラックには少なくとも1つのスタート地点が必要です。複数のスタート地点がある場合は、最後に配置されたものが使用されます。",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "チェックポイントは、スタート地点とフィニッシュラインの間に配置する必要があります。チェックポイントのトラックパーツが選択されると、右下にチェックポイントの順序を選択するためのツールが表示されます。これにより、チェックポイントを通過する順序が決まります。同じチェックポイント順序で複数のチェックポイントを持つことも可能です。",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "フィニッシュラインはトラックの終わりですが、すべてのチェックポイントを通過した後にのみアクティブになります。複数のフィニッシュラインを持つことも可能です。",
            "Starting point": "スタート地点",
            Checkpoint: "チェックポイント",
            "Finish line": "フィニッシュライン",
            "Exporting the track": "トラックのエクスポート",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "トラックが完成したら、トップ左にトラックの名前を入力し、エクスポートボタンを使用してトラックをエクスポートできます。これにより、他のユーザーがトラックをインポートして再生できるトラックコードが表示されます。",
            Close: "閉じる",
            "Not set": "未設定",
            or: "または",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "カメラは1本の指でドラッグすることで移動できます。カメラを回転させるには、2本の指でドラッグします。ピンチインとピンチアウトでズームインとズームアウトができます。",
            "The edited height can be changed by using the height selection in the bottom left corner.": "編集された高さは、左下隅の高さ選択を使用することで変更できます。",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "トラックパーツは、右側のメニューで選択してから、画面をタップすることで配置できます。",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "選択したパーツは、左下隅の回転ボタンをタップすることで回転させることができます。",
            "Track parts can be deleted by using the delete tool in the right side menu.": "トラックパーツは、右側のメニューの削除ツールを使用することで削除できます。",
            Watch: "視聴",
            "Loading replay": "リプレイを読み込み中",
            "Press {0} to return to the last checkpoint": "最後のチェックポイントに戻るには {0} を押してください",
            "Press {0} to start over": "最初からやり直すには {0} を押してください",
            "Reset once to return to the last checkpoint": "最後のチェックポイントに戻るには1回リセットしてください",
            "Reset again to start over": "最初からやり直すにはもう一度リセットしてください",
            Leaderboard: "リーダーボード",
            "{0} players": "{0} 人のプレイヤー",
            Back: "戻る",
            "Error: Failed to load leaderboard": "エラー：リーダーボードの読み込みに失敗しました",
            "Unofficial versions of the game cannot access the leaderboard": "ゲームの非公式バージョンはリーダーボードにアクセスできません",
            Pending: "保留中",
            Verified: "検証済み",
            Invalid: "無効",
            Duplicate: "重複",
            You: "あなた",
            "Only verified": "検証済みのみ",
            Loading: "読み込み中",
            "Failed to load recordings": "録画の読み込みに失敗しました",
            "Cannot load recordings due to non-determinism": "非決定論により録画を読み込むことができません",
            Ok: "OK",
            "Track is missing starting point": "トラックにスタート地点がありません",
            "Some leaderboard features are disabled.": "一部のリーダーボード機能が無効になっています。",
            "Please try another browser or device.": "別のブラウザまたはデバイスをお試しください。",
            "You already have another instance of PolyTrack open.": "すでに別のPolyTrackインスタンスが開いています。",
            "Please switch to that tab or window to continue.": "続行するには、そのタブまたはウィンドウに切り替えてください。",
            "Computer determinism check failed.": "コンピューターの決定論チェックに失敗しました。",
            "Non-deterministic game assets found.": "非決定論的なゲームアセットが見つかりました。",
            "Please try clearing your browser cache.": "ブラウザのキャッシュをクリアしてみてください。",
            "Hardware acceleration is disabled. Performance may be reduced.": "ハードウェアアクセラレーションが無効です。パフォーマンスが低下する可能性があります。",
            "Please make sure hardware acceleration is enabled in your browser settings.": "ハードウェアアクセラレーションがブラウザの設定で有効になっていることを確認してください。",
            Customize: "カスタマイズ",
            Editor: "エディタ",
            Settings: "設定",
            Profile: "プロフィール",
            Play: "再生",
            Version: "バージョン",
            "You cannot have duplicate user profiles": "重複するユーザープロファイルを持つことはできません",
            "Failed to create user profile": "ユーザープロファイルの作成に失敗しました",
            "This user profile does not exist on the server": "このユーザープロファイルはサーバーに存在しません",
            "Failed to download user profile from the server": "サーバーからユーザープロファイルをダウンロードできませんでした",
            "User token is invalid": "ユーザートークンが無効です",
            "Are you sure you want to display your private key?": "本当に秘密鍵を表示しますか？",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "この鍵を誰とも共有しないでください。",
            "You need a free user profile slot to import a new user profile": "新しいユーザープロファイルをインポートするには空きユーザープロファイルスロットが必要です",
            Quit: "終了",
            Fullscreen: "フルスクリーン",
            Windowed: "ウィンドウ",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "{0} の非公式バージョンをプレイしているようです。最新バージョンについては、元のソースをご覧ください:",
            Nickname: "ニックネーム",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "リーダーボードに表示されるニックネームを選択してください。ニックネームはいつでも変更できます。",
            Cancel: "キャンセル",
            Confirm: "確認",
            "User ID": "ユーザーID",
            Paused: "一時停止",
            "Switch car": "車両を切り替え",
            Profiles: "プロフィール",
            'Are you sure you would like to delete "{0}"?': '"{0}"を削除してもよろしいですか？',
            Empty: "空",
            Reset: "リセット",
            Apply: "適用",
            Gameplay: "ゲームプレイ",
            Units: "単位",
            Metric: "メトリック",
            Imperial: "インペリアル",
            "Reset hint": "ヒントをリセット",
            Disabled: "無効",
            Enabled: "有効",
            "Ghost car": "ゴーストカー",
            "Default camera": "デフォルトカメラ",
            Default: "デフォルト",
            Cockpit: "コクピット",
            "Cockpit camera mode": "コクピットカメラモード",
            Hold: "押し続ける",
            Toggle: "トグル",
            Checkpoints: "チェックポイント",
            Timer: "タイマー",
            Speedometer: "スピードメーター",
            Bottom: "下",
            Top: "上",
            Language: "言語",
            Graphics: "グラフィック",
            Shadows: "影",
            Off: "オフ",
            On: "オン",
            Minimal: "ミニマル",
            Low: "低",
            Medium: "中",
            High: "高",
            Ultra: "ウルトラ",
            Clouds: "雲",
            Particles: "パーティクル",
            Skidmarks: "スキッドマーク",
            "Render scale": "レンダースケール",
            "Anti-aliasing (requires restart)": "アンチエイリアシング（再起動が必要）",
            Audio: "オーディオ",
            "Sound effect volume": "効果音の音量",
            "Music volume": "音楽の音量",
            "Checkpoint volume": "チェックポイントの音量",
            Mobile: "モバイル",
            Vibration: "バイブレーション",
            "Steering control side": "ステアリングコントロールの側面",
            Left: "左",
            Right: "右",
            Controls: "コントロール",
            Vehicle: "車両",
            Accelerate: "アクセル",
            Brake: "ブレーキ",
            "Turn left": "左に曲がる",
            "Turn right": "右に曲がる",
            "Checkpoint reset": "チェックポイントリセット",
            "Start reset": "スタートリセット",
            "Cockpit camera": "コクピットカメラ",
            "Rotate part": "パーツを回転",
            "Height modifier": "高さ変更",
            "Delete part": "パーツを削除",
            "Move forwards": "前に移動",
            "Move backwards": "後ろに移動",
            "Move left": "左に移動",
            "Move right": "右に移動",
            "Rotate view up": "ビューを上に回転",
            "Rotate view down": "ビューを下に回転",
            "Rotate view left": "ビューを左に回転",
            "Rotate view right": "ビューを右に回転",
            "Move down": "下に移動",
            "Move up": "上に移動",
            "Test track": "トラックをテスト",
            "Pick part": "パーツを選択",
            Spectator: "スペクテーター",
            "Speed modifier": "スピード変更",
            Other: "その他",
            "Hide UI": "UIを非表示",
            Pause: "一時停止",
            "Toggle FPS counter": "FPSカウンターを切り替え",
            "Toggle spectator camera": "スペクテーターカメラを切り替え",
            "Press any key...\n\nPress [Escape] to cancel.": "任意のキーを押してください...\n\n[Escape] を押してキャンセル。",
            Clear: "クリア",
            "New record": "新記録",
            Record: "記録",
            Current: "現在",
            Difference: "差分",
            Copy: "コピー",
            Import: "インポート",
            "Failed to import track": "トラックのインポートに失敗しました",
            'The track "{0}" already exists. Do you wish to overwrite it?': "トラック「{0}」は既に存在します。上書きしますか？",
            Overwrite: "上書き",
            "Paste track data here...": "トラックデータをここに貼り付けてください...",
            Rank: "ランク",
            "Personal best": "個人ベスト",
            Opponents: "対戦相手",
            "{0} opponent selected": "{0} 人の対戦相手が選択されました",
            "{0} opponents selected": "{0} 人の対戦相手が選択されました",
            "Select opponents to race against from the leaderboard on the left": "左のリーダーボードから対戦相手を選択してください",
            "No record": "記録なし",
            "Official tracks": "公式トラック",
            "Community tracks": "コミュニティトラック",
            "Custom tracks": "カスタムトラック",
            'Are you sure you want to delete "{0}"?': '"{0}" を削除してもよろしいですか？',
            Delete: "削除",
            "No community tracks": "コミュニティトラックはありません",
            "Community tracks are coming soon": "コミュニティトラックは近日公開予定です",
            "No custom tracks": "カスタムトラックはありません",
            "Create a track using the editor or import a track code": "エディタを使用してトラックを作成するか、トラックコードをインポートしてトラックを作成します",
            "Search by track or author...": "トラックまたは作者で検索...",
            "Invalid replay detected!": "無効なリプレイが検出されました！"
        }
          , xO = {
            "Checkpoint order": "체크포인트 순서",
            Height: "높이",
            Exit: "나가기",
            Random: "랜덤",
            Primary: "기본",
            Secondary: "보조",
            Frame: "프레임",
            Rims: "림",
            "Are you sure you want to exit without saving?": "저장하지 않고 나가시겠습니까?",
            "All changes will be lost!": "모든 변경 사항이 손실됩니다!",
            "Car saved!": "차량이 저장되었습니다!",
            Test: "테스트",
            "Starting point is missing!": "출발 지점이 없습니다!",
            Generate: "생성",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "새로운 트랙을 생성하시겠습니까?\n\n현재 트랙은 손실됩니다!",
            Load: "불러오기",
            Save: "저장",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "새로운 트랙을 불러오시겠습니까?\n\n현재 트랙은 손실됩니다!",
            "Track saved!": "트랙이 저장되었습니다!",
            "Failed to save!": "저장 실패!",
            'Are you sure you want to overwrite "{0}"?': '"{0}"을(를) 덮어쓰시겠습니까?',
            Export: "내보내기",
            Help: "도움말",
            "Are you sure you want to exit the editor?": "편집기를 나가시겠습니까?",
            "All unsaved data will be lost!": "저장되지 않은 모든 데이터가 손실됩니다!",
            "Track settings": "트랙 설정",
            "Unnamed Track": "이름 없는 트랙",
            "Track name": "트랙 이름",
            Author: "제작자",
            Unknown: "알 수 없음",
            Environment: "환경",
            Summer: "여름",
            Winter: "겨울",
            Desert: "사막",
            "Sun direction": "태양 방향",
            "How to use the editor": "에디터 사용 방법",
            "Camera controls": "카메라 컨트롤",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "카메라는 마우스 오른쪽 버튼을 클릭하고 드래그하여 이동할 수 있습니다. 카메라를 회전하려면 마우스 중간 버튼(휠)을 클릭하거나 컨트롤 키를 누른 상태에서 마우스 오른쪽 버튼을 클릭하고 드래그하면 됩니다. 마우스 휠을 스크롤하여 확대 및 축소할 수 있습니다.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "또는 다음 키보드 키를 사용하여 카메라를 제어할 수도 있습니다.",
            "Move forwards:": "앞으로 이동:",
            "Move backwards:": "뒤로 이동:",
            "Move left:": "왼쪽으로 이동:",
            "Move right:": "오른쪽으로 이동:",
            "Rotate left:": "왼쪽으로 회전:",
            "Rotate right:": "오른쪽으로 회전:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "편집된 높이는 왼쪽 하단 모서리의 높이 선택을 사용하거나 Shift 키를 누른 상태에서 마우스 휠을 스크롤하여 변경할 수 있습니다. 또는 다음 키보드 키를 사용할 수도 있습니다.",
            "Move up:": "위로 이동:",
            "Move down:": "아래로 이동:",
            Editing: "편집",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "트랙 부품은 오른쪽 메뉴에서 선택한 후 마우스로 왼쪽 클릭하여 배치할 수 있습니다.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "또는 현재 마우스로 가리키고 있는 트랙 부품을 다음 키보드 단축키로 선택할 수도 있습니다.",
            "The selected part can then be rotated using the following keyboard shortcut:": "선택한 부품은 다음 키보드 단축키를 사용하여 회전할 수 있습니다.",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "트랙 부품은 오른쪽 메뉴의 삭제 도구를 사용하거나 다음 키를 누른 상태에서 삭제할 수 있습니다.",
            "Starting points, checkpoints and the finish line": "시작 지점, 체크포인트 및 완주 선",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "시작 지점, 체크포인트 및 완주 선은 모두 오른쪽 메뉴의 가장 상위 카테고리에서 선택할 수 있습니다.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "각 트랙은 최소한 하나의 시작 지점이 있어야 합니다. 여러 개의 시작 지점이 있는 경우 마지막으로 배치된 지점이 사용됩니다.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "체크포인트는 시작 지점과 완주 선 사이에 배치되어야 합니다. 체크포인트 트랙 부품이 선택되면 하단 오른쪽에 체크포인트 순서를 선택할 수 있는 도구가 있습니다. 이는 완주 선으로 이동하기 전에 체크포인트를 통과해야 하는 순서를 결정합니다. 동일한 체크포인트 순서를 가진 여러 개의 체크포인트를 가질 수 있다는 점에 유의하세요.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "완주 선은 트랙이 끝나는 곳이지만 모든 체크포인트를 통과한 후에만 활성화됩니다. 여러 개의 완주 선을 가질 수도 있습니다.",
            "Starting point": "시작 지점",
            Checkpoint: "체크포인트",
            "Finish line": "완주 선",
            "Exporting the track": "트랙 내보내기",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "트랙이 완성되면 왼쪽 상단에 트랙 이름을 입력한 후 내보내기 버튼을 사용하여 트랙을 내보낼 수 있습니다. 이렇게 하면 다른 사용자가 트랙을 가져와서 재생할 수 있는 트랙 코드가 표시됩니다.",
            Close: "닫기",
            "Not set": "설정되지 않음",
            or: "또는",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "카메라는 한 손가락으로 드래그하여 이동할 수 있습니다. 카메라를 두 손가락으로 드래그하여 회전할 수 있습니다. 확대 및 축소하려면 핀치 동작을 사용하십시오.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "편집된 높이는 왼쪽 하단의 높이 선택을 사용하여 변경할 수 있습니다.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "트랙 부품은 오른쪽 메뉴에서 선택한 후 화면을 탭하여 배치할 수 있습니다.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "선택한 부품은 왼쪽 하단의 회전 버튼을 탭하여 회전할 수 있습니다.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "트랙 부품은 오른쪽 메뉴의 삭제 도구를 사용하여 삭제할 수 있습니다.",
            Watch: "관전",
            "Loading replay": "리플레이 로딩",
            "Press {0} to return to the last checkpoint": "마지막 체크포인트로 돌아가려면 {0}을(를) 누르십시오",
            "Press {0} to start over": "처음부터 시작하려면 {0}을(를) 누르십시오",
            "Reset once to return to the last checkpoint": "한 번 리셋하여 마지막 체크포인트로 돌아가세요",
            "Reset again to start over": "다시 리셋하여 처음부터 시작하세요",
            Leaderboard: "리더보드",
            "{0} players": "{0} 플레이어",
            Back: "뒤로",
            "Error: Failed to load leaderboard": "오류: 리더보드 불러오기 실패",
            "Unofficial versions of the game cannot access the leaderboard": "게임의 비공식 버전은 리더보드에 접근할 수 없습니다",
            Pending: "대기 중",
            Verified: "확인됨",
            Invalid: "유효하지 않음",
            Duplicate: "중복",
            You: "당신",
            "Only verified": "확인된 것만",
            Loading: "로딩 중",
            "Failed to load recordings": "녹화 불러오기 실패",
            "Cannot load recordings due to non-determinism": "결정론적이지 않아 녹화를 불러올 수 없습니다",
            Ok: "확인",
            "Track is missing starting point": "트랙에 출발 지점이 없습니다",
            "Some leaderboard features are disabled.": "일부 리더보드 기능이 비활성화되었습니다.",
            "Please try another browser or device.": "다른 브라우저나 기기를 시도해보십시오.",
            "You already have another instance of PolyTrack open.": "이미 다른 PolyTrack 인스턴스가 열려 있습니다.",
            "Please switch to that tab or window to continue.": "계속하려면 해당 탭이나 창으로 전환하십시오.",
            "Computer determinism check failed.": "컴퓨터 결정론 검사 실패.",
            "Non-deterministic game assets found.": "결정론적이지 않은 게임 자산 발견.",
            "Please try clearing your browser cache.": "브라우저 캐시를 지우는 것을 시도해보십시오.",
            "Hardware acceleration is disabled. Performance may be reduced.": "하드웨어 가속이 비활성화되어 있습니다. 성능이 저하될 수 있습니다.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "하드웨어 가속이 브라우저의 설정에서 활성화되어 있는지 확인하십시오.",
            Customize: "사용자 설정",
            Editor: "편집기",
            Settings: "설정",
            Profile: "프로필",
            Play: "재생",
            Version: "버전",
            "You cannot have duplicate user profiles": "중복 사용자 프로필을 가질 수 없습니다",
            "Failed to create user profile": "사용자 프로필 생성에 실패했습니다",
            "This user profile does not exist on the server": "이 사용자 프로필은 서버에 존재하지 않습니다",
            "Failed to download user profile from the server": "서버에서 사용자 프로필을 다운로드하지 못했습니다",
            "User token is invalid": "사용자 토큰이 유효하지 않습니다",
            "Are you sure you want to display your private key?": "개인 키를 표시하시겠습니까?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "이 키를 아무와도 공유하지 마십시오.",
            "You need a free user profile slot to import a new user profile": "새로운 사용자 프로필을 가져오려면 빈 사용자 프로필 슬롯이 필요합니다",
            Quit: "종료",
            Fullscreen: "전체 화면",
            Windowed: "창 모드",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "{0}의 비공식 버전을 플레이 중인 것 같습니다. 최신 버전은 원본 소스에서 확인하십시오:",
            Nickname: "닉네임",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "리더보드에 표시될 닉네임을 선택하십시오. 닉네임은 언제든지 변경할 수 있습니다.",
            Cancel: "취소",
            Confirm: "확인",
            "User ID": "사용자 ID",
            Paused: "일시 정지",
            "Switch car": "차량 전환",
            Profiles: "프로필",
            'Are you sure you would like to delete "{0}"?': '"{0}"를 삭제하시겠습니까?',
            Empty: "비어 있음",
            Reset: "재설정",
            Apply: "적용",
            Gameplay: "게임 플레이",
            Units: "단위",
            Metric: "미터법",
            Imperial: "영국/미국 단위",
            "Reset hint": "힌트 재설정",
            Disabled: "비활성화",
            Enabled: "활성화",
            "Ghost car": "유령 자동차",
            "Default camera": "기본 카메라",
            Default: "기본",
            Cockpit: "콕핏",
            "Cockpit camera mode": "콕핏 카메라 모드",
            Hold: "유지",
            Toggle: "전환",
            Checkpoints: "체크포인트",
            Timer: "타이머",
            Speedometer: "속도계",
            Bottom: "하단",
            Top: "상단",
            Language: "언어",
            Graphics: "그래픽",
            Shadows: "그림자",
            Off: "끄기",
            On: "켜기",
            Minimal: "최소",
            Low: "낮음",
            Medium: "중간",
            High: "높음",
            Ultra: "초고화질",
            Clouds: "구름",
            Particles: "파티클",
            Skidmarks: "스키드 마크",
            "Render scale": "렌더링 스케일",
            "Anti-aliasing (requires restart)": "안티 앨리어싱 (재시작 필요)",
            Audio: "오디오",
            "Sound effect volume": "사운드 효과 볼륨",
            "Music volume": "음악 볼륨",
            "Checkpoint volume": "체크포인트 볼륨",
            Mobile: "모바일",
            Vibration: "진동",
            "Steering control side": "조향 제어 측면",
            Left: "왼쪽",
            Right: "오른쪽",
            Controls: "컨트롤",
            Vehicle: "차량",
            Accelerate: "가속",
            Brake: "브레이크",
            "Turn left": "왼쪽으로 회전",
            "Turn right": "오른쪽으로 회전",
            "Checkpoint reset": "체크포인트 리셋",
            "Start reset": "시작 리셋",
            "Cockpit camera": "콕핏 카메라",
            "Rotate part": "부품 회전",
            "Height modifier": "높이 조절",
            "Delete part": "부품 삭제",
            "Move forwards": "앞으로 이동",
            "Move backwards": "뒤로 이동",
            "Move left": "왼쪽으로 이동",
            "Move right": "오른쪽으로 이동",
            "Rotate view up": "뷰 위로 회전",
            "Rotate view down": "뷰 아래로 회전",
            "Rotate view left": "뷰 왼쪽으로 회전",
            "Rotate view right": "뷰 오른쪽으로 회전",
            "Move down": "아래로 이동",
            "Move up": "위로 이동",
            "Test track": "트랙 테스트",
            "Pick part": "부품 선택",
            Spectator: "관전자",
            "Speed modifier": "속도 조절",
            Other: "기타",
            "Hide UI": "UI 숨기기",
            Pause: "일시 정지",
            "Toggle FPS counter": "FPS 카운터 전환",
            "Toggle spectator camera": "관전 카메라 전환",
            "Press any key...\n\nPress [Escape] to cancel.": "아무 키나 누르십시오...\n\n[Escape]를 눌러 취소하십시오.",
            Clear: "지우기",
            "New record": "새 기록",
            Record: "기록",
            Current: "현재",
            Difference: "차이",
            Copy: "복사",
            Import: "가져오기",
            "Failed to import track": "트랙 가져오기 실패",
            'The track "{0}" already exists. Do you wish to overwrite it?': '"{0}" 트랙이 이미 존재합니다. 덮어쓰시겠습니까?',
            Overwrite: "덮어쓰기",
            "Paste track data here...": "트랙 데이터를 여기에 붙여넣으십시오...",
            Rank: "순위",
            "Personal best": "개인 최고 기록",
            Opponents: "상대방",
            "{0} opponent selected": "{0} 상대방 선택됨",
            "{0} opponents selected": "{0} 상대방 선택됨",
            "Select opponents to race against from the leaderboard on the left": "왼쪽의 리더보드에서 경주할 상대방을 선택하세요",
            "No record": "기록 없음",
            "Official tracks": "공식 트랙",
            "Community tracks": "커뮤니티 트랙",
            "Custom tracks": "사용자 정의 트랙",
            'Are you sure you want to delete "{0}"?': '"{0}"을(를) 삭제하시겠습니까?',
            Delete: "삭제",
            "No community tracks": "커뮤니티 트랙 없음",
            "Community tracks are coming soon": "커뮤니티 트랙이 곧 출시됩니다",
            "No custom tracks": "사용자 정의 트랙 없음",
            "Create a track using the editor or import a track code": "에디터를 사용하여 트랙을 만들거나 트랙 코드를 가져와서 트랙을 만드세요",
            "Search by track or author...": "트랙 또는 제작자 검색...",
            "Invalid replay detected!": "유효하지 않은 리플레이가 감지되었습니다!"
        }
          , kO = {
            "Checkpoint order": "Kolejność punktów kontrolnych",
            Height: "Wysokość",
            Exit: "Wyjście",
            Random: "Losowe",
            Primary: "Główny",
            Secondary: "Dodatkowy",
            Frame: "Rama",
            Rims: "Obręcze",
            "Are you sure you want to exit without saving?": "Czy na pewno chcesz wyjść bez zapisywania?",
            "All changes will be lost!": "Wszystkie zmiany zostaną utracone!",
            "Car saved!": "Samochód zapisany!",
            Test: "Test",
            "Starting point is missing!": "Brak punktu startowego!",
            Generate: "Generuj",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "Czy na pewno chcesz wygenerować nową trasę?\n\nTwoja obecna trasa zostanie utracona!",
            Load: "Wczytaj",
            Save: "Zapisz",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "Czy na pewno chcesz wczytać nową trasę?\n\nTwoja obecna trasa zostanie utracona!",
            "Track saved!": "Trasa została zapisana!",
            "Failed to save!": "Nie udało się zapisać!",
            'Are you sure you want to overwrite "{0}"?': "Czy na pewno chcesz nadpisać „{0}”?",
            Export: "Eksportuj",
            Help: "Pomoc",
            "Are you sure you want to exit the editor?": "Czy na pewno chcesz wyjść z edytora?",
            "All unsaved data will be lost!": "Wszystkie niezapisane dane zostaną utracone!",
            "Track settings": "Ustawienia trasy",
            "Unnamed Track": "Bez nazwy",
            "Track name": "Nazwa trasy",
            Author: "Autor",
            Unknown: "Nieznany",
            Environment: "Środowisko",
            Summer: "Lato",
            Winter: "Zima",
            Desert: "Pustynia",
            "Sun direction": "Kierunek słońca",
            "How to use the editor": "Jak korzystać z edytora",
            "Camera controls": "Sterowanie kamerą",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "Kamerę można przesuwać, klikając prawym przyciskiem myszy i przeciągając. Obróć kamerę, klikając środkowy przycisk myszy (koło myszy) lub przytrzymując klawisz Ctrl i klikając prawym przyciskiem myszy i przeciągając. Przybliż i oddal obraz, przewijając kółko myszy.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "Alternatywnie, kamerą można również sterować za pomocą następujących klawiszy na klawiaturze:",
            "Move forwards:": "Poruszaj się do przodu:",
            "Move backwards:": "Poruszaj się do tyłu:",
            "Move left:": "Poruszaj się w lewo:",
            "Move right:": "Poruszaj się w prawo:",
            "Rotate left:": "Obróć w lewo:",
            "Rotate right:": "Obróć w prawo:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "Edytowaną wysokość można zmienić, korzystając z wyboru wysokości w lewym dolnym rogu lub przytrzymując klawisz Shift i przewijając kółko myszy. Alternatywnie można użyć następujących klawiszy na klawiaturze:",
            "Move up:": "Przesuń w górę:",
            "Move down:": "Przesuń w dół:",
            Editing: "Edycja",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "Części toru można wybrać w menu po prawej stronie, a następnie można je umieścić, klikając lewym przyciskiem myszy.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "Alternatywnie, aktualnie zaznaczoną część toru można wybrać za pomocą następującego skrótu klawiaturowego:",
            "The selected part can then be rotated using the following keyboard shortcut:": "Wybraną część można następnie obrócić za pomocą następującego skrótu klawiaturowego:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "Części toru można usunąć, korzystając z narzędzia usuwania w menu po prawej stronie lub przytrzymując następujący klawisz:",
            "Starting points, checkpoints and the finish line": "Punkty startowe, punkty kontrolne i linia mety",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "Punkty startowe, punkty kontrolne i linie mety można wybrać we wszystkich kategoriach w menu po prawej stronie.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "Każda trasa musi mieć co najmniej jeden punkt startowy. Jeśli istnieje wiele punktów startowych, zostanie użyty ostatnio umieszczony.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "Punkty kontrolne powinny być umieszczone między punktem startowym a linią mety. Po wybraniu części toru punktu kontrolnego pojawi się narzędzie w prawym dolnym rogu, które pozwoli wybrać kolejność punktu kontrolnego. Określa to kolejność, w jakiej punkty kontrolne muszą być przechodzone przed dojazdem do linii mety. Zauważ, że możliwe jest posiadanie wielu punktów kontrolnych o tej samej kolejności.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "Linia mety to miejsce, gdzie kończy się tor, ale staje się aktywna dopiero po przejściu wszystkich punktów kontrolnych. Możliwe jest również posiadanie wielu linii mety.",
            "Starting point": "Punkt startowy",
            Checkpoint: "Punkt kontrolny",
            "Finish line": "Linia mety",
            "Exporting the track": "Eksportowanie trasy",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "Po zakończeniu trasy można wprowadzić jej nazwę w lewym górnym rogu, a następnie można ją wyeksportować, korzystając z przycisku eksportu. To ujawni kod trasy, który można przesłać innym użytkownikom, aby mogli zaimportować i odtworzyć trasę.",
            Close: "Zamknij",
            "Not set": "Nie ustawiono",
            or: "lub",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "Kamerę można przesuwać, przeciągając jednym palcem. Obróć kamerę, przeciągając dwoma palcami. Przybliż i oddal obraz, ściskając palcami.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "Edytowaną wysokość można zmienić, korzystając z wyboru wysokości w lewym dolnym rogu.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "Części toru można wybrać w menu po prawej stronie, a następnie można je umieścić, dotykając ekranu.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "Wybraną część można następnie obrócić, dotykając przycisku obracania w lewym dolnym rogu.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "Części toru można usunąć, korzystając z narzędzia usuwania w menu po prawej stronie.",
            Watch: "Oglądaj",
            "Loading replay": "Wczytywanie nagrania",
            "Press {0} to return to the last checkpoint": "Naciśnij {0}, aby wrócić do ostatniego punktu kontrolnego",
            "Press {0} to start over": "Naciśnij {0}, aby zacząć od nowa",
            "Reset once to return to the last checkpoint": "Resetuj raz, aby wrócić do ostatniego punktu kontrolnego",
            "Reset again to start over": "Resetuj ponownie, aby zacząć od nowa",
            Leaderboard: "Tabela wyników",
            "{0} players": "{0} graczy",
            Back: "Powrót",
            "Error: Failed to load leaderboard": "Błąd: Nie można wczytać tabeli wyników",
            "Unofficial versions of the game cannot access the leaderboard": "Nieoficjalne wersje gry nie mogą uzyskać dostępu do tabeli wyników",
            Pending: "Oczekujący",
            Verified: "Zweryfikowany",
            Invalid: "Nieprawidłowy",
            Duplicate: "Duplikat",
            You: "Ty",
            "Only verified": "Tylko zweryfikowane",
            Loading: "Ładowanie",
            "Failed to load recordings": "Nie udało się wczytać nagrań",
            "Cannot load recordings due to non-determinism": "Nie można wczytać nagrań z powodu nieterminizmu",
            Ok: "Ok",
            "Track is missing starting point": "Brak punktu startowego na trasie",
            "Some leaderboard features are disabled.": "Niektóre funkcje tabeli wyników są wyłączone.",
            "Please try another browser or device.": "Proszę spróbować inną przeglądarkę lub urządzenie.",
            "You already have another instance of PolyTrack open.": "Masz już otwartą inną instancję PolyTrack.",
            "Please switch to that tab or window to continue.": "Proszę przełączyć się na ten kartę lub okno, aby kontynuować.",
            "Computer determinism check failed.": "Nie udało się sprawdzić determinizmu komputera.",
            "Non-deterministic game assets found.": "Znaleziono nieterministyczne zasoby gry.",
            "Please try clearing your browser cache.": "Proszę spróbować wyczyścić pamięć podręczną przeglądarki.",
            "Hardware acceleration is disabled. Performance may be reduced.": "Przyspieszenie sprzętowe jest wyłączone. Wydajność może być zmniejszona.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "Proszę upewnić się, że przyspieszenie sprzętowe jest włączone w ustawieniach przeglądarki.",
            Customize: "Dostosuj",
            Editor: "Edytor",
            Settings: "Ustawienia",
            Profile: "Profil",
            Play: "Graj",
            Version: "Wersja",
            "You cannot have duplicate user profiles": "Nie możesz mieć zduplikowanych profili użytkownika",
            "Failed to create user profile": "Nie udało się utworzyć profilu użytkownika",
            "This user profile does not exist on the server": "Ten profil użytkownika nie istnieje na serwerze",
            "Failed to download user profile from the server": "Nie udało się pobrać profilu użytkownika z serwera",
            "User token is invalid": "Token użytkownika jest nieprawidłowy",
            "Are you sure you want to display your private key?": "Czy na pewno chcesz wyświetlić swój klucz prywatny?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "NIE UDOSTĘPNIAJ TEGO KLUCZA NIKOMU.",
            "You need a free user profile slot to import a new user profile": "Potrzebujesz wolnego miejsca na profil użytkownika, aby zaimportować nowy profil użytkownika",
            Quit: "Wyjdź",
            Fullscreen: "Pełny ekran",
            Windowed: "Okno",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "Wygląda na to, że grasz w nieoficjalną wersję {0}. Aby uzyskać najnowszą wersję, odwiedź oryginalne źródło:",
            Nickname: "Pseudonim",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "Wybierz pseudonim, który będzie wyświetlany w tabeli wyników. Możesz go zmieniać w dowolnym momencie.",
            Cancel: "Anuluj",
            Confirm: "Potwierdź",
            "User ID": "ID użytkownika",
            Paused: "Wstrzymano",
            "Switch car": "Zmień samochód",
            Profiles: "Profile",
            'Are you sure you would like to delete "{0}"?': 'Czy na pewno chcesz usunąć "{0}"?',
            Empty: "Puste",
            Reset: "Resetuj",
            Apply: "Zastosuj",
            Gameplay: "Rozgrywka",
            Units: "Jednostki",
            Metric: "Metryczne",
            Imperial: "Imperialne",
            "Reset hint": "Resetuj wskazówkę",
            Disabled: "Wyłączone",
            Enabled: "Włączone",
            "Ghost car": "Duch samochodu",
            "Default camera": "Domyślna kamera",
            Default: "Domyślny",
            Cockpit: "Kokpit",
            "Cockpit camera mode": "Tryb kamery kokpitu",
            Hold: "Przytrzymaj",
            Toggle: "Przełącz",
            Checkpoints: "Punkty kontrolne",
            Timer: "Stoper",
            Speedometer: "Prędkościomierz",
            Bottom: "Dół",
            Top: "Góra",
            Language: "Język",
            Graphics: "Grafika",
            Shadows: "Cienie",
            Off: "Wyłącz",
            On: "Włącz",
            Minimal: "Minimalny",
            Low: "Niska",
            Medium: "Średnia",
            High: "Wysoka",
            Ultra: "Ultra",
            Clouds: "Chmury",
            Particles: "Cząsteczki",
            Skidmarks: "Ślady opon",
            "Render scale": "Skala renderowania",
            "Anti-aliasing (requires restart)": "Anti-aliasing (wymaga restartu)",
            Audio: "Dźwięk",
            "Sound effect volume": "Głośność efektów dźwiękowych",
            "Music volume": "Głośność muzyki",
            "Checkpoint volume": "Głośność punktów kontrolnych",
            Mobile: "Mobilny",
            Vibration: "Wibracja",
            "Steering control side": "Strona sterowania kierownicą",
            Left: "Lewo",
            Right: "Prawo",
            Controls: "Sterowanie",
            Vehicle: "Pojazd",
            Accelerate: "Przyspiesz",
            Brake: "Hamuj",
            "Turn left": "Skręć w lewo",
            "Turn right": "Skręć w prawo",
            "Checkpoint reset": "Reset punktu kontrolnego",
            "Start reset": "Reset startu",
            "Cockpit camera": "Kamera kokpitu",
            "Rotate part": "Obróć część",
            "Height modifier": "Modyfikator wysokości",
            "Delete part": "Usuń część",
            "Move forwards": "Poruszaj się do przodu",
            "Move backwards": "Poruszaj się do tyłu",
            "Move left": "Poruszaj się w lewo",
            "Move right": "Poruszaj się w prawo",
            "Rotate view up": "Obróć widok w górę",
            "Rotate view down": "Obróć widok w dół",
            "Rotate view left": "Obróć widok w lewo",
            "Rotate view right": "Obróć widok w prawo",
            "Move down": "Przesuń w dół",
            "Move up": "Przesuń w górę",
            "Test track": "Testuj trasę",
            "Pick part": "Wybierz część",
            Spectator: "Widz",
            "Speed modifier": "Modyfikator prędkości",
            Other: "Inne",
            "Hide UI": "Ukryj UI",
            Pause: "Pauza",
            "Toggle FPS counter": "Przełącz licznik FPS",
            "Toggle spectator camera": "Przełącz kamerę widza",
            "Press any key...\n\nPress [Escape] to cancel.": "Naciśnij dowolny klawisz...\n\nNaciśnij [Escape], aby anulować.",
            Clear: "Wyczyść",
            "New record": "Nowy rekord",
            Record: "Rekord",
            Current: "Aktualny",
            Difference: "Różnica",
            Copy: "Kopiuj",
            Import: "Importuj",
            "Failed to import track": "Import trasy nie powiódł się",
            'The track "{0}" already exists. Do you wish to overwrite it?': "Trasa „{0}” już istnieje. Czy chcesz ją nadpisać?",
            Overwrite: "Nadpisz",
            "Paste track data here...": "Wklej dane trasy tutaj...",
            Rank: "Ranking",
            "Personal best": "Najlepszy wynik",
            Opponents: "Przeciwnicy",
            "{0} opponent selected": "{0} przeciwnik wybrany",
            "{0} opponents selected": "{0} przeciwników wybranych",
            "Select opponents to race against from the leaderboard on the left": "Wybierz przeciwników, przeciwko którym chcesz ścigać się z tabeli wyników po lewej stronie",
            "No record": "Brak rekordu",
            "Official tracks": "Oficjalne trasy",
            "Community tracks": "Trasy społeczności",
            "Custom tracks": "Niestandardowe trasy",
            'Are you sure you want to delete "{0}"?': "Czy na pewno chcesz usunąć „{0}”?",
            Delete: "Usuń",
            "No community tracks": "Brak tras społeczności",
            "Community tracks are coming soon": "Trasy społeczności wkrótce",
            "No custom tracks": "Brak niestandardowych tras",
            "Create a track using the editor or import a track code": "Utwórz trasę za pomocą edytora lub zaimportuj kod trasy",
            "Search by track or author...": "Szukaj według trasy lub autora...",
            "Invalid replay detected!": "Wykryto nieprawidłowe nagranie!"
        }
          , EO = {
            "Checkpoint order": "Ordem dos Pontos de Verificação",
            Height: "Altura",
            Exit: "Sair",
            Random: "Aleatório",
            Primary: "Principal",
            Secondary: "Secundário",
            Frame: "Estrutura",
            Rims: "Aros",
            "Are you sure you want to exit without saving?": "Tem certeza de que deseja sair sem salvar?",
            "All changes will be lost!": "Todas as alterações serão perdidas!",
            "Car saved!": "Carro salvo!",
            Test: "Testar",
            "Starting point is missing!": "Ponto de partida está faltando!",
            Generate: "Gerar",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "Tem certeza de que deseja gerar uma nova pista?\n\nSua pista atual será perdida!",
            Load: "Carregar",
            Save: "Salvar",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "Tem certeza de que deseja carregar uma nova pista?\n\nSua pista atual será perdida!",
            "Track saved!": "Pista salva!",
            "Failed to save!": "Falha ao salvar!",
            'Are you sure you want to overwrite "{0}"?': 'Tem certeza de que deseja sobrescrever "{0}"?',
            Export: "Exportar",
            Help: "Ajuda",
            "Are you sure you want to exit the editor?": "Tem certeza de que deseja sair do editor?",
            "All unsaved data will be lost!": "Todos os dados não salvos serão perdidos!",
            "Track settings": "Configurações da pista",
            "Unnamed Track": "Pista sem nome",
            "Track name": "Nome da pista",
            Author: "Autor",
            Unknown: "Desconhecido",
            Environment: "Ambiente",
            Summer: "Verão",
            Winter: "Inverno",
            Desert: "Deserto",
            "Sun direction": "Direção do sol",
            "How to use the editor": "Como usar o editor",
            "Camera controls": "Controles da câmera",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "A câmera pode ser movida clicando com o botão direito do mouse e arrastando. Gire a câmera clicando no botão do meio do mouse (roda do mouse) ou segurando a tecla de controle e clicando com o botão direito do mouse e arrastando. Amplie e reduza o zoom rolando a roda do mouse.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "Alternativamente, a câmera também pode ser controlada usando as seguintes teclas do teclado:",
            "Move forwards:": "Mover para frente:",
            "Move backwards:": "Mover para trás:",
            "Move left:": "Mover para a esquerda:",
            "Move right:": "Mover para a direita:",
            "Rotate left:": "Girar para a esquerda:",
            "Rotate right:": "Girar para a direita:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "A altura editada pode ser alterada usando a seleção de altura no canto inferior esquerdo ou segurando a tecla shift e rolando a roda do mouse. Alternativamente, você pode usar as seguintes teclas do teclado:",
            "Move up:": "Mover para cima:",
            "Move down:": "Mover para baixo:",
            Editing: "Edição",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "As partes da pista podem ser selecionadas no menu à direita e, em seguida, podem ser colocadas clicando com o botão esquerdo do mouse.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "Alternativamente, a parte da pista atualmente destacada pelo mouse pode ser selecionada com o seguinte atalho de teclado:",
            "The selected part can then be rotated using the following keyboard shortcut:": "A parte selecionada pode então ser girada usando o seguinte atalho de teclado:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "As partes da pista podem ser excluídas usando a ferramenta de exclusão no menu lateral direito ou segurando a seguinte tecla:",
            "Starting points, checkpoints and the finish line": "Pontos de partida, checkpoints e linha de chegada",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "Pontos de partida, checkpoints e linhas de chegada podem ser selecionados na categoria mais alta do menu lateral direito.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "Cada pista deve ter pelo menos um ponto de partida. Se houver vários pontos de partida, o último colocado será usado.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "Os checkpoints devem ser colocados entre o ponto de partida e a linha de chegada. Quando uma parte da pista de checkpoint é selecionada, haverá uma ferramenta no canto inferior direito para selecionar a ordem do checkpoint. Isso determina a ordem em que os checkpoints devem ser passados antes de dirigir até a linha de chegada. Observe que é possível ter vários checkpoints com a mesma ordem de checkpoint.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "A linha de chegada é onde a pista termina, mas só se tornará ativa depois que todos os checkpoints forem passados. Também é possível ter várias linhas de chegada.",
            "Starting point": "Ponto de partida",
            Checkpoint: "Checkpoint",
            "Finish line": "Linha de chegada",
            "Exporting the track": "Exportando a pista",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "Quando a pista estiver pronta, um nome para a pista pode ser inserido no canto superior esquerdo e, em seguida, a pista pode ser exportada usando o botão de exportação. Isso revelará um código de pista que pode ser enviado para outros usuários para que eles possam importar e jogar a pista.",
            Close: "Fechar",
            "Not set": "Não definido",
            or: "ou",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "A câmera pode ser movida arrastando com um dedo. Gire a câmera arrastando com dois dedos. Amplie e reduza o zoom beliscando.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "A altura editada pode ser alterada usando a seleção de altura no canto inferior esquerdo.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "As partes da pista podem ser selecionadas no menu à direita e, em seguida, podem ser colocadas tocando na tela.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "A parte selecionada pode então ser girada tocando no botão de rotação no canto inferior esquerdo.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "As partes da pista podem ser excluídas usando a ferramenta de exclusão no menu lateral direito.",
            Watch: "Assistir",
            "Loading replay": "Carregando replay",
            "Press {0} to return to the last checkpoint": "Pressione {0} para retornar ao último checkpoint",
            "Press {0} to start over": "Pressione {0} para começar de novo",
            "Reset once to return to the last checkpoint": "Redefinir uma vez para retornar ao último checkpoint",
            "Reset again to start over": "Redefinir novamente para começar de novo",
            Leaderboard: "Quadro de Líderes",
            "{0} players": "{0} jogadores",
            Back: "Voltar",
            "Error: Failed to load leaderboard": "Erro: Falha ao carregar o quadro de líderes",
            "Unofficial versions of the game cannot access the leaderboard": "Versões não oficiais do jogo não podem acessar o quadro de líderes",
            Pending: "Pendente",
            Verified: "Verificado",
            Invalid: "Inválido",
            Duplicate: "Duplicado",
            You: "Você",
            "Only verified": "Apenas verificados",
            Loading: "Carregando",
            "Failed to load recordings": "Falha ao carregar gravações",
            "Cannot load recordings due to non-determinism": "Não é possível carregar gravações devido a não determinismo",
            Ok: "Ok",
            "Track is missing starting point": "Pista está sem ponto de partida",
            "Some leaderboard features are disabled.": "Alguns recursos do quadro de líderes estão desativados.",
            "Please try another browser or device.": "Por favor, tente outro navegador ou dispositivo.",
            "You already have another instance of PolyTrack open.": "Você já tem outra instância do PolyTrack aberta.",
            "Please switch to that tab or window to continue.": "Por favor, mude para aquela guia ou janela para continuar.",
            "Computer determinism check failed.": "Falha na verificação de determinismo do computador.",
            "Non-deterministic game assets found.": "Assets de jogo não determinísticos encontrados.",
            "Please try clearing your browser cache.": "Por favor, tente limpar o cache do seu navegador.",
            "Hardware acceleration is disabled. Performance may be reduced.": "Aceleração de hardware está desativada. O desempenho pode ser reduzido.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "Por favor, certifique-se de que a aceleração de hardware esteja ativada nas configurações do seu navegador.",
            Customize: "Personalizar",
            Editor: "Editor",
            Settings: "Configurações",
            Profile: "Perfil",
            Play: "Jogar",
            Version: "Versão",
            "You cannot have duplicate user profiles": "Você não pode ter perfis de usuário duplicados",
            "Failed to create user profile": "Falha ao criar perfil de usuário",
            "This user profile does not exist on the server": "Este perfil de usuário não existe no servidor",
            "Failed to download user profile from the server": "Falha ao baixar perfil de usuário do servidor",
            "User token is invalid": "Token de usuário inválido",
            "Are you sure you want to display your private key?": "Tem certeza de que deseja exibir sua chave privada?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "NÃO COMPARTILHE ESTA CHAVE COM NINGUÉM.",
            "You need a free user profile slot to import a new user profile": "Você precisa de um slot de perfil de usuário livre para importar um novo perfil de usuário",
            Quit: "Sair",
            Fullscreen: "Tela Cheia",
            Windowed: "Janela",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "Parece que você está jogando uma versão não oficial de {0}. Para a versão mais atualizada, visite a fonte original:",
            Nickname: "Apelido",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "Escolha um apelido para ser exibido no quadro de líderes. Seu apelido pode ser alterado a qualquer momento.",
            Cancel: "Cancelar",
            Confirm: "Confirmar",
            "User ID": "ID de Usuário",
            Paused: "Pausado",
            "Switch car": "Trocar carro",
            Profiles: "Perfis",
            'Are you sure you would like to delete "{0}"?': 'Tem certeza de que deseja excluir "{0}"?',
            Empty: "Vazio",
            Reset: "Redefinir",
            Apply: "Aplicar",
            Gameplay: "Jogabilidade",
            Units: "Unidades",
            Metric: "Métrico",
            Imperial: "Imperial",
            "Reset hint": "Redefinir dica",
            Disabled: "Desativado",
            Enabled: "Ativado",
            "Ghost car": "Carro Fantasma",
            "Default camera": "Câmera Padrão",
            Default: "Padrão",
            Cockpit: "Cockpit",
            "Cockpit camera mode": "Modo de câmera do cockpit",
            Hold: "Manter",
            Toggle: "Alternar",
            Checkpoints: "Pontos de Verificação",
            Timer: "Temporizador",
            Speedometer: "Velocímetro",
            Bottom: "Inferior",
            Top: "Superior",
            Language: "Idioma",
            Graphics: "Gráficos",
            Shadows: "Sombras",
            Off: "Desligado",
            On: "Ligado",
            Minimal: "Mínimo",
            Low: "Baixo",
            Medium: "Médio",
            High: "Alto",
            Ultra: "Ultra",
            Clouds: "Nuvens",
            Particles: "Partículas",
            Skidmarks: "Marcas de Derrapagem",
            "Render scale": "Escala de Renderização",
            "Anti-aliasing (requires restart)": "Anti-aliasing (requer reinício)",
            Audio: "Áudio",
            "Sound effect volume": "Volume de Efeitos Sonoros",
            "Music volume": "Volume de Música",
            "Checkpoint volume": "Volume dos Pontos de Verificação",
            Mobile: "Celular",
            Vibration: "Vibração",
            "Steering control side": "Lado do controle de direção",
            Left: "Esquerda",
            Right: "Direita",
            Controls: "Controles",
            Vehicle: "Veículo",
            Accelerate: "Acelerar",
            Brake: "Freio",
            "Turn left": "Virar à Esquerda",
            "Turn right": "Virar à Direita",
            "Checkpoint reset": "Redefinir Ponto de Verificação",
            "Start reset": "Redefinir Início",
            "Cockpit camera": "Câmera do Cockpit",
            "Rotate part": "Girar Parte",
            "Height modifier": "Modificador de Altura",
            "Delete part": "Excluir Parte",
            "Move forwards": "Mover para Frente",
            "Move backwards": "Mover para Trás",
            "Move left": "Mover para a Esquerda",
            "Move right": "Mover para a Direita",
            "Rotate view up": "Girar Visão para Cima",
            "Rotate view down": "Girar Visão para Baixo",
            "Rotate view left": "Girar Visão para a Esquerda",
            "Rotate view right": "Girar Visão para a Direita",
            "Move down": "Mover para Baixo",
            "Move up": "Mover para Cima",
            "Test track": "Testar Pista",
            "Pick part": "Escolher Parte",
            Spectator: "Espectador",
            "Speed modifier": "Modificador de Velocidade",
            Other: "Outro",
            "Hide UI": "Ocultar UI",
            Pause: "Pausar",
            "Toggle FPS counter": "Alternar Contador de FPS",
            "Toggle spectator camera": "Alternar Câmera de Espectador",
            "Press any key...\n\nPress [Escape] to cancel.": "Pressione qualquer tecla...\n\nPressione [Escape] para cancelar.",
            Clear: "Limpar",
            "New record": "Novo recorde",
            Record: "Recorde",
            Current: "Atual",
            Difference: "Diferença",
            Copy: "Copiar",
            Import: "Importar",
            "Failed to import track": "Falha ao importar a pista",
            'The track "{0}" already exists. Do you wish to overwrite it?': 'A pista "{0}" já existe. Deseja sobrescrevê-la?',
            Overwrite: "Sobrescrever",
            "Paste track data here...": "Cole os dados da pista aqui...",
            Rank: "Classificação",
            "Personal best": "Melhor pessoal",
            Opponents: "Oponentes",
            "{0} opponent selected": "{0} oponente selecionado",
            "{0} opponents selected": "{0} oponentes selecionados",
            "Select opponents to race against from the leaderboard on the left": "Selecione os oponentes para competir no quadro de líderes à esquerda",
            "No record": "Sem recorde",
            "Official tracks": "Pistas Oficiais",
            "Community tracks": "Pistas Comunitárias",
            "Custom tracks": "Pistas Personalizadas",
            'Are you sure you want to delete "{0}"?': 'Tem certeza de que deseja excluir "{0}"?',
            Delete: "Excluir",
            "No community tracks": "Sem pistas comunitárias",
            "Community tracks are coming soon": "Pistas comunitárias em breve",
            "No custom tracks": "Sem pistas personalizadas",
            "Create a track using the editor or import a track code": "Crie uma pista usando o editor ou importe um código de pista",
            "Search by track or author...": "Pesquisar por pista ou autor...",
            "Invalid replay detected!": "Replay inválido detectado!"
        }
          , SO = {
            "Checkpoint order": "Ordem dos Pontos de Verificação",
            Height: "Altura",
            Exit: "Sair",
            Random: "Aleatório",
            Primary: "Primário",
            Secondary: "Secundário",
            Frame: "Estrutura",
            Rims: "Aros",
            "Are you sure you want to exit without saving?": "Tem a certeza de que deseja sair sem guardar?",
            "All changes will be lost!": "Todas as alterações serão perdidas!",
            "Car saved!": "Carro guardado!",
            Test: "Testar",
            "Starting point is missing!": "Ponto de partida em falta!",
            Generate: "Gerar",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "Tem a certeza de que deseja gerar uma nova pista?\n\nA pista atual será perdida!",
            Load: "Carregar",
            Save: "Guardar",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "Tem a certeza de que deseja carregar uma nova pista?\n\nA pista atual será perdida!",
            "Track saved!": "Pista guardada!",
            "Failed to save!": "Falha ao guardar!",
            'Are you sure you want to overwrite "{0}"?': 'Tem a certeza de que deseja substituir "{0}"?',
            Export: "Exportar",
            Help: "Ajuda",
            "Are you sure you want to exit the editor?": "Tem a certeza de que deseja sair do editor?",
            "All unsaved data will be lost!": "Todos os dados não guardados serão perdidos!",
            "Track settings": "Definições da pista",
            "Unnamed Track": "Pista sem nome",
            "Track name": "Nome da pista",
            Author: "Autor",
            Unknown: "Desconhecido",
            Environment: "Ambiente",
            Summer: "Verão",
            Winter: "Inverno",
            Desert: "Deserto",
            "Sun direction": "Direção do sol",
            "How to use the editor": "Como usar o editor",
            "Camera controls": "Controlos da câmera",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "A câmera pode ser movida clicando com o botão direito do mouse e arrastando. Rode a câmera clicando no botão do meio do mouse (roda do mouse) ou segurando a tecla de controle e clicando com o botão direito do mouse e arrastando. Aproxime e afaste o zoom rolando a roda do mouse.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "Alternativamente, a câmera também pode ser controlada usando as seguintes teclas do teclado:",
            "Move forwards:": "Mover para a frente:",
            "Move backwards:": "Mover para trás:",
            "Move left:": "Mover para a esquerda:",
            "Move right:": "Mover para a direita:",
            "Rotate left:": "Rodar para a esquerda:",
            "Rotate right:": "Rodar para a direita:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "A altura editada pode ser alterada usando a seleção de altura no canto inferior esquerdo ou segurando a tecla shift e rolando a roda do mouse. Alternativamente, você pode usar as seguintes teclas do teclado:",
            "Move up:": "Mover para cima:",
            "Move down:": "Mover para baixo:",
            Editing: "Edição",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "As partes da pista podem ser selecionadas no menu à direita e depois podem ser colocadas clicando com o botão esquerdo do mouse.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "Alternativamente, a parte da pista atualmente destacada pelo mouse pode ser selecionada com o seguinte atalho de teclado:",
            "The selected part can then be rotated using the following keyboard shortcut:": "A parte selecionada pode então ser girada usando o seguinte atalho de teclado:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "As partes da pista podem ser excluídas usando a ferramenta de exclusão no menu lateral direito ou segurando a seguinte tecla:",
            "Starting points, checkpoints and the finish line": "Pontos de partida, checkpoints e linha de chegada",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "Pontos de partida, checkpoints e linhas de chegada podem ser selecionados na categoria mais alta do menu lateral direito.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "Cada pista deve ter pelo menos um ponto de partida. Se houver vários pontos de partida, o último colocado será usado.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "Os checkpoints devem ser colocados entre o ponto de partida e a linha de chegada. Quando uma parte da pista de checkpoint é selecionada, haverá uma ferramenta no canto inferior direito para selecionar a ordem do checkpoint. Isso determina a ordem em que os checkpoints devem ser passados antes de dirigir até a linha de chegada. Observe que é possível ter vários checkpoints com a mesma ordem de checkpoint.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "A linha de chegada é onde a pista termina, mas só se tornará ativa depois que todos os checkpoints forem passados. Também é possível ter várias linhas de chegada.",
            "Starting point": "Ponto de partida",
            Checkpoint: "Checkpoint",
            "Finish line": "Linha de chegada",
            "Exporting the track": "Exportando a pista",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "Quando a pista estiver pronta, um nome para a pista pode ser inserido no canto superior esquerdo, após o qual a pista pode ser exportada usando o botão de exportação. Isso revelará um código de pista que pode ser enviado para outros usuários para que eles possam importar e jogar a pista.",
            Close: "Fechar",
            "Not set": "Não definido",
            or: "ou",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "A câmera pode ser movida arrastando com um dedo. Rode a câmera arrastando com dois dedos. Aproxime e afaste o zoom beliscando.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "A altura editada pode ser alterada usando a seleção de altura no canto inferior esquerdo.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "As partes da pista podem ser selecionadas no menu à direita e depois podem ser colocadas tocando na tela.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "A parte selecionada pode então ser girada tocando no botão de rotação no canto inferior esquerdo.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "As partes da pista podem ser excluídas usando a ferramenta de exclusão no menu lateral direito.",
            Watch: "Ver",
            "Loading replay": "A carregar replay",
            "Press {0} to return to the last checkpoint": "Pressione {0} para voltar ao último checkpoint",
            "Press {0} to start over": "Pressione {0} para começar de novo",
            "Reset once to return to the last checkpoint": "Repor uma vez para voltar ao último checkpoint",
            "Reset again to start over": "Repor novamente para começar de novo",
            Leaderboard: "Tabela de Classificação",
            "{0} players": "{0} jogadores",
            Back: "Voltar",
            "Error: Failed to load leaderboard": "Erro: Falha ao carregar a tabela de classificação",
            "Unofficial versions of the game cannot access the leaderboard": "Versões não oficiais do jogo não podem acessar a tabela de classificação",
            Pending: "Pendente",
            Verified: "Verificado",
            Invalid: "Inválido",
            Duplicate: "Duplicado",
            You: "Você",
            "Only verified": "Apenas verificados",
            Loading: "A Carregar",
            "Failed to load recordings": "Falha ao carregar as gravações",
            "Cannot load recordings due to non-determinism": "Não é possível carregar as gravações devido ao não determinismo",
            Ok: "Ok",
            "Track is missing starting point": "A pista não tem ponto de partida",
            "Some leaderboard features are disabled.": "Algumas funcionalidades da tabela de classificação estão desativadas.",
            "Please try another browser or device.": "Por favor, tente outro navegador ou dispositivo.",
            "You already have another instance of PolyTrack open.": "Já tem outra instância do PolyTrack aberta.",
            "Please switch to that tab or window to continue.": "Por favor, mude para essa aba ou janela para continuar.",
            "Computer determinism check failed.": "Falha na verificação de determinismo do computador.",
            "Non-deterministic game assets found.": "Ativos de jogo não determinísticos encontrados.",
            "Please try clearing your browser cache.": "Por favor, tente limpar o cache do seu navegador.",
            "Hardware acceleration is disabled. Performance may be reduced.": "Aceleração de hardware está desativada. O desempenho pode ser reduzido.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "Por favor, certifique-se de que a aceleração de hardware esteja ativada nas configurações do seu navegador.",
            Customize: "Personalizar",
            Editor: "Editor",
            Settings: "Definições",
            Profile: "Perfil",
            Play: "Jogar",
            Version: "Versão",
            "You cannot have duplicate user profiles": "Não pode ter perfis de utilizador duplicados",
            "Failed to create user profile": "Falha ao criar o perfil de utilizador",
            "This user profile does not exist on the server": "Este perfil de utilizador não existe no servidor",
            "Failed to download user profile from the server": "Falha ao descarregar o perfil de utilizador do servidor",
            "User token is invalid": "Token de utilizador inválido",
            "Are you sure you want to display your private key?": "Tem a certeza de que pretende mostrar a sua chave privada?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "NÃO PARTILHE ESTA CHAVE COM NINGUÉM.",
            "You need a free user profile slot to import a new user profile": "Necessita de um slot de perfil de utilizador livre para importar um novo perfil de utilizador",
            Quit: "Sair",
            Fullscreen: "Ecrã Inteiro",
            Windowed: "Janela",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "Parece que está a jogar uma versão não oficial de {0}. Para a versão mais atualizada, visite a fonte original:",
            Nickname: "Alcunha",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "Escolha uma alcunha para ser exibida na tabela de classificação. A sua alcunha pode ser alterada a qualquer momento.",
            Cancel: "Cancelar",
            Confirm: "Confirmar",
            "User ID": "ID de Utilizador",
            Paused: "Pausado",
            "Switch car": "Mudar de carro",
            Profiles: "Perfis",
            'Are you sure you would like to delete "{0}"?': 'Tem a certeza de que pretende eliminar "{0}"?',
            Empty: "Vazio",
            Reset: "Repor",
            Apply: "Aplicar",
            Gameplay: "Jogabilidade",
            Units: "Unidades",
            Metric: "Métrico",
            Imperial: "Imperial",
            "Reset hint": "Repor dica",
            Disabled: "Desativado",
            Enabled: "Ativado",
            "Ghost car": "Carro Fantasma",
            "Default camera": "Câmera Padrão",
            Default: "Padrão",
            Cockpit: "Cabine",
            "Cockpit camera mode": "Modo da câmera de cabine",
            Hold: "Manter",
            Toggle: "Alternar",
            Checkpoints: "Pontos de Verificação",
            Timer: "Temporizador",
            Speedometer: "Velocímetro",
            Bottom: "Inferior",
            Top: "Superior",
            Language: "Idioma",
            Graphics: "Gráficos",
            Shadows: "Sombras",
            Off: "Desligado",
            On: "Ligado",
            Minimal: "Mínimo",
            Low: "Baixo",
            Medium: "Médio",
            High: "Alto",
            Ultra: "Ultra",
            Clouds: "Nuvens",
            Particles: "Partículas",
            Skidmarks: "Marcas de Derrapagem",
            "Render scale": "Escala de Renderização",
            "Anti-aliasing (requires restart)": "Anti-aliasing (necessita de reiniciar)",
            Audio: "Áudio",
            "Sound effect volume": "Volume dos Efeitos Sonoros",
            "Music volume": "Volume da Música",
            "Checkpoint volume": "Volume dos Pontos de Verificação",
            Mobile: "Dispositivo Móvel",
            Vibration: "Vibração",
            "Steering control side": "Lado do Controle de Direção",
            Left: "Esquerda",
            Right: "Direita",
            Controls: "Controlos",
            Vehicle: "Veículo",
            Accelerate: "Acelerar",
            Brake: "Travar",
            "Turn left": "Virar à Esquerda",
            "Turn right": "Virar à Direita",
            "Checkpoint reset": "Repor o Ponto de Verificação",
            "Start reset": "Repor o Início",
            "Cockpit camera": "Câmera de Cabine",
            "Rotate part": "Rodar Parte",
            "Height modifier": "Modificador de Altura",
            "Delete part": "Eliminar Parte",
            "Move forwards": "Mover para a frente",
            "Move backwards": "Mover para trás",
            "Move left": "Mover para a esquerda",
            "Move right": "Mover para a direita",
            "Rotate view up": "Rodar a vista para cima",
            "Rotate view down": "Rodar a vista para baixo",
            "Rotate view left": "Rodar a vista para a esquerda",
            "Rotate view right": "Rodar a vista para a direita",
            "Move down": "Mover para baixo",
            "Move up": "Mover para cima",
            "Test track": "Testar Pista",
            "Pick part": "Escolher Parte",
            Spectator: "Espectador",
            "Speed modifier": "Modificador de Velocidade",
            Other: "Outro",
            "Hide UI": "Esconder UI",
            Pause: "Pausa",
            "Toggle FPS counter": "Alternar Contador de FPS",
            "Toggle spectator camera": "Alternar Câmara de Espectador",
            "Press any key...\n\nPress [Escape] to cancel.": "Pressione qualquer tecla...\n\nPressione [Escape] para cancelar.",
            Clear: "Limpar",
            "New record": "Novo Recorde",
            Record: "Recorde",
            Current: "Atual",
            Difference: "Diferença",
            Copy: "Copiar",
            Import: "Importar",
            "Failed to import track": "Falha ao importar a pista",
            'The track "{0}" already exists. Do you wish to overwrite it?': 'A pista "{0}" já existe. Deseja substituí-la?',
            Overwrite: "Substituir",
            "Paste track data here...": "Cole os dados da pista aqui...",
            Rank: "Classificação",
            "Personal best": "Melhor Pessoal",
            Opponents: "Oponentes",
            "{0} opponent selected": "{0} oponente selecionado",
            "{0} opponents selected": "{0} oponentes selecionados",
            "Select opponents to race against from the leaderboard on the left": "Selecione os oponentes para competir na tabela de classificação à esquerda",
            "No record": "Sem Registo",
            "Official tracks": "Pistas Oficiais",
            "Community tracks": "Pistas da Comunidade",
            "Custom tracks": "Pistas Personalizadas",
            'Are you sure you want to delete "{0}"?': 'Tem a certeza de que deseja eliminar "{0}"?',
            Delete: "Eliminar",
            "No community tracks": "Sem pistas da comunidade",
            "Community tracks are coming soon": "Pistas da comunidade em breve",
            "No custom tracks": "Sem pistas personalizadas",
            "Create a track using the editor or import a track code": "Crie uma pista usando o editor ou importe um código de pista",
            "Search by track or author...": "Pesquisar por pista ou autor...",
            "Invalid replay detected!": "Replay inválido detetado!"
        }
          , MO = {
            "Checkpoint order": "Порядок контрольных точек",
            Height: "Высота",
            Exit: "Выход",
            Random: "Случайный",
            Primary: "Основной",
            Secondary: "Вторичный",
            Frame: "Каркас",
            Rims: "Диски",
            "Are you sure you want to exit without saving?": "Вы уверены, что хотите выйти без сохранения?",
            "All changes will be lost!": "Все изменения будут потеряны!",
            "Car saved!": "Автомобиль сохранен!",
            Test: "Тест",
            "Starting point is missing!": "Отсутствует стартовая точка!",
            Generate: "Генерировать",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "Вы уверены, что хотите создать новую трассу?\n\nВаша текущая трасса будет потеряна!",
            Load: "Загрузить",
            Save: "Сохранить",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "Вы уверены, что хотите загрузить новую трассу?\n\nВаша текущая трасса будет потеряна!",
            "Track saved!": "Трасса сохранена!",
            "Failed to save!": "Не удалось сохранить!",
            'Are you sure you want to overwrite "{0}"?': 'Вы уверены, что хотите перезаписать "{0}"?',
            Export: "Экспорт",
            Help: "Помощь",
            "Are you sure you want to exit the editor?": "Вы уверены, что хотите выйти из редактора?",
            "All unsaved data will be lost!": "Все несохраненные данные будут потеряны!",
            "Track settings": "Настройки трассы",
            "Unnamed Track": "Безымянная трасса",
            "Track name": "Имя трассы",
            Author: "Автор",
            Unknown: "Неизвестно",
            Environment: "Окружение",
            Summer: "Лето",
            Winter: "Зима",
            Desert: "Пустыня",
            "Sun direction": "Направление солнца",
            "How to use the editor": "Как использовать редактор",
            "Camera controls": "Управление камерой",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "Камеру можно перемещать, щелкая правой кнопкой мыши и перетаскивая мышь. Вращайте камеру, щелкнув средней кнопкой мыши (колесиком) или удерживая клавишу Ctrl и щелкнув правой кнопкой мыши и перетаскивая мышь. Масштабируйте внутрь и наружу, прокручивая колесико мыши.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "Кроме того, камеру можно управлять с помощью следующих клавиш клавиатуры:",
            "Move forwards:": "Двигаться вперед:",
            "Move backwards:": "Двигаться назад:",
            "Move left:": "Двигаться влево:",
            "Move right:": "Двигаться вправо:",
            "Rotate left:": "Повернуть влево:",
            "Rotate right:": "Повернуть вправо:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "Изменять высоту редактируемой части можно с помощью выбора высоты в левом нижнем углу или удерживая клавишу Shift и прокручивая колесико мыши. Кроме того, можно использовать следующие клавиши клавиатуры:",
            "Move up:": "Двигаться вверх:",
            "Move down:": "Двигаться вниз:",
            Editing: "Редактирование",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "Части трассы можно выбирать в меню справа, после чего их можно размещать, щелкнув левой кнопкой мыши.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "Кроме того, текущую часть трассы, на которую указывает мышь, можно выбрать с помощью следующей комбинации клавиш:",
            "The selected part can then be rotated using the following keyboard shortcut:": "Выбранную часть можно повернуть с помощью следующей комбинации клавиш:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "Части трассы можно удалять с помощью инструмента удаления в правом меню или удерживая следующую клавишу:",
            "Starting points, checkpoints and the finish line": "Стартовые точки, контрольные точки и финишная линия",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "Стартовые точки, контрольные точки и финишные линии можно выбрать в верхней категории правого меню.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "Каждая трасса должна иметь как минимум одну стартовую точку. Если есть несколько стартовых точек, будет использована последняя размещенная.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "Контрольные точки следует размещать между стартовой точкой и финишной линией. При выборе части трассы контрольной точки в правом нижнем углу появится инструмент для выбора порядка контрольной точки. Это определяет порядок, в котором контрольные точки должны быть пройдены перед движением к финишной линии. Обратите внимание, что возможно наличие нескольких контрольных точек с одним и тем же порядком контрольных точек.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "Финишная линия - это место, где заканчивается трасса, но она становится активной только после прохождения всех контрольных точек. Также возможно наличие нескольких финишных линий.",
            "Starting point": "Стартовая точка",
            Checkpoint: "Контрольная точка",
            "Finish line": "Финишная линия",
            "Exporting the track": "Экспорт трассы",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "Когда трасса готова, в верхнем левом углу можно ввести имя трассы, после чего трассу можно экспортировать с помощью кнопки экспорта. Это позволит получить код трассы, который можно отправить другим пользователям, чтобы они могли импортировать и играть на трассе.",
            Close: "Закрыть",
            "Not set": "Не установлено",
            or: "или",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "Камеру можно перемещать, перетаскивая одним пальцем. Вращайте камеру, перетаскивая двумя пальцами. Масштабируйте внутрь и наружу, сжимая и разжимая пальцами.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "Изменять высоту редактируемой части можно с помощью выбора высоты в левом нижнем углу.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "Части трассы можно выбирать в меню справа, после чего их можно размещать, касаясь экрана.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "Выбранную часть можно повернуть, касаясь кнопки поворота в левом нижнем углу.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "Части трассы можно удалять с помощью инструмента удаления в правом меню.",
            Watch: "Смотреть",
            "Loading replay": "Загрузка записи",
            "Press {0} to return to the last checkpoint": "Нажмите {0}, чтобы вернуться к последней контрольной точке",
            "Press {0} to start over": "Нажмите {0}, чтобы начать заново",
            "Reset once to return to the last checkpoint": "Сбросьте один раз, чтобы вернуться к последней контрольной точке",
            "Reset again to start over": "Сбросьте еще раз, чтобы начать заново",
            Leaderboard: "Таблица лидеров",
            "{0} players": "{0} игроков",
            Back: "Назад",
            "Error: Failed to load leaderboard": "Ошибка: не удалось загрузить таблицу лидеров",
            "Unofficial versions of the game cannot access the leaderboard": "Неофициальные версии игры не могут получить доступ к таблице лидеров",
            Pending: "В ожидании",
            Verified: "Подтверждено",
            Invalid: "Недействительно",
            Duplicate: "Дубликат",
            You: "Вы",
            "Only verified": "Только подтвержденные",
            Loading: "Загрузка",
            "Failed to load recordings": "Не удалось загрузить записи",
            "Cannot load recordings due to non-determinism": "Невозможно загрузить записи из-за недетерминизма",
            Ok: "Ок",
            "Track is missing starting point": "Отсутствует стартовая точка на трассе",
            "Some leaderboard features are disabled.": "Некоторые функции таблицы лидеров отключены.",
            "Please try another browser or device.": "Пожалуйста, попробуйте другой браузер или устройство.",
            "You already have another instance of PolyTrack open.": "У вас уже открыт другой экземпляр PolyTrack.",
            "Please switch to that tab or window to continue.": "Пожалуйста, переключитесь на эту вкладку или окно, чтобы продолжить.",
            "Computer determinism check failed.": "Проверка детерминизма компьютера не удалась.",
            "Non-deterministic game assets found.": "Недетерминированные игровые ресурсы найдены.",
            "Please try clearing your browser cache.": "Пожалуйста, попробуйте очистить кеш браузера.",
            "Hardware acceleration is disabled. Performance may be reduced.": "Аппаратное ускорение отключено. Производительность может быть снижена.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "Пожалуйста, убедитесь, что аппаратное ускорение включено в настройках вашего браузера.",
            Customize: "Настройка",
            Editor: "Редактор",
            Settings: "Настройки",
            Profile: "Профиль",
            Play: "Играть",
            Version: "Версия",
            "You cannot have duplicate user profiles": "Нельзя иметь дублирующиеся профили пользователей",
            "Failed to create user profile": "Не удалось создать профиль пользователя",
            "This user profile does not exist on the server": "Этот профиль пользователя не существует на сервере",
            "Failed to download user profile from the server": "Не удалось загрузить профиль пользователя с сервера",
            "User token is invalid": "Недействительный токен пользователя",
            "Are you sure you want to display your private key?": "Вы уверены, что хотите отобразить свой личный ключ?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "НЕ ДЕЛИТЕСЬ ЭТИМ КЛЮЧОМ НИ С КЕМ.",
            "You need a free user profile slot to import a new user profile": "Вам нужен свободный слот профиля пользователя для импорта нового профиля пользователя",
            Quit: "Выйти",
            Fullscreen: "Полноэкранный",
            Windowed: "Оконный",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "Похоже, вы играете в неофициальную версию {0}. Для самой актуальной версии посетите оригинальный источник:",
            Nickname: "Никнейм",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "Выберите никнейм, который будет отображаться в таблице лидеров. Вы можете изменить никнейм в любое время.",
            Cancel: "Отмена",
            Confirm: "Подтвердить",
            "User ID": "Идентификатор пользователя",
            Paused: "Пауза",
            "Switch car": "Сменить автомобиль",
            Profiles: "Профили",
            'Are you sure you would like to delete "{0}"?': 'Вы уверены, что хотите удалить "{0}"?',
            Empty: "Пусто",
            Reset: "Сброс",
            Apply: "Применить",
            Gameplay: "Игровой процесс",
            Units: "Единицы измерения",
            Metric: "Метрическая",
            Imperial: "Имперская",
            "Reset hint": "Сбросить подсказку",
            Disabled: "Выключено",
            Enabled: "Включено",
            "Ghost car": "Призрачная машина",
            "Default camera": "Камера по умолчанию",
            Default: "По умолчанию",
            Cockpit: "Кабина",
            "Cockpit camera mode": "Режим кабины",
            Hold: "Удерживать",
            Toggle: "Переключить",
            Checkpoints: "Контрольные точки",
            Timer: "Таймер",
            Speedometer: "Спидометр",
            Bottom: "Снизу",
            Top: "Сверху",
            Language: "Язык",
            Graphics: "Графика",
            Shadows: "Тени",
            Off: "Выключено",
            On: "Включено",
            Minimal: "Минимальный",
            Low: "Низкая",
            Medium: "Средняя",
            High: "Высокая",
            Ultra: "Ультра",
            Clouds: "Облака",
            Particles: "Частицы",
            Skidmarks: "Отметины от скольжения",
            "Render scale": "Масштаб рендера",
            "Anti-aliasing (requires restart)": "Сглаживание (требуется перезапуск)",
            Audio: "Звук",
            "Sound effect volume": "Громкость звуковых эффектов",
            "Music volume": "Громкость музыки",
            "Checkpoint volume": "Громкость контрольных точек",
            Mobile: "Мобильный",
            Vibration: "Вибрация",
            "Steering control side": "Сторона управления рулем",
            Left: "Левый",
            Right: "Правый",
            Controls: "Управление",
            Vehicle: "Транспорт",
            Accelerate: "Ускорить",
            Brake: "Тормоз",
            "Turn left": "Повернуть налево",
            "Turn right": "Повернуть направо",
            "Checkpoint reset": "Сброс контрольной точки",
            "Start reset": "Сброс старта",
            "Cockpit camera": "Камера кабины",
            "Rotate part": "Повернуть часть",
            "Height modifier": "Модификатор высоты",
            "Delete part": "Удалить часть",
            "Move forwards": "Двигаться вперед",
            "Move backwards": "Двигаться назад",
            "Move left": "Двигаться влево",
            "Move right": "Двигаться вправо",
            "Rotate view up": "Повернуть вид вверх",
            "Rotate view down": "Повернуть вид вниз",
            "Rotate view left": "Повернуть вид влево",
            "Rotate view right": "Повернуть вид вправо",
            "Move down": "Двигаться вниз",
            "Move up": "Двигаться вверх",
            "Test track": "Тестировать трассу",
            "Pick part": "Выбрать часть",
            Spectator: "Наблюдатель",
            "Speed modifier": "Модификатор скорости",
            Other: "Другое",
            "Hide UI": "Скрыть интерфейс",
            Pause: "Пауза",
            "Toggle FPS counter": "Переключить счетчик FPS",
            "Toggle spectator camera": "Переключить камеру наблюдателя",
            "Press any key...\n\nPress [Escape] to cancel.": "Нажмите любую клавишу...\n\nНажмите [Escape], чтобы отменить.",
            Clear: "Очистить",
            "New record": "Новый рекорд",
            Record: "Рекорд",
            Current: "Текущее",
            Difference: "Разница",
            Copy: "Копировать",
            Import: "Импортировать",
            "Failed to import track": "Не удалось импортировать трассу",
            'The track "{0}" already exists. Do you wish to overwrite it?': 'Трасса "{0}" уже существует. Хотите перезаписать её?',
            Overwrite: "Перезаписать",
            "Paste track data here...": "Вставьте данные трассы сюда...",
            Rank: "Ранг",
            "Personal best": "Личный рекорд",
            Opponents: "Противники",
            "{0} opponent selected": "{0} противник выбран",
            "{0} opponents selected": "{0} противников выбрано",
            "Select opponents to race against from the leaderboard on the left": "Выберите противников для гонки из таблицы лидеров слева",
            "No record": "Нет рекорда",
            "Official tracks": "Официальные трассы",
            "Community tracks": "Трассы сообщества",
            "Custom tracks": "Пользовательские трассы",
            'Are you sure you want to delete "{0}"?': 'Вы уверены, что хотите удалить "{0}"?',
            Delete: "Удалить",
            "No community tracks": "Нет трасс сообщества",
            "Community tracks are coming soon": "Трассы сообщества скоро появятся",
            "No custom tracks": "Нет пользовательских трасс",
            "Create a track using the editor or import a track code": "Создайте трассу с помощью редактора или импортируйте код трассы",
            "Search by track or author...": "Поиск по трассе или автору...",
            "Invalid replay detected!": "Обнаружена недействительная запись!"
        }
          , _O = {
            "Checkpoint order": "Kontrol noktası sırası",
            Height: "Yükseklik",
            Exit: "Çıkış",
            Random: "Rastgele",
            Primary: "Birincil",
            Secondary: "İkincil",
            Frame: "Çerçeve",
            Rims: "Jantlar",
            "Are you sure you want to exit without saving?": "Kaydetmeden çıkmak istediğinizden emin misiniz?",
            "All changes will be lost!": "Tüm değişiklikler kaybolacak!",
            "Car saved!": "Araba kaydedildi!",
            Test: "Test",
            "Starting point is missing!": "Başlangıç noktası eksik!",
            Generate: "Oluştur",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "Yeni bir rota oluşturmak istediğinizden emin misiniz?\n\nMevcut rotanız kaybolacak!",
            Load: "Yükle",
            Save: "Kaydet",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "Yeni bir rota yüklemek istediğinizden emin misiniz?\n\nMevcut rotanız kaybolacak!",
            "Track saved!": "Rota kaydedildi!",
            "Failed to save!": "Kaydetme başarısız!",
            'Are you sure you want to overwrite "{0}"?': '"{0}" üzerine yazmak istediğinizden emin misiniz?',
            Export: "Dışa Aktar",
            Help: "Yardım",
            "Are you sure you want to exit the editor?": "Editörden çıkmak istediğinizden emin misiniz?",
            "All unsaved data will be lost!": "Tüm kaydedilmemiş veriler kaybolacak!",
            "Track settings": "Rota ayarları",
            "Unnamed Track": "Adsız Rota",
            "Track name": "Rota adı",
            Author: "Yazar",
            Unknown: "Bilinmiyor",
            Environment: "Çevre",
            Summer: "Yaz",
            Winter: "Kış",
            Desert: "Çöl",
            "Sun direction": "Güneş yönü",
            "How to use the editor": "Editörü nasıl kullanılır",
            "Camera controls": "Kamera kontrolleri",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "Kamerayı sağ tıklayarak ve fareyi sürükleyerek hareket ettirebilirsiniz. Kamerayı orta fare düğmesine (fare tekerleği) tıklayarak veya kontrol tuşunu basılı tutarak sağ tıklayarak ve fareyi sürükleyerek döndürebilirsiniz. Fare tekerleği ile yakınlaştırma ve uzaklaştırma yapabilirsiniz.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "Alternatif olarak, kamera aşağıdaki klavye tuşları kullanılarak da kontrol edilebilir:",
            "Move forwards:": "İleri hareket et:",
            "Move backwards:": "Geri hareket et:",
            "Move left:": "Sola hareket et:",
            "Move right:": "Sağa hareket et:",
            "Rotate left:": "Sola döndür:",
            "Rotate right:": "Sağa döndür:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "Düzenlenen yükseklik, sol alt köşedeki yükseklik seçimini kullanarak veya Shift tuşunu basılı tutarak ve fare tekerleğini kaydırarak değiştirilebilir. Alternatif olarak, aşağıdaki klavye tuşlarını kullanabilirsiniz:",
            "Move up:": "Yukarı hareket et:",
            "Move down:": "Aşağı hareket et:",
            Editing: "Düzenleme",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "Parçalar, fareyle sol tıklayarak yerleştirilebilecekleri sağ taraftaki menüden seçilebilir.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "Alternatif olarak, fare tarafından üzerine gelinen rota parçası aşağıdaki klavye kısayoluyla seçilebilir:",
            "The selected part can then be rotated using the following keyboard shortcut:": "Seçilen parça aşağıdaki klavye kısayoluyla döndürülebilir:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "Rota parçaları, sağ taraftaki menüdeki silme aracı kullanılarak veya aşağıdaki tuşa basılı tutarak silinebilir:",
            "Starting points, checkpoints and the finish line": "Başlangıç noktaları, kontrol noktaları ve bitiş çizgisi",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "Başlangıç noktaları, kontrol noktaları ve bitiş çizgileri, sağ taraftaki menünün en üst kategorisinde seçilebilir.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "Her rota en az bir başlangıç noktasına sahip olmalıdır. Birden fazla başlangıç noktası varsa, en son yerleştirilen kullanılacaktır.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "Kontrol noktaları, başlangıç noktası ile bitiş çizgisi arasına yerleştirilmelidir. Bir kontrol noktası rota parçası seçildiğinde, kontrol noktasının sırasını seçmek için sağ alt köşede bir araç bulunur. Bu, kontrol noktalarının bitiş çizgisine gitmeden önce geçilmesi gereken sırayı belirler. Aynı kontrol noktası sırasına sahip birden fazla kontrol noktası olabileceğine dikkat edin.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "Bitiş çizgisi, rotanın bittiği yerdir, ancak tüm kontrol noktaları geçildikten sonra aktif hale gelir. Birden fazla bitiş çizgisi de olabilir.",
            "Starting point": "Başlangıç noktası",
            Checkpoint: "Kontrol noktası",
            "Finish line": "Bitiş çizgisi",
            "Exporting the track": "Rotanın dışa aktarılması",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "Rota tamamlandığında, rota için bir ad girilebilir ve ardından rota düğmesini kullanarak rota dışa aktarılabilir. Bu, diğer kullanıcılara gönderilebilecek bir rota kodunu ortaya çıkarır, böylece rota içe aktarılabilir ve oynanabilir.",
            Close: "Kapat",
            "Not set": "Ayarlanmadı",
            or: "veya",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "Kamerayı bir parmakla sürükleyerek hareket ettirebilirsiniz. Kamerayı iki parmakla sürükleyerek döndürebilirsiniz. Yakınlaştırmak ve uzaklaştırmak için sıkıştırabilirsiniz.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "Düzenlenen yükseklik, sol alt köşedeki yükseklik seçimi kullanılarak değiştirilebilir.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "Parçalar, ekrana dokunarak yerleştirilebilecekleri sağ taraftaki menüden seçilebilir.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "Seçilen parça, sol alt köşedeki döndür düğmesine dokunarak döndürülebilir.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "Parçalar, sağ taraftaki menüdeki silme aracı kullanılarak silinebilir.",
            Watch: "İzle",
            "Loading replay": "Tekrar yükleniyor",
            "Press {0} to return to the last checkpoint": "Son kontrol noktasına dönmek için {0} tuşuna basın",
            "Press {0} to start over": "Baştan başlamak için {0} tuşuna basın",
            "Reset once to return to the last checkpoint": "Son kontrol noktasına dönmek için bir kez sıfırlayın",
            "Reset again to start over": "Baştan başlamak için tekrar sıfırlayın",
            Leaderboard: "Liderlik Tablosu",
            "{0} players": "{0} oyuncu",
            Back: "Geri",
            "Error: Failed to load leaderboard": "Hata: Liderlik tablosu yüklenemedi",
            "Unofficial versions of the game cannot access the leaderboard": "Oyunun resmi olmayan sürümleri liderlik tablosuna erişemez",
            Pending: "Beklemede",
            Verified: "Doğrulandı",
            Invalid: "Geçersiz",
            Duplicate: "Çift",
            You: "Sen",
            "Only verified": "Sadece doğrulanmış",
            Loading: "Yükleniyor",
            "Failed to load recordings": "Kayıtlar yüklenemedi",
            "Cannot load recordings due to non-determinism": "Belirlenim dışılıktan dolayı kayıtlar yüklenemiyor",
            Ok: "Tamam",
            "Track is missing starting point": "Rota başlangıç noktası eksik",
            "Some leaderboard features are disabled.": "Bazı liderlik tablosu özellikleri devre dışı bırakıldı.",
            "Please try another browser or device.": "Lütfen başka bir tarayıcı veya cihaz deneyin.",
            "You already have another instance of PolyTrack open.": "Zaten PolyTrack'in başka bir örneğini açtınız.",
            "Please switch to that tab or window to continue.": "Devam etmek için lütfen o sekmeye veya pencereye geçin.",
            "Computer determinism check failed.": "Bilgisayar belirlenim kontrolü başarısız oldu.",
            "Non-deterministic game assets found.": "Belirlenim dışı oyun varlıkları bulundu.",
            "Please try clearing your browser cache.": "Lütfen tarayıcı önbelleğinizi temizlemeyi deneyin.",
            "Hardware acceleration is disabled. Performance may be reduced.": "Donanım hızlandırması devre dışı bırakıldı. Performans düşebilir.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "Lütfen tarayıcı ayarlarınızda donanım hızlandırmasının etkinleştirildiğinden emin olun.",
            Customize: "Özelleştir",
            Editor: "Editör",
            Settings: "Ayarlar",
            Profile: "Profil",
            Play: "Oyna",
            Version: "Sürüm",
            "You cannot have duplicate user profiles": "Çift kullanıcı profili oluşturamazsınız",
            "Failed to create user profile": "Kullanıcı profili oluşturulamadı",
            "This user profile does not exist on the server": "Bu kullanıcı profili sunucuda mevcut değil",
            "Failed to download user profile from the server": "Kullanıcı profili sunucudan indirilemedi",
            "User token is invalid": "Kullanıcı belirteci geçersiz",
            "Are you sure you want to display your private key?": "Gizli anahtarınızı göstermek istediğinizden emin misiniz?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "BU ANAHTARI KİMSEYLE PAYLAŞMAYIN.",
            "You need a free user profile slot to import a new user profile": "Yeni bir kullanıcı profili eklemek için boş bir kullanıcı profili yuvasına ihtiyacınız var",
            Quit: "Çıkış",
            Fullscreen: "Tam Ekran",
            Windowed: "Pencere Modu",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "{0} adlı resmi olmayan bir sürüm oynuyor gibi görünüyorsunuz. En güncel sürüm için lütfen orijinal kaynağı ziyaret edin:",
            Nickname: "Kullanıcı Adı",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "Liderlik tablosunda gösterilecek bir kullanıcı adı seçin. Kullanıcı adınızı istediğiniz zaman değiştirebilirsiniz.",
            Cancel: "İptal",
            Confirm: "Onayla",
            "User ID": "Kullanıcı Kimliği",
            Paused: "Duraklatıldı",
            "Switch car": "Araba değiştir",
            Profiles: "Profiller",
            'Are you sure you would like to delete "{0}"?': '"{0}" silmek istediğinizden emin misiniz?',
            Empty: "Boş",
            Reset: "Sıfırla",
            Apply: "Uygula",
            Gameplay: "Oynanış",
            Units: "Birimler",
            Metric: "Metrik",
            Imperial: "İngiliz",
            "Reset hint": "İpucunu sıfırla",
            Disabled: "Devre Dışı",
            Enabled: "Etkin",
            "Ghost car": "Hayalet araba",
            "Default camera": "Varsayılan kamera",
            Default: "Varsayılan",
            Cockpit: "Kokpit",
            "Cockpit camera mode": "Kokpit kamera modu",
            Hold: "Basılı Tut",
            Toggle: "Değiştir",
            Checkpoints: "Kontrol Noktaları",
            Timer: "Zamanlayıcı",
            Speedometer: "Hızölçer",
            Bottom: "Alt",
            Top: "Üst",
            Language: "Dil",
            Graphics: "Grafikler",
            Shadows: "Gölge",
            Off: "Kapalı",
            On: "Açık",
            Minimal: "Minimal",
            Low: "Düşük",
            Medium: "Orta",
            High: "Yüksek",
            Ultra: "Ultra",
            Clouds: "Bulutlar",
            Particles: "Partiküller",
            Skidmarks: "Lastik izleri",
            "Render scale": "Görüntü ölçeği",
            "Anti-aliasing (requires restart)": "Kenar yumuşatma (yeniden başlatma gerektirir)",
            Audio: "Ses",
            "Sound effect volume": "Ses efekti ses seviyesi",
            "Music volume": "Müzik ses seviyesi",
            "Checkpoint volume": "Kontrol noktası ses seviyesi",
            Mobile: "Mobil",
            Vibration: "Titreşim",
            "Steering control side": "Direksiyon kontrol tarafı",
            Left: "Sol",
            Right: "Sağ",
            Controls: "Kontroller",
            Vehicle: "Araç",
            Accelerate: "Hızlan",
            Brake: "Fren",
            "Turn left": "Sola dön",
            "Turn right": "Sağa dön",
            "Checkpoint reset": "Kontrol noktası sıfırla",
            "Start reset": "Başlangıç sıfırla",
            "Cockpit camera": "Kokpit kamera",
            "Rotate part": "Parçayı döndür",
            "Height modifier": "Yükseklik değiştir",
            "Delete part": "Parçayı sil",
            "Move forwards": "İleri git",
            "Move backwards": "Geri git",
            "Move left": "Sola git",
            "Move right": "Sağa git",
            "Rotate view up": "Görünümü yukarı döndür",
            "Rotate view down": "Görünümü aşağı döndür",
            "Rotate view left": "Görünümü sola döndür",
            "Rotate view right": "Görünümü sağa döndür",
            "Move down": "Aşağı git",
            "Move up": "Yukarı git",
            "Test track": "Rota test et",
            "Pick part": "Parça seç",
            Spectator: "Seyirci",
            "Speed modifier": "Hız değiştir",
            Other: "Diğer",
            "Hide UI": "UI'yi gizle",
            Pause: "Duraklat",
            "Toggle FPS counter": "FPS sayacını değiştir",
            "Toggle spectator camera": "Seyirci kamerasını değiştir",
            "Press any key...\n\nPress [Escape] to cancel.": "Herhangi bir tuşa basın...\n\nİptal etmek için [Escape] tuşuna basın",
            Clear: "Temizle",
            "New record": "Yeni kayıt",
            Record: "Kayıt",
            Current: "Mevcut",
            Difference: "Fark",
            Copy: "Kopyala",
            Import: "İçe Aktar",
            "Failed to import track": "Rota içe aktarma başarısız oldu",
            'The track "{0}" already exists. Do you wish to overwrite it?': '"{0}" rota zaten var. Üzerine yazmak istiyor musunuz?',
            Overwrite: "Üzerine yaz",
            "Paste track data here...": "Rota verilerini buraya yapıştır...",
            Rank: "Sıra",
            "Personal best": "Kişisel en iyi",
            Opponents: "Rakipler",
            "{0} opponent selected": "{0} rakip seçildi",
            "{0} opponents selected": "{0} rakip seçildi",
            "Select opponents to race against from the leaderboard on the left": "Soldaki liderlik tablosundan yarışmak için rakipleri seçin",
            "No record": "Kayıt yok",
            "Official tracks": "Resmi rotalar",
            "Community tracks": "Topluluk rotaları",
            "Custom tracks": "Özel rotalar",
            'Are you sure you want to delete "{0}"?': '"{0}" silmek istediğinizden emin misiniz?',
            Delete: "Sil",
            "No community tracks": "Topluluk rotası yok",
            "Community tracks are coming soon": "Topluluk rotaları yakında gelecek",
            "No custom tracks": "Özel rotalar yok",
            "Create a track using the editor or import a track code": "Editörü kullanarak bir rota oluşturun veya bir rota kodu içe aktarın",
            "Search by track or author...": "Rota veya yazar arayın...",
            "Invalid replay detected!": "Geçersiz tekrar algılandı!"
        }
          , TO = {
            "Checkpoint order": "Порядок пунктів контролю",
            Height: "Висота",
            Exit: "Вихід",
            Random: "Випадково",
            Primary: "Основний",
            Secondary: "Додатковий",
            Frame: "Рама",
            Rims: "Дисків",
            "Are you sure you want to exit without saving?": "Ви впевнені, що хочете вийти без збереження?",
            "All changes will be lost!": "Всі зміни будуть втрачені!",
            "Car saved!": "Автомобіль збережено!",
            Test: "Тест",
            "Starting point is missing!": "Відсутня стартова точка!",
            Generate: "Генерувати",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "Ви впевнені, що хочете згенерувати новий трек?\n\nВаш поточний трек буде втрачено!",
            Load: "Завантажити",
            Save: "Зберегти",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "Ви впевнені, що хочете завантажити новий трек?\n\nВаш поточний трек буде втрачено!",
            "Track saved!": "Трек збережено!",
            "Failed to save!": "Не вдалося зберегти!",
            'Are you sure you want to overwrite "{0}"?': 'Ви впевнені, що хочете перезаписати "{0}"?',
            Export: "Експорт",
            Help: "Довідка",
            "Are you sure you want to exit the editor?": "Ви впевнені, що хочете вийти з редактора?",
            "All unsaved data will be lost!": "Всі не збережені дані будуть втрачені!",
            "Track settings": "Налаштування треку",
            "Unnamed Track": "Безіменний трек",
            "Track name": "Назва треку",
            Author: "Автор",
            Unknown: "Невідомий",
            Environment: "Середовище",
            Summer: "Літо",
            Winter: "Зима",
            Desert: "Пустеля",
            "Sun direction": "Напрямок сонця",
            "How to use the editor": "Як користуватися редактором",
            "Camera controls": "Управління камерою",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "Камеру можна переміщувати, натискаючи праву кнопку миші і перетягуючи її. Повертайте камеру, натискаючи середню кнопку миші (колесо миші) або утримуючи клавішу Control і натискаючи праву кнопку миші і перетягуючи її. Збільшуйте та зменшуйте масштаб, прокручуючи колесо миші.",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "Також камеру можна керувати за допомогою наступних клавіш на клавіатурі:",
            "Move forwards:": "Рухатися вперед:",
            "Move backwards:": "Рухатися назад:",
            "Move left:": "Рухатися вліво:",
            "Move right:": "Рухатися вправо:",
            "Rotate left:": "Повернути вліво:",
            "Rotate right:": "Повернути вправо:",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "Редаговану висоту можна змінити, використовуючи вибір висоти в нижньому лівому куті або утримуючи клавішу Shift і прокручуючи колесо миші. Альтернативно, ви можете використовувати наступні клавіші на клавіатурі:",
            "Move up:": "Рухатися вгору:",
            "Move down:": "Рухатися вниз:",
            Editing: "Редагування",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "Частини треку можна вибрати в меню справа, після чого їх можна розмістити, натиснувши ліву кнопку миші.",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "Альтернативно, частину треку, над якою зараз знаходиться курсор миші, можна вибрати за допомогою наступної комбінації клавіш на клавіатурі:",
            "The selected part can then be rotated using the following keyboard shortcut:": "Вибрану частину можна повернути за допомогою наступної комбінації клавіш на клавіатурі:",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "Частини треку можна видалити, використовуючи інструмент видалення в бічному меню справа або утримуючи наступну клавішу:",
            "Starting points, checkpoints and the finish line": "Стартові точки, контрольні пункти та фінішна лінія",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "Стартові точки, контрольні пункти та фінішна лінія можуть бути вибрані в найвищій категорії в бічному меню справа.",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "Кожен трек повинен мати принаймні одну стартову точку. Якщо є кілька стартових точок, буде використана остання розміщена.",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "Контрольні пункти слід розміщувати між стартовою точкою та фінішною лінією. Коли вибрана частина треку контрольного пункту, внизу справа з'явиться інструмент для вибору порядку контрольного пункту. Це визначає порядок, в якому контрольні пункти повинні бути пройдені перед рухом до фінішної лінії. Зверніть увагу, що можливо мати кілька контрольних пунктів з однаковим порядком контрольних пунктів.",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "Фінішна лінія - це місце, де закінчується трек, але вона стане активною лише після проходження всіх контрольних пунктів. Також можливо мати кілька фінішних ліній.",
            "Starting point": "Стартова точка",
            Checkpoint: "Контрольний пункт",
            "Finish line": "Фінішна лінія",
            "Exporting the track": "Експорт треку",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "Коли трек готовий, вгорі зліва можна ввести назву треку, після чого трек можна експортувати, використовуючи кнопку експорту. Це розкриє код треку, який можна надіслати іншим користувачам, щоб вони могли імпортувати й грати трек.",
            Close: "Закрити",
            "Not set": "Не встановлено",
            or: "або",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "Камеру можна переміщувати, перетягуючи одним пальцем. Повертайте камеру, перетягуючи двома пальцями. Збільшуйте та зменшуйте масштаб, стискаючи пальці.",
            "The edited height can be changed by using the height selection in the bottom left corner.": "Редаговану висоту можна змінити, використовуючи вибір висоти в нижньому лівому куті.",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "Частини треку можна вибрати в меню справа, після чого їх можна розмістити, натиснувши на екран.",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "Вибрану частину можна повернути, натиснувши кнопку повороту в нижньому лівому куті.",
            "Track parts can be deleted by using the delete tool in the right side menu.": "Частини треку можна видалити, використовуючи інструмент видалення в бічному меню справа.",
            Watch: "Перегляд",
            "Loading replay": "Завантаження повтору",
            "Press {0} to return to the last checkpoint": "Натисніть {0}, щоб повернутися до останнього контрольного пункту",
            "Press {0} to start over": "Натисніть {0}, щоб почати спочатку",
            "Reset once to return to the last checkpoint": "Скинути один раз, щоб повернутися до останнього контрольного пункту",
            "Reset again to start over": "Скинути ще раз, щоб почати спочатку",
            Leaderboard: "Таблиця лідерів",
            "{0} players": "{0} гравців",
            Back: "Назад",
            "Error: Failed to load leaderboard": "Помилка: не вдалося завантажити таблицю лідерів",
            "Unofficial versions of the game cannot access the leaderboard": "Неофіційні версії гри не можуть отримати доступ до таблиці лідерів",
            Pending: "Очікує на підтвердження",
            Verified: "Підтверджено",
            Invalid: "Недійсний",
            Duplicate: "Дубльований",
            You: "Ви",
            "Only verified": "Тільки підтверджені",
            Loading: "Завантаження",
            "Failed to load recordings": "Не вдалося завантажити записи",
            "Cannot load recordings due to non-determinism": "Не вдається завантажити записи через недетермінізм",
            Ok: "Ок",
            "Track is missing starting point": "В треку відсутня стартова точка",
            "Some leaderboard features are disabled.": "Деякі функції таблиці лідерів вимкнені.",
            "Please try another browser or device.": "Будь ласка, спробуйте інший браузер або пристрій.",
            "You already have another instance of PolyTrack open.": "У вас вже є інший екземпляр PolyTrack відкритий.",
            "Please switch to that tab or window to continue.": "Будь ласка, перейдіть на ту вкладку або вікно, щоб продовжити.",
            "Computer determinism check failed.": "Перевірка детермінізму комп'ютера не вдалася.",
            "Non-deterministic game assets found.": "Знайдено недетерміністичні ігрові ресурси.",
            "Please try clearing your browser cache.": "Спробуйте очистити кеш браузера.",
            "Hardware acceleration is disabled. Performance may be reduced.": "Аппаратне прискорення вимкнено. Продуктивність може бути знижена.",
            "Please make sure hardware acceleration is enabled in your browser settings.": "Будь ласка, переконайтеся, що апаратне прискорення увімкнено в налаштуваннях вашого браузера.",
            Customize: "Налаштувати",
            Editor: "Редактор",
            Settings: "Налаштування",
            Profile: "Профіль",
            Play: "Грати",
            Version: "Версія",
            "You cannot have duplicate user profiles": "Ви не можете мати дубльовані профілі користувачів",
            "Failed to create user profile": "Не вдалося створити профіль користувача",
            "This user profile does not exist on the server": "Цей профіль користувача не існує на сервері",
            "Failed to download user profile from the server": "Не вдалося завантажити профіль користувача з сервера",
            "User token is invalid": "Недійсний токен користувача",
            "Are you sure you want to display your private key?": "Ви впевнені, що хочете відобразити свій приватний ключ?",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "НЕ ДІЛІТЬСЯ ЦИМ КЛЮЧЕМ З КИМБУДЬ.",
            "You need a free user profile slot to import a new user profile": "Вам потрібен вільний слот профілю користувача для імпорту нового профілю користувача",
            Quit: "Вийти",
            Fullscreen: "Повноекранний",
            Windowed: "У вікні",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "Здається, ви граєте в неофіційну версію {0}. Для найновішої версії відвідайте оригінальне джерело:",
            Nickname: "Псевдонім",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "Виберіть псевдонім для відображення в таблиці лідерів. Ви можете змінити псевдонім в будь-який час.",
            Cancel: "Скасувати",
            Confirm: "Підтвердити",
            "User ID": "ID користувача",
            Paused: "Пауза",
            "Switch car": "Перемикання автомобіля",
            Profiles: "Профілі",
            'Are you sure you would like to delete "{0}"?': 'Ви впевнені, що хочете видалити "{0}"?',
            Empty: "Порожній",
            Reset: "Скинути",
            Apply: "Застосувати",
            Gameplay: "Ігровий процес",
            Units: "Одиниці вимірювання",
            Metric: "Метричні",
            Imperial: "Імперські",
            "Reset hint": "Скинути підказку",
            Disabled: "Вимкнено",
            Enabled: "Увімкнено",
            "Ghost car": "Привид автомобіля",
            "Default camera": "Камера за замовчуванням",
            Default: "За замовчуванням",
            Cockpit: "Кабіна кокпіту",
            "Cockpit camera mode": "Режим кабіни кокпіту",
            Hold: "Тримати",
            Toggle: "Перемикання",
            Checkpoints: "Контрольні пункти",
            Timer: "Таймер",
            Speedometer: "Спідометр",
            Bottom: "Знизу",
            Top: "Зверху",
            Language: "Мова",
            Graphics: "Графіка",
            Shadows: "Тіні",
            Off: "Вимкнено",
            On: "Увімкнено",
            Minimal: "Мінімальний",
            Low: "Низькі",
            Medium: "Середні",
            High: "Високі",
            Ultra: "Ультра",
            Clouds: "Хмари",
            Particles: "Частинки",
            Skidmarks: "Сліди",
            "Render scale": "Масштаб рендерингу",
            "Anti-aliasing (requires restart)": "Антиаліасинг (потребує перезапуску)",
            Audio: "Звук",
            "Sound effect volume": "Гучність звукових ефектів",
            "Music volume": "Гучність музики",
            "Checkpoint volume": "Гучність пунктів контролю",
            Mobile: "Мобільний",
            Vibration: "Вібрація",
            "Steering control side": "Сторона керування кермом",
            Left: "Ліворуч",
            Right: "Праворуч",
            Controls: "Управління",
            Vehicle: "Транспортний засіб",
            Accelerate: "Прискорити",
            Brake: "Гальмо",
            "Turn left": "Повернути ліворуч",
            "Turn right": "Повернути праворуч",
            "Checkpoint reset": "Скидання контрольної точки",
            "Start reset": "Скидання старту",
            "Cockpit camera": "Камера кабіни кокпіту",
            "Rotate part": "Повернути частину",
            "Height modifier": "Модифікатор висоти",
            "Delete part": "Видалити частину",
            "Move forwards": "Рухатися вперед",
            "Move backwards": "Рухатися назад",
            "Move left": "Рухатися вліво",
            "Move right": "Рухатися вправо",
            "Rotate view up": "Повернути вид вгору",
            "Rotate view down": "Повернути вид вниз",
            "Rotate view left": "Повернути вид вліво",
            "Rotate view right": "Повернути вид вправо",
            "Move down": "Рухатися вниз",
            "Move up": "Рухатися вгору",
            "Test track": "Тестовий трек",
            "Pick part": "Вибрати частину",
            Spectator: "Спостерігач",
            "Speed modifier": "Модифікатор швидкості",
            Other: "Інше",
            "Hide UI": "Приховати інтерфейс",
            Pause: "Пауза",
            "Toggle FPS counter": "Перемикання лічильника FPS",
            "Toggle spectator camera": "Перемикання камери спостерігача",
            "Press any key...\n\nPress [Escape] to cancel.": "Натисніть будь-яку клавішу...\n\nНатисніть [Escape], щоб скасувати.",
            Clear: "Очистити",
            "New record": "Новий рекорд",
            Record: "Рекорд",
            Current: "Поточний",
            Difference: "Різниця",
            Copy: "Копіювати",
            Import: "Імпортувати",
            "Failed to import track": "Не вдалося імпортувати трек",
            'The track "{0}" already exists. Do you wish to overwrite it?': 'Трек "{0}" вже існує. Бажаєте перезаписати його?',
            Overwrite: "Перезаписати",
            "Paste track data here...": "Вставте дані треку сюди...",
            Rank: "Ранг",
            "Personal best": "Особистий рекорд",
            Opponents: "Супротивники",
            "{0} opponent selected": "{0} супротивник вибраний",
            "{0} opponents selected": "{0} супротивників вибрано",
            "Select opponents to race against from the leaderboard on the left": "Виберіть супротивників для гонки з таблиці лідерів зліва",
            "No record": "Немає записів",
            "Official tracks": "Офіційні треки",
            "Community tracks": "Спільнота треків",
            "Custom tracks": "Власні треки",
            'Are you sure you want to delete "{0}"?': 'Ви впевнені, що хочете видалити "{0}"?',
            Delete: "Видалити",
            "No community tracks": "Спільнота треків відсутня",
            "Community tracks are coming soon": "Спільнота треків незабаром",
            "No custom tracks": "Власні треки відсутні",
            "Create a track using the editor or import a track code": "Створіть трек за допомогою редактора або імпортуйте код треку",
            "Search by track or author...": "Пошук за треком або автором...",
            "Invalid replay detected!": "Виявлено недійсний повтор!"
        }
          , CO = {
            "Checkpoint order": "检查点顺序",
            Height: "高度",
            Exit: "退出",
            Random: "随机",
            Primary: "主要",
            Secondary: "次要",
            Frame: "框架",
            Rims: "轮辋",
            "Are you sure you want to exit without saving?": "确定要退出而不保存吗？",
            "All changes will be lost!": "所有更改将丢失！",
            "Car saved!": "车辆已保存！",
            Test: "测试",
            "Starting point is missing!": "起点缺失！",
            Generate: "生成",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "确定要生成新赛道吗？\n\n当前赛道将丢失！",
            Load: "加载",
            Save: "保存",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "确定要加载新赛道吗？\n\n当前赛道将丢失！",
            "Track saved!": "赛道已保存！",
            "Failed to save!": "保存失败！",
            'Are you sure you want to overwrite "{0}"?': '确定要覆盖 "{0}" 吗？',
            Export: "导出",
            Help: "帮助",
            "Are you sure you want to exit the editor?": "确定要退出编辑器吗？",
            "All unsaved data will be lost!": "所有未保存的数据将丢失！",
            "Track settings": "赛道设置",
            "Unnamed Track": "未命名赛道",
            "Track name": "赛道名称",
            Author: "作者",
            Unknown: "未知",
            Environment: "环境",
            Summer: "夏季",
            Winter: "冬季",
            Desert: "沙漠",
            "Sun direction": "太阳方向",
            "How to use the editor": "如何使用编辑器",
            "Camera controls": "相机控制",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "可以通过右键单击并拖动鼠标来移动相机。通过单击中间鼠标按钮（鼠标滚轮）或按住Ctrl键并右键单击并拖动鼠标来旋转相机。通过滚动鼠标滚轮进行缩放。",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "或者，还可以使用以下键盘按键来控制相机：",
            "Move forwards:": "向前移动：",
            "Move backwards:": "向后移动：",
            "Move left:": "向左移动：",
            "Move right:": "向右移动：",
            "Rotate left:": "向左旋转：",
            "Rotate right:": "向右旋转：",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "可以通过使用左下角的高度选择器来更改编辑的高度，也可以按住Shift键并滚动鼠标滚轮。或者，您可以使用以下键盘按键：",
            "Move up:": "向上移动：",
            "Move down:": "向下移动：",
            Editing: "编辑",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "可以在右侧菜单中选择轨道部件，然后可以使用鼠标左键单击放置。",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "或者，可以使用以下键盘快捷键选择当前鼠标悬停的轨道部件：",
            "The selected part can then be rotated using the following keyboard shortcut:": "然后可以使用以下键盘快捷键旋转所选部件：",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "可以使用右侧菜单中的删除工具或按住以下键来删除轨道部件：",
            "Starting points, checkpoints and the finish line": "起点、检查点和终点",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "起点、检查点和终点都可以在右侧菜单的最上方类别中选择。",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "每个赛道必须至少有一个起点。如果有多个起点，则将使用最后放置的起点。",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "检查点应该放置在起点和终点之间。当选择检查点轨道部件时，底部右侧将有一个工具来选择检查点的顺序。这决定了在驶向终点之前必须通过检查点的顺序。请注意，可以有多个具有相同检查点顺序的检查点。",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "终点是赛道结束的地方，但只有在通过所有检查点后才会变为活动状态。也可以有多个终点。",
            "Starting point": "起点",
            Checkpoint: "检查点",
            "Finish line": "终点",
            "Exporting the track": "导出赛道",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "当赛道完成后，可以在左上角输入赛道名称，然后可以使用导出按钮导出赛道。这将显示一个赛道代码，可以将其发送给其他用户，以便他们可以导入和播放赛道。",
            Close: "关闭",
            "Not set": "未设置",
            or: "或",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "相机可以通过用一根手指拖动来移动。通过用两根手指拖动来旋转相机。通过捏合来放大和缩小。",
            "The edited height can be changed by using the height selection in the bottom left corner.": "可以通过使用左下角的高度选择器来更改编辑的高度。",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "可以在右侧菜单中选择轨道部件，然后可以通过点击屏幕来放置。",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "然后可以通过点击左下角的旋转按钮来旋转所选部件。",
            "Track parts can be deleted by using the delete tool in the right side menu.": "可以使用右侧菜单中的删除工具来删除轨道部件。",
            Watch: "观看",
            "Loading replay": "加载录像",
            "Press {0} to return to the last checkpoint": "按 {0} 返回到上一个检查点",
            "Press {0} to start over": "按 {0} 重新开始",
            "Reset once to return to the last checkpoint": "重置一次返回到上一个检查点",
            "Reset again to start over": "再次重置重新开始",
            Leaderboard: "排行榜",
            "{0} players": "{0} 名玩家",
            Back: "返回",
            "Error: Failed to load leaderboard": "错误：加载排行榜失败",
            "Unofficial versions of the game cannot access the leaderboard": "游戏的非官方版本无法访问排行榜",
            Pending: "待处理",
            Verified: "已验证",
            Invalid: "无效",
            Duplicate: "重复",
            You: "您",
            "Only verified": "仅验证",
            Loading: "加载中",
            "Failed to load recordings": "加载录像失败",
            "Cannot load recordings due to non-determinism": "由于非确定性无法加载录像",
            Ok: "确定",
            "Track is missing starting point": "赛道缺失起点",
            "Some leaderboard features are disabled.": "一些排行榜功能已禁用。",
            "Please try another browser or device.": "请尝试其他浏览器或设备。",
            "You already have another instance of PolyTrack open.": "您已经打开了另一个PolyTrack实例。",
            "Please switch to that tab or window to continue.": "请切换到该选项卡或窗口继续。",
            "Computer determinism check failed.": "计算机确定性检查失败。",
            "Non-deterministic game assets found.": "发现非确定性游戏资源。",
            "Please try clearing your browser cache.": "请尝试清除浏览器缓存。",
            "Hardware acceleration is disabled. Performance may be reduced.": "硬件加速已禁用。性能可能会降低。",
            "Please make sure hardware acceleration is enabled in your browser settings.": "请确保在浏览器设置中启用硬件加速。",
            Customize: "自定义",
            Editor: "编辑器",
            Settings: "设置",
            Profile: "个人资料",
            Play: "游戏",
            Version: "版本",
            "You cannot have duplicate user profiles": "您不能拥有重复的用户配置文件",
            "Failed to create user profile": "创建用户配置文件失败",
            "This user profile does not exist on the server": "服务器上不存在此用户配置文件",
            "Failed to download user profile from the server": "无法从服务器下载用户配置文件",
            "User token is invalid": "用户令牌无效",
            "Are you sure you want to display your private key?": "确定要显示您的私钥吗？",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "请勿与任何人分享此密钥。",
            "You need a free user profile slot to import a new user profile": "您需要一个空闲的用户配置文件槽来导入新的用户配置文件",
            Quit: "退出",
            Fullscreen: "全屏",
            Windowed: "窗口",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "您似乎正在玩 {0} 的非官方版本。请访问原始来源获取最新版本：",
            Nickname: "昵称",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "选择在排行榜中显示的昵称。您可以随时更改昵称。",
            Cancel: "取消",
            Confirm: "确认",
            "User ID": "用户ID",
            Paused: "暂停",
            "Switch car": "切换车辆",
            Profiles: "配置文件",
            'Are you sure you would like to delete "{0}"?': '您确定要删除 "{0}" 吗？',
            Empty: "空",
            Reset: "重置",
            Apply: "应用",
            Gameplay: "游戏方式",
            Units: "单位",
            Metric: "公制",
            Imperial: "英制",
            "Reset hint": "重置提示",
            Disabled: "禁用",
            Enabled: "启用",
            "Ghost car": "幽灵车",
            "Default camera": "默认摄像头",
            Default: "默认",
            Cockpit: "座舱",
            "Cockpit camera mode": "座舱摄像头模式",
            Hold: "按住",
            Toggle: "切换",
            Checkpoints: "检查点",
            Timer: "计时器",
            Speedometer: "速度计",
            Bottom: "底部",
            Top: "顶部",
            Language: "语言",
            Graphics: "图形",
            Shadows: "阴影",
            Off: "关闭",
            On: "打开",
            Minimal: "最小",
            Low: "低",
            Medium: "中",
            High: "高",
            Ultra: "超高",
            Clouds: "云",
            Particles: "粒子",
            Skidmarks: "打滑痕迹",
            "Render scale": "渲染比例",
            "Anti-aliasing (requires restart)": "抗锯齿（需要重启）",
            Audio: "音频",
            "Sound effect volume": "音效音量",
            "Music volume": "音乐音量",
            "Checkpoint volume": "检查点音量",
            Mobile: "移动",
            Vibration: "振动",
            "Steering control side": "转向控制侧",
            Left: "左侧",
            Right: "右侧",
            Controls: "控制",
            Vehicle: "车辆",
            Accelerate: "加速",
            Brake: "刹车",
            "Turn left": "左转",
            "Turn right": "右转",
            "Checkpoint reset": "检查点重置",
            "Start reset": "起点重置",
            "Cockpit camera": "座舱摄像头",
            "Rotate part": "旋转部件",
            "Height modifier": "高度调整",
            "Delete part": "删除部件",
            "Move forwards": "向前移动",
            "Move backwards": "向后移动",
            "Move left": "向左移动",
            "Move right": "向右移动",
            "Rotate view up": "向上旋转视图",
            "Rotate view down": "向下旋转视图",
            "Rotate view left": "向左旋转视图",
            "Rotate view right": "向右旋转视图",
            "Move down": "向下移动",
            "Move up": "向上移动",
            "Test track": "测试赛道",
            "Pick part": "选择部件",
            Spectator: "观众",
            "Speed modifier": "速度调整",
            Other: "其他",
            "Hide UI": "隐藏UI",
            Pause: "暂停",
            "Toggle FPS counter": "切换FPS计数器",
            "Toggle spectator camera": "切换观众摄像头",
            "Press any key...\n\nPress [Escape] to cancel.": "按任意键...\n\n按 [Escape] 取消。",
            Clear: "清除",
            "New record": "新记录",
            Record: "记录",
            Current: "当前",
            Difference: "差异",
            Copy: "复制",
            Import: "导入",
            "Failed to import track": "导入赛道失败",
            'The track "{0}" already exists. Do you wish to overwrite it?': '赛道 "{0}" 已存在。您是否要覆盖它？',
            Overwrite: "覆盖",
            "Paste track data here...": "在此粘贴赛道数据...",
            Rank: "排名",
            "Personal best": "个人最佳",
            Opponents: "对手",
            "{0} opponent selected": "{0} 个对手已选择",
            "{0} opponents selected": "{0} 个对手已选择",
            "Select opponents to race against from the leaderboard on the left": "从左侧的排行榜中选择对手进行比赛",
            "No record": "无记录",
            "Official tracks": "官方赛道",
            "Community tracks": "社区赛道",
            "Custom tracks": "自定义赛道",
            'Are you sure you want to delete "{0}"?': '确定要删除 "{0}" 吗？',
            Delete: "删除",
            "No community tracks": "没有社区赛道",
            "Community tracks are coming soon": "社区赛道即将推出",
            "No custom tracks": "没有自定义赛道",
            "Create a track using the editor or import a track code": "使用编辑器创建赛道或导入赛道代码",
            "Search by track or author...": "按赛道或作者搜索...",
            "Invalid replay detected!": "检测到无效的重放！"
        }
          , PO = {
            "Checkpoint order": "檢查點順序",
            Height: "高度",
            Exit: "退出",
            Random: "隨機",
            Primary: "主要",
            Secondary: "次要",
            Frame: "框架",
            Rims: "輪框",
            "Are you sure you want to exit without saving?": "您確定要退出而不保存嗎？",
            "All changes will be lost!": "所有更改將遺失！",
            "Car saved!": "車輛已保存！",
            Test: "測試",
            "Starting point is missing!": "起點缺失！",
            Generate: "生成",
            "Are you sure you want to generate a new track?\n\nYour current track will be lost!": "您確定要生成新賽道嗎？\n\n您當前的賽道將會丟失！",
            Load: "載入",
            Save: "保存",
            "Are you sure you want to load a new track?\n\nYour current track will be lost!": "您確定要載入新賽道嗎？\n\n您當前的賽道將會丟失！",
            "Track saved!": "賽道已保存！",
            "Failed to save!": "保存失敗！",
            'Are you sure you want to overwrite "{0}"?': '您確定要覆蓋 "{0}" 嗎？',
            Export: "匯出",
            Help: "幫助",
            "Are you sure you want to exit the editor?": "您確定要退出編輯器嗎？",
            "All unsaved data will be lost!": "所有未儲存的資料將遺失！",
            "Track settings": "賽道設定",
            "Unnamed Track": "未命名賽道",
            "Track name": "賽道名稱",
            Author: "作者",
            Unknown: "未知",
            Environment: "環境",
            Summer: "夏季",
            Winter: "冬季",
            Desert: "沙漠",
            "Sun direction": "太陽方向",
            "How to use the editor": "如何使用編輯器",
            "Camera controls": "攝影機控制",
            "The camera can be moved by right clicking and dragging the mouse. Rotate the camera by clicking the middle mouse button (mouse wheel) or holding the control key and right clicking and dragging the mouse. Zoom in and out by scrolling the mouse wheel.": "攝影機可以通過右鍵點擊並拖動鼠標來移動。通過點擊中間的鼠標按鈕（滾輪）或按住Ctrl鍵並右鍵點擊並拖動鼠標來旋轉攝影機。通過滾動鼠標滾輪來放大和縮小。",
            "Alternatively, the camera can also be controlled using the following keyboard keys:": "或者，攝影機也可以使用以下鍵盤按鍵進行控制：",
            "Move forwards:": "向前移動：",
            "Move backwards:": "向後移動：",
            "Move left:": "向左移動：",
            "Move right:": "向右移動：",
            "Rotate left:": "向左旋轉：",
            "Rotate right:": "向右旋轉：",
            "The edited height can be changed either by using the height selection in the bottom left corner, or holding the shift key and scrolling the mouse wheel. Alternatively, you can use the following keyboard keys:": "可以通過使用左下角的高度選擇器來更改編輯的高度，也可以按住Shift鍵並滾動鼠標滾輪。或者，您可以使用以下鍵盤按鍵：",
            "Move up:": "向上移動：",
            "Move down:": "向下移動：",
            Editing: "編輯",
            "Track parts can be selected in the menu on the right after which they can be placed by left clicking with the mouse.": "可以在右側的菜單中選擇軌道部件，然後可以使用鼠標左鍵點擊放置。",
            "Alternatively, the track part currently hovered by the mouse can be selected with the following keyboard shortcut:": "或者，可以使用以下鍵盤快捷鍵選擇當前鼠標懸停的軌道部件：",
            "The selected part can then be rotated using the following keyboard shortcut:": "然後可以使用以下鍵盤快捷鍵旋轉所選部分：",
            "Track parts can be deleted by using the delete tool in the right side menu or by holding the following key:": "可以使用右側菜單中的刪除工具或按住以下鍵來刪除軌道部件：",
            "Starting points, checkpoints and the finish line": "起點、檢查點和終點",
            "Starting points, checkpoints and finish lines can all be selected in the uppermost category in the right side menu.": "起點、檢查點和終點都可以在右側菜單的最上方類別中選擇。",
            "Each track must have at least one starting point. If there are multiple starting points, the last placed one will be used.": "每個賽道必須至少有一個起點。如果有多個起點，則使用最後放置的起點。",
            "Checkpoints should be placed between the starting point and the finish line. When a checkpoint track part is selected there will be a tool in the bottom right to select the order of the checkpoint. This determines the order in which the checkpoints must be passed before driving to the finish line. Notice that it is possible to have multiple checkpoints with the same checkpoint order.": "檢查點應該放置在起點和終點之間。當選擇檢查點軌道部件時，底部右側將有一個工具來選擇檢查點的順序。這決定了在開始行駛到終點之前必須通過檢查點的順序。請注意，可以有多個具有相同檢查點順序的檢查點。",
            "The finish line is where the track ends but will only become active after all checkpoints have been passed. It is also possible to have multiple finish lines.": "終點是賽道結束的地方，但只有在通過所有檢查點後才會變為活動狀態。也可以有多個終點。",
            "Starting point": "起點",
            Checkpoint: "檢查點",
            "Finish line": "終點",
            "Exporting the track": "導出賽道",
            "When the track is finished, a name for the track can be entered in top left after which the track can be exported using the export button. This will reveal a track code which can be sent to other users so they can import and play the track.": "完成賽道後，可以在左上角輸入賽道名稱，然後使用導出按鈕導出賽道。這將顯示一個賽道代碼，可以將其發送給其他用戶，以便他們可以導入並播放賽道。",
            Close: "關閉",
            "Not set": "未設置",
            or: "或",
            "The camera can be moved by dragging with one finger. Rotate the camera by dragging with two fingers. Zoom in and out by pinching.": "攝影機可以通過用一根手指拖動來移動。通過用兩根手指拖動來旋轉攝影機。通過捏合來放大和縮小。",
            "The edited height can be changed by using the height selection in the bottom left corner.": "可以通過使用左下角的高度選擇器來更改編輯的高度。",
            "Track parts can be selected in the menu on the right after which they can be placed by tapping on the screen.": "可以在右側的菜單中選擇軌道部件，然後可以通過點擊屏幕來放置。",
            "The selected part can then be rotated by tapping the rotate button in the bottom left corner.": "然後可以通過點擊左下角的旋轉按鈕來旋轉所選部分。",
            "Track parts can be deleted by using the delete tool in the right side menu.": "可以使用右側菜單中的刪除工具來刪除軌道部件。",
            Watch: "觀看",
            "Loading replay": "載入錄影",
            "Press {0} to return to the last checkpoint": "按 {0} 返回到上一個檢查點",
            "Press {0} to start over": "按 {0} 重新開始",
            "Reset once to return to the last checkpoint": "重設一次返回到上一個檢查點",
            "Reset again to start over": "再次重設重新開始",
            Leaderboard: "排行榜",
            "{0} players": "{0} 玩家",
            Back: "返回",
            "Error: Failed to load leaderboard": "錯誤：無法載入排行榜",
            "Unofficial versions of the game cannot access the leaderboard": "非官方版本的遊戲無法訪問排行榜",
            Pending: "待定",
            Verified: "已驗證",
            Invalid: "無效",
            Duplicate: "重複",
            You: "您",
            "Only verified": "僅驗證",
            Loading: "載入中",
            "Failed to load recordings": "無法載入錄影",
            "Cannot load recordings due to non-determinism": "由於非確定性，無法載入錄影",
            Ok: "確定",
            "Track is missing starting point": "賽道缺少起點",
            "Some leaderboard features are disabled.": "一些排行榜功能已禁用。",
            "Please try another browser or device.": "請嘗試其他瀏覽器或設備。",
            "You already have another instance of PolyTrack open.": "您已經打開了另一個 PolyTrack 實例。",
            "Please switch to that tab or window to continue.": "請切換到該標籤或窗口以繼續。",
            "Computer determinism check failed.": "電腦確定性檢查失敗。",
            "Non-deterministic game assets found.": "發現非確定性遊戲資產。",
            "Please try clearing your browser cache.": "請嘗試清除瀏覽器快取。",
            "Hardware acceleration is disabled. Performance may be reduced.": "硬體加速已禁用。性能可能會降低。",
            "Please make sure hardware acceleration is enabled in your browser settings.": "請確保在瀏覽器設定中啟用硬體加速。",
            Customize: "自訂",
            Editor: "編輯器",
            Settings: "設定",
            Profile: "個人資料",
            Play: "遊玩",
            Version: "版本",
            "You cannot have duplicate user profiles": "您不能擁有重複的使用者檔案",
            "Failed to create user profile": "無法建立使用者檔案",
            "This user profile does not exist on the server": "此使用者檔案不存在於伺服器上",
            "Failed to download user profile from the server": "無法從伺服器下載使用者檔案",
            "User token is invalid": "使用者令牌無效",
            "Are you sure you want to display your private key?": "確定要顯示您的私密金鑰嗎？",
            "DO NOT SHARE THIS KEY WITH ANYONE.": "請勿與任何人分享此金鑰。",
            "You need a free user profile slot to import a new user profile": "您需要一個空閒的使用者檔案插槽以匯入新的使用者檔案",
            Quit: "退出",
            Fullscreen: "全螢幕",
            Windowed: "視窗",
            "It seems like you are playing an unofficial version of {0}. For the most up-to-date version please visit the original source:": "您似乎正在玩非官方版本的 {0}。請訪問原始來源以獲取最新版本：",
            Nickname: "暱稱",
            "Choose a nickname to be shown in the leaderboard. Your nickname can be changed at any time.": "選擇一個在排行榜中顯示的暱稱。您隨時可以更改您的暱稱。",
            Cancel: "取消",
            Confirm: "確認",
            "User ID": "使用者 ID",
            Paused: "暫停",
            "Switch car": "切換車輛",
            Profiles: "配置檔",
            'Are you sure you would like to delete "{0}"?': '您確定要刪除 "{0}" 嗎？',
            Empty: "空",
            Reset: "重設",
            Apply: "套用",
            Gameplay: "遊戲玩法",
            Units: "單位",
            Metric: "公制",
            Imperial: "英制",
            "Reset hint": "重設提示",
            Disabled: "禁用",
            Enabled: "啟用",
            "Ghost car": "鬼車",
            "Default camera": "預設攝影機",
            Default: "預設",
            Cockpit: "座艙",
            "Cockpit camera mode": "座艙攝影機模式",
            Hold: "按住",
            Toggle: "切換",
            Checkpoints: "檢查點",
            Timer: "計時器",
            Speedometer: "速度計",
            Bottom: "底部",
            Top: "頂部",
            Language: "語言",
            Graphics: "圖形",
            Shadows: "陰影",
            Off: "關",
            On: "開",
            Minimal: "最小",
            Low: "低",
            Medium: "中",
            High: "高",
            Ultra: "超高",
            Clouds: "雲彩",
            Particles: "粒子",
            Skidmarks: "滑胎痕跡",
            "Render scale": "渲染比例",
            "Anti-aliasing (requires restart)": "抗鋸齒 (需要重新啟動)",
            Audio: "音效",
            "Sound effect volume": "音效音量",
            "Music volume": "音樂音量",
            "Checkpoint volume": "檢查點音量",
            Mobile: "行動裝置",
            Vibration: "震動",
            "Steering control side": "方向盤控制側",
            Left: "左側",
            Right: "右側",
            Controls: "控制",
            Vehicle: "車輛",
            Accelerate: "加速",
            Brake: "剎車",
            "Turn left": "左轉",
            "Turn right": "右轉",
            "Checkpoint reset": "檢查點重設",
            "Start reset": "起點重設",
            "Cockpit camera": "座艙攝影機",
            "Rotate part": "旋轉部件",
            "Height modifier": "高度調整",
            "Delete part": "刪除部件",
            "Move forwards": "前進",
            "Move backwards": "後退",
            "Move left": "左移",
            "Move right": "右移",
            "Rotate view up": "向上旋轉視圖",
            "Rotate view down": "向下旋轉視圖",
            "Rotate view left": "向左旋轉視圖",
            "Rotate view right": "向右旋轉視圖",
            "Move down": "向下移動",
            "Move up": "向上移動",
            "Test track": "測試賽道",
            "Pick part": "選擇部件",
            Spectator: "觀眾",
            "Speed modifier": "速度調整",
            Other: "其他",
            "Hide UI": "隱藏 UI",
            Pause: "暫停",
            "Toggle FPS counter": "切換 FPS 計數器",
            "Toggle spectator camera": "切換觀眾攝影機",
            "Press any key...\n\nPress [Escape] to cancel.": "按下任意鍵...\n\n按 [Escape] 取消。",
            Clear: "清除",
            "New record": "新紀錄",
            Record: "紀錄",
            Current: "目前",
            Difference: "差異",
            Copy: "複製",
            Import: "匯入",
            "Failed to import track": "匯入賽道失敗",
            'The track "{0}" already exists. Do you wish to overwrite it?': '賽道 "{0}" 已存在。您要覆蓋它嗎？',
            Overwrite: "覆蓋",
            "Paste track data here...": "在此粘貼賽道數據...",
            Rank: "排名",
            "Personal best": "個人最佳",
            Opponents: "對手",
            "{0} opponent selected": "{0} 對手已選擇",
            "{0} opponents selected": "{0} 對手已選擇",
            "Select opponents to race against from the leaderboard on the left": "從左側的排行榜中選擇對手進行比賽",
            "No record": "無紀錄",
            "Official tracks": "官方賽道",
            "Community tracks": "社區賽道",
            "Custom tracks": "自訂賽道",
            'Are you sure you want to delete "{0}"?': '您確定要刪除 "{0}" 嗎？',
            Delete: "刪除",
            "No community tracks": "沒有社區賽道",
            "Community tracks are coming soon": "社區賽道即將推出",
            "No custom tracks": "沒有自訂賽道",
            "Create a track using the editor or import a track code": "使用編輯器創建賽道或匯入賽道代碼",
            "Search by track or author...": "按賽道或作者搜索...",
            "Invalid replay detected!": "檢測到無效的重播！"
        };
        var IO, RO, LO, DO, NO = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        }, BO = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        };
        RO = new WeakMap,
        LO = new WeakMap,
        IO = new WeakSet,
        DO = function(e) {
            const t = NO(this, LO, "f").get(e);
            return null != t ? t : vO
        }
        ;
        const UO = class {
            constructor(e) {
                IO.add(this),
                RO.set(this, void 0),
                LO.set(this, new Map([["ar", mO], ["de-DE", gO], ["es-ES", wO], ["fr-FR", yO], ["it-IT", bO], ["ja-JP", AO], ["ko-KR", xO], ["pl-PL", kO], ["pt-BR", EO], ["pt-PT", SO], ["ru-RU", MO], ["tr-TR", _O], ["uk-UA", TO], ["zh-CN", CO], ["zh-TW", PO]])),
                BO(this, RO, NO(this, IO, "m", DO).call(this, e), "f")
            }
            set language(e) {
                BO(this, RO, NO(this, IO, "m", DO).call(this, e), "f")
            }
            get(e, t) {
                let n;
                if (n = e in NO(this, RO, "f") ? NO(this, RO, "f")[e] : e,
                null != t)
                    for (const [e,i] of t.entries())
                        n = n.replace(new RegExp("\\{" + e.toString() + "\\}","g"), i);
                return n
            }
        }
        ;
        var zO = i(1465)
          , OO = {};
        OO.styleTagTransform = u(),
        OO.setAttributes = l(),
        OO.insert = s().bind(null, "head"),
        OO.domAPI = r(),
        OO.insertStyleElement = h();
        t()(zO.A, OO);
        zO.A && zO.A.locals && zO.A.locals;
        var FO, WO, HO, VO, GO, jO, QO = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, KO = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        FO = new WeakMap,
        WO = new WeakMap,
        HO = new WeakMap,
        VO = new WeakMap,
        GO = new WeakMap,
        jO = new WeakMap;
        const qO = class {
            constructor() {
                FO.set(this, void 0),
                WO.set(this, void 0),
                HO.set(this, void 0),
                VO.set(this, void 0),
                GO.set(this, void 0),
                jO.set(this, void 0);
                const e = document.getElementById("ui");
                if (null == e)
                    throw new Error("UI element not found");
                QO(this, FO, e, "f"),
                QO(this, WO, document.createElement("div"), "f"),
                KO(this, WO, "f").className = "input-visualizer",
                KO(this, FO, "f").appendChild(KO(this, WO, "f")),
                QO(this, HO, document.createElement("div"), "f"),
                KO(this, HO, "f").className = "arrow-up",
                KO(this, HO, "f").innerHTML = '<img src="images/arrow_up.svg">',
                KO(this, WO, "f").appendChild(KO(this, HO, "f")),
                QO(this, VO, document.createElement("div"), "f"),
                KO(this, VO, "f").className = "arrow-right",
                KO(this, VO, "f").innerHTML = '<img src="images/arrow_right.svg">',
                KO(this, WO, "f").appendChild(KO(this, VO, "f")),
                QO(this, GO, document.createElement("div"), "f"),
                KO(this, GO, "f").className = "arrow-down",
                KO(this, GO, "f").innerHTML = '<img src="images/arrow_down.svg">',
                KO(this, WO, "f").appendChild(KO(this, GO, "f")),
                QO(this, jO, document.createElement("div"), "f"),
                KO(this, jO, "f").className = "arrow-left",
                KO(this, jO, "f").innerHTML = '<img src="images/arrow_left.svg">',
                KO(this, WO, "f").appendChild(KO(this, jO, "f"))
            }
            dispose() {
                KO(this, FO, "f").removeChild(KO(this, WO, "f"))
            }
            update(e) {
                KO(this, HO, "f").className = e.up ? "active arrow-up" : "arrow-up",
                KO(this, VO, "f").className = e.right ? "active arrow-right" : "arrow-right",
                KO(this, GO, "f").className = e.down ? "active arrow-down" : "arrow-down",
                KO(this, jO, "f").className = e.left ? "active arrow-left" : "arrow-left"
            }
        }
        ;
        var YO = i(4543)
          , XO = {};
        XO.styleTagTransform = u(),
        XO.setAttributes = l(),
        XO.insert = s().bind(null, "head"),
        XO.domAPI = r(),
        XO.insertStyleElement = h();
        t()(YO.A, XO);
        YO.A && YO.A.locals && YO.A.locals;
        var ZO, JO, $O, eF, tF, nF, iF, rF, aF, sF, oF, lF, cF, hF, dF, uF, pF, fF, mF, gF = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, vF = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        JO = new WeakMap,
        $O = new WeakMap,
        eF = new WeakMap,
        tF = new WeakMap,
        nF = new WeakMap,
        iF = new WeakMap,
        rF = new WeakMap,
        aF = new WeakMap,
        sF = new WeakMap,
        oF = new WeakMap,
        lF = new WeakMap,
        cF = new WeakMap,
        hF = new WeakMap,
        dF = new WeakMap,
        uF = new WeakMap,
        ZO = new WeakSet,
        pF = function(e) {
            const t = vF(this, nF, "f").getBoundingClientRect()
              , n = (e.clientX - t.left) / (t.width - 8)
              , i = new Gp(Math.max(0, Math.min(vF(this, lF, "f").numberOfFrames, Math.floor(n * vF(this, lF, "f").numberOfFrames))));
            vF(this, $O, "f").call(this, i)
        }
        ,
        fF = function() {
            vF(this, oF, "f") ? vF(this, tF, "f").innerHTML = '<img src="images/reset.svg">' : vF(this, sF, "f") ? vF(this, tF, "f").innerHTML = '<img src="images/play.svg">' : vF(this, tF, "f").innerHTML = '<img src="images/pause.svg">'
        }
        ,
        mF = function() {
            if (vF(this, aF, "f").innerHTML = "",
            vF(this, lF, "f").time < 1e4) {
                let e, t;
                vF(this, lF, "f").time > 2e3 ? (e = 60,
                t = 600) : vF(this, lF, "f").time > 200 ? (e = 10,
                t = 60) : (e = 1,
                t = 10);
                for (let n = e; n < vF(this, lF, "f").time; n += e) {
                    const e = document.createElement("div");
                    e.className = n % t == 0 ? "dash long" : "dash",
                    e.style.left = "calc(" + (n / vF(this, lF, "f").time * 100).toString() + "% - 1px)",
                    vF(this, aF, "f").appendChild(e)
                }
            }
            for (const e of vF(this, cF, "f")) {
                const t = document.createElement("div");
                t.className = "checkpoint-dash",
                t.style.left = "calc(" + (e.time / vF(this, lF, "f").time * 100).toString() + "% - 1px)",
                vF(this, aF, "f").appendChild(t)
            }
        }
        ;
        const wF = class {
            constructor(e, t, n, i, r) {
                ZO.add(this),
                JO.set(this, void 0),
                $O.set(this, void 0),
                eF.set(this, void 0),
                tF.set(this, void 0),
                nF.set(this, void 0),
                iF.set(this, void 0),
                rF.set(this, void 0),
                aF.set(this, void 0),
                sF.set(this, void 0),
                oF.set(this, !1),
                lF.set(this, void 0),
                cF.set(this, []),
                hF.set(this, !1),
                dF.set(this, void 0),
                uF.set(this, void 0),
                gF(this, sF, r, "f");
                const a = document.getElementById("ui");
                if (null == a)
                    throw new Error("UI element not found");
                gF(this, JO, a, "f"),
                gF(this, $O, i, "f"),
                gF(this, lF, t, "f"),
                gF(this, cF, n.map((e => e.clone())), "f"),
                gF(this, eF, document.createElement("div"), "f"),
                vF(this, eF, "f").className = "time-bar",
                vF(this, JO, "f").appendChild(vF(this, eF, "f")),
                gF(this, tF, document.createElement("button"), "f"),
                vF(this, tF, "f").className = "button",
                vF(this, tF, "f").addEventListener("click", ( () => {
                    e.playUIClick(),
                    vF(this, oF, "f") ? (vF(this, $O, "f").call(this, new Gp(0)),
                    this.isPaused = !1) : this.isPaused = !this.isPaused
                }
                )),
                vF(this, eF, "f").appendChild(vF(this, tF, "f")),
                vF(this, ZO, "m", fF).call(this),
                gF(this, nF, document.createElement("div"), "f"),
                vF(this, nF, "f").className = "bar",
                vF(this, nF, "f").addEventListener("pointerdown", (e => {
                    gF(this, hF, !0, "f"),
                    vF(this, ZO, "m", pF).call(this, e)
                }
                )),
                window.addEventListener("pointermove", gF(this, dF, (e => {
                    vF(this, hF, "f") && vF(this, ZO, "m", pF).call(this, e)
                }
                ), "f")),
                window.addEventListener("pointerup", gF(this, uF, (e => {
                    vF(this, hF, "f") && (gF(this, hF, !1, "f"),
                    vF(this, ZO, "m", pF).call(this, e))
                }
                ), "f")),
                vF(this, eF, "f").appendChild(vF(this, nF, "f"));
                const s = document.createElement("div");
                vF(this, nF, "f").appendChild(s),
                gF(this, iF, document.createElement("div"), "f"),
                vF(this, iF, "f").className = "unloaded-fill",
                s.appendChild(vF(this, iF, "f")),
                gF(this, rF, document.createElement("div"), "f"),
                vF(this, rF, "f").className = "fill",
                s.appendChild(vF(this, rF, "f")),
                gF(this, aF, document.createElement("div"), "f"),
                vF(this, aF, "f").className = "dash-container",
                s.appendChild(vF(this, aF, "f")),
                vF(this, ZO, "m", mF).call(this)
            }
            dispose() {
                vF(this, JO, "f").removeChild(vF(this, eF, "f")),
                window.removeEventListener("pointermove", vF(this, dF, "f")),
                window.removeEventListener("pointerup", vF(this, uF, "f"))
            }
            get isDragging() {
                return vF(this, hF, "f")
            }
            get isPaused() {
                return vF(this, sF, "f")
            }
            set isPaused(e) {
                gF(this, sF, e, "f"),
                vF(this, ZO, "m", fF).call(this)
            }
            set time(e) {
                const t = e.numberOfFrames >= vF(this, lF, "f").numberOfFrames;
                vF(this, rF, "f").style.width = "calc(8px + " + (e.numberOfFrames / vF(this, lF, "f").numberOfFrames * 100).toString() + "%)",
                0 == e.numberOfFrames ? vF(this, rF, "f").style.visibility = "hidden" : vF(this, rF, "f").style.visibility = "visible",
                vF(this, oF, "f") != t && (gF(this, oF, t, "f"),
                vF(this, ZO, "m", fF).call(this))
            }
            set loadedTime(e) {
                vF(this, iF, "f").style.width = "calc(8px + " + (100 * (1 - e.numberOfFrames / vF(this, lF, "f").numberOfFrames)).toString() + "%)",
                e.numberOfFrames >= vF(this, lF, "f").numberOfFrames ? vF(this, iF, "f").style.visibility = "hidden" : vF(this, iF, "f").style.visibility = "visible"
            }
            set totalTime(e) {
                vF(this, lF, "f").equals(e) || (gF(this, lF, e.clone(), "f"),
                vF(this, ZO, "m", mF).call(this))
            }
            set checkpointTimes(e) {
                gF(this, cF, e.map((e => e.clone())), "f"),
                vF(this, ZO, "m", mF).call(this)
            }
        }
        ;
        var yF = i(8768)
          , bF = {};
        bF.styleTagTransform = u(),
        bF.setAttributes = l(),
        bF.insert = s().bind(null, "head"),
        bF.domAPI = r(),
        bF.insertStyleElement = h();
        t()(yF.A, bF);
        yF.A && yF.A.locals && yF.A.locals;
        var AF, xF, kF = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, EF = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        AF = new WeakMap,
        xF = new WeakMap;
        const SF = class {
            constructor(e, t, n, i) {
                AF.set(this, void 0),
                xF.set(this, void 0);
                const r = document.getElementById("ui");
                if (null == r)
                    throw new Error("UI element not found");
                kF(this, AF, r, "f"),
                kF(this, xF, document.createElement("div"), "f"),
                EF(this, xF, "f").className = "preview-toolbar";
                const a = document.createElement("button");
                if (a.className = "button",
                a.innerHTML = '<img class="button-icon" src="images/back.svg"> ',
                a.append(document.createTextNode(t.get("Back"))),
                a.addEventListener("click", ( () => {
                    e.playUIClick(),
                    n()
                }
                )),
                EF(this, xF, "f").appendChild(a),
                null != i) {
                    const n = document.createElement("button");
                    n.className = "button",
                    n.innerHTML = '<img class="button-icon" src="images/customize.svg"> ',
                    n.append(document.createTextNode(t.get("Switch car"))),
                    n.addEventListener("click", ( () => {
                        e.playUIClick(),
                        i()
                    }
                    )),
                    EF(this, xF, "f").appendChild(n)
                }
                EF(this, AF, "f").appendChild(EF(this, xF, "f"))
            }
            dispose() {
                EF(this, AF, "f").removeChild(EF(this, xF, "f"))
            }
        }
        ;
        var MF, _F, TF, CF, PF, IF, RF, LF, DF, NF, BF, UF, zF, OF, FF, WF, HF, VF, GF, jF, QF, KF, qF, YF, XF, ZF, JF, $F, eW, tW, nW, iW = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, rW = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        _F = new WeakMap,
        TF = new WeakMap,
        CF = new WeakMap,
        PF = new WeakMap,
        IF = new WeakMap,
        RF = new WeakMap,
        LF = new WeakMap,
        DF = new WeakMap,
        NF = new WeakMap,
        BF = new WeakMap,
        UF = new WeakMap,
        zF = new WeakMap,
        OF = new WeakMap,
        FF = new WeakMap,
        WF = new WeakMap,
        HF = new WeakMap,
        VF = new WeakMap,
        GF = new WeakMap,
        jF = new WeakMap,
        QF = new WeakMap,
        KF = new WeakMap,
        qF = new WeakMap,
        YF = new WeakMap,
        XF = new WeakMap,
        ZF = new WeakMap,
        JF = new WeakMap,
        $F = new WeakMap,
        eW = new WeakMap,
        MF = new WeakSet,
        tW = function(e) {
            var t, n, i, r, a;
            if (e) {
                const e = rW(this, FF, "f")[rW(this, OF, "f")]
                  , t = e.settings.time;
                let n;
                iW(this, QF, new wF(rW(this, NF, "f"),t,e.checkpointTimes,(e => {
                    var t, n, i;
                    iW(this, HF, Math.max(0, Math.min(rW(this, VF, "f"), e.time)), "f");
                    const r = Math.round(1e3 * rW(this, HF, "f"));
                    rW(this, MF, "m", nW).call(this, r);
                    for (const e of rW(this, FF, "f"))
                        e.car.update(0);
                    const a = rW(this, FF, "f")[rW(this, OF, "f")].car;
                    null != rW(this, QF, "f") && (rW(this, QF, "f").time = new Gp(r)),
                    null === (t = rW(this, qF, "f")) || void 0 === t || t.update(a.getControls()),
                    null === (n = rW(this, YF, "f")) || void 0 === n || n.update(a),
                    null === (i = rW(this, XF, "f")) || void 0 === i || i.update(a)
                }
                ),rW(this, WF, "f")), "f"),
                n = rW(this, FF, "f").length > 1 ? () => {
                    iW(this, OF, (rW(this, OF, "f") + 1) % rW(this, FF, "f").length, "f");
                    for (let e = 0; e < rW(this, FF, "f").length; e++)
                        rW(this, FF, "f")[e].car.notificationAudioEnabled = e == rW(this, OF, "f");
                    rW(this, GF, "f").isEnabled || (rW(this, UF, "f").getSettingBoolean(el.DefaultCameraMode) ? rW(this, DF, "f").setCamera(rW(this, FF, "f")[rW(this, OF, "f")].car.cameraCockpit) : rW(this, DF, "f").setCamera(rW(this, FF, "f")[rW(this, OF, "f")].car.cameraOrbit)),
                    null != rW(this, QF, "f") && (rW(this, QF, "f").totalTime = rW(this, FF, "f")[rW(this, OF, "f")].settings.time,
                    rW(this, QF, "f").checkpointTimes = rW(this, FF, "f")[rW(this, OF, "f")].checkpointTimes),
                    null != rW(this, XF, "f") && (rW(this, XF, "f").nickname = rW(this, FF, "f")[rW(this, OF, "f")].settings.name)
                }
                : null,
                iW(this, KF, new SF(rW(this, NF, "f"),rW(this, BF, "f"),( () => {
                    rW(this, zF, "f").call(this, rW(this, CF, "f"), rW(this, PF, "f"), rW(this, IF, "f"), rW(this, FF, "f").map((e => e.settings)))
                }
                ),n), "f"),
                iW(this, qF, new qO, "f"),
                iW(this, YF, new kT(rW(this, UF, "f")), "f"),
                rW(this, YF, "f").setOverridePosition(!1),
                iW(this, XF, new $k(rW(this, BF, "f"),rW(this, UF, "f"),!0), "f"),
                rW(this, XF, "f").nickname = rW(this, FF, "f")[rW(this, OF, "f")].settings.name,
                rW(this, XF, "f").setOverridePosition(!1)
            } else
                null === (t = rW(this, QF, "f")) || void 0 === t || t.dispose(),
                iW(this, QF, null, "f"),
                null === (n = rW(this, KF, "f")) || void 0 === n || n.dispose(),
                iW(this, KF, null, "f"),
                null === (i = rW(this, qF, "f")) || void 0 === i || i.dispose(),
                iW(this, qF, null, "f"),
                null === (r = rW(this, YF, "f")) || void 0 === r || r.dispose(),
                iW(this, YF, null, "f"),
                null === (a = rW(this, XF, "f")) || void 0 === a || a.dispose(),
                iW(this, XF, null, "f")
        }
        ,
        nW = function(e) {
            for (const t of rW(this, FF, "f"))
                if (t.car.getTime().numberOfFrames != e) {
                    const n = t.replay.getFrame(e);
                    null != n && t.car.setCarState(n)
                }
        }
        ;
        const aW = class {
            constructor(e, t, n, i, r, a, s, o, l, c, h, d, u) {
                MF.add(this),
                _F.set(this, void 0),
                TF.set(this, void 0),
                CF.set(this, void 0),
                PF.set(this, void 0),
                IF.set(this, void 0),
                RF.set(this, void 0),
                LF.set(this, void 0),
                DF.set(this, void 0),
                NF.set(this, void 0),
                BF.set(this, void 0),
                UF.set(this, void 0),
                zF.set(this, void 0),
                OF.set(this, 0),
                FF.set(this, void 0),
                WF.set(this, !1),
                HF.set(this, 0),
                VF.set(this, 0),
                GF.set(this, void 0),
                jF.set(this, !0),
                QF.set(this, null),
                KF.set(this, null),
                qF.set(this, null),
                YF.set(this, null),
                XF.set(this, null),
                ZF.set(this, null),
                JF.set(this, void 0),
                $F.set(this, void 0),
                eW.set(this, 1e4),
                iW(this, _F, e, "f"),
                iW(this, TF, t, "f"),
                iW(this, CF, n, "f"),
                iW(this, PF, i, "f"),
                iW(this, IF, r, "f"),
                iW(this, RF, a, "f"),
                iW(this, LF, s, "f"),
                iW(this, DF, o, "f"),
                iW(this, NF, l, "f"),
                iW(this, BF, c, "f"),
                iW(this, UF, h, "f"),
                iW(this, zF, u, "f"),
                t.loadTrackData(i),
                t.generateMeshes(),
                a.generateMountains(t.getBounds());
                const p = t.getStartTransform();
                if (null == p)
                    throw new Error("Track has no starting point");
                const f = new Gp(d.reduce(( (e, t) => Math.max(e, t.time.numberOfFrames + rW(this, eW, "f"))), 0));
                iW(this, VF, f.time, "f"),
                iW(this, FF, d.map(( (n, i) => {
                    const r = new Qw(null,p,n.recording,null,o,l,a,t,h);
                    r.notificationAudioEnabled = rW(this, OF, "f") == i,
                    r.setColors(n.carColors);
                    const s = {
                        replay: new xP,
                        checkpointTimes: [],
                        carId: null,
                        car: r,
                        settings: n
                    };
                    let c = e.createCar(p, a.getMountainVertices(), a.getMountainOffset(), t.getTrackData(), n.recording, (t => {
                        s.replay.push(t),
                        null != s.carId && t.frames >= f.numberOfFrames && (e.deleteCar(s.carId),
                        s.carId = null),
                        t.nextCheckpointIndex > c.nextCheckpointIndex && (s.checkpointTimes.push(new Gp(t.frames)),
                        i == rW(this, OF, "f") && null != rW(this, QF, "f") && (rW(this, QF, "f").checkpointTimes = s.checkpointTimes)),
                        c = t
                    }
                    ));
                    return s.replay.push(c),
                    e.startCar(c.id, f.clone()),
                    s.carId = c.id,
                    s
                }
                )), "f"),
                h.getSettingBoolean(el.DefaultCameraMode) ? o.setCamera(rW(this, FF, "f")[rW(this, OF, "f")].car.cameraCockpit) : o.setCamera(rW(this, FF, "f")[rW(this, OF, "f")].car.cameraOrbit),
                iW(this, GF, new XC(o,h), "f"),
                rW(this, GF, "f").addToggleListener((e => {
                    e ? o.setCamera(rW(this, GF, "f").camera) : rW(this, UF, "f").getSettingBoolean(el.DefaultCameraMode) ? rW(this, DF, "f").setCamera(rW(this, FF, "f")[rW(this, OF, "f")].car.cameraCockpit) : rW(this, DF, "f").setCamera(rW(this, FF, "f")[rW(this, OF, "f")].car.cameraOrbit)
                }
                )),
                rW(this, MF, "m", tW).call(this, !0),
                window.addEventListener("keydown", iW(this, JF, (e => {
                    if (rW(this, GF, "f").isEnabled)
                        "Escape" == e.code && (rW(this, GF, "f").isEnabled = !1,
                        e.preventDefault());
                    else if ("Escape" == e.code)
                        u(n, i, r, rW(this, FF, "f").map((e => e.settings))),
                        e.preventDefault();
                    else if (h.checkKeyBinding(e, gk.VehicleCheckpointReset) || h.checkKeyBinding(e, gk.VehicleStartReset))
                        e.repeat || iW(this, HF, 0, "f"),
                        e.preventDefault();
                    else if (rW(this, UF, "f").checkKeyBinding(e, gk.VehicleCockpitCamera)) {
                        if (!e.repeat) {
                            const e = rW(this, FF, "f")[rW(this, OF, "f")].car;
                            e.hasFinished() || (rW(this, UF, "f").getSettingBoolean(el.CockpitCameraToggle) ? rW(this, DF, "f").camera == e.cameraOrbit ? rW(this, DF, "f").setCamera(e.cameraCockpit) : rW(this, DF, "f").setCamera(e.cameraOrbit) : rW(this, UF, "f").getSettingBoolean(el.DefaultCameraMode) ? rW(this, DF, "f").setCamera(e.cameraOrbit) : rW(this, DF, "f").setCamera(e.cameraCockpit))
                        }
                        e.preventDefault()
                    }
                    if (h.checkKeyBinding(e, gk.ToggleUI) && (iW(this, jF, !rW(this, jF, "f"), "f"),
                    rW(this, MF, "m", tW).call(this, rW(this, jF, "f")),
                    e.preventDefault()),
                    h.checkKeyBinding(e, gk.ToggleSpectatorCamera)) {
                        rW(this, GF, "f").camera.position.copy(rW(this, DF, "f").camera.position);
                        const t = new si(0,0,0,"YXZ").setFromQuaternion(rW(this, DF, "f").camera.quaternion);
                        t.z = 0,
                        rW(this, GF, "f").camera.quaternion.setFromEuler(t),
                        rW(this, GF, "f").toggle(),
                        e.preventDefault()
                    }
                    "Space" == e.code && (iW(this, WF, !rW(this, WF, "f"), "f"),
                    null != rW(this, QF, "f") && (rW(this, QF, "f").isPaused = rW(this, WF, "f")),
                    e.preventDefault())
                }
                ), "f")),
                window.addEventListener("keyup", iW(this, $F, (e => {
                    if (!rW(this, GF, "f").isEnabled && rW(this, UF, "f").checkKeyBinding(e, gk.VehicleCockpitCamera)) {
                        const e = rW(this, FF, "f")[rW(this, OF, "f")].car;
                        e.hasFinished() || rW(this, UF, "f").getSettingBoolean(el.CockpitCameraToggle) || (rW(this, UF, "f").getSettingBoolean(el.DefaultCameraMode) ? rW(this, DF, "f").setCamera(e.cameraCockpit) : rW(this, DF, "f").setCamera(e.cameraOrbit))
                    }
                }
                ), "f"))
            }
            dispose() {
                var e;
                rW(this, TF, "f").clear(),
                rW(this, RF, "f").clearMountains();
                for (const e of rW(this, FF, "f"))
                    null != e.carId && (rW(this, _F, "f").deleteCar(e.carId),
                    e.carId = null),
                    e.car.dispose();
                rW(this, GF, "f").dispose(),
                rW(this, MF, "m", tW).call(this, !1),
                window.removeEventListener("keydown", rW(this, JF, "f")),
                window.removeEventListener("keyup", rW(this, $F, "f")),
                null === (e = rW(this, ZF, "f")) || void 0 === e || e.dispose()
            }
            update(e) {
                var t, n, i, r, a, s;
                null != rW(this, QF, "f") && iW(this, WF, rW(this, QF, "f").isPaused, "f");
                let o = 1 / 0;
                for (const e of rW(this, FF, "f"))
                    o = Math.min(o, e.replay.getLastFrame().numberOfFrames);
                const l = new Gp(o);
                let c;
                if (rW(this, WF, "f") || (null === (t = rW(this, QF, "f")) || void 0 === t ? void 0 : t.isDragging)) {
                    c = 0;
                    for (const e of rW(this, FF, "f"))
                        e.car.audioVolume = 0
                } else {
                    const t = Math.min(rW(this, VF, "f"), rW(this, HF, "f") + e);
                    if (l.time >= t) {
                        iW(this, HF, t, "f"),
                        rW(this, HF, "f") == rW(this, VF, "f") && (null != rW(this, QF, "f") && (rW(this, QF, "f").isPaused = !0),
                        iW(this, WF, !0, "f")),
                        c = e;
                        for (const e of rW(this, FF, "f"))
                            e.car.audioVolume = 1
                    } else {
                        c = 0;
                        for (const e of rW(this, FF, "f"))
                            e.car.audioVolume = 0
                    }
                }
                const h = Math.round(1e3 * rW(this, HF, "f"))
                  , d = Math.min(h, l.numberOfFrames);
                if ((null === (n = rW(this, QF, "f")) || void 0 === n ? void 0 : n.isDragging) || d < rW(this, FF, "f")[rW(this, OF, "f")].car.getTime().numberOfFrames || d > rW(this, FF, "f")[rW(this, OF, "f")].car.getTime().numberOfFrames + 1e3)
                    rW(this, MF, "m", nW).call(this, d);
                else {
                    for (let e = rW(this, FF, "f")[rW(this, OF, "f")].car.getTime().numberOfFrames + 1; e <= d; e++)
                        rW(this, MF, "m", nW).call(this, e)
                }
                null != rW(this, QF, "f") && (rW(this, QF, "f").time = rW(this, FF, "f")[rW(this, OF, "f")].car.getTime(),
                rW(this, QF, "f").loadedTime = l),
                null === (i = rW(this, qF, "f")) || void 0 === i || i.update(rW(this, FF, "f")[rW(this, OF, "f")].car.getControls()),
                null === (r = rW(this, YF, "f")) || void 0 === r || r.update(rW(this, FF, "f")[rW(this, OF, "f")].car),
                null === (a = rW(this, XF, "f")) || void 0 === a || a.update(rW(this, FF, "f")[rW(this, OF, "f")].car);
                for (const e of rW(this, FF, "f"))
                    e.car.update(c),
                    e.car.updateCameras(c);
                null === (s = rW(this, ZF, "f")) || void 0 === s || s.updateCar(rW(this, FF, "f")[rW(this, OF, "f")].car),
                rW(this, GF, "f").update(e),
                rW(this, RF, "f").update(rW(this, TF, "f")),
                rW(this, LF, "f").update(c, rW(this, DF, "f").camera, rW(this, TF, "f").sunDirection),
                rW(this, NF, "f").update(e, !1, rW(this, DF, "f"), rW(this, UF, "f")),
                rW(this, DF, "f").update(rW(this, TF, "f").sunDirection)
            }
        }
        ;
        var sW, oW, lW = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        }, cW = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        };
        sW = new WeakMap,
        oW = new WeakMap;
        const hW = class {
            constructor() {
                sW.set(this, !1),
                oW.set(this, []),
                window.addEventListener("touchstart", ( () => {
                    if (!lW(this, sW, "f")) {
                        cW(this, sW, !0, "f");
                        for (const e of lW(this, oW, "f"))
                            e(lW(this, sW, "f"))
                    }
                }
                )),
                window.addEventListener("keydown", ( () => {
                    if (lW(this, sW, "f")) {
                        cW(this, sW, !1, "f");
                        for (const e of lW(this, oW, "f"))
                            e(lW(this, sW, "f"))
                    }
                }
                ))
            }
            get touchEnabled() {
                return lW(this, sW, "f")
            }
            addChangeListener(e) {
                lW(this, oW, "f").push(e),
                e(lW(this, sW, "f"))
            }
            removeChangeListener(e) {
                const t = lW(this, oW, "f").indexOf(e);
                t >= 0 && lW(this, oW, "f").splice(t, 1)
            }
        }
        ;
        var dW = i(5768)
          , uW = {};
        uW.styleTagTransform = u(),
        uW.setAttributes = l(),
        uW.insert = s().bind(null, "head"),
        uW.domAPI = r(),
        uW.insertStyleElement = h();
        t()(dW.A, uW);
        dW.A && dW.A.locals && dW.A.locals;
        var pW, fW, mW, gW = function(e, t, n, i) {
            return new (n || (n = Promise))((function(r, a) {
                function s(e) {
                    try {
                        l(i.next(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function o(e) {
                    try {
                        l(i.throw(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(e) {
                    var t;
                    e.done ? r(e.value) : (t = e.value,
                    t instanceof n ? t : new n((function(e) {
                        e(t)
                    }
                    ))).then(s, o)
                }
                l((i = i.apply(e, t || [])).next())
            }
            ))
        }, vW = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, wW = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        pW = new WeakMap,
        fW = new WeakMap,
        mW = new WeakMap;
        const yW = class {
            constructor(e, t, n, i, r, a) {
                pW.set(this, void 0),
                fW.set(this, void 0),
                mW.set(this, void 0);
                const s = (0,
                wA.sha256)(r)
                  , o = document.getElementById("ui");
                if (null == o)
                    throw new Error("UI element not found");
                vW(this, pW, o, "f"),
                vW(this, fW, document.createElement("div"), "f"),
                wW(this, fW, "f").className = "admin-ui",
                wW(this, pW, "f").appendChild(wW(this, fW, "f"));
                const l = document.createElement("div");
                l.className = "tracks-list",
                wW(this, fW, "f").appendChild(l);
                let c = null
                  , h = 1;
                function d(n, a) {
                    return gW(this, void 0, void 0, (function*() {
                        c = n,
                        h = a,
                        g.value = a.toString(),
                        p.innerHTML = "";
                        const o = document.createElement("tr");
                        p.appendChild(o);
                        const l = document.createElement("th");
                        l.textContent = "Name",
                        o.appendChild(l);
                        const u = document.createElement("th");
                        u.textContent = "Frames",
                        o.appendChild(u);
                        const f = document.createElement("th");
                        f.textContent = "",
                        o.appendChild(f);
                        let v = [];
                        if (null != n)
                            try {
                                v = (yield i.getLeaderboard(s, n, 20 * (a - 1), 20, !1)).entries
                            } catch (e) {}
                        for (let s = 0; s < 20; s++) {
                            const o = document.createElement("tr");
                            if (p.appendChild(o),
                            v.length > s) {
                                const l = v[s]
                                  , c = document.createElement("td");
                                c.textContent = l.name,
                                o.appendChild(c);
                                const h = document.createElement("td");
                                h.textContent = l.time.numberOfFrames.toString(),
                                o.appendChild(h);
                                const u = document.createElement("td");
                                u.textContent = "",
                                o.appendChild(u)
                            } else
                                o.appendChild(document.createElement("td")),
                                o.appendChild(document.createElement("td"))
                        }
                    }
                    ))
                }
                n.forEachTrack(( (t, n) => {
                    const i = document.createElement("button");
                    i.className = "button",
                    i.textContent = n.name,
                    i.addEventListener("click", ( () => {
                        e.playUIClick(),
                        d(t, 1)
                    }
                    )),
                    l.appendChild(i)
                }
                ));
                const u = document.createElement("div");
                u.className = "leaderboard-container",
                wW(this, fW, "f").appendChild(u);
                const p = document.createElement("table");
                u.appendChild(p);
                const f = document.createElement("div");
                f.className = "navigation",
                u.appendChild(f);
                const m = document.createElement("button");
                m.className = "button",
                m.textContent = "<",
                m.addEventListener("click", ( () => {
                    e.playUIClick(),
                    null != c && d(c, Math.max(1, h - 1))
                }
                )),
                f.appendChild(m);
                const g = document.createElement("input");
                g.type = "text",
                g.min = "1",
                g.value = "1",
                g.addEventListener("change", ( () => {
                    const e = parseInt(g.value, 10);
                    null != c && Number.isSafeInteger(e) && e >= 1 && d(c, e)
                }
                )),
                f.appendChild(g);
                const v = document.createElement("button");
                v.className = "button",
                v.textContent = ">",
                v.addEventListener("click", ( () => {
                    e.playUIClick(),
                    null != c && d(c, h + 1)
                }
                )),
                f.appendChild(v),
                d(null, 1);
                const w = document.createElement("button");
                w.className = "button",
                w.textContent = "Quit",
                w.addEventListener("click", ( () => {
                    e.playUIClick(),
                    a()
                }
                )),
                wW(this, fW, "f").appendChild(w),
                window.addEventListener("keydown", vW(this, mW, (e => {
                    "Escape" == e.code && (a(),
                    e.preventDefault())
                }
                ), "f"))
            }
            dispose() {
                wW(this, pW, "f").removeChild(wW(this, fW, "f")),
                window.removeEventListener("keydown", wW(this, mW, "f"))
            }
        }
        ;
        var bW, AW, xW, kW, EW = function(e, t, n, i, r) {
            if ("m" === i)
                throw new TypeError("Private method is not writable");
            if ("a" === i && !r)
                throw new TypeError("Private accessor was defined without a setter");
            if ("function" == typeof t ? e !== t || !r : !t.has(e))
                throw new TypeError("Cannot write private member to an object whose class did not declare it");
            return "a" === i ? r.call(e, n) : r ? r.value = n : t.set(e, n),
            n
        }, SW = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        bW = new WeakMap,
        AW = new WeakMap,
        xW = new WeakMap,
        kW = new WeakMap;
        const MW = class {
            constructor(e, t, n, i, r, a, s, o) {
                bW.set(this, void 0),
                AW.set(this, void 0),
                xW.set(this, void 0),
                kW.set(this, void 0),
                EW(this, bW, e, "f"),
                EW(this, AW, t, "f"),
                EW(this, xW, i, "f"),
                EW(this, kW, new yW(e,n,r,a,s,o), "f")
            }
            dispose() {
                SW(this, kW, "f").dispose()
            }
            update(e) {
                SW(this, bW, "f").update(e, !1, SW(this, AW, "f"), SW(this, xW, "f"))
            }
        }
        ;
        var _W, TW, CW = function(e, t, n, i) {
            if ("a" === n && !i)
                throw new TypeError("Private accessor was defined without a getter");
            if ("function" == typeof t ? e !== t || !i : !t.has(e))
                throw new TypeError("Cannot read private member from an object whose class did not declare it");
            return "m" === n ? i : "a" === n ? i.call(e) : i ? i.value : t.get(e)
        };
        new WeakMap,
        _W = new WeakMap,
        TW = new WeakMap,
        new WeakSet;
        /**
 * @license
 * Copyright 2025 Kodub.com
 */
        var PW = function(e, t, n, i) {
            return new (n || (n = Promise))((function(r, a) {
                function s(e) {
                    try {
                        l(i.next(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function o(e) {
                    try {
                        l(i.throw(e))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(e) {
                    var t;
                    e.done ? r(e.value) : (t = e.value,
                    t instanceof n ? t : new n((function(e) {
                        e(t)
                    }
                    ))).then(s, o)
                }
                l((i = i.apply(e, t || [])).next())
            }
            ))
        };
        rn.enabled = !1,
        function() {
            PW(this, void 0, void 0, (function*() {
                yield function() {
                    return Fb(this, void 0, void 0, (function*() {
                        const e = Uint8Array.from(atob(" "), (e => e.charCodeAt(0)))
                          , t = yield WebAssembly.compile(e)
                          , n = (yield WebAssembly.instantiate(t)).exports;
                        Math = {
                            E: Wb,
                            LN10: Hb,
                            LN2: Vb,
                            LOG2E: Gb,
                            LOG10E: jb,
                            PI: Qb,
                            SQRT1_2: Kb,
                            SQRT2: qb,
                            abs: Math.abs,
                            acos: n.acos,
                            asin: n.asin,
                            atan: n.atan,
                            atan2: n.atan2,
                            ceil: Math.ceil,
                            cos: Jb,
                            exp: n.exp,
                            floor: Math.floor,
                            log: n.log,
                            max: Math.max,
                            min: Math.min,
                            pow: n.pow,
                            random: Math.random,
                            round: Math.round,
                            sin: Zb,
                            sqrt: n.sqrt,
                            tan: n.tan,
                            clz32: () => Xb("clz32"),
                            imul: () => Xb("imul"),
                            sign: Math.sign,
                            log10: n.log10,
                            log2: n.log2,
                            log1p: () => Xb("log1p"),
                            expm1: () => Xb("expm1"),
                            cosh: () => Xb("cosh"),
                            sinh: () => Xb("sinh"),
                            tanh: () => Xb("tanh"),
                            acosh: () => Xb("acosh"),
                            asinh: () => Xb("asinh"),
                            atanh: () => Xb("atanh"),
                            hypot: () => Xb("hypot"),
                            trunc: Math.trunc,
                            cbrt: () => Xb("cbrt"),
                            fround: Math.fround,
                            [Symbol.toStringTag]: "Math"
                        }
                    }
                    ))
                }();
                const e = new DU;
                yield e.initialize(),
                e.migrate();
                const t = new uB;
                t.addResource(),
                VP().then(( () => {
                    t.loadedResource()
                }
                )),
                t.addCompleteListener(( () => {
                    qP()
                }
                ));
                const n = i(7780);
                for (const e of n.keys())
                    t.preloadImage("images/" + e.substring(2));
                const r = new nU
                  , a = new KU
                  , s = new gl(t);
                s.load("music", ["audio/music.ogg", "audio/music.mp3"]),
                s.load("click", ["audio/click.ogg", "audio/click.mp3"]),
                s.load("engine", ["audio/engine.ogg", "audio/engine.mp3"]),
                s.load("suspension", ["audio/suspension.ogg", "audio/suspension.mp3"]),
                s.load("tires", ["audio/tires.ogg", "audio/tires.mp3"]),
                s.load("collision", ["audio/collision.ogg", "audio/collision.mp3"]),
                s.load("skidding", ["audio/skidding.ogg", "audio/skidding.mp3"]),
                s.load("editor_edit", ["audio/editor_edit.ogg", "audio/editor_edit.mp3"]),
                s.load("checkpoint", ["audio/checkpoint.ogg", "audio/checkpoint.mp3"]),
                s.load("finish", ["audio/checkpoint.ogg", "audio/checkpoint.mp3"]),
                s.load("position_tick", ["audio/position_tick.ogg", "audio/position_tick.mp3"]),
                Sp.initResources(t),
                Ox.initResources(t);
                const o = new az(e)
                  , l = document.getElementById("screen")
                  , c = new Qu(l,o)
                  , h = new YB
                  , d = h.init(c, t)
                  , u = new vz(!0,h,t)
                  , p = new vz(!1,h,t)
                  , f = u.testDeterminism();
                t.addResource(),
                t.addResource(),
                t.addResource(),
                Qw.initResources().then((e => {
                    t.loadedResource(),
                    d.then((n => {
                        t.loadedResource(),
                        f.then((i => {
                            v.determinismState = i ? n && e ? HT.Ok : HT.AssetsFailed : HT.TestFailed,
                            t.loadedResource()
                        }
                        ))
                    }
                    ))
                }
                ));
                const m = new UO(o.getSetting(el.Language))
                  , g = new AD(e)
                  , v = new ZU;
                g.syncUserProfile(v);
                const w = new EB(e,v,g)
                  , y = new cU(c,o,t)
                  , b = new FR(c)
                  , A = new Px(c,o,h)
                  , x = new zB(t,e)
                  , k = new dA
                  , E = new aB(s)
                  , S = new hW
                  , M = n => {
                    r.trigger(( () => {
                        jP(),
                        QP(),
                        L.dispose(),
                        L = new WN(u,A,b,y,x,m,E,g,w,c,s,e,o,v,t,n,_,T,C,P,I,R),
                        KP()
                    }
                    ))
                }
                  , _ = () => {
                    r.trigger(( () => {
                        jP(),
                        QP(),
                        L.dispose(),
                        L = new Ob(m,A,b,y,c,s,g,o,v,E,( () => {
                            M(!1)
                        }
                        )),
                        KP()
                    }
                    ))
                }
                  , T = () => {
                    r.trigger(( () => {
                        QP(),
                        L.dispose();
                        const n = L = new R_(A,h,e,b,y,m,s,c,o,r,g,w,x,E,S,( () => {
                            jP(),
                            QP(),
                            L.dispose(),
                            L = new WN(u,A,b,y,x,m,E,g,w,c,s,e,o,v,t,!1,_,T,C,P,I,R),
                            KP()
                        }
                        ),( (e, t, i) => {
                            const r = L = new yR(u,p,A,b,y,m,c,s,g,o,a,E,S,e,t,"custom",[],null,null,( () => Promise.resolve(null)),( () => {
                                GP(),
                                r.dispose(!1),
                                L = n,
                                i()
                            }
                            ),null)
                        }
                        ));
                        return KP(),
                        n.isPaused = !0,
                        YP(( () => {
                            s.isAdPlaying = !0
                        }
                        ), "start-editor").finally(( () => {
                            GP(),
                            s.isAdPlaying = !1,
                            n.isPaused = !1
                        }
                        ))
                    }
                    ))
                }
                  , C = (e, t, n, i, l=null) => {
                    r.trigger(( () => {
                        QP(),
                        L.dispose();
                        const r = g.profileSlot
                          , h = w.getRecordTime(r, t.getId())
                          , d = L = new yR(u,p,A,b,y,m,c,s,g,o,a,E,S,e,t,n,i,h,l,( (e, t, i) => {
                            if (null != e) {
                                const a = w.getRecordTime(r, e);
                                if (null == a || i.lessThan(a)) {
                                    const a = "official" == n || "community" == n ? !0 : null;
                                    return w.setRecord(r, e, a, i, t)
                                }
                            }
                            return Promise.resolve(null)
                        }
                        ),( () => {
                            M(!0)
                        }
                        ),P);
                        return KP(),
                        d.isPaused = !0,
                        YP(( () => {
                            s.isAdPlaying = !0
                        }
                        ), "start-game").finally(( () => {
                            s.isAdPlaying = !1,
                            d.isPaused = !1
                        }
                        ))
                    }
                    ))
                }
                  , P = (e, t, n, i) => {
                    r.trigger(( () => {
                        QP(),
                        L.dispose(),
                        L = new aW(p,A,e,t,n,b,y,c,s,m,o,i,C),
                        KP(),
                        GP()
                    }
                    ))
                }
                  , I = e => {
                    r.trigger(( () => {
                        QP(),
                        L.dispose(),
                        L = new fO(s,c,v,x,h,o,t,e,( () => {
                            M(!1)
                        }
                        )),
                        KP(),
                        GP()
                    }
                    ))
                }
                  , R = e => {
                    r.trigger(( () => {
                        QP(),
                        L.dispose(),
                        L = new MW(s,c,E,o,x,v,e,( () => {
                            M(!1)
                        }
                        )),
                        KP(),
                        GP()
                    }
                    ))
                }
                ;
                let L = new WN(u,A,b,y,x,m,E,g,w,c,s,e,o,v,t,!1,_,T,C,P,I,R)
                  , D = 0;
                c.setAnimationLoop((function(e) {
                    const t = Math.max(e - D, 0) / 1e3;
                    D = e,
                    L.update(t),
                    k.update(t)
                }
                )),
                window.addEventListener("keyup", (e => {
                    o.checkKeyBinding(e, gk.ToggleFpsCounter) && k.toggle()
                }
                ))
            }
            ))
        }()
    }
    )()
}
)();
