/**
 * @license
 * lodash 3.10.1 (Custom Build) <https://lodash.com/>
 * Build: `lodash compat exports="amd" -d -o /rdisks/sf-netapp01-jenkinbuild/workspace/SkateboardPlatform-MessageBus-mainline/target/checkout/target/messagebus/lodash.js include="main,after,arraySome,debounce,createForEach,arrayEach,baseEach,baseAssign,arrayFilter,isEqual,keys,arrayMap,throttle,root,isObject,now,bindCallback,isArray,baseForOwn,createBaseEach,baseCopy,baseIsEqual,getNative,isArrayLike,shimKeys,each,extend,bind,reduce,defaults,map,any,filter,find,contains,clone,without,cloneDeep,isPlainObject"`
 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 * Available under MIT license <https://lodash.com/license>
 */

/*!
 *
 * Copyright 2009-2012 Kris Kowal under the terms of the MIT
 * license found at http://github.com/kriskowal/q/raw/master/LICENSE
 *
 * With parts by Tyler Close
 * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found
 * at http://www.opensource.org/licenses/mit-license.html
 * Forked at ref_send.js version: 2009-05-11
 *
 * With parts by Mark Miller
 * Copyright (C) 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

//     Underscore.js 1.8.3
//     http://underscorejs.org
//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
//     Underscore may be freely distributed under the MIT license.

/**
 * riveter - Mix-in, inheritance and constructor extend behavior for your JavaScript enjoyment.
 * © 2012 - Copyright appendTo, LLC 
 * Author(s): Jim Cowart, Nicholas Cloud, Doug Neiner
 * Version: v0.1.2
 * Url: https://github.com/a2labs/riveter
 * License(s): MIT
 */

/**
 * Fast UUID generator, RFC4122 version 4 compliant.
 * @author Jeff Ward (jcward.com).
 * @license MIT license
 * @link http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136
 **/

/*!
 * pixi.js - v4.8.5
 * Compiled Mon, 07 Jan 2019 15:50:28 UTC
 *
 * pixi.js is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */

/*
     object-assign
     (c) Sindre Sorhus
     @license MIT
     */

// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

/*! https://mths.be/punycode v1.4.1 by @mathias */

/**
 * The height of the top row (c)
 *
 * @member {number}
 * @memberof PIXI.NineSlicePlane#
 * @override
 */

/*!
 * @license SoundJS
 * Visit http://createjs.com/ for documentation, updates and examples.
 *
 * Copyright (c) 2011-2015 gskinner.com, inc.
 *
 * Distributed under the terms of the MIT license.
 * http://www.opensource.org/licenses/mit-license.html
 *
 * This notice shall be included in all copies or substantial portions of the Software.
 */

/*!
 * VERSION: 1.20.1
 * DATE: 2017-06-29
 * UPDATES AND DOCS AT: http://greensock.com
 * 
 * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
 *
 * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
 * This work is subject to the terms at http://greensock.com/standard-license or for
 * Club GreenSock members, the software agreement that was issued with your membership.
 * 
 * @author: Jack Doyle, jack@greensock.com
 **/

/*!
 * VERSION: 1.20.1
 * DATE: 2017-06-29
 * UPDATES AND DOCS AT: http://greensock.com
 *
 * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
 * This work is subject to the terms at http://greensock.com/standard-license or for
 * Club GreenSock members, the software agreement that was issued with your membership.
 * 
 * @author: Jack Doyle, jack@greensock.com
 */

/*!
 * VERSION: 0.1.2
 * DATE: 2017-06-29
 * UPDATES AND DOCS AT: http://greensock.com
 *
 * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
 * PixiPlugin is subject to the terms at http://greensock.com/standard-license or for
 * Club GreenSock members, the software agreement that was issued with your membership.
 *
 * @author: Jack Doyle, jack@greensock.com
 */

! function() {
    define("skbJet/component/utils/Map", [], function() {
            function e() {
                var e = {};
                this.clear = function() {
                    for (var t in e) delete e[t]
                }, this.set = function(t, i) {
                    e[t] = i
                }, this.get = function(t) {
                    return e[t]
                }, this.delete = function(t) {
                    delete e[t]
                }, this.keys = function() {
                    var t = [];
                    for (var i in e) t.push(i);
                    return t
                }, this.size = function() {
                    return this.keys().length
                }
            }
            return window.Map ? window.Map : (window.Map = e, e)
        }), define("skbJet/component/gameMsgBus/GameMsgBus", ["skbJet/component/utils/Map"], function(e) {
            function t(e) {
                setTimeout(function() {
                    o.publish("error", {
                        errorCode: "GM-003",
                        message: "" + e
                    })
                }, 3)
            }

            function i(e, t) {
                setTimeout(function() {
                    t(e)
                }, 0)
            }

            function r(e, t, i) {
                setTimeout(function() {
                    s[e](t, i)
                }, 0)
            }
            var n = new e,
                o = {},
                s = [];
            return o.subscribe = function(e, t) {
                if (!e) return o;
                if (!t) return o;
                var i = n.get(e);
                return i || (i = [], n.set(e, i)), i.indexOf(t) < 0 && i.push(t), o
            }, o.unsubscribe = function(e, t) {
                var i = n.get(e);
                if (i) {
                    var r = i.indexOf(t);
                    r >= 0 && i.splice(r, 1)
                }
                return o
            }, o.publish = function(e, a, l) {
                var u = n.get(e);
                if (!u) return o;
                for (var c = 0; c < s.length; c++) r(c, e, a);
                for (c = 0; c < u.length; c++) try {
                    l ? i(a, u[c]) : u[c](a)
                } catch (e) {
                    t(e)
                }
                return o
            }, o.addWireTap = function(e) {
                "function" == typeof e && s.push(e)
            }, o.removeWireTap = function(e) {
                s.splice(s.indexOf(e), 1)
            }, o
        }),
        function() {
            function e(e, t, i) {
                for (var r = e.length, n = i ? r : -1; i ? n-- : ++n < r;)
                    if (t(e[n], n, e)) return n;
                return -1
            }

            function t(e, t, i) {
                if (t !== t) return r(e, i);
                for (var n = i - 1, o = e.length; ++n < o;)
                    if (e[n] === t) return n;
                return -1
            }

            function i(e) {
                return null == e ? "" : e + ""
            }

            function r(e, t, i) {
                for (var r = e.length, n = t + (i ? 0 : -1); i ? n-- : ++n < r;) {
                    var o = e[n];
                    if (o !== o) return n
                }
                return -1
            }

            function n(e) {
                return !!e && "object" == typeof e
            }

            function o(e, t) {
                for (var i = -1, r = e.length, n = -1, o = []; ++i < r;) e[i] === t && (e[i] = It, o[++n] = i);
                return o
            }

            function s(e) {
                if (n(e) && !lr(e) && !(e instanceof u)) {
                    if (e instanceof l) return e;
                    if (Ti.call(e, "__chain__") && Ti.call(e, "__wrapped__")) return De(e)
                }
                return new l(e)
            }

            function a() {}

            function l(e, t, i) {
                this.__wrapped__ = e, this.__actions__ = i || [], this.__chain__ = !!t
            }

            function u(e) {
                this.__wrapped__ = e, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = ki, this.__views__ = []
            }

            function c() {
                var e = new u(this.__wrapped__);
                return e.__actions__ = g(this.__actions__), e.__dir__ = this.__dir__, e.__filtered__ = this.__filtered__, e.__iteratees__ = g(this.__iteratees__), e.__takeCount__ = this.__takeCount__, e.__views__ = g(this.__views__), e
            }

            function h() {
                if (this.__filtered__) {
                    var e = new u(this);
                    e.__dir__ = -1, e.__filtered__ = !0
                } else e = this.clone(), e.__dir__ *= -1;
                return e
            }

            function d() {
                var e = this.__wrapped__.value(),
                    t = this.__dir__,
                    i = lr(e),
                    r = t < 0,
                    n = i ? e.length : 0,
                    o = ge(0, n, this.__views__),
                    s = o.start,
                    a = o.end,
                    l = a - s,
                    u = r ? a : s - 1,
                    c = this.__iteratees__,
                    h = c.length,
                    d = 0,
                    p = Ni(l, this.__takeCount__);
                if (!i || n < Mt || n == l && p == l) return Q(e, this.__actions__);
                var f = [];
                e: for (; l-- && d < p;) {
                    u += t;
                    for (var _ = -1, m = e[u]; ++_ < h;) {
                        var g = c[_],
                            v = g.iteratee,
                            y = g.type,
                            b = v(m);
                        if (y == Ot) m = b;
                        else if (!b) {
                            if (y == Rt) continue e;
                            break e
                        }
                    }
                    f[d++] = m
                }
                return f
            }

            function p(e) {
                var t = e ? e.length : 0;
                for (this.data = {
                        hash: wi(null),
                        set: new Ci
                    }; t--;) this.push(e[t])
            }

            function f(e, t) {
                var i = e.data;
                return ("string" == typeof t || nt(t) ? i.set.has(t) : i.hash[t]) ? 0 : -1
            }

            function _(e) {
                var t = this.data;
                "string" == typeof e || nt(e) ? t.set.add(e) : t.hash[e] = !0
            }

            function m(e, t) {
                for (var i = -1, r = e.length, n = -1, o = t.length, s = Array(r + o); ++i < r;) s[i] = e[i];
                for (; ++n < o;) s[i++] = t[n];
                return s
            }

            function g(e, t) {
                var i = -1,
                    r = e.length;
                for (t || (t = Array(r)); ++i < r;) t[i] = e[i];
                return t
            }

            function v(e, t) {
                for (var i = -1, r = e.length; ++i < r && !1 !== t(e[i], i, e););
                return e
            }

            function y(e, t) {
                for (var i = -1, r = e.length, n = -1, o = []; ++i < r;) {
                    var s = e[i];
                    t(s, i, e) && (o[++n] = s)
                }
                return o
            }

            function b(e, t) {
                for (var i = -1, r = e.length, n = Array(r); ++i < r;) n[i] = t(e[i], i, e);
                return n
            }

            function x(e, t) {
                for (var i = -1, r = t.length, n = e.length; ++i < r;) e[n + i] = t[i];
                return e
            }

            function T(e, t, i, r) {
                var n = -1,
                    o = e.length;
                for (r && o && (i = e[++n]); ++n < o;) i = t(i, e[n], n, e);
                return i
            }

            function E(e, t) {
                for (var i = -1, r = e.length; ++i < r;)
                    if (t(e[i], i, e)) return !0;
                return !1
            }

            function S(e, t) {
                return e === vt ? t : e
            }

            function P(e, t, i) {
                for (var r = -1, n = hr(t), o = n.length; ++r < o;) {
                    var s = n[r],
                        a = e[s],
                        l = i(a, t[s], s, e, t);
                    (l === l ? l === a : a !== a) && (a !== vt || s in e) || (e[s] = l)
                }
                return e
            }

            function A(e, t) {
                return null == t ? e : C(t, hr(t), e)
            }

            function C(e, t, i) {
                i || (i = {});
                for (var r = -1, n = t.length; ++r < n;) {
                    var o = t[r];
                    i[o] = e[o]
                }
                return i
            }

            function M(e, t, i) {
                var r = typeof e;
                return "function" == r ? t === vt ? e : $(e, t, i) : null == e ? pt : "object" == r ? z(e) : t === vt ? gt(e) : j(e, t)
            }

            function R(e, t, i, r, n, o, s) {
                var a;
                if (i && (a = n ? i(e, r, n) : i(e)), a !== vt) return a;
                if (!nt(e)) return e;
                var l = lr(e);
                if (l) {
                    if (a = ve(e), !t) return g(e, a)
                } else {
                    var u = Ei.call(e),
                        c = u == Vt;
                    if (u != Ut && u != Dt && (!c || n)) return li[u] ? be(e, u, t) : n ? e : {};
                    if (mi(e)) return n ? e : {};
                    if (a = ye(c ? {} : e), !t) return A(a, e)
                }
                o || (o = []), s || (s = []);
                for (var h = o.length; h--;)
                    if (o[h] == e) return s[h];
                return o.push(e), s.push(a), (l ? v : B)(e, function(r, n) {
                    a[n] = R(r, t, i, n, e, o, s)
                }), a
            }

            function O(e, i) {
                var r = e ? e.length : 0,
                    n = [];
                if (!r) return n;
                var o = -1,
                    s = fe(),
                    a = s === t,
                    l = a && i.length >= Mt ? ne(i) : null,
                    u = i.length;
                l && (s = f, a = !1, i = l);
                e: for (; ++o < r;) {
                    var c = e[o];
                    if (a && c === c) {
                        for (var h = u; h--;)
                            if (i[h] === c) continue e;
                        n.push(c)
                    } else s(i, c, 0) < 0 && n.push(c)
                }
                return n
            }

            function w(e, t) {
                var i = [];
                return Ki(e, function(e, r, n) {
                    t(e, r, n) && i.push(e)
                }), i
            }

            function I(e, t, i, r) {
                var n;
                return i(e, function(e, i, o) {
                    if (t(e, i, o)) return n = r ? i : e, !1
                }), n
            }

            function D(e, t, i, r) {
                r || (r = []);
                for (var o = -1, s = e.length; ++o < s;) {
                    var a = e[o];
                    n(a) && xe(a) && (i || lr(a) || tt(a)) ? t ? D(a, t, i, r) : x(r, a) : i || (r[r.length] = a)
                }
                return r
            }

            function L(e, t) {
                return Qi(e, t, ut)
            }

            function B(e, t) {
                return Qi(e, t, hr)
            }

            function F(e, t) {
                for (var i = -1, r = t.length, n = -1, o = []; ++i < r;) {
                    var s = t[i];
                    rt(e[s]) && (o[++n] = s)
                }
                return o
            }

            function N(e, t, i) {
                if (null != e) {
                    e = we(e), i !== vt && i in e && (t = [i]);
                    for (var r = 0, n = t.length; null != e && r < n;) e = we(e)[t[r++]];
                    return r && r == n ? e : vt
                }
            }

            function V(e, t, i, r, o, s) {
                return e === t || (null == e || null == t || !nt(e) && !n(t) ? e !== e && t !== t : k(e, t, V, i, r, o, s))
            }

            function k(e, t, i, r, n, o, s) {
                var a = lr(e),
                    l = lr(t),
                    u = Lt,
                    c = Lt;
                a || (u = Ei.call(e), u == Dt ? u = Ut : u != Ut && (a = lt(e))), l || (c = Ei.call(t), c == Dt ? c = Ut : c != Ut && (l = lt(t)));
                var h = u == Ut && !mi(e),
                    d = c == Ut && !mi(t),
                    p = u == c;
                if (p && !a && !h) return ce(e, t, u);
                if (!n) {
                    var f = h && Ti.call(e, "__wrapped__"),
                        _ = d && Ti.call(t, "__wrapped__");
                    if (f || _) return i(f ? e.value() : e, _ ? t.value() : t, r, n, o, s)
                }
                if (!p) return !1;
                o || (o = []), s || (s = []);
                for (var m = o.length; m--;)
                    if (o[m] == e) return s[m] == t;
                o.push(e), s.push(t);
                var g = (a ? ue : he)(e, t, i, r, n, o, s);
                return o.pop(), s.pop(), g
            }

            function U(e, t, i) {
                var r = t.length,
                    n = r,
                    o = !i;
                if (null == e) return !n;
                for (e = we(e); r--;) {
                    var s = t[r];
                    if (o && s[2] ? s[1] !== e[s[0]] : !(s[0] in e)) return !1
                }
                for (; ++r < n;) {
                    s = t[r];
                    var a = s[0],
                        l = e[a],
                        u = s[1];
                    if (o && s[2]) {
                        if (l === vt && !(a in e)) return !1
                    } else {
                        var c = i ? i(l, u, a) : vt;
                        if (!(c === vt ? V(u, l, i, !0) : c)) return !1
                    }
                }
                return !0
            }

            function G(e, t) {
                var i = -1,
                    r = xe(e) ? Array(e.length) : [];
                return Ki(e, function(e, n, o) {
                    r[++i] = t(e, n, o)
                }), r
            }

            function z(e) {
                var t = _e(e);
                if (1 == t.length && t[0][2]) {
                    var i = t[0][0],
                        r = t[0][1];
                    return function(e) {
                        return null != e && (e = we(e), e[i] === r && (r !== vt || i in e))
                    }
                }
                return function(e) {
                    return U(e, t)
                }
            }

            function j(e, t) {
                var i = lr(e),
                    r = Se(e) && Ce(t),
                    n = e + "";
                return e = Ie(e),
                    function(o) {
                        if (null == o) return !1;
                        var s = n;
                        if (o = we(o), (i || !r) && !(s in o)) {
                            if (null == (o = 1 == e.length ? o : N(o, Y(e, 0, -1)))) return !1;
                            s = Be(e), o = we(o)
                        }
                        return o[s] === t ? t !== vt || s in o : V(t, o[s], vt, !0)
                    }
            }

            function H(e) {
                return function(t) {
                    return null == t ? vt : we(t)[e]
                }
            }

            function W(e) {
                var t = e + "";
                return e = Ie(e),
                    function(i) {
                        return N(i, e, t)
                    }
            }

            function X(e, t, i, r, n) {
                return n(e, function(e, n, o) {
                    i = r ? (r = !1, e) : t(i, e, n, o)
                }), i
            }

            function Y(e, t, i) {
                var r = -1,
                    n = e.length;
                t = null == t ? 0 : +t || 0, t < 0 && (t = -t > n ? 0 : n + t), i = i === vt || i > n ? n : +i || 0, i < 0 && (i += n), n = t > i ? 0 : i - t >>> 0, t >>>= 0;
                for (var o = Array(n); ++r < n;) o[r] = e[r + t];
                return o
            }

            function q(e, t) {
                var i;
                return Ki(e, function(e, r, n) {
                    return !(i = t(e, r, n))
                }), !!i
            }

            function K(e, t) {
                for (var i = -1, r = t.length, n = Array(r); ++i < r;) n[i] = e[t[i]];
                return n
            }

            function Q(e, t) {
                var i = e;
                i instanceof u && (i = i.value());
                for (var r = -1, n = t.length; ++r < n;) {
                    var o = t[r];
                    i = o.func.apply(o.thisArg, x([i], o.args))
                }
                return i
            }

            function Z(e, t, i) {
                var r = 0,
                    n = e ? e.length : r;
                if ("number" == typeof t && t === t && n <= Gi) {
                    for (; r < n;) {
                        var o = r + n >>> 1,
                            s = e[o];
                        (i ? s <= t : s < t) && null !== s ? r = o + 1 : n = o
                    }
                    return n
                }
                return J(e, t, pt, i)
            }

            function J(e, t, i, r) {
                t = i(t);
                for (var n = 0, o = e ? e.length : 0, s = t !== t, a = null === t, l = t === vt; n < o;) {
                    var u = Ii((n + o) / 2),
                        c = i(e[u]),
                        h = c !== vt,
                        d = c === c;
                    if (s) var p = d || r;
                    else p = a ? d && h && (r || null != c) : l ? d && (r || h) : null != c && (r ? c <= t : c < t);
                    p ? n = u + 1 : o = u
                }
                return Ni(o, Ui)
            }

            function $(e, t, i) {
                if ("function" != typeof e) return pt;
                if (t === vt) return e;
                switch (i) {
                    case 1:
                        return function(i) {
                            return e.call(t, i)
                        };
                    case 3:
                        return function(i, r, n) {
                            return e.call(t, i, r, n)
                        };
                    case 4:
                        return function(i, r, n, o) {
                            return e.call(t, i, r, n, o)
                        };
                    case 5:
                        return function(i, r, n, o, s) {
                            return e.call(t, i, r, n, o, s)
                        }
                }
                return function() {
                    return e.apply(t, arguments)
                }
            }

            function ee(e) {
                var t = new Pi(e.byteLength);
                return new Ri(t).set(new Ri(e)), t
            }

            function te(e, t, i) {
                for (var r = i.length, n = -1, o = Fi(e.length - r, 0), s = -1, a = t.length, l = Array(a + o); ++s < a;) l[s] = t[s];
                for (; ++n < r;) l[i[n]] = e[n];
                for (; o--;) l[s++] = e[n++];
                return l
            }

            function ie(e, t, i) {
                for (var r = -1, n = i.length, o = -1, s = Fi(e.length - n, 0), a = -1, l = t.length, u = Array(s + l); ++o < s;) u[o] = e[o];
                for (var c = o; ++a < l;) u[c + a] = t[a];
                for (; ++r < n;) u[c + i[r]] = e[o++];
                return u
            }

            function re(e, t) {
                function i() {
                    return (this && this !== _i && this instanceof i ? r : e).apply(t, arguments)
                }
                var r = oe(e);
                return i
            }

            function ne(e) {
                return wi && Ci ? new p(e) : null
            }

            function oe(e) {
                return function() {
                    var t = arguments;
                    switch (t.length) {
                        case 0:
                            return new e;
                        case 1:
                            return new e(t[0]);
                        case 2:
                            return new e(t[0], t[1]);
                        case 3:
                            return new e(t[0], t[1], t[2]);
                        case 4:
                            return new e(t[0], t[1], t[2], t[3]);
                        case 5:
                            return new e(t[0], t[1], t[2], t[3], t[4]);
                        case 6:
                            return new e(t[0], t[1], t[2], t[3], t[4], t[5]);
                        case 7:
                            return new e(t[0], t[1], t[2], t[3], t[4], t[5], t[6])
                    }
                    var i = qi(e.prototype),
                        r = e.apply(i, t);
                    return nt(r) ? r : i
                }
            }

            function se(e, t, i, r, n, s, a, l, u, c) {
                function h() {
                    for (var b = arguments.length, x = b, T = Array(b); x--;) T[x] = arguments[x];
                    if (r && (T = te(T, r, n)), s && (T = ie(T, s, a)), _ || v) {
                        var E = h.placeholder,
                            S = o(T, E);
                        if ((b -= S.length) < c) {
                            var P = l ? g(l) : vt,
                                A = Fi(c - b, 0),
                                C = _ ? S : vt,
                                M = _ ? vt : S,
                                R = _ ? T : vt,
                                O = _ ? vt : T;
                            t |= _ ? St : Pt, t &= ~(_ ? Pt : St), m || (t &= ~(yt | bt));
                            var w = [e, t, i, R, C, O, M, P, u, A],
                                I = se.apply(vt, w);
                            return Pe(e) && er(I, w), I.placeholder = E, I
                        }
                    }
                    var D = p ? i : this,
                        L = f ? D[e] : e;
                    return l && (T = Re(T, l)), d && u < T.length && (T.length = u), this && this !== _i && this instanceof h && (L = y || oe(e)), L.apply(D, T)
                }
                var d = t & At,
                    p = t & yt,
                    f = t & bt,
                    _ = t & Tt,
                    m = t & xt,
                    v = t & Et,
                    y = f ? vt : oe(e);
                return h
            }

            function ae(e, t, i, r) {
                function n() {
                    for (var t = -1, a = arguments.length, l = -1, u = r.length, c = Array(u + a); ++l < u;) c[l] = r[l];
                    for (; a--;) c[l++] = arguments[++t];
                    return (this && this !== _i && this instanceof n ? s : e).apply(o ? i : this, c)
                }
                var o = t & yt,
                    s = oe(e);
                return n
            }

            function le(e, t, i, r, n, o, s, a) {
                var l = t & bt;
                if (!l && "function" != typeof e) throw new TypeError(wt);
                var u = r ? r.length : 0;
                if (u || (t &= ~(St | Pt), r = n = vt), u -= n ? n.length : 0, t & Pt) {
                    var c = r,
                        h = n;
                    r = n = vt
                }
                var d = l ? vt : Ji(e),
                    p = [e, t, i, r, n, c, h, o, s, a];
                if (d && (Me(p, d), t = p[1], a = p[9]), p[9] = null == a ? l ? 0 : e.length : Fi(a - u, 0) || 0, t == yt) var f = re(p[0], p[2]);
                else f = t != St && t != (yt | St) || p[4].length ? se.apply(vt, p) : ae.apply(vt, p);
                return (d ? Zi : er)(f, p)
            }

            function ue(e, t, i, r, n, o, s) {
                var a = -1,
                    l = e.length,
                    u = t.length;
                if (l != u && !(n && u > l)) return !1;
                for (; ++a < l;) {
                    var c = e[a],
                        h = t[a],
                        d = r ? r(n ? h : c, n ? c : h, a) : vt;
                    if (d !== vt) {
                        if (d) continue;
                        return !1
                    }
                    if (n) {
                        if (!E(t, function(e) {
                                return c === e || i(c, e, r, n, o, s)
                            })) return !1
                    } else if (c !== h && !i(c, h, r, n, o, s)) return !1
                }
                return !0
            }

            function ce(e, t, i) {
                switch (i) {
                    case Bt:
                    case Ft:
                        return +e == +t;
                    case Nt:
                        return e.name == t.name && e.message == t.message;
                    case kt:
                        return e != +e ? t != +t : e == +t;
                    case Gt:
                    case zt:
                        return e == t + ""
                }
                return !1
            }

            function he(e, t, i, r, n, o, s) {
                var a = hr(e),
                    l = a.length;
                if (l != hr(t).length && !n) return !1;
                for (var u = l; u--;) {
                    var c = a[u];
                    if (!(n ? c in t : Ti.call(t, c))) return !1
                }
                for (var h = n; ++u < l;) {
                    c = a[u];
                    var d = e[c],
                        p = t[c],
                        f = r ? r(n ? p : d, n ? d : p, c) : vt;
                    if (!(f === vt ? i(d, p, r, n, o, s) : f)) return !1;
                    h || (h = "constructor" == c)
                }
                if (!h) {
                    var _ = e.constructor,
                        m = t.constructor;
                    if (_ != m && "constructor" in e && "constructor" in t && !("function" == typeof _ && _ instanceof _ && "function" == typeof m && m instanceof m)) return !1
                }
                return !0
            }

            function de(e, t, i) {
                var r = s.callback || dt;
                return r = r === dt ? M : r, i ? r(e, t, i) : r
            }

            function pe(e) {
                for (var t = e.name + "", i = Hi[t], r = i ? i.length : 0; r--;) {
                    var n = i[r],
                        o = n.func;
                    if (null == o || o == e) return n.name
                }
                return t
            }

            function fe(e, i, r) {
                var n = s.indexOf || Le;
                return n = n === Le ? t : n, e ? n(e, i, r) : n
            }

            function _e(e) {
                for (var t = ct(e), i = t.length; i--;) t[i][2] = Ce(t[i][1]);
                return t
            }

            function me(e, t) {
                var i = null == e ? vt : e[t];
                return ot(i) ? i : vt
            }

            function ge(e, t, i) {
                for (var r = -1, n = i.length; ++r < n;) {
                    var o = i[r],
                        s = o.size;
                    switch (o.type) {
                        case "drop":
                            e += s;
                            break;
                        case "dropRight":
                            t -= s;
                            break;
                        case "take":
                            t = Ni(t, e + s);
                            break;
                        case "takeRight":
                            e = Fi(e, t - s)
                    }
                }
                return {
                    start: e,
                    end: t
                }
            }

            function ve(e) {
                var t = e.length,
                    i = new e.constructor(t);
                return t && "string" == typeof e[0] && Ti.call(e, "index") && (i.index = e.index, i.input = e.input), i
            }

            function ye(e) {
                var t = e.constructor;
                return "function" == typeof t && t instanceof t || (t = Object), new t
            }

            function be(e, t, i) {
                var r = e.constructor;
                switch (t) {
                    case jt:
                        return ee(e);
                    case Bt:
                    case Ft:
                        return new r(+e);
                    case Ht:
                    case Wt:
                    case Xt:
                    case Yt:
                    case qt:
                    case Kt:
                    case Qt:
                    case Zt:
                    case Jt:
                        r instanceof r && (r = Wi[t]);
                        var n = e.buffer;
                        return new r(i ? ee(n) : n, e.byteOffset, e.length);
                    case kt:
                    case zt:
                        return new r(e);
                    case Gt:
                        var o = new r(e.source, ri.exec(e));
                        o.lastIndex = e.lastIndex
                }
                return o
            }

            function xe(e) {
                return null != e && Ae($i(e))
            }

            function Te(e, t) {
                return e = "number" == typeof e || oi.test(e) ? +e : -1, t = null == t ? zi : t, e > -1 && e % 1 == 0 && e < t
            }

            function Ee(e, t, i) {
                if (!nt(i)) return !1;
                var r = typeof t;
                if ("number" == r ? xe(i) && Te(t, i.length) : "string" == r && t in i) {
                    var n = i[t];
                    return e === e ? e === n : n !== n
                }
                return !1
            }

            function Se(e, t) {
                var i = typeof e;
                return !!("string" == i && ei.test(e) || "number" == i) || !lr(e) && (!$t.test(e) || null != t && e in we(t))
            }

            function Pe(e) {
                var t = pe(e),
                    i = s[t];
                if ("function" != typeof i || !(t in u.prototype)) return !1;
                if (e === i) return !0;
                var r = Ji(i);
                return !!r && e === r[0]
            }

            function Ae(e) {
                return "number" == typeof e && e > -1 && e % 1 == 0 && e <= zi
            }

            function Ce(e) {
                return e === e && !nt(e)
            }

            function Me(e, t) {
                var i = e[1],
                    r = t[1],
                    n = i | r,
                    s = n < At,
                    a = r == At && i == Tt || r == At && i == Ct && e[7].length <= t[8] || r == (At | Ct) && i == Tt;
                if (!s && !a) return e;
                r & yt && (e[2] = t[2], n |= i & yt ? 0 : xt);
                var l = t[3];
                if (l) {
                    var u = e[3];
                    e[3] = u ? te(u, l, t[4]) : g(l), e[4] = u ? o(e[3], It) : g(t[4])
                }
                return l = t[5], l && (u = e[5], e[5] = u ? ie(u, l, t[6]) : g(l), e[6] = u ? o(e[5], It) : g(t[6])), l = t[7], l && (e[7] = g(l)), r & At && (e[8] = null == e[8] ? t[8] : Ni(e[8], t[8])), null == e[9] && (e[9] = t[9]), e[0] = t[0], e[1] = n, e
            }

            function Re(e, t) {
                for (var i = e.length, r = Ni(t.length, i), n = g(e); r--;) {
                    var o = t[r];
                    e[r] = Te(o, i) ? n[o] : vt
                }
                return e
            }

            function Oe(e) {
                for (var t = ut(e), i = t.length, r = i && e.length, n = !!r && Ae(r) && (lr(e) || tt(e) || at(e)), o = -1, s = []; ++o < i;) {
                    var a = t[o];
                    (n && Te(a, r) || Ti.call(e, a)) && s.push(a)
                }
                return s
            }

            function we(e) {
                if (s.support.unindexedChars && at(e)) {
                    for (var t = -1, i = e.length, r = Object(e); ++t < i;) r[t] = e.charAt(t);
                    return r
                }
                return nt(e) ? e : Object(e)
            }

            function Ie(e) {
                if (lr(e)) return e;
                var t = [];
                return i(e).replace(ti, function(e, i, r, n) {
                    t.push(r ? n.replace(ii, "$1") : i || e)
                }), t
            }

            function De(e) {
                return e instanceof u ? e.clone() : new l(e.__wrapped__, e.__chain__, g(e.__actions__))
            }

            function Le(e, i, r) {
                var n = e ? e.length : 0;
                if (!n) return -1;
                if ("number" == typeof r) r = r < 0 ? Fi(n + r, 0) : r;
                else if (r) {
                    var o = Z(e, i);
                    return o < n && (i === i ? i === e[o] : e[o] !== e[o]) ? o : -1
                }
                return t(e, i, r || 0)
            }

            function Be(e) {
                var t = e ? e.length : 0;
                return t ? e[t - 1] : vt
            }

            function Fe(e) {
                var t = s(e);
                return t.__chain__ = !0, t
            }

            function Ne(e, t, i) {
                return t.call(i, e), e
            }

            function Ve(e, t, i) {
                return t.call(i, e)
            }

            function ke() {
                return Fe(this)
            }

            function Ue() {
                return new l(this.value(), this.__chain__)
            }

            function Ge(e) {
                for (var t, i = this; i instanceof a;) {
                    var r = De(i);
                    t ? n.__wrapped__ = r : t = r;
                    var n = r;
                    i = i.__wrapped__
                }
                return n.__wrapped__ = e, t
            }

            function ze() {
                var e = this.__wrapped__,
                    t = function(e) {
                        return e.reverse()
                    };
                if (e instanceof u) {
                    var i = e;
                    return this.__actions__.length && (i = new u(this)), i = i.reverse(), i.__actions__.push({
                        func: Ve,
                        args: [t],
                        thisArg: vt
                    }), new l(i, this.__chain__)
                }
                return this.thru(t)
            }

            function je() {
                return this.value() + ""
            }

            function He() {
                return Q(this.__wrapped__, this.__actions__)
            }

            function We(e, t, i) {
                var r = lr(e) ? y : w;
                return t = de(t, i, 3), r(e, t)
            }

            function Xe(e, t, i, r) {
                var n = e ? $i(e) : 0;
                return Ae(n) || (e = ht(e), n = e.length), i = "number" != typeof i || r && Ee(t, i, r) ? 0 : i < 0 ? Fi(n + i, 0) : i || 0, "string" == typeof e || !lr(e) && at(e) ? i <= n && e.indexOf(t, i) > -1 : !!n && fe(e, t, i) > -1
            }

            function Ye(e, t, i) {
                var r = lr(e) ? b : G;
                return t = de(t, i, 3), r(e, t)
            }

            function qe(e, t, i) {
                var r = lr(e) ? E : q;
                return i && Ee(e, t, i) && (t = vt), "function" == typeof t && i === vt || (t = de(t, i, 3)), r(e, t)
            }

            function Ke(e, t) {
                if ("function" != typeof t) {
                    if ("function" != typeof e) throw new TypeError(wt);
                    var i = e;
                    e = t, t = i
                }
                return e = Li(e = +e) ? e : 0,
                    function() {
                        if (--e < 1) return t.apply(this, arguments)
                    }
            }

            function Qe(e, t, i) {
                function r() {
                    p && clearTimeout(p), u && clearTimeout(u), _ = 0, u = p = f = vt
                }

                function n(t, i) {
                    i && clearTimeout(i), u = p = f = vt, t && (_ = sr(), c = e.apply(d, l), p || u || (l = d = vt))
                }

                function o() {
                    var e = t - (sr() - h);
                    e <= 0 || e > t ? n(f, u) : p = setTimeout(o, e)
                }

                function s() {
                    n(g, p)
                }

                function a() {
                    if (l = arguments, h = sr(), d = this, f = g && (p || !v), !1 === m) var i = v && !p;
                    else {
                        u || v || (_ = h);
                        var r = m - (h - _),
                            n = r <= 0 || r > m;
                        n ? (u && (u = clearTimeout(u)), _ = h, c = e.apply(d, l)) : u || (u = setTimeout(s, r))
                    }
                    return n && p ? p = clearTimeout(p) : p || t === m || (p = setTimeout(o, t)), i && (n = !0, c = e.apply(d, l)), !n || p || u || (l = d = vt), c
                }
                var l, u, c, h, d, p, f, _ = 0,
                    m = !1,
                    g = !0;
                if ("function" != typeof e) throw new TypeError(wt);
                if (t = t < 0 ? 0 : +t || 0, !0 === i) {
                    var v = !0;
                    g = !1
                } else nt(i) && (v = !!i.leading, m = "maxWait" in i && Fi(+i.maxWait || 0, t), g = "trailing" in i ? !!i.trailing : g);
                return a.cancel = r, a
            }

            function Ze(e, t) {
                if ("function" != typeof e) throw new TypeError(wt);
                return t = Fi(t === vt ? e.length - 1 : +t || 0, 0),
                    function() {
                        for (var i = arguments, r = -1, n = Fi(i.length - t, 0), o = Array(n); ++r < n;) o[r] = i[t + r];
                        switch (t) {
                            case 0:
                                return e.call(this, o);
                            case 1:
                                return e.call(this, i[0], o);
                            case 2:
                                return e.call(this, i[0], i[1], o)
                        }
                        var s = Array(t + 1);
                        for (r = -1; ++r < t;) s[r] = i[r];
                        return s[t] = o, e.apply(this, s)
                    }
            }

            function Je(e, t, i) {
                var r = !0,
                    n = !0;
                if ("function" != typeof e) throw new TypeError(wt);
                return !1 === i ? r = !1 : nt(i) && (r = "leading" in i ? !!i.leading : r, n = "trailing" in i ? !!i.trailing : n), Qe(e, t, {
                    leading: r,
                    maxWait: +t,
                    trailing: n
                })
            }

            function $e(e, t, i, r) {
                return t && "boolean" != typeof t && Ee(e, t, i) ? t = !1 : "function" == typeof t && (r = i, i = t, t = !1), "function" == typeof i ? R(e, t, $(i, r, 3)) : R(e, t)
            }

            function et(e, t, i) {
                return "function" == typeof t ? R(e, !0, $(t, i, 3)) : R(e, !0)
            }

            function tt(e) {
                return n(e) && xe(e) && Ti.call(e, "callee") && !Ai.call(e, "callee")
            }

            function it(e, t, i, r) {
                i = "function" == typeof i ? $(i, r, 3) : vt;
                var n = i ? i(e, t) : vt;
                return n === vt ? V(e, t, i) : !!n
            }

            function rt(e) {
                return nt(e) && Ei.call(e) == Vt
            }

            function nt(e) {
                var t = typeof e;
                return !!e && ("object" == t || "function" == t)
            }

            function ot(e) {
                return null != e && (rt(e) ? Si.test(xi.call(e)) : n(e) && (mi(e) ? Si : ni).test(e))
            }

            function st(e) {
                var t;
                if (!n(e) || Ei.call(e) != Ut || mi(e) || tt(e) || !Ti.call(e, "constructor") && "function" == typeof(t = e.constructor) && !(t instanceof t)) return !1;
                var i;
                return s.support.ownLast ? (L(e, function(e, t, r) {
                    return i = Ti.call(r, t), !1
                }), !1 !== i) : (L(e, function(e, t) {
                    i = t
                }), i === vt || Ti.call(e, i))
            }

            function at(e) {
                return "string" == typeof e || n(e) && Ei.call(e) == zt
            }

            function lt(e) {
                return n(e) && Ae(e.length) && !!ai[Ei.call(e)]
            }

            function ut(e) {
                if (null == e) return [];
                nt(e) || (e = Object(e));
                var t = e.length,
                    i = s.support;
                t = t && Ae(t) && (lr(e) || tt(e) || at(e)) && t || 0;
                for (var r = e.constructor, n = -1, o = rt(r) && r.prototype || yi, a = o === e, l = Array(t), u = t > 0, c = i.enumErrorProps && (e === vi || e instanceof Error), h = i.enumPrototypes && rt(e); ++n < t;) l[n] = n + "";
                for (var d in e) h && "prototype" == d || c && ("message" == d || "name" == d) || u && Te(d, t) || "constructor" == d && (a || !Ti.call(e, d)) || l.push(d);
                if (i.nonEnumShadows && e !== yi) {
                    var p = e === bi ? zt : e === vi ? Nt : Ei.call(e),
                        f = Xi[p] || Xi[Ut];
                    for (p == Ut && (o = yi), t = si.length; t--;) {
                        d = si[t];
                        var _ = f[d];
                        a && _ || (_ ? !Ti.call(e, d) : e[d] === o[d]) || l.push(d)
                    }
                }
                return l
            }

            function ct(e) {
                e = we(e);
                for (var t = -1, i = hr(e), r = i.length, n = Array(r); ++t < r;) {
                    var o = i[t];
                    n[t] = [o, e[o]]
                }
                return n
            }

            function ht(e) {
                return K(e, hr(e))
            }

            function dt(e, t, i) {
                return i && Ee(e, t, i) && (t = vt), n(e) ? ft(e) : M(e, t)
            }

            function pt(e) {
                return e
            }

            function ft(e) {
                return z(R(e, !0))
            }

            function _t(e, t, i) {
                if (null == i) {
                    var r = nt(t),
                        n = r ? hr(t) : vt,
                        o = n && n.length ? F(t, n) : vt;
                    (o ? o.length : r) || (o = !1, i = t, t = e, e = this)
                }
                o || (o = F(t, hr(t)));
                var s = !0,
                    a = -1,
                    l = rt(e),
                    u = o.length;
                !1 === i ? s = !1 : nt(i) && "chain" in i && (s = i.chain);
                for (; ++a < u;) {
                    var c = o[a],
                        h = t[c];
                    e[c] = h, l && (e.prototype[c] = function(t) {
                        return function() {
                            var i = this.__chain__;
                            if (s || i) {
                                var r = e(this.__wrapped__);
                                return (r.__actions__ = g(this.__actions__)).push({
                                    func: t,
                                    args: arguments,
                                    thisArg: e
                                }), r.__chain__ = i, r
                            }
                            return t.apply(e, x([this.value()], arguments))
                        }
                    }(h))
                }
                return e
            }

            function mt() {}

            function gt(e) {
                return Se(e) ? H(e) : W(e)
            }
            var vt, yt = 1,
                bt = 2,
                xt = 4,
                Tt = 8,
                Et = 16,
                St = 32,
                Pt = 64,
                At = 128,
                Ct = 256,
                Mt = 200,
                Rt = 1,
                Ot = 2,
                wt = "Expected a function",
                It = "__lodash_placeholder__",
                Dt = "[object Arguments]",
                Lt = "[object Array]",
                Bt = "[object Boolean]",
                Ft = "[object Date]",
                Nt = "[object Error]",
                Vt = "[object Function]",
                kt = "[object Number]",
                Ut = "[object Object]",
                Gt = "[object RegExp]",
                zt = "[object String]",
                jt = "[object ArrayBuffer]",
                Ht = "[object Float32Array]",
                Wt = "[object Float64Array]",
                Xt = "[object Int8Array]",
                Yt = "[object Int16Array]",
                qt = "[object Int32Array]",
                Kt = "[object Uint8Array]",
                Qt = "[object Uint8ClampedArray]",
                Zt = "[object Uint16Array]",
                Jt = "[object Uint32Array]",
                $t = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
                ei = /^\w*$/,
                ti = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,
                ii = /\\(\\)?/g,
                ri = /\w*$/,
                ni = /^\[object .+?Constructor\]$/,
                oi = /^\d+$/,
                si = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"],
                ai = {};
            ai[Ht] = ai[Wt] = ai[Xt] = ai[Yt] = ai[qt] = ai[Kt] = ai[Qt] = ai[Zt] = ai[Jt] = !0, ai[Dt] = ai[Lt] = ai[jt] = ai[Bt] = ai[Ft] = ai[Nt] = ai[Vt] = ai["[object Map]"] = ai[kt] = ai[Ut] = ai[Gt] = ai["[object Set]"] = ai[zt] = ai["[object WeakMap]"] = !1;
            var li = {};
            li[Dt] = li[Lt] = li[jt] = li[Bt] = li[Ft] = li[Ht] = li[Wt] = li[Xt] = li[Yt] = li[qt] = li[kt] = li[Ut] = li[Gt] = li[zt] = li[Kt] = li[Qt] = li[Zt] = li[Jt] = !0, li[Nt] = li[Vt] = li["[object Map]"] = li["[object Set]"] = li["[object WeakMap]"] = !1;
            var ui = {
                    function: !0,
                    object: !0
                },
                ci = ui[typeof exports] && exports && !exports.nodeType && exports,
                hi = ui[typeof module] && module && !module.nodeType && module,
                di = ci && hi && "object" == typeof global && global && global.Object && global,
                pi = ui[typeof self] && self && self.Object && self,
                fi = ui[typeof window] && window && window.Object && window,
                _i = di || fi !== (this && this.window) && fi || pi || this,
                mi = function() {
                    try {
                        Object({
                            toString: 0
                        } + "")
                    } catch (e) {
                        return function() {
                            return !1
                        }
                    }
                    return function(e) {
                        return "function" != typeof e.toString && "string" == typeof(e + "")
                    }
                }(),
                gi = Array.prototype,
                vi = Error.prototype,
                yi = Object.prototype,
                bi = String.prototype,
                xi = Function.prototype.toString,
                Ti = yi.hasOwnProperty,
                Ei = yi.toString,
                Si = RegExp("^" + xi.call(Ti).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
                Pi = _i.ArrayBuffer,
                Ai = yi.propertyIsEnumerable,
                Ci = me(_i, "Set"),
                Mi = gi.splice,
                Ri = _i.Uint8Array,
                Oi = me(_i, "WeakMap"),
                wi = me(Object, "create"),
                Ii = Math.floor,
                Di = me(Array, "isArray"),
                Li = _i.isFinite,
                Bi = me(Object, "keys"),
                Fi = Math.max,
                Ni = Math.min,
                Vi = me(Date, "now"),
                ki = Number.POSITIVE_INFINITY,
                Ui = 4294967294,
                Gi = 2147483647,
                zi = 9007199254740991,
                ji = Oi && new Oi,
                Hi = {},
                Wi = {};
            Wi[Ht] = _i.Float32Array, Wi[Wt] = _i.Float64Array, Wi[Xt] = _i.Int8Array, Wi[Yt] = _i.Int16Array, Wi[qt] = _i.Int32Array, Wi[Kt] = Ri, Wi[Qt] = _i.Uint8ClampedArray, Wi[Zt] = _i.Uint16Array, Wi[Jt] = _i.Uint32Array;
            var Xi = {};
            Xi[Lt] = Xi[Ft] = Xi[kt] = {
                constructor: !0,
                toLocaleString: !0,
                toString: !0,
                valueOf: !0
            }, Xi[Bt] = Xi[zt] = {
                constructor: !0,
                toString: !0,
                valueOf: !0
            }, Xi[Nt] = Xi[Vt] = Xi[Gt] = {
                constructor: !0,
                toString: !0
            }, Xi[Ut] = {
                constructor: !0
            }, v(si, function(e) {
                for (var t in Xi)
                    if (Ti.call(Xi, t)) {
                        var i = Xi[t];
                        i[e] = Ti.call(i, e)
                    }
            });
            var Yi = s.support = {};
            ! function(e) {
                var t = function() {
                        this.x = 1
                    },
                    i = {
                        0: 1,
                        length: 1
                    },
                    r = [];
                t.prototype = {
                    valueOf: 1,
                    y: 1
                };
                for (var n in new t) r.push(n);
                Yi.enumErrorProps = Ai.call(vi, "message") || Ai.call(vi, "name"), Yi.enumPrototypes = Ai.call(t, "prototype"), Yi.nonEnumShadows = !/valueOf/.test(r), Yi.ownLast = "x" != r[0], Yi.spliceObjects = (Mi.call(i, 0, 1), !i[0]), Yi.unindexedChars = "x" [0] + Object("x")[0] != "xx"
            }();
            var qi = function() {
                    function e() {}
                    return function(t) {
                        if (nt(t)) {
                            e.prototype = t;
                            var i = new e;
                            e.prototype = vt
                        }
                        return i || {}
                    }
                }(),
                Ki = function(e, t) {
                    return function(i, r) {
                        var n = i ? $i(i) : 0;
                        if (!Ae(n)) return e(i, r);
                        for (var o = t ? n : -1, s = we(i);
                            (t ? o-- : ++o < n) && !1 !== r(s[o], o, s););
                        return i
                    }
                }(B),
                Qi = function(e) {
                    return function(t, i, r) {
                        for (var n = we(t), o = r(t), s = o.length, a = e ? s : -1; e ? a-- : ++a < s;) {
                            var l = o[a];
                            if (!1 === i(n[l], l, n)) break
                        }
                        return t
                    }
                }(),
                Zi = ji ? function(e, t) {
                    return ji.set(e, t), e
                } : pt,
                Ji = ji ? function(e) {
                    return ji.get(e)
                } : mt,
                $i = H("length"),
                er = function() {
                    var e = 0,
                        t = 0;
                    return function(i, r) {
                        var n = sr(),
                            o = 16 - (n - t);
                        if (t = n, o > 0) {
                            if (++e >= 150) return i
                        } else e = 0;
                        return Zi(i, r)
                    }
                }(),
                tr = Ze(function(e, t) {
                    return xe(e) ? O(e, t) : []
                }),
                ir = Ze(function(e) {
                    return e = D(e), this.thru(function(t) {
                        return m(lr(t) ? t : [we(t)], e)
                    })
                }),
                rr = function(t, i) {
                    return function(r, n, o) {
                        if (n = de(n, o, 3), lr(r)) {
                            var s = e(r, n, i);
                            return s > -1 ? r[s] : vt
                        }
                        return I(r, n, t)
                    }
                }(Ki),
                nr = function(e, t) {
                    return function(i, r, n) {
                        return "function" == typeof r && n === vt && lr(i) ? e(i, r) : t(i, $(r, n, 3))
                    }
                }(v, Ki),
                or = function(e, t) {
                    return function(i, r, n, o) {
                        var s = arguments.length < 3;
                        return "function" == typeof r && o === vt && lr(i) ? e(i, r, n, s) : X(i, de(r, o, 4), n, s, t)
                    }
                }(T, Ki),
                sr = Vi || function() {
                    return (new Date).getTime()
                },
                ar = Ze(function(e, t, i) {
                    var r = yt;
                    if (i.length) {
                        var n = o(i, ar.placeholder);
                        r |= St
                    }
                    return le(e, r, t, i, n)
                }),
                lr = Di || function(e) {
                    return n(e) && Ae(e.length) && Ei.call(e) == Lt
                },
                ur = function(e) {
                    return Ze(function(t, i) {
                        var r = -1,
                            n = null == t ? 0 : i.length,
                            o = n > 2 ? i[n - 2] : vt,
                            s = n > 2 ? i[2] : vt,
                            a = n > 1 ? i[n - 1] : vt;
                        for ("function" == typeof o ? (o = $(o, a, 5), n -= 2) : (o = "function" == typeof a ? a : vt, n -= o ? 1 : 0), s && Ee(i[0], i[1], s) && (o = n < 3 ? vt : o, n = 1); ++r < n;) {
                            var l = i[r];
                            l && e(t, l, o)
                        }
                        return t
                    })
                }(function(e, t, i) {
                    return i ? P(e, t, i) : A(e, t)
                }),
                cr = function(e, t) {
                    return Ze(function(i) {
                        var r = i[0];
                        return null == r ? r : (i.push(t), e.apply(vt, i))
                    })
                }(ur, S),
                hr = Bi ? function(e) {
                    var t = null == e ? vt : e.constructor;
                    return "function" == typeof t && t.prototype === e || ("function" == typeof e ? s.support.enumPrototypes : xe(e)) ? Oe(e) : nt(e) ? Bi(e) : []
                } : Oe;
            s.prototype = a.prototype, l.prototype = qi(a.prototype), l.prototype.constructor = l, u.prototype = qi(a.prototype), u.prototype.constructor = u, p.prototype.push = _, s.after = Ke, s.assign = ur, s.bind = ar, s.callback = dt, s.chain = Fe, s.debounce = Qe, s.defaults = cr, s.filter = We, s.forEach = nr, s.keys = hr, s.keysIn = ut, s.map = Ye, s.matches = ft, s.mixin = _t, s.pairs = ct, s.property = gt, s.restParam = Ze, s.tap = Ne, s.throttle = Je, s.thru = Ve, s.values = ht, s.without = tr, s.collect = Ye, s.each = nr, s.extend = ur, s.iteratee = dt, s.select = We, _t(s, s), s.clone = $e, s.cloneDeep = et, s.find = rr, s.identity = pt, s.includes = Xe, s.indexOf = Le, s.isArguments = tt, s.isArray = lr, s.isEqual = it, s.isFunction = rt, s.isNative = ot, s.isObject = nt, s.isPlainObject = st, s.isString = at, s.isTypedArray = lt, s.last = Be, s.noop = mt, s.now = sr, s.reduce = or, s.some = qe, s.any = qe, s.contains = Xe, s.eq = it, s.detect = rr, s.foldl = or, s.include = Xe, s.inject = or, _t(s, function() {
                var e = {};
                return B(s, function(t, i) {
                    s.prototype[i] || (e[i] = t)
                }), e
            }(), !1), s.prototype.sample = function(e) {
                return this.__chain__ || null != e ? this.thru(function(t) {
                    return sample(t, e)
                }) : sample(this.value())
            }, s.VERSION = "3.10.1", ar.placeholder = s, v(["drop", "take"], function(e, t) {
                u.prototype[e] = function(i) {
                    var r = this.__filtered__;
                    if (r && !t) return new u(this);
                    i = null == i ? 1 : Fi(Ii(i) || 0, 0);
                    var n = this.clone();
                    return r ? n.__takeCount__ = Ni(n.__takeCount__, i) : n.__views__.push({
                        size: i,
                        type: e + (n.__dir__ < 0 ? "Right" : "")
                    }), n
                }, u.prototype[e + "Right"] = function(t) {
                    return this.reverse()[e](t).reverse()
                }
            }), v(["filter", "map", "takeWhile"], function(e, t) {
                var i = t + 1,
                    r = i != Ot;
                u.prototype[e] = function(e, t) {
                    var n = this.clone();
                    return n.__iteratees__.push({
                        iteratee: de(e, t, 1),
                        type: i
                    }), n.__filtered__ = n.__filtered__ || r, n
                }
            }), v(["first", "last"], function(e, t) {
                var i = "take" + (t ? "Right" : "");
                u.prototype[e] = function() {
                    return this[i](1).value()[0]
                }
            }), v(["initial", "rest"], function(e, t) {
                var i = "drop" + (t ? "" : "Right");
                u.prototype[e] = function() {
                    return this.__filtered__ ? new u(this) : this[i](1)
                }
            }), v(["pluck", "where"], function(e, t) {
                var i = t ? "filter" : "map",
                    r = t ? z : gt;
                u.prototype[e] = function(e) {
                    return this[i](r(e))
                }
            }), u.prototype.compact = function() {
                return this.filter(pt)
            }, u.prototype.reject = function(e, t) {
                return e = de(e, t, 1), this.filter(function(t) {
                    return !e(t)
                })
            }, u.prototype.slice = function(e, t) {
                e = null == e ? 0 : +e || 0;
                var i = this;
                return i.__filtered__ && (e > 0 || t < 0) ? new u(i) : (e < 0 ? i = i.takeRight(-e) : e && (i = i.drop(e)), t !== vt && (t = +t || 0, i = t < 0 ? i.dropRight(-t) : i.take(t - e)), i)
            }, u.prototype.takeRightWhile = function(e, t) {
                return this.reverse().takeWhile(e, t).reverse()
            }, u.prototype.toArray = function() {
                return this.take(ki)
            }, B(u.prototype, function(e, t) {
                var i = /^(?:filter|map|reject)|While$/.test(t),
                    r = /^(?:first|last)$/.test(t),
                    n = s[r ? "take" + ("last" == t ? "Right" : "") : t];
                n && (s.prototype[t] = function() {
                    var t = r ? [1] : arguments,
                        o = this.__chain__,
                        s = this.__wrapped__,
                        a = !!this.__actions__.length,
                        c = s instanceof u,
                        h = t[0],
                        d = c || lr(s);
                    d && i && "function" == typeof h && 1 != h.length && (c = d = !1);
                    var p = function(e) {
                            return r && o ? n(e, 1)[0] : n.apply(vt, x([e], t))
                        },
                        f = {
                            func: Ve,
                            args: [p],
                            thisArg: vt
                        },
                        _ = c && !a;
                    if (r && !o) return _ ? (s = s.clone(), s.__actions__.push(f), e.call(s)) : n.call(vt, this.value())[0];
                    if (!r && d) {
                        s = _ ? s : new u(this);
                        var m = e.apply(s, t);
                        return m.__actions__.push(f), new l(m, o)
                    }
                    return this.thru(p)
                })
            }), v(["join", "pop", "push", "replace", "shift", "sort", "splice", "split", "unshift"], function(e) {
                var t = (/^(?:replace|split)$/.test(e) ? bi : gi)[e],
                    i = /^(?:push|sort|unshift)$/.test(e) ? "tap" : "thru",
                    r = !Yi.spliceObjects && /^(?:pop|shift|splice)$/.test(e),
                    n = /^(?:join|pop|replace|shift)$/.test(e),
                    o = r ? function() {
                        var e = t.apply(this, arguments);
                        return 0 === this.length && delete this[0], e
                    } : t;
                s.prototype[e] = function() {
                    var e = arguments;
                    return n && !this.__chain__ ? o.apply(this.value(), e) : this[i](function(t) {
                        return o.apply(t, e)
                    })
                }
            }), B(u.prototype, function(e, t) {
                var i = s[t];
                if (i) {
                    var r = i.name + "";
                    (Hi[r] || (Hi[r] = [])).push({
                        name: t,
                        func: i
                    })
                }
            }), Hi[se(vt, bt).name] = [{
                name: "wrapper",
                func: vt
            }], u.prototype.clone = c, u.prototype.reverse = h, u.prototype.value = d, s.prototype.chain = ke, s.prototype.commit = Ue, s.prototype.concat = ir, s.prototype.plant = Ge, s.prototype.reverse = ze, s.prototype.toString = je, s.prototype.run = s.prototype.toJSON = s.prototype.valueOf = s.prototype.value = He, s.prototype.collect = s.prototype.map, s.prototype.head = s.prototype.first, s.prototype.select = s.prototype.filter, s.prototype.tail = s.prototype.rest, "function" == typeof define && "object" == typeof define.amd && define.amd && define("lodash", [], function() {
                return s
            })
        }.call(this),
        function(e, t) {
            "function" == typeof define && define.amd ? define("postal", ["lodash"], function(i) {
                return t(i, e)
            }) : "object" == typeof module && module.exports ? module.exports = t(require("lodash"), this) : e.postal = t(e._, e)
        }(this, function(e, t, i) {
            function r() {
                for (; x.length;) c.unsubscribe(x.shift())
            }

            function n(e, t, i) {
                return function(r, n, o) {
                    r === e && o.splice(n, 1), 0 === o.length && delete i[t]
                }
            }

            function o(e, t, i, r, n) {
                var o = n && n.headers || {};
                return function(n) {
                    var s;
                    h.resolver.compare(n.topic, e, o) && (o.resolverNoCache || (s = t[i] = t[i] || [], s.push(n)), n.cacheKeys.push(i), r && r(n))
                }
            }

            function s(e, t) {
                return {
                    channel: h.SYSTEM_CHANNEL,
                    topic: "subscription." + e,
                    data: {
                        event: "subscription." + e,
                        channel: t.channel,
                        topic: t.topic
                    }
                }
            }

            function a(t, i) {
                return "function" == typeof t ? t : t ? function(r) {
                    var n = 0,
                        o = 0;
                    return e.each(t, function(e, s) {
                        n += 1, ("topic" === s && i.compare(r.topic, t.topic, {
                            resolverNoCache: !0
                        }) || "context" === s && t.context === r._context || r[s] === t[s]) && (o += 1)
                    }), n === o
                } : function() {
                    return !0
                }
            }
            var l = t.postal,
                u = {
                    DEFAULT_CHANNEL: "/",
                    SYSTEM_CHANNEL: "postal",
                    enableSystemMessages: !0,
                    cacheKeyDelimiter: "|",
                    autoCompactResolver: !1
                },
                c = {
                    configuration: e.extend({}, u)
                },
                h = c.configuration,
                d = function(e, t) {
                    this.bus = t, this.channel = e || h.DEFAULT_CHANNEL
                };
            d.prototype.subscribe = function() {
                return this.bus.subscribe({
                    channel: this.channel,
                    topic: 1 === arguments.length ? arguments[0].topic : arguments[0],
                    callback: 1 === arguments.length ? arguments[0].callback : arguments[1]
                })
            }, d.prototype.publish = function() {
                var e, t = {};
                if ("string" == typeof arguments[0] ? (t.topic = arguments[0], t.data = arguments[1], e = arguments[2]) : (t = arguments[0], e = arguments[1]), "object" != typeof t) throw new Error("The first argument to ChannelDefinition.publish should be either an envelope object or a string topic.");
                t.channel = this.channel, this.bus.publish(t, e)
            };
            var p = function(e, t, r) {
                    if (3 !== arguments.length) throw new Error("You must provide a channel, topic and callback when creating a SubscriptionDefinition instance.");
                    if (0 === t.length) throw new Error("Topics cannot be empty");
                    this.channel = e, this.topic = t, this.callback = r, this.pipeline = [], this.cacheKeys = [], this._context = i
                },
                f = function() {
                    var t;
                    return function(i) {
                        var r = !1;
                        return "string" == typeof i ? (r = i === t, t = i) : (r = e.isEqual(i, t), t = e.extend({}, i)), !r
                    }
                },
                _ = function() {
                    var t = [];
                    return function(i) {
                        var r = !e.any(t, function(t) {
                            return e.isEqual(i, t)
                        });
                        return r && t.push(i), r
                    }
                };
            p.prototype = {
                catch: function(e) {
                    var t = this.callback,
                        i = function() {
                            try {
                                t.apply(this, arguments)
                            } catch (t) {
                                e(t, arguments[0])
                            }
                        };
                    return this.callback = i, this
                },
                defer: function() {
                    return this.delay(0)
                },
                disposeAfter: function(t) {
                    if ("number" != typeof t || t <= 0) throw new Error("The value provided to disposeAfter (maxCalls) must be a number greater than zero.");
                    var i = this,
                        r = e.after(t, e.bind(function() {
                            i.unsubscribe()
                        }));
                    return i.pipeline.push(function(e, t, i) {
                        i(e, t), r()
                    }), i
                },
                distinct: function() {
                    return this.constraint(new _)
                },
                distinctUntilChanged: function() {
                    return this.constraint(new f)
                },
                invokeSubscriber: function(e, t) {
                    if (!this.inactive) {
                        var i = this,
                            r = i.pipeline,
                            n = r.length,
                            o = i._context,
                            s = -1,
                            a = !1;
                        if (n) {
                            r = r.concat([i.callback]);
                            ! function e(t, l) {
                                s += 1, s < n ? r[s].call(o, t, l, e) : (i.callback.call(o, t, l), a = !0)
                            }(e, t)
                        } else i.callback.call(o, e, t), a = !0;
                        return a
                    }
                },
                logError: function() {
                    if (console) {
                        var e;
                        e = console.warn ? console.warn : console.log, this.catch(e)
                    }
                    return this
                },
                once: function() {
                    return this.disposeAfter(1)
                },
                subscribe: function(e) {
                    return this.callback = e, this
                },
                unsubscribe: function() {
                    this.inactive || c.unsubscribe(this)
                },
                constraint: function(e) {
                    if ("function" != typeof e) throw new Error("Predicate constraint must be a function");
                    return this.pipeline.push(function(t, i, r) {
                        e.call(this, t, i) && r(t, i)
                    }), this
                },
                constraints: function(t) {
                    var i = this;
                    return e.each(t, function(e) {
                        i.constraint(e)
                    }), i
                },
                context: function(e) {
                    return this._context = e, this
                },
                debounce: function(t, i) {
                    if ("number" != typeof t) throw new Error("Milliseconds must be a number");
                    return this.pipeline.push(e.debounce(function(e, t, i) {
                        i(e, t)
                    }, t, !!i)), this
                },
                delay: function(e) {
                    if ("number" != typeof e) throw new Error("Milliseconds must be a number");
                    return this.pipeline.push(function(t, i, r) {
                        setTimeout(function() {
                            r(t, i)
                        }, e)
                    }), this
                },
                throttle: function(t) {
                    if ("number" != typeof t) throw new Error("Milliseconds must be a number");
                    var i = function(e, t, i) {
                        i(e, t)
                    };
                    return this.pipeline.push(e.throttle(i, t)), this
                }
            };
            for (var m = ["withConstraint", "withConstraints", "withContext", "withDebounce", "withDelay", "withThrottle"], g = ["constraint", "constraints", "context", "debounce", "delay", "throttle"], v = 0; v < 6; v++) {
                var y = m[v];
                p.prototype[y] = function(e, t) {
                    return function() {
                        if (console.warn || console.log) {
                            console.warn
                        }
                        return p.prototype[t].apply(this, arguments)
                    }
                }(y, g[v])
            }
            var b = (h.resolver = {
                    cache: {},
                    regex: {},
                    enableCache: !0,
                    compare: function(t, i, r) {
                        var n, o, s, a = i + h.cacheKeyDelimiter + t,
                            l = this.cache[a],
                            u = r || {},
                            c = this.enableCache && !u.resolverNoCache;
                        return !0 === l ? l : -1 === t.indexOf("#") && -1 === t.indexOf("*") ? (l = i === t, c && (this.cache[a] = l), l) : ((o = this.regex[t]) || (n = "^" + e.map(t.split("."), function(e) {
                            var t = "";
                            return s && (t = "#" !== s ? "\\.\\b" : "\\b"), t += "#" === e ? "[\\s\\S]*" : "*" === e ? "[^.]+" : e, s = e, t
                        }).join("") + "$", o = this.regex[t] = new RegExp(n)), l = o.test(i), c && (this.cache[a] = l), l)
                    },
                    reset: function() {
                        this.cache = {}, this.regex = {}
                    },
                    purge: function(t) {
                        var i = this,
                            r = h.cacheKeyDelimiter,
                            n = function(e, n) {
                                var o = n.split(r),
                                    s = o[0],
                                    a = o[1];
                                void 0 !== t.topic && t.topic !== s || void 0 !== t.binding && t.binding !== a || delete i.cache[n]
                            },
                            o = function(e, t) {
                                var n = t.split(r);
                                0 === c.getSubscribersFor({
                                    topic: n[0]
                                }).length && delete i.cache[t]
                            };
                        if (void 0 === t) this.reset();
                        else {
                            var s = !0 === t.compact ? o : n;
                            e.each(this.cache, s)
                        }
                    }
                }, 0),
                x = [],
                T = 0,
                E = e.bind(s, this, "created"),
                S = e.bind(s, this, "removed");
            if (e.extend(c, {
                    cache: {},
                    subscriptions: {},
                    wireTaps: [],
                    ChannelDefinition: d,
                    SubscriptionDefinition: p,
                    channel: function(e) {
                        return new d(e, this)
                    },
                    addWireTap: function(e) {
                        var t = this;
                        return t.wireTaps.push(e),
                            function() {
                                var i = t.wireTaps.indexOf(e); - 1 !== i && t.wireTaps.splice(i, 1)
                            }
                    },
                    noConflict: function() {
                        if ("undefined" == typeof window || "undefined" != typeof window && "function" == typeof define && define.amd) throw new Error("noConflict can only be used in browser clients which aren't using AMD modules");
                        return t.postal = l, this
                    },
                    getSubscribersFor: function(t) {
                        var i = [],
                            r = this;
                        return e.each(r.subscriptions, function(r) {
                            e.each(r, function(r) {
                                i = i.concat(e.filter(r, a(t, h.resolver)))
                            })
                        }), i
                    },
                    publish: function(t, i) {
                        ++b;
                        var n = t.channel = t.channel || h.DEFAULT_CHANNEL,
                            s = t.topic;
                        t.timeStamp = new Date, this.wireTaps.length && e.each(this.wireTaps, function(e) {
                            e(t.data, t, b)
                        });
                        var a = n + h.cacheKeyDelimiter + s,
                            l = this.cache[a],
                            u = 0,
                            c = 0;
                        if (l) e.each(l, function(e) {
                            e.invokeSubscriber(t.data, t) ? c++ : u++
                        });
                        else {
                            var d = o(s, this.cache, a, function(e) {
                                e.invokeSubscriber(t.data, t) ? c++ : u++
                            }, t);
                            e.each(this.subscriptions[n], function(t) {
                                e.each(t, d)
                            })
                        }
                        0 == --b && r(), i && i({
                            activated: c,
                            skipped: u
                        })
                    },
                    reset: function() {
                        this.unsubscribeFor(), h.resolver.reset(), this.subscriptions = {}, this.cache = {}
                    },
                    subscribe: function(t) {
                        var i, r = this.subscriptions,
                            n = new p(t.channel || h.DEFAULT_CHANNEL, t.topic, t.callback),
                            s = r[n.channel],
                            a = n.channel.length;
                        return s || (s = r[n.channel] = {}), i = r[n.channel][n.topic], i || (i = r[n.channel][n.topic] = []), i.push(n), e.each(e.keys(this.cache), function(e) {
                            e.substr(0, a) === n.channel && o(e.split(h.cacheKeyDelimiter)[1], this.cache, e)(n)
                        }, this), h.enableSystemMessages && this.publish(E(n)), n
                    },
                    unsubscribe: function() {
                        for (var t, i, r, o, s = arguments.length, a = 0; a < s; a++) {
                            if (t = arguments[a], t.inactive = !0, b) return void x.push(t);
                            if (i = this.subscriptions[t.channel], r = i && i[t.topic]) {
                                var l = r.length;
                                for (o = 0; o < l;) {
                                    if (r[o] === t) {
                                        r.splice(o, 1);
                                        break
                                    }
                                    o += 1
                                }
                                if (0 === r.length && (delete i[t.topic], e.keys(i).length || delete this.subscriptions[t.channel]), t.cacheKeys && t.cacheKeys.length)
                                    for (var u; u = t.cacheKeys.pop();) e.each(this.cache[u], n(t, u, this.cache));
                                if ("function" == typeof h.resolver.purge) {
                                    var c = !0 === h.autoCompactResolver ? 0 : "number" == typeof h.autoCompactResolver && h.autoCompactResolver - 1;
                                    c >= 0 && T === c ? (h.resolver.purge({
                                        compact: !0
                                    }), T = 0) : c >= 0 && T < c && (T += 1)
                                }
                            }
                            h.enableSystemMessages && this.publish(S(t))
                        }
                    },
                    unsubscribeFor: function(e) {
                        var t = [];
                        this.subscriptions && (t = this.getSubscribersFor(e), this.unsubscribe.apply(this, t))
                    }
                }), t && Object.prototype.hasOwnProperty.call(t, "__postalReady__") && e.isArray(t.__postalReady__))
                for (; t.__postalReady__.length;) t.__postalReady__.shift().onReady(c);
            return c
        }),
        function(e) {
            "use strict";
            if ("function" == typeof bootstrap) bootstrap("promise", e);
            else if ("object" == typeof exports && "object" == typeof module) module.exports = e();
            else if ("function" == typeof define && define.amd) define("promise", e);
            else if ("undefined" != typeof ses) {
                if (!ses.ok()) return;
                ses.makeQ = e
            } else {
                if ("undefined" == typeof window && "undefined" == typeof self) throw new Error("This environment was not anticipated by Q. Please file a bug.");
                var t = "undefined" != typeof window ? window : self,
                    i = t.Q;
                t.Q = e(), t.Q.noConflict = function() {
                    return t.Q = i, this
                }
            }
        }(function() {
            "use strict";

            function e(e) {
                return function() {
                    return X.apply(e, arguments)
                }
            }

            function t(e) {
                return e === Object(e)
            }

            function i(e) {
                return "[object StopIteration]" === ee(e) || e instanceof z
            }

            function r(e, t) {
                if (U && t.stack && "object" == typeof e && null !== e && e.stack && -1 === e.stack.indexOf(te)) {
                    for (var i = [], r = t; r; r = r.source) r.stack && i.unshift(r.stack);
                    i.unshift(e.stack);
                    var o = i.join("\n" + te + "\n");
                    e.stack = n(o)
                }
            }

            function n(e) {
                for (var t = e.split("\n"), i = [], r = 0; r < t.length; ++r) {
                    var n = t[r];
                    a(n) || o(n) || !n || i.push(n)
                }
                return i.join("\n")
            }

            function o(e) {
                return -1 !== e.indexOf("(module.js:") || -1 !== e.indexOf("(node.js:")
            }

            function s(e) {
                var t = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);
                if (t) return [t[1], Number(t[2])];
                var i = /at ([^ ]+):(\d+):(?:\d+)$/.exec(e);
                if (i) return [i[1], Number(i[2])];
                var r = /.*@(.+):(\d+)$/.exec(e);
                return r ? [r[1], Number(r[2])] : void 0
            }

            function a(e) {
                var t = s(e);
                if (!t) return !1;
                var i = t[0],
                    r = t[1];
                return i === G && r >= j && r <= se
            }

            function l() {
                if (U) try {
                    throw new Error
                } catch (r) {
                    var e = r.stack.split("\n"),
                        t = e[0].indexOf("@") > 0 ? e[1] : e[2],
                        i = s(t);
                    if (!i) return;
                    return G = i[0], i[1]
                }
            }

            function u(e) {
                return e instanceof p ? e : g(e) ? A(e) : P(e)
            }

            function c() {
                function e(e) {
                    t = e, o.source = e, q(i, function(t, i) {
                        u.nextTick(function() {
                            e.promiseDispatch.apply(e, i)
                        })
                    }, void 0), i = void 0, r = void 0
                }
                var t, i = [],
                    r = [],
                    n = Z(c.prototype),
                    o = Z(p.prototype);
                if (o.promiseDispatch = function(e, n, o) {
                        var s = Y(arguments);
                        i ? (i.push(s), "when" === n && o[1] && r.push(o[1])) : u.nextTick(function() {
                            t.promiseDispatch.apply(t, s)
                        })
                    }, o.valueOf = function() {
                        if (i) return o;
                        var e = _(t);
                        return m(e) && (t = e), e
                    }, o.inspect = function() {
                        return t ? t.inspect() : {
                            state: "pending"
                        }
                    }, u.longStackSupport && U) try {
                    throw new Error
                } catch (e) {
                    o.stack = e.stack.substring(e.stack.indexOf("\n") + 1)
                }
                return n.promise = o, n.resolve = function(i) {
                    t || e(u(i))
                }, n.fulfill = function(i) {
                    t || e(P(i))
                }, n.reject = function(i) {
                    t || e(S(i))
                }, n.notify = function(e) {
                    t || q(r, function(t, i) {
                        u.nextTick(function() {
                            i(e)
                        })
                    }, void 0)
                }, n
            }

            function h(e) {
                if ("function" != typeof e) throw new TypeError("resolver must be a function.");
                var t = c();
                try {
                    e(t.resolve, t.reject, t.notify)
                } catch (e) {
                    t.reject(e)
                }
                return t.promise
            }

            function d(e) {
                return h(function(t, i) {
                    for (var r = 0, n = e.length; r < n; r++) u(e[r]).then(t, i)
                })
            }

            function p(e, t, i) {
                void 0 === t && (t = function(e) {
                    return S(new Error("Promise does not support operation: " + e))
                }), void 0 === i && (i = function() {
                    return {
                        state: "unknown"
                    }
                });
                var r = Z(p.prototype);
                if (r.promiseDispatch = function(i, n, o) {
                        var s;
                        try {
                            s = e[n] ? e[n].apply(r, o) : t.call(r, n, o)
                        } catch (e) {
                            s = S(e)
                        }
                        i && i(s)
                    }, r.inspect = i, i) {
                    var n = i();
                    "rejected" === n.state && (r.exception = n.reason), r.valueOf = function() {
                        var e = i();
                        return "pending" === e.state || "rejected" === e.state ? r : e.value
                    }
                }
                return r
            }

            function f(e, t, i, r) {
                return u(e).then(t, i, r)
            }

            function _(e) {
                if (m(e)) {
                    var t = e.inspect();
                    if ("fulfilled" === t.state) return t.value
                }
                return e
            }

            function m(e) {
                return e instanceof p
            }

            function g(e) {
                return t(e) && "function" == typeof e.then
            }

            function v(e) {
                return m(e) && "pending" === e.inspect().state
            }

            function y(e) {
                return !m(e) || "fulfilled" === e.inspect().state
            }

            function b(e) {
                return m(e) && "rejected" === e.inspect().state
            }

            function x() {
                ie.length = 0, re.length = 0, oe || (oe = !0)
            }

            function T(e, t) {
                oe && ("object" == typeof process && "function" == typeof process.emit && u.nextTick.runAfter(function() {
                    -1 !== K(re, e) && (process.emit("unhandledRejection", t, e), ne.push(e))
                }), re.push(e), t && void 0 !== t.stack ? ie.push(t.stack) : ie.push("(no stack) " + t))
            }

            function E(e) {
                if (oe) {
                    var t = K(re, e); - 1 !== t && ("object" == typeof process && "function" == typeof process.emit && u.nextTick.runAfter(function() {
                        var i = K(ne, e); - 1 !== i && (process.emit("rejectionHandled", ie[t], e), ne.splice(i, 1))
                    }), re.splice(t, 1), ie.splice(t, 1))
                }
            }

            function S(e) {
                var t = p({
                    when: function(t) {
                        return t && E(this), t ? t(e) : this
                    }
                }, function() {
                    return this
                }, function() {
                    return {
                        state: "rejected",
                        reason: e
                    }
                });
                return T(t, e), t
            }

            function P(e) {
                return p({
                    when: function() {
                        return e
                    },
                    get: function(t) {
                        return e[t]
                    },
                    set: function(t, i) {
                        e[t] = i
                    },
                    delete: function(t) {
                        delete e[t]
                    },
                    post: function(t, i) {
                        return null === t || void 0 === t ? e.apply(void 0, i) : e[t].apply(e, i)
                    },
                    apply: function(t, i) {
                        return e.apply(t, i)
                    },
                    keys: function() {
                        return $(e)
                    }
                }, void 0, function() {
                    return {
                        state: "fulfilled",
                        value: e
                    }
                })
            }

            function A(e) {
                var t = c();
                return u.nextTick(function() {
                    try {
                        e.then(t.resolve, t.reject, t.notify)
                    } catch (e) {
                        t.reject(e)
                    }
                }), t.promise
            }

            function C(e) {
                return p({
                    isDef: function() {}
                }, function(t, i) {
                    return D(e, t, i)
                }, function() {
                    return u(e).inspect()
                })
            }

            function M(e, t, i) {
                return u(e).spread(t, i)
            }

            function R(e) {
                return function() {
                    function t(e, t) {
                        var s;
                        if ("undefined" == typeof StopIteration) {
                            try {
                                s = r[e](t)
                            } catch (e) {
                                return S(e)
                            }
                            return s.done ? u(s.value) : f(s.value, n, o)
                        }
                        try {
                            s = r[e](t)
                        } catch (e) {
                            return i(e) ? u(e.value) : S(e)
                        }
                        return f(s, n, o)
                    }
                    var r = e.apply(this, arguments),
                        n = t.bind(t, "next"),
                        o = t.bind(t, "throw");
                    return n()
                }
            }

            function O(e) {
                u.done(u.async(e)())
            }

            function w(e) {
                throw new z(e)
            }

            function I(e) {
                return function() {
                    return M([this, L(arguments)], function(t, i) {
                        return e.apply(t, i)
                    })
                }
            }

            function D(e, t, i) {
                return u(e).dispatch(t, i)
            }

            function L(e) {
                return f(e, function(e) {
                    var t = 0,
                        i = c();
                    return q(e, function(r, n, o) {
                        var s;
                        m(n) && "fulfilled" === (s = n.inspect()).state ? e[o] = s.value : (++t, f(n, function(r) {
                            e[o] = r, 0 == --t && i.resolve(e)
                        }, i.reject, function(e) {
                            i.notify({
                                index: o,
                                value: e
                            })
                        }))
                    }, void 0), 0 === t && i.resolve(e), i.promise
                })
            }

            function B(e) {
                if (0 === e.length) return u.resolve();
                var t = u.defer(),
                    i = 0;
                return q(e, function(r, n, o) {
                    function s(e) {
                        t.resolve(e)
                    }

                    function a() {
                        0 === --i && t.reject(new Error("Q can't get fulfillment value from any promise, all promises were rejected."))
                    }

                    function l(e) {
                        t.notify({
                            index: o,
                            value: e
                        })
                    }
                    var u = e[o];
                    i++, f(u, s, a, l)
                }, void 0), t.promise
            }

            function F(e) {
                return f(e, function(e) {
                    return e = Q(e, u), f(L(Q(e, function(e) {
                        return f(e, H, H)
                    })), function() {
                        return e
                    })
                })
            }

            function N(e) {
                return u(e).allSettled()
            }

            function V(e, t) {
                return u(e).then(void 0, void 0, t)
            }

            function k(e, t) {
                return u(e).nodeify(t)
            }
            var U = !1;
            try {
                throw new Error
            } catch (e) {
                U = !!e.stack
            }
            var G, z, j = l(),
                H = function() {},
                W = function() {
                    function e() {
                        for (var e, r; i.next;) i = i.next, e = i.task, i.task = void 0, r = i.domain, r && (i.domain = void 0, r.enter()), t(e, r);
                        for (; a.length;) e = a.pop(), t(e);
                        n = !1
                    }

                    function t(t, i) {
                        try {
                            t()
                        } catch (t) {
                            if (s) throw i && i.exit(), setTimeout(e, 0), i && i.enter(), t;
                            setTimeout(function() {
                                throw t
                            }, 0)
                        }
                        i && i.exit()
                    }
                    var i = {
                            task: void 0,
                            next: null
                        },
                        r = i,
                        n = !1,
                        o = void 0,
                        s = !1,
                        a = [];
                    if (W = function(e) {
                            r = r.next = {
                                task: e,
                                domain: s && process.domain,
                                next: null
                            }, n || (n = !0, o())
                        }, "object" == typeof process && "[object process]" === process.toString() && process.nextTick) s = !0, o = function() {
                        process.nextTick(e)
                    };
                    else if ("function" == typeof setImmediate) o = "undefined" != typeof window ? setImmediate.bind(window, e) : function() {
                        setImmediate(e)
                    };
                    else if ("undefined" != typeof MessageChannel) {
                        var l = new MessageChannel;
                        l.port1.onmessage = function() {
                            o = u, l.port1.onmessage = e, e()
                        };
                        var u = function() {
                            l.port2.postMessage(0)
                        };
                        o = function() {
                            setTimeout(e, 0), u()
                        }
                    } else o = function() {
                        setTimeout(e, 0)
                    };
                    return W.runAfter = function(e) {
                        a.push(e), n || (n = !0, o())
                    }, W
                }(),
                X = Function.call,
                Y = e(Array.prototype.slice),
                q = e(Array.prototype.reduce || function(e, t) {
                    var i = 0,
                        r = this.length;
                    if (1 === arguments.length)
                        for (;;) {
                            if (i in this) {
                                t = this[i++];
                                break
                            }
                            if (++i >= r) throw new TypeError
                        }
                    for (; i < r; i++) i in this && (t = e(t, this[i], i));
                    return t
                }),
                K = e(Array.prototype.indexOf || function(e) {
                    for (var t = 0; t < this.length; t++)
                        if (this[t] === e) return t;
                    return -1
                }),
                Q = e(Array.prototype.map || function(e, t) {
                    var i = this,
                        r = [];
                    return q(i, function(n, o, s) {
                        r.push(e.call(t, o, s, i))
                    }, void 0), r
                }),
                Z = Object.create || function(e) {
                    function t() {}
                    return t.prototype = e, new t
                },
                J = e(Object.prototype.hasOwnProperty),
                $ = Object.keys || function(e) {
                    var t = [];
                    for (var i in e) J(e, i) && t.push(i);
                    return t
                },
                ee = e(Object.prototype.toString);
            z = "undefined" != typeof ReturnValue ? ReturnValue : function(e) {
                this.value = e
            };
            var te = "From previous event:";
            u.resolve = u, u.nextTick = W, u.longStackSupport = !1, "object" == typeof process && process && process.env && process.env.Q_DEBUG && (u.longStackSupport = !0), u.defer = c, c.prototype.makeNodeResolver = function() {
                var e = this;
                return function(t, i) {
                    t ? e.reject(t) : arguments.length > 2 ? e.resolve(Y(arguments, 1)) : e.resolve(i)
                }
            }, u.Promise = h, u.promise = h, h.race = d, h.all = L, h.reject = S, h.resolve = u, u.passByCopy = function(e) {
                return e
            }, p.prototype.passByCopy = function() {
                return this
            }, u.join = function(e, t) {
                return u(e).join(t)
            }, p.prototype.join = function(e) {
                return u([this, e]).spread(function(e, t) {
                    if (e === t) return e;
                    throw new Error("Q can't join: not the same: " + e + " " + t)
                })
            }, u.race = d, p.prototype.race = function() {
                return this.then(u.race)
            }, u.makePromise = p, p.prototype.toString = function() {
                return "[object Promise]"
            }, p.prototype.then = function(e, t, i) {
                function n(t) {
                    try {
                        return "function" == typeof e ? e(t) : t
                    } catch (e) {
                        return S(e)
                    }
                }

                function o(e) {
                    if ("function" == typeof t) {
                        r(e, a);
                        try {
                            return t(e)
                        } catch (e) {
                            return S(e)
                        }
                    }
                    return S(e)
                }

                function s(e) {
                    return "function" == typeof i ? i(e) : e
                }
                var a = this,
                    l = c(),
                    h = !1;
                return u.nextTick(function() {
                    a.promiseDispatch(function(e) {
                        h || (h = !0, l.resolve(n(e)))
                    }, "when", [function(e) {
                        h || (h = !0, l.resolve(o(e)))
                    }])
                }), a.promiseDispatch(void 0, "when", [void 0, function(e) {
                    var t, i = !1;
                    try {
                        t = s(e)
                    } catch (e) {
                        if (i = !0, !u.onerror) throw e;
                        u.onerror(e)
                    }
                    i || l.notify(t)
                }]), l.promise
            }, u.tap = function(e, t) {
                return u(e).tap(t)
            }, p.prototype.tap = function(e) {
                return e = u(e), this.then(function(t) {
                    return e.fcall(t).thenResolve(t)
                })
            }, u.when = f, p.prototype.thenResolve = function(e) {
                return this.then(function() {
                    return e
                })
            }, u.thenResolve = function(e, t) {
                return u(e).thenResolve(t)
            }, p.prototype.thenReject = function(e) {
                return this.then(function() {
                    throw e
                })
            }, u.thenReject = function(e, t) {
                return u(e).thenReject(t)
            }, u.nearer = _, u.isPromise = m, u.isPromiseAlike = g, u.isPending = v, p.prototype.isPending = function() {
                return "pending" === this.inspect().state
            }, u.isFulfilled = y, p.prototype.isFulfilled = function() {
                return "fulfilled" === this.inspect().state
            }, u.isRejected = b, p.prototype.isRejected = function() {
                return "rejected" === this.inspect().state
            };
            var ie = [],
                re = [],
                ne = [],
                oe = !0;
            u.resetUnhandledRejections = x, u.getUnhandledReasons = function() {
                return ie.slice()
            }, u.stopUnhandledRejectionTracking = function() {
                x(), oe = !1
            }, x(), u.reject = S, u.fulfill = P, u.master = C, u.spread = M, p.prototype.spread = function(e, t) {
                return this.all().then(function(t) {
                    return e.apply(void 0, t)
                }, t)
            }, u.async = R, u.spawn = O, u.return = w, u.promised = I, u.dispatch = D, p.prototype.dispatch = function(e, t) {
                var i = this,
                    r = c();
                return u.nextTick(function() {
                    i.promiseDispatch(r.resolve, e, t)
                }), r.promise
            }, u.get = function(e, t) {
                return u(e).dispatch("get", [t])
            }, p.prototype.get = function(e) {
                return this.dispatch("get", [e])
            }, u.set = function(e, t, i) {
                return u(e).dispatch("set", [t, i])
            }, p.prototype.set = function(e, t) {
                return this.dispatch("set", [e, t])
            }, u.del = u.delete = function(e, t) {
                return u(e).dispatch("delete", [t])
            }, p.prototype.del = p.prototype.delete = function(e) {
                return this.dispatch("delete", [e])
            }, u.mapply = u.post = function(e, t, i) {
                return u(e).dispatch("post", [t, i])
            }, p.prototype.mapply = p.prototype.post = function(e, t) {
                return this.dispatch("post", [e, t])
            }, u.send = u.mcall = u.invoke = function(e, t) {
                return u(e).dispatch("post", [t, Y(arguments, 2)])
            }, p.prototype.send = p.prototype.mcall = p.prototype.invoke = function(e) {
                return this.dispatch("post", [e, Y(arguments, 1)])
            }, u.fapply = function(e, t) {
                return u(e).dispatch("apply", [void 0, t])
            }, p.prototype.fapply = function(e) {
                return this.dispatch("apply", [void 0, e])
            }, u.try = u.fcall = function(e) {
                return u(e).dispatch("apply", [void 0, Y(arguments, 1)])
            }, p.prototype.fcall = function() {
                return this.dispatch("apply", [void 0, Y(arguments)])
            }, u.fbind = function(e) {
                var t = u(e),
                    i = Y(arguments, 1);
                return function() {
                    return t.dispatch("apply", [this, i.concat(Y(arguments))])
                }
            }, p.prototype.fbind = function() {
                var e = this,
                    t = Y(arguments);
                return function() {
                    return e.dispatch("apply", [this, t.concat(Y(arguments))])
                }
            }, u.keys = function(e) {
                return u(e).dispatch("keys", [])
            }, p.prototype.keys = function() {
                return this.dispatch("keys", [])
            }, u.all = L, p.prototype.all = function() {
                return L(this)
            }, u.any = B, p.prototype.any = function() {
                return B(this)
            }, u.allResolved = function(e, t, i) {
                return function() {
                    return "undefined" != typeof console && console.warn, e.apply(e, arguments)
                }
            }(F, "allResolved", "allSettled"), p.prototype.allResolved = function() {
                return F(this)
            }, u.allSettled = N, p.prototype.allSettled = function() {
                return this.then(function(e) {
                    return L(Q(e, function(e) {
                        function t() {
                            return e.inspect()
                        }
                        return e = u(e), e.then(t, t)
                    }))
                })
            }, u.fail = u.catch = function(e, t) {
                return u(e).then(void 0, t)
            }, p.prototype.fail = p.prototype.catch = function(e) {
                return this.then(void 0, e)
            }, u.progress = V, p.prototype.progress = function(e) {
                return this.then(void 0, void 0, e)
            }, u.fin = u.finally = function(e, t) {
                return u(e).finally(t)
            }, p.prototype.fin = p.prototype.finally = function(e) {
                if (!e || "function" != typeof e.apply) throw new Error("Q can't apply finally callback");
                return e = u(e), this.then(function(t) {
                    return e.fcall().then(function() {
                        return t
                    })
                }, function(t) {
                    return e.fcall().then(function() {
                        throw t
                    })
                })
            }, u.done = function(e, t, i, r) {
                return u(e).done(t, i, r)
            }, p.prototype.done = function(e, t, i) {
                var n = function(e) {
                        u.nextTick(function() {
                            if (r(e, o), !u.onerror) throw e;
                            u.onerror(e)
                        })
                    },
                    o = e || t || i ? this.then(e, t, i) : this;
                "object" == typeof process && process && process.domain && (n = process.domain.bind(n)), o.then(void 0, n)
            }, u.timeout = function(e, t, i) {
                return u(e).timeout(t, i)
            }, p.prototype.timeout = function(e, t) {
                var i = c(),
                    r = setTimeout(function() {
                        t && "string" != typeof t || (t = new Error(t || "Timed out after " + e + " ms"), t.code = "ETIMEDOUT"), i.reject(t)
                    }, e);
                return this.then(function(e) {
                    clearTimeout(r), i.resolve(e)
                }, function(e) {
                    clearTimeout(r), i.reject(e)
                }, i.notify), i.promise
            }, u.delay = function(e, t) {
                return void 0 === t && (t = e, e = void 0), u(e).delay(t)
            }, p.prototype.delay = function(e) {
                return this.then(function(t) {
                    var i = c();
                    return setTimeout(function() {
                        i.resolve(t)
                    }, e), i.promise
                })
            }, u.nfapply = function(e, t) {
                return u(e).nfapply(t)
            }, p.prototype.nfapply = function(e) {
                var t = c(),
                    i = Y(e);
                return i.push(t.makeNodeResolver()), this.fapply(i).fail(t.reject), t.promise
            }, u.nfcall = function(e) {
                var t = Y(arguments, 1);
                return u(e).nfapply(t)
            }, p.prototype.nfcall = function() {
                var e = Y(arguments),
                    t = c();
                return e.push(t.makeNodeResolver()), this.fapply(e).fail(t.reject), t.promise
            }, u.nfbind = u.denodeify = function(e) {
                if (void 0 === e) throw new Error("Q can't wrap an undefined function");
                var t = Y(arguments, 1);
                return function() {
                    var i = t.concat(Y(arguments)),
                        r = c();
                    return i.push(r.makeNodeResolver()), u(e).fapply(i).fail(r.reject), r.promise
                }
            }, p.prototype.nfbind = p.prototype.denodeify = function() {
                var e = Y(arguments);
                return e.unshift(this), u.denodeify.apply(void 0, e)
            }, u.nbind = function(e, t) {
                var i = Y(arguments, 2);
                return function() {
                    function r() {
                        return e.apply(t, arguments)
                    }
                    var n = i.concat(Y(arguments)),
                        o = c();
                    return n.push(o.makeNodeResolver()), u(r).fapply(n).fail(o.reject), o.promise
                }
            }, p.prototype.nbind = function() {
                var e = Y(arguments, 0);
                return e.unshift(this), u.nbind.apply(void 0, e)
            }, u.nmapply = u.npost = function(e, t, i) {
                return u(e).npost(t, i)
            }, p.prototype.nmapply = p.prototype.npost = function(e, t) {
                var i = Y(t || []),
                    r = c();
                return i.push(r.makeNodeResolver()), this.dispatch("post", [e, i]).fail(r.reject), r.promise
            }, u.nsend = u.nmcall = u.ninvoke = function(e, t) {
                var i = Y(arguments, 2),
                    r = c();
                return i.push(r.makeNodeResolver()), u(e).dispatch("post", [t, i]).fail(r.reject), r.promise
            }, p.prototype.nsend = p.prototype.nmcall = p.prototype.ninvoke = function(e) {
                var t = Y(arguments, 1),
                    i = c();
                return t.push(i.makeNodeResolver()), this.dispatch("post", [e, t]).fail(i.reject), i.promise
            }, u.nodeify = k, p.prototype.nodeify = function(e) {
                if (!e) return this;
                this.then(function(t) {
                    u.nextTick(function() {
                        e(null, t)
                    })
                }, function(t) {
                    u.nextTick(function() {
                        e(t)
                    })
                })
            }, u.noConflict = function() {
                throw new Error("Q.noConflict only works when Q is used as a global")
            };
            var se = l();
            return u
        }),
        function() {
            function e(e) {
                function t(t, i, r, n, o, s) {
                    for (; o >= 0 && s > o; o += e) {
                        var a = n ? n[o] : o;
                        r = i(r, t[a], a, t)
                    }
                    return r
                }
                return function(i, r, n, o) {
                    r = y(r, o, 4);
                    var s = !A(i) && v.keys(i),
                        a = (s || i).length,
                        l = e > 0 ? 0 : a - 1;
                    return arguments.length < 3 && (n = i[s ? s[l] : l], l += e), t(i, r, n, s, l, a)
                }
            }

            function t(e) {
                return function(t, i, r) {
                    i = b(i, r);
                    for (var n = P(t), o = e > 0 ? 0 : n - 1; o >= 0 && n > o; o += e)
                        if (i(t[o], o, t)) return o;
                    return -1
                }
            }

            function i(e, t, i) {
                return function(r, n, o) {
                    var s = 0,
                        a = P(r);
                    if ("number" == typeof o) e > 0 ? s = o >= 0 ? o : Math.max(o + a, s) : a = o >= 0 ? Math.min(o + 1, a) : o + a + 1;
                    else if (i && o && a) return o = i(r, n), r[o] === n ? o : -1;
                    if (n !== n) return o = t(c.call(r, s, a), v.isNaN), o >= 0 ? o + s : -1;
                    for (o = e > 0 ? s : a - 1; o >= 0 && a > o; o += e)
                        if (r[o] === n) return o;
                    return -1
                }
            }

            function r(e, t) {
                var i = w.length,
                    r = e.constructor,
                    n = v.isFunction(r) && r.prototype || a,
                    o = "constructor";
                for (v.has(e, o) && !v.contains(t, o) && t.push(o); i--;)(o = w[i]) in e && e[o] !== n[o] && !v.contains(t, o) && t.push(o)
            }
            var n = this,
                o = n._,
                s = Array.prototype,
                a = Object.prototype,
                l = Function.prototype,
                u = s.push,
                c = s.slice,
                h = a.toString,
                d = a.hasOwnProperty,
                p = Array.isArray,
                f = Object.keys,
                _ = l.bind,
                m = Object.create,
                g = function() {},
                v = function(e) {
                    return e instanceof v ? e : this instanceof v ? void(this._wrapped = e) : new v(e)
                };
            "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = v), exports._ = v) : n._ = v, v.VERSION = "1.8.3";
            var y = function(e, t, i) {
                    if (void 0 === t) return e;
                    switch (null == i ? 3 : i) {
                        case 1:
                            return function(i) {
                                return e.call(t, i)
                            };
                        case 2:
                            return function(i, r) {
                                return e.call(t, i, r)
                            };
                        case 3:
                            return function(i, r, n) {
                                return e.call(t, i, r, n)
                            };
                        case 4:
                            return function(i, r, n, o) {
                                return e.call(t, i, r, n, o)
                            }
                    }
                    return function() {
                        return e.apply(t, arguments)
                    }
                },
                b = function(e, t, i) {
                    return null == e ? v.identity : v.isFunction(e) ? y(e, t, i) : v.isObject(e) ? v.matcher(e) : v.property(e)
                };
            v.iteratee = function(e, t) {
                return b(e, t, 1 / 0)
            };
            var x = function(e, t) {
                    return function(i) {
                        var r = arguments.length;
                        if (2 > r || null == i) return i;
                        for (var n = 1; r > n; n++)
                            for (var o = arguments[n], s = e(o), a = s.length, l = 0; a > l; l++) {
                                var u = s[l];
                                t && void 0 !== i[u] || (i[u] = o[u])
                            }
                        return i
                    }
                },
                T = function(e) {
                    if (!v.isObject(e)) return {};
                    if (m) return m(e);
                    g.prototype = e;
                    var t = new g;
                    return g.prototype = null, t
                },
                E = function(e) {
                    return function(t) {
                        return null == t ? void 0 : t[e]
                    }
                },
                S = Math.pow(2, 53) - 1,
                P = E("length"),
                A = function(e) {
                    var t = P(e);
                    return "number" == typeof t && t >= 0 && S >= t
                };
            v.each = v.forEach = function(e, t, i) {
                t = y(t, i);
                var r, n;
                if (A(e))
                    for (r = 0, n = e.length; n > r; r++) t(e[r], r, e);
                else {
                    var o = v.keys(e);
                    for (r = 0, n = o.length; n > r; r++) t(e[o[r]], o[r], e)
                }
                return e
            }, v.map = v.collect = function(e, t, i) {
                t = b(t, i);
                for (var r = !A(e) && v.keys(e), n = (r || e).length, o = Array(n), s = 0; n > s; s++) {
                    var a = r ? r[s] : s;
                    o[s] = t(e[a], a, e)
                }
                return o
            }, v.reduce = v.foldl = v.inject = e(1), v.reduceRight = v.foldr = e(-1), v.find = v.detect = function(e, t, i) {
                var r;
                return r = A(e) ? v.findIndex(e, t, i) : v.findKey(e, t, i), void 0 !== r && -1 !== r ? e[r] : void 0
            }, v.filter = v.select = function(e, t, i) {
                var r = [];
                return t = b(t, i), v.each(e, function(e, i, n) {
                    t(e, i, n) && r.push(e)
                }), r
            }, v.reject = function(e, t, i) {
                return v.filter(e, v.negate(b(t)), i)
            }, v.every = v.all = function(e, t, i) {
                t = b(t, i);
                for (var r = !A(e) && v.keys(e), n = (r || e).length, o = 0; n > o; o++) {
                    var s = r ? r[o] : o;
                    if (!t(e[s], s, e)) return !1
                }
                return !0
            }, v.some = v.any = function(e, t, i) {
                t = b(t, i);
                for (var r = !A(e) && v.keys(e), n = (r || e).length, o = 0; n > o; o++) {
                    var s = r ? r[o] : o;
                    if (t(e[s], s, e)) return !0
                }
                return !1
            }, v.contains = v.includes = v.include = function(e, t, i, r) {
                return A(e) || (e = v.values(e)), ("number" != typeof i || r) && (i = 0), v.indexOf(e, t, i) >= 0
            }, v.invoke = function(e, t) {
                var i = c.call(arguments, 2),
                    r = v.isFunction(t);
                return v.map(e, function(e) {
                    var n = r ? t : e[t];
                    return null == n ? n : n.apply(e, i)
                })
            }, v.pluck = function(e, t) {
                return v.map(e, v.property(t))
            }, v.where = function(e, t) {
                return v.filter(e, v.matcher(t))
            }, v.findWhere = function(e, t) {
                return v.find(e, v.matcher(t))
            }, v.max = function(e, t, i) {
                var r, n, o = -1 / 0,
                    s = -1 / 0;
                if (null == t && null != e) {
                    e = A(e) ? e : v.values(e);
                    for (var a = 0, l = e.length; l > a; a++)(r = e[a]) > o && (o = r)
                } else t = b(t, i), v.each(e, function(e, i, r) {
                    ((n = t(e, i, r)) > s || n === -1 / 0 && o === -1 / 0) && (o = e, s = n)
                });
                return o
            }, v.min = function(e, t, i) {
                var r, n, o = 1 / 0,
                    s = 1 / 0;
                if (null == t && null != e) {
                    e = A(e) ? e : v.values(e);
                    for (var a = 0, l = e.length; l > a; a++) r = e[a], o > r && (o = r)
                } else t = b(t, i), v.each(e, function(e, i, r) {
                    n = t(e, i, r), (s > n || 1 / 0 === n && 1 / 0 === o) && (o = e, s = n)
                });
                return o
            }, v.shuffle = function(e) {
                for (var t, i = A(e) ? e : v.values(e), r = i.length, n = Array(r), o = 0; r > o; o++) t = v.random(0, o), t !== o && (n[o] = n[t]), n[t] = i[o];
                return n
            }, v.sample = function(e, t, i) {
                return null == t || i ? (A(e) || (e = v.values(e)), e[v.random(e.length - 1)]) : v.shuffle(e).slice(0, Math.max(0, t))
            }, v.sortBy = function(e, t, i) {
                return t = b(t, i), v.pluck(v.map(e, function(e, i, r) {
                    return {
                        value: e,
                        index: i,
                        criteria: t(e, i, r)
                    }
                }).sort(function(e, t) {
                    var i = e.criteria,
                        r = t.criteria;
                    if (i !== r) {
                        if (i > r || void 0 === i) return 1;
                        if (r > i || void 0 === r) return -1
                    }
                    return e.index - t.index
                }), "value")
            };
            var C = function(e) {
                return function(t, i, r) {
                    var n = {};
                    return i = b(i, r), v.each(t, function(r, o) {
                        var s = i(r, o, t);
                        e(n, r, s)
                    }), n
                }
            };
            v.groupBy = C(function(e, t, i) {
                v.has(e, i) ? e[i].push(t) : e[i] = [t]
            }), v.indexBy = C(function(e, t, i) {
                e[i] = t
            }), v.countBy = C(function(e, t, i) {
                v.has(e, i) ? e[i]++ : e[i] = 1
            }), v.toArray = function(e) {
                return e ? v.isArray(e) ? c.call(e) : A(e) ? v.map(e, v.identity) : v.values(e) : []
            }, v.size = function(e) {
                return null == e ? 0 : A(e) ? e.length : v.keys(e).length
            }, v.partition = function(e, t, i) {
                t = b(t, i);
                var r = [],
                    n = [];
                return v.each(e, function(e, i, o) {
                    (t(e, i, o) ? r : n).push(e)
                }), [r, n]
            }, v.first = v.head = v.take = function(e, t, i) {
                return null == e ? void 0 : null == t || i ? e[0] : v.initial(e, e.length - t)
            }, v.initial = function(e, t, i) {
                return c.call(e, 0, Math.max(0, e.length - (null == t || i ? 1 : t)))
            }, v.last = function(e, t, i) {
                return null == e ? void 0 : null == t || i ? e[e.length - 1] : v.rest(e, Math.max(0, e.length - t))
            }, v.rest = v.tail = v.drop = function(e, t, i) {
                return c.call(e, null == t || i ? 1 : t)
            }, v.compact = function(e) {
                return v.filter(e, v.identity)
            };
            var M = function(e, t, i, r) {
                for (var n = [], o = 0, s = r || 0, a = P(e); a > s; s++) {
                    var l = e[s];
                    if (A(l) && (v.isArray(l) || v.isArguments(l))) {
                        t || (l = M(l, t, i));
                        var u = 0,
                            c = l.length;
                        for (n.length += c; c > u;) n[o++] = l[u++]
                    } else i || (n[o++] = l)
                }
                return n
            };
            v.flatten = function(e, t) {
                return M(e, t, !1)
            }, v.without = function(e) {
                return v.difference(e, c.call(arguments, 1))
            }, v.uniq = v.unique = function(e, t, i, r) {
                v.isBoolean(t) || (r = i, i = t, t = !1), null != i && (i = b(i, r));
                for (var n = [], o = [], s = 0, a = P(e); a > s; s++) {
                    var l = e[s],
                        u = i ? i(l, s, e) : l;
                    t ? (s && o === u || n.push(l), o = u) : i ? v.contains(o, u) || (o.push(u), n.push(l)) : v.contains(n, l) || n.push(l)
                }
                return n
            }, v.union = function() {
                return v.uniq(M(arguments, !0, !0))
            }, v.intersection = function(e) {
                for (var t = [], i = arguments.length, r = 0, n = P(e); n > r; r++) {
                    var o = e[r];
                    if (!v.contains(t, o)) {
                        for (var s = 1; i > s && v.contains(arguments[s], o); s++);
                        s === i && t.push(o)
                    }
                }
                return t
            }, v.difference = function(e) {
                var t = M(arguments, !0, !0, 1);
                return v.filter(e, function(e) {
                    return !v.contains(t, e)
                })
            }, v.zip = function() {
                return v.unzip(arguments)
            }, v.unzip = function(e) {
                for (var t = e && v.max(e, P).length || 0, i = Array(t), r = 0; t > r; r++) i[r] = v.pluck(e, r);
                return i
            }, v.object = function(e, t) {
                for (var i = {}, r = 0, n = P(e); n > r; r++) t ? i[e[r]] = t[r] : i[e[r][0]] = e[r][1];
                return i
            }, v.findIndex = t(1), v.findLastIndex = t(-1), v.sortedIndex = function(e, t, i, r) {
                i = b(i, r, 1);
                for (var n = i(t), o = 0, s = P(e); s > o;) {
                    var a = Math.floor((o + s) / 2);
                    i(e[a]) < n ? o = a + 1 : s = a
                }
                return o
            }, v.indexOf = i(1, v.findIndex, v.sortedIndex), v.lastIndexOf = i(-1, v.findLastIndex), v.range = function(e, t, i) {
                null == t && (t = e || 0, e = 0), i = i || 1;
                for (var r = Math.max(Math.ceil((t - e) / i), 0), n = Array(r), o = 0; r > o; o++, e += i) n[o] = e;
                return n
            };
            var R = function(e, t, i, r, n) {
                if (!(r instanceof t)) return e.apply(i, n);
                var o = T(e.prototype),
                    s = e.apply(o, n);
                return v.isObject(s) ? s : o
            };
            v.bind = function(e, t) {
                if (_ && e.bind === _) return _.apply(e, c.call(arguments, 1));
                if (!v.isFunction(e)) throw new TypeError("Bind must be called on a function");
                var i = c.call(arguments, 2),
                    r = function() {
                        return R(e, r, t, this, i.concat(c.call(arguments)))
                    };
                return r
            }, v.partial = function(e) {
                var t = c.call(arguments, 1),
                    i = function() {
                        for (var r = 0, n = t.length, o = Array(n), s = 0; n > s; s++) o[s] = t[s] === v ? arguments[r++] : t[s];
                        for (; r < arguments.length;) o.push(arguments[r++]);
                        return R(e, i, this, this, o)
                    };
                return i
            }, v.bindAll = function(e) {
                var t, i, r = arguments.length;
                if (1 >= r) throw new Error("bindAll must be passed function names");
                for (t = 1; r > t; t++) i = arguments[t], e[i] = v.bind(e[i], e);
                return e
            }, v.memoize = function(e, t) {
                var i = function(r) {
                    var n = i.cache,
                        o = "" + (t ? t.apply(this, arguments) : r);
                    return v.has(n, o) || (n[o] = e.apply(this, arguments)), n[o]
                };
                return i.cache = {}, i
            }, v.delay = function(e, t) {
                var i = c.call(arguments, 2);
                return setTimeout(function() {
                    return e.apply(null, i)
                }, t)
            }, v.defer = v.partial(v.delay, v, 1), v.throttle = function(e, t, i) {
                var r, n, o, s = null,
                    a = 0;
                i || (i = {});
                var l = function() {
                    a = !1 === i.leading ? 0 : v.now(), s = null, o = e.apply(r, n), s || (r = n = null)
                };
                return function() {
                    var u = v.now();
                    a || !1 !== i.leading || (a = u);
                    var c = t - (u - a);
                    return r = this, n = arguments, 0 >= c || c > t ? (s && (clearTimeout(s), s = null), a = u, o = e.apply(r, n), s || (r = n = null)) : s || !1 === i.trailing || (s = setTimeout(l, c)), o
                }
            }, v.debounce = function(e, t, i) {
                var r, n, o, s, a, l = function() {
                    var u = v.now() - s;
                    t > u && u >= 0 ? r = setTimeout(l, t - u) : (r = null, i || (a = e.apply(o, n), r || (o = n = null)))
                };
                return function() {
                    o = this, n = arguments, s = v.now();
                    var u = i && !r;
                    return r || (r = setTimeout(l, t)), u && (a = e.apply(o, n), o = n = null), a
                }
            }, v.wrap = function(e, t) {
                return v.partial(t, e)
            }, v.negate = function(e) {
                return function() {
                    return !e.apply(this, arguments)
                }
            }, v.compose = function() {
                var e = arguments,
                    t = e.length - 1;
                return function() {
                    for (var i = t, r = e[t].apply(this, arguments); i--;) r = e[i].call(this, r);
                    return r
                }
            }, v.after = function(e, t) {
                return function() {
                    return --e < 1 ? t.apply(this, arguments) : void 0
                }
            }, v.before = function(e, t) {
                var i;
                return function() {
                    return --e > 0 && (i = t.apply(this, arguments)), 1 >= e && (t = null), i
                }
            }, v.once = v.partial(v.before, 2);
            var O = !{
                    toString: null
                }.propertyIsEnumerable("toString"),
                w = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"];
            v.keys = function(e) {
                    if (!v.isObject(e)) return [];
                    if (f) return f(e);
                    var t = [];
                    for (var i in e) v.has(e, i) && t.push(i);
                    return O && r(e, t), t
                }, v.allKeys = function(e) {
                    if (!v.isObject(e)) return [];
                    var t = [];
                    for (var i in e) t.push(i);
                    return O && r(e, t), t
                }, v.values = function(e) {
                    for (var t = v.keys(e), i = t.length, r = Array(i), n = 0; i > n; n++) r[n] = e[t[n]];
                    return r
                }, v.mapObject = function(e, t, i) {
                    t = b(t, i);
                    for (var r, n = v.keys(e), o = n.length, s = {}, a = 0; o > a; a++) r = n[a], s[r] = t(e[r], r, e);
                    return s
                }, v.pairs = function(e) {
                    for (var t = v.keys(e), i = t.length, r = Array(i), n = 0; i > n; n++) r[n] = [t[n], e[t[n]]];
                    return r
                }, v.invert = function(e) {
                    for (var t = {}, i = v.keys(e), r = 0, n = i.length; n > r; r++) t[e[i[r]]] = i[r];
                    return t
                }, v.functions = v.methods = function(e) {
                    var t = [];
                    for (var i in e) v.isFunction(e[i]) && t.push(i);
                    return t.sort()
                }, v.extend = x(v.allKeys),
                v.extendOwn = v.assign = x(v.keys), v.findKey = function(e, t, i) {
                    t = b(t, i);
                    for (var r, n = v.keys(e), o = 0, s = n.length; s > o; o++)
                        if (r = n[o], t(e[r], r, e)) return r
                }, v.pick = function(e, t, i) {
                    var r, n, o = {},
                        s = e;
                    if (null == s) return o;
                    v.isFunction(t) ? (n = v.allKeys(s), r = y(t, i)) : (n = M(arguments, !1, !1, 1), r = function(e, t, i) {
                        return t in i
                    }, s = Object(s));
                    for (var a = 0, l = n.length; l > a; a++) {
                        var u = n[a],
                            c = s[u];
                        r(c, u, s) && (o[u] = c)
                    }
                    return o
                }, v.omit = function(e, t, i) {
                    if (v.isFunction(t)) t = v.negate(t);
                    else {
                        var r = v.map(M(arguments, !1, !1, 1), String);
                        t = function(e, t) {
                            return !v.contains(r, t)
                        }
                    }
                    return v.pick(e, t, i)
                }, v.defaults = x(v.allKeys, !0), v.create = function(e, t) {
                    var i = T(e);
                    return t && v.extendOwn(i, t), i
                }, v.clone = function(e) {
                    return v.isObject(e) ? v.isArray(e) ? e.slice() : v.extend({}, e) : e
                }, v.tap = function(e, t) {
                    return t(e), e
                }, v.isMatch = function(e, t) {
                    var i = v.keys(t),
                        r = i.length;
                    if (null == e) return !r;
                    for (var n = Object(e), o = 0; r > o; o++) {
                        var s = i[o];
                        if (t[s] !== n[s] || !(s in n)) return !1
                    }
                    return !0
                };
            var I = function(e, t, i, r) {
                if (e === t) return 0 !== e || 1 / e == 1 / t;
                if (null == e || null == t) return e === t;
                e instanceof v && (e = e._wrapped), t instanceof v && (t = t._wrapped);
                var n = h.call(e);
                if (n !== h.call(t)) return !1;
                switch (n) {
                    case "[object RegExp]":
                    case "[object String]":
                        return "" + e == "" + t;
                    case "[object Number]":
                        return +e != +e ? +t != +t : 0 == +e ? 1 / +e == 1 / t : +e == +t;
                    case "[object Date]":
                    case "[object Boolean]":
                        return +e == +t
                }
                var o = "[object Array]" === n;
                if (!o) {
                    if ("object" != typeof e || "object" != typeof t) return !1;
                    var s = e.constructor,
                        a = t.constructor;
                    if (s !== a && !(v.isFunction(s) && s instanceof s && v.isFunction(a) && a instanceof a) && "constructor" in e && "constructor" in t) return !1
                }
                i = i || [], r = r || [];
                for (var l = i.length; l--;)
                    if (i[l] === e) return r[l] === t;
                if (i.push(e), r.push(t), o) {
                    if ((l = e.length) !== t.length) return !1;
                    for (; l--;)
                        if (!I(e[l], t[l], i, r)) return !1
                } else {
                    var u, c = v.keys(e);
                    if (l = c.length, v.keys(t).length !== l) return !1;
                    for (; l--;)
                        if (u = c[l], !v.has(t, u) || !I(e[u], t[u], i, r)) return !1
                }
                return i.pop(), r.pop(), !0
            };
            v.isEqual = function(e, t) {
                return I(e, t)
            }, v.isEmpty = function(e) {
                return null == e || (A(e) && (v.isArray(e) || v.isString(e) || v.isArguments(e)) ? 0 === e.length : 0 === v.keys(e).length)
            }, v.isElement = function(e) {
                return !(!e || 1 !== e.nodeType)
            }, v.isArray = p || function(e) {
                return "[object Array]" === h.call(e)
            }, v.isObject = function(e) {
                var t = typeof e;
                return "function" === t || "object" === t && !!e
            }, v.each(["Arguments", "Function", "String", "Number", "Date", "RegExp", "Error"], function(e) {
                v["is" + e] = function(t) {
                    return h.call(t) === "[object " + e + "]"
                }
            }), v.isArguments(arguments) || (v.isArguments = function(e) {
                return v.has(e, "callee")
            }), "function" != typeof /./ && "object" != typeof Int8Array && (v.isFunction = function(e) {
                return "function" == typeof e || !1
            }), v.isFinite = function(e) {
                return isFinite(e) && !isNaN(parseFloat(e))
            }, v.isNaN = function(e) {
                return v.isNumber(e) && e !== +e
            }, v.isBoolean = function(e) {
                return !0 === e || !1 === e || "[object Boolean]" === h.call(e)
            }, v.isNull = function(e) {
                return null === e
            }, v.isUndefined = function(e) {
                return void 0 === e
            }, v.has = function(e, t) {
                return null != e && d.call(e, t)
            }, v.noConflict = function() {
                return n._ = o, this
            }, v.identity = function(e) {
                return e
            }, v.constant = function(e) {
                return function() {
                    return e
                }
            }, v.noop = function() {}, v.property = E, v.propertyOf = function(e) {
                return null == e ? function() {} : function(t) {
                    return e[t]
                }
            }, v.matcher = v.matches = function(e) {
                return e = v.extendOwn({}, e),
                    function(t) {
                        return v.isMatch(t, e)
                    }
            }, v.times = function(e, t, i) {
                var r = Array(Math.max(0, e));
                t = y(t, i, 1);
                for (var n = 0; e > n; n++) r[n] = t(n);
                return r
            }, v.random = function(e, t) {
                return null == t && (t = e, e = 0), e + Math.floor(Math.random() * (t - e + 1))
            }, v.now = Date.now || function() {
                return (new Date).getTime()
            };
            var D = {
                    "&": "&amp;",
                    "<": "&lt;",
                    ">": "&gt;",
                    '"': "&quot;",
                    "'": "&#x27;",
                    "`": "&#x60;"
                },
                L = v.invert(D),
                B = function(e) {
                    var t = function(t) {
                            return e[t]
                        },
                        i = "(?:" + v.keys(e).join("|") + ")",
                        r = RegExp(i),
                        n = RegExp(i, "g");
                    return function(e) {
                        return e = null == e ? "" : "" + e, r.test(e) ? e.replace(n, t) : e
                    }
                };
            v.escape = B(D), v.unescape = B(L), v.result = function(e, t, i) {
                var r = null == e ? void 0 : e[t];
                return void 0 === r && (r = i), v.isFunction(r) ? r.call(e) : r
            };
            var F = 0;
            v.uniqueId = function(e) {
                var t = ++F + "";
                return e ? e + t : t
            }, v.templateSettings = {
                evaluate: /<%([\s\S]+?)%>/g,
                interpolate: /<%=([\s\S]+?)%>/g,
                escape: /<%-([\s\S]+?)%>/g
            };
            var N = /(.)^/,
                V = {
                    "'": "'",
                    "\\": "\\",
                    "\r": "r",
                    "\n": "n",
                    "\u2028": "u2028",
                    "\u2029": "u2029"
                },
                k = /\\|'|\r|\n|\u2028|\u2029/g,
                U = function(e) {
                    return "\\" + V[e]
                };
            v.template = function(e, t, i) {
                !t && i && (t = i), t = v.defaults({}, t, v.templateSettings);
                var r = RegExp([(t.escape || N).source, (t.interpolate || N).source, (t.evaluate || N).source].join("|") + "|$", "g"),
                    n = 0,
                    o = "__p+='";
                e.replace(r, function(t, i, r, s, a) {
                    return o += e.slice(n, a).replace(k, U), n = a + t.length, i ? o += "'+\n((__t=(" + i + "))==null?'':_.escape(__t))+\n'" : r ? o += "'+\n((__t=(" + r + "))==null?'':__t)+\n'" : s && (o += "';\n" + s + "\n__p+='"), t
                }), o += "';\n", t.variable || (o = "with(obj||{}){\n" + o + "}\n"), o = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + o + "return __p;\n";
                try {
                    var s = new Function(t.variable || "obj", "_", o)
                } catch (e) {
                    throw e.source = o, e
                }
                var a = function(e) {
                    return s.call(this, e, v)
                };
                return a.source = "function(" + (t.variable || "obj") + "){\n" + o + "}", a
            }, v.chain = function(e) {
                var t = v(e);
                return t._chain = !0, t
            };
            var G = function(e, t) {
                return e._chain ? v(t).chain() : t
            };
            v.mixin = function(e) {
                v.each(v.functions(e), function(t) {
                    var i = v[t] = e[t];
                    v.prototype[t] = function() {
                        var e = [this._wrapped];
                        return u.apply(e, arguments), G(this, i.apply(v, e))
                    }
                })
            }, v.mixin(v), v.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(e) {
                var t = s[e];
                v.prototype[e] = function() {
                    var i = this._wrapped;
                    return t.apply(i, arguments), "shift" !== e && "splice" !== e || 0 !== i.length || delete i[0], G(this, i)
                }
            }), v.each(["concat", "join", "slice"], function(e) {
                var t = s[e];
                v.prototype[e] = function() {
                    return G(this, t.apply(this._wrapped, arguments))
                }
            }), v.prototype.value = function() {
                return this._wrapped
            }, v.prototype.valueOf = v.prototype.toJSON = v.prototype.value, v.prototype.toString = function() {
                return "" + this._wrapped
            }, "function" == typeof define && define.amd && define("underscore", [], function() {
                return v
            })
        }.call(this),
        function(e, t) {
            "object" == typeof module && module.exports ? module.exports = t(require("underscore")) : "function" == typeof define && define.amd ? define("riveter", ["underscore"], function(i) {
                return t(i, e)
            }) : e.riveter = t(e._, e)
        }(this, function(e, t, i) {
            var r = Array.prototype.slice,
                n = function() {
                    for (var e = r.call(arguments, 0); e.length;) n.rivet(e.shift())
                };
            return n.rivet = function(e) {
                e.hasOwnProperty("extend") || (e.extend = function(t, i) {
                    return n.extend(e, t, i)
                }), e.hasOwnProperty("compose") || (e.compose = function() {
                    return n.compose.apply(this, [e].concat(r.call(arguments, 0)))
                }), e.hasOwnProperty("inherits") || (e.inherits = function(t, i) {
                    n.inherits(e, t, i)
                }), e.hasOwnProperty("mixin") || (e.mixin = function() {
                    n.mixin.apply(this, [e].concat(r.call(arguments, 0)))
                })
            }, n.inherits = function(t, i, r) {
                var o, s = function() {},
                    a = function() {
                        i.apply(this, arguments)
                    };
                return "object" == typeof t ? (t.hasOwnProperty("constructor") && (a = t.constructor), o = t) : (a = t, o = t.prototype), n.rivet(a), e.defaults(a, i, r), s.prototype = i.prototype, a.prototype = new s, e.extend(a.prototype, o, {
                    constructor: a
                }), a.__super = i, a.__super__ = i.prototype, a
            }, n.extend = function(e, t, i) {
                return n.inherits(t, e, i)
            }, n.compose = function() {
                var t = r.call(arguments, 0),
                    i = t.shift();
                n.rivet(i);
                var o = e.reduce(t, function(e, t) {
                        return t.hasOwnProperty("_preInit") && e.preInit.push(t._preInit), t.hasOwnProperty("_postInit") && e.postInit.push(t._postInit), t = t.mixin || t, e.items.push(t), e
                    }, {
                        items: [],
                        preInit: [],
                        postInit: []
                    }),
                    s = i.extend({
                        constructor: function() {
                            var t = r.call(arguments, 0);
                            e.each(o.preInit, function(e) {
                                e.apply(this, t)
                            }, this), i.prototype.constructor.apply(this, t), e.each(o.postInit, function(e) {
                                e.apply(this, t)
                            }, this)
                        }
                    });
                return n.rivet(s), e.defaults(s.prototype, e.extend.apply(null, [{}].concat(o.items))), s
            }, n.mixin = function() {
                var t = r.call(arguments, 0),
                    i = t.shift();
                n.rivet(i), e.defaults(i.prototype, e.extend.apply(null, [{}].concat(t)))
            }, n
        }),
        function(e, t) {
            "object" == typeof module && module.exports ? module.exports = function(e) {
                return t(require("lodash"), e, require("riveter"))
            } : "function" == typeof define && define.amd ? define("postal.federation", ["lodash", "postal", "riveter"], function(i, r, n) {
                return t(i, r, n, e)
            }) : e.postal = t(e._, e.postal, e.riveter, e)
        }(this, function(e, t, i, r, n) {
            function o(e) {
                t.fedx.signalReady.apply(this, e)
            }

            function s(e) {
                t.fedx.send.apply(this, e)
            }

            function a(e) {
                t.fedx.onFederatedMsg.call(this, e)
            }
            t.createUUID || (t.createUUID = function() {
                for (var e = [], t = "0123456789abcdef", i = 0; i < 36; i++) e[i] = t.substr(Math.floor(16 * Math.random()), 1);
                return e[14] = "4", e[19] = t.substr(3 & e[19] | 8, 1), e[8] = e[13] = e[18] = e[23] = "-", e.join("")
            }), t.instanceId || (t.instanceId = function() {
                var e, i;
                return function(r) {
                    return r && (i = e, e = r, t.publish({
                        channel: t.configuration.SYSTEM_CHANNEL,
                        topic: "instanceId.changed",
                        data: {
                            oldId: i,
                            newId: e
                        }
                    })), e
                }
            }());
            var l = function() {},
                u = !1,
                c = [],
                h = [],
                d = [],
                p = {
                    enabled: !0,
                    filterMode: "whitelist",
                    filterDirection: "both"
                },
                f = p,
                _ = function(i, r, n) {
                    var o = Object.prototype.hasOwnProperty.call(t.fedx.filters[n], i),
                        s = o && e.any(t.fedx.filters[n][i], function(e) {
                            return t.configuration.resolver.compare(e, r)
                        }),
                        a = "blacklist" === f.filterMode;
                    return f.enabled && (a && (!o || o && !s) || !a && o && s)
                },
                m = {
                    ping: function() {
                        return {
                            type: "federation.ping",
                            instanceId: t.instanceId(),
                            timeStamp: new Date,
                            ticket: t.createUUID()
                        }
                    },
                    pong: function(e) {
                        return {
                            type: "federation.pong",
                            instanceId: t.instanceId(),
                            timeStamp: new Date,
                            pingData: {
                                instanceId: e.instanceId,
                                timeStamp: e.timeStamp,
                                ticket: e.ticket
                            }
                        }
                    },
                    message: function(e) {
                        return {
                            type: "federation.message",
                            instanceId: t.instanceId(),
                            timeStamp: new Date,
                            envelope: e
                        }
                    },
                    disconnect: function() {
                        return {
                            type: "federation.disconnect",
                            instanceId: t.instanceId(),
                            timeStamp: new Date
                        }
                    },
                    bundle: function(e) {
                        return {
                            type: "federation.bundle",
                            instanceId: t.instanceId(),
                            timeStamp: new Date,
                            packingSlips: e
                        }
                    }
                },
                g = {
                    "federation.ping": function(e) {
                        e.source.setInstanceId(e.packingSlip.instanceId), e.source.handshakeComplete ? e.source.sendPong(e.packingSlip) : e.source.sendBundle([t.fedx.getPackingSlip("pong", e.packingSlip), t.fedx.getPackingSlip("ping")])
                    },
                    "federation.pong": function(i) {
                        i.source.handshakeComplete = !0, i.source.setInstanceId(i.packingSlip.instanceId), i.source.pings[i.packingSlip.pingData.ticket] && (i.source.pings[i.packingSlip.pingData.ticket].callback({
                            ticket: i.packingSlip.pingData.ticket,
                            instanceId: i.packingSlip.instanceId,
                            source: i.source
                        }), i.source.pings[i.packingSlip.pingData.ticket] = n), e.contains(t.fedx.clients, i.packingSlip.instanceId) || t.fedx.clients.push(i.packingSlip.instanceId), t.publish({
                            channel: "postal.federation",
                            topic: "client.federated",
                            data: {
                                remoteId: i.source.instanceId,
                                localId: t.instanceId(),
                                transport: i.transport
                            }
                        })
                    },
                    "federation.disconnect": function(i) {
                        t.fedx.clients = e.without(t.fedx.clients, i.source.instanceId), t.fedx.disconnect({
                            transport: i.source.transportName,
                            instanceId: i.source.instanceId,
                            doNotNotify: !0
                        })
                    },
                    "federation.message": function(e) {
                        var i = e.packingSlip.envelope;
                        _(i.channel, i.topic, "in") && (i.lastSender = e.packingSlip.instanceId, t.publish(i))
                    },
                    "federation.bundle": function(i) {
                        e.each(i.packingSlip.packingSlips, function(r) {
                            t.fedx.onFederatedMsg(e.extend({}, i, {
                                packingSlip: r
                            }))
                        })
                    }
                },
                v = function(e, t, i) {
                    this.target = e, this.options = t || {}, this.pings = {}, this.instanceId = i, this.handshakeComplete = !1
                };
            return v.prototype.sendPing = function(e) {
                var i = t.fedx.getPackingSlip("ping");
                this.pings[i.ticket] = {
                    ticket: i.ticket,
                    callback: e || l
                }, this.send(i)
            }, v.prototype.sendPong = function(e) {
                this.send(t.fedx.getPackingSlip("pong", e))
            }, v.prototype.sendBundle = function(e) {
                this.send(t.fedx.getPackingSlip("bundle", e))
            }, v.prototype.sendMessage = function(i) {
                if (this.handshakeComplete) {
                    i.originId = i.originId || t.instanceId();
                    var r = e.clone(i);
                    !this.instanceId || this.instanceId === r.lastSender || r.knownIds && r.knownIds.length && (!r.knownIds || e.include(r.knownIds, this.instanceId)) || (r.knownIds = (r.knownIds || []).concat(e.without(t.fedx.clients, this.instanceId)), this.send(t.fedx.getPackingSlip("message", r)))
                }
            }, v.prototype.disconnect = function() {
                this.send(t.fedx.getPackingSlip("disconnect"))
            }, v.prototype.onMessage = function(e) {
                this.shouldProcess() && t.fedx.onFederatedMsg({
                    transport: this.transportName,
                    packingSlip: e,
                    source: this
                })
            }, v.prototype.shouldProcess = function() {
                return !0
            }, v.prototype.send = function() {
                throw new Error("An object deriving from FederationClient must provide an implementation for 'send'.")
            }, v.prototype.setInstanceId = function(e) {
                this.instanceId = e
            }, i(v), t.fedx = e.extend({
                FederationClient: v,
                packingSlips: m,
                handlers: g,
                clients: [],
                transports: {},
                filters: { in: {},
                    out: {}
                },
                addFilter: function(t) {
                    t = e.isArray(t) ? t : [t], e.each(t, function(t) {
                        t.direction = t.direction || f.filterDirection, e.each("both" === t.direction ? ["in", "out"] : [t.direction], function(i) {
                            this.filters[i][t.channel] ? e.include(this.filters[i][t.channel], t.topic) || this.filters[i][t.channel].push(t.topic) : this.filters[i][t.channel] = [t.topic]
                        }, this)
                    }, this)
                },
                removeFilter: function(t) {
                    t = e.isArray(t) ? t : [t], e.each(t, function(t) {
                        t.direction = t.direction || f.filterDirection, e.each("both" === t.direction ? ["in", "out"] : [t.direction], function(i) {
                            this.filters[i][t.channel] && e.include(this.filters[i][t.channel], t.topic) && (this.filters[i][t.channel] = e.without(this.filters[i][t.channel], t.topic))
                        }, this)
                    }, this)
                },
                canSendRemote: function(e, t) {
                    return _(e, t, "out")
                },
                configure: function(t) {
                    if (t && t.filterMode && "blacklist" !== t.filterMode && "whitelist" !== t.filterMode) throw new Error("postal.fedx filterMode must be 'blacklist' or 'whitelist'.");
                    return t && (f = e.defaults(t, p)), f
                },
                getPackingSlip: function(e) {
                    if (Object.prototype.hasOwnProperty.call(m, e)) return m[e].apply(this, Array.prototype.slice.call(arguments, 1))
                },
                onFederatedMsg: function(e) {
                    if (!u) return void c.push(e);
                    if (!Object.prototype.hasOwnProperty.call(g, e.packingSlip.type)) throw new Error("postal.federation does not have a message handler for '" + e.packingSlip.type + "'.");
                    g[e.packingSlip.type](e)
                },
                sendMessage: function(t) {
                    if (!u) return void h.push(arguments);
                    e.each(this.transports, function(e) {
                        e.sendMessage(t)
                    })
                },
                disconnect: function(t) {
                    t = t || {};
                    var i = this.transports;
                    t.transport && (i = {}, i[t.transport] = this.transports[t.transport]), e.each(i, function(e) {
                        e.disconnect({
                            target: t.target,
                            instanceId: t.instanceId,
                            doNotNotify: !!t.doNotNotify
                        })
                    }, this)
                },
                _getTransports: function() {
                    return e.reduce(this.transports, function(e, t, i) {
                        return e[i] = !0, e
                    }, {})
                },
                signalReady: function(t, i, r) {
                    if (!u) return void d.push(arguments);
                    var n = this._getTransports();
                    switch (arguments.length) {
                        case 1:
                            "function" == typeof t ? r = t : "string" == typeof t && (n = {}, n[t] = this.transports[t], r = l);
                            break;
                        case 2:
                            "string" == typeof t ? (n = {}, n[t] = this.transports[t]) : n = t, r = i || l;
                            break;
                        case 3:
                            n = {}, n[t] = [i]
                    }
                    e.each(n, function(e, t) {
                        e = "boolean" == typeof e ? [] : e, this.transports[t].signalReady(e, r)
                    }, this)
                }
            }, t.fedx), t.addWireTap(function(e, i) {
                t.fedx.canSendRemote(i.channel, i.topic) && t.fedx.sendMessage(i)
            }), t.subscribe({
                channel: t.configuration.SYSTEM_CHANNEL,
                topic: "instanceId.changed",
                callback: function() {
                    for (u = !0; d.length;) o(d.shift());
                    for (; h.length;) s(h.shift());
                    for (; c.length;) a(c.shift())
                }
            }), t.instanceId() !== n && (u = !0), t
        }),
        function(e, t) {
            "function" == typeof define && define.amd ? define("xframe", ["lodash", "postal.federation"], function(i, r) {
                return t(i, r, e)
            }) : "object" == typeof module && module.exports ? module.exports = function(e) {
                return t(require("lodash"), e)
            } : e.postal = t(e._, e.postal, e)
        }(this, function(e, t, i, r) {
            function n() {
                g.routeMessage.apply(g, arguments)
            }

            function o(t) {
                for (var i in t) t.hasOwnProperty(i) && ("function" == typeof t[i] && delete t[i], e.isPlainObject(t[i]) && o(t[i]), e.isArray(t[i]) && e.each(t[i], o));
                return t
            }
            var s = location.origin || location.protocol + "//" + location.host,
                a = /MSIE [8,9]/.test(navigator.userAgent),
                l = function(t, i) {
                    var r = e.find(this.remotes, function(e) {
                        return e.instanceId === i
                    });
                    return r && t.push(r), t
                },
                u = function(t, i) {
                    var r = e.find(this.remotes, function(e) {
                        return e.target === i
                    });
                    return r && t.push(r), t
                },
                c = function(e) {
                    e.disconnect()
                },
                h = "undefined" == typeof window && postMessage && location,
                d = [],
                p = function() {},
                f = {
                    allowedOrigins: [s],
                    enabled: !0,
                    defaultOriginUrl: "*",
                    safeSerialize: !1
                },
                _ = e.extend({}, f),
                m = t.fedx.FederationClient.extend({
                    transportName: "xframe",
                    shouldProcess: function() {
                        var t = !!_.allowedOrigins.length;
                        return _.enabled && ("*" === this.options.origin || t && e.contains(_.allowedOrigins, this.options.origin) || !t || this.options.isWorker && e.contains(d, this.target) || h)
                    },
                    send: function(e) {
                        var i, r;
                        this.shouldProcess() && (r = h ? null : this.target, i = [t.fedx.transports.xframe.wrapForTransport(e)], this.options.isWorker || h || i.push(this.options.origin), h ? this.target.postMessage.apply(r, i) : 1 === i.length ? this.target.postMessage(i[0]) : this.target.postMessage(i[0], i[1]))
                    }
                }, {
                    getInstance: function(e, t, i) {
                        var r = new m(e, {
                            origin: t,
                            isWorker: "undefined" != typeof Worker && e instanceof Worker
                        }, i);
                        return r.options.isWorker && g.listenToWorker(r.target), r
                    }
                }),
                g = t.fedx.transports.xframe = {
                    eagerSerialize: a,
                    XFrameClient: m,
                    configure: function(t) {
                        return t && (_ = e.defaults(e.extend(_, t), f)), _
                    },
                    clearConfiguration: function() {
                        _ = e.extend({}, f)
                    },
                    getTargets: h ? function() {
                        return [{
                            target: {
                                postMessage: postMessage
                            }
                        }]
                    } : function() {
                        var t = e.map(document.getElementsByTagName("iframe"), function(e) {
                            var t = document.createElement("a");
                            t.href = e.src;
                            var i = t.protocol + "//" + t.host;
                            return "//" === i && (i = null), {
                                target: e.contentWindow,
                                origin: i || _.defaultOriginUrl
                            }
                        });
                        return window.parent && window.parent !== window && t.push({
                            target: window.parent,
                            origin: "*"
                        }), t.concat(d)
                    },
                    remotes: [],
                    wrapForTransport: a ? function(e) {
                        return JSON.stringify({
                            postal: !0,
                            packingSlip: e
                        })
                    } : function(e) {
                        return {
                            postal: !0,
                            packingSlip: e
                        }
                    },
                    unwrapFromTransport: function(e) {
                        if ("string" != typeof e || !a && -1 === e.indexOf('"postal":true')) return e;
                        try {
                            return JSON.parse(e)
                        } catch (e) {
                            return {}
                        }
                    },
                    routeMessage: function(i) {
                        var r = i.source || i.currentTarget,
                            n = this.unwrapFromTransport(i.data);
                        if (n.postal) {
                            t.instanceId();
                            var o = e.find(this.remotes, function(e) {
                                return e.target === r
                            });
                            o || (o = m.getInstance(r, i.origin, n.packingSlip.instanceId), this.remotes.push(o)), o.onMessage(n.packingSlip)
                        }
                    },
                    sendMessage: function(t) {
                        var i = t;
                        _.safeSerialize && (i = o(e.cloneDeep(t))), e.each(this.remotes, function(e) {
                            e.sendMessage(i)
                        })
                    },
                    disconnect: function(t) {
                        t = t || {};
                        var i = t.instanceId ? e.reduce(e.isArray(t.instanceId) ? t.instanceId : [t.instanceId], l, [], this) : t.target ? e.reduce(e.isArray(t.target) ? t.target : [t.target], u, [], this) : this.remotes;
                        t.doNotNotify || e.each(i, c, this), this.remotes = e.without.apply(null, [this.remotes].concat(i))
                    },
                    signalReady: function(t, i) {
                        t = e.isArray(t) ? t : [t], t = t.length ? t : this.getTargets(), i = i || p, e.each(t, function(t) {
                            if (t.target) {
                                t.origin = t.origin || _.defaultOriginUrl;
                                var r = e.find(this.remotes, function(e) {
                                    return e.target === t.target
                                });
                                r || (r = m.getInstance(t.target, t.origin), this.remotes.push(r)), r.sendPing(i)
                            }
                        }, this)
                    },
                    addEventListener: h ? function() {
                        addEventListener("message", n)
                    } : function(e, t, i, r) {
                        "undefined" != typeof window && ("addEventListener" in e ? e.addEventListener(t, i, r) : e.attachEvent("on" + t, i))
                    },
                    listenToWorker: function(t) {
                        e.include(d, t) || (t.addEventListener("message", n), d.push(t))
                    },
                    stopListeningToWorker: function(t) {
                        if (t) t.removeEventListener("message", n), d = e.without(d, t);
                        else
                            for (; d.length;) d.pop().removeEventListener("message", n)
                    }
                };
            return g.addEventListener(this, "message", n, !1), t
        }),
        function(e, t) {
            "function" == typeof define && define.amd ? define("request-response", ["lodash", "postal"], function(i, r) {
                return t(i, r, e)
            }) : "object" == typeof module && module.exports ? module.exports = function(e) {
                return t(require("lodash"), e, this)
            } : e.postal = t(e._, e.postal, e)
        }(this, function(e, t, i, r) {
            t.configuration.promise = {
                createDeferred: function() {
                    throw new Error("You need to provide an implementation for postal.configuration.promise.createDeferred that returns a deferred/promise instance.")
                },
                getPromise: function() {
                    throw new Error("You need to provide an implementation for postal.configuration.promise.getPromise that returns a promise safe for consuming APIs to use.")
                },
                fulfill: "resolve",
                fail: "reject"
            };
            var n = function() {
                for (var e = {}, t = [], i = 0; i < 256; i++) t[i] = (i < 16 ? "0" : "") + i.toString(16);
                return e.create = function() {
                    var e = 4294967295 * Math.random() | 0,
                        i = 4294967295 * Math.random() | 0,
                        r = 4294967295 * Math.random() | 0,
                        n = 4294967295 * Math.random() | 0;
                    return t[255 & e] + t[e >> 8 & 255] + t[e >> 16 & 255] + t[e >> 24 & 255] + "-" + t[255 & i] + t[i >> 8 & 255] + "-" + t[i >> 16 & 15 | 64] + t[i >> 24 & 255] + "-" + t[63 & r | 128] + t[r >> 8 & 255] + "-" + t[r >> 16 & 255] + t[r >> 24 & 255] + t[255 & n] + t[n >> 8 & 255] + t[n >> 16 & 255] + t[n >> 24 & 255]
                }, e
            }();
            t.ChannelDefinition.prototype.request = function(e) {
                var i = e.envelope ? e.envelope : {
                        topic: e.topic,
                        data: e.data,
                        headers: e.headers
                    },
                    r = n.create(),
                    o = e.replyTopic || r,
                    s = e.replyChannel || "postal.request-response",
                    a = t.configuration.promise.createDeferred();
                i.headers = i.headers || {}, i.headers.replyable = !0, i.headers.requestId = r, i.headers.replyTopic = o, i.headers.replyChannel = s;
                t.subscribe({
                    channel: s,
                    topic: o,
                    callback: function(e, i) {
                        i.headers && i.headers.isError ? a[t.configuration.promise.fail](e) : a[t.configuration.promise.fulfill](e)
                    }
                }).once();
                return e.timeout && setTimeout(function() {
                    a[t.configuration.promise.fail](new Error("Timeout limit exceeded for request."))
                }, e.timeout), this.publish(i), t.configuration.promise.getPromise(a)
            };
            var o = t.publish;
            return t.publish = function(e) {
                e.headers && e.headers.replyable && (e.reply = function(i, r) {
                    t.publish({
                        channel: e.headers.replyChannel,
                        topic: e.headers.replyTopic,
                        headers: {
                            isReply: !0,
                            isError: !!i,
                            requestId: e.headers.requestId,
                            resolverNoCache: !0
                        },
                        data: i || r
                    })
                }), o.call(this, e)
            }, t
        }), define("skbJet/component/gameMsgBus/PlatformMessageBus", ["postal", "promise", "postal.federation", "xframe", "request-response"], function(e, t) {
            "use strict";

            function i(i) {
                if (0 === arguments.length) throw new Error("Message Bus Configuration Payload cannot be empty, malformed or undefined");
                return a = i, e.instanceId("Game"), e.fedx.transports.xframe.configure({
                    allowedOrigins: i.allowedDomains,
                    defaultOriginUrl: i.defaultOrigin,
                    filterMode: "blacklist",
                    safeSerialize: !0
                }), e.configuration.promise.createDeferred = function() {
                    return t.defer()
                }, e.configuration.promise.getPromise = function(e) {
                    return e.promise
                }, i.channels && e.fedx.addFilter(i.channels), e.fedx.signalReady(function() {}), !0
            }

            function r(t) {
                e.publish(t)
            }

            function n(t, i, r) {
                e.channel(t.channel).request(t).then(i, r)
            }

            function o(t) {
                e.subscribe(t)
            }

            function s(t) {
                e.unsubscribe(t)
            }
            var a;
            return function() {
                return Object.freeze({
                    init: i,
                    publish: r,
                    subscribe: o,
                    unsubscribe: s,
                    getPostal: e,
                    request: n
                })
            }
        }), define("skbJet/component/gameMsgBus/PlatformMsgBusAdapter", ["skbJet/component/gameMsgBus/GameMsgBus", "skbJet/component/gameMsgBus/PlatformMessageBus"], function(e, t) {
            function i() {}
            var r = t();
            r.init({
                allowedDomains: ["*"],
                channels: [{
                    channel: "Kernel",
                    topic: "#",
                    direction: "both"
                }, {
                    channel: "ClientService",
                    topic: "#",
                    direction: "both"
                }, {
                    channel: "ConsoleService",
                    topic: "#",
                    direction: "both"
                }, {
                    channel: "Game",
                    topic: "#",
                    direction: "both"
                }, {
                    channel: "postal.request-response",
                    topic: "#",
                    direction: "both"
                }]
            }), r.getPostal.addWireTap(function(t, i) {
                "postal" === i.channel || "postal.federation" === i.channel || i._fromGame || setTimeout(function() {
                    e.publish("platformMsg/" + i.channel + "/" + i.topic, i.data)
                }, 0)
            }), e.subscribe("toPlatform", function(e) {
                e._fromGame = !0, r.publish(e)
            }), e.subscribe("toPlatformRequest", function(e) {
                r.request({
                    channel: e.channel,
                    topic: e.topic,
                    data: e.data
                }, e.successCallback, e.failCallback)
            }), e.subscribe("error", function(e) {
                var t = e;
                e.errorCode || (t = {
                    errorCode: "GM-001",
                    message: "" + e
                }), r.publish({
                    channel: "Game",
                    topic: "ErrorHandler.Throw",
                    data: t
                })
            });
            var n = null;
            return r.getPostal.channel("ClientService").subscribe("StateChange", function(t, r) {
                n = function() {
                    n = i, r.reply(null, {
                        state: t.state
                    })
                }, e.publish(t.state, t)
            }), e.subscribe("nextState", function() {
                n && n()
            }), {}
        }), define("game/data/gameEvents", ["skbJet/component/gameMsgBus/GameMsgBus"], function(e) {
            return {
                publish: function(t, i) {
                    void 0 === i && (i = {}), i.type = t, e.publish(t, i)
                },
                ON_STAGE_CHANGE: "onStageChange",
                ON_TRASITION_DONE: "onTransitionDone",
                PLATFORM_TO_PLATFORM: "toPlatform",
                PLATFORM_GAME_INIT: "platformMsg/ClientService/Game.Init",
                GAME_INIT: "gameInit",
                PLATFORM_SYSTEM_INIT: "platformMsg/Kernel/System.Init",
                PLATFORM_UPDATE_BALANCE: "platformMsg/ClientService/Account.Balances",
                PLATFORM_CONSOLE_BET_UPDATE: "platformMsg/ConsoleService/Game.Control",
                PLATFORM_REQUEST: "toPlatformRequest",
                PLATFORM_STOP_AUTO_SPIN: "platformMsg/ClientService/Game.StopAutoSpin",
                RESOURCES_LOAD_PROGRESS: "resourceLoader.loadProgress",
                ORIENTATION_CHANGED: "orientationChanged",
                HELP_FILES_ENABLE: "helpFiles.enableConsole",
                MAX_WIN_ACHIEVED: "maxWinAchieved",
                MAX_WIN_CLOSE: "maxWinClose",
                MAX_WIN_COMPLETE: "maxWinComplete",
                ON_BEFORE_SHOW_STAGE: "onBeforeShowStage",
                ON_BEFORE_REQUEST: "onBeforeRequest",
                ON_RESOLVE_STAGE: "onResolveStage",
                ON_START_ROLLUP: "onStartRollup",
                ON_BEGIN_NEW_GAME: "onBeginNewGame",
                ON_EXIT_STAGE: "onExitStage",
                ON_ABORT_NEXT_STAGE: "onAbortNextStage",
                ON_RESET_NEXT_STAGE: "onResetNextStage",
                ON_ENTER_NEXT_STAGE: "onEnterNextStage",
                ON_START_GAME_INITIAL: "onStartGameInitial",
                ON_START_PROGRESS_STAGE: "onStartGameInProgressStage",
                ON_START_PROGRESS_NEXT_STAGE: "onStartGameInProgressNextStage",
                ON_MAKE_REQUEST: "onMakeRequest",
                ON_END_GAME: "onEndGame",
                ON_IN_PROGRESS_STAGE: "onInProgressStage",
                AUTOPLAY_END: "AutoSpinController.autoSpinEnd",
                AUTOPLAY_START: "AutoSpinController.autoSpinStart",
                AUTOPLAY_PROMPT_CLOSED: "AutoSpin.promptClosed",
                AUTOPLAY_PROMPT_OPEN: "AutoSpin.promptOpen",
                SHOW_FREE_SPINS: "showFreeSpins",
                START_FREE_SPINS_TRANSITION: "startFreeSpinsTransition",
                START_BASE_GAME_TRANSITION: "startBaseGameTransition",
                SHOW_FREE_SPINS_INTRO_PANEL: "showFreeSpinsIntro",
                ENTER_FREE_SPINS: "enterFreeSpins",
                SHOW_FREE_SPINS_CONGRATS: "showFreeSpinsCongrats",
                EXIT_FREE_SPINS: "exitFreeSpins",
                EXIT_FREE_SPINS_SHOW_WINLINES: "exotFreeSpinsShowWinlines",
                FREE_SPINS_DO_FLY_IN: "doFlyIn",
                FREE_SPINS_EXIT_FLY_IN: "exitFlyIn",
                FREE_SPINS_EXTRA_SPINS_AWARDED: "extraSpinsAwarded",
                FREE_SPINS_EXTRA_SPINS_CLOSED: "extraSpinsClosed",
                SHOW_BASE_GAME: "showBaseGame",
                BET_INCREMENT: "betIncrement",
                BET_DECREMENT: "betDecrement",
                HIDE_STATIC_WINLINE_SYMBOLS: "hideStaticWinlineSymbols",
                HIDE_STATIC_SD_SYMBOLS: "hideStaticSDSymbols",
                SHOW_STATIC_SYMBOLS: "showStaticWinlineSymbols",
                SET_REEL_WILDS: "setReelWilds",
                UPDATE_FOOTER: "updateFooter",
                ENABLE_AUTOPLAY: "enableAutoplay",
                DISABLE_AUTOPLAY: "disableAutoplay",
                START_ROLLUP: "startRollup",
                START_BIG_WIN_ROLLUP: "startBigWinRollup",
                START_MULTIPLIER_ROLLUP: "startMultiplierRollup",
                FINAL_MULTIPLIER_ROLLUP: "finalMultiplierRollup",
                END_MULTIPLIER: "endMultiplier",
                REEL_STOPPED: "reelStopped",
                SKIP_WIN: "skipWin",
                SKIP_HIDE: "skipHide",
                SKIP_SHOW: "skipShow",
                RECOVERY_SET_ANTICIPATION: "recoverySetAnticipation",
                RECOVERY_SHOW_PLAY: "recoveryShowPlay",
                RECOVERY_SETUP_AFTER_DATA_PROCESSED: "recoverySetupAfterDataProcessed",
                SHOW_WINLINES: "showWinlines",
                PATTERN_PAY: "patternPay",
                WINLINES_CLEARED: "winlinesCleared",
                SHOW_MAX_WIN_SKIP_BUTTON: "showMaxWinSkipButton",
                SHOW_PUNCH_A_BUNCH_INTRO_PANEL: "showBunchABunchIntro",
                START_PUNCH_A_BUNCH_TRANSITION: "startPunchABunchTransition",
                MOD4_START_FIRST_WINLINES: "mod4StartFirstRollup",
                MOD4_START_REWIND_ANIM: "mod4StartRewindAnim",
                MOD4_START_REVERSE_SPIN: "mod4StartReverseSpin",
                BONUS_SYMBOL_TRACKING: "bonusSymbolTracking",
                DEBUG_DATA: "debugData"
            }
        }),
        function(e) {
            if ("object" == typeof exports && "undefined" != typeof module) module.exports = e();
            else if ("function" == typeof define && define.amd) define("com/pixijs/pixi", [], e);
            else {
                var t;
                t = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, t.PIXI = e()
            }
        }(function() {
            var e;
            return function() {
                function e(t, i, r) {
                    function n(s, a) {
                        if (!i[s]) {
                            if (!t[s]) {
                                var l = "function" == typeof require && require;
                                if (!a && l) return l(s, !0);
                                if (o) return o(s, !0);
                                var u = new Error("Cannot find module '" + s + "'");
                                throw u.code = "MODULE_NOT_FOUND", u
                            }
                            var c = i[s] = {
                                exports: {}
                            };
                            t[s][0].call(c.exports, function(e) {
                                var i = t[s][1][e];
                                return n(i || e)
                            }, c, c.exports, e, t, i, r)
                        }
                        return i[s].exports
                    }
                    for (var o = "function" == typeof require && require, s = 0; s < r.length; s++) n(r[s]);
                    return n
                }
                return e
            }()({
                1: [function(e, t, i) {
                    "use strict";
                    "use restrict";

                    function r(e) {
                        var t = 32;
                        return e &= -e, e && t--, 65535 & e && (t -= 16), 16711935 & e && (t -= 8), 252645135 & e && (t -= 4), 858993459 & e && (t -= 2), 1431655765 & e && (t -= 1), t
                    }
                    i.INT_BITS = 32, i.INT_MAX = 2147483647, i.INT_MIN = -1 << 31, i.sign = function(e) {
                        return (e > 0) - (e < 0)
                    }, i.abs = function(e) {
                        var t = e >> 31;
                        return (e ^ t) - t
                    }, i.min = function(e, t) {
                        return t ^ (e ^ t) & -(e < t)
                    }, i.max = function(e, t) {
                        return e ^ (e ^ t) & -(e < t)
                    }, i.isPow2 = function(e) {
                        return !(e & e - 1 || !e)
                    }, i.log2 = function(e) {
                        var t, i;
                        return t = (e > 65535) << 4, e >>>= t, i = (e > 255) << 3, e >>>= i, t |= i, i = (e > 15) << 2, e >>>= i, t |= i, i = (e > 3) << 1, e >>>= i, (t |= i) | e >> 1
                    }, i.log10 = function(e) {
                        return e >= 1e9 ? 9 : e >= 1e8 ? 8 : e >= 1e7 ? 7 : e >= 1e6 ? 6 : e >= 1e5 ? 5 : e >= 1e4 ? 4 : e >= 1e3 ? 3 : e >= 100 ? 2 : e >= 10 ? 1 : 0
                    }, i.popCount = function(e) {
                        return e -= e >>> 1 & 1431655765, 16843009 * ((e = (858993459 & e) + (e >>> 2 & 858993459)) + (e >>> 4) & 252645135) >>> 24
                    }, i.countTrailingZeros = r, i.nextPow2 = function(e) {
                        return e += 0 === e, --e, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, (e |= e >>> 16) + 1
                    }, i.prevPow2 = function(e) {
                        return e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, (e |= e >>> 16) - (e >>> 1)
                    }, i.parity = function(e) {
                        return e ^= e >>> 16, e ^= e >>> 8, e ^= e >>> 4, 27030 >>> (e &= 15) & 1
                    };
                    var n = new Array(256);
                    ! function(e) {
                        for (var t = 0; t < 256; ++t) {
                            var i = t,
                                r = t,
                                n = 7;
                            for (i >>>= 1; i; i >>>= 1) r <<= 1, r |= 1 & i, --n;
                            e[t] = r << n & 255
                        }
                    }(n), i.reverse = function(e) {
                        return n[255 & e] << 24 | n[e >>> 8 & 255] << 16 | n[e >>> 16 & 255] << 8 | n[e >>> 24 & 255]
                    }, i.interleave2 = function(e, t) {
                        return e &= 65535, e = 16711935 & (e | e << 8), e = 252645135 & (e | e << 4), e = 858993459 & (e | e << 2), e = 1431655765 & (e | e << 1), t &= 65535, t = 16711935 & (t | t << 8), t = 252645135 & (t | t << 4), t = 858993459 & (t | t << 2), t = 1431655765 & (t | t << 1), e | t << 1
                    }, i.deinterleave2 = function(e, t) {
                        return e = e >>> t & 1431655765, e = 858993459 & (e | e >>> 1), e = 252645135 & (e | e >>> 2), e = 16711935 & (e | e >>> 4), (e = 65535 & (e | e >>> 16)) << 16 >> 16
                    }, i.interleave3 = function(e, t, i) {
                        return e &= 1023, e = 4278190335 & (e | e << 16), e = 251719695 & (e | e << 8), e = 3272356035 & (e | e << 4), e = 1227133513 & (e | e << 2), t &= 1023, t = 4278190335 & (t | t << 16), t = 251719695 & (t | t << 8), t = 3272356035 & (t | t << 4), t = 1227133513 & (t | t << 2), e |= t << 1, i &= 1023, i = 4278190335 & (i | i << 16), i = 251719695 & (i | i << 8), i = 3272356035 & (i | i << 4), i = 1227133513 & (i | i << 2), e | i << 2
                    }, i.deinterleave3 = function(e, t) {
                        return e = e >>> t & 1227133513, e = 3272356035 & (e | e >>> 2), e = 251719695 & (e | e >>> 4), e = 4278190335 & (e | e >>> 8), (e = 1023 & (e | e >>> 16)) << 22 >> 22
                    }, i.nextCombination = function(e) {
                        var t = e | e - 1;
                        return t + 1 | (~t & -~t) - 1 >>> r(e) + 1
                    }
                }, {}],
                2: [function(e, t, i) {
                    "use strict";

                    function r(e, t, i) {
                        i = i || 2;
                        var r = t && t.length,
                            o = r ? t[0] * i : e.length,
                            a = n(e, 0, o, i, !0),
                            l = [];
                        if (!a || a.next === a.prev) return l;
                        var u, c, d, p, f, _, m;
                        if (r && (a = h(e, t, a, i)), e.length > 80 * i) {
                            u = d = e[0], c = p = e[1];
                            for (var g = i; g < o; g += i) f = e[g], _ = e[g + 1], f < u && (u = f), _ < c && (c = _), f > d && (d = f), _ > p && (p = _);
                            m = Math.max(d - u, p - c), m = 0 !== m ? 1 / m : 0
                        }
                        return s(a, l, i, u, c, m), l
                    }

                    function n(e, t, i, r, n) {
                        var o, s;
                        if (n === w(e, t, i, r) > 0)
                            for (o = t; o < i; o += r) s = M(o, e[o], e[o + 1], s);
                        else
                            for (o = i - r; o >= t; o -= r) s = M(o, e[o], e[o + 1], s);
                        return s && T(s, s.next) && (R(s), s = s.next), s
                    }

                    function o(e, t) {
                        if (!e) return e;
                        t || (t = e);
                        var i, r = e;
                        do {
                            if (i = !1, r.steiner || !T(r, r.next) && 0 !== x(r.prev, r, r.next)) r = r.next;
                            else {
                                if (R(r), (r = t = r.prev) === r.next) break;
                                i = !0
                            }
                        } while (i || r !== t);
                        return t
                    }

                    function s(e, t, i, r, n, h, d) {
                        if (e) {
                            !d && h && _(e, r, n, h);
                            for (var p, f, m = e; e.prev !== e.next;)
                                if (p = e.prev, f = e.next, h ? l(e, r, n, h) : a(e)) t.push(p.i / i), t.push(e.i / i), t.push(f.i / i), R(e), e = f.next, m = f.next;
                                else if ((e = f) === m) {
                                d ? 1 === d ? (e = u(e, t, i), s(e, t, i, r, n, h, 2)) : 2 === d && c(e, t, i, r, n, h) : s(o(e), t, i, r, n, h, 1);
                                break
                            }
                        }
                    }

                    function a(e) {
                        var t = e.prev,
                            i = e,
                            r = e.next;
                        if (x(t, i, r) >= 0) return !1;
                        for (var n = e.next.next; n !== e.prev;) {
                            if (y(t.x, t.y, i.x, i.y, r.x, r.y, n.x, n.y) && x(n.prev, n, n.next) >= 0) return !1;
                            n = n.next
                        }
                        return !0
                    }

                    function l(e, t, i, r) {
                        var n = e.prev,
                            o = e,
                            s = e.next;
                        if (x(n, o, s) >= 0) return !1;
                        for (var a = n.x < o.x ? n.x < s.x ? n.x : s.x : o.x < s.x ? o.x : s.x, l = n.y < o.y ? n.y < s.y ? n.y : s.y : o.y < s.y ? o.y : s.y, u = n.x > o.x ? n.x > s.x ? n.x : s.x : o.x > s.x ? o.x : s.x, c = n.y > o.y ? n.y > s.y ? n.y : s.y : o.y > s.y ? o.y : s.y, h = g(a, l, t, i, r), d = g(u, c, t, i, r), p = e.prevZ, f = e.nextZ; p && p.z >= h && f && f.z <= d;) {
                            if (p !== e.prev && p !== e.next && y(n.x, n.y, o.x, o.y, s.x, s.y, p.x, p.y) && x(p.prev, p, p.next) >= 0) return !1;
                            if (p = p.prevZ, f !== e.prev && f !== e.next && y(n.x, n.y, o.x, o.y, s.x, s.y, f.x, f.y) && x(f.prev, f, f.next) >= 0) return !1;
                            f = f.nextZ
                        }
                        for (; p && p.z >= h;) {
                            if (p !== e.prev && p !== e.next && y(n.x, n.y, o.x, o.y, s.x, s.y, p.x, p.y) && x(p.prev, p, p.next) >= 0) return !1;
                            p = p.prevZ
                        }
                        for (; f && f.z <= d;) {
                            if (f !== e.prev && f !== e.next && y(n.x, n.y, o.x, o.y, s.x, s.y, f.x, f.y) && x(f.prev, f, f.next) >= 0) return !1;
                            f = f.nextZ
                        }
                        return !0
                    }

                    function u(e, t, i) {
                        var r = e;
                        do {
                            var n = r.prev,
                                o = r.next.next;
                            !T(n, o) && E(n, r, r.next, o) && P(n, o) && P(o, n) && (t.push(n.i / i), t.push(r.i / i), t.push(o.i / i), R(r), R(r.next), r = e = o), r = r.next
                        } while (r !== e);
                        return r
                    }

                    function c(e, t, i, r, n, a) {
                        var l = e;
                        do {
                            for (var u = l.next.next; u !== l.prev;) {
                                if (l.i !== u.i && b(l, u)) {
                                    var c = C(l, u);
                                    return l = o(l, l.next), c = o(c, c.next), s(l, t, i, r, n, a), void s(c, t, i, r, n, a)
                                }
                                u = u.next
                            }
                            l = l.next
                        } while (l !== e)
                    }

                    function h(e, t, i, r) {
                        var s, a, l, u, c, h = [];
                        for (s = 0, a = t.length; s < a; s++) l = t[s] * r, u = s < a - 1 ? t[s + 1] * r : e.length, c = n(e, l, u, r, !1), c === c.next && (c.steiner = !0), h.push(v(c));
                        for (h.sort(d), s = 0; s < h.length; s++) p(h[s], i), i = o(i, i.next);
                        return i
                    }

                    function d(e, t) {
                        return e.x - t.x
                    }

                    function p(e, t) {
                        if (t = f(e, t)) {
                            var i = C(t, e);
                            o(i, i.next)
                        }
                    }

                    function f(e, t) {
                        var i, r = t,
                            n = e.x,
                            o = e.y,
                            s = -1 / 0;
                        do {
                            if (o <= r.y && o >= r.next.y && r.next.y !== r.y) {
                                var a = r.x + (o - r.y) * (r.next.x - r.x) / (r.next.y - r.y);
                                if (a <= n && a > s) {
                                    if (s = a, a === n) {
                                        if (o === r.y) return r;
                                        if (o === r.next.y) return r.next
                                    }
                                    i = r.x < r.next.x ? r : r.next
                                }
                            }
                            r = r.next
                        } while (r !== t);
                        if (!i) return null;
                        if (n === s) return i.prev;
                        var l, u = i,
                            c = i.x,
                            h = i.y,
                            d = 1 / 0;
                        for (r = i.next; r !== u;) n >= r.x && r.x >= c && n !== r.x && y(o < h ? n : s, o, c, h, o < h ? s : n, o, r.x, r.y) && ((l = Math.abs(o - r.y) / (n - r.x)) < d || l === d && r.x > i.x) && P(r, e) && (i = r, d = l), r = r.next;
                        return i
                    }

                    function _(e, t, i, r) {
                        var n = e;
                        do {
                            null === n.z && (n.z = g(n.x, n.y, t, i, r)), n.prevZ = n.prev, n.nextZ = n.next, n = n.next
                        } while (n !== e);
                        n.prevZ.nextZ = null, n.prevZ = null, m(n)
                    }

                    function m(e) {
                        var t, i, r, n, o, s, a, l, u = 1;
                        do {
                            for (i = e, e = null, o = null, s = 0; i;) {
                                for (s++, r = i, a = 0, t = 0; t < u && (a++, r = r.nextZ); t++);
                                for (l = u; a > 0 || l > 0 && r;) 0 !== a && (0 === l || !r || i.z <= r.z) ? (n = i, i = i.nextZ, a--) : (n = r, r = r.nextZ, l--), o ? o.nextZ = n : e = n, n.prevZ = o, o = n;
                                i = r
                            }
                            o.nextZ = null, u *= 2
                        } while (s > 1);
                        return e
                    }

                    function g(e, t, i, r, n) {
                        return e = 32767 * (e - i) * n, t = 32767 * (t - r) * n, e = 16711935 & (e | e << 8), e = 252645135 & (e | e << 4), e = 858993459 & (e | e << 2), e = 1431655765 & (e | e << 1), t = 16711935 & (t | t << 8), t = 252645135 & (t | t << 4), t = 858993459 & (t | t << 2), t = 1431655765 & (t | t << 1), e | t << 1
                    }

                    function v(e) {
                        var t = e,
                            i = e;
                        do {
                            t.x < i.x && (i = t), t = t.next
                        } while (t !== e);
                        return i
                    }

                    function y(e, t, i, r, n, o, s, a) {
                        return (n - s) * (t - a) - (e - s) * (o - a) >= 0 && (e - s) * (r - a) - (i - s) * (t - a) >= 0 && (i - s) * (o - a) - (n - s) * (r - a) >= 0
                    }

                    function b(e, t) {
                        return e.next.i !== t.i && e.prev.i !== t.i && !S(e, t) && P(e, t) && P(t, e) && A(e, t)
                    }

                    function x(e, t, i) {
                        return (t.y - e.y) * (i.x - t.x) - (t.x - e.x) * (i.y - t.y)
                    }

                    function T(e, t) {
                        return e.x === t.x && e.y === t.y
                    }

                    function E(e, t, i, r) {
                        return !!(T(e, t) && T(i, r) || T(e, r) && T(i, t)) || x(e, t, i) > 0 != x(e, t, r) > 0 && x(i, r, e) > 0 != x(i, r, t) > 0
                    }

                    function S(e, t) {
                        var i = e;
                        do {
                            if (i.i !== e.i && i.next.i !== e.i && i.i !== t.i && i.next.i !== t.i && E(i, i.next, e, t)) return !0;
                            i = i.next
                        } while (i !== e);
                        return !1
                    }

                    function P(e, t) {
                        return x(e.prev, e, e.next) < 0 ? x(e, t, e.next) >= 0 && x(e, e.prev, t) >= 0 : x(e, t, e.prev) < 0 || x(e, e.next, t) < 0
                    }

                    function A(e, t) {
                        var i = e,
                            r = !1,
                            n = (e.x + t.x) / 2,
                            o = (e.y + t.y) / 2;
                        do {
                            i.y > o != i.next.y > o && i.next.y !== i.y && n < (i.next.x - i.x) * (o - i.y) / (i.next.y - i.y) + i.x && (r = !r), i = i.next
                        } while (i !== e);
                        return r
                    }

                    function C(e, t) {
                        var i = new O(e.i, e.x, e.y),
                            r = new O(t.i, t.x, t.y),
                            n = e.next,
                            o = t.prev;
                        return e.next = t, t.prev = e, i.next = n, n.prev = i, r.next = i, i.prev = r, o.next = r, r.prev = o, r
                    }

                    function M(e, t, i, r) {
                        var n = new O(e, t, i);
                        return r ? (n.next = r.next, n.prev = r, r.next.prev = n, r.next = n) : (n.prev = n, n.next = n), n
                    }

                    function R(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 O(e, t, i) {
                        this.i = e, this.x = t, this.y = i, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = !1
                    }

                    function w(e, t, i, r) {
                        for (var n = 0, o = t, s = i - r; o < i; o += r) n += (e[s] - e[o]) * (e[o + 1] + e[s + 1]), s = o;
                        return n
                    }
                    t.exports = r, t.exports.default = r, r.deviation = function(e, t, i, r) {
                        var n = t && t.length,
                            o = n ? t[0] * i : e.length,
                            s = Math.abs(w(e, 0, o, i));
                        if (n)
                            for (var a = 0, l = t.length; a < l; a++) {
                                var u = t[a] * i,
                                    c = a < l - 1 ? t[a + 1] * i : e.length;
                                s -= Math.abs(w(e, u, c, i))
                            }
                        var h = 0;
                        for (a = 0; a < r.length; a += 3) {
                            var d = r[a] * i,
                                p = r[a + 1] * i,
                                f = r[a + 2] * i;
                            h += Math.abs((e[d] - e[f]) * (e[p + 1] - e[d + 1]) - (e[d] - e[p]) * (e[f + 1] - e[d + 1]))
                        }
                        return 0 === s && 0 === h ? 0 : Math.abs((h - s) / s)
                    }, r.flatten = function(e) {
                        for (var t = e[0][0].length, i = {
                                vertices: [],
                                holes: [],
                                dimensions: t
                            }, r = 0, n = 0; n < e.length; n++) {
                            for (var o = 0; o < e[n].length; o++)
                                for (var s = 0; s < t; s++) i.vertices.push(e[n][o][s]);
                            n > 0 && (r += e[n - 1].length, i.holes.push(r))
                        }
                        return i
                    }
                }, {}],
                3: [function(e, t, i) {
                    "use strict";

                    function r() {}

                    function n(e, t, i) {
                        this.fn = e, this.context = t, this.once = i || !1
                    }

                    function o() {
                        this._events = new r, this._eventsCount = 0
                    }
                    var s = Object.prototype.hasOwnProperty,
                        a = "~";
                    Object.create && (r.prototype = Object.create(null), (new r).__proto__ || (a = !1)), o.prototype.eventNames = function() {
                        var e, t, i = [];
                        if (0 === this._eventsCount) return i;
                        for (t in e = this._events) s.call(e, t) && i.push(a ? t.slice(1) : t);
                        return Object.getOwnPropertySymbols ? i.concat(Object.getOwnPropertySymbols(e)) : i
                    }, o.prototype.listeners = function(e, t) {
                        var i = a ? a + e : e,
                            r = this._events[i];
                        if (t) return !!r;
                        if (!r) return [];
                        if (r.fn) return [r.fn];
                        for (var n = 0, o = r.length, s = new Array(o); n < o; n++) s[n] = r[n].fn;
                        return s
                    }, o.prototype.emit = function(e, t, i, r, n, o) {
                        var s = a ? a + e : e;
                        if (!this._events[s]) return !1;
                        var l, u, c = this._events[s],
                            h = arguments.length;
                        if (c.fn) {
                            switch (c.once && this.removeListener(e, c.fn, void 0, !0), h) {
                                case 1:
                                    return c.fn.call(c.context), !0;
                                case 2:
                                    return c.fn.call(c.context, t), !0;
                                case 3:
                                    return c.fn.call(c.context, t, i), !0;
                                case 4:
                                    return c.fn.call(c.context, t, i, r), !0;
                                case 5:
                                    return c.fn.call(c.context, t, i, r, n), !0;
                                case 6:
                                    return c.fn.call(c.context, t, i, r, n, o), !0
                            }
                            for (u = 1, l = new Array(h - 1); u < h; u++) l[u - 1] = arguments[u];
                            c.fn.apply(c.context, l)
                        } else {
                            var d, p = c.length;
                            for (u = 0; u < p; u++) switch (c[u].once && this.removeListener(e, c[u].fn, void 0, !0), h) {
                                case 1:
                                    c[u].fn.call(c[u].context);
                                    break;
                                case 2:
                                    c[u].fn.call(c[u].context, t);
                                    break;
                                case 3:
                                    c[u].fn.call(c[u].context, t, i);
                                    break;
                                case 4:
                                    c[u].fn.call(c[u].context, t, i, r);
                                    break;
                                default:
                                    if (!l)
                                        for (d = 1, l = new Array(h - 1); d < h; d++) l[d - 1] = arguments[d];
                                    c[u].fn.apply(c[u].context, l)
                            }
                        }
                        return !0
                    }, o.prototype.on = function(e, t, i) {
                        var r = new n(t, i || this),
                            o = a ? a + e : e;
                        return this._events[o] ? this._events[o].fn ? this._events[o] = [this._events[o], r] : this._events[o].push(r) : (this._events[o] = r, this._eventsCount++), this
                    }, o.prototype.once = function(e, t, i) {
                        var r = new n(t, i || this, !0),
                            o = a ? a + e : e;
                        return this._events[o] ? this._events[o].fn ? this._events[o] = [this._events[o], r] : this._events[o].push(r) : (this._events[o] = r, this._eventsCount++), this
                    }, o.prototype.removeListener = function(e, t, i, n) {
                        var o = a ? a + e : e;
                        if (!this._events[o]) return this;
                        if (!t) return 0 == --this._eventsCount ? this._events = new r : delete this._events[o], this;
                        var s = this._events[o];
                        if (s.fn) s.fn !== t || n && !s.once || i && s.context !== i || (0 == --this._eventsCount ? this._events = new r : delete this._events[o]);
                        else {
                            for (var l = 0, u = [], c = s.length; l < c; l++)(s[l].fn !== t || n && !s[l].once || i && s[l].context !== i) && u.push(s[l]);
                            u.length ? this._events[o] = 1 === u.length ? u[0] : u : 0 == --this._eventsCount ? this._events = new r : delete this._events[o]
                        }
                        return this
                    }, o.prototype.removeAllListeners = function(e) {
                        var t;
                        return e ? (t = a ? a + e : e, this._events[t] && (0 == --this._eventsCount ? this._events = new r : delete this._events[t])) : (this._events = new r, this._eventsCount = 0), this
                    }, o.prototype.off = o.prototype.removeListener, o.prototype.addListener = o.prototype.on, o.prototype.setMaxListeners = function() {
                        return this
                    }, o.prefixed = a, o.EventEmitter = o, void 0 !== t && (t.exports = o)
                }, {}],
                4: [function(t, i, r) {
                    ! function(t) {
                        function r(e, t) {
                            return e.test(t)
                        }

                        function n(e) {
                            var t = e || ("undefined" != typeof navigator ? navigator.userAgent : ""),
                                i = t.split("[FBAN");
                            void 0 !== i[1] && (t = i[0]), void 0 !== (i = t.split("Twitter"))[1] && (t = i[0]);
                            var n = {
                                apple: {
                                    phone: r(o, t) && !r(d, t),
                                    ipod: r(s, t),
                                    tablet: !r(o, t) && r(a, t) && !r(d, t),
                                    device: (r(o, t) || r(s, t) || r(a, t)) && !r(d, t)
                                },
                                amazon: {
                                    phone: r(c, t),
                                    tablet: !r(c, t) && r(h, t),
                                    device: r(c, t) || r(h, t)
                                },
                                android: {
                                    phone: !r(d, t) && r(c, t) || !r(d, t) && r(l, t),
                                    tablet: !r(d, t) && !r(c, t) && !r(l, t) && (r(h, t) || r(u, t)),
                                    device: !r(d, t) && (r(c, t) || r(h, t) || r(l, t) || r(u, t))
                                },
                                windows: {
                                    phone: r(d, t),
                                    tablet: r(p, t),
                                    device: r(d, t) || r(p, t)
                                },
                                other: {
                                    blackberry: r(f, t),
                                    blackberry10: r(_, t),
                                    opera: r(m, t),
                                    firefox: r(v, t),
                                    chrome: r(g, t),
                                    device: r(f, t) || r(_, t) || r(m, t) || r(v, t) || r(g, t)
                                }
                            };
                            return n.any = n.apple.device || n.android.device || n.windows.device || n.other.device, n.phone = n.apple.phone || n.android.phone || n.windows.phone, n.tablet = n.apple.tablet || n.android.tablet || n.windows.tablet, n
                        }
                        var o = /iPhone/i,
                            s = /iPod/i,
                            a = /iPad/i,
                            l = /\bAndroid(?:.+)Mobile\b/i,
                            u = /Android/i,
                            c = /\bAndroid(?:.+)SD4930UR\b/i,
                            h = /\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,
                            d = /Windows Phone/i,
                            p = /\bWindows(?:.+)ARM\b/i,
                            f = /BlackBerry/i,
                            _ = /BB10/i,
                            m = /Opera Mini/i,
                            g = /\b(CriOS|Chrome)(?:.+)Mobile/i,
                            v = /\Mobile(?:.+)Firefox\b/i;
                        void 0 !== i && i.exports && "undefined" == typeof window ? i.exports = n : void 0 !== i && i.exports && "undefined" != typeof window ? i.exports = n() : "function" == typeof e && e.amd ? e([], t.isMobile = n()) : t.isMobile = n()
                    }(this)
                }, {}],
                5: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        return e._head ? (e._tail._next = t, t._prev = e._tail, e._tail = t) : (e._head = t, e._tail = t), t._owner = e, t
                    }
                    Object.defineProperty(i, "__esModule", {
                        value: !0
                    });
                    var o = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        s = function() {
                            function e(t, i, n) {
                                void 0 === i && (i = !1), r(this, e), this._fn = t, this._once = i, this._thisArg = n, this._next = this._prev = this._owner = null
                            }
                            return o(e, [{
                                key: "detach",
                                value: function() {
                                    return null !== this._owner && (this._owner.detach(this), !0)
                                }
                            }]), e
                        }(),
                        a = function() {
                            function e() {
                                r(this, e), this._head = this._tail = void 0
                            }
                            return o(e, [{
                                key: "handlers",
                                value: function() {
                                    var e = !(arguments.length <= 0 || void 0 === arguments[0]) && arguments[0],
                                        t = this._head;
                                    if (e) return !!t;
                                    for (var i = []; t;) i.push(t), t = t._next;
                                    return i
                                }
                            }, {
                                key: "has",
                                value: function(e) {
                                    if (!(e instanceof s)) throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");
                                    return e._owner === this
                                }
                            }, {
                                key: "dispatch",
                                value: function() {
                                    var e = this._head;
                                    if (!e) return !1;
                                    for (; e;) e._once && this.detach(e), e._fn.apply(e._thisArg, arguments), e = e._next;
                                    return !0
                                }
                            }, {
                                key: "add",
                                value: function(e) {
                                    var t = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
                                    if ("function" != typeof e) throw new Error("MiniSignal#add(): First arg must be a Function.");
                                    return n(this, new s(e, !1, t))
                                }
                            }, {
                                key: "once",
                                value: function(e) {
                                    var t = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
                                    if ("function" != typeof e) throw new Error("MiniSignal#once(): First arg must be a Function.");
                                    return n(this, new s(e, !0, t))
                                }
                            }, {
                                key: "detach",
                                value: function(e) {
                                    if (!(e instanceof s)) throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");
                                    return e._owner !== this ? this : (e._prev && (e._prev._next = e._next), e._next && (e._next._prev = e._prev), e === this._head ? (this._head = e._next, null === e._next && (this._tail = null)) : e === this._tail && (this._tail = e._prev, this._tail._next = null), e._owner = null, this)
                                }
                            }, {
                                key: "detachAll",
                                value: function() {
                                    var e = this._head;
                                    if (!e) return this;
                                    for (this._head = this._tail = null; e;) e._owner = null, e = e._next;
                                    return this
                                }
                            }]), e
                        }();
                    a.MiniSignalBinding = s, i.default = a, t.exports = i.default
                }, {}],
                6: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        if (null === e || void 0 === e) throw new TypeError("Object.assign cannot be called with null or undefined");
                        return Object(e)
                    }
                    var n = Object.getOwnPropertySymbols,
                        o = Object.prototype.hasOwnProperty,
                        s = Object.prototype.propertyIsEnumerable;
                    t.exports = function() {
                        try {
                            if (!Object.assign) return !1;
                            var e = new String("abc");
                            if (e[5] = "de", "5" === Object.getOwnPropertyNames(e)[0]) return !1;
                            for (var t = {}, i = 0; i < 10; i++) t["_" + String.fromCharCode(i)] = i;
                            if ("0123456789" !== Object.getOwnPropertyNames(t).map(function(e) {
                                    return t[e]
                                }).join("")) return !1;
                            var r = {};
                            return "abcdefghijklmnopqrst".split("").forEach(function(e) {
                                r[e] = e
                            }), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, r)).join("")
                        } catch (e) {
                            return !1
                        }
                    }() ? Object.assign : function(e, t) {
                        for (var i, a, l = r(e), u = 1; u < arguments.length; u++) {
                            i = Object(arguments[u]);
                            for (var c in i) o.call(i, c) && (l[c] = i[c]);
                            if (n) {
                                a = n(i);
                                for (var h = 0; h < a.length; h++) s.call(i, a[h]) && (l[a[h]] = i[a[h]])
                            }
                        }
                        return l
                    }
                }, {}],
                7: [function(e, t, i) {
                    "use strict";
                    t.exports = function(e, t) {
                        t = t || {};
                        for (var i = {
                                key: ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"],
                                q: {
                                    name: "queryKey",
                                    parser: /(?:^|&)([^&=]*)=?([^&]*)/g
                                },
                                parser: {
                                    strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
                                    loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
                                }
                            }, r = i.parser[t.strictMode ? "strict" : "loose"].exec(e), n = {}, o = 14; o--;) n[i.key[o]] = r[o] || "";
                        return n[i.q.name] = {}, n[i.key[12]].replace(i.q.parser, function(e, t, r) {
                            t && (n[i.q.name][t] = r)
                        }), n
                    }
                }, {}],
                8: [function(e, t, i) {
                    (function(e) {
                        function t(e, t) {
                            for (var i = 0, r = e.length - 1; r >= 0; r--) {
                                var n = e[r];
                                "." === n ? e.splice(r, 1) : ".." === n ? (e.splice(r, 1), i++) : i && (e.splice(r, 1), i--)
                            }
                            if (t)
                                for (; i--; i) e.unshift("..");
                            return e
                        }

                        function r(e, t) {
                            if (e.filter) return e.filter(t);
                            for (var i = [], r = 0; r < e.length; r++) t(e[r], r, e) && i.push(e[r]);
                            return i
                        }
                        var n = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,
                            o = function(e) {
                                return n.exec(e).slice(1)
                            };
                        i.resolve = function() {
                            for (var i = "", n = !1, o = arguments.length - 1; o >= -1 && !n; o--) {
                                var s = o >= 0 ? arguments[o] : e.cwd();
                                if ("string" != typeof s) throw new TypeError("Arguments to path.resolve must be strings");
                                s && (i = s + "/" + i, n = "/" === s.charAt(0))
                            }
                            return i = t(r(i.split("/"), function(e) {
                                return !!e
                            }), !n).join("/"), (n ? "/" : "") + i || "."
                        }, i.normalize = function(e) {
                            var n = i.isAbsolute(e),
                                o = "/" === s(e, -1);
                            return e = t(r(e.split("/"), function(e) {
                                return !!e
                            }), !n).join("/"), e || n || (e = "."), e && o && (e += "/"), (n ? "/" : "") + e
                        }, i.isAbsolute = function(e) {
                            return "/" === e.charAt(0)
                        }, i.join = function() {
                            var e = Array.prototype.slice.call(arguments, 0);
                            return i.normalize(r(e, function(e, t) {
                                if ("string" != typeof e) throw new TypeError("Arguments to path.join must be strings");
                                return e
                            }).join("/"))
                        }, i.relative = function(e, t) {
                            function r(e) {
                                for (var t = 0; t < e.length && "" === e[t]; t++);
                                for (var i = e.length - 1; i >= 0 && "" === e[i]; i--);
                                return t > i ? [] : e.slice(t, i - t + 1)
                            }
                            e = i.resolve(e).substr(1), t = i.resolve(t).substr(1);
                            for (var n = r(e.split("/")), o = r(t.split("/")), s = Math.min(n.length, o.length), a = s, l = 0; l < s; l++)
                                if (n[l] !== o[l]) {
                                    a = l;
                                    break
                                }
                            for (var u = [], l = a; l < n.length; l++) u.push("..");
                            return u = u.concat(o.slice(a)), u.join("/")
                        }, i.sep = "/", i.delimiter = ":", i.dirname = function(e) {
                            var t = o(e),
                                i = t[0],
                                r = t[1];
                            return i || r ? (r && (r = r.substr(0, r.length - 1)), i + r) : "."
                        }, i.basename = function(e, t) {
                            var i = o(e)[2];
                            return t && i.substr(-1 * t.length) === t && (i = i.substr(0, i.length - t.length)), i
                        }, i.extname = function(e) {
                            return o(e)[3]
                        };
                        var s = "b" === "ab".substr(-1) ? function(e, t, i) {
                            return e.substr(t, i)
                        } : function(e, t, i) {
                            return t < 0 && (t = e.length + t), e.substr(t, i)
                        }
                    }).call(this, e("_process"))
                }, {
                    _process: 26
                }],
                9: [function(e, t, i) {
                    var r = new ArrayBuffer(0),
                        n = function(e, t, i, n) {
                            this.gl = e, this.buffer = e.createBuffer(), this.type = t || e.ARRAY_BUFFER, this.drawType = n || e.STATIC_DRAW, this.data = r, i && this.upload(i), this._updateID = 0
                        };
                    n.prototype.upload = function(e, t, i) {
                        i || this.bind();
                        var r = this.gl;
                        e = e || this.data, t = t || 0, this.data.byteLength >= e.byteLength ? r.bufferSubData(this.type, t, e) : r.bufferData(this.type, e, this.drawType), this.data = e
                    }, n.prototype.bind = function() {
                        this.gl.bindBuffer(this.type, this.buffer)
                    }, n.createVertexBuffer = function(e, t, i) {
                        return new n(e, e.ARRAY_BUFFER, t, i)
                    }, n.createIndexBuffer = function(e, t, i) {
                        return new n(e, e.ELEMENT_ARRAY_BUFFER, t, i)
                    }, n.create = function(e, t, i, r) {
                        return new n(e, t, i, r)
                    }, n.prototype.destroy = function() {
                        this.gl.deleteBuffer(this.buffer)
                    }, t.exports = n
                }, {}],
                10: [function(e, t, i) {
                    var r = e("./GLTexture"),
                        n = function(e, t, i) {
                            this.gl = e, this.framebuffer = e.createFramebuffer(), this.stencil = null, this.texture = null, this.width = t || 100, this.height = i || 100
                        };
                    n.prototype.enableTexture = function(e) {
                        var t = this.gl;
                        this.texture = e || new r(t), this.texture.bind(), this.bind(), t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, this.texture.texture, 0)
                    }, n.prototype.enableStencil = function() {
                        if (!this.stencil) {
                            var e = this.gl;
                            this.stencil = e.createRenderbuffer(), e.bindRenderbuffer(e.RENDERBUFFER, this.stencil), e.framebufferRenderbuffer(e.FRAMEBUFFER, e.DEPTH_STENCIL_ATTACHMENT, e.RENDERBUFFER, this.stencil), e.renderbufferStorage(e.RENDERBUFFER, e.DEPTH_STENCIL, this.width, this.height)
                        }
                    }, n.prototype.clear = function(e, t, i, r) {
                        this.bind();
                        var n = this.gl;
                        n.clearColor(e, t, i, r), n.clear(n.COLOR_BUFFER_BIT | n.DEPTH_BUFFER_BIT)
                    }, n.prototype.bind = function() {
                        var e = this.gl;
                        e.bindFramebuffer(e.FRAMEBUFFER, this.framebuffer)
                    }, n.prototype.unbind = function() {
                        var e = this.gl;
                        e.bindFramebuffer(e.FRAMEBUFFER, null)
                    }, n.prototype.resize = function(e, t) {
                        var i = this.gl;
                        this.width = e, this.height = t, this.texture && this.texture.uploadData(null, e, t), this.stencil && (i.bindRenderbuffer(i.RENDERBUFFER, this.stencil), i.renderbufferStorage(i.RENDERBUFFER, i.DEPTH_STENCIL, e, t))
                    }, n.prototype.destroy = function() {
                        var e = this.gl;
                        this.texture && this.texture.destroy(), e.deleteFramebuffer(this.framebuffer), this.gl = null, this.stencil = null, this.texture = null
                    }, n.createRGBA = function(e, t, i, o) {
                        var s = r.fromData(e, null, t, i);
                        s.enableNearestScaling(), s.enableWrapClamp();
                        var a = new n(e, t, i);
                        return a.enableTexture(s), a.unbind(), a
                    }, n.createFloat32 = function(e, t, i, o) {
                        var s = new r.fromData(e, o, t, i);
                        s.enableNearestScaling(), s.enableWrapClamp();
                        var a = new n(e, t, i);
                        return a.enableTexture(s), a.unbind(), a
                    }, t.exports = n
                }, {
                    "./GLTexture": 12
                }],
                11: [function(e, t, i) {
                    var r = e("./shader/compileProgram"),
                        n = e("./shader/extractAttributes"),
                        o = e("./shader/extractUniforms"),
                        s = e("./shader/setPrecision"),
                        a = e("./shader/generateUniformAccessObject"),
                        l = function(e, t, i, l, u) {
                            this.gl = e, l && (t = s(t, l), i = s(i, l)), this.program = r(e, t, i, u), this.attributes = n(e, this.program), this.uniformData = o(e, this.program), this.uniforms = a(e, this.uniformData)
                        };
                    l.prototype.bind = function() {
                        return this.gl.useProgram(this.program), this
                    }, l.prototype.destroy = function() {
                        this.attributes = null, this.uniformData = null, this.uniforms = null, this.gl.deleteProgram(this.program)
                    }, t.exports = l
                }, {
                    "./shader/compileProgram": 17,
                    "./shader/extractAttributes": 19,
                    "./shader/extractUniforms": 20,
                    "./shader/generateUniformAccessObject": 21,
                    "./shader/setPrecision": 25
                }],
                12: [function(e, t, i) {
                    var r = function(e, t, i, r, n) {
                        this.gl = e, this.texture = e.createTexture(), this.mipmap = !1, this.premultiplyAlpha = !1, this.width = t || -1, this.height = i || -1, this.format = r || e.RGBA, this.type = n || e.UNSIGNED_BYTE
                    };
                    r.prototype.upload = function(e) {
                        this.bind();
                        var t = this.gl;
                        t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);
                        var i = e.videoWidth || e.width,
                            r = e.videoHeight || e.height;
                        r !== this.height || i !== this.width ? t.texImage2D(t.TEXTURE_2D, 0, this.format, this.format, this.type, e) : t.texSubImage2D(t.TEXTURE_2D, 0, 0, 0, this.format, this.type, e), this.width = i, this.height = r
                    };
                    var n = !1;
                    r.prototype.uploadData = function(e, t, i) {
                        this.bind();
                        var r = this.gl;
                        if (e instanceof Float32Array) {
                            if (!n) {
                                if (!r.getExtension("OES_texture_float")) throw new Error("floating point textures not available");
                                n = !0
                            }
                            this.type = r.FLOAT
                        } else this.type = this.type || r.UNSIGNED_BYTE;
                        r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha), t !== this.width || i !== this.height ? r.texImage2D(r.TEXTURE_2D, 0, this.format, t, i, 0, this.format, this.type, e || null) : r.texSubImage2D(r.TEXTURE_2D, 0, 0, 0, t, i, this.format, this.type, e || null), this.width = t, this.height = i
                    }, r.prototype.bind = function(e) {
                        var t = this.gl;
                        void 0 !== e && t.activeTexture(t.TEXTURE0 + e), t.bindTexture(t.TEXTURE_2D, this.texture)
                    }, r.prototype.unbind = function() {
                        var e = this.gl;
                        e.bindTexture(e.TEXTURE_2D, null)
                    }, r.prototype.minFilter = function(e) {
                        var t = this.gl;
                        this.bind(), this.mipmap ? t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, e ? t.LINEAR_MIPMAP_LINEAR : t.NEAREST_MIPMAP_NEAREST) : t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, e ? t.LINEAR : t.NEAREST)
                    }, r.prototype.magFilter = function(e) {
                        var t = this.gl;
                        this.bind(), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, e ? t.LINEAR : t.NEAREST)
                    }, r.prototype.enableMipmap = function() {
                        var e = this.gl;
                        this.bind(), this.mipmap = !0, e.generateMipmap(e.TEXTURE_2D)
                    }, r.prototype.enableLinearScaling = function() {
                        this.minFilter(!0), this.magFilter(!0)
                    }, r.prototype.enableNearestScaling = function() {
                        this.minFilter(!1), this.magFilter(!1)
                    }, r.prototype.enableWrapClamp = function() {
                        var e = this.gl;
                        this.bind(), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE)
                    }, r.prototype.enableWrapRepeat = function() {
                        var e = this.gl;
                        this.bind(), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.REPEAT), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.REPEAT)
                    }, r.prototype.enableWrapMirrorRepeat = function() {
                        var e = this.gl;
                        this.bind(), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.MIRRORED_REPEAT), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.MIRRORED_REPEAT)
                    }, r.prototype.destroy = function() {
                        this.gl.deleteTexture(this.texture)
                    }, r.fromSource = function(e, t, i) {
                        var n = new r(e);
                        return n.premultiplyAlpha = i || !1, n.upload(t), n
                    }, r.fromData = function(e, t, i, n) {
                        var o = new r(e);
                        return o.uploadData(t, i, n), o
                    }, t.exports = r
                }, {}],
                13: [function(e, t, i) {
                    function r(e, t) {
                        if (this.nativeVaoExtension = null, r.FORCE_NATIVE || (this.nativeVaoExtension = e.getExtension("OES_vertex_array_object") || e.getExtension("MOZ_OES_vertex_array_object") || e.getExtension("WEBKIT_OES_vertex_array_object")), this.nativeState = t, this.nativeVaoExtension) {
                            this.nativeVao = this.nativeVaoExtension.createVertexArrayOES();
                            var i = e.getParameter(e.MAX_VERTEX_ATTRIBS);
                            this.nativeState = {
                                tempAttribState: new Array(i),
                                attribState: new Array(i)
                            }
                        }
                        this.gl = e, this.attributes = [], this.indexBuffer = null, this.dirty = !1
                    }
                    var n = e("./setVertexAttribArrays");
                    r.prototype.constructor = r, t.exports = r, r.FORCE_NATIVE = !1, r.prototype.bind = function() {
                        if (this.nativeVao) {
                            if (this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao), this.dirty) return this.dirty = !1, this.activate(), this;
                            this.indexBuffer && this.indexBuffer.bind()
                        } else this.activate();
                        return this
                    }, r.prototype.unbind = function() {
                        return this.nativeVao && this.nativeVaoExtension.bindVertexArrayOES(null), this
                    }, r.prototype.activate = function() {
                        for (var e = this.gl, t = null, i = 0; i < this.attributes.length; i++) {
                            var r = this.attributes[i];
                            t !== r.buffer && (r.buffer.bind(), t = r.buffer), e.vertexAttribPointer(r.attribute.location, r.attribute.size, r.type || e.FLOAT, r.normalized || !1, r.stride || 0, r.start || 0)
                        }
                        return n(e, this.attributes, this.nativeState), this.indexBuffer && this.indexBuffer.bind(), this
                    }, r.prototype.addAttribute = function(e, t, i, r, n, o) {
                        return this.attributes.push({
                            buffer: e,
                            attribute: t,
                            location: t.location,
                            type: i || this.gl.FLOAT,
                            normalized: r || !1,
                            stride: n || 0,
                            start: o || 0
                        }), this.dirty = !0, this
                    }, r.prototype.addIndex = function(e) {
                        return this.indexBuffer = e, this.dirty = !0, this
                    }, r.prototype.clear = function() {
                        return this.nativeVao && this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao), this.attributes.length = 0, this.indexBuffer = null, this
                    }, r.prototype.draw = function(e, t, i) {
                        var r = this.gl;
                        return this.indexBuffer ? r.drawElements(e, t || this.indexBuffer.data.length, r.UNSIGNED_SHORT, 2 * (i || 0)) : r.drawArrays(e, i, t || this.getSize()), this
                    }, r.prototype.destroy = function() {
                        this.gl = null, this.indexBuffer = null, this.attributes = null, this.nativeState = null, this.nativeVao && this.nativeVaoExtension.deleteVertexArrayOES(this.nativeVao), this.nativeVaoExtension = null, this.nativeVao = null
                    }, r.prototype.getSize = function() {
                        var e = this.attributes[0];
                        return e.buffer.data.length / (e.stride / 4 || e.attribute.size)
                    }
                }, {
                    "./setVertexAttribArrays": 16
                }],
                14: [function(e, t, i) {
                    var r = function(e, t) {
                        var i = e.getContext("webgl", t) || e.getContext("experimental-webgl", t);
                        if (!i) throw new Error("This browser does not support webGL. Try using the canvas renderer");
                        return i
                    };
                    t.exports = r
                }, {}],
                15: [function(e, t, i) {
                    var r = {
                        createContext: e("./createContext"),
                        setVertexAttribArrays: e("./setVertexAttribArrays"),
                        GLBuffer: e("./GLBuffer"),
                        GLFramebuffer: e("./GLFramebuffer"),
                        GLShader: e("./GLShader"),
                        GLTexture: e("./GLTexture"),
                        VertexArrayObject: e("./VertexArrayObject"),
                        shader: e("./shader")
                    };
                    void 0 !== t && t.exports && (t.exports = r), "undefined" != typeof window && (window.PIXI = window.PIXI || {}, window.PIXI.glCore = r)
                }, {
                    "./GLBuffer": 9,
                    "./GLFramebuffer": 10,
                    "./GLShader": 11,
                    "./GLTexture": 12,
                    "./VertexArrayObject": 13,
                    "./createContext": 14,
                    "./setVertexAttribArrays": 16,
                    "./shader": 22
                }],
                16: [function(e, t, i) {
                    var r = function(e, t, i) {
                        var r;
                        if (i) {
                            var n = i.tempAttribState,
                                o = i.attribState;
                            for (r = 0; r < n.length; r++) n[r] = !1;
                            for (r = 0; r < t.length; r++) n[t[r].attribute.location] = !0;
                            for (r = 0; r < o.length; r++) o[r] !== n[r] && (o[r] = n[r], i.attribState[r] ? e.enableVertexAttribArray(r) : e.disableVertexAttribArray(r))
                        } else
                            for (r = 0; r < t.length; r++) {
                                var s = t[r];
                                e.enableVertexAttribArray(s.attribute.location)
                            }
                    };
                    t.exports = r
                }, {}],
                17: [function(e, t, i) {
                    var r = function(e, t, i, r) {
                            var o = n(e, e.VERTEX_SHADER, t),
                                s = n(e, e.FRAGMENT_SHADER, i),
                                a = e.createProgram();
                            if (e.attachShader(a, o), e.attachShader(a, s), r)
                                for (var l in r) e.bindAttribLocation(a, r[l], l);
                            return e.linkProgram(a), e.getProgramParameter(a, e.LINK_STATUS) || (e.getProgramInfoLog(a), e.deleteProgram(a), a = null), e.deleteShader(o), e.deleteShader(s), a
                        },
                        n = function(e, t, i) {
                            var r = e.createShader(t);
                            return e.shaderSource(r, i), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : null
                        };
                    t.exports = r
                }, {}],
                18: [function(e, t, i) {
                    var r = function(e, t) {
                            switch (e) {
                                case "float":
                                    return 0;
                                case "vec2":
                                    return new Float32Array(2 * t);
                                case "vec3":
                                    return new Float32Array(3 * t);
                                case "vec4":
                                    return new Float32Array(4 * t);
                                case "int":
                                case "sampler2D":
                                    return 0;
                                case "ivec2":
                                    return new Int32Array(2 * t);
                                case "ivec3":
                                    return new Int32Array(3 * t);
                                case "ivec4":
                                    return new Int32Array(4 * t);
                                case "bool":
                                    return !1;
                                case "bvec2":
                                    return n(2 * t);
                                case "bvec3":
                                    return n(3 * t);
                                case "bvec4":
                                    return n(4 * t);
                                case "mat2":
                                    return new Float32Array([1, 0, 0, 1]);
                                case "mat3":
                                    return new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);
                                case "mat4":
                                    return new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
                            }
                        },
                        n = function(e) {
                            for (var t = new Array(e), i = 0; i < t.length; i++) t[i] = !1;
                            return t
                        };
                    t.exports = r
                }, {}],
                19: [function(e, t, i) {
                    var r = e("./mapType"),
                        n = e("./mapSize"),
                        o = function(e, t) {
                            for (var i = {}, o = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), a = 0; a < o; a++) {
                                var l = e.getActiveAttrib(t, a),
                                    u = r(e, l.type);
                                i[l.name] = {
                                    type: u,
                                    size: n(u),
                                    location: e.getAttribLocation(t, l.name),
                                    pointer: s
                                }
                            }
                            return i
                        },
                        s = function(e, t, i, r) {
                            gl.vertexAttribPointer(this.location, this.size, e || gl.FLOAT, t || !1, i || 0, r || 0)
                        };
                    t.exports = o
                }, {
                    "./mapSize": 23,
                    "./mapType": 24
                }],
                20: [function(e, t, i) {
                    var r = e("./mapType"),
                        n = e("./defaultValue"),
                        o = function(e, t) {
                            for (var i = {}, o = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), s = 0; s < o; s++) {
                                var a = e.getActiveUniform(t, s),
                                    l = a.name.replace(/\[.*?\]/, ""),
                                    u = r(e, a.type);
                                i[l] = {
                                    type: u,
                                    size: a.size,
                                    location: e.getUniformLocation(t, l),
                                    value: n(u, a.size)
                                }
                            }
                            return i
                        };
                    t.exports = o
                }, {
                    "./defaultValue": 18,
                    "./mapType": 24
                }],
                21: [function(e, t, i) {
                    function r(e, t) {
                        return function(i) {
                            this.data[e].value = i;
                            var r = this.data[e].location;
                            1 === t.size ? a[t.type](this.gl, r, i) : l[t.type](this.gl, r, i)
                        }
                    }

                    function n(e, t) {
                        for (var i = t, r = 0; r < e.length - 1; r++) {
                            var n = i[e[r]] || {
                                data: {}
                            };
                            i[e[r]] = n, i = n
                        }
                        return i
                    }
                    var o = function(e, t) {
                            var i = {
                                data: {}
                            };
                            i.gl = e;
                            for (var o = Object.keys(t), a = 0; a < o.length; a++) {
                                var l = o[a],
                                    u = l.split("."),
                                    c = u[u.length - 1],
                                    h = n(u, i),
                                    d = t[l];
                                h.data[c] = d, h.gl = e, Object.defineProperty(h, c, {
                                    get: s(c),
                                    set: r(c, d)
                                })
                            }
                            return i
                        },
                        s = function(e) {
                            return function() {
                                return this.data[e].value
                            }
                        },
                        a = {
                            float: function(e, t, i) {
                                e.uniform1f(t, i)
                            },
                            vec2: function(e, t, i) {
                                e.uniform2f(t, i[0], i[1])
                            },
                            vec3: function(e, t, i) {
                                e.uniform3f(t, i[0], i[1], i[2])
                            },
                            vec4: function(e, t, i) {
                                e.uniform4f(t, i[0], i[1], i[2], i[3])
                            },
                            int: function(e, t, i) {
                                e.uniform1i(t, i)
                            },
                            ivec2: function(e, t, i) {
                                e.uniform2i(t, i[0], i[1])
                            },
                            ivec3: function(e, t, i) {
                                e.uniform3i(t, i[0], i[1], i[2])
                            },
                            ivec4: function(e, t, i) {
                                e.uniform4i(t, i[0], i[1], i[2], i[3])
                            },
                            bool: function(e, t, i) {
                                e.uniform1i(t, i)
                            },
                            bvec2: function(e, t, i) {
                                e.uniform2i(t, i[0], i[1])
                            },
                            bvec3: function(e, t, i) {
                                e.uniform3i(t, i[0], i[1], i[2])
                            },
                            bvec4: function(e, t, i) {
                                e.uniform4i(t, i[0], i[1], i[2], i[3])
                            },
                            mat2: function(e, t, i) {
                                e.uniformMatrix2fv(t, !1, i)
                            },
                            mat3: function(e, t, i) {
                                e.uniformMatrix3fv(t, !1, i)
                            },
                            mat4: function(e, t, i) {
                                e.uniformMatrix4fv(t, !1, i)
                            },
                            sampler2D: function(e, t, i) {
                                e.uniform1i(t, i)
                            }
                        },
                        l = {
                            float: function(e, t, i) {
                                e.uniform1fv(t, i)
                            },
                            vec2: function(e, t, i) {
                                e.uniform2fv(t, i)
                            },
                            vec3: function(e, t, i) {
                                e.uniform3fv(t, i)
                            },
                            vec4: function(e, t, i) {
                                e.uniform4fv(t, i)
                            },
                            int: function(e, t, i) {
                                e.uniform1iv(t, i)
                            },
                            ivec2: function(e, t, i) {
                                e.uniform2iv(t, i)
                            },
                            ivec3: function(e, t, i) {
                                e.uniform3iv(t, i)
                            },
                            ivec4: function(e, t, i) {
                                e.uniform4iv(t, i)
                            },
                            bool: function(e, t, i) {
                                e.uniform1iv(t, i)
                            },
                            bvec2: function(e, t, i) {
                                e.uniform2iv(t, i)
                            },
                            bvec3: function(e, t, i) {
                                e.uniform3iv(t, i)
                            },
                            bvec4: function(e, t, i) {
                                e.uniform4iv(t, i)
                            },
                            sampler2D: function(e, t, i) {
                                e.uniform1iv(t, i)
                            }
                        };
                    t.exports = o
                }, {}],
                22: [function(e, t, i) {
                    t.exports = {
                        compileProgram: e("./compileProgram"),
                        defaultValue: e("./defaultValue"),
                        extractAttributes: e("./extractAttributes"),
                        extractUniforms: e("./extractUniforms"),
                        generateUniformAccessObject: e("./generateUniformAccessObject"),
                        setPrecision: e("./setPrecision"),
                        mapSize: e("./mapSize"),
                        mapType: e("./mapType")
                    }
                }, {
                    "./compileProgram": 17,
                    "./defaultValue": 18,
                    "./extractAttributes": 19,
                    "./extractUniforms": 20,
                    "./generateUniformAccessObject": 21,
                    "./mapSize": 23,
                    "./mapType": 24,
                    "./setPrecision": 25
                }],
                23: [function(e, t, i) {
                    var r = function(e) {
                            return n[e]
                        },
                        n = {
                            float: 1,
                            vec2: 2,
                            vec3: 3,
                            vec4: 4,
                            int: 1,
                            ivec2: 2,
                            ivec3: 3,
                            ivec4: 4,
                            bool: 1,
                            bvec2: 2,
                            bvec3: 3,
                            bvec4: 4,
                            mat2: 4,
                            mat3: 9,
                            mat4: 16,
                            sampler2D: 1
                        };
                    t.exports = r
                }, {}],
                24: [function(e, t, i) {
                    var r = function(e, t) {
                            if (!n) {
                                var i = Object.keys(o);
                                n = {};
                                for (var r = 0; r < i.length; ++r) {
                                    var s = i[r];
                                    n[e[s]] = o[s]
                                }
                            }
                            return n[t]
                        },
                        n = null,
                        o = {
                            FLOAT: "float",
                            FLOAT_VEC2: "vec2",
                            FLOAT_VEC3: "vec3",
                            FLOAT_VEC4: "vec4",
                            INT: "int",
                            INT_VEC2: "ivec2",
                            INT_VEC3: "ivec3",
                            INT_VEC4: "ivec4",
                            BOOL: "bool",
                            BOOL_VEC2: "bvec2",
                            BOOL_VEC3: "bvec3",
                            BOOL_VEC4: "bvec4",
                            FLOAT_MAT2: "mat2",
                            FLOAT_MAT3: "mat3",
                            FLOAT_MAT4: "mat4",
                            SAMPLER_2D: "sampler2D"
                        };
                    t.exports = r
                }, {}],
                25: [function(e, t, i) {
                    var r = function(e, t) {
                        return "precision" !== e.substring(0, 9) ? "precision " + t + " float;\n" + e : e
                    };
                    t.exports = r
                }, {}],
                26: [function(e, t, i) {
                    function r() {
                        throw new Error("setTimeout has not been defined")
                    }

                    function n() {
                        throw new Error("clearTimeout has not been defined")
                    }

                    function o(e) {
                        if (h === setTimeout) return setTimeout(e, 0);
                        if ((h === r || !h) && setTimeout) return h = setTimeout, setTimeout(e, 0);
                        try {
                            return h(e, 0)
                        } catch (t) {
                            try {
                                return h.call(null, e, 0)
                            } catch (t) {
                                return h.call(this, e, 0)
                            }
                        }
                    }

                    function s(e) {
                        if (d === clearTimeout) return clearTimeout(e);
                        if ((d === n || !d) && clearTimeout) return d = clearTimeout, clearTimeout(e);
                        try {
                            return d(e)
                        } catch (t) {
                            try {
                                return d.call(null, e)
                            } catch (t) {
                                return d.call(this, e)
                            }
                        }
                    }

                    function a() {
                        m && f && (m = !1, f.length ? _ = f.concat(_) : g = -1, _.length && l())
                    }

                    function l() {
                        if (!m) {
                            var e = o(a);
                            m = !0;
                            for (var t = _.length; t;) {
                                for (f = _, _ = []; ++g < t;) f && f[g].run();
                                g = -1, t = _.length
                            }
                            f = null, m = !1, s(e)
                        }
                    }

                    function u(e, t) {
                        this.fun = e, this.array = t
                    }

                    function c() {}
                    var h, d, p = t.exports = {};
                    ! function() {
                        try {
                            h = "function" == typeof setTimeout ? setTimeout : r
                        } catch (e) {
                            h = r
                        }
                        try {
                            d = "function" == typeof clearTimeout ? clearTimeout : n
                        } catch (e) {
                            d = n
                        }
                    }();
                    var f, _ = [],
                        m = !1,
                        g = -1;
                    p.nextTick = function(e) {
                        var t = new Array(arguments.length - 1);
                        if (arguments.length > 1)
                            for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i];
                        _.push(new u(e, t)), 1 !== _.length || m || o(l)
                    }, u.prototype.run = function() {
                        this.fun.apply(null, this.array)
                    }, p.title = "browser", p.browser = !0, p.env = {}, p.argv = [], p.version = "", p.versions = {}, p.on = c, p.addListener = c, p.once = c, p.off = c, p.removeListener = c, p.removeAllListeners = c, p.emit = c, p.prependListener = c, p.prependOnceListener = c, p.listeners = function(e) {
                        return []
                    }, p.binding = function(e) {
                        throw new Error("process.binding is not supported")
                    }, p.cwd = function() {
                        return "/"
                    }, p.chdir = function(e) {
                        throw new Error("process.chdir is not supported")
                    }, p.umask = function() {
                        return 0
                    }
                }, {}],
                27: [function(t, i, r) {
                    (function(t) {
                        ! function(n) {
                            function o(e) {
                                throw new RangeError(L[e])
                            }

                            function s(e, t) {
                                for (var i = e.length, r = []; i--;) r[i] = t(e[i]);
                                return r
                            }

                            function a(e, t) {
                                var i = e.split("@"),
                                    r = "";
                                return i.length > 1 && (r = i[0] + "@", e = i[1]), e = e.replace(D, "."), r + s(e.split("."), t).join(".")
                            }

                            function l(e) {
                                for (var t, i, r = [], n = 0, o = e.length; n < o;) t = e.charCodeAt(n++), t >= 55296 && t <= 56319 && n < o ? (i = e.charCodeAt(n++), 56320 == (64512 & i) ? r.push(((1023 & t) << 10) + (1023 & i) + 65536) : (r.push(t), n--)) : r.push(t);
                                return r
                            }

                            function u(e) {
                                return s(e, function(e) {
                                    var t = "";
                                    return e > 65535 && (e -= 65536, t += N(e >>> 10 & 1023 | 55296), e = 56320 | 1023 & e), t += N(e)
                                }).join("")
                            }

                            function c(e) {
                                return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
                            }

                            function h(e, t) {
                                return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
                            }

                            function d(e, t, i) {
                                var r = 0;
                                for (e = i ? F(e / C) : e >> 1, e += F(e / t); e > B * P >> 1; r += E) e = F(e / B);
                                return F(r + (B + 1) * e / (e + A))
                            }

                            function p(e) {
                                var t, i, r, n, s, a, l, h, p, f, _ = [],
                                    m = e.length,
                                    g = 0,
                                    v = R,
                                    y = M;
                                for (i = e.lastIndexOf(O), i < 0 && (i = 0), r = 0; r < i; ++r) e.charCodeAt(r) >= 128 && o("not-basic"), _.push(e.charCodeAt(r));
                                for (n = i > 0 ? i + 1 : 0; n < m;) {
                                    for (s = g, a = 1, l = E; n >= m && o("invalid-input"), h = c(e.charCodeAt(n++)), (h >= E || h > F((T - g) / a)) && o("overflow"), g += h * a, p = l <= y ? S : l >= y + P ? P : l - y, !(h < p); l += E) f = E - p, a > F(T / f) && o("overflow"),
                                        a *= f;
                                    t = _.length + 1, y = d(g - s, t, 0 == s), F(g / t) > T - v && o("overflow"), v += F(g / t), g %= t, _.splice(g++, 0, v)
                                }
                                return u(_)
                            }

                            function f(e) {
                                var t, i, r, n, s, a, u, c, p, f, _, m, g, v, y, b = [];
                                for (e = l(e), m = e.length, t = R, i = 0, s = M, a = 0; a < m; ++a)(_ = e[a]) < 128 && b.push(N(_));
                                for (r = n = b.length, n && b.push(O); r < m;) {
                                    for (u = T, a = 0; a < m; ++a)(_ = e[a]) >= t && _ < u && (u = _);
                                    for (g = r + 1, u - t > F((T - i) / g) && o("overflow"), i += (u - t) * g, t = u, a = 0; a < m; ++a)
                                        if (_ = e[a], _ < t && ++i > T && o("overflow"), _ == t) {
                                            for (c = i, p = E; f = p <= s ? S : p >= s + P ? P : p - s, !(c < f); p += E) y = c - f, v = E - f, b.push(N(h(f + y % v, 0))), c = F(y / v);
                                            b.push(N(h(c, 0))), s = d(i, g, r == n), i = 0, ++r
                                        }++i, ++t
                                }
                                return b.join("")
                            }

                            function _(e) {
                                return a(e, function(e) {
                                    return w.test(e) ? p(e.slice(4).toLowerCase()) : e
                                })
                            }

                            function m(e) {
                                return a(e, function(e) {
                                    return I.test(e) ? "xn--" + f(e) : e
                                })
                            }
                            var g = "object" == typeof r && r && !r.nodeType && r,
                                v = "object" == typeof i && i && !i.nodeType && i,
                                y = "object" == typeof t && t;
                            y.global !== y && y.window !== y && y.self !== y || (n = y);
                            var b, x, T = 2147483647,
                                E = 36,
                                S = 1,
                                P = 26,
                                A = 38,
                                C = 700,
                                M = 72,
                                R = 128,
                                O = "-",
                                w = /^xn--/,
                                I = /[^\x20-\x7E]/,
                                D = /[\x2E\u3002\uFF0E\uFF61]/g,
                                L = {
                                    overflow: "Overflow: input needs wider integers to process",
                                    "not-basic": "Illegal input >= 0x80 (not a basic code point)",
                                    "invalid-input": "Invalid input"
                                },
                                B = E - S,
                                F = Math.floor,
                                N = String.fromCharCode;
                            if (b = {
                                    version: "1.4.1",
                                    ucs2: {
                                        decode: l,
                                        encode: u
                                    },
                                    decode: p,
                                    encode: f,
                                    toASCII: m,
                                    toUnicode: _
                                }, "function" == typeof e && "object" == typeof e.amd && e.amd) e("punycode", function() {
                                return b
                            });
                            else if (g && v)
                                if (i.exports == g) v.exports = b;
                                else
                                    for (x in b) b.hasOwnProperty(x) && (g[x] = b[x]);
                            else n.punycode = b
                        }(this)
                    }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
                }, {}],
                28: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        return Object.prototype.hasOwnProperty.call(e, t)
                    }
                    t.exports = function(e, t, i, o) {
                        t = t || "&", i = i || "=";
                        var s = {};
                        if ("string" != typeof e || 0 === e.length) return s;
                        var a = /\+/g;
                        e = e.split(t);
                        var l = 1e3;
                        o && "number" == typeof o.maxKeys && (l = o.maxKeys);
                        var u = e.length;
                        l > 0 && u > l && (u = l);
                        for (var c = 0; c < u; ++c) {
                            var h, d, p, f, _ = e[c].replace(a, "%20"),
                                m = _.indexOf(i);
                            m >= 0 ? (h = _.substr(0, m), d = _.substr(m + 1)) : (h = _, d = ""), p = decodeURIComponent(h), f = decodeURIComponent(d), r(s, p) ? n(s[p]) ? s[p].push(f) : s[p] = [s[p], f] : s[p] = f
                        }
                        return s
                    };
                    var n = Array.isArray || function(e) {
                        return "[object Array]" === Object.prototype.toString.call(e)
                    }
                }, {}],
                29: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (e.map) return e.map(t);
                        for (var i = [], r = 0; r < e.length; r++) i.push(t(e[r], r));
                        return i
                    }
                    var n = function(e) {
                        switch (typeof e) {
                            case "string":
                                return e;
                            case "boolean":
                                return e ? "true" : "false";
                            case "number":
                                return isFinite(e) ? e : "";
                            default:
                                return ""
                        }
                    };
                    t.exports = function(e, t, i, a) {
                        return t = t || "&", i = i || "=", null === e && (e = void 0), "object" == typeof e ? r(s(e), function(s) {
                            var a = encodeURIComponent(n(s)) + i;
                            return o(e[s]) ? r(e[s], function(e) {
                                return a + encodeURIComponent(n(e))
                            }).join(t) : a + encodeURIComponent(n(e[s]))
                        }).join(t) : a ? encodeURIComponent(n(a)) + i + encodeURIComponent(n(e)) : ""
                    };
                    var o = Array.isArray || function(e) {
                            return "[object Array]" === Object.prototype.toString.call(e)
                        },
                        s = Object.keys || function(e) {
                            var t = [];
                            for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
                            return t
                        }
                }, {}],
                30: [function(e, t, i) {
                    "use strict";
                    i.decode = i.parse = e("./decode"), i.encode = i.stringify = e("./encode")
                }, {
                    "./decode": 28,
                    "./encode": 29
                }],
                31: [function(e, t, i) {
                    "use strict";
                    t.exports = function(e, t, i) {
                        var r, n = e.length;
                        if (!(t >= n || 0 === i)) {
                            i = t + i > n ? n - t : i;
                            var o = n - i;
                            for (r = t; r < o; ++r) e[r] = e[r + i];
                            e.length = o
                        }
                    }
                }, {}],
                32: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0, i.Loader = void 0;
                    var o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
                            return typeof e
                        } : function(e) {
                            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
                        },
                        s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("mini-signals"),
                        l = r(a),
                        u = e("parse-uri"),
                        c = r(u),
                        h = e("./async"),
                        d = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(h),
                        p = e("./Resource"),
                        f = /(#[\w-]+)?$/,
                        _ = i.Loader = function() {
                            function e() {
                                var t = this,
                                    i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
                                    r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 10;
                                n(this, e), this.baseUrl = i, this.progress = 0, this.loading = !1, this.defaultQueryString = "", this._beforeMiddleware = [], this._afterMiddleware = [], this._resourcesParsing = [], this._boundLoadResource = function(e, i) {
                                    return t._loadResource(e, i)
                                }, this._queue = d.queue(this._boundLoadResource, r), this._queue.pause(), this.resources = {}, this.onProgress = new l.default, this.onError = new l.default, this.onLoad = new l.default, this.onStart = new l.default, this.onComplete = new l.default;
                                for (var o = 0; o < e._defaultBeforeMiddleware.length; ++o) this.pre(e._defaultBeforeMiddleware[o]);
                                for (var s = 0; s < e._defaultAfterMiddleware.length; ++s) this.use(e._defaultAfterMiddleware[s])
                            }
                            return e.prototype.add = function(e, t, i, r) {
                                if (Array.isArray(e)) {
                                    for (var n = 0; n < e.length; ++n) this.add(e[n]);
                                    return this
                                }
                                if ("object" === (void 0 === e ? "undefined" : o(e)) && (r = t || e.callback || e.onComplete, i = e, t = e.url, e = e.name || e.key || e.url), "string" != typeof t && (r = i, i = t, t = e), "string" != typeof t) throw new Error("No url passed to add resource to loader.");
                                if ("function" == typeof i && (r = i, i = null), this.loading && (!i || !i.parentResource)) throw new Error("Cannot add resources while the loader is running.");
                                if (this.resources[e]) throw new Error('Resource named "' + e + '" already exists.');
                                if (t = this._prepareUrl(t), this.resources[e] = new p.Resource(e, t, i), "function" == typeof r && this.resources[e].onAfterMiddleware.once(r), this.loading) {
                                    for (var s = i.parentResource, a = [], l = 0; l < s.children.length; ++l) s.children[l].isComplete || a.push(s.children[l]);
                                    var u = s.progressChunk * (a.length + 1),
                                        c = u / (a.length + 2);
                                    s.children.push(this.resources[e]), s.progressChunk = c;
                                    for (var h = 0; h < a.length; ++h) a[h].progressChunk = c;
                                    this.resources[e].progressChunk = c
                                }
                                return this._queue.push(this.resources[e]), this
                            }, e.prototype.pre = function(e) {
                                return this._beforeMiddleware.push(e), this
                            }, e.prototype.use = function(e) {
                                return this._afterMiddleware.push(e), this
                            }, e.prototype.reset = function() {
                                this.progress = 0, this.loading = !1, this._queue.kill(), this._queue.pause();
                                for (var e in this.resources) {
                                    var t = this.resources[e];
                                    t._onLoadBinding && t._onLoadBinding.detach(), t.isLoading && t.abort()
                                }
                                return this.resources = {}, this
                            }, e.prototype.load = function(e) {
                                if ("function" == typeof e && this.onComplete.once(e), this.loading) return this;
                                if (this._queue.idle()) this._onStart(), this._onComplete();
                                else {
                                    for (var t = this._queue._tasks.length, i = 100 / t, r = 0; r < this._queue._tasks.length; ++r) this._queue._tasks[r].data.progressChunk = i;
                                    this._onStart(), this._queue.resume()
                                }
                                return this
                            }, e.prototype._prepareUrl = function(e) {
                                var t = (0, c.default)(e, {
                                        strictMode: !0
                                    }),
                                    i = void 0;
                                if (i = t.protocol || !t.path || 0 === e.indexOf("//") ? e : this.baseUrl.length && this.baseUrl.lastIndexOf("/") !== this.baseUrl.length - 1 && "/" !== e.charAt(0) ? this.baseUrl + "/" + e : this.baseUrl + e, this.defaultQueryString) {
                                    var r = f.exec(i)[0];
                                    i = i.substr(0, i.length - r.length), -1 !== i.indexOf("?") ? i += "&" + this.defaultQueryString : i += "?" + this.defaultQueryString, i += r
                                }
                                return i
                            }, e.prototype._loadResource = function(e, t) {
                                var i = this;
                                e._dequeue = t, d.eachSeries(this._beforeMiddleware, function(t, r) {
                                    t.call(i, e, function() {
                                        r(e.isComplete ? {} : null)
                                    })
                                }, function() {
                                    e.isComplete ? i._onLoad(e) : (e._onLoadBinding = e.onComplete.once(i._onLoad, i), e.load())
                                }, !0)
                            }, e.prototype._onStart = function() {
                                this.progress = 0, this.loading = !0, this.onStart.dispatch(this)
                            }, e.prototype._onComplete = function() {
                                this.progress = 100, this.loading = !1, this.onComplete.dispatch(this, this.resources)
                            }, e.prototype._onLoad = function(e) {
                                var t = this;
                                e._onLoadBinding = null, this._resourcesParsing.push(e), e._dequeue(), d.eachSeries(this._afterMiddleware, function(i, r) {
                                    i.call(t, e, r)
                                }, function() {
                                    e.onAfterMiddleware.dispatch(e), t.progress = Math.min(100, t.progress + e.progressChunk), t.onProgress.dispatch(t, e), e.error ? t.onError.dispatch(e.error, t, e) : t.onLoad.dispatch(t, e), t._resourcesParsing.splice(t._resourcesParsing.indexOf(e), 1), t._queue.idle() && 0 === t._resourcesParsing.length && t._onComplete()
                                }, !0)
                            }, s(e, [{
                                key: "concurrency",
                                get: function() {
                                    return this._queue.concurrency
                                },
                                set: function(e) {
                                    this._queue.concurrency = e
                                }
                            }]), e
                        }();
                    _._defaultBeforeMiddleware = [], _._defaultAfterMiddleware = [], _.pre = function(e) {
                        return _._defaultBeforeMiddleware.push(e), _
                    }, _.use = function(e) {
                        return _._defaultAfterMiddleware.push(e), _
                    }
                }, {
                    "./Resource": 33,
                    "./async": 34,
                    "mini-signals": 5,
                    "parse-uri": 7
                }],
                33: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o() {}

                    function s(e, t, i) {
                        t && 0 === t.indexOf(".") && (t = t.substring(1)), t && (e[t] = i)
                    }

                    function a(e) {
                        return e.toString().replace("object ", "")
                    }
                    i.__esModule = !0, i.Resource = void 0;
                    var l = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        u = e("parse-uri"),
                        c = r(u),
                        h = e("mini-signals"),
                        d = r(h),
                        p = !(!window.XDomainRequest || "withCredentials" in new XMLHttpRequest),
                        f = null,
                        _ = i.Resource = function() {
                            function e(t, i, r) {
                                if (n(this, e), "string" != typeof t || "string" != typeof i) throw new Error("Both name and url are required for constructing a resource.");
                                r = r || {}, this._flags = 0, this._setFlag(e.STATUS_FLAGS.DATA_URL, 0 === i.indexOf("data:")), this.name = t, this.url = i, this.extension = this._getExtension(), this.data = null, this.crossOrigin = !0 === r.crossOrigin ? "anonymous" : r.crossOrigin, this.timeout = r.timeout || 0, this.loadType = r.loadType || this._determineLoadType(), this.xhrType = r.xhrType, this.metadata = r.metadata || {}, this.error = null, this.xhr = null, this.children = [], this.type = e.TYPE.UNKNOWN, this.progressChunk = 0, this._dequeue = o, this._onLoadBinding = null, this._elementTimer = 0, this._boundComplete = this.complete.bind(this), this._boundOnError = this._onError.bind(this), this._boundOnProgress = this._onProgress.bind(this), this._boundOnTimeout = this._onTimeout.bind(this), this._boundXhrOnError = this._xhrOnError.bind(this), this._boundXhrOnTimeout = this._xhrOnTimeout.bind(this), this._boundXhrOnAbort = this._xhrOnAbort.bind(this), this._boundXhrOnLoad = this._xhrOnLoad.bind(this), this.onStart = new d.default, this.onProgress = new d.default, this.onComplete = new d.default, this.onAfterMiddleware = new d.default
                            }
                            return e.setExtensionLoadType = function(t, i) {
                                s(e._loadTypeMap, t, i)
                            }, e.setExtensionXhrType = function(t, i) {
                                s(e._xhrTypeMap, t, i)
                            }, e.prototype.complete = function() {
                                this._clearEvents(), this._finish()
                            }, e.prototype.abort = function(t) {
                                if (!this.error) {
                                    if (this.error = new Error(t), this._clearEvents(), this.xhr) this.xhr.abort();
                                    else if (this.xdr) this.xdr.abort();
                                    else if (this.data)
                                        if (this.data.src) this.data.src = e.EMPTY_GIF;
                                        else
                                            for (; this.data.firstChild;) this.data.removeChild(this.data.firstChild);
                                    this._finish()
                                }
                            }, e.prototype.load = function(t) {
                                var i = this;
                                if (!this.isLoading) {
                                    if (this.isComplete) return void(t && setTimeout(function() {
                                        return t(i)
                                    }, 1));
                                    switch (t && this.onComplete.once(t), this._setFlag(e.STATUS_FLAGS.LOADING, !0), this.onStart.dispatch(this), !1 !== this.crossOrigin && "string" == typeof this.crossOrigin || (this.crossOrigin = this._determineCrossOrigin(this.url)), this.loadType) {
                                        case e.LOAD_TYPE.IMAGE:
                                            this.type = e.TYPE.IMAGE, this._loadElement("image");
                                            break;
                                        case e.LOAD_TYPE.AUDIO:
                                            this.type = e.TYPE.AUDIO, this._loadSourceElement("audio");
                                            break;
                                        case e.LOAD_TYPE.VIDEO:
                                            this.type = e.TYPE.VIDEO, this._loadSourceElement("video");
                                            break;
                                        case e.LOAD_TYPE.XHR:
                                        default:
                                            p && this.crossOrigin ? this._loadXdr() : this._loadXhr()
                                    }
                                }
                            }, e.prototype._hasFlag = function(e) {
                                return 0 != (this._flags & e)
                            }, e.prototype._setFlag = function(e, t) {
                                this._flags = t ? this._flags | e : this._flags & ~e
                            }, e.prototype._clearEvents = function() {
                                clearTimeout(this._elementTimer), this.data && this.data.removeEventListener && (this.data.removeEventListener("error", this._boundOnError, !1), this.data.removeEventListener("load", this._boundComplete, !1), this.data.removeEventListener("progress", this._boundOnProgress, !1), this.data.removeEventListener("canplaythrough", this._boundComplete, !1)), this.xhr && (this.xhr.removeEventListener ? (this.xhr.removeEventListener("error", this._boundXhrOnError, !1), this.xhr.removeEventListener("timeout", this._boundXhrOnTimeout, !1), this.xhr.removeEventListener("abort", this._boundXhrOnAbort, !1), this.xhr.removeEventListener("progress", this._boundOnProgress, !1), this.xhr.removeEventListener("load", this._boundXhrOnLoad, !1)) : (this.xhr.onerror = null, this.xhr.ontimeout = null, this.xhr.onprogress = null, this.xhr.onload = null))
                            }, e.prototype._finish = function() {
                                if (this.isComplete) throw new Error("Complete called again for an already completed resource.");
                                this._setFlag(e.STATUS_FLAGS.COMPLETE, !0), this._setFlag(e.STATUS_FLAGS.LOADING, !1), this.onComplete.dispatch(this)
                            }, e.prototype._loadElement = function(e) {
                                this.metadata.loadElement ? this.data = this.metadata.loadElement : "image" === e && void 0 !== window.Image ? this.data = new Image : this.data = document.createElement(e), this.crossOrigin && (this.data.crossOrigin = this.crossOrigin), this.metadata.skipSource || (this.data.src = this.url), this.data.addEventListener("error", this._boundOnError, !1), this.data.addEventListener("load", this._boundComplete, !1), this.data.addEventListener("progress", this._boundOnProgress, !1), this.timeout && (this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout))
                            }, e.prototype._loadSourceElement = function(e) {
                                if (this.metadata.loadElement ? this.data = this.metadata.loadElement : "audio" === e && void 0 !== window.Audio ? this.data = new Audio : this.data = document.createElement(e), null === this.data) return void this.abort("Unsupported element: " + e);
                                if (this.crossOrigin && (this.data.crossOrigin = this.crossOrigin), !this.metadata.skipSource)
                                    if (navigator.isCocoonJS) this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;
                                    else if (Array.isArray(this.url))
                                    for (var t = this.metadata.mimeType, i = 0; i < this.url.length; ++i) this.data.appendChild(this._createSource(e, this.url[i], Array.isArray(t) ? t[i] : t));
                                else {
                                    var r = this.metadata.mimeType;
                                    this.data.appendChild(this._createSource(e, this.url, Array.isArray(r) ? r[0] : r))
                                }
                                this.data.addEventListener("error", this._boundOnError, !1), this.data.addEventListener("load", this._boundComplete, !1), this.data.addEventListener("progress", this._boundOnProgress, !1), this.data.addEventListener("canplaythrough", this._boundComplete, !1), this.data.load(), this.timeout && (this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout))
                            }, e.prototype._loadXhr = function() {
                                "string" != typeof this.xhrType && (this.xhrType = this._determineXhrType());
                                var t = this.xhr = new XMLHttpRequest;
                                t.open("GET", this.url, !0), t.timeout = this.timeout, this.xhrType === e.XHR_RESPONSE_TYPE.JSON || this.xhrType === e.XHR_RESPONSE_TYPE.DOCUMENT ? t.responseType = e.XHR_RESPONSE_TYPE.TEXT : t.responseType = this.xhrType, t.addEventListener("error", this._boundXhrOnError, !1), t.addEventListener("timeout", this._boundXhrOnTimeout, !1), t.addEventListener("abort", this._boundXhrOnAbort, !1), t.addEventListener("progress", this._boundOnProgress, !1), t.addEventListener("load", this._boundXhrOnLoad, !1), t.send()
                            }, e.prototype._loadXdr = function() {
                                "string" != typeof this.xhrType && (this.xhrType = this._determineXhrType());
                                var e = this.xhr = new XDomainRequest;
                                e.timeout = this.timeout || 5e3, e.onerror = this._boundXhrOnError, e.ontimeout = this._boundXhrOnTimeout, e.onprogress = this._boundOnProgress, e.onload = this._boundXhrOnLoad, e.open("GET", this.url, !0), setTimeout(function() {
                                    return e.send()
                                }, 1)
                            }, e.prototype._createSource = function(e, t, i) {
                                i || (i = e + "/" + this._getExtension(t));
                                var r = document.createElement("source");
                                return r.src = t, r.type = i, r
                            }, e.prototype._onError = function(e) {
                                this.abort("Failed to load element using: " + e.target.nodeName)
                            }, e.prototype._onProgress = function(e) {
                                e && e.lengthComputable && this.onProgress.dispatch(this, e.loaded / e.total)
                            }, e.prototype._onTimeout = function() {
                                this.abort("Load timed out.")
                            }, e.prototype._xhrOnError = function() {
                                var e = this.xhr;
                                this.abort(a(e) + " Request failed. Status: " + e.status + ', text: "' + e.statusText + '"')
                            }, e.prototype._xhrOnTimeout = function() {
                                var e = this.xhr;
                                this.abort(a(e) + " Request timed out.")
                            }, e.prototype._xhrOnAbort = function() {
                                var e = this.xhr;
                                this.abort(a(e) + " Request was aborted by the user.")
                            }, e.prototype._xhrOnLoad = function() {
                                var t = this.xhr,
                                    i = "",
                                    r = void 0 === t.status ? 200 : t.status;
                                if ("" !== t.responseType && "text" !== t.responseType && void 0 !== t.responseType || (i = t.responseText), 0 === r && (i.length > 0 || t.responseType === e.XHR_RESPONSE_TYPE.BUFFER) ? r = 200 : 1223 === r && (r = 204), 2 != (r / 100 | 0)) return void this.abort("[" + t.status + "] " + t.statusText + ": " + t.responseURL);
                                if (this.xhrType === e.XHR_RESPONSE_TYPE.TEXT) this.data = i, this.type = e.TYPE.TEXT;
                                else if (this.xhrType === e.XHR_RESPONSE_TYPE.JSON) try {
                                    this.data = JSON.parse(i), this.type = e.TYPE.JSON
                                } catch (e) {
                                    return void this.abort("Error trying to parse loaded json: " + e)
                                } else if (this.xhrType === e.XHR_RESPONSE_TYPE.DOCUMENT) try {
                                    if (window.DOMParser) {
                                        var n = new DOMParser;
                                        this.data = n.parseFromString(i, "text/xml")
                                    } else {
                                        var o = document.createElement("div");
                                        o.innerHTML = i, this.data = o
                                    }
                                    this.type = e.TYPE.XML
                                } catch (e) {
                                    return void this.abort("Error trying to parse loaded xml: " + e)
                                } else this.data = t.response || i;
                                this.complete()
                            }, e.prototype._determineCrossOrigin = function(e, t) {
                                if (0 === e.indexOf("data:")) return "";
                                if (window.origin !== window.location.origin) return "anonymous";
                                t = t || window.location, f || (f = document.createElement("a")), f.href = e, e = (0, c.default)(f.href, {
                                    strictMode: !0
                                });
                                var i = !e.port && "" === t.port || e.port === t.port,
                                    r = e.protocol ? e.protocol + ":" : "";
                                return e.host === t.hostname && i && r === t.protocol ? "" : "anonymous"
                            }, e.prototype._determineXhrType = function() {
                                return e._xhrTypeMap[this.extension] || e.XHR_RESPONSE_TYPE.TEXT
                            }, e.prototype._determineLoadType = function() {
                                return e._loadTypeMap[this.extension] || e.LOAD_TYPE.XHR
                            }, e.prototype._getExtension = function() {
                                var e = this.url,
                                    t = "";
                                if (this.isDataUrl) {
                                    var i = e.indexOf("/");
                                    t = e.substring(i + 1, e.indexOf(";", i))
                                } else {
                                    var r = e.indexOf("?"),
                                        n = e.indexOf("#"),
                                        o = Math.min(r > -1 ? r : e.length, n > -1 ? n : e.length);
                                    e = e.substring(0, o), t = e.substring(e.lastIndexOf(".") + 1)
                                }
                                return t.toLowerCase()
                            }, e.prototype._getMimeFromXhrType = function(t) {
                                switch (t) {
                                    case e.XHR_RESPONSE_TYPE.BUFFER:
                                        return "application/octet-binary";
                                    case e.XHR_RESPONSE_TYPE.BLOB:
                                        return "application/blob";
                                    case e.XHR_RESPONSE_TYPE.DOCUMENT:
                                        return "application/xml";
                                    case e.XHR_RESPONSE_TYPE.JSON:
                                        return "application/json";
                                    case e.XHR_RESPONSE_TYPE.DEFAULT:
                                    case e.XHR_RESPONSE_TYPE.TEXT:
                                    default:
                                        return "text/plain"
                                }
                            }, l(e, [{
                                key: "isDataUrl",
                                get: function() {
                                    return this._hasFlag(e.STATUS_FLAGS.DATA_URL)
                                }
                            }, {
                                key: "isComplete",
                                get: function() {
                                    return this._hasFlag(e.STATUS_FLAGS.COMPLETE)
                                }
                            }, {
                                key: "isLoading",
                                get: function() {
                                    return this._hasFlag(e.STATUS_FLAGS.LOADING)
                                }
                            }]), e
                        }();
                    _.STATUS_FLAGS = {
                        NONE: 0,
                        DATA_URL: 1,
                        COMPLETE: 2,
                        LOADING: 4
                    }, _.TYPE = {
                        UNKNOWN: 0,
                        JSON: 1,
                        XML: 2,
                        IMAGE: 3,
                        AUDIO: 4,
                        VIDEO: 5,
                        TEXT: 6
                    }, _.LOAD_TYPE = {
                        XHR: 1,
                        IMAGE: 2,
                        AUDIO: 3,
                        VIDEO: 4
                    }, _.XHR_RESPONSE_TYPE = {
                        DEFAULT: "text",
                        BUFFER: "arraybuffer",
                        BLOB: "blob",
                        DOCUMENT: "document",
                        JSON: "json",
                        TEXT: "text"
                    }, _._loadTypeMap = {
                        gif: _.LOAD_TYPE.IMAGE,
                        png: _.LOAD_TYPE.IMAGE,
                        bmp: _.LOAD_TYPE.IMAGE,
                        jpg: _.LOAD_TYPE.IMAGE,
                        jpeg: _.LOAD_TYPE.IMAGE,
                        tif: _.LOAD_TYPE.IMAGE,
                        tiff: _.LOAD_TYPE.IMAGE,
                        webp: _.LOAD_TYPE.IMAGE,
                        tga: _.LOAD_TYPE.IMAGE,
                        svg: _.LOAD_TYPE.IMAGE,
                        "svg+xml": _.LOAD_TYPE.IMAGE,
                        mp3: _.LOAD_TYPE.AUDIO,
                        ogg: _.LOAD_TYPE.AUDIO,
                        wav: _.LOAD_TYPE.AUDIO,
                        mp4: _.LOAD_TYPE.VIDEO,
                        webm: _.LOAD_TYPE.VIDEO
                    }, _._xhrTypeMap = {
                        xhtml: _.XHR_RESPONSE_TYPE.DOCUMENT,
                        html: _.XHR_RESPONSE_TYPE.DOCUMENT,
                        htm: _.XHR_RESPONSE_TYPE.DOCUMENT,
                        xml: _.XHR_RESPONSE_TYPE.DOCUMENT,
                        tmx: _.XHR_RESPONSE_TYPE.DOCUMENT,
                        svg: _.XHR_RESPONSE_TYPE.DOCUMENT,
                        tsx: _.XHR_RESPONSE_TYPE.DOCUMENT,
                        gif: _.XHR_RESPONSE_TYPE.BLOB,
                        png: _.XHR_RESPONSE_TYPE.BLOB,
                        bmp: _.XHR_RESPONSE_TYPE.BLOB,
                        jpg: _.XHR_RESPONSE_TYPE.BLOB,
                        jpeg: _.XHR_RESPONSE_TYPE.BLOB,
                        tif: _.XHR_RESPONSE_TYPE.BLOB,
                        tiff: _.XHR_RESPONSE_TYPE.BLOB,
                        webp: _.XHR_RESPONSE_TYPE.BLOB,
                        tga: _.XHR_RESPONSE_TYPE.BLOB,
                        json: _.XHR_RESPONSE_TYPE.JSON,
                        text: _.XHR_RESPONSE_TYPE.TEXT,
                        txt: _.XHR_RESPONSE_TYPE.TEXT,
                        ttf: _.XHR_RESPONSE_TYPE.BUFFER,
                        otf: _.XHR_RESPONSE_TYPE.BUFFER
                    }, _.EMPTY_GIF = "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==", void 0 !== t && (t.exports.default = _)
                }, {
                    "mini-signals": 5,
                    "parse-uri": 7
                }],
                34: [function(e, t, i) {
                    "use strict";

                    function r() {}

                    function n(e, t, i, r) {
                        var n = 0,
                            o = e.length;
                        ! function s(a) {
                            if (a || n === o) return void(i && i(a));
                            r ? setTimeout(function() {
                                t(e[n++], s)
                            }, 1) : t(e[n++], s)
                        }()
                    }

                    function o(e) {
                        return function() {
                            if (null === e) throw new Error("Callback was already called.");
                            var t = e;
                            e = null, t.apply(this, arguments)
                        }
                    }

                    function s(e, t) {
                        function i(e, t, i) {
                            if (null != i && "function" != typeof i) throw new Error("task callback must be a function");
                            if (a.started = !0, null == e && a.idle()) return void setTimeout(function() {
                                return a.drain()
                            }, 1);
                            var n = {
                                data: e,
                                callback: "function" == typeof i ? i : r
                            };
                            t ? a._tasks.unshift(n) : a._tasks.push(n), setTimeout(function() {
                                return a.process()
                            }, 1)
                        }

                        function n(e) {
                            return function() {
                                s -= 1, e.callback.apply(e, arguments), null != arguments[0] && a.error(arguments[0], e.data), s <= a.concurrency - a.buffer && a.unsaturated(), a.idle() && a.drain(), a.process()
                            }
                        }
                        if (null == t) t = 1;
                        else if (0 === t) throw new Error("Concurrency must not be zero");
                        var s = 0,
                            a = {
                                _tasks: [],
                                concurrency: t,
                                saturated: r,
                                unsaturated: r,
                                buffer: t / 4,
                                empty: r,
                                drain: r,
                                error: r,
                                started: !1,
                                paused: !1,
                                push: function(e, t) {
                                    i(e, !1, t)
                                },
                                kill: function() {
                                    s = 0, a.drain = r, a.started = !1, a._tasks = []
                                },
                                unshift: function(e, t) {
                                    i(e, !0, t)
                                },
                                process: function() {
                                    for (; !a.paused && s < a.concurrency && a._tasks.length;) {
                                        var t = a._tasks.shift();
                                        0 === a._tasks.length && a.empty(), s += 1, s === a.concurrency && a.saturated(), e(t.data, o(n(t)))
                                    }
                                },
                                length: function() {
                                    return a._tasks.length
                                },
                                running: function() {
                                    return s
                                },
                                idle: function() {
                                    return a._tasks.length + s === 0
                                },
                                pause: function() {
                                    !0 !== a.paused && (a.paused = !0)
                                },
                                resume: function() {
                                    if (!1 !== a.paused) {
                                        a.paused = !1;
                                        for (var e = 1; e <= a.concurrency; e++) a.process()
                                    }
                                }
                            };
                        return a
                    }
                    i.__esModule = !0, i.eachSeries = n, i.queue = s
                }, {}],
                35: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        for (var t = "", i = 0; i < e.length;) {
                            for (var r = [0, 0, 0], o = [0, 0, 0, 0], s = 0; s < r.length; ++s) i < e.length ? r[s] = 255 & e.charCodeAt(i++) : r[s] = 0;
                            o[0] = r[0] >> 2, o[1] = (3 & r[0]) << 4 | r[1] >> 4, o[2] = (15 & r[1]) << 2 | r[2] >> 6, o[3] = 63 & r[2];
                            switch (i - (e.length - 1)) {
                                case 2:
                                    o[3] = 64, o[2] = 64;
                                    break;
                                case 1:
                                    o[3] = 64
                            }
                            for (var a = 0; a < o.length; ++a) t += n.charAt(o[a])
                        }
                        return t
                    }
                    i.__esModule = !0, i.encodeBinary = r;
                    var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
                    void 0 !== t && (t.exports.default = r)
                }, {}],
                36: [function(e, t, i) {
                    "use strict";
                    var r = e("./Loader").Loader,
                        n = e("./Resource").Resource,
                        o = e("./async"),
                        s = e("./b64");
                    r.Resource = n, r.async = o, r.encodeBinary = s, r.base64 = s, t.exports = r, t.exports.Loader = r, t.exports.default = r
                }, {
                    "./Loader": 32,
                    "./Resource": 33,
                    "./async": 34,
                    "./b64": 35
                }],
                37: [function(e, t, i) {
                    "use strict";

                    function r() {
                        return function(e, t) {
                            if (!e.data) return void t();
                            if (e.xhr && e.xhrType === n.Resource.XHR_RESPONSE_TYPE.BLOB)
                                if (window.Blob && "string" != typeof e.data) {
                                    if (0 === e.data.type.indexOf("image")) {
                                        var i = s.createObjectURL(e.data);
                                        return e.blob = e.data, e.data = new Image, e.data.src = i, e.type = n.Resource.TYPE.IMAGE, void(e.data.onload = function() {
                                            s.revokeObjectURL(i), e.data.onload = null, t()
                                        })
                                    }
                                } else {
                                    var r = e.xhr.getResponseHeader("content-type");
                                    if (r && 0 === r.indexOf("image")) return e.data = new Image, e.data.src = "data:" + r + ";base64," + (0, o.encodeBinary)(e.xhr.responseText), e.type = n.Resource.TYPE.IMAGE, void(e.data.onload = function() {
                                        e.data.onload = null, t()
                                    })
                                }
                            t()
                        }
                    }
                    i.__esModule = !0, i.blobMiddlewareFactory = r;
                    var n = e("../../Resource"),
                        o = e("../../b64"),
                        s = window.URL || window.webkitURL
                }, {
                    "../../Resource": 33,
                    "../../b64": 35
                }],
                38: [function(e, t, i) {
                    "use strict";

                    function r() {
                        this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null
                    }

                    function n(e, t, i) {
                        if (e && u.isObject(e) && e instanceof r) return e;
                        var n = new r;
                        return n.parse(e, t, i), n
                    }

                    function o(e) {
                        return u.isString(e) && (e = n(e)), e instanceof r ? e.format() : r.prototype.format.call(e)
                    }

                    function s(e, t) {
                        return n(e, !1, !0).resolve(t)
                    }

                    function a(e, t) {
                        return e ? n(e, !1, !0).resolveObject(t) : t
                    }
                    var l = e("punycode"),
                        u = e("./util");
                    i.parse = n, i.resolve = s, i.resolveObject = a, i.format = o, i.Url = r;
                    var c = /^([a-z0-9.+-]+:)/i,
                        h = /:[0-9]*$/,
                        d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
                        p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"],
                        f = ["{", "}", "|", "\\", "^", "`"].concat(p),
                        _ = ["'"].concat(f),
                        m = ["%", "/", "?", ";", "#"].concat(_),
                        g = ["/", "?", "#"],
                        v = /^[+a-z0-9A-Z_-]{0,63}$/,
                        y = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
                        b = {
                            javascript: !0,
                            "javascript:": !0
                        },
                        x = {
                            javascript: !0,
                            "javascript:": !0
                        },
                        T = {
                            http: !0,
                            https: !0,
                            ftp: !0,
                            gopher: !0,
                            file: !0,
                            "http:": !0,
                            "https:": !0,
                            "ftp:": !0,
                            "gopher:": !0,
                            "file:": !0
                        },
                        E = e("querystring");
                    r.prototype.parse = function(e, t, i) {
                        if (!u.isString(e)) throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
                        var r = e.indexOf("?"),
                            n = -1 !== r && r < e.indexOf("#") ? "?" : "#",
                            o = e.split(n),
                            s = /\\/g;
                        o[0] = o[0].replace(s, "/"), e = o.join(n);
                        var a = e;
                        if (a = a.trim(), !i && 1 === e.split("#").length) {
                            var h = d.exec(a);
                            if (h) return this.path = a, this.href = a, this.pathname = h[1], h[2] ? (this.search = h[2], this.query = t ? E.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "", this.query = {}), this
                        }
                        var p = c.exec(a);
                        if (p) {
                            p = p[0];
                            var f = p.toLowerCase();
                            this.protocol = f, a = a.substr(p.length)
                        }
                        if (i || p || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
                            var S = "//" === a.substr(0, 2);
                            !S || p && x[p] || (a = a.substr(2), this.slashes = !0)
                        }
                        if (!x[p] && (S || p && !T[p])) {
                            for (var P = -1, A = 0; A < g.length; A++) {
                                var C = a.indexOf(g[A]); - 1 !== C && (-1 === P || C < P) && (P = C)
                            }
                            var M, R;
                            R = -1 === P ? a.lastIndexOf("@") : a.lastIndexOf("@", P), -1 !== R && (M = a.slice(0, R), a = a.slice(R + 1), this.auth = decodeURIComponent(M)), P = -1;
                            for (var A = 0; A < m.length; A++) {
                                var C = a.indexOf(m[A]); - 1 !== C && (-1 === P || C < P) && (P = C)
                            } - 1 === P && (P = a.length), this.host = a.slice(0, P), a = a.slice(P), this.parseHost(), this.hostname = this.hostname || "";
                            var O = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
                            if (!O)
                                for (var w = this.hostname.split(/\./), A = 0, I = w.length; A < I; A++) {
                                    var D = w[A];
                                    if (D && !D.match(v)) {
                                        for (var L = "", B = 0, F = D.length; B < F; B++) D.charCodeAt(B) > 127 ? L += "x" : L += D[B];
                                        if (!L.match(v)) {
                                            var N = w.slice(0, A),
                                                V = w.slice(A + 1),
                                                k = D.match(y);
                                            k && (N.push(k[1]), V.unshift(k[2])), V.length && (a = "/" + V.join(".") + a), this.hostname = N.join(".");
                                            break
                                        }
                                    }
                                }
                            this.hostname.length > 255 ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), O || (this.hostname = l.toASCII(this.hostname));
                            var U = this.port ? ":" + this.port : "",
                                G = this.hostname || "";
                            this.host = G + U, this.href += this.host, O && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), "/" !== a[0] && (a = "/" + a))
                        }
                        if (!b[f])
                            for (var A = 0, I = _.length; A < I; A++) {
                                var z = _[A];
                                if (-1 !== a.indexOf(z)) {
                                    var j = encodeURIComponent(z);
                                    j === z && (j = escape(z)), a = a.split(z).join(j)
                                }
                            }
                        var H = a.indexOf("#"); - 1 !== H && (this.hash = a.substr(H), a = a.slice(0, H));
                        var W = a.indexOf("?");
                        if (-1 !== W ? (this.search = a.substr(W), this.query = a.substr(W + 1), t && (this.query = E.parse(this.query)), a = a.slice(0, W)) : t && (this.search = "", this.query = {}), a && (this.pathname = a), T[f] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
                            var U = this.pathname || "",
                                X = this.search || "";
                            this.path = U + X
                        }
                        return this.href = this.format(), this
                    }, r.prototype.format = function() {
                        var e = this.auth || "";
                        e && (e = encodeURIComponent(e), e = e.replace(/%3A/i, ":"), e += "@");
                        var t = this.protocol || "",
                            i = this.pathname || "",
                            r = this.hash || "",
                            n = !1,
                            o = "";
                        this.host ? n = e + this.host : this.hostname && (n = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"), this.port && (n += ":" + this.port)), this.query && u.isObject(this.query) && Object.keys(this.query).length && (o = E.stringify(this.query));
                        var s = this.search || o && "?" + o || "";
                        return t && ":" !== t.substr(-1) && (t += ":"), this.slashes || (!t || T[t]) && !1 !== n ? (n = "//" + (n || ""), i && "/" !== i.charAt(0) && (i = "/" + i)) : n || (n = ""), r && "#" !== r.charAt(0) && (r = "#" + r), s && "?" !== s.charAt(0) && (s = "?" + s), i = i.replace(/[?#]/g, function(e) {
                            return encodeURIComponent(e)
                        }), s = s.replace("#", "%23"), t + n + i + s + r
                    }, r.prototype.resolve = function(e) {
                        return this.resolveObject(n(e, !1, !0)).format()
                    }, r.prototype.resolveObject = function(e) {
                        if (u.isString(e)) {
                            var t = new r;
                            t.parse(e, !1, !0), e = t
                        }
                        for (var i = new r, n = Object.keys(this), o = 0; o < n.length; o++) {
                            var s = n[o];
                            i[s] = this[s]
                        }
                        if (i.hash = e.hash, "" === e.href) return i.href = i.format(), i;
                        if (e.slashes && !e.protocol) {
                            for (var a = Object.keys(e), l = 0; l < a.length; l++) {
                                var c = a[l];
                                "protocol" !== c && (i[c] = e[c])
                            }
                            return T[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"), i.href = i.format(), i
                        }
                        if (e.protocol && e.protocol !== i.protocol) {
                            if (!T[e.protocol]) {
                                for (var h = Object.keys(e), d = 0; d < h.length; d++) {
                                    var p = h[d];
                                    i[p] = e[p]
                                }
                                return i.href = i.format(), i
                            }
                            if (i.protocol = e.protocol, e.host || x[e.protocol]) i.pathname = e.pathname;
                            else {
                                for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()););
                                e.host || (e.host = ""), e.hostname || (e.hostname = ""), "" !== f[0] && f.unshift(""), f.length < 2 && f.unshift(""), i.pathname = f.join("/")
                            }
                            if (i.search = e.search, i.query = e.query, i.host = e.host || "", i.auth = e.auth, i.hostname = e.hostname || e.host, i.port = e.port, i.pathname || i.search) {
                                var _ = i.pathname || "",
                                    m = i.search || "";
                                i.path = _ + m
                            }
                            return i.slashes = i.slashes || e.slashes, i.href = i.format(), i
                        }
                        var g = i.pathname && "/" === i.pathname.charAt(0),
                            v = e.host || e.pathname && "/" === e.pathname.charAt(0),
                            y = v || g || i.host && e.pathname,
                            b = y,
                            E = i.pathname && i.pathname.split("/") || [],
                            f = e.pathname && e.pathname.split("/") || [],
                            S = i.protocol && !T[i.protocol];
                        if (S && (i.hostname = "", i.port = null, i.host && ("" === E[0] ? E[0] = i.host : E.unshift(i.host)), i.host = "", e.protocol && (e.hostname = null, e.port = null, e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)), e.host = null), y = y && ("" === f[0] || "" === E[0])), v) i.host = e.host || "" === e.host ? e.host : i.host, i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname, i.search = e.search, i.query = e.query, E = f;
                        else if (f.length) E || (E = []), E.pop(), E = E.concat(f), i.search = e.search, i.query = e.query;
                        else if (!u.isNullOrUndefined(e.search)) {
                            if (S) {
                                i.hostname = i.host = E.shift();
                                var P = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
                                P && (i.auth = P.shift(), i.host = i.hostname = P.shift())
                            }
                            return i.search = e.search, i.query = e.query, u.isNull(i.pathname) && u.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")), i.href = i.format(), i
                        }
                        if (!E.length) return i.pathname = null, i.search ? i.path = "/" + i.search : i.path = null, i.href = i.format(), i;
                        for (var A = E.slice(-1)[0], C = (i.host || e.host || E.length > 1) && ("." === A || ".." === A) || "" === A, M = 0, R = E.length; R >= 0; R--) A = E[R], "." === A ? E.splice(R, 1) : ".." === A ? (E.splice(R, 1), M++) : M && (E.splice(R, 1), M--);
                        if (!y && !b)
                            for (; M--; M) E.unshift("..");
                        !y || "" === E[0] || E[0] && "/" === E[0].charAt(0) || E.unshift(""), C && "/" !== E.join("/").substr(-1) && E.push("");
                        var O = "" === E[0] || E[0] && "/" === E[0].charAt(0);
                        if (S) {
                            i.hostname = i.host = O ? "" : E.length ? E.shift() : "";
                            var P = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
                            P && (i.auth = P.shift(), i.host = i.hostname = P.shift())
                        }
                        return y = y || i.host && E.length, y && !O && E.unshift(""), E.length ? i.pathname = E.join("/") : (i.pathname = null, i.path = null), u.isNull(i.pathname) && u.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")), i.auth = e.auth || i.auth, i.slashes = i.slashes || e.slashes, i.href = i.format(), i
                    }, r.prototype.parseHost = function() {
                        var e = this.host,
                            t = h.exec(e);
                        t && (t = t[0], ":" !== t && (this.port = t.substr(1)), e = e.substr(0, e.length - t.length)), e && (this.hostname = e)
                    }
                }, {
                    "./util": 39,
                    punycode: 27,
                    querystring: 30
                }],
                39: [function(e, t, i) {
                    "use strict";
                    t.exports = {
                        isString: function(e) {
                            return "string" == typeof e
                        },
                        isObject: function(e) {
                            return "object" == typeof e && null !== e
                        },
                        isNull: function(e) {
                            return null === e
                        },
                        isNullOrUndefined: function(e) {
                            return null == e
                        }
                    }
                }, {}],
                40: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var o = e("../core"),
                        s = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(o),
                        a = e("ismobilejs"),
                        l = r(a),
                        u = e("./accessibleTarget"),
                        c = r(u);
                    s.utils.mixins.delayMixin(s.DisplayObject.prototype, c.default);
                    var h = 100,
                        d = 0,
                        p = 0,
                        f = 2,
                        _ = function() {
                            function e(t) {
                                n(this, e), !l.default.tablet && !l.default.phone || navigator.isCocoonJS || this.createTouchHook();
                                var i = document.createElement("div");
                                i.style.width = h + "px", i.style.height = h + "px", i.style.position = "absolute", i.style.top = d + "px", i.style.left = p + "px", i.style.zIndex = f, this.div = i, this.pool = [], this.renderId = 0, this.debug = !1, this.renderer = t, this.children = [], this._onKeyDown = this._onKeyDown.bind(this), this._onMouseMove = this._onMouseMove.bind(this), this.isActive = !1, this.isMobileAccessabillity = !1, window.addEventListener("keydown", this._onKeyDown, !1)
                            }
                            return e.prototype.createTouchHook = function() {
                                var e = this,
                                    t = document.createElement("button");
                                t.style.width = "1px", t.style.height = "1px", t.style.position = "absolute", t.style.top = "-1000px", t.style.left = "-1000px", t.style.zIndex = 2, t.style.backgroundColor = "#FF0000", t.title = "HOOK DIV", t.addEventListener("focus", function() {
                                    e.isMobileAccessabillity = !0, e.activate(), document.body.removeChild(t)
                                }), document.body.appendChild(t)
                            }, e.prototype.activate = function() {
                                this.isActive || (this.isActive = !0, window.document.addEventListener("mousemove", this._onMouseMove, !0), window.removeEventListener("keydown", this._onKeyDown, !1), this.renderer.on("postrender", this.update, this), this.renderer.view.parentNode && this.renderer.view.parentNode.appendChild(this.div))
                            }, e.prototype.deactivate = function() {
                                this.isActive && !this.isMobileAccessabillity && (this.isActive = !1, window.document.removeEventListener("mousemove", this._onMouseMove, !0), window.addEventListener("keydown", this._onKeyDown, !1), this.renderer.off("postrender", this.update), this.div.parentNode && this.div.parentNode.removeChild(this.div))
                            }, e.prototype.updateAccessibleObjects = function(e) {
                                if (e.visible) {
                                    e.accessible && e.interactive && (e._accessibleActive || this.addChild(e), e.renderId = this.renderId);
                                    for (var t = e.children, i = 0; i < t.length; i++) this.updateAccessibleObjects(t[i])
                                }
                            }, e.prototype.update = function() {
                                if (this.renderer.renderingToScreen) {
                                    this.updateAccessibleObjects(this.renderer._lastObjectRendered);
                                    var e = this.renderer.view.getBoundingClientRect(),
                                        t = e.width / this.renderer.width,
                                        i = e.height / this.renderer.height,
                                        r = this.div;
                                    r.style.left = e.left + "px", r.style.top = e.top + "px", r.style.width = this.renderer.width + "px", r.style.height = this.renderer.height + "px";
                                    for (var n = 0; n < this.children.length; n++) {
                                        var o = this.children[n];
                                        if (o.renderId !== this.renderId) o._accessibleActive = !1, s.utils.removeItems(this.children, n, 1), this.div.removeChild(o._accessibleDiv), this.pool.push(o._accessibleDiv), o._accessibleDiv = null, n--, 0 === this.children.length && this.deactivate();
                                        else {
                                            r = o._accessibleDiv;
                                            var a = o.hitArea,
                                                l = o.worldTransform;
                                            o.hitArea ? (r.style.left = (l.tx + a.x * l.a) * t + "px", r.style.top = (l.ty + a.y * l.d) * i + "px", r.style.width = a.width * l.a * t + "px", r.style.height = a.height * l.d * i + "px") : (a = o.getBounds(), this.capHitArea(a), r.style.left = a.x * t + "px", r.style.top = a.y * i + "px", r.style.width = a.width * t + "px", r.style.height = a.height * i + "px", r.title !== o.accessibleTitle && null !== o.accessibleTitle && (r.title = o.accessibleTitle), r.getAttribute("aria-label") !== o.accessibleHint && null !== o.accessibleHint && r.setAttribute("aria-label", o.accessibleHint))
                                        }
                                    }
                                    this.renderId++
                                }
                            }, e.prototype.capHitArea = function(e) {
                                e.x < 0 && (e.width += e.x, e.x = 0), e.y < 0 && (e.height += e.y, e.y = 0), e.x + e.width > this.renderer.width && (e.width = this.renderer.width - e.x), e.y + e.height > this.renderer.height && (e.height = this.renderer.height - e.y)
                            }, e.prototype.addChild = function(e) {
                                var t = this.pool.pop();
                                t || (t = document.createElement("button"), t.style.width = h + "px", t.style.height = h + "px", t.style.backgroundColor = this.debug ? "rgba(255,0,0,0.5)" : "transparent", t.style.position = "absolute", t.style.zIndex = f, t.style.borderStyle = "none", navigator.userAgent.toLowerCase().indexOf("chrome") > -1 ? t.setAttribute("aria-live", "off") : t.setAttribute("aria-live", "polite"), navigator.userAgent.match(/rv:.*Gecko\//) ? t.setAttribute("aria-relevant", "additions") : t.setAttribute("aria-relevant", "text"), t.addEventListener("click", this._onClick.bind(this)), t.addEventListener("focus", this._onFocus.bind(this)), t.addEventListener("focusout", this._onFocusOut.bind(this))), e.accessibleTitle && null !== e.accessibleTitle ? t.title = e.accessibleTitle : e.accessibleHint && null !== e.accessibleHint || (t.title = "displayObject " + e.tabIndex), e.accessibleHint && null !== e.accessibleHint && t.setAttribute("aria-label", e.accessibleHint), e._accessibleActive = !0, e._accessibleDiv = t, t.displayObject = e, this.children.push(e), this.div.appendChild(e._accessibleDiv), e._accessibleDiv.tabIndex = e.tabIndex
                            }, e.prototype._onClick = function(e) {
                                var t = this.renderer.plugins.interaction;
                                t.dispatchEvent(e.target.displayObject, "click", t.eventData)
                            }, e.prototype._onFocus = function(e) {
                                e.target.getAttribute("aria-live", "off") || e.target.setAttribute("aria-live", "assertive");
                                var t = this.renderer.plugins.interaction;
                                t.dispatchEvent(e.target.displayObject, "mouseover", t.eventData)
                            }, e.prototype._onFocusOut = function(e) {
                                e.target.getAttribute("aria-live", "off") || e.target.setAttribute("aria-live", "polite");
                                var t = this.renderer.plugins.interaction;
                                t.dispatchEvent(e.target.displayObject, "mouseout", t.eventData)
                            }, e.prototype._onKeyDown = function(e) {
                                9 === e.keyCode && this.activate()
                            }, e.prototype._onMouseMove = function(e) {
                                0 === e.movementX && 0 === e.movementY || this.deactivate()
                            }, e.prototype.destroy = function() {
                                this.div = null;
                                for (var e = 0; e < this.children.length; e++) this.children[e].div = null;
                                window.document.removeEventListener("mousemove", this._onMouseMove, !0), window.removeEventListener("keydown", this._onKeyDown), this.pool = null, this.children = null, this.renderer = null
                            }, e
                        }();
                    i.default = _, s.WebGLRenderer.registerPlugin("accessibility", _), s.CanvasRenderer.registerPlugin("accessibility", _)
                }, {
                    "../core": 65,
                    "./accessibleTarget": 41,
                    ismobilejs: 4
                }],
                41: [function(e, t, i) {
                    "use strict";
                    i.__esModule = !0, i.default = {
                        accessible: !1,
                        accessibleTitle: null,
                        accessibleHint: null,
                        tabIndex: 0,
                        _accessibleActive: !1,
                        _accessibleDiv: !1
                    }
                }, {}],
                42: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0;
                    var n = e("./accessibleTarget");
                    Object.defineProperty(i, "accessibleTarget", {
                        enumerable: !0,
                        get: function() {
                            return r(n).default
                        }
                    });
                    var o = e("./AccessibilityManager");
                    Object.defineProperty(i, "AccessibilityManager", {
                        enumerable: !0,
                        get: function() {
                            return r(o).default
                        }
                    })
                }, {
                    "./AccessibilityManager": 40,
                    "./accessibleTarget": 41
                }],
                43: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var o = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        s = e("./autoDetectRenderer"),
                        a = e("./display/Container"),
                        l = r(a),
                        u = e("./ticker"),
                        c = e("./settings"),
                        h = r(c),
                        d = e("./const"),
                        p = function() {
                            function e(t, i, r, o, a) {
                                n(this, e), "number" == typeof t && (t = Object.assign({
                                    width: t,
                                    height: i || h.default.RENDER_OPTIONS.height,
                                    forceCanvas: !!o,
                                    sharedTicker: !!a
                                }, r)), this._options = t = Object.assign({
                                    autoStart: !0,
                                    sharedTicker: !1,
                                    forceCanvas: !1,
                                    sharedLoader: !1
                                }, t), this.renderer = (0, s.autoDetectRenderer)(t), this.stage = new l.default, this._ticker = null, this.ticker = t.sharedTicker ? u.shared : new u.Ticker, t.autoStart && this.start()
                            }
                            return e.prototype.render = function() {
                                this.renderer.render(this.stage)
                            }, e.prototype.stop = function() {
                                this._ticker.stop()
                            }, e.prototype.start = function() {
                                this._ticker.start()
                            }, e.prototype.destroy = function(e, t) {
                                if (this._ticker) {
                                    var i = this._ticker;
                                    this.ticker = null, i.destroy()
                                }
                                this.stage.destroy(t), this.stage = null, this.renderer.destroy(e), this.renderer = null, this._options = null
                            }, o(e, [{
                                key: "ticker",
                                set: function(e) {
                                    this._ticker && this._ticker.remove(this.render, this), this._ticker = e, e && e.add(this.render, this, d.UPDATE_PRIORITY.LOW)
                                },
                                get: function() {
                                    return this._ticker
                                }
                            }, {
                                key: "view",
                                get: function() {
                                    return this.renderer.view
                                }
                            }, {
                                key: "screen",
                                get: function() {
                                    return this.renderer.screen
                                }
                            }]), e
                        }();
                    i.default = p
                }, {
                    "./autoDetectRenderer": 45,
                    "./const": 46,
                    "./display/Container": 48,
                    "./settings": 101,
                    "./ticker": 121
                }],
                44: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }

                    function s(e, t) {
                        if (e instanceof Array) {
                            if ("precision" !== e[0].substring(0, 9)) {
                                var i = e.slice(0);
                                return i.unshift("precision " + t + " float;"), i
                            }
                        } else if ("precision" !== e.trim().substring(0, 9)) return "precision " + t + " float;\n" + e;
                        return e
                    }
                    i.__esModule = !0;
                    var a = e("pixi-gl-core"),
                        l = e("./settings"),
                        u = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(l),
                        c = function(e) {
                            function t(i, o, a, l, c) {
                                return r(this, t), n(this, e.call(this, i, s(o, c || u.default.PRECISION_VERTEX), s(a, c || u.default.PRECISION_FRAGMENT), void 0, l))
                            }
                            return o(t, e), t
                        }(a.GLShader);
                    i.default = c
                }, {
                    "./settings": 101,
                    "pixi-gl-core": 15
                }],
                45: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t, i, r) {
                        var n = e && e.forceCanvas;
                        return void 0 !== r && (n = r), !n && s.isWebGLSupported() ? new c.default(e, t, i) : new l.default(e, t, i)
                    }
                    i.__esModule = !0, i.autoDetectRenderer = n;
                    var o = e("./utils"),
                        s = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(o),
                        a = e("./renderers/canvas/CanvasRenderer"),
                        l = r(a),
                        u = e("./renderers/webgl/WebGLRenderer"),
                        c = r(u)
                }, {
                    "./renderers/canvas/CanvasRenderer": 77,
                    "./renderers/webgl/WebGLRenderer": 84,
                    "./utils": 125
                }],
                46: [function(e, t, i) {
                    "use strict";
                    i.__esModule = !0;
                    i.VERSION = "4.8.5", i.PI_2 = 2 * Math.PI, i.RAD_TO_DEG = 180 / Math.PI, i.DEG_TO_RAD = Math.PI / 180, i.RENDERER_TYPE = {
                        UNKNOWN: 0,
                        WEBGL: 1,
                        CANVAS: 2
                    }, i.BLEND_MODES = {
                        NORMAL: 0,
                        ADD: 1,
                        MULTIPLY: 2,
                        SCREEN: 3,
                        OVERLAY: 4,
                        DARKEN: 5,
                        LIGHTEN: 6,
                        COLOR_DODGE: 7,
                        COLOR_BURN: 8,
                        HARD_LIGHT: 9,
                        SOFT_LIGHT: 10,
                        DIFFERENCE: 11,
                        EXCLUSION: 12,
                        HUE: 13,
                        SATURATION: 14,
                        COLOR: 15,
                        LUMINOSITY: 16,
                        NORMAL_NPM: 17,
                        ADD_NPM: 18,
                        SCREEN_NPM: 19
                    }, i.DRAW_MODES = {
                        POINTS: 0,
                        LINES: 1,
                        LINE_LOOP: 2,
                        LINE_STRIP: 3,
                        TRIANGLES: 4,
                        TRIANGLE_STRIP: 5,
                        TRIANGLE_FAN: 6
                    }, i.SCALE_MODES = {
                        LINEAR: 0,
                        NEAREST: 1
                    }, i.WRAP_MODES = {
                        CLAMP: 0,
                        REPEAT: 1,
                        MIRRORED_REPEAT: 2
                    }, i.GC_MODES = {
                        AUTO: 0,
                        MANUAL: 1
                    }, i.URL_FILE_EXTENSION = /\.(\w{3,4})(?:$|\?|#)/i, i.DATA_URI = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i, i.SVG_SIZE = /<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i, i.SHAPES = {
                        POLY: 0,
                        RECT: 1,
                        CIRC: 2,
                        ELIP: 3,
                        RREC: 4
                    }, i.PRECISION = {
                        LOW: "lowp",
                        MEDIUM: "mediump",
                        HIGH: "highp"
                    }, i.TRANSFORM_MODE = {
                        STATIC: 0,
                        DYNAMIC: 1
                    }, i.TEXT_GRADIENT = {
                        LINEAR_VERTICAL: 0,
                        LINEAR_HORIZONTAL: 1
                    }, i.UPDATE_PRIORITY = {
                        INTERACTION: 50,
                        HIGH: 25,
                        NORMAL: 0,
                        LOW: -25,
                        UTILITY: -50
                    }
                }, {}],
                47: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../math"),
                        o = function() {
                            function e() {
                                r(this, e), this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = -1 / 0, this.maxY = -1 / 0, this.rect = null
                            }
                            return e.prototype.isEmpty = function() {
                                return this.minX > this.maxX || this.minY > this.maxY
                            }, e.prototype.clear = function() {
                                this.updateID++, this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = -1 / 0, this.maxY = -1 / 0
                            }, e.prototype.getRectangle = function(e) {
                                return this.minX > this.maxX || this.minY > this.maxY ? n.Rectangle.EMPTY : (e = e || new n.Rectangle(0, 0, 1, 1), e.x = this.minX, e.y = this.minY, e.width = this.maxX - this.minX, e.height = this.maxY - this.minY, e)
                            }, e.prototype.addPoint = function(e) {
                                this.minX = Math.min(this.minX, e.x), this.maxX = Math.max(this.maxX, e.x), this.minY = Math.min(this.minY, e.y), this.maxY = Math.max(this.maxY, e.y)
                            }, e.prototype.addQuad = function(e) {
                                var t = this.minX,
                                    i = this.minY,
                                    r = this.maxX,
                                    n = this.maxY,
                                    o = e[0],
                                    s = e[1];
                                t = o < t ? o : t, i = s < i ? s : i, r = o > r ? o : r, n = s > n ? s : n, o = e[2], s = e[3], t = o < t ? o : t, i = s < i ? s : i, r = o > r ? o : r, n = s > n ? s : n, o = e[4], s = e[5], t = o < t ? o : t, i = s < i ? s : i, r = o > r ? o : r, n = s > n ? s : n, o = e[6], s = e[7], t = o < t ? o : t, i = s < i ? s : i, r = o > r ? o : r, n = s > n ? s : n, this.minX = t, this.minY = i, this.maxX = r, this.maxY = n
                            }, e.prototype.addFrame = function(e, t, i, r, n) {
                                var o = e.worldTransform,
                                    s = o.a,
                                    a = o.b,
                                    l = o.c,
                                    u = o.d,
                                    c = o.tx,
                                    h = o.ty,
                                    d = this.minX,
                                    p = this.minY,
                                    f = this.maxX,
                                    _ = this.maxY,
                                    m = s * t + l * i + c,
                                    g = a * t + u * i + h;
                                d = m < d ? m : d, p = g < p ? g : p, f = m > f ? m : f, _ = g > _ ? g : _, m = s * r + l * i + c, g = a * r + u * i + h, d = m < d ? m : d, p = g < p ? g : p, f = m > f ? m : f, _ = g > _ ? g : _, m = s * t + l * n + c, g = a * t + u * n + h, d = m < d ? m : d, p = g < p ? g : p, f = m > f ? m : f, _ = g > _ ? g : _, m = s * r + l * n + c, g = a * r + u * n + h, d = m < d ? m : d, p = g < p ? g : p, f = m > f ? m : f, _ = g > _ ? g : _, this.minX = d, this.minY = p, this.maxX = f, this.maxY = _
                            }, e.prototype.addVertices = function(e, t, i, r) {
                                for (var n = e.worldTransform, o = n.a, s = n.b, a = n.c, l = n.d, u = n.tx, c = n.ty, h = this.minX, d = this.minY, p = this.maxX, f = this.maxY, _ = i; _ < r; _ += 2) {
                                    var m = t[_],
                                        g = t[_ + 1],
                                        v = o * m + a * g + u,
                                        y = l * g + s * m + c;
                                    h = v < h ? v : h, d = y < d ? y : d, p = v > p ? v : p, f = y > f ? y : f
                                }
                                this.minX = h, this.minY = d, this.maxX = p, this.maxY = f
                            }, e.prototype.addBounds = function(e) {
                                var t = this.minX,
                                    i = this.minY,
                                    r = this.maxX,
                                    n = this.maxY;
                                this.minX = e.minX < t ? e.minX : t, this.minY = e.minY < i ? e.minY : i, this.maxX = e.maxX > r ? e.maxX : r, this.maxY = e.maxY > n ? e.maxY : n
                            }, e.prototype.addBoundsMask = function(e, t) {
                                var i = e.minX > t.minX ? e.minX : t.minX,
                                    r = e.minY > t.minY ? e.minY : t.minY,
                                    n = e.maxX < t.maxX ? e.maxX : t.maxX,
                                    o = e.maxY < t.maxY ? e.maxY : t.maxY;
                                if (i <= n && r <= o) {
                                    var s = this.minX,
                                        a = this.minY,
                                        l = this.maxX,
                                        u = this.maxY;
                                    this.minX = i < s ? i : s, this.minY = r < a ? r : a, this.maxX = n > l ? n : l, this.maxY = o > u ? o : u
                                }
                            }, e.prototype.addBoundsArea = function(e, t) {
                                var i = e.minX > t.x ? e.minX : t.x,
                                    r = e.minY > t.y ? e.minY : t.y,
                                    n = e.maxX < t.x + t.width ? e.maxX : t.x + t.width,
                                    o = e.maxY < t.y + t.height ? e.maxY : t.y + t.height;
                                if (i <= n && r <= o) {
                                    var s = this.minX,
                                        a = this.minY,
                                        l = this.maxX,
                                        u = this.maxY;
                                    this.minX = i < s ? i : s, this.minY = r < a ? r : a, this.maxX = n > l ? n : l, this.maxY = o > u ? o : u
                                }
                            }, e
                        }();
                    i.default = o
                }, {
                    "../math": 70
                }],
                48: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("../utils"),
                        l = e("./DisplayObject"),
                        u = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(l),
                        c = function(e) {
                            function t() {
                                r(this, t);
                                var i = n(this, e.call(this));
                                return i.children = [], i
                            }
                            return o(t, e), t.prototype.onChildrenChange = function() {}, t.prototype.addChild = function(e) {
                                var t = arguments.length;
                                if (t > 1)
                                    for (var i = 0; i < t; i++) this.addChild(arguments[i]);
                                else e.parent && e.parent.removeChild(e), e.parent = this, e.transform._parentID = -1, this.children.push(e), this._boundsID++, this.onChildrenChange(this.children.length - 1), e.emit("added", this);
                                return e
                            }, t.prototype.addChildAt = function(e, t) {
                                if (t < 0 || t > this.children.length) throw new Error(e + "addChildAt: The index " + t + " supplied is out of bounds " + this.children.length);
                                return e.parent && e.parent.removeChild(e), e.parent = this, e.transform._parentID = -1, this.children.splice(t, 0, e), this._boundsID++, this.onChildrenChange(t), e.emit("added", this), e
                            }, t.prototype.swapChildren = function(e, t) {
                                if (e !== t) {
                                    var i = this.getChildIndex(e),
                                        r = this.getChildIndex(t);
                                    this.children[i] = t, this.children[r] = e, this.onChildrenChange(i < r ? i : r)
                                }
                            }, t.prototype.getChildIndex = function(e) {
                                var t = this.children.indexOf(e);
                                if (-1 === t) throw new Error("The supplied DisplayObject must be a child of the caller");
                                return t
                            }, t.prototype.setChildIndex = function(e, t) {
                                if (t < 0 || t >= this.children.length) throw new Error("The index " + t + " supplied is out of bounds " + this.children.length);
                                var i = this.getChildIndex(e);
                                (0, a.removeItems)(this.children, i, 1), this.children.splice(t, 0, e), this.onChildrenChange(t)
                            }, t.prototype.getChildAt = function(e) {
                                if (e < 0 || e >= this.children.length) throw new Error("getChildAt: Index (" + e + ") does not exist.");
                                return this.children[e]
                            }, t.prototype.removeChild = function(e) {
                                var t = arguments.length;
                                if (t > 1)
                                    for (var i = 0; i < t; i++) this.removeChild(arguments[i]);
                                else {
                                    var r = this.children.indexOf(e);
                                    if (-1 === r) return null;
                                    e.parent = null, e.transform._parentID = -1, (0, a.removeItems)(this.children, r, 1), this._boundsID++, this.onChildrenChange(r), e.emit("removed", this)
                                }
                                return e
                            }, t.prototype.removeChildAt = function(e) {
                                var t = this.getChildAt(e);
                                return t.parent = null, t.transform._parentID = -1, (0, a.removeItems)(this.children, e, 1), this._boundsID++, this.onChildrenChange(e), t.emit("removed", this), t
                            }, t.prototype.removeChildren = function() {
                                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                                    t = arguments[1],
                                    i = e,
                                    r = "number" == typeof t ? t : this.children.length,
                                    n = r - i,
                                    o = void 0;
                                if (n > 0 && n <= r) {
                                    o = this.children.splice(i, n);
                                    for (var s = 0; s < o.length; ++s) o[s].parent = null, o[s].transform && (o[s].transform._parentID = -1);
                                    this._boundsID++, this.onChildrenChange(e);
                                    for (var a = 0; a < o.length; ++a) o[a].emit("removed", this);
                                    return o
                                }
                                if (0 === n && 0 === this.children.length) return [];
                                throw new RangeError("removeChildren: numeric values are outside the acceptable range.")
                            }, t.prototype.updateTransform = function() {
                                this._boundsID++, this.transform.updateTransform(this.parent.transform), this.worldAlpha = this.alpha * this.parent.worldAlpha;
                                for (var e = 0, t = this.children.length; e < t; ++e) {
                                    var i = this.children[e];
                                    i.visible && i.updateTransform()
                                }
                            }, t.prototype.calculateBounds = function() {
                                this._bounds.clear(), this._calculateBounds();
                                for (var e = 0; e < this.children.length; e++) {
                                    var t = this.children[e];
                                    t.visible && t.renderable && (t.calculateBounds(), t._mask ? (t._mask.calculateBounds(), this._bounds.addBoundsMask(t._bounds, t._mask._bounds)) : t.filterArea ? this._bounds.addBoundsArea(t._bounds, t.filterArea) : this._bounds.addBounds(t._bounds))
                                }
                                this._lastBoundsID = this._boundsID
                            }, t.prototype._calculateBounds = function() {}, t.prototype.renderWebGL = function(e) {
                                if (this.visible && !(this.worldAlpha <= 0) && this.renderable)
                                    if (this._mask || this._filters) this.renderAdvancedWebGL(e);
                                    else {
                                        this._renderWebGL(e);
                                        for (var t = 0, i = this.children.length; t < i; ++t) this.children[t].renderWebGL(e)
                                    }
                            }, t.prototype.renderAdvancedWebGL = function(e) {
                                e.flush();
                                var t = this._filters,
                                    i = this._mask;
                                if (t) {
                                    this._enabledFilters || (this._enabledFilters = []), this._enabledFilters.length = 0;
                                    for (var r = 0; r < t.length; r++) t[r].enabled && this._enabledFilters.push(t[r]);
                                    this._enabledFilters.length && e.filterManager.pushFilter(this, this._enabledFilters)
                                }
                                i && e.maskManager.pushMask(this, this._mask), this._renderWebGL(e);
                                for (var n = 0, o = this.children.length; n < o; n++) this.children[n].renderWebGL(e);
                                e.flush(), i && e.maskManager.popMask(this, this._mask), t && this._enabledFilters && this._enabledFilters.length && e.filterManager.popFilter()
                            }, t.prototype._renderWebGL = function(e) {}, t.prototype._renderCanvas = function(e) {}, t.prototype.renderCanvas = function(e) {
                                if (this.visible && !(this.worldAlpha <= 0) && this.renderable) {
                                    this._mask && e.maskManager.pushMask(this._mask), this._renderCanvas(e);
                                    for (var t = 0, i = this.children.length; t < i; ++t) this.children[t].renderCanvas(e);
                                    this._mask && e.maskManager.popMask(e)
                                }
                            }, t.prototype.destroy = function(t) {
                                e.prototype.destroy.call(this);
                                var i = "boolean" == typeof t ? t : t && t.children,
                                    r = this.removeChildren(0, this.children.length);
                                if (i)
                                    for (var n = 0; n < r.length; ++n) r[n].destroy(t)
                            }, s(t, [{
                                key: "width",
                                get: function() {
                                    return this.scale.x * this.getLocalBounds().width
                                },
                                set: function(e) {
                                    var t = this.getLocalBounds().width;
                                    this.scale.x = 0 !== t ? e / t : 1, this._width = e
                                }
                            }, {
                                key: "height",
                                get: function() {
                                    return this.scale.y * this.getLocalBounds().height
                                },
                                set: function(e) {
                                    var t = this.getLocalBounds().height;
                                    this.scale.y = 0 !== t ? e / t : 1, this._height = e
                                }
                            }]), t
                        }(u.default);
                    i.default = c, c.prototype.containerUpdateTransform = c.prototype.updateTransform
                }, {
                    "../utils": 125,
                    "./DisplayObject": 49
                }],
                49: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        l = e("eventemitter3"),
                        u = r(l),
                        c = e("../const"),
                        h = e("../settings"),
                        d = r(h),
                        p = e("./TransformStatic"),
                        f = r(p),
                        _ = e("./Transform"),
                        m = r(_),
                        g = e("./Bounds"),
                        v = r(g),
                        y = e("../math"),
                        b = function(e) {
                            function t() {
                                n(this, t);
                                var i = o(this, e.call(this)),
                                    r = d.default.TRANSFORM_MODE === c.TRANSFORM_MODE.STATIC ? f.default : m.default;
                                return i.tempDisplayObjectParent = null, i.transform = new r, i.alpha = 1, i.visible = !0, i.renderable = !0, i.parent = null, i.worldAlpha = 1, i.filterArea = null, i._filters = null, i._enabledFilters = null, i._bounds = new v.default, i._boundsID = 0, i._lastBoundsID = -1, i._boundsRect = null, i._localBoundsRect = null, i._mask = null, i._destroyed = !1, i
                            }
                            return s(t, e), t.prototype.updateTransform = function() {
                                this.transform.updateTransform(this.parent.transform), this.worldAlpha = this.alpha * this.parent.worldAlpha, this._bounds.updateID++
                            }, t.prototype._recursivePostUpdateTransform = function() {
                                this.parent ? (this.parent._recursivePostUpdateTransform(), this.transform.updateTransform(this.parent.transform)) : this.transform.updateTransform(this._tempDisplayObjectParent.transform)
                            }, t.prototype.getBounds = function(e, t) {
                                return e || (this.parent ? (this._recursivePostUpdateTransform(), this.updateTransform()) : (this.parent = this._tempDisplayObjectParent, this.updateTransform(), this.parent = null)), this._boundsID !== this._lastBoundsID && this.calculateBounds(), t || (this._boundsRect || (this._boundsRect = new y.Rectangle), t = this._boundsRect), this._bounds.getRectangle(t)
                            }, t.prototype.getLocalBounds = function(e) {
                                var t = this.transform,
                                    i = this.parent;
                                this.parent = null, this.transform = this._tempDisplayObjectParent.transform, e || (this._localBoundsRect || (this._localBoundsRect = new y.Rectangle), e = this._localBoundsRect);
                                var r = this.getBounds(!1, e);
                                return this.parent = i, this.transform = t, r
                            }, t.prototype.toGlobal = function(e, t) {
                                return arguments.length > 2 && void 0 !== arguments[2] && arguments[2] || (this._recursivePostUpdateTransform(), this.parent ? this.displayObjectUpdateTransform() : (this.parent = this._tempDisplayObjectParent, this.displayObjectUpdateTransform(), this.parent = null)), this.worldTransform.apply(e, t)
                            }, t.prototype.toLocal = function(e, t, i, r) {
                                return t && (e = t.toGlobal(e, i, r)), r || (this._recursivePostUpdateTransform(), this.parent ? this.displayObjectUpdateTransform() : (this.parent = this._tempDisplayObjectParent, this.displayObjectUpdateTransform(), this.parent = null)), this.worldTransform.applyInverse(e, i)
                            }, t.prototype.renderWebGL = function(e) {}, t.prototype.renderCanvas = function(e) {}, t.prototype.setParent = function(e) {
                                if (!e || !e.addChild) throw new Error("setParent: Argument must be a Container");
                                return e.addChild(this), e
                            }, t.prototype.setTransform = function() {
                                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                                    t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
                                    i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
                                    r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1,
                                    n = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0,
                                    o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0,
                                    s = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : 0,
                                    a = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : 0,
                                    l = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : 0;
                                return this.position.x = e, this.position.y = t, this.scale.x = i || 1, this.scale.y = r || 1, this.rotation = n, this.skew.x = o, this.skew.y = s, this.pivot.x = a, this.pivot.y = l, this
                            }, t.prototype.destroy = function() {
                                this.removeAllListeners(), this.parent && this.parent.removeChild(this), this.transform = null, this.parent = null, this._bounds = null, this._currentBounds = null, this._mask = null, this.filterArea = null, this.interactive = !1, this.interactiveChildren = !1, this._destroyed = !0
                            }, a(t, [{
                                key: "_tempDisplayObjectParent",
                                get: function() {
                                    return null === this.tempDisplayObjectParent && (this.tempDisplayObjectParent = new t), this.tempDisplayObjectParent
                                }
                            }, {
                                key: "x",
                                get: function() {
                                    return this.position.x
                                },
                                set: function(e) {
                                    this.transform.position.x = e
                                }
                            }, {
                                key: "y",
                                get: function() {
                                    return this.position.y
                                },
                                set: function(e) {
                                    this.transform.position.y = e
                                }
                            }, {
                                key: "worldTransform",
                                get: function() {
                                    return this.transform.worldTransform
                                }
                            }, {
                                key: "localTransform",
                                get: function() {
                                    return this.transform.localTransform
                                }
                            }, {
                                key: "position",
                                get: function() {
                                    return this.transform.position
                                },
                                set: function(e) {
                                    this.transform.position.copy(e)
                                }
                            }, {
                                key: "scale",
                                get: function() {
                                    return this.transform.scale
                                },
                                set: function(e) {
                                    this.transform.scale.copy(e)
                                }
                            }, {
                                key: "pivot",
                                get: function() {
                                    return this.transform.pivot
                                },
                                set: function(e) {
                                    this.transform.pivot.copy(e)
                                }
                            }, {
                                key: "skew",
                                get: function() {
                                    return this.transform.skew
                                },
                                set: function(e) {
                                    this.transform.skew.copy(e)
                                }
                            }, {
                                key: "rotation",
                                get: function() {
                                    return this.transform.rotation
                                },
                                set: function(e) {
                                    this.transform.rotation = e
                                }
                            }, {
                                key: "worldVisible",
                                get: function() {
                                    var e = this;
                                    do {
                                        if (!e.visible) return !1;
                                        e = e.parent
                                    } while (e);
                                    return !0
                                }
                            }, {
                                key: "mask",
                                get: function() {
                                    return this._mask
                                },
                                set: function(e) {
                                    this._mask && (this._mask.renderable = !0, this._mask.isMask = !1), this._mask = e, this._mask && (this._mask.renderable = !1, this._mask.isMask = !0)
                                }
                            }, {
                                key: "filters",
                                get: function() {
                                    return this._filters && this._filters.slice()
                                },
                                set: function(e) {
                                    this._filters = e && e.slice()
                                }
                            }]), t
                        }(u.default);
                    i.default = b, b.prototype.displayObjectUpdateTransform = b.prototype.updateTransform
                }, {
                    "../const": 46,
                    "../math": 70,
                    "../settings": 101,
                    "./Bounds": 47,
                    "./Transform": 50,
                    "./TransformStatic": 52,
                    eventemitter3: 3
                }],
                50: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("../math"),
                        l = e("./TransformBase"),
                        u = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(l),
                        c = function(e) {
                            function t() {
                                r(this, t);
                                var i = n(this, e.call(this));
                                return i.position = new a.Point(0, 0), i.scale = new a.Point(1, 1), i.skew = new a.ObservablePoint(i.updateSkew, i, 0, 0), i.pivot = new a.Point(0, 0), i._rotation = 0, i._cx = 1, i._sx = 0, i._cy = 0, i._sy = 1, i
                            }
                            return o(t, e), t.prototype.updateSkew = function() {
                                this._cx = Math.cos(this._rotation + this.skew._y), this._sx = Math.sin(this._rotation + this.skew._y), this._cy = -Math.sin(this._rotation - this.skew._x), this._sy = Math.cos(this._rotation - this.skew._x)
                            }, t.prototype.updateLocalTransform = function() {
                                var e = this.localTransform;
                                e.a = this._cx * this.scale.x, e.b = this._sx * this.scale.x, e.c = this._cy * this.scale.y, e.d = this._sy * this.scale.y, e.tx = this.position.x - (this.pivot.x * e.a + this.pivot.y * e.c), e.ty = this.position.y - (this.pivot.x * e.b + this.pivot.y * e.d)
                            }, t.prototype.updateTransform = function(e) {
                                var t = this.localTransform;
                                t.a = this._cx * this.scale.x, t.b = this._sx * this.scale.x, t.c = this._cy * this.scale.y, t.d = this._sy * this.scale.y, t.tx = this.position.x - (this.pivot.x * t.a + this.pivot.y * t.c), t.ty = this.position.y - (this.pivot.x * t.b + this.pivot.y * t.d);
                                var i = e.worldTransform,
                                    r = this.worldTransform;
                                r.a = t.a * i.a + t.b * i.c, r.b = t.a * i.b + t.b * i.d, r.c = t.c * i.a + t.d * i.c, r.d = t.c * i.b + t.d * i.d, r.tx = t.tx * i.a + t.ty * i.c + i.tx, r.ty = t.tx * i.b + t.ty * i.d + i.ty, this._worldID++
                            }, t.prototype.setFromMatrix = function(e) {
                                e.decompose(this)
                            }, s(t, [{
                                key: "rotation",
                                get: function() {
                                    return this._rotation
                                },
                                set: function(e) {
                                    this._rotation = e, this.updateSkew()
                                }
                            }]), t
                        }(u.default);
                    i.default = c
                }, {
                    "../math": 70,
                    "./TransformBase": 51
                }],
                51: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../math"),
                        o = function() {
                            function e() {
                                r(this, e), this.worldTransform = new n.Matrix, this.localTransform = new n.Matrix, this._worldID = 0, this._parentID = 0
                            }
                            return e.prototype.updateLocalTransform = function() {}, e.prototype.updateTransform = function(e) {
                                var t = e.worldTransform,
                                    i = this.worldTransform,
                                    r = this.localTransform;
                                i.a = r.a * t.a + r.b * t.c, i.b = r.a * t.b + r.b * t.d, i.c = r.c * t.a + r.d * t.c, i.d = r.c * t.b + r.d * t.d, i.tx = r.tx * t.a + r.ty * t.c + t.tx, i.ty = r.tx * t.b + r.ty * t.d + t.ty, this._worldID++
                            }, e
                        }();
                    i.default = o, o.prototype.updateWorldTransform = o.prototype.updateTransform, o.IDENTITY = new o
                }, {
                    "../math": 70
                }],
                52: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("../math"),
                        l = e("./TransformBase"),
                        u = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(l),
                        c = function(e) {
                            function t() {
                                r(this, t);
                                var i = n(this, e.call(this));
                                return i.position = new a.ObservablePoint(i.onChange, i, 0, 0), i.scale = new a.ObservablePoint(i.onChange, i, 1, 1), i.pivot = new a.ObservablePoint(i.onChange, i, 0, 0), i.skew = new a.ObservablePoint(i.updateSkew, i, 0, 0), i._rotation = 0, i._cx = 1, i._sx = 0, i._cy = 0, i._sy = 1, i._localID = 0, i._currentLocalID = 0, i
                            }
                            return o(t, e), t.prototype.onChange = function() {
                                    this._localID++
                                }, t.prototype.updateSkew = function() {
                                    this._cx = Math.cos(this._rotation + this.skew._y), this._sx = Math.sin(this._rotation + this.skew._y), this._cy = -Math.sin(this._rotation - this.skew._x), this._sy = Math.cos(this._rotation - this.skew._x), this._localID++
                                }, t.prototype.updateLocalTransform = function() {
                                    var e = this.localTransform;
                                    this._localID !== this._currentLocalID && (e.a = this._cx * this.scale._x, e.b = this._sx * this.scale._x, e.c = this._cy * this.scale._y, e.d = this._sy * this.scale._y, e.tx = this.position._x - (this.pivot._x * e.a + this.pivot._y * e.c), e.ty = this.position._y - (this.pivot._x * e.b + this.pivot._y * e.d), this._currentLocalID = this._localID, this._parentID = -1)
                                }, t.prototype.updateTransform = function(e) {
                                    var t = this.localTransform;
                                    if (this._localID !== this._currentLocalID && (t.a = this._cx * this.scale._x, t.b = this._sx * this.scale._x, t.c = this._cy * this.scale._y, t.d = this._sy * this.scale._y, t.tx = this.position._x - (this.pivot._x * t.a + this.pivot._y * t.c), t.ty = this.position._y - (this.pivot._x * t.b + this.pivot._y * t.d), this._currentLocalID = this._localID, this._parentID = -1), this._parentID !== e._worldID) {
                                        var i = e.worldTransform,
                                            r = this.worldTransform;
                                        r.a = t.a * i.a + t.b * i.c, r.b = t.a * i.b + t.b * i.d, r.c = t.c * i.a + t.d * i.c, r.d = t.c * i.b + t.d * i.d, r.tx = t.tx * i.a + t.ty * i.c + i.tx, r.ty = t.tx * i.b + t.ty * i.d + i.ty, this._parentID = e._worldID, this._worldID++
                                    }
                                },
                                t.prototype.setFromMatrix = function(e) {
                                    e.decompose(this), this._localID++
                                }, s(t, [{
                                    key: "rotation",
                                    get: function() {
                                        return this._rotation
                                    },
                                    set: function(e) {
                                        this._rotation !== e && (this._rotation = e, this.updateSkew())
                                    }
                                }]), t
                        }(u.default);
                    i.default = c
                }, {
                    "../math": 70,
                    "./TransformBase": 51
                }],
                53: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("../display/Container"),
                        l = r(a),
                        u = e("../textures/RenderTexture"),
                        c = r(u),
                        h = e("../textures/Texture"),
                        d = r(h),
                        p = e("./GraphicsData"),
                        f = r(p),
                        _ = e("../sprites/Sprite"),
                        m = r(_),
                        g = e("../math"),
                        v = e("../utils"),
                        y = e("../const"),
                        b = e("../display/Bounds"),
                        x = r(b),
                        T = e("./utils/bezierCurveTo"),
                        E = r(T),
                        S = e("../renderers/canvas/CanvasRenderer"),
                        P = r(S),
                        A = void 0,
                        C = new g.Matrix,
                        M = new g.Point,
                        R = new Float32Array(4),
                        O = new Float32Array(4),
                        w = function(e) {
                            function t() {
                                var i = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
                                n(this, t);
                                var r = o(this, e.call(this));
                                return r.fillAlpha = 1, r.lineWidth = 0, r.nativeLines = i, r.lineColor = 0, r.lineAlignment = .5, r.graphicsData = [], r.tint = 16777215, r._prevTint = 16777215, r.blendMode = y.BLEND_MODES.NORMAL, r.currentPath = null, r._webGL = {}, r.isMask = !1, r.boundsPadding = 0, r._localBounds = new x.default, r.dirty = 0, r.fastRectDirty = -1, r.clearDirty = 0, r.boundsDirty = -1, r.cachedSpriteDirty = !1, r._spriteRect = null, r._fastRect = !1, r._prevRectTint = null, r._prevRectFillColor = null, r
                            }
                            return s(t, e), t.prototype.clone = function() {
                                var e = new t;
                                e.renderable = this.renderable, e.fillAlpha = this.fillAlpha, e.lineWidth = this.lineWidth, e.lineColor = this.lineColor, e.lineAlignment = this.lineAlignment, e.tint = this.tint, e.blendMode = this.blendMode, e.isMask = this.isMask, e.boundsPadding = this.boundsPadding, e.dirty = 0, e.cachedSpriteDirty = this.cachedSpriteDirty;
                                for (var i = 0; i < this.graphicsData.length; ++i) e.graphicsData.push(this.graphicsData[i].clone());
                                return e.currentPath = e.graphicsData[e.graphicsData.length - 1], e.updateLocalBounds(), e
                            }, t.prototype._quadraticCurveLength = function(e, t, i, r, n, o) {
                                var s = e - (2 * i + n),
                                    a = t - (2 * r + o),
                                    l = (i - 2) * e * 2,
                                    u = (r - 2) * t * 2,
                                    c = 4 * (s * s + a * a),
                                    h = 4 * (s * l + a * u),
                                    d = l * l + u * u,
                                    p = 2 * Math.sqrt(c + h + d),
                                    f = Math.sqrt(c),
                                    _ = 2 * c * f,
                                    m = 2 * Math.sqrt(d),
                                    g = h / f;
                                return (_ * p + f * h * (p - m) + (4 * d * c - h * h) * Math.log((2 * f + g + p) / (g + m))) / (4 * _)
                            }, t.prototype._bezierCurveLength = function(e, t, i, r, n, o, s, a) {
                                for (var l = 0, u = 0, c = 0, h = 0, d = 0, p = 0, f = 0, _ = 0, m = 0, g = 0, v = 0, y = e, b = t, x = 1; x <= 10; ++x) u = x / 10, c = u * u, h = c * u, d = 1 - u, p = d * d, f = p * d, _ = f * e + 3 * p * u * i + 3 * d * c * n + h * s, m = f * t + 3 * p * u * r + 3 * d * c * o + h * a, g = y - _, v = b - m, y = _, b = m, l += Math.sqrt(g * g + v * v);
                                return l
                            }, t.prototype._segmentsCount = function(e) {
                                var i = Math.ceil(e / t.CURVES.maxLength);
                                return i < t.CURVES.minSegments ? i = t.CURVES.minSegments : i > t.CURVES.maxSegments && (i = t.CURVES.maxSegments), i
                            }, t.prototype.lineStyle = function() {
                                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                                    t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
                                    i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
                                    r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : .5;
                                if (this.lineWidth = e, this.lineColor = t, this.lineAlpha = i, this.lineAlignment = r, this.currentPath)
                                    if (this.currentPath.shape.points.length) {
                                        var n = new g.Polygon(this.currentPath.shape.points.slice(-2));
                                        n.closed = !1, this.drawShape(n)
                                    } else this.currentPath.lineWidth = this.lineWidth, this.currentPath.lineColor = this.lineColor, this.currentPath.lineAlpha = this.lineAlpha, this.currentPath.lineAlignment = this.lineAlignment;
                                return this
                            }, t.prototype.moveTo = function(e, t) {
                                var i = new g.Polygon([e, t]);
                                return i.closed = !1, this.drawShape(i), this
                            }, t.prototype.lineTo = function(e, t) {
                                var i = this.currentPath.shape.points,
                                    r = i[i.length - 2],
                                    n = i[i.length - 1];
                                return r === e && n === t || (i.push(e, t), this.dirty++), this
                            }, t.prototype.quadraticCurveTo = function(e, i, r, n) {
                                this.currentPath ? 0 === this.currentPath.shape.points.length && (this.currentPath.shape.points = [0, 0]) : this.moveTo(0, 0);
                                var o = this.currentPath.shape.points,
                                    s = 0,
                                    a = 0;
                                0 === o.length && this.moveTo(0, 0);
                                for (var l = o[o.length - 2], u = o[o.length - 1], c = t.CURVES.adaptive ? this._segmentsCount(this._quadraticCurveLength(l, u, e, i, r, n)) : 20, h = 1; h <= c; ++h) {
                                    var d = h / c;
                                    s = l + (e - l) * d, a = u + (i - u) * d, o.push(s + (e + (r - e) * d - s) * d, a + (i + (n - i) * d - a) * d)
                                }
                                return this.dirty++, this
                            }, t.prototype.bezierCurveTo = function(e, i, r, n, o, s) {
                                this.currentPath ? 0 === this.currentPath.shape.points.length && (this.currentPath.shape.points = [0, 0]) : this.moveTo(0, 0);
                                var a = this.currentPath.shape.points,
                                    l = a[a.length - 2],
                                    u = a[a.length - 1];
                                a.length -= 2;
                                var c = t.CURVES.adaptive ? this._segmentsCount(this._bezierCurveLength(l, u, e, i, r, n, o, s)) : 20;
                                return (0, E.default)(l, u, e, i, r, n, o, s, c, a), this.dirty++, this
                            }, t.prototype.arcTo = function(e, t, i, r, n) {
                                this.currentPath ? 0 === this.currentPath.shape.points.length && this.currentPath.shape.points.push(e, t) : this.moveTo(e, t);
                                var o = this.currentPath.shape.points,
                                    s = o[o.length - 2],
                                    a = o[o.length - 1],
                                    l = a - t,
                                    u = s - e,
                                    c = r - t,
                                    h = i - e,
                                    d = Math.abs(l * h - u * c);
                                if (d < 1e-8 || 0 === n) o[o.length - 2] === e && o[o.length - 1] === t || o.push(e, t);
                                else {
                                    var p = l * l + u * u,
                                        f = c * c + h * h,
                                        _ = l * c + u * h,
                                        m = n * Math.sqrt(p) / d,
                                        g = n * Math.sqrt(f) / d,
                                        v = m * _ / p,
                                        y = g * _ / f,
                                        b = m * h + g * u,
                                        x = m * c + g * l,
                                        T = u * (g + v),
                                        E = l * (g + v),
                                        S = h * (m + y),
                                        P = c * (m + y),
                                        A = Math.atan2(E - x, T - b),
                                        C = Math.atan2(P - x, S - b);
                                    this.arc(b + e, x + t, n, A, C, u * c > h * l)
                                }
                                return this.dirty++, this
                            }, t.prototype.arc = function(e, i, r, n, o) {
                                var s = arguments.length > 5 && void 0 !== arguments[5] && arguments[5];
                                if (n === o) return this;
                                !s && o <= n ? o += y.PI_2 : s && n <= o && (n += y.PI_2);
                                var a = o - n,
                                    l = t.CURVES.adaptive ? this._segmentsCount(Math.abs(a) * r) : 40 * Math.ceil(Math.abs(a) / y.PI_2);
                                if (0 === a) return this;
                                var u = e + Math.cos(n) * r,
                                    c = i + Math.sin(n) * r,
                                    h = this.currentPath ? this.currentPath.shape.points : null;
                                if (h) {
                                    var d = Math.abs(h[h.length - 2] - u),
                                        p = Math.abs(h[h.length - 1] - c);
                                    d < .001 && p < .001 || h.push(u, c)
                                } else this.moveTo(u, c), h = this.currentPath.shape.points;
                                for (var f = a / (2 * l), _ = 2 * f, m = Math.cos(f), g = Math.sin(f), v = l - 1, b = v % 1 / v, x = 0; x <= v; ++x) {
                                    var T = x + b * x,
                                        E = f + n + _ * T,
                                        S = Math.cos(E),
                                        P = -Math.sin(E);
                                    h.push((m * S + g * P) * r + e, (m * -P + g * S) * r + i)
                                }
                                return this.dirty++, this
                            }, t.prototype.beginFill = function() {
                                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                                    t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
                                return this.filling = !0, this.fillColor = e, this.fillAlpha = t, this.currentPath && this.currentPath.shape.points.length <= 2 && (this.currentPath.fill = this.filling, this.currentPath.fillColor = this.fillColor, this.currentPath.fillAlpha = this.fillAlpha), this
                            }, t.prototype.endFill = function() {
                                return this.filling = !1, this.fillColor = null, this.fillAlpha = 1, this
                            }, t.prototype.drawRect = function(e, t, i, r) {
                                return this.drawShape(new g.Rectangle(e, t, i, r)), this
                            }, t.prototype.drawRoundedRect = function(e, t, i, r, n) {
                                return this.drawShape(new g.RoundedRectangle(e, t, i, r, n)), this
                            }, t.prototype.drawCircle = function(e, t, i) {
                                return this.drawShape(new g.Circle(e, t, i)), this
                            }, t.prototype.drawEllipse = function(e, t, i, r) {
                                return this.drawShape(new g.Ellipse(e, t, i, r)), this
                            }, t.prototype.drawPolygon = function(e) {
                                var t = e,
                                    i = !0;
                                if (t instanceof g.Polygon && (i = t.closed, t = t.points), !Array.isArray(t)) {
                                    t = new Array(arguments.length);
                                    for (var r = 0; r < t.length; ++r) t[r] = arguments[r]
                                }
                                var n = new g.Polygon(t);
                                return n.closed = i, this.drawShape(n), this
                            }, t.prototype.drawStar = function(e, t, i, r, n) {
                                var o = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0;
                                n = n || r / 2;
                                for (var s = -1 * Math.PI / 2 + o, a = 2 * i, l = y.PI_2 / a, u = [], c = 0; c < a; c++) {
                                    var h = c % 2 ? n : r,
                                        d = c * l + s;
                                    u.push(e + h * Math.cos(d), t + h * Math.sin(d))
                                }
                                return this.drawPolygon(u)
                            }, t.prototype.clear = function() {
                                return (this.lineWidth || this.filling || this.graphicsData.length > 0) && (this.lineWidth = 0, this.lineAlignment = .5, this.filling = !1, this.boundsDirty = -1, this.canvasTintDirty = -1, this.dirty++, this.clearDirty++, this.graphicsData.length = 0), this.currentPath = null, this._spriteRect = null, this
                            }, t.prototype.isFastRect = function() {
                                return 1 === this.graphicsData.length && this.graphicsData[0].shape.type === y.SHAPES.RECT && !this.graphicsData[0].lineWidth
                            }, t.prototype._renderWebGL = function(e) {
                                this.dirty !== this.fastRectDirty && (this.fastRectDirty = this.dirty, this._fastRect = this.isFastRect()), this._fastRect ? this._renderSpriteRect(e) : (e.setObjectRenderer(e.plugins.graphics), e.plugins.graphics.render(this))
                            }, t.prototype._renderSpriteRect = function(e) {
                                var t = this.graphicsData[0].shape;
                                this._spriteRect || (this._spriteRect = new m.default(new d.default(d.default.WHITE)));
                                var i = this._spriteRect,
                                    r = this.graphicsData[0].fillColor;
                                if (16777215 === this.tint) i.tint = r;
                                else if (this.tint !== this._prevRectTint || r !== this._prevRectFillColor) {
                                    var n = R,
                                        o = O;
                                    (0, v.hex2rgb)(r, n), (0, v.hex2rgb)(this.tint, o), n[0] *= o[0], n[1] *= o[1], n[2] *= o[2], i.tint = (0, v.rgb2hex)(n), this._prevRectTint = this.tint, this._prevRectFillColor = r
                                }
                                i.alpha = this.graphicsData[0].fillAlpha, i.worldAlpha = this.worldAlpha * i.alpha, i.blendMode = this.blendMode, i._texture._frame.width = t.width, i._texture._frame.height = t.height, i.transform.worldTransform = this.transform.worldTransform, i.anchor.set(-t.x / t.width, -t.y / t.height), i._onAnchorUpdate(), i._renderWebGL(e)
                            }, t.prototype._renderCanvas = function(e) {
                                !0 !== this.isMask && e.plugins.graphics.render(this)
                            }, t.prototype._calculateBounds = function() {
                                this.boundsDirty !== this.dirty && (this.boundsDirty = this.dirty, this.updateLocalBounds(), this.cachedSpriteDirty = !0);
                                var e = this._localBounds;
                                this._bounds.addFrame(this.transform, e.minX, e.minY, e.maxX, e.maxY)
                            }, t.prototype.containsPoint = function(e) {
                                this.worldTransform.applyInverse(e, M);
                                for (var t = this.graphicsData, i = 0; i < t.length; ++i) {
                                    var r = t[i];
                                    if (r.fill && (r.shape && r.shape.contains(M.x, M.y))) {
                                        if (r.holes)
                                            for (var n = 0; n < r.holes.length; n++) {
                                                var o = r.holes[n];
                                                if (o.contains(M.x, M.y)) return !1
                                            }
                                        return !0
                                    }
                                }
                                return !1
                            }, t.prototype.updateLocalBounds = function() {
                                var e = 1 / 0,
                                    t = -1 / 0,
                                    i = 1 / 0,
                                    r = -1 / 0;
                                if (this.graphicsData.length)
                                    for (var n = 0, o = 0, s = 0, a = 0, l = 0, u = 0; u < this.graphicsData.length; u++) {
                                        var c = this.graphicsData[u],
                                            h = c.type,
                                            d = c.lineWidth,
                                            p = c.lineAlignment,
                                            f = d * p;
                                        if (n = c.shape, h === y.SHAPES.RECT || h === y.SHAPES.RREC) o = n.x - f, s = n.y - f, a = n.width + 2 * f, l = n.height + 2 * f, e = o < e ? o : e, t = o + a > t ? o + a : t, i = s < i ? s : i, r = s + l > r ? s + l : r;
                                        else if (h === y.SHAPES.CIRC) o = n.x, s = n.y, a = n.radius + f, l = n.radius + f, e = o - a < e ? o - a : e, t = o + a > t ? o + a : t, i = s - l < i ? s - l : i, r = s + l > r ? s + l : r;
                                        else if (h === y.SHAPES.ELIP) o = n.x, s = n.y, a = n.width + f, l = n.height + f, e = o - a < e ? o - a : e, t = o + a > t ? o + a : t, i = s - l < i ? s - l : i, r = s + l > r ? s + l : r;
                                        else
                                            for (var _ = n.points, m = 0, g = 0, v = 0, b = 0, x = 0, T = 0, E = 0, S = 0, P = 0; P + 2 < _.length; P += 2) o = _[P], s = _[P + 1], m = _[P + 2], g = _[P + 3], v = Math.abs(m - o), b = Math.abs(g - s), l = 2 * f, (a = Math.sqrt(v * v + b * b)) < 1e-9 || (x = (l / a * b + v) / 2, T = (l / a * v + b) / 2, E = (m + o) / 2, S = (g + s) / 2, e = E - x < e ? E - x : e, t = E + x > t ? E + x : t, i = S - T < i ? S - T : i, r = S + T > r ? S + T : r)
                                    } else e = 0, t = 0, i = 0, r = 0;
                                var A = this.boundsPadding;
                                this._localBounds.minX = e - A, this._localBounds.maxX = t + A, this._localBounds.minY = i - A, this._localBounds.maxY = r + A
                            }, t.prototype.drawShape = function(e) {
                                this.currentPath && this.currentPath.shape.points.length <= 2 && this.graphicsData.pop(), this.currentPath = null;
                                var t = new f.default(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, this.nativeLines, e, this.lineAlignment);
                                return this.graphicsData.push(t), t.type === y.SHAPES.POLY && (t.shape.closed = t.shape.closed, this.currentPath = t), this.dirty++, t
                            }, t.prototype.generateCanvasTexture = function(e) {
                                var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
                                    i = this.getLocalBounds(),
                                    r = c.default.create(i.width, i.height, e, t);
                                A || (A = new P.default), this.transform.updateLocalTransform(), this.transform.localTransform.copy(C), C.invert(), C.tx -= i.x, C.ty -= i.y, A.render(this, r, !0, C);
                                var n = d.default.fromCanvas(r.baseTexture._canvasRenderTarget.canvas, e, "graphics");
                                return n.baseTexture.resolution = t, n.baseTexture.update(), n
                            }, t.prototype.closePath = function() {
                                var e = this.currentPath;
                                return e && e.shape && e.shape.close(), this
                            }, t.prototype.addHole = function() {
                                var e = this.graphicsData.pop();
                                return this.currentPath = this.graphicsData[this.graphicsData.length - 1], this.currentPath.addHole(e.shape), this.currentPath = null, this
                            }, t.prototype.destroy = function(t) {
                                e.prototype.destroy.call(this, t);
                                for (var i = 0; i < this.graphicsData.length; ++i) this.graphicsData[i].destroy();
                                for (var r in this._webGL)
                                    for (var n = 0; n < this._webGL[r].data.length; ++n) this._webGL[r].data[n].destroy();
                                this._spriteRect && this._spriteRect.destroy(), this.graphicsData = null, this.currentPath = null, this._webGL = null, this._localBounds = null
                            }, t
                        }(l.default);
                    i.default = w, w._SPRITE_TEXTURE = null, w.CURVES = {
                        adaptive: !1,
                        maxLength: 10,
                        minSegments: 8,
                        maxSegments: 2048
                    }
                }, {
                    "../const": 46,
                    "../display/Bounds": 47,
                    "../display/Container": 48,
                    "../math": 70,
                    "../renderers/canvas/CanvasRenderer": 77,
                    "../sprites/Sprite": 102,
                    "../textures/RenderTexture": 113,
                    "../textures/Texture": 115,
                    "../utils": 125,
                    "./GraphicsData": 54,
                    "./utils/bezierCurveTo": 56
                }],
                54: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                        function e(t, i, n, o, s, a, l, u, c) {
                            r(this, e), this.lineWidth = t, this.lineAlignment = c, this.nativeLines = l, this.lineColor = i, this.lineAlpha = n, this._lineTint = i, this.fillColor = o, this.fillAlpha = s, this._fillTint = o, this.fill = a, this.holes = [], this.shape = u, this.type = u.type
                        }
                        return e.prototype.clone = function() {
                            return new e(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.fill, this.nativeLines, this.shape, this.lineAlignment)
                        }, e.prototype.addHole = function(e) {
                            this.holes.push(e)
                        }, e.prototype.destroy = function() {
                            this.shape = null, this.holes = null
                        }, e
                    }();
                    i.default = n
                }, {}],
                55: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../../renderers/canvas/CanvasRenderer"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = e("../../const"),
                        a = function() {
                            function e(t) {
                                r(this, e), this.renderer = t
                            }
                            return e.prototype.render = function(e) {
                                var t = this.renderer,
                                    i = t.context,
                                    r = e.worldAlpha,
                                    n = e.transform.worldTransform,
                                    o = t.resolution;
                                i.setTransform(n.a * o, n.b * o, n.c * o, n.d * o, n.tx * o, n.ty * o), e.canvasTintDirty === e.dirty && e._prevTint === e.tint || this.updateGraphicsTint(e), t.setBlendMode(e.blendMode);
                                for (var a = 0; a < e.graphicsData.length; a++) {
                                    var l = e.graphicsData[a],
                                        u = l.shape,
                                        c = l._fillTint,
                                        h = l._lineTint;
                                    if (i.lineWidth = l.lineWidth, l.type === s.SHAPES.POLY) {
                                        i.beginPath();
                                        var d = u.points,
                                            p = l.holes,
                                            f = void 0,
                                            _ = void 0;
                                        i.moveTo(d[0], d[1]);
                                        for (var m = 2; m < d.length; m += 2) i.lineTo(d[m], d[m + 1]);
                                        if (u.closed && i.closePath(), p.length > 0) {
                                            f = 0;
                                            for (var g = 0; g < d.length; g += 2) f += d[g] * d[g + 3] - d[g + 1] * d[g + 2];
                                            for (var v = 0; v < p.length; v++) {
                                                d = p[v].points, _ = 0;
                                                for (var y = 0; y < d.length; y += 2) _ += d[y] * d[y + 3] - d[y + 1] * d[y + 2];
                                                if (i.moveTo(d[0], d[1]), _ * f < 0)
                                                    for (var b = 2; b < d.length; b += 2) i.lineTo(d[b], d[b + 1]);
                                                else
                                                    for (var x = d.length - 2; x >= 2; x -= 2) i.lineTo(d[x], d[x + 1]);
                                                p[v].closed && i.closePath()
                                            }
                                        }
                                        l.fill && (i.globalAlpha = l.fillAlpha * r, i.fillStyle = "#" + ("00000" + (0 | c).toString(16)).substr(-6), i.fill()), l.lineWidth && (i.globalAlpha = l.lineAlpha * r, i.strokeStyle = "#" + ("00000" + (0 | h).toString(16)).substr(-6), i.stroke())
                                    } else if (l.type === s.SHAPES.RECT)(l.fillColor || 0 === l.fillColor) && (i.globalAlpha = l.fillAlpha * r, i.fillStyle = "#" + ("00000" + (0 | c).toString(16)).substr(-6), i.fillRect(u.x, u.y, u.width, u.height)), l.lineWidth && (i.globalAlpha = l.lineAlpha * r, i.strokeStyle = "#" + ("00000" + (0 | h).toString(16)).substr(-6), i.strokeRect(u.x, u.y, u.width, u.height));
                                    else if (l.type === s.SHAPES.CIRC) i.beginPath(), i.arc(u.x, u.y, u.radius, 0, 2 * Math.PI), i.closePath(), l.fill && (i.globalAlpha = l.fillAlpha * r, i.fillStyle = "#" + ("00000" + (0 | c).toString(16)).substr(-6), i.fill()), l.lineWidth && (i.globalAlpha = l.lineAlpha * r, i.strokeStyle = "#" + ("00000" + (0 | h).toString(16)).substr(-6), i.stroke());
                                    else if (l.type === s.SHAPES.ELIP) {
                                        var T = 2 * u.width,
                                            E = 2 * u.height,
                                            S = u.x - T / 2,
                                            P = u.y - E / 2;
                                        i.beginPath();
                                        var A = T / 2 * .5522848,
                                            C = E / 2 * .5522848,
                                            M = S + T,
                                            R = P + E,
                                            O = S + T / 2,
                                            w = P + E / 2;
                                        i.moveTo(S, w), i.bezierCurveTo(S, w - C, O - A, P, O, P), i.bezierCurveTo(O + A, P, M, w - C, M, w), i.bezierCurveTo(M, w + C, O + A, R, O, R), i.bezierCurveTo(O - A, R, S, w + C, S, w), i.closePath(), l.fill && (i.globalAlpha = l.fillAlpha * r, i.fillStyle = "#" + ("00000" + (0 | c).toString(16)).substr(-6), i.fill()), l.lineWidth && (i.globalAlpha = l.lineAlpha * r, i.strokeStyle = "#" + ("00000" + (0 | h).toString(16)).substr(-6), i.stroke())
                                    } else if (l.type === s.SHAPES.RREC) {
                                        var I = u.x,
                                            D = u.y,
                                            L = u.width,
                                            B = u.height,
                                            F = u.radius,
                                            N = Math.min(L, B) / 2 | 0;
                                        F = F > N ? N : F, i.beginPath(), i.moveTo(I, D + F), i.lineTo(I, D + B - F), i.quadraticCurveTo(I, D + B, I + F, D + B), i.lineTo(I + L - F, D + B), i.quadraticCurveTo(I + L, D + B, I + L, D + B - F), i.lineTo(I + L, D + F), i.quadraticCurveTo(I + L, D, I + L - F, D), i.lineTo(I + F, D), i.quadraticCurveTo(I, D, I, D + F), i.closePath(), (l.fillColor || 0 === l.fillColor) && (i.globalAlpha = l.fillAlpha * r, i.fillStyle = "#" + ("00000" + (0 | c).toString(16)).substr(-6), i.fill()), l.lineWidth && (i.globalAlpha = l.lineAlpha * r, i.strokeStyle = "#" + ("00000" + (0 | h).toString(16)).substr(-6), i.stroke())
                                    }
                                }
                            }, e.prototype.updateGraphicsTint = function(e) {
                                e._prevTint = e.tint, e.canvasTintDirty = e.dirty;
                                for (var t = (e.tint >> 16 & 255) / 255, i = (e.tint >> 8 & 255) / 255, r = (255 & e.tint) / 255, n = 0; n < e.graphicsData.length; ++n) {
                                    var o = e.graphicsData[n],
                                        s = 0 | o.fillColor,
                                        a = 0 | o.lineColor;
                                    o._fillTint = ((s >> 16 & 255) / 255 * t * 255 << 16) + ((s >> 8 & 255) / 255 * i * 255 << 8) + (255 & s) / 255 * r * 255, o._lineTint = ((a >> 16 & 255) / 255 * t * 255 << 16) + ((a >> 8 & 255) / 255 * i * 255 << 8) + (255 & a) / 255 * r * 255
                                }
                            }, e.prototype.renderPolygon = function(e, t, i) {
                                i.moveTo(e[0], e[1]);
                                for (var r = 1; r < e.length / 2; ++r) i.lineTo(e[2 * r], e[2 * r + 1]);
                                t && i.closePath()
                            }, e.prototype.destroy = function() {
                                this.renderer = null
                            }, e
                        }();
                    i.default = a, o.default.registerPlugin("graphics", a)
                }, {
                    "../../const": 46,
                    "../../renderers/canvas/CanvasRenderer": 77
                }],
                56: [function(e, t, i) {
                    "use strict";

                    function r(e, t, i, r, n, o, s, a, l) {
                        var u = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : [],
                            c = 0,
                            h = 0,
                            d = 0,
                            p = 0,
                            f = 0;
                        u.push(e, t);
                        for (var _ = 1, m = 0; _ <= l; ++_) m = _ / l, c = 1 - m, h = c * c, d = h * c, p = m * m, f = p * m, u.push(d * e + 3 * h * m * i + 3 * c * p * n + f * s, d * t + 3 * h * m * r + 3 * c * p * o + f * a);
                        return u
                    }
                    i.__esModule = !0, i.default = r
                }, {}],
                57: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("../../utils"),
                        l = e("../../const"),
                        u = e("../../renderers/webgl/utils/ObjectRenderer"),
                        c = r(u),
                        h = e("../../renderers/webgl/WebGLRenderer"),
                        d = r(h),
                        p = e("./WebGLGraphicsData"),
                        f = r(p),
                        _ = e("./shaders/PrimitiveShader"),
                        m = r(_),
                        g = e("./utils/buildPoly"),
                        v = r(g),
                        y = e("./utils/buildRectangle"),
                        b = r(y),
                        x = e("./utils/buildRoundedRectangle"),
                        T = r(x),
                        E = e("./utils/buildCircle"),
                        S = r(E),
                        P = function(e) {
                            function t(i) {
                                n(this, t);
                                var r = o(this, e.call(this, i));
                                return r.graphicsDataPool = [], r.primitiveShader = null, r.gl = i.gl, r.CONTEXT_UID = 0, r
                            }
                            return s(t, e), t.prototype.onContextChange = function() {
                                this.gl = this.renderer.gl, this.CONTEXT_UID = this.renderer.CONTEXT_UID, this.primitiveShader = new m.default(this.gl)
                            }, t.prototype.destroy = function() {
                                c.default.prototype.destroy.call(this);
                                for (var e = 0; e < this.graphicsDataPool.length; ++e) this.graphicsDataPool[e].destroy();
                                this.graphicsDataPool = null
                            }, t.prototype.render = function(e) {
                                var t = this.renderer,
                                    i = t.gl,
                                    r = void 0,
                                    n = e._webGL[this.CONTEXT_UID];
                                n && e.dirty === n.dirty || (this.updateGraphics(e), n = e._webGL[this.CONTEXT_UID]);
                                var o = this.primitiveShader;
                                t.bindShader(o), t.state.setBlendMode(e.blendMode);
                                for (var s = 0, l = n.data.length; s < l; s++) {
                                    r = n.data[s];
                                    var u = r.shader;
                                    t.bindShader(u), u.uniforms.translationMatrix = e.transform.worldTransform.toArray(!0), u.uniforms.tint = (0, a.hex2rgb)(e.tint), u.uniforms.alpha = e.worldAlpha, t.bindVao(r.vao), r.nativeLines ? i.drawArrays(i.LINES, 0, r.points.length / 6) : r.vao.draw(i.TRIANGLE_STRIP, r.indices.length)
                                }
                            }, t.prototype.updateGraphics = function(e) {
                                var t = this.renderer.gl,
                                    i = e._webGL[this.CONTEXT_UID];
                                if (i || (i = e._webGL[this.CONTEXT_UID] = {
                                        lastIndex: 0,
                                        data: [],
                                        gl: t,
                                        clearDirty: -1,
                                        dirty: -1
                                    }), i.dirty = e.dirty, e.clearDirty !== i.clearDirty) {
                                    i.clearDirty = e.clearDirty;
                                    for (var r = 0; r < i.data.length; r++) this.graphicsDataPool.push(i.data[r]);
                                    i.data.length = 0, i.lastIndex = 0
                                }
                                for (var n = void 0, o = void 0, s = i.lastIndex; s < e.graphicsData.length; s++) {
                                    var a = e.graphicsData[s];
                                    n = this.getWebGLData(i, 0), a.nativeLines && a.lineWidth && (o = this.getWebGLData(i, 0, !0), i.lastIndex++), a.type === l.SHAPES.POLY && (0, v.default)(a, n, o), a.type === l.SHAPES.RECT ? (0, b.default)(a, n, o) : a.type === l.SHAPES.CIRC || a.type === l.SHAPES.ELIP ? (0, S.default)(a, n, o) : a.type === l.SHAPES.RREC && (0, T.default)(a, n, o), i.lastIndex++
                                }
                                this.renderer.bindVao(null);
                                for (var u = 0; u < i.data.length; u++) n = i.data[u], n.dirty && n.upload()
                            }, t.prototype.getWebGLData = function(e, t, i) {
                                var r = e.data[e.data.length - 1];
                                return (!r || r.nativeLines !== i || r.points.length > 32e4) && (r = this.graphicsDataPool.pop() || new f.default(this.renderer.gl, this.primitiveShader, this.renderer.state.attribsState), r.nativeLines = i, r.reset(t), e.data.push(r)), r.dirty = !0, r
                            }, t
                        }(c.default);
                    i.default = P, d.default.registerPlugin("graphics", P)
                }, {
                    "../../const": 46,
                    "../../renderers/webgl/WebGLRenderer": 84,
                    "../../renderers/webgl/utils/ObjectRenderer": 94,
                    "../../utils": 125,
                    "./WebGLGraphicsData": 58,
                    "./shaders/PrimitiveShader": 59,
                    "./utils/buildCircle": 60,
                    "./utils/buildPoly": 62,
                    "./utils/buildRectangle": 63,
                    "./utils/buildRoundedRectangle": 64
                }],
                58: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("pixi-gl-core"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = function() {
                            function e(t, i, n) {
                                r(this, e), this.gl = t, this.color = [0, 0, 0], this.points = [], this.indices = [], this.buffer = o.default.GLBuffer.createVertexBuffer(t), this.indexBuffer = o.default.GLBuffer.createIndexBuffer(t), this.dirty = !0, this.nativeLines = !1, this.glPoints = null, this.glIndices = null, this.shader = i, this.vao = new o.default.VertexArrayObject(t, n).addIndex(this.indexBuffer).addAttribute(this.buffer, i.attributes.aVertexPosition, t.FLOAT, !1, 24, 0).addAttribute(this.buffer, i.attributes.aColor, t.FLOAT, !1, 24, 8)
                            }
                            return e.prototype.reset = function() {
                                this.points.length = 0, this.indices.length = 0
                            }, e.prototype.upload = function() {
                                this.glPoints = new Float32Array(this.points), this.buffer.upload(this.glPoints), this.glIndices = new Uint16Array(this.indices), this.indexBuffer.upload(this.glIndices), this.dirty = !1
                            }, e.prototype.destroy = function() {
                                this.color = null, this.points = null, this.indices = null, this.vao.destroy(), this.buffer.destroy(), this.indexBuffer.destroy(), this.gl = null, this.buffer = null, this.indexBuffer = null, this.glPoints = null, this.glIndices = null
                            }, e
                        }();
                    i.default = s
                }, {
                    "pixi-gl-core": 15
                }],
                59: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = e("../../../Shader"),
                        a = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(s),
                        l = function(e) {
                            function t(i) {
                                return r(this, t), n(this, e.call(this, i, ["attribute vec2 aVertexPosition;", "attribute vec4 aColor;", "uniform mat3 translationMatrix;", "uniform mat3 projectionMatrix;", "uniform float alpha;", "uniform vec3 tint;", "varying vec4 vColor;", "void main(void){", "   gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);", "   vColor = aColor * vec4(tint * alpha, alpha);", "}"].join("\n"), ["varying vec4 vColor;", "void main(void){", "   gl_FragColor = vColor;", "}"].join("\n")))
                            }
                            return o(t, e), t
                        }(a.default);
                    i.default = l
                }, {
                    "../../../Shader": 44
                }],
                60: [function(e, t, i) {
                    "use strict";

                    function r(e, t, i) {
                        var r = e.shape,
                            n = r.x,
                            l = r.y,
                            u = void 0,
                            c = void 0;
                        if (e.type === s.SHAPES.CIRC ? (u = r.radius, c = r.radius) : (u = r.width, c = r.height), 0 !== u && 0 !== c) {
                            var h = Math.floor(30 * Math.sqrt(r.radius)) || Math.floor(15 * Math.sqrt(r.width + r.height)),
                                d = 2 * Math.PI / h;
                            if (e.fill) {
                                var p = (0, a.hex2rgb)(e.fillColor),
                                    f = e.fillAlpha,
                                    _ = p[0] * f,
                                    m = p[1] * f,
                                    g = p[2] * f,
                                    v = t.points,
                                    y = t.indices,
                                    b = v.length / 6;
                                y.push(b);
                                for (var x = 0; x < h + 1; x++) v.push(n, l, _, m, g, f), v.push(n + Math.sin(d * x) * u, l + Math.cos(d * x) * c, _, m, g, f), y.push(b++, b++);
                                y.push(b - 1)
                            }
                            if (e.lineWidth) {
                                var T = e.points;
                                e.points = [];
                                for (var E = 0; E < h; E++) e.points.push(n + Math.sin(d * -E) * u, l + Math.cos(d * -E) * c);
                                e.points.push(e.points[0], e.points[1]), (0, o.default)(e, t, i), e.points = T
                            }
                        }
                    }
                    i.__esModule = !0, i.default = r;
                    var n = e("./buildLine"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = e("../../../const"),
                        a = e("../../../utils")
                }, {
                    "../../../const": 46,
                    "../../../utils": 125,
                    "./buildLine": 61
                }],
                61: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        var i = e.points;
                        if (0 !== i.length) {
                            var r = new o.Point(i[0], i[1]),
                                n = new o.Point(i[i.length - 2], i[i.length - 1]);
                            if (r.x === n.x && r.y === n.y) {
                                i = i.slice(), i.pop(), i.pop(), n = new o.Point(i[i.length - 2], i[i.length - 1]);
                                var a = n.x + .5 * (r.x - n.x),
                                    l = n.y + .5 * (r.y - n.y);
                                i.unshift(a, l), i.push(a, l)
                            }
                            var u = t.points,
                                c = t.indices,
                                h = i.length / 2,
                                d = i.length,
                                p = u.length / 6,
                                f = e.lineWidth / 2,
                                _ = (0, s.hex2rgb)(e.lineColor),
                                m = e.lineAlpha,
                                g = _[0] * m,
                                v = _[1] * m,
                                y = _[2] * m,
                                b = i[0],
                                x = i[1],
                                T = i[2],
                                E = i[3],
                                S = 0,
                                P = 0,
                                A = -(x - E),
                                C = b - T,
                                M = 0,
                                R = 0,
                                O = 0,
                                w = 0,
                                I = Math.sqrt(A * A + C * C);
                            A /= I, C /= I, A *= f, C *= f;
                            var D = e.lineAlignment,
                                L = 2 * (1 - D),
                                B = 2 * D;
                            u.push(b - A * L, x - C * L, g, v, y, m), u.push(b + A * B, x + C * B, g, v, y, m);
                            for (var F = 1; F < h - 1; ++F) {
                                b = i[2 * (F - 1)], x = i[2 * (F - 1) + 1], T = i[2 * F], E = i[2 * F + 1], S = i[2 * (F + 1)], P = i[2 * (F + 1) + 1], A = -(x - E), C = b - T, I = Math.sqrt(A * A + C * C), A /= I, C /= I, A *= f, C *= f, M = -(E - P), R = T - S, I = Math.sqrt(M * M + R * R), M /= I, R /= I, M *= f, R *= f;
                                var N = -C + x - (-C + E),
                                    V = -A + T - (-A + b),
                                    k = (-A + b) * (-C + E) - (-A + T) * (-C + x),
                                    U = -R + P - (-R + E),
                                    G = -M + T - (-M + S),
                                    z = (-M + S) * (-R + E) - (-M + T) * (-R + P),
                                    j = N * G - U * V;
                                if (Math.abs(j) < .1) j += 10.1, u.push(T - A * L, E - C * L, g, v, y, m), u.push(T + A * B, E + C * B, g, v, y, m);
                                else {
                                    var H = (V * z - G * k) / j,
                                        W = (U * k - N * z) / j;
                                    (H - T) * (H - T) + (W - E) * (W - E) > 196 * f * f ? (O = A - M, w = C - R, I = Math.sqrt(O * O + w * w), O /= I, w /= I, O *= f, w *= f, u.push(T - O * L, E - w * L), u.push(g, v, y, m), u.push(T + O * B, E + w * B), u.push(g, v, y, m), u.push(T - O * B * L, E - w * L), u.push(g, v, y, m), d++) : (u.push(T + (H - T) * L, E + (W - E) * L), u.push(g, v, y, m), u.push(T - (H - T) * B, E - (W - E) * B), u.push(g, v, y, m))
                                }
                            }
                            b = i[2 * (h - 2)], x = i[2 * (h - 2) + 1], T = i[2 * (h - 1)], E = i[2 * (h - 1) + 1], A = -(x - E), C = b - T, I = Math.sqrt(A * A + C * C), A /= I, C /= I, A *= f, C *= f, u.push(T - A * L, E - C * L), u.push(g, v, y, m), u.push(T + A * B, E + C * B), u.push(g, v, y, m), c.push(p);
                            for (var X = 0; X < d; ++X) c.push(p++);
                            c.push(p - 1)
                        }
                    }

                    function n(e, t) {
                        var i = 0,
                            r = e.points;
                        if (0 !== r.length) {
                            var n = t.points,
                                o = r.length / 2,
                                a = (0, s.hex2rgb)(e.lineColor),
                                l = e.lineAlpha,
                                u = a[0] * l,
                                c = a[1] * l,
                                h = a[2] * l;
                            for (i = 1; i < o; i++) {
                                var d = r[2 * (i - 1)],
                                    p = r[2 * (i - 1) + 1],
                                    f = r[2 * i],
                                    _ = r[2 * i + 1];
                                n.push(d, p), n.push(u, c, h, l), n.push(f, _), n.push(u, c, h, l)
                            }
                        }
                    }
                    i.__esModule = !0, i.default = function(e, t, i) {
                        e.nativeLines ? n(e, i) : r(e, t)
                    };
                    var o = e("../../../math"),
                        s = e("../../../utils")
                }, {
                    "../../../math": 70,
                    "../../../utils": 125
                }],
                62: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t, i) {
                        e.points = e.shape.points.slice();
                        var r = e.points;
                        if (e.fill && r.length >= 6) {
                            for (var n = [], o = e.holes, l = 0; l < o.length; l++) {
                                var c = o[l];
                                n.push(r.length / 2), r = r.concat(c.points)
                            }
                            var h = t.points,
                                d = t.indices,
                                p = r.length / 2,
                                f = (0, a.hex2rgb)(e.fillColor),
                                _ = e.fillAlpha,
                                m = f[0] * _,
                                g = f[1] * _,
                                v = f[2] * _,
                                y = (0, u.default)(r, n, 2);
                            if (!y) return;
                            for (var b = h.length / 6, x = 0; x < y.length; x += 3) d.push(y[x] + b), d.push(y[x] + b), d.push(y[x + 1] + b), d.push(y[x + 2] + b), d.push(y[x + 2] + b);
                            for (var T = 0; T < p; T++) h.push(r[2 * T], r[2 * T + 1], m, g, v, _)
                        }
                        e.lineWidth > 0 && (0, s.default)(e, t, i)
                    }
                    i.__esModule = !0, i.default = n;
                    var o = e("./buildLine"),
                        s = r(o),
                        a = e("../../../utils"),
                        l = e("earcut"),
                        u = r(l)
                }, {
                    "../../../utils": 125,
                    "./buildLine": 61,
                    earcut: 2
                }],
                63: [function(e, t, i) {
                    "use strict";

                    function r(e, t, i) {
                        var r = e.shape,
                            n = r.x,
                            a = r.y,
                            l = r.width,
                            u = r.height;
                        if (e.fill) {
                            var c = (0, s.hex2rgb)(e.fillColor),
                                h = e.fillAlpha,
                                d = c[0] * h,
                                p = c[1] * h,
                                f = c[2] * h,
                                _ = t.points,
                                m = t.indices,
                                g = _.length / 6;
                            _.push(n, a), _.push(d, p, f, h), _.push(n + l, a), _.push(d, p, f, h), _.push(n, a + u), _.push(d, p, f, h), _.push(n + l, a + u), _.push(d, p, f, h), m.push(g, g, g + 1, g + 2, g + 3, g + 3)
                        }
                        if (e.lineWidth) {
                            var v = e.points;
                            e.points = [n, a, n + l, a, n + l, a + u, n, a + u, n, a], (0, o.default)(e, t, i), e.points = v
                        }
                    }
                    i.__esModule = !0, i.default = r;
                    var n = e("./buildLine"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = e("../../../utils")
                }, {
                    "../../../utils": 125,
                    "./buildLine": 61
                }],
                64: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t, i) {
                        var r = e.shape,
                            n = r.x,
                            o = r.y,
                            a = r.width,
                            u = r.height,
                            d = r.radius,
                            p = [];
                        if (p.push(n + d, o), s(n + a - d, o, n + a, o, n + a, o + d, p), s(n + a, o + u - d, n + a, o + u, n + a - d, o + u, p), s(n + d, o + u, n, o + u, n, o + u - d, p), s(n, o + d, n, o, n + d + 1e-10, o, p), e.fill) {
                            for (var f = (0, h.hex2rgb)(e.fillColor), _ = e.fillAlpha, m = f[0] * _, g = f[1] * _, v = f[2] * _, y = t.points, b = t.indices, x = y.length / 6, T = (0, l.default)(p, null, 2), E = 0, S = T.length; E < S; E += 3) b.push(T[E] + x), b.push(T[E] + x), b.push(T[E + 1] + x), b.push(T[E + 2] + x), b.push(T[E + 2] + x);
                            for (var P = 0, A = p.length; P < A; P++) y.push(p[P], p[++P], m, g, v, _)
                        }
                        if (e.lineWidth) {
                            var C = e.points;
                            e.points = p, (0, c.default)(e, t, i), e.points = C
                        }
                    }

                    function o(e, t, i) {
                        return e + (t - e) * i
                    }

                    function s(e, t, i, r, n, s) {
                        for (var a = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : [], l = a, u = 0, c = 0, h = 0, d = 0, p = 0, f = 0, _ = 0, m = 0; _ <= 20; ++_) m = _ / 20, u = o(e, i, m), c = o(t, r, m), h = o(i, n, m), d = o(r, s, m), p = o(u, h, m), f = o(c, d, m), l.push(p, f);
                        return l
                    }
                    i.__esModule = !0, i.default = n;
                    var a = e("earcut"),
                        l = r(a),
                        u = e("./buildLine"),
                        c = r(u),
                        h = e("../../../utils")
                }, {
                    "../../../utils": 125,
                    "./buildLine": 61,
                    earcut: 2
                }],
                65: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        if (e && e.__esModule) return e;
                        var t = {};
                        if (null != e)
                            for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                        return t.default = e, t
                    }

                    function n(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0, i.autoDetectRenderer = i.Application = i.Filter = i.SpriteMaskFilter = i.Quad = i.RenderTarget = i.ObjectRenderer = i.WebGLManager = i.Shader = i.CanvasRenderTarget = i.TextureUvs = i.VideoBaseTexture = i.BaseRenderTexture = i.RenderTexture = i.BaseTexture = i.TextureMatrix = i.Texture = i.Spritesheet = i.CanvasGraphicsRenderer = i.GraphicsRenderer = i.GraphicsData = i.Graphics = i.TextMetrics = i.TextStyle = i.Text = i.SpriteRenderer = i.CanvasTinter = i.CanvasSpriteRenderer = i.Sprite = i.TransformBase = i.TransformStatic = i.Transform = i.Container = i.DisplayObject = i.Bounds = i.glCore = i.WebGLRenderer = i.CanvasRenderer = i.ticker = i.utils = i.settings = void 0;
                    var o = e("./const");
                    Object.keys(o).forEach(function(e) {
                        "default" !== e && "__esModule" !== e && Object.defineProperty(i, e, {
                            enumerable: !0,
                            get: function() {
                                return o[e]
                            }
                        })
                    });
                    var s = e("./math");
                    Object.keys(s).forEach(function(e) {
                        "default" !== e && "__esModule" !== e && Object.defineProperty(i, e, {
                            enumerable: !0,
                            get: function() {
                                return s[e]
                            }
                        })
                    });
                    var a = e("pixi-gl-core");
                    Object.defineProperty(i, "glCore", {
                        enumerable: !0,
                        get: function() {
                            return n(a).default
                        }
                    });
                    var l = e("./display/Bounds");
                    Object.defineProperty(i, "Bounds", {
                        enumerable: !0,
                        get: function() {
                            return n(l).default
                        }
                    });
                    var u = e("./display/DisplayObject");
                    Object.defineProperty(i, "DisplayObject", {
                        enumerable: !0,
                        get: function() {
                            return n(u).default
                        }
                    });
                    var c = e("./display/Container");
                    Object.defineProperty(i, "Container", {
                        enumerable: !0,
                        get: function() {
                            return n(c).default
                        }
                    });
                    var h = e("./display/Transform");
                    Object.defineProperty(i, "Transform", {
                        enumerable: !0,
                        get: function() {
                            return n(h).default
                        }
                    });
                    var d = e("./display/TransformStatic");
                    Object.defineProperty(i, "TransformStatic", {
                        enumerable: !0,
                        get: function() {
                            return n(d).default
                        }
                    });
                    var p = e("./display/TransformBase");
                    Object.defineProperty(i, "TransformBase", {
                        enumerable: !0,
                        get: function() {
                            return n(p).default
                        }
                    });
                    var f = e("./sprites/Sprite");
                    Object.defineProperty(i, "Sprite", {
                        enumerable: !0,
                        get: function() {
                            return n(f).default
                        }
                    });
                    var _ = e("./sprites/canvas/CanvasSpriteRenderer");
                    Object.defineProperty(i, "CanvasSpriteRenderer", {
                        enumerable: !0,
                        get: function() {
                            return n(_).default
                        }
                    });
                    var m = e("./sprites/canvas/CanvasTinter");
                    Object.defineProperty(i, "CanvasTinter", {
                        enumerable: !0,
                        get: function() {
                            return n(m).default
                        }
                    });
                    var g = e("./sprites/webgl/SpriteRenderer");
                    Object.defineProperty(i, "SpriteRenderer", {
                        enumerable: !0,
                        get: function() {
                            return n(g).default
                        }
                    });
                    var v = e("./text/Text");
                    Object.defineProperty(i, "Text", {
                        enumerable: !0,
                        get: function() {
                            return n(v).default
                        }
                    });
                    var y = e("./text/TextStyle");
                    Object.defineProperty(i, "TextStyle", {
                        enumerable: !0,
                        get: function() {
                            return n(y).default
                        }
                    });
                    var b = e("./text/TextMetrics");
                    Object.defineProperty(i, "TextMetrics", {
                        enumerable: !0,
                        get: function() {
                            return n(b).default
                        }
                    });
                    var x = e("./graphics/Graphics");
                    Object.defineProperty(i, "Graphics", {
                        enumerable: !0,
                        get: function() {
                            return n(x).default
                        }
                    });
                    var T = e("./graphics/GraphicsData");
                    Object.defineProperty(i, "GraphicsData", {
                        enumerable: !0,
                        get: function() {
                            return n(T).default
                        }
                    });
                    var E = e("./graphics/webgl/GraphicsRenderer");
                    Object.defineProperty(i, "GraphicsRenderer", {
                        enumerable: !0,
                        get: function() {
                            return n(E).default
                        }
                    });
                    var S = e("./graphics/canvas/CanvasGraphicsRenderer");
                    Object.defineProperty(i, "CanvasGraphicsRenderer", {
                        enumerable: !0,
                        get: function() {
                            return n(S).default
                        }
                    });
                    var P = e("./textures/Spritesheet");
                    Object.defineProperty(i, "Spritesheet", {
                        enumerable: !0,
                        get: function() {
                            return n(P).default
                        }
                    });
                    var A = e("./textures/Texture");
                    Object.defineProperty(i, "Texture", {
                        enumerable: !0,
                        get: function() {
                            return n(A).default
                        }
                    });
                    var C = e("./textures/TextureMatrix");
                    Object.defineProperty(i, "TextureMatrix", {
                        enumerable: !0,
                        get: function() {
                            return n(C).default
                        }
                    });
                    var M = e("./textures/BaseTexture");
                    Object.defineProperty(i, "BaseTexture", {
                        enumerable: !0,
                        get: function() {
                            return n(M).default
                        }
                    });
                    var R = e("./textures/RenderTexture");
                    Object.defineProperty(i, "RenderTexture", {
                        enumerable: !0,
                        get: function() {
                            return n(R).default
                        }
                    });
                    var O = e("./textures/BaseRenderTexture");
                    Object.defineProperty(i, "BaseRenderTexture", {
                        enumerable: !0,
                        get: function() {
                            return n(O).default
                        }
                    });
                    var w = e("./textures/VideoBaseTexture");
                    Object.defineProperty(i, "VideoBaseTexture", {
                        enumerable: !0,
                        get: function() {
                            return n(w).default
                        }
                    });
                    var I = e("./textures/TextureUvs");
                    Object.defineProperty(i, "TextureUvs", {
                        enumerable: !0,
                        get: function() {
                            return n(I).default
                        }
                    });
                    var D = e("./renderers/canvas/utils/CanvasRenderTarget");
                    Object.defineProperty(i, "CanvasRenderTarget", {
                        enumerable: !0,
                        get: function() {
                            return n(D).default
                        }
                    });
                    var L = e("./Shader");
                    Object.defineProperty(i, "Shader", {
                        enumerable: !0,
                        get: function() {
                            return n(L).default
                        }
                    });
                    var B = e("./renderers/webgl/managers/WebGLManager");
                    Object.defineProperty(i, "WebGLManager", {
                        enumerable: !0,
                        get: function() {
                            return n(B).default
                        }
                    });
                    var F = e("./renderers/webgl/utils/ObjectRenderer");
                    Object.defineProperty(i, "ObjectRenderer", {
                        enumerable: !0,
                        get: function() {
                            return n(F).default
                        }
                    });
                    var N = e("./renderers/webgl/utils/RenderTarget");
                    Object.defineProperty(i, "RenderTarget", {
                        enumerable: !0,
                        get: function() {
                            return n(N).default
                        }
                    });
                    var V = e("./renderers/webgl/utils/Quad");
                    Object.defineProperty(i, "Quad", {
                        enumerable: !0,
                        get: function() {
                            return n(V).default
                        }
                    });
                    var k = e("./renderers/webgl/filters/spriteMask/SpriteMaskFilter");
                    Object.defineProperty(i, "SpriteMaskFilter", {
                        enumerable: !0,
                        get: function() {
                            return n(k).default
                        }
                    });
                    var U = e("./renderers/webgl/filters/Filter");
                    Object.defineProperty(i, "Filter", {
                        enumerable: !0,
                        get: function() {
                            return n(U).default
                        }
                    });
                    var G = e("./Application");
                    Object.defineProperty(i, "Application", {
                        enumerable: !0,
                        get: function() {
                            return n(G).default
                        }
                    });
                    var z = e("./autoDetectRenderer");
                    Object.defineProperty(i, "autoDetectRenderer", {
                        enumerable: !0,
                        get: function() {
                            return z.autoDetectRenderer
                        }
                    });
                    var j = e("./utils"),
                        H = r(j),
                        W = e("./ticker"),
                        X = r(W),
                        Y = e("./settings"),
                        q = n(Y),
                        K = e("./renderers/canvas/CanvasRenderer"),
                        Q = n(K),
                        Z = e("./renderers/webgl/WebGLRenderer"),
                        J = n(Z);
                    i.settings = q.default, i.utils = H, i.ticker = X, i.CanvasRenderer = Q.default, i.WebGLRenderer = J.default
                }, {
                    "./Application": 43,
                    "./Shader": 44,
                    "./autoDetectRenderer": 45,
                    "./const": 46,
                    "./display/Bounds": 47,
                    "./display/Container": 48,
                    "./display/DisplayObject": 49,
                    "./display/Transform": 50,
                    "./display/TransformBase": 51,
                    "./display/TransformStatic": 52,
                    "./graphics/Graphics": 53,
                    "./graphics/GraphicsData": 54,
                    "./graphics/canvas/CanvasGraphicsRenderer": 55,
                    "./graphics/webgl/GraphicsRenderer": 57,
                    "./math": 70,
                    "./renderers/canvas/CanvasRenderer": 77,
                    "./renderers/canvas/utils/CanvasRenderTarget": 79,
                    "./renderers/webgl/WebGLRenderer": 84,
                    "./renderers/webgl/filters/Filter": 86,
                    "./renderers/webgl/filters/spriteMask/SpriteMaskFilter": 89,
                    "./renderers/webgl/managers/WebGLManager": 93,
                    "./renderers/webgl/utils/ObjectRenderer": 94,
                    "./renderers/webgl/utils/Quad": 95,
                    "./renderers/webgl/utils/RenderTarget": 96,
                    "./settings": 101,
                    "./sprites/Sprite": 102,
                    "./sprites/canvas/CanvasSpriteRenderer": 103,
                    "./sprites/canvas/CanvasTinter": 104,
                    "./sprites/webgl/SpriteRenderer": 106,
                    "./text/Text": 108,
                    "./text/TextMetrics": 109,
                    "./text/TextStyle": 110,
                    "./textures/BaseRenderTexture": 111,
                    "./textures/BaseTexture": 112,
                    "./textures/RenderTexture": 113,
                    "./textures/Spritesheet": 114,
                    "./textures/Texture": 115,
                    "./textures/TextureMatrix": 116,
                    "./textures/TextureUvs": 117,
                    "./textures/VideoBaseTexture": 118,
                    "./ticker": 121,
                    "./utils": 125,
                    "pixi-gl-core": 15
                }],
                66: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e < 0 ? -1 : e > 0 ? 1 : 0
                    }
                    i.__esModule = !0;
                    var n = e("./Matrix"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1],
                        a = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1],
                        l = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1],
                        u = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1],
                        c = [],
                        h = [];
                    ! function() {
                        for (var e = 0; e < 16; e++) {
                            var t = [];
                            h.push(t);
                            for (var i = 0; i < 16; i++)
                                for (var n = r(s[e] * s[i] + l[e] * a[i]), d = r(a[e] * s[i] + u[e] * a[i]), p = r(s[e] * l[i] + l[e] * u[i]), f = r(a[e] * l[i] + u[e] * u[i]), _ = 0; _ < 16; _++)
                                    if (s[_] === n && a[_] === d && l[_] === p && u[_] === f) {
                                        t.push(_);
                                        break
                                    }
                        }
                        for (var m = 0; m < 16; m++) {
                            var g = new o.default;
                            g.set(s[m], a[m], l[m], u[m], 0, 0), c.push(g)
                        }
                    }();
                    var d = {
                        E: 0,
                        SE: 1,
                        S: 2,
                        SW: 3,
                        W: 4,
                        NW: 5,
                        N: 6,
                        NE: 7,
                        MIRROR_VERTICAL: 8,
                        MIRROR_HORIZONTAL: 12,
                        uX: function(e) {
                            return s[e]
                        },
                        uY: function(e) {
                            return a[e]
                        },
                        vX: function(e) {
                            return l[e]
                        },
                        vY: function(e) {
                            return u[e]
                        },
                        inv: function(e) {
                            return 8 & e ? 15 & e : 7 & -e
                        },
                        add: function(e, t) {
                            return h[e][t]
                        },
                        sub: function(e, t) {
                            return h[e][d.inv(t)]
                        },
                        rotate180: function(e) {
                            return 4 ^ e
                        },
                        isVertical: function(e) {
                            return 2 == (3 & e)
                        },
                        byDirection: function(e, t) {
                            return 2 * Math.abs(e) <= Math.abs(t) ? t >= 0 ? d.S : d.N : 2 * Math.abs(t) <= Math.abs(e) ? e > 0 ? d.E : d.W : t > 0 ? e > 0 ? d.SE : d.SW : e > 0 ? d.NE : d.NW
                        },
                        matrixAppendRotationInv: function(e, t) {
                            var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
                                r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0,
                                n = c[d.inv(t)];
                            n.tx = i, n.ty = r, e.append(n)
                        }
                    };
                    i.default = d
                }, {
                    "./Matrix": 67
                }],
                67: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        o = e("./Point"),
                        s = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(o),
                        a = e("../const"),
                        l = function() {
                            function e() {
                                var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
                                    i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
                                    n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
                                    o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1,
                                    s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0,
                                    a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0;
                                r(this, e), this.a = t, this.b = i, this.c = n, this.d = o, this.tx = s, this.ty = a, this.array = null
                            }
                            return e.prototype.fromArray = function(e) {
                                this.a = e[0], this.b = e[1], this.c = e[3], this.d = e[4], this.tx = e[2], this.ty = e[5]
                            }, e.prototype.set = function(e, t, i, r, n, o) {
                                return this.a = e, this.b = t, this.c = i, this.d = r, this.tx = n, this.ty = o, this
                            }, e.prototype.toArray = function(e, t) {
                                this.array || (this.array = new Float32Array(9));
                                var i = t || this.array;
                                return e ? (i[0] = this.a, i[1] = this.b, i[2] = 0, i[3] = this.c, i[4] = this.d, i[5] = 0, i[6] = this.tx, i[7] = this.ty, i[8] = 1) : (i[0] = this.a, i[1] = this.c, i[2] = this.tx, i[3] = this.b, i[4] = this.d, i[5] = this.ty, i[6] = 0, i[7] = 0, i[8] = 1), i
                            }, e.prototype.apply = function(e, t) {
                                t = t || new s.default;
                                var i = e.x,
                                    r = e.y;
                                return t.x = this.a * i + this.c * r + this.tx, t.y = this.b * i + this.d * r + this.ty, t
                            }, e.prototype.applyInverse = function(e, t) {
                                t = t || new s.default;
                                var i = 1 / (this.a * this.d + this.c * -this.b),
                                    r = e.x,
                                    n = e.y;
                                return t.x = this.d * i * r + -this.c * i * n + (this.ty * this.c - this.tx * this.d) * i, t.y = this.a * i * n + -this.b * i * r + (-this.ty * this.a + this.tx * this.b) * i, t
                            }, e.prototype.translate = function(e, t) {
                                return this.tx += e, this.ty += t, this
                            }, e.prototype.scale = function(e, t) {
                                return this.a *= e, this.d *= t, this.c *= e, this.b *= t, this.tx *= e, this.ty *= t, this
                            }, e.prototype.rotate = function(e) {
                                var t = Math.cos(e),
                                    i = Math.sin(e),
                                    r = this.a,
                                    n = this.c,
                                    o = this.tx;
                                return this.a = r * t - this.b * i, this.b = r * i + this.b * t, this.c = n * t - this.d * i, this.d = n * i + this.d * t, this.tx = o * t - this.ty * i, this.ty = o * i + this.ty * t, this
                            }, e.prototype.append = function(e) {
                                var t = this.a,
                                    i = this.b,
                                    r = this.c,
                                    n = this.d;
                                return this.a = e.a * t + e.b * r, this.b = e.a * i + e.b * n, this.c = e.c * t + e.d * r, this.d = e.c * i + e.d * n, this.tx = e.tx * t + e.ty * r + this.tx, this.ty = e.tx * i + e.ty * n + this.ty, this
                            }, e.prototype.setTransform = function(e, t, i, r, n, o, s, a, l) {
                                return this.a = Math.cos(s + l) * n, this.b = Math.sin(s + l) * n, this.c = -Math.sin(s - a) * o, this.d = Math.cos(s - a) * o, this.tx = e - (i * this.a + r * this.c), this.ty = t - (i * this.b + r * this.d), this
                            }, e.prototype.prepend = function(e) {
                                var t = this.tx;
                                if (1 !== e.a || 0 !== e.b || 0 !== e.c || 1 !== e.d) {
                                    var i = this.a,
                                        r = this.c;
                                    this.a = i * e.a + this.b * e.c, this.b = i * e.b + this.b * e.d, this.c = r * e.a + this.d * e.c, this.d = r * e.b + this.d * e.d
                                }
                                return this.tx = t * e.a + this.ty * e.c + e.tx, this.ty = t * e.b + this.ty * e.d + e.ty, this
                            }, e.prototype.decompose = function(e) {
                                var t = this.a,
                                    i = this.b,
                                    r = this.c,
                                    n = this.d,
                                    o = -Math.atan2(-r, n),
                                    s = Math.atan2(i, t),
                                    l = Math.abs(o + s);
                                return l < 1e-5 || Math.abs(a.PI_2 - l) < 1e-5 ? (e.rotation = s, t < 0 && n >= 0 && (e.rotation += e.rotation <= 0 ? Math.PI : -Math.PI), e.skew.x = e.skew.y = 0) : (e.rotation = 0, e.skew.x = o, e.skew.y = s), e.scale.x = Math.sqrt(t * t + i * i), e.scale.y = Math.sqrt(r * r + n * n), e.position.x = this.tx, e.position.y = this.ty, e
                            }, e.prototype.invert = function() {
                                var e = this.a,
                                    t = this.b,
                                    i = this.c,
                                    r = this.d,
                                    n = this.tx,
                                    o = e * r - t * i;
                                return this.a = r / o, this.b = -t / o, this.c = -i / o, this.d = e / o, this.tx = (i * this.ty - r * n) / o, this.ty = -(e * this.ty - t * n) / o, this
                            }, e.prototype.identity = function() {
                                return this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.tx = 0, this.ty = 0, this
                            }, e.prototype.clone = function() {
                                var t = new e;
                                return t.a = this.a, t.b = this.b, t.c = this.c, t.d = this.d, t.tx = this.tx, t.ty = this.ty, t
                            }, e.prototype.copy = function(e) {
                                return e.a = this.a, e.b = this.b, e.c = this.c, e.d = this.d, e.tx = this.tx, e.ty = this.ty, e
                            }, n(e, null, [{
                                key: "IDENTITY",
                                get: function() {
                                    return new e
                                }
                            }, {
                                key: "TEMP_MATRIX",
                                get: function() {
                                    return new e
                                }
                            }]), e
                        }();
                    i.default = l
                }, {
                    "../const": 46,
                    "./Point": 69
                }],
                68: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        o = function() {
                            function e(t, i) {
                                var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
                                    o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0;
                                r(this, e), this._x = n, this._y = o, this.cb = t, this.scope = i
                            }
                            return e.prototype.clone = function() {
                                var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null,
                                    i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null;
                                return new e(t || this.cb, i || this.scope, this._x, this._y)
                            }, e.prototype.set = function(e, t) {
                                var i = e || 0,
                                    r = t || (0 !== t ? i : 0);
                                this._x === i && this._y === r || (this._x = i, this._y = r, this.cb.call(this.scope))
                            }, e.prototype.copy = function(e) {
                                this._x === e.x && this._y === e.y || (this._x = e.x, this._y = e.y, this.cb.call(this.scope))
                            }, e.prototype.equals = function(e) {
                                return e.x === this._x && e.y === this._y
                            }, n(e, [{
                                key: "x",
                                get: function() {
                                    return this._x
                                },
                                set: function(e) {
                                    this._x !== e && (this._x = e, this.cb.call(this.scope))
                                }
                            }, {
                                key: "y",
                                get: function() {
                                    return this._y
                                },
                                set: function(e) {
                                    this._y !== e && (this._y = e, this.cb.call(this.scope))
                                }
                            }]), e
                        }();
                    i.default = o
                }, {}],
                69: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                        function e() {
                            var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                                i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
                            r(this, e), this.x = t, this.y = i
                        }
                        return e.prototype.clone = function() {
                            return new e(this.x, this.y)
                        }, e.prototype.copy = function(e) {
                            this.set(e.x, e.y)
                        }, e.prototype.equals = function(e) {
                            return e.x === this.x && e.y === this.y
                        }, e.prototype.set = function(e, t) {
                            this.x = e || 0, this.y = t || (0 !== t ? this.x : 0)
                        }, e
                    }();
                    i.default = n
                }, {}],
                70: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0;
                    var n = e("./Point");
                    Object.defineProperty(i, "Point", {
                        enumerable: !0,
                        get: function() {
                            return r(n).default
                        }
                    });
                    var o = e("./ObservablePoint");
                    Object.defineProperty(i, "ObservablePoint", {
                        enumerable: !0,
                        get: function() {
                            return r(o).default
                        }
                    });
                    var s = e("./Matrix");
                    Object.defineProperty(i, "Matrix", {
                        enumerable: !0,
                        get: function() {
                            return r(s).default
                        }
                    });
                    var a = e("./GroupD8");
                    Object.defineProperty(i, "GroupD8", {
                        enumerable: !0,
                        get: function() {
                            return r(a).default
                        }
                    });
                    var l = e("./shapes/Circle");
                    Object.defineProperty(i, "Circle", {
                        enumerable: !0,
                        get: function() {
                            return r(l).default
                        }
                    });
                    var u = e("./shapes/Ellipse");
                    Object.defineProperty(i, "Ellipse", {
                        enumerable: !0,
                        get: function() {
                            return r(u).default
                        }
                    });
                    var c = e("./shapes/Polygon");
                    Object.defineProperty(i, "Polygon", {
                        enumerable: !0,
                        get: function() {
                            return r(c).default
                        }
                    });
                    var h = e("./shapes/Rectangle");
                    Object.defineProperty(i, "Rectangle", {
                        enumerable: !0,
                        get: function() {
                            return r(h).default
                        }
                    });
                    var d = e("./shapes/RoundedRectangle");
                    Object.defineProperty(i, "RoundedRectangle", {
                        enumerable: !0,
                        get: function() {
                            return r(d).default
                        }
                    })
                }, {
                    "./GroupD8": 66,
                    "./Matrix": 67,
                    "./ObservablePoint": 68,
                    "./Point": 69,
                    "./shapes/Circle": 71,
                    "./shapes/Ellipse": 72,
                    "./shapes/Polygon": 73,
                    "./shapes/Rectangle": 74,
                    "./shapes/RoundedRectangle": 75
                }],
                71: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("./Rectangle"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = e("../../const"),
                        a = function() {
                            function e() {
                                var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                                    i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
                                    n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
                                r(this, e), this.x = t, this.y = i, this.radius = n, this.type = s.SHAPES.CIRC
                            }
                            return e.prototype.clone = function() {
                                return new e(this.x, this.y, this.radius)
                            }, e.prototype.contains = function(e, t) {
                                if (this.radius <= 0) return !1;
                                var i = this.radius * this.radius,
                                    r = this.x - e,
                                    n = this.y - t;
                                return r *= r, n *= n, r + n <= i
                            }, e.prototype.getBounds = function() {
                                return new o.default(this.x - this.radius, this.y - this.radius, 2 * this.radius, 2 * this.radius)
                            }, e
                        }();
                    i.default = a
                }, {
                    "../../const": 46,
                    "./Rectangle": 74
                }],
                72: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("./Rectangle"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = e("../../const"),
                        a = function() {
                            function e() {
                                var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                                    i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
                                    n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
                                    o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0;
                                r(this, e), this.x = t, this.y = i, this.width = n, this.height = o, this.type = s.SHAPES.ELIP
                            }
                            return e.prototype.clone = function() {
                                return new e(this.x, this.y, this.width, this.height)
                            }, e.prototype.contains = function(e, t) {
                                if (this.width <= 0 || this.height <= 0) return !1;
                                var i = (e - this.x) / this.width,
                                    r = (t - this.y) / this.height;
                                return i *= i, r *= r, i + r <= 1
                            }, e.prototype.getBounds = function() {
                                return new o.default(this.x - this.width, this.y - this.height, this.width, this.height)
                            }, e
                        }();
                    i.default = a
                }, {
                    "../../const": 46,
                    "./Rectangle": 74
                }],
                73: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../Point"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = e("../../const"),
                        a = function() {
                            function e() {
                                for (var t = arguments.length, i = Array(t), n = 0; n < t; n++) i[n] = arguments[n];
                                if (r(this, e), Array.isArray(i[0]) && (i = i[0]), i[0] instanceof o.default) {
                                    for (var a = [], l = 0, u = i.length; l < u; l++) a.push(i[l].x, i[l].y);
                                    i = a
                                }
                                this.closed = !0, this.points = i, this.type = s.SHAPES.POLY
                            }
                            return e.prototype.clone = function() {
                                return new e(this.points.slice())
                            }, e.prototype.close = function() {
                                var e = this.points;
                                e[0] === e[e.length - 2] && e[1] === e[e.length - 1] || e.push(e[0], e[1])
                            }, e.prototype.contains = function(e, t) {
                                for (var i = !1, r = this.points.length / 2, n = 0, o = r - 1; n < r; o = n++) {
                                    var s = this.points[2 * n],
                                        a = this.points[2 * n + 1],
                                        l = this.points[2 * o],
                                        u = this.points[2 * o + 1];
                                    a > t != u > t && e < (t - a) / (u - a) * (l - s) + s && (i = !i)
                                }
                                return i
                            }, e
                        }();
                    i.default = a
                }, {
                    "../../const": 46,
                    "../Point": 69
                }],
                74: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        o = e("../../const"),
                        s = function() {
                            function e() {
                                var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                                    i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
                                    n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
                                    s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0;
                                r(this, e), this.x = Number(t), this.y = Number(i), this.width = Number(n), this.height = Number(s), this.type = o.SHAPES.RECT
                            }
                            return e.prototype.clone = function() {
                                return new e(this.x, this.y, this.width, this.height)
                            }, e.prototype.copy = function(e) {
                                return this.x = e.x, this.y = e.y, this.width = e.width, this.height = e.height, this
                            }, e.prototype.contains = function(e, t) {
                                return !(this.width <= 0 || this.height <= 0) && (e >= this.x && e < this.x + this.width && t >= this.y && t < this.y + this.height)
                            }, e.prototype.pad = function(e, t) {
                                e = e || 0, t = t || (0 !== t ? e : 0), this.x -= e, this.y -= t, this.width += 2 * e, this.height += 2 * t
                            }, e.prototype.fit = function(e) {
                                this.x < e.x && (this.width += this.x, this.width < 0 && (this.width = 0), this.x = e.x), this.y < e.y && (this.height += this.y, this.height < 0 && (this.height = 0), this.y = e.y), this.x + this.width > e.x + e.width && (this.width = e.width - this.x, this.width < 0 && (this.width = 0)), this.y + this.height > e.y + e.height && (this.height = e.height - this.y, this.height < 0 && (this.height = 0))
                            }, e.prototype.enlarge = function(e) {
                                var t = Math.min(this.x, e.x),
                                    i = Math.max(this.x + this.width, e.x + e.width),
                                    r = Math.min(this.y, e.y),
                                    n = Math.max(this.y + this.height, e.y + e.height);
                                this.x = t, this.width = i - t, this.y = r, this.height = n - r
                            }, e.prototype.ceil = function() {
                                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
                                    t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : .001,
                                    i = Math.ceil((this.x + this.width - t) * e) / e,
                                    r = Math.ceil((this.y + this.height - t) * e) / e;
                                this.x = Math.floor((this.x + t) * e) / e, this.y = Math.floor((this.y + t) * e) / e, this.width = i - this.x, this.height = r - this.y
                            }, n(e, [{
                                key: "left",
                                get: function() {
                                    return this.x
                                }
                            }, {
                                key: "right",
                                get: function() {
                                    return this.x + this.width
                                }
                            }, {
                                key: "top",
                                get: function() {
                                    return this.y
                                }
                            }, {
                                key: "bottom",
                                get: function() {
                                    return this.y + this.height
                                }
                            }], [{
                                key: "EMPTY",
                                get: function() {
                                    return new e(0, 0, 0, 0)
                                }
                            }]), e
                        }();
                    i.default = s
                }, {
                    "../../const": 46
                }],
                75: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../../const"),
                        o = function() {
                            function e() {
                                var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                                    i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
                                    o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
                                    s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0,
                                    a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 20;
                                r(this, e), this.x = t, this.y = i, this.width = o, this.height = s, this.radius = a, this.type = n.SHAPES.RREC
                            }
                            return e.prototype.clone = function() {
                                return new e(this.x, this.y, this.width, this.height, this.radius)
                            }, e.prototype.contains = function(e, t) {
                                if (this.width <= 0 || this.height <= 0) return !1;
                                if (e >= this.x && e <= this.x + this.width && t >= this.y && t <= this.y + this.height) {
                                    if (t >= this.y + this.radius && t <= this.y + this.height - this.radius || e >= this.x + this.radius && e <= this.x + this.width - this.radius) return !0;
                                    var i = e - (this.x + this.radius),
                                        r = t - (this.y + this.radius),
                                        n = this.radius * this.radius;
                                    if (i * i + r * r <= n) return !0;
                                    if ((i = e - (this.x + this.width - this.radius)) * i + r * r <= n) return !0;
                                    if (r = t - (this.y + this.height - this.radius), i * i + r * r <= n) return !0;
                                    if ((i = e - (this.x + this.radius)) * i + r * r <= n) return !0
                                }
                                return !1
                            }, e
                        }();
                    i.default = o
                }, {
                    "../../const": 46
                }],
                76: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        l = e("../utils"),
                        u = e("../math"),
                        c = e("../const"),
                        h = e("../settings"),
                        d = r(h),
                        p = e("../display/Container"),
                        f = r(p),
                        _ = e("../textures/RenderTexture"),
                        m = r(_),
                        g = e("eventemitter3"),
                        v = r(g),
                        y = new u.Matrix,
                        b = function(e) {
                            function t(i, r, s, a) {
                                n(this, t);
                                var h = o(this, e.call(this));
                                return (0, l.sayHello)(i), "number" == typeof r && (r = Object.assign({
                                    width: r,
                                    height: s || d.default.RENDER_OPTIONS.height
                                }, a)), r = Object.assign({}, d.default.RENDER_OPTIONS, r), h.options = r, h.type = c.RENDERER_TYPE.UNKNOWN, h.screen = new u.Rectangle(0, 0, r.width, r.height), h.view = r.view || document.createElement("canvas"), h.resolution = r.resolution || d.default.RESOLUTION, h.transparent = r.transparent, h.autoResize = r.autoResize || !1, h.blendModes = null, h.preserveDrawingBuffer = r.preserveDrawingBuffer, h.clearBeforeRender = r.clearBeforeRender, h.roundPixels = r.roundPixels, h._backgroundColor = 0, h._backgroundColorRgba = [0, 0, 0, 0], h._backgroundColorString = "#000000", h.backgroundColor = r.backgroundColor || h._backgroundColor, h._tempDisplayObjectParent = new f.default, h._lastObjectRendered = h._tempDisplayObjectParent, h
                            }
                            return s(t, e), t.prototype.resize = function(e, t) {
                                this.screen.width = e, this.screen.height = t, this.view.width = e * this.resolution, this.view.height = t * this.resolution, this.autoResize && (this.view.style.width = e + "px", this.view.style.height = t + "px")
                            }, t.prototype.generateTexture = function(e, t, i, r) {
                                r = r || e.getLocalBounds();
                                var n = m.default.create(0 | r.width, 0 | r.height, t, i);
                                return y.tx = -r.x, y.ty = -r.y, this.render(e, n, !1, y, !!e.parent), n
                            }, t.prototype.destroy = function(e) {
                                e && this.view.parentNode && this.view.parentNode.removeChild(this.view), this.type = c.RENDERER_TYPE.UNKNOWN, this.view = null, this.screen = null, this.resolution = 0, this.transparent = !1, this.autoResize = !1, this.blendModes = null, this.options = null, this.preserveDrawingBuffer = !1, this.clearBeforeRender = !1, this.roundPixels = !1, this._backgroundColor = 0, this._backgroundColorRgba = null, this._backgroundColorString = null, this._tempDisplayObjectParent = null, this._lastObjectRendered = null
                            }, a(t, [{
                                key: "width",
                                get: function() {
                                    return this.view.width
                                }
                            }, {
                                key: "height",
                                get: function() {
                                    return this.view.height
                                }
                            }, {
                                key: "backgroundColor",
                                get: function() {
                                    return this._backgroundColor
                                },
                                set: function(e) {
                                    this._backgroundColor = e, this._backgroundColorString = (0, l.hex2string)(e), (0, l.hex2rgb)(e, this._backgroundColorRgba)
                                }
                            }]), t
                        }(v.default);
                    i.default = b
                }, {
                    "../const": 46,
                    "../display/Container": 48,
                    "../math": 70,
                    "../settings": 101,
                    "../textures/RenderTexture": 113,
                    "../utils": 125,
                    eventemitter3: 3
                }],
                77: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("../SystemRenderer"),
                        l = r(a),
                        u = e("./utils/CanvasMaskManager"),
                        c = r(u),
                        h = e("./utils/CanvasRenderTarget"),
                        d = r(h),
                        p = e("./utils/mapCanvasBlendModesToPixi"),
                        f = r(p),
                        _ = e("../../utils"),
                        m = e("../../const"),
                        g = e("../../settings"),
                        v = r(g),
                        y = function(e) {
                            function t(i, r, s) {
                                n(this, t);
                                var a = o(this, e.call(this, "Canvas", i, r, s));
                                return a.type = m.RENDERER_TYPE.CANVAS, a.rootContext = a.view.getContext("2d", {
                                    alpha: a.transparent
                                }), a.context = a.rootContext, a.refresh = !0, a.maskManager = new c.default(a), a.smoothProperty = "imageSmoothingEnabled", a.rootContext.imageSmoothingEnabled || (a.rootContext.webkitImageSmoothingEnabled ? a.smoothProperty = "webkitImageSmoothingEnabled" : a.rootContext.mozImageSmoothingEnabled ? a.smoothProperty = "mozImageSmoothingEnabled" : a.rootContext.oImageSmoothingEnabled ? a.smoothProperty = "oImageSmoothingEnabled" : a.rootContext.msImageSmoothingEnabled && (a.smoothProperty = "msImageSmoothingEnabled")), a.initPlugins(), a.blendModes = (0, f.default)(), a._activeBlendMode = null, a.renderingToScreen = !1, a.resize(a.options.width, a.options.height), a
                            }
                            return s(t, e), t.prototype.render = function(e, t, i, r, n) {
                                if (this.view) {
                                    this.renderingToScreen = !t, this.emit("prerender");
                                    var o = this.resolution;
                                    t ? (t = t.baseTexture || t, t._canvasRenderTarget || (t._canvasRenderTarget = new d.default(t.width, t.height, t.resolution), t.source = t._canvasRenderTarget.canvas, t.valid = !0), this.context = t._canvasRenderTarget.context, this.resolution = t._canvasRenderTarget.resolution) : this.context = this.rootContext;
                                    var s = this.context;
                                    if (t || (this._lastObjectRendered = e), !n) {
                                        var a = e.parent,
                                            l = this._tempDisplayObjectParent.transform.worldTransform;
                                        r ? (r.copy(l), this._tempDisplayObjectParent.transform._worldID = -1) : l.identity(), e.parent = this._tempDisplayObjectParent, e.updateTransform(), e.parent = a
                                    }
                                    s.save(), s.setTransform(1, 0, 0, 1, 0, 0), s.globalAlpha = 1, this._activeBlendMode = m.BLEND_MODES.NORMAL, s.globalCompositeOperation = this.blendModes[m.BLEND_MODES.NORMAL], navigator.isCocoonJS && this.view.screencanvas && (s.fillStyle = "black", s.clear()), (void 0 !== i ? i : this.clearBeforeRender) && this.renderingToScreen && (this.transparent ? s.clearRect(0, 0, this.width, this.height) : (s.fillStyle = this._backgroundColorString, s.fillRect(0, 0, this.width, this.height)));
                                    var u = this.context;
                                    this.context = s, e.renderCanvas(this), this.context = u, s.restore(), this.resolution = o, this.emit("postrender")
                                }
                            }, t.prototype.clear = function(e) {
                                var t = this.context;
                                e = e || this._backgroundColorString, !this.transparent && e ? (t.fillStyle = e, t.fillRect(0, 0, this.width, this.height)) : t.clearRect(0, 0, this.width, this.height)
                            }, t.prototype.setBlendMode = function(e) {
                                this._activeBlendMode !== e && (this._activeBlendMode = e, this.context.globalCompositeOperation = this.blendModes[e])
                            }, t.prototype.destroy = function(t) {
                                this.destroyPlugins(), e.prototype.destroy.call(this, t), this.context = null, this.refresh = !0, this.maskManager.destroy(), this.maskManager = null, this.smoothProperty = null
                            }, t.prototype.resize = function(t, i) {
                                e.prototype.resize.call(this, t, i), this.smoothProperty && (this.rootContext[this.smoothProperty] = v.default.SCALE_MODE === m.SCALE_MODES.LINEAR)
                            }, t.prototype.invalidateBlendMode = function() {
                                this._activeBlendMode = this.blendModes.indexOf(this.context.globalCompositeOperation)
                            }, t
                        }(l.default);
                    i.default = y, _.pluginTarget.mixin(y)
                }, {
                    "../../const": 46,
                    "../../settings": 101,
                    "../../utils": 125,
                    "../SystemRenderer": 76,
                    "./utils/CanvasMaskManager": 78,
                    "./utils/CanvasRenderTarget": 79,
                    "./utils/mapCanvasBlendModesToPixi": 81
                }],
                78: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../../../const"),
                        o = function() {
                            function e(t) {
                                r(this, e), this.renderer = t
                            }
                            return e.prototype.pushMask = function(e) {
                                var t = this.renderer;
                                t.context.save();
                                var i = e.alpha,
                                    r = e.transform.worldTransform,
                                    n = t.resolution;
                                t.context.setTransform(r.a * n, r.b * n, r.c * n, r.d * n, r.tx * n, r.ty * n), e._texture || (this.renderGraphicsShape(e), t.context.clip()), e.worldAlpha = i
                            }, e.prototype.renderGraphicsShape = function(e) {
                                var t = this.renderer.context,
                                    i = e.graphicsData.length;
                                if (0 !== i) {
                                    t.beginPath();
                                    for (var r = 0; r < i; r++) {
                                        var o = e.graphicsData[r],
                                            s = o.shape;
                                        if (o.type === n.SHAPES.POLY) {
                                            var a = s.points,
                                                l = o.holes,
                                                u = void 0,
                                                c = void 0;
                                            t.moveTo(a[0], a[1]);
                                            for (var h = 2; h < a.length; h += 2) t.lineTo(a[h], a[h + 1]);
                                            if (a[0] === a[a.length - 2] && a[1] === a[a.length - 1] && t.closePath(), l.length > 0) {
                                                u = 0;
                                                for (var d = 0; d < a.length; d += 2) u += a[d] * a[d + 3] - a[d + 1] * a[d + 2];
                                                for (var p = 0; p < l.length; p++) {
                                                    a = l[p].points, c = 0;
                                                    for (var f = 0; f < a.length; f += 2) c += a[f] * a[f + 3] - a[f + 1] * a[f + 2];
                                                    if (t.moveTo(a[0], a[1]), c * u < 0)
                                                        for (var _ = 2; _ < a.length; _ += 2) t.lineTo(a[_], a[_ + 1]);
                                                    else
                                                        for (var m = a.length - 2; m >= 2; m -= 2) t.lineTo(a[m], a[m + 1])
                                                }
                                            }
                                        } else if (o.type === n.SHAPES.RECT) t.rect(s.x, s.y, s.width, s.height), t.closePath();
                                        else if (o.type === n.SHAPES.CIRC) t.arc(s.x, s.y, s.radius, 0, 2 * Math.PI), t.closePath();
                                        else if (o.type === n.SHAPES.ELIP) {
                                            var g = 2 * s.width,
                                                v = 2 * s.height,
                                                y = s.x - g / 2,
                                                b = s.y - v / 2,
                                                x = g / 2 * .5522848,
                                                T = v / 2 * .5522848,
                                                E = y + g,
                                                S = b + v,
                                                P = y + g / 2,
                                                A = b + v / 2;
                                            t.moveTo(y, A), t.bezierCurveTo(y, A - T, P - x, b, P, b), t.bezierCurveTo(P + x, b, E, A - T, E, A), t.bezierCurveTo(E, A + T, P + x, S, P, S), t.bezierCurveTo(P - x, S, y, A + T, y, A), t.closePath()
                                        } else if (o.type === n.SHAPES.RREC) {
                                            var C = s.x,
                                                M = s.y,
                                                R = s.width,
                                                O = s.height,
                                                w = s.radius,
                                                I = Math.min(R, O) / 2 | 0;
                                            w = w > I ? I : w, t.moveTo(C, M + w), t.lineTo(C, M + O - w), t.quadraticCurveTo(C, M + O, C + w, M + O), t.lineTo(C + R - w, M + O), t.quadraticCurveTo(C + R, M + O, C + R, M + O - w), t.lineTo(C + R, M + w), t.quadraticCurveTo(C + R, M, C + R - w, M), t.lineTo(C + w, M), t.quadraticCurveTo(C, M, C, M + w), t.closePath()
                                        }
                                    }
                                }
                            }, e.prototype.popMask = function(e) {
                                e.context.restore(), e.invalidateBlendMode()
                            }, e.prototype.destroy = function() {}, e
                        }();
                    i.default = o
                }, {
                    "../../../const": 46
                }],
                79: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        o = e("../../../settings"),
                        s = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(o),
                        a = function() {
                            function e(t, i, n) {
                                r(this, e), this.canvas = document.createElement("canvas"), this.context = this.canvas.getContext("2d"), this.resolution = n || s.default.RESOLUTION, this.resize(t, i)
                            }
                            return e.prototype.clear = function() {
                                this.context.setTransform(1, 0, 0, 1, 0, 0), this.context.clearRect(0, 0, this.canvas.width, this.canvas.height)
                            }, e.prototype.resize = function(e, t) {
                                this.canvas.width = e * this.resolution, this.canvas.height = t * this.resolution
                            }, e.prototype.destroy = function() {
                                this.context = null, this.canvas = null
                            }, n(e, [{
                                key: "width",
                                get: function() {
                                    return this.canvas.width
                                },
                                set: function(e) {
                                    this.canvas.width = e
                                }
                            }, {
                                key: "height",
                                get: function() {
                                    return this.canvas.height
                                },
                                set: function(e) {
                                    this.canvas.height = e
                                }
                            }]), e
                        }();
                    i.default = a
                }, {
                    "../../../settings": 101
                }],
                80: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        var t = document.createElement("canvas");
                        t.width = 6, t.height = 1;
                        var i = t.getContext("2d");
                        return i.fillStyle = e, i.fillRect(0, 0, 6, 1), t
                    }

                    function n() {
                        if ("undefined" == typeof document) return !1;
                        var e = r("#ff00ff"),
                            t = r("#ffff00"),
                            i = document.createElement("canvas");
                        i.width = 6, i.height = 1;
                        var n = i.getContext("2d");
                        n.globalCompositeOperation = "multiply", n.drawImage(e, 0, 0), n.drawImage(t, 2, 0);
                        var o = n.getImageData(2, 0, 1, 1);
                        if (!o) return !1;
                        var s = o.data;
                        return 255 === s[0] && 0 === s[1] && 0 === s[2]
                    }
                    i.__esModule = !0, i.default = n
                }, {}],
                81: [function(e, t, i) {
                    "use strict";

                    function r() {
                        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
                        return (0, s.default)() ? (e[n.BLEND_MODES.NORMAL] = "source-over", e[n.BLEND_MODES.ADD] = "lighter", e[n.BLEND_MODES.MULTIPLY] = "multiply", e[n.BLEND_MODES.SCREEN] = "screen",
                            e[n.BLEND_MODES.OVERLAY] = "overlay", e[n.BLEND_MODES.DARKEN] = "darken", e[n.BLEND_MODES.LIGHTEN] = "lighten", e[n.BLEND_MODES.COLOR_DODGE] = "color-dodge", e[n.BLEND_MODES.COLOR_BURN] = "color-burn", e[n.BLEND_MODES.HARD_LIGHT] = "hard-light", e[n.BLEND_MODES.SOFT_LIGHT] = "soft-light", e[n.BLEND_MODES.DIFFERENCE] = "difference", e[n.BLEND_MODES.EXCLUSION] = "exclusion", e[n.BLEND_MODES.HUE] = "hue", e[n.BLEND_MODES.SATURATION] = "saturate", e[n.BLEND_MODES.COLOR] = "color", e[n.BLEND_MODES.LUMINOSITY] = "luminosity") : (e[n.BLEND_MODES.NORMAL] = "source-over", e[n.BLEND_MODES.ADD] = "lighter", e[n.BLEND_MODES.MULTIPLY] = "source-over", e[n.BLEND_MODES.SCREEN] = "source-over", e[n.BLEND_MODES.OVERLAY] = "source-over", e[n.BLEND_MODES.DARKEN] = "source-over", e[n.BLEND_MODES.LIGHTEN] = "source-over", e[n.BLEND_MODES.COLOR_DODGE] = "source-over", e[n.BLEND_MODES.COLOR_BURN] = "source-over", e[n.BLEND_MODES.HARD_LIGHT] = "source-over", e[n.BLEND_MODES.SOFT_LIGHT] = "source-over", e[n.BLEND_MODES.DIFFERENCE] = "source-over", e[n.BLEND_MODES.EXCLUSION] = "source-over", e[n.BLEND_MODES.HUE] = "source-over", e[n.BLEND_MODES.SATURATION] = "source-over", e[n.BLEND_MODES.COLOR] = "source-over", e[n.BLEND_MODES.LUMINOSITY] = "source-over"), e[n.BLEND_MODES.NORMAL_NPM] = e[n.BLEND_MODES.NORMAL], e[n.BLEND_MODES.ADD_NPM] = e[n.BLEND_MODES.ADD], e[n.BLEND_MODES.SCREEN_NPM] = e[n.BLEND_MODES.SCREEN], e
                    }
                    i.__esModule = !0, i.default = r;
                    var n = e("../../../const"),
                        o = e("./canUseNewCanvasBlendModes"),
                        s = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(o)
                }, {
                    "../../../const": 46,
                    "./canUseNewCanvasBlendModes": 80
                }],
                82: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../../const"),
                        o = e("../../settings"),
                        s = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(o),
                        a = function() {
                            function e(t) {
                                r(this, e), this.renderer = t, this.count = 0, this.checkCount = 0, this.maxIdle = s.default.GC_MAX_IDLE, this.checkCountMax = s.default.GC_MAX_CHECK_COUNT, this.mode = s.default.GC_MODE
                            }
                            return e.prototype.update = function() {
                                this.count++, this.mode !== n.GC_MODES.MANUAL && ++this.checkCount > this.checkCountMax && (this.checkCount = 0, this.run())
                            }, e.prototype.run = function() {
                                for (var e = this.renderer.textureManager, t = e._managedTextures, i = !1, r = 0; r < t.length; r++) {
                                    var n = t[r];
                                    !n._glRenderTargets && this.count - n.touched > this.maxIdle && (e.destroyTexture(n, !0), t[r] = null, i = !0)
                                }
                                if (i) {
                                    for (var o = 0, s = 0; s < t.length; s++) null !== t[s] && (t[o++] = t[s]);
                                    t.length = o
                                }
                            }, e.prototype.unload = function(e) {
                                var t = this.renderer.textureManager;
                                e._texture && e._texture._glRenderTargets && t.destroyTexture(e._texture, !0);
                                for (var i = e.children.length - 1; i >= 0; i--) this.unload(e.children[i])
                            }, e
                        }();
                    i.default = a
                }, {
                    "../../const": 46,
                    "../../settings": 101
                }],
                83: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("pixi-gl-core"),
                        o = e("../../const"),
                        s = e("./utils/RenderTarget"),
                        a = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(s),
                        l = e("../../utils"),
                        u = function() {
                            function e(t) {
                                r(this, e), this.renderer = t, this.gl = t.gl, this._managedTextures = []
                            }
                            return e.prototype.bindTexture = function() {}, e.prototype.getTexture = function() {}, e.prototype.updateTexture = function(e, t) {
                                var i = this.gl,
                                    r = !!e._glRenderTargets;
                                if (!e.hasLoaded) return null;
                                var s = this.renderer.boundTextures;
                                if (void 0 === t) {
                                    t = 0;
                                    for (var l = 0; l < s.length; ++l)
                                        if (s[l] === e) {
                                            t = l;
                                            break
                                        }
                                }
                                s[t] = e, i.activeTexture(i.TEXTURE0 + t);
                                var u = e._glTextures[this.renderer.CONTEXT_UID];
                                if (u) r ? e._glRenderTargets[this.renderer.CONTEXT_UID].resize(e.width, e.height) : u.upload(e.source);
                                else {
                                    if (r) {
                                        var c = new a.default(this.gl, e.width, e.height, e.scaleMode, e.resolution);
                                        c.resize(e.width, e.height), e._glRenderTargets[this.renderer.CONTEXT_UID] = c, u = c.texture, this.renderer._activeRenderTarget.root || this.renderer._activeRenderTarget.frameBuffer.bind()
                                    } else u = new n.GLTexture(this.gl, null, null, null, null), u.bind(t), u.premultiplyAlpha = !0, u.upload(e.source);
                                    e._glTextures[this.renderer.CONTEXT_UID] = u, e.on("update", this.updateTexture, this), e.on("dispose", this.destroyTexture, this), this._managedTextures.push(e), e.isPowerOfTwo ? (e.mipmap && u.enableMipmap(), e.wrapMode === o.WRAP_MODES.CLAMP ? u.enableWrapClamp() : e.wrapMode === o.WRAP_MODES.REPEAT ? u.enableWrapRepeat() : u.enableWrapMirrorRepeat()) : u.enableWrapClamp(), e.scaleMode === o.SCALE_MODES.NEAREST ? u.enableNearestScaling() : u.enableLinearScaling()
                                }
                                return u
                            }, e.prototype.destroyTexture = function(e, t) {
                                if (e = e.baseTexture || e, e.hasLoaded) {
                                    var i = this.renderer,
                                        r = i.CONTEXT_UID,
                                        n = e._glTextures,
                                        o = e._glRenderTargets;
                                    if (n[r] && (i.unbindTexture(e), n[r].destroy(), e.off("update", this.updateTexture, this), e.off("dispose", this.destroyTexture, this), delete n[r], !t)) {
                                        var s = this._managedTextures.indexOf(e); - 1 !== s && (0, l.removeItems)(this._managedTextures, s, 1)
                                    }
                                    o && o[r] && (i._activeRenderTarget === o[r] && i.bindRenderTarget(i.rootRenderTarget), o[r].destroy(), delete o[r])
                                }
                            }, e.prototype.removeAll = function() {
                                for (var e = 0; e < this._managedTextures.length; ++e) {
                                    var t = this._managedTextures[e];
                                    t._glTextures[this.renderer.CONTEXT_UID] && delete t._glTextures[this.renderer.CONTEXT_UID]
                                }
                            }, e.prototype.destroy = function() {
                                for (var e = 0; e < this._managedTextures.length; ++e) {
                                    var t = this._managedTextures[e];
                                    this.destroyTexture(t, !0), t.off("update", this.updateTexture, this), t.off("dispose", this.destroyTexture, this)
                                }
                                this._managedTextures = null
                            }, e
                        }();
                    i.default = u
                }, {
                    "../../const": 46,
                    "../../utils": 125,
                    "./utils/RenderTarget": 96,
                    "pixi-gl-core": 15
                }],
                84: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("../SystemRenderer"),
                        l = r(a),
                        u = e("./managers/MaskManager"),
                        c = r(u),
                        h = e("./managers/StencilManager"),
                        d = r(h),
                        p = e("./managers/FilterManager"),
                        f = r(p),
                        _ = e("./utils/RenderTarget"),
                        m = r(_),
                        g = e("./utils/ObjectRenderer"),
                        v = r(g),
                        y = e("./TextureManager"),
                        b = r(y),
                        x = e("../../textures/BaseTexture"),
                        T = r(x),
                        E = e("./TextureGarbageCollector"),
                        S = r(E),
                        P = e("./WebGLState"),
                        A = r(P),
                        C = e("./utils/mapWebGLDrawModesToPixi"),
                        M = r(C),
                        R = e("./utils/validateContext"),
                        O = r(R),
                        w = e("../../utils"),
                        I = e("pixi-gl-core"),
                        D = r(I),
                        L = e("../../const"),
                        B = 0,
                        F = function(e) {
                            function t(i, r, s) {
                                n(this, t);
                                var a = o(this, e.call(this, "WebGL", i, r, s));
                                return a.legacy = a.options.legacy, a.legacy && (D.default.VertexArrayObject.FORCE_NATIVE = !0), a.type = L.RENDERER_TYPE.WEBGL, a.handleContextLost = a.handleContextLost.bind(a), a.handleContextRestored = a.handleContextRestored.bind(a), a.view.addEventListener("webglcontextlost", a.handleContextLost, !1), a.view.addEventListener("webglcontextrestored", a.handleContextRestored, !1), a._contextOptions = {
                                    alpha: a.transparent,
                                    antialias: a.options.antialias,
                                    premultipliedAlpha: a.transparent && "notMultiplied" !== a.transparent,
                                    stencil: !0,
                                    preserveDrawingBuffer: a.options.preserveDrawingBuffer,
                                    powerPreference: a.options.powerPreference
                                }, a._backgroundColorRgba[3] = a.transparent ? 0 : 1, a.maskManager = new c.default(a), a.stencilManager = new d.default(a), a.emptyRenderer = new v.default(a), a.currentRenderer = a.emptyRenderer, a.textureManager = null, a.filterManager = null, a.initPlugins(), a.options.context && (0, O.default)(a.options.context), a.gl = a.options.context || D.default.createContext(a.view, a._contextOptions), a.CONTEXT_UID = B++, a.state = new A.default(a.gl), a.renderingToScreen = !0, a.boundTextures = null, a._activeShader = null, a._activeVao = null, a._activeRenderTarget = null, a._initContext(), a.drawModes = (0, M.default)(a.gl), a._nextTextureLocation = 0, a.setBlendMode(0), a
                            }
                            return s(t, e), t.prototype._initContext = function() {
                                var e = this.gl;
                                e.isContextLost() && e.getExtension("WEBGL_lose_context") && e.getExtension("WEBGL_lose_context").restoreContext();
                                var t = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
                                this._activeShader = null, this._activeVao = null, this.boundTextures = new Array(t), this.emptyTextures = new Array(t), this.textureManager = new b.default(this), this.filterManager = new f.default(this), this.textureGC = new S.default(this), this.state.resetToDefault(), this.rootRenderTarget = new m.default(e, this.width, this.height, null, this.resolution, !0), this.rootRenderTarget.clearColor = this._backgroundColorRgba, this.bindRenderTarget(this.rootRenderTarget);
                                var i = new D.default.GLTexture.fromData(e, null, 1, 1),
                                    r = {
                                        _glTextures: {}
                                    };
                                r._glTextures[this.CONTEXT_UID] = {};
                                for (var n = 0; n < t; n++) {
                                    var o = new T.default;
                                    o._glTextures[this.CONTEXT_UID] = i, this.boundTextures[n] = r, this.emptyTextures[n] = o, this.bindTexture(null, n)
                                }
                                this.emit("context", e), this.resize(this.screen.width, this.screen.height)
                            }, t.prototype.render = function(e, t, i, r, n) {
                                if (this.renderingToScreen = !t, this.emit("prerender"), this.gl && !this.gl.isContextLost()) {
                                    if (this._nextTextureLocation = 0, t || (this._lastObjectRendered = e), !n) {
                                        var o = e.parent;
                                        e.parent = this._tempDisplayObjectParent, e.updateTransform(), e.parent = o
                                    }
                                    this.bindRenderTexture(t, r), this.currentRenderer.start(), (void 0 !== i ? i : this.clearBeforeRender) && this._activeRenderTarget.clear(), e.renderWebGL(this), this.currentRenderer.flush(), this.textureGC.update(), this.emit("postrender")
                                }
                            }, t.prototype.setObjectRenderer = function(e) {
                                this.currentRenderer !== e && (this.currentRenderer.stop(), this.currentRenderer = e, this.currentRenderer.start())
                            }, t.prototype.flush = function() {
                                this.setObjectRenderer(this.emptyRenderer)
                            }, t.prototype.resize = function(e, t) {
                                l.default.prototype.resize.call(this, e, t), this.rootRenderTarget.resize(e, t), this._activeRenderTarget === this.rootRenderTarget && (this.rootRenderTarget.activate(), this._activeShader && (this._activeShader.uniforms.projectionMatrix = this.rootRenderTarget.projectionMatrix.toArray(!0)))
                            }, t.prototype.setBlendMode = function(e) {
                                this.state.setBlendMode(e)
                            }, t.prototype.clear = function(e) {
                                this._activeRenderTarget.clear(e)
                            }, t.prototype.setTransform = function(e) {
                                this._activeRenderTarget.transform = e
                            }, t.prototype.clearRenderTexture = function(e, t) {
                                var i = e.baseTexture,
                                    r = i._glRenderTargets[this.CONTEXT_UID];
                                return r && r.clear(t), this
                            }, t.prototype.bindRenderTexture = function(e, t) {
                                var i = void 0;
                                if (e) {
                                    var r = e.baseTexture;
                                    r._glRenderTargets[this.CONTEXT_UID] || this.textureManager.updateTexture(r, 0), this.unbindTexture(r), i = r._glRenderTargets[this.CONTEXT_UID], i.setFrame(e.frame)
                                } else i = this.rootRenderTarget;
                                return i.transform = t, this.bindRenderTarget(i), this
                            }, t.prototype.bindRenderTarget = function(e) {
                                return e !== this._activeRenderTarget && (this._activeRenderTarget = e, e.activate(), this._activeShader && (this._activeShader.uniforms.projectionMatrix = e.projectionMatrix.toArray(!0)), this.stencilManager.setMaskStack(e.stencilMaskStack)), this
                            }, t.prototype.bindShader = function(e, t) {
                                return this._activeShader !== e && (this._activeShader = e, e.bind(), !1 !== t && (e.uniforms.projectionMatrix = this._activeRenderTarget.projectionMatrix.toArray(!0))), this
                            }, t.prototype.bindTexture = function(e, t, i) {
                                if (e = e || this.emptyTextures[t], e = e.baseTexture || e, e.touched = this.textureGC.count, i) t = t || 0;
                                else {
                                    for (var r = 0; r < this.boundTextures.length; r++)
                                        if (this.boundTextures[r] === e) return r;
                                    void 0 === t && (this._nextTextureLocation++, this._nextTextureLocation %= this.boundTextures.length, t = this.boundTextures.length - this._nextTextureLocation - 1)
                                }
                                var n = this.gl,
                                    o = e._glTextures[this.CONTEXT_UID];
                                return o ? (this.boundTextures[t] = e, n.activeTexture(n.TEXTURE0 + t), n.bindTexture(n.TEXTURE_2D, o.texture)) : this.textureManager.updateTexture(e, t), t
                            }, t.prototype.unbindTexture = function(e) {
                                var t = this.gl;
                                e = e.baseTexture || e;
                                for (var i = 0; i < this.boundTextures.length; i++) this.boundTextures[i] === e && (this.boundTextures[i] = this.emptyTextures[i], t.activeTexture(t.TEXTURE0 + i), t.bindTexture(t.TEXTURE_2D, this.emptyTextures[i]._glTextures[this.CONTEXT_UID].texture));
                                return this
                            }, t.prototype.createVao = function() {
                                return new D.default.VertexArrayObject(this.gl, this.state.attribState)
                            }, t.prototype.bindVao = function(e) {
                                return this._activeVao === e ? this : (e ? e.bind() : this._activeVao && this._activeVao.unbind(), this._activeVao = e, this)
                            }, t.prototype.reset = function() {
                                this.setObjectRenderer(this.emptyRenderer), this.bindVao(null), this._activeShader = null, this._activeRenderTarget = this.rootRenderTarget;
                                for (var e = 0; e < this.boundTextures.length; e++) this.boundTextures[e] = this.emptyTextures[e];
                                return this.rootRenderTarget.activate(), this.state.resetToDefault(), this
                            }, t.prototype.handleContextLost = function(e) {
                                e.preventDefault()
                            }, t.prototype.handleContextRestored = function() {
                                this.textureManager.removeAll(), this.filterManager.destroy(!0), this._initContext()
                            }, t.prototype.destroy = function(t) {
                                this.destroyPlugins(), this.view.removeEventListener("webglcontextlost", this.handleContextLost), this.view.removeEventListener("webglcontextrestored", this.handleContextRestored), this.textureManager.destroy(), e.prototype.destroy.call(this, t), this.uid = 0, this.maskManager.destroy(), this.stencilManager.destroy(), this.filterManager.destroy(), this.maskManager = null, this.filterManager = null, this.textureManager = null, this.currentRenderer = null, this.handleContextLost = null, this.handleContextRestored = null, this._contextOptions = null, this.gl.useProgram(null), this.gl.getExtension("WEBGL_lose_context") && this.gl.getExtension("WEBGL_lose_context").loseContext(), this.gl = null
                            }, t
                        }(l.default);
                    i.default = F, w.pluginTarget.mixin(F)
                }, {
                    "../../const": 46,
                    "../../textures/BaseTexture": 112,
                    "../../utils": 125,
                    "../SystemRenderer": 76,
                    "./TextureGarbageCollector": 82,
                    "./TextureManager": 83,
                    "./WebGLState": 85,
                    "./managers/FilterManager": 90,
                    "./managers/MaskManager": 91,
                    "./managers/StencilManager": 92,
                    "./utils/ObjectRenderer": 94,
                    "./utils/RenderTarget": 96,
                    "./utils/mapWebGLDrawModesToPixi": 99,
                    "./utils/validateContext": 100,
                    "pixi-gl-core": 15
                }],
                85: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("./utils/mapWebGLBlendModesToPixi"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = function() {
                            function e(t) {
                                r(this, e), this.activeState = new Uint8Array(16), this.defaultState = new Uint8Array(16), this.defaultState[0] = 1, this.stackIndex = 0, this.stack = [], this.gl = t, this.maxAttribs = t.getParameter(t.MAX_VERTEX_ATTRIBS), this.attribState = {
                                    tempAttribState: new Array(this.maxAttribs),
                                    attribState: new Array(this.maxAttribs)
                                }, this.blendModes = (0, o.default)(t), this.nativeVaoExtension = t.getExtension("OES_vertex_array_object") || t.getExtension("MOZ_OES_vertex_array_object") || t.getExtension("WEBKIT_OES_vertex_array_object")
                            }
                            return e.prototype.push = function() {
                                var e = this.stack[this.stackIndex];
                                e || (e = this.stack[this.stackIndex] = new Uint8Array(16)), ++this.stackIndex;
                                for (var t = 0; t < this.activeState.length; t++) e[t] = this.activeState[t]
                            }, e.prototype.pop = function() {
                                var e = this.stack[--this.stackIndex];
                                this.setState(e)
                            }, e.prototype.setState = function(e) {
                                this.setBlend(e[0]), this.setDepthTest(e[1]), this.setFrontFace(e[2]), this.setCullFace(e[3]), this.setBlendMode(e[4])
                            }, e.prototype.setBlend = function(e) {
                                e = e ? 1 : 0, this.activeState[0] !== e && (this.activeState[0] = e, this.gl[e ? "enable" : "disable"](this.gl.BLEND))
                            }, e.prototype.setBlendMode = function(e) {
                                if (e !== this.activeState[4]) {
                                    this.activeState[4] = e;
                                    var t = this.blendModes[e];
                                    2 === t.length ? this.gl.blendFunc(t[0], t[1]) : this.gl.blendFuncSeparate(t[0], t[1], t[2], t[3])
                                }
                            }, e.prototype.setDepthTest = function(e) {
                                e = e ? 1 : 0, this.activeState[1] !== e && (this.activeState[1] = e, this.gl[e ? "enable" : "disable"](this.gl.DEPTH_TEST))
                            }, e.prototype.setCullFace = function(e) {
                                e = e ? 1 : 0, this.activeState[3] !== e && (this.activeState[3] = e, this.gl[e ? "enable" : "disable"](this.gl.CULL_FACE))
                            }, e.prototype.setFrontFace = function(e) {
                                e = e ? 1 : 0, this.activeState[2] !== e && (this.activeState[2] = e, this.gl.frontFace(this.gl[e ? "CW" : "CCW"]))
                            }, e.prototype.resetAttributes = function() {
                                for (var e = 0; e < this.attribState.tempAttribState.length; e++) this.attribState.tempAttribState[e] = 0;
                                for (var t = 0; t < this.attribState.attribState.length; t++) this.attribState.attribState[t] = 0;
                                for (var i = 1; i < this.maxAttribs; i++) this.gl.disableVertexAttribArray(i)
                            }, e.prototype.resetToDefault = function() {
                                this.nativeVaoExtension && this.nativeVaoExtension.bindVertexArrayOES(null), this.resetAttributes();
                                for (var e = 0; e < this.activeState.length; ++e) this.activeState[e] = 32;
                                this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, !1), this.setState(this.defaultState)
                            }, e
                        }();
                    i.default = s
                }, {
                    "./utils/mapWebGLBlendModesToPixi": 98
                }],
                86: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var o = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        s = e("./extractUniformsFromSrc"),
                        a = r(s),
                        l = e("../../../utils"),
                        u = e("../../../const"),
                        c = e("../../../settings"),
                        h = r(c),
                        d = {},
                        p = function() {
                            function e(t, i, r) {
                                n(this, e), this.vertexSrc = t || e.defaultVertexSrc, this.fragmentSrc = i || e.defaultFragmentSrc, this._blendMode = u.BLEND_MODES.NORMAL, this.uniformData = r || (0, a.default)(this.vertexSrc, this.fragmentSrc, "projectionMatrix|uSampler"), this.uniforms = {};
                                for (var o in this.uniformData) this.uniforms[o] = this.uniformData[o].value, this.uniformData[o].type && (this.uniformData[o].type = this.uniformData[o].type.toLowerCase());
                                this.glShaders = {}, d[this.vertexSrc + this.fragmentSrc] || (d[this.vertexSrc + this.fragmentSrc] = (0, l.uid)()), this.glShaderKey = d[this.vertexSrc + this.fragmentSrc], this.padding = 4, this.resolution = h.default.FILTER_RESOLUTION, this.enabled = !0, this.autoFit = !0
                            }
                            return e.prototype.apply = function(e, t, i, r, n) {
                                e.applyFilter(this, t, i, r)
                            }, o(e, [{
                                key: "blendMode",
                                get: function() {
                                    return this._blendMode
                                },
                                set: function(e) {
                                    this._blendMode = e
                                }
                            }], [{
                                key: "defaultVertexSrc",
                                get: function() {
                                    return ["attribute vec2 aVertexPosition;", "attribute vec2 aTextureCoord;", "uniform mat3 projectionMatrix;", "uniform mat3 filterMatrix;", "varying vec2 vTextureCoord;", "varying vec2 vFilterCoord;", "void main(void){", "   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);", "   vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0)  ).xy;", "   vTextureCoord = aTextureCoord ;", "}"].join("\n")
                                }
                            }, {
                                key: "defaultFragmentSrc",
                                get: function() {
                                    return ["varying vec2 vTextureCoord;", "varying vec2 vFilterCoord;", "uniform sampler2D uSampler;", "uniform sampler2D filterSampler;", "void main(void){", "   vec4 masky = texture2D(filterSampler, vFilterCoord);", "   vec4 sample = texture2D(uSampler, vTextureCoord);", "   vec4 color;", "   if(mod(vFilterCoord.x, 1.0) > 0.5)", "   {", "     color = vec4(1.0, 0.0, 0.0, 1.0);", "   }", "   else", "   {", "     color = vec4(0.0, 1.0, 0.0, 1.0);", "   }", "   gl_FragColor = mix(sample, masky, 0.5);", "   gl_FragColor *= sample.a;", "}"].join("\n")
                                }
                            }]), e
                        }();
                    i.default = p
                }, {
                    "../../../const": 46,
                    "../../../settings": 101,
                    "../../../utils": 125,
                    "./extractUniformsFromSrc": 87
                }],
                87: [function(e, t, i) {
                    "use strict";

                    function r(e, t, i) {
                        var r = n(e),
                            o = n(t);
                        return Object.assign(r, o)
                    }

                    function n(e) {
                        for (var t = new RegExp("^(projectionMatrix|uSampler|filterArea|filterClamp)$"), i = {}, r = void 0, n = e.replace(/\s+/g, " ").split(/\s*;\s*/), o = 0; o < n.length; o++) {
                            var s = n[o].trim();
                            if (s.indexOf("uniform") > -1) {
                                var l = s.split(" "),
                                    u = l[1],
                                    c = l[2],
                                    h = 1;
                                c.indexOf("[") > -1 && (r = c.split(/\[|]/), c = r[0], h *= Number(r[1])), c.match(t) || (i[c] = {
                                    value: a(u, h),
                                    name: c,
                                    type: u
                                })
                            }
                        }
                        return i
                    }
                    i.__esModule = !0, i.default = r;
                    var o = e("pixi-gl-core"),
                        s = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(o),
                        a = s.default.shader.defaultValue
                }, {
                    "pixi-gl-core": 15
                }],
                88: [function(e, t, i) {
                    "use strict";

                    function r(e, t, i) {
                        var r = e.identity();
                        return r.translate(t.x / i.width, t.y / i.height), r.scale(i.width, i.height), r
                    }

                    function n(e, t, i) {
                        var r = e.identity();
                        r.translate(t.x / i.width, t.y / i.height);
                        var n = i.width / t.width,
                            o = i.height / t.height;
                        return r.scale(n, o), r
                    }

                    function o(e, t, i, r) {
                        var n = r._texture.orig,
                            o = e.set(i.width, 0, 0, i.height, t.x, t.y),
                            a = r.worldTransform.copy(s.Matrix.TEMP_MATRIX);
                        return a.invert(), o.prepend(a), o.scale(1 / n.width, 1 / n.height), o.translate(r.anchor.x, r.anchor.y), o
                    }
                    i.__esModule = !0, i.calculateScreenSpaceMatrix = r, i.calculateNormalizedScreenSpaceMatrix = n, i.calculateSpriteMatrix = o;
                    var s = e("../../../math")
                }, {
                    "../../../math": 70
                }],
                89: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("../Filter"),
                        l = r(a),
                        u = e("../../../../math"),
                        c = (e("path"), e("../../../../textures/TextureMatrix")),
                        h = r(c),
                        d = function(e) {
                            function t(i) {
                                n(this, t);
                                var r = new u.Matrix,
                                    s = o(this, e.call(this, "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n}\n", "varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n    float clip = step(3.5,\n        step(maskClamp.x, vMaskCoord.x) +\n        step(maskClamp.y, vMaskCoord.y) +\n        step(vMaskCoord.x, maskClamp.z) +\n        step(vMaskCoord.y, maskClamp.w));\n\n    vec4 original = texture2D(uSampler, vTextureCoord);\n    vec4 masky = texture2D(mask, vMaskCoord);\n\n    original *= (masky.r * masky.a * alpha * clip);\n\n    gl_FragColor = original;\n}\n"));
                                return i.renderable = !1, s.maskSprite = i, s.maskMatrix = r, s
                            }
                            return s(t, e), t.prototype.apply = function(e, t, i) {
                                var r = this.maskSprite,
                                    n = this.maskSprite.texture;
                                n.valid && (n.transform || (n.transform = new h.default(n, 0)), n.transform.update(), this.uniforms.mask = n, this.uniforms.otherMatrix = e.calculateSpriteMatrix(this.maskMatrix, r).prepend(n.transform.mapCoord), this.uniforms.alpha = r.worldAlpha, this.uniforms.maskClamp = n.transform.uClampFrame, e.applyFilter(this, t, i))
                            }, t
                        }(l.default);
                    i.default = d
                }, {
                    "../../../../math": 70,
                    "../../../../textures/TextureMatrix": 116,
                    "../Filter": 86,
                    path: 8
                }],
                90: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }

                    function s(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var a = e("./WebGLManager"),
                        l = r(a),
                        u = e("../utils/RenderTarget"),
                        c = r(u),
                        h = e("../utils/Quad"),
                        d = r(h),
                        p = e("../../../math"),
                        f = e("../../../Shader"),
                        _ = r(f),
                        m = e("../filters/filterTransforms"),
                        g = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(m),
                        v = e("bit-twiddle"),
                        y = r(v),
                        b = function() {
                            function e() {
                                s(this, e), this.renderTarget = null, this.target = null, this.resolution = 1, this.sourceFrame = new p.Rectangle, this.destinationFrame = new p.Rectangle, this.filters = []
                            }
                            return e.prototype.clear = function() {
                                this.filters = null, this.target = null, this.renderTarget = null
                            }, e
                        }(),
                        x = function(e) {
                            function t(i) {
                                s(this, t);
                                var r = n(this, e.call(this, i));
                                return r.gl = r.renderer.gl, r.quad = new d.default(r.gl, i.state.attribState), r.shaderCache = {}, r.pool = {}, r.filterData = null, r.managedFilters = [], r.renderer.on("prerender", r.onPrerender, r), r._screenWidth = i.view.width, r._screenHeight = i.view.height, r
                            }
                            return o(t, e), t.prototype.pushFilter = function(e, t) {
                                var i = this.renderer,
                                    r = this.filterData;
                                if (!r) {
                                    r = this.renderer._activeRenderTarget.filterStack;
                                    var n = new b;
                                    n.sourceFrame = n.destinationFrame = this.renderer._activeRenderTarget.size, n.renderTarget = i._activeRenderTarget, this.renderer._activeRenderTarget.filterData = r = {
                                        index: 0,
                                        stack: [n]
                                    }, this.filterData = r
                                }
                                var o = r.stack[++r.index],
                                    s = r.stack[0].destinationFrame;
                                o || (o = r.stack[r.index] = new b);
                                var a = e.filterArea && 0 === e.filterArea.x && 0 === e.filterArea.y && e.filterArea.width === i.screen.width && e.filterArea.height === i.screen.height,
                                    l = t[0].resolution,
                                    u = 0 | t[0].padding,
                                    c = a ? i.screen : e.filterArea || e.getBounds(!0),
                                    h = o.sourceFrame,
                                    d = o.destinationFrame;
                                h.x = (c.x * l | 0) / l, h.y = (c.y * l | 0) / l, h.width = (c.width * l | 0) / l, h.height = (c.height * l | 0) / l, a || (r.stack[0].renderTarget.transform || t[0].autoFit && h.fit(s), h.pad(u)), d.width = h.width, d.height = h.height;
                                var p = this.getPotRenderTarget(i.gl, h.width, h.height, l);
                                o.target = e, o.filters = t, o.resolution = l, o.renderTarget = p, p.setFrame(d, h), i.bindRenderTarget(p), p.clear()
                            }, t.prototype.popFilter = function() {
                                var e = this.filterData,
                                    t = e.stack[e.index - 1],
                                    i = e.stack[e.index];
                                this.quad.map(i.renderTarget.size, i.sourceFrame).upload();
                                var r = i.filters;
                                if (1 === r.length) r[0].apply(this, i.renderTarget, t.renderTarget, !1, i), this.freePotRenderTarget(i.renderTarget);
                                else {
                                    var n = i.renderTarget,
                                        o = this.getPotRenderTarget(this.renderer.gl, i.sourceFrame.width, i.sourceFrame.height, i.resolution);
                                    o.setFrame(i.destinationFrame, i.sourceFrame), o.clear();
                                    var s = 0;
                                    for (s = 0; s < r.length - 1; ++s) {
                                        r[s].apply(this, n, o, !0, i);
                                        var a = n;
                                        n = o, o = a
                                    }
                                    r[s].apply(this, n, t.renderTarget, !1, i), this.freePotRenderTarget(n), this.freePotRenderTarget(o)
                                }
                                i.clear(), 0 === --e.index && (this.filterData = null)
                            }, t.prototype.applyFilter = function(e, t, i, r) {
                                var n = this.renderer,
                                    o = n.gl,
                                    s = e.glShaders[n.CONTEXT_UID];
                                s || (e.glShaderKey ? (s = this.shaderCache[e.glShaderKey]) || (s = new _.default(this.gl, e.vertexSrc, e.fragmentSrc), e.glShaders[n.CONTEXT_UID] = this.shaderCache[e.glShaderKey] = s, this.managedFilters.push(e)) : (s = e.glShaders[n.CONTEXT_UID] = new _.default(this.gl, e.vertexSrc, e.fragmentSrc), this.managedFilters.push(e)), n.bindVao(null), this.quad.initVao(s)), n.bindVao(this.quad.vao), n.bindRenderTarget(i), r && (o.disable(o.SCISSOR_TEST), n.clear(), o.enable(o.SCISSOR_TEST)), i === n.maskManager.scissorRenderTarget && n.maskManager.pushScissorMask(null, n.maskManager.scissorData), n.bindShader(s);
                                var a = this.renderer.emptyTextures[0];
                                this.renderer.boundTextures[0] = a, this.syncUniforms(s, e), n.state.setBlendMode(e.blendMode), o.activeTexture(o.TEXTURE0), o.bindTexture(o.TEXTURE_2D, t.texture.texture), this.quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0), o.bindTexture(o.TEXTURE_2D, a._glTextures[this.renderer.CONTEXT_UID].texture)
                            }, t.prototype.syncUniforms = function(e, t) {
                                var i = t.uniformData,
                                    r = t.uniforms,
                                    n = 1,
                                    o = void 0;
                                if (e.uniforms.filterArea) {
                                    o = this.filterData.stack[this.filterData.index];
                                    var s = e.uniforms.filterArea;
                                    s[0] = o.renderTarget.size.width, s[1] = o.renderTarget.size.height, s[2] = o.sourceFrame.x, s[3] = o.sourceFrame.y, e.uniforms.filterArea = s
                                }
                                if (e.uniforms.filterClamp) {
                                    o = o || this.filterData.stack[this.filterData.index];
                                    var a = e.uniforms.filterClamp;
                                    a[0] = 0, a[1] = 0, a[2] = (o.sourceFrame.width - 1) / o.renderTarget.size.width, a[3] = (o.sourceFrame.height - 1) / o.renderTarget.size.height, e.uniforms.filterClamp = a
                                }
                                for (var l in i)
                                    if (e.uniforms.data[l]) {
                                        var u = i[l].type;
                                        if ("sampler2d" === u && 0 !== r[l]) {
                                            if (r[l].baseTexture) e.uniforms[l] = this.renderer.bindTexture(r[l].baseTexture, n);
                                            else {
                                                e.uniforms[l] = n;
                                                var c = this.renderer.gl;
                                                this.renderer.boundTextures[n] = this.renderer.emptyTextures[n], c.activeTexture(c.TEXTURE0 + n), r[l].texture.bind()
                                            }
                                            n++
                                        } else if ("mat3" === u) void 0 !== r[l].a ? e.uniforms[l] = r[l].toArray(!0) : e.uniforms[l] = r[l];
                                        else if ("vec2" === u)
                                            if (void 0 !== r[l].x) {
                                                var h = e.uniforms[l] || new Float32Array(2);
                                                h[0] = r[l].x, h[1] = r[l].y, e.uniforms[l] = h
                                            } else e.uniforms[l] = r[l];
                                        else "float" === u ? e.uniforms.data[l].value !== i[l] && (e.uniforms[l] = r[l]) : e.uniforms[l] = r[l]
                                    }
                            }, t.prototype.getRenderTarget = function(e, t) {
                                var i = this.filterData.stack[this.filterData.index],
                                    r = this.getPotRenderTarget(this.renderer.gl, i.sourceFrame.width, i.sourceFrame.height, t || i.resolution);
                                return r.setFrame(i.destinationFrame, i.sourceFrame), r
                            }, t.prototype.returnRenderTarget = function(e) {
                                this.freePotRenderTarget(e)
                            }, t.prototype.calculateScreenSpaceMatrix = function(e) {
                                var t = this.filterData.stack[this.filterData.index];
                                return g.calculateScreenSpaceMatrix(e, t.sourceFrame, t.renderTarget.size)
                            }, t.prototype.calculateNormalizedScreenSpaceMatrix = function(e) {
                                var t = this.filterData.stack[this.filterData.index];
                                return g.calculateNormalizedScreenSpaceMatrix(e, t.sourceFrame, t.renderTarget.size, t.destinationFrame)
                            }, t.prototype.calculateSpriteMatrix = function(e, t) {
                                var i = this.filterData.stack[this.filterData.index];
                                return g.calculateSpriteMatrix(e, i.sourceFrame, i.renderTarget.size, t)
                            }, t.prototype.destroy = function() {
                                var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0],
                                    t = this.renderer,
                                    i = this.managedFilters;
                                t.off("prerender", this.onPrerender, this);
                                for (var r = 0; r < i.length; r++) e || i[r].glShaders[t.CONTEXT_UID].destroy(), delete i[r].glShaders[t.CONTEXT_UID];
                                this.shaderCache = {}, e ? this.pool = {} : this.emptyPool()
                            }, t.prototype.getPotRenderTarget = function(e, t, i, r) {
                                var n = "screen";
                                t *= r, i *= r, t === this._screenWidth && i === this._screenHeight || (t = y.default.nextPow2(t), i = y.default.nextPow2(i), n = (65535 & t) << 16 | 65535 & i), this.pool[n] || (this.pool[n] = []);
                                var o = this.pool[n].pop();
                                if (!o) {
                                    var s = this.renderer.boundTextures[0];
                                    e.activeTexture(e.TEXTURE0), o = new c.default(e, t, i, null, 1), e.bindTexture(e.TEXTURE_2D, s._glTextures[this.renderer.CONTEXT_UID].texture)
                                }
                                return o.resolution = r, o.defaultFrame.width = o.size.width = t / r, o.defaultFrame.height = o.size.height = i / r, o.filterPoolKey = n, o
                            }, t.prototype.emptyPool = function() {
                                for (var e in this.pool) {
                                    var t = this.pool[e];
                                    if (t)
                                        for (var i = 0; i < t.length; i++) t[i].destroy(!0)
                                }
                                this.pool = {}
                            }, t.prototype.freePotRenderTarget = function(e) {
                                this.pool[e.filterPoolKey].push(e)
                            }, t.prototype.onPrerender = function() {
                                if (this._screenWidth !== this.renderer.view.width || this._screenHeight !== this.renderer.view.height) {
                                    this._screenWidth = this.renderer.view.width, this._screenHeight = this.renderer.view.height;
                                    var e = this.pool.screen;
                                    if (e)
                                        for (var t = 0; t < e.length; t++) e[t].destroy(!0);
                                    this.pool.screen = []
                                }
                            }, t
                        }(l.default);
                    i.default = x
                }, {
                    "../../../Shader": 44,
                    "../../../math": 70,
                    "../filters/filterTransforms": 88,
                    "../utils/Quad": 95,
                    "../utils/RenderTarget": 96,
                    "./WebGLManager": 93,
                    "bit-twiddle": 1
                }],
                91: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("./WebGLManager"),
                        l = r(a),
                        u = e("../filters/spriteMask/SpriteMaskFilter"),
                        c = r(u),
                        h = function(e) {
                            function t(i) {
                                n(this, t);
                                var r = o(this, e.call(this, i));
                                return r.scissor = !1, r.scissorData = null, r.scissorRenderTarget = null, r.enableScissor = !0, r.alphaMaskPool = [], r.alphaMaskIndex = 0, r
                            }
                            return s(t, e), t.prototype.pushMask = function(e, t) {
                                if (t.texture) this.pushSpriteMask(e, t);
                                else if (this.enableScissor && !this.scissor && this.renderer._activeRenderTarget.root && !this.renderer.stencilManager.stencilMaskStack.length && t.isFastRect()) {
                                    var i = t.worldTransform,
                                        r = Math.atan2(i.b, i.a);
                                    r = Math.round(r * (180 / Math.PI)),
                                        r % 90 ? this.pushStencilMask(t) : this.pushScissorMask(e, t)
                                } else this.pushStencilMask(t)
                            }, t.prototype.popMask = function(e, t) {
                                t.texture ? this.popSpriteMask(e, t) : this.enableScissor && !this.renderer.stencilManager.stencilMaskStack.length ? this.popScissorMask(e, t) : this.popStencilMask(e, t)
                            }, t.prototype.pushSpriteMask = function(e, t) {
                                var i = this.alphaMaskPool[this.alphaMaskIndex];
                                i || (i = this.alphaMaskPool[this.alphaMaskIndex] = [new c.default(t)]), i[0].resolution = this.renderer.resolution, i[0].maskSprite = t, e.filterArea = t.getBounds(!0), this.renderer.filterManager.pushFilter(e, i), this.alphaMaskIndex++
                            }, t.prototype.popSpriteMask = function() {
                                this.renderer.filterManager.popFilter(), this.alphaMaskIndex--
                            }, t.prototype.pushStencilMask = function(e) {
                                this.renderer.currentRenderer.stop(), this.renderer.stencilManager.pushStencil(e)
                            }, t.prototype.popStencilMask = function() {
                                this.renderer.currentRenderer.stop(), this.renderer.stencilManager.popStencil()
                            }, t.prototype.pushScissorMask = function(e, t) {
                                t.renderable = !0;
                                var i = this.renderer._activeRenderTarget,
                                    r = t.getBounds();
                                r.fit(i.size), t.renderable = !1, this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);
                                var n = this.renderer.resolution;
                                this.renderer.gl.scissor(r.x * n, (i.root ? i.size.height - r.y - r.height : r.y) * n, r.width * n, r.height * n), this.scissorRenderTarget = i, this.scissorData = t, this.scissor = !0
                            }, t.prototype.popScissorMask = function() {
                                this.scissorRenderTarget = null, this.scissorData = null, this.scissor = !1;
                                var e = this.renderer.gl;
                                e.disable(e.SCISSOR_TEST)
                            }, t
                        }(l.default);
                    i.default = h
                }, {
                    "../filters/spriteMask/SpriteMaskFilter": 89,
                    "./WebGLManager": 93
                }],
                92: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = e("./WebGLManager"),
                        a = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(s),
                        l = function(e) {
                            function t(i) {
                                r(this, t);
                                var o = n(this, e.call(this, i));
                                return o.stencilMaskStack = null, o
                            }
                            return o(t, e), t.prototype.setMaskStack = function(e) {
                                this.stencilMaskStack = e;
                                var t = this.renderer.gl;
                                0 === e.length ? t.disable(t.STENCIL_TEST) : t.enable(t.STENCIL_TEST)
                            }, t.prototype.pushStencil = function(e) {
                                this.renderer.setObjectRenderer(this.renderer.plugins.graphics), this.renderer._activeRenderTarget.attachStencilBuffer();
                                var t = this.renderer.gl,
                                    i = this.stencilMaskStack.length;
                                0 === i && t.enable(t.STENCIL_TEST), this.stencilMaskStack.push(e), t.colorMask(!1, !1, !1, !1), t.stencilFunc(t.EQUAL, i, this._getBitwiseMask()), t.stencilOp(t.KEEP, t.KEEP, t.INCR), this.renderer.plugins.graphics.render(e), this._useCurrent()
                            }, t.prototype.popStencil = function() {
                                this.renderer.setObjectRenderer(this.renderer.plugins.graphics);
                                var e = this.renderer.gl,
                                    t = this.stencilMaskStack.pop();
                                0 === this.stencilMaskStack.length ? (e.disable(e.STENCIL_TEST), e.clear(e.STENCIL_BUFFER_BIT), e.clearStencil(0)) : (e.colorMask(!1, !1, !1, !1), e.stencilOp(e.KEEP, e.KEEP, e.DECR), this.renderer.plugins.graphics.render(t), this._useCurrent())
                            }, t.prototype._useCurrent = function() {
                                var e = this.renderer.gl;
                                e.colorMask(!0, !0, !0, !0), e.stencilFunc(e.EQUAL, this.stencilMaskStack.length, this._getBitwiseMask()), e.stencilOp(e.KEEP, e.KEEP, e.KEEP)
                            }, t.prototype._getBitwiseMask = function() {
                                return (1 << this.stencilMaskStack.length) - 1
                            }, t.prototype.destroy = function() {
                                a.default.prototype.destroy.call(this), this.stencilMaskStack.stencilStack = null
                            }, t
                        }(a.default);
                    i.default = l
                }, {
                    "./WebGLManager": 93
                }],
                93: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                        function e(t) {
                            r(this, e), this.renderer = t, this.renderer.on("context", this.onContextChange, this)
                        }
                        return e.prototype.onContextChange = function() {}, e.prototype.destroy = function() {
                            this.renderer.off("context", this.onContextChange, this), this.renderer = null
                        }, e
                    }();
                    i.default = n
                }, {}],
                94: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = e("../managers/WebGLManager"),
                        a = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(s),
                        l = function(e) {
                            function t() {
                                return r(this, t), n(this, e.apply(this, arguments))
                            }
                            return o(t, e), t.prototype.start = function() {}, t.prototype.stop = function() {
                                this.flush()
                            }, t.prototype.flush = function() {}, t.prototype.render = function(e) {}, t
                        }(a.default);
                    i.default = l
                }, {
                    "../managers/WebGLManager": 93
                }],
                95: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var o = e("pixi-gl-core"),
                        s = r(o),
                        a = e("../../../utils/createIndicesForQuads"),
                        l = r(a),
                        u = function() {
                            function e(t, i) {
                                n(this, e), this.gl = t, this.vertices = new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1]), this.uvs = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), this.interleaved = new Float32Array(16);
                                for (var r = 0; r < 4; r++) this.interleaved[4 * r] = this.vertices[2 * r], this.interleaved[4 * r + 1] = this.vertices[2 * r + 1], this.interleaved[4 * r + 2] = this.uvs[2 * r], this.interleaved[4 * r + 3] = this.uvs[2 * r + 1];
                                this.indices = (0, l.default)(1), this.vertexBuffer = s.default.GLBuffer.createVertexBuffer(t, this.interleaved, t.STATIC_DRAW), this.indexBuffer = s.default.GLBuffer.createIndexBuffer(t, this.indices, t.STATIC_DRAW), this.vao = new s.default.VertexArrayObject(t, i)
                            }
                            return e.prototype.initVao = function(e) {
                                this.vao.clear().addIndex(this.indexBuffer).addAttribute(this.vertexBuffer, e.attributes.aVertexPosition, this.gl.FLOAT, !1, 16, 0).addAttribute(this.vertexBuffer, e.attributes.aTextureCoord, this.gl.FLOAT, !1, 16, 8)
                            }, e.prototype.map = function(e, t) {
                                var i = 0,
                                    r = 0;
                                return this.uvs[0] = i, this.uvs[1] = r, this.uvs[2] = i + t.width / e.width, this.uvs[3] = r, this.uvs[4] = i + t.width / e.width, this.uvs[5] = r + t.height / e.height, this.uvs[6] = i, this.uvs[7] = r + t.height / e.height, i = t.x, r = t.y, this.vertices[0] = i, this.vertices[1] = r, this.vertices[2] = i + t.width, this.vertices[3] = r, this.vertices[4] = i + t.width, this.vertices[5] = r + t.height, this.vertices[6] = i, this.vertices[7] = r + t.height, this
                            }, e.prototype.upload = function() {
                                for (var e = 0; e < 4; e++) this.interleaved[4 * e] = this.vertices[2 * e], this.interleaved[4 * e + 1] = this.vertices[2 * e + 1], this.interleaved[4 * e + 2] = this.uvs[2 * e], this.interleaved[4 * e + 3] = this.uvs[2 * e + 1];
                                return this.vertexBuffer.upload(this.interleaved), this
                            }, e.prototype.destroy = function() {
                                var e = this.gl;
                                e.deleteBuffer(this.vertexBuffer), e.deleteBuffer(this.indexBuffer)
                            }, e
                        }();
                    i.default = u
                }, {
                    "../../../utils/createIndicesForQuads": 123,
                    "pixi-gl-core": 15
                }],
                96: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../../../math"),
                        o = e("../../../const"),
                        s = e("../../../settings"),
                        a = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(s),
                        l = e("pixi-gl-core"),
                        u = function() {
                            function e(t, i, s, u, c, h) {
                                r(this, e), this.gl = t, this.frameBuffer = null, this.texture = null, this.clearColor = [0, 0, 0, 0], this.size = new n.Rectangle(0, 0, 1, 1), this.resolution = c || a.default.RESOLUTION, this.projectionMatrix = new n.Matrix, this.transform = null, this.frame = null, this.defaultFrame = new n.Rectangle, this.destinationFrame = null, this.sourceFrame = null, this.stencilBuffer = null, this.stencilMaskStack = [], this.filterData = null, this.filterPoolKey = "", this.scaleMode = void 0 !== u ? u : a.default.SCALE_MODE, this.root = h || !1, this.root ? (this.frameBuffer = new l.GLFramebuffer(t, 100, 100), this.frameBuffer.framebuffer = null) : (this.frameBuffer = l.GLFramebuffer.createRGBA(t, 100, 100), this.scaleMode === o.SCALE_MODES.NEAREST ? this.frameBuffer.texture.enableNearestScaling() : this.frameBuffer.texture.enableLinearScaling(), this.texture = this.frameBuffer.texture), this.setFrame(), this.resize(i, s)
                            }
                            return e.prototype.clear = function(e) {
                                var t = e || this.clearColor;
                                this.frameBuffer.clear(t[0], t[1], t[2], t[3])
                            }, e.prototype.attachStencilBuffer = function() {
                                this.root || this.frameBuffer.enableStencil()
                            }, e.prototype.setFrame = function(e, t) {
                                this.destinationFrame = e || this.destinationFrame || this.defaultFrame, this.sourceFrame = t || this.sourceFrame || this.destinationFrame
                            }, e.prototype.activate = function() {
                                var e = this.gl;
                                this.frameBuffer.bind(), this.calculateProjection(this.destinationFrame, this.sourceFrame), this.transform && this.projectionMatrix.append(this.transform), this.destinationFrame !== this.sourceFrame ? (e.enable(e.SCISSOR_TEST), e.scissor(0 | this.destinationFrame.x, 0 | this.destinationFrame.y, this.destinationFrame.width * this.resolution | 0, this.destinationFrame.height * this.resolution | 0)) : e.disable(e.SCISSOR_TEST), e.viewport(0 | this.destinationFrame.x, 0 | this.destinationFrame.y, this.destinationFrame.width * this.resolution | 0, this.destinationFrame.height * this.resolution | 0)
                            }, e.prototype.calculateProjection = function(e, t) {
                                var i = this.projectionMatrix;
                                t = t || e, i.identity(), this.root ? (i.a = 1 / e.width * 2, i.d = -1 / e.height * 2, i.tx = -1 - t.x * i.a, i.ty = 1 - t.y * i.d) : (i.a = 1 / e.width * 2, i.d = 1 / e.height * 2, i.tx = -1 - t.x * i.a, i.ty = -1 - t.y * i.d)
                            }, e.prototype.resize = function(e, t) {
                                if (e |= 0, t |= 0, this.size.width !== e || this.size.height !== t) {
                                    this.size.width = e, this.size.height = t, this.defaultFrame.width = e, this.defaultFrame.height = t, this.frameBuffer.resize(e * this.resolution, t * this.resolution);
                                    var i = this.frame || this.size;
                                    this.calculateProjection(i)
                                }
                            }, e.prototype.destroy = function() {
                                this.frameBuffer.stencil && this.gl.deleteRenderbuffer(this.frameBuffer.stencil), this.frameBuffer.destroy(), this.frameBuffer = null, this.texture = null
                            }, e
                        }();
                    i.default = u
                }, {
                    "../../../const": 46,
                    "../../../math": 70,
                    "../../../settings": 101,
                    "pixi-gl-core": 15
                }],
                97: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        var i = !t;
                        if (0 === e) throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");
                        if (i) {
                            var r = document.createElement("canvas");
                            r.width = 1, r.height = 1, t = s.default.createContext(r)
                        }
                        for (var o = t.createShader(t.FRAGMENT_SHADER);;) {
                            var l = a.replace(/%forloop%/gi, n(e));
                            if (t.shaderSource(o, l), t.compileShader(o), t.getShaderParameter(o, t.COMPILE_STATUS)) break;
                            e = e / 2 | 0
                        }
                        return i && t.getExtension("WEBGL_lose_context") && t.getExtension("WEBGL_lose_context").loseContext(), e
                    }

                    function n(e) {
                        for (var t = "", i = 0; i < e; ++i) i > 0 && (t += "\nelse "), i < e - 1 && (t += "if(test == " + i + ".0){}");
                        return t
                    }
                    i.__esModule = !0, i.default = r;
                    var o = e("pixi-gl-core"),
                        s = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(o),
                        a = ["precision mediump float;", "void main(void){", "float test = 0.1;", "%forloop%", "gl_FragColor = vec4(0.0);", "}"].join("\n")
                }, {
                    "pixi-gl-core": 15
                }],
                98: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [];
                        return t[n.BLEND_MODES.NORMAL] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.ADD] = [e.ONE, e.DST_ALPHA], t[n.BLEND_MODES.MULTIPLY] = [e.DST_COLOR, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.SCREEN] = [e.ONE, e.ONE_MINUS_SRC_COLOR], t[n.BLEND_MODES.OVERLAY] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.DARKEN] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.LIGHTEN] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.COLOR_DODGE] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.COLOR_BURN] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.HARD_LIGHT] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.SOFT_LIGHT] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.DIFFERENCE] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.EXCLUSION] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.HUE] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.SATURATION] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.COLOR] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.LUMINOSITY] = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.NORMAL_NPM] = [e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA], t[n.BLEND_MODES.ADD_NPM] = [e.SRC_ALPHA, e.DST_ALPHA, e.ONE, e.DST_ALPHA], t[n.BLEND_MODES.SCREEN_NPM] = [e.SRC_ALPHA, e.ONE_MINUS_SRC_COLOR, e.ONE, e.ONE_MINUS_SRC_COLOR], t
                    }
                    i.__esModule = !0, i.default = r;
                    var n = e("../../../const")
                }, {
                    "../../../const": 46
                }],
                99: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
                        return t[n.DRAW_MODES.POINTS] = e.POINTS, t[n.DRAW_MODES.LINES] = e.LINES, t[n.DRAW_MODES.LINE_LOOP] = e.LINE_LOOP, t[n.DRAW_MODES.LINE_STRIP] = e.LINE_STRIP, t[n.DRAW_MODES.TRIANGLES] = e.TRIANGLES, t[n.DRAW_MODES.TRIANGLE_STRIP] = e.TRIANGLE_STRIP, t[n.DRAW_MODES.TRIANGLE_FAN] = e.TRIANGLE_FAN, t
                    }
                    i.__esModule = !0, i.default = r;
                    var n = e("../../../const")
                }, {
                    "../../../const": 46
                }],
                100: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        e.getContextAttributes().stencil
                    }
                    i.__esModule = !0, i.default = r
                }, {}],
                101: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0;
                    var n = e("./utils/maxRecommendedTextures"),
                        o = r(n),
                        s = e("./utils/canUploadSameBuffer"),
                        a = r(s);
                    i.default = {
                        TARGET_FPMS: .06,
                        MIPMAP_TEXTURES: !0,
                        RESOLUTION: 1,
                        FILTER_RESOLUTION: 1,
                        SPRITE_MAX_TEXTURES: (0, o.default)(32),
                        SPRITE_BATCH_SIZE: 4096,
                        RETINA_PREFIX: /@([0-9\.]+)x/,
                        RENDER_OPTIONS: {
                            view: null,
                            antialias: !1,
                            forceFXAA: !1,
                            autoResize: !1,
                            transparent: !1,
                            backgroundColor: 0,
                            clearBeforeRender: !0,
                            preserveDrawingBuffer: !1,
                            roundPixels: !1,
                            width: 800,
                            height: 600,
                            legacy: !1
                        },
                        TRANSFORM_MODE: 0,
                        GC_MODE: 0,
                        GC_MAX_IDLE: 3600,
                        GC_MAX_CHECK_COUNT: 600,
                        WRAP_MODE: 0,
                        SCALE_MODE: 0,
                        PRECISION_VERTEX: "highp",
                        PRECISION_FRAGMENT: "mediump",
                        CAN_UPLOAD_SAME_BUFFER: (0, a.default)(),
                        MESH_CANVAS_PADDING: 0
                    }
                }, {
                    "./utils/canUploadSameBuffer": 122,
                    "./utils/maxRecommendedTextures": 127
                }],
                102: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        l = e("../math"),
                        u = e("../utils"),
                        c = e("../const"),
                        h = e("../textures/Texture"),
                        d = r(h),
                        p = e("../display/Container"),
                        f = r(p),
                        _ = new l.Point,
                        m = function(e) {
                            function t(i) {
                                n(this, t);
                                var r = o(this, e.call(this));
                                return r._anchor = new l.ObservablePoint(r._onAnchorUpdate, r, i ? i.defaultAnchor.x : 0, i ? i.defaultAnchor.y : 0), r._texture = null, r._width = 0, r._height = 0, r._tint = null, r._tintRGB = null, r.tint = 16777215, r.blendMode = c.BLEND_MODES.NORMAL, r.shader = null, r.cachedTint = 16777215, r.texture = i || d.default.EMPTY, r.vertexData = new Float32Array(8), r.vertexTrimmedData = null, r._transformID = -1, r._textureID = -1, r._transformTrimmedID = -1, r._textureTrimmedID = -1, r.pluginName = "sprite", r
                            }
                            return s(t, e), t.prototype._onTextureUpdate = function() {
                                this._textureID = -1, this._textureTrimmedID = -1, this.cachedTint = 16777215, this._width && (this.scale.x = (0, u.sign)(this.scale.x) * this._width / this._texture.orig.width), this._height && (this.scale.y = (0, u.sign)(this.scale.y) * this._height / this._texture.orig.height)
                            }, t.prototype._onAnchorUpdate = function() {
                                this._transformID = -1, this._transformTrimmedID = -1
                            }, t.prototype.calculateVertices = function() {
                                if (this._transformID !== this.transform._worldID || this._textureID !== this._texture._updateID) {
                                    this._transformID = this.transform._worldID, this._textureID = this._texture._updateID;
                                    var e = this._texture,
                                        t = this.transform.worldTransform,
                                        i = t.a,
                                        r = t.b,
                                        n = t.c,
                                        o = t.d,
                                        s = t.tx,
                                        a = t.ty,
                                        l = this.vertexData,
                                        u = e.trim,
                                        c = e.orig,
                                        h = this._anchor,
                                        d = 0,
                                        p = 0,
                                        f = 0,
                                        _ = 0;
                                    u ? (p = u.x - h._x * c.width, d = p + u.width, _ = u.y - h._y * c.height, f = _ + u.height) : (p = -h._x * c.width, d = p + c.width, _ = -h._y * c.height, f = _ + c.height), l[0] = i * p + n * _ + s, l[1] = o * _ + r * p + a, l[2] = i * d + n * _ + s, l[3] = o * _ + r * d + a, l[4] = i * d + n * f + s, l[5] = o * f + r * d + a, l[6] = i * p + n * f + s, l[7] = o * f + r * p + a
                                }
                            }, t.prototype.calculateTrimmedVertices = function() {
                                if (this.vertexTrimmedData) {
                                    if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID) return
                                } else this.vertexTrimmedData = new Float32Array(8);
                                this._transformTrimmedID = this.transform._worldID, this._textureTrimmedID = this._texture._updateID;
                                var e = this._texture,
                                    t = this.vertexTrimmedData,
                                    i = e.orig,
                                    r = this._anchor,
                                    n = this.transform.worldTransform,
                                    o = n.a,
                                    s = n.b,
                                    a = n.c,
                                    l = n.d,
                                    u = n.tx,
                                    c = n.ty,
                                    h = -r._x * i.width,
                                    d = h + i.width,
                                    p = -r._y * i.height,
                                    f = p + i.height;
                                t[0] = o * h + a * p + u, t[1] = l * p + s * h + c, t[2] = o * d + a * p + u, t[3] = l * p + s * d + c, t[4] = o * d + a * f + u, t[5] = l * f + s * d + c, t[6] = o * h + a * f + u, t[7] = l * f + s * h + c
                            }, t.prototype._renderWebGL = function(e) {
                                this.calculateVertices(), e.setObjectRenderer(e.plugins[this.pluginName]), e.plugins[this.pluginName].render(this)
                            }, t.prototype._renderCanvas = function(e) {
                                e.plugins[this.pluginName].render(this)
                            }, t.prototype._calculateBounds = function() {
                                var e = this._texture.trim,
                                    t = this._texture.orig;
                                !e || e.width === t.width && e.height === t.height ? (this.calculateVertices(), this._bounds.addQuad(this.vertexData)) : (this.calculateTrimmedVertices(), this._bounds.addQuad(this.vertexTrimmedData))
                            }, t.prototype.getLocalBounds = function(t) {
                                return 0 === this.children.length ? (this._bounds.minX = this._texture.orig.width * -this._anchor._x, this._bounds.minY = this._texture.orig.height * -this._anchor._y, this._bounds.maxX = this._texture.orig.width * (1 - this._anchor._x), this._bounds.maxY = this._texture.orig.height * (1 - this._anchor._y), t || (this._localBoundsRect || (this._localBoundsRect = new l.Rectangle), t = this._localBoundsRect), this._bounds.getRectangle(t)) : e.prototype.getLocalBounds.call(this, t)
                            }, t.prototype.containsPoint = function(e) {
                                this.worldTransform.applyInverse(e, _);
                                var t = this._texture.orig.width,
                                    i = this._texture.orig.height,
                                    r = -t * this.anchor.x,
                                    n = 0;
                                return _.x >= r && _.x < r + t && (n = -i * this.anchor.y, _.y >= n && _.y < n + i)
                            }, t.prototype.destroy = function(t) {
                                if (e.prototype.destroy.call(this, t), this._texture.off("update", this._onTextureUpdate, this), this._anchor = null, "boolean" == typeof t ? t : t && t.texture) {
                                    var i = "boolean" == typeof t ? t : t && t.baseTexture;
                                    this._texture.destroy(!!i)
                                }
                                this._texture = null, this.shader = null
                            }, t.from = function(e) {
                                return new t(d.default.from(e))
                            }, t.fromFrame = function(e) {
                                var i = u.TextureCache[e];
                                if (!i) throw new Error('The frameId "' + e + '" does not exist in the texture cache');
                                return new t(i)
                            }, t.fromImage = function(e, i, r) {
                                return new t(d.default.fromImage(e, i, r))
                            }, a(t, [{
                                key: "width",
                                get: function() {
                                    return Math.abs(this.scale.x) * this._texture.orig.width
                                },
                                set: function(e) {
                                    var t = (0, u.sign)(this.scale.x) || 1;
                                    this.scale.x = t * e / this._texture.orig.width, this._width = e
                                }
                            }, {
                                key: "height",
                                get: function() {
                                    return Math.abs(this.scale.y) * this._texture.orig.height
                                },
                                set: function(e) {
                                    var t = (0, u.sign)(this.scale.y) || 1;
                                    this.scale.y = t * e / this._texture.orig.height, this._height = e
                                }
                            }, {
                                key: "anchor",
                                get: function() {
                                    return this._anchor
                                },
                                set: function(e) {
                                    this._anchor.copy(e)
                                }
                            }, {
                                key: "tint",
                                get: function() {
                                    return this._tint
                                },
                                set: function(e) {
                                    this._tint = e, this._tintRGB = (e >> 16) + (65280 & e) + ((255 & e) << 16)
                                }
                            }, {
                                key: "texture",
                                get: function() {
                                    return this._texture
                                },
                                set: function(e) {
                                    this._texture !== e && (this._texture = e || d.default.EMPTY, this.cachedTint = 16777215, this._textureID = -1, this._textureTrimmedID = -1, e && (e.baseTexture.hasLoaded ? this._onTextureUpdate() : e.once("update", this._onTextureUpdate, this)))
                                }
                            }]), t
                        }(f.default);
                    i.default = m
                }, {
                    "../const": 46,
                    "../display/Container": 48,
                    "../math": 70,
                    "../textures/Texture": 115,
                    "../utils": 125
                }],
                103: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var o = e("../../renderers/canvas/CanvasRenderer"),
                        s = r(o),
                        a = e("../../const"),
                        l = e("../../math"),
                        u = e("./CanvasTinter"),
                        c = r(u),
                        h = new l.Matrix,
                        d = function() {
                            function e(t) {
                                n(this, e), this.renderer = t
                            }
                            return e.prototype.render = function(e) {
                                var t = e._texture,
                                    i = this.renderer,
                                    r = t._frame.width,
                                    n = t._frame.height,
                                    o = e.transform.worldTransform,
                                    s = 0,
                                    u = 0;
                                if (!(t.orig.width <= 0 || t.orig.height <= 0) && t.baseTexture.source && (i.setBlendMode(e.blendMode), t.valid)) {
                                    i.context.globalAlpha = e.worldAlpha;
                                    var d = t.baseTexture.scaleMode === a.SCALE_MODES.LINEAR;
                                    i.smoothProperty && i.context[i.smoothProperty] !== d && (i.context[i.smoothProperty] = d), t.trim ? (s = t.trim.width / 2 + t.trim.x - e.anchor.x * t.orig.width, u = t.trim.height / 2 + t.trim.y - e.anchor.y * t.orig.height) : (s = (.5 - e.anchor.x) * t.orig.width, u = (.5 - e.anchor.y) * t.orig.height), t.rotate && (o.copy(h), o = h, l.GroupD8.matrixAppendRotationInv(o, t.rotate, s, u), s = 0, u = 0), s -= r / 2, u -= n / 2, i.roundPixels ? (i.context.setTransform(o.a, o.b, o.c, o.d, o.tx * i.resolution | 0, o.ty * i.resolution | 0), s |= 0, u |= 0) : i.context.setTransform(o.a, o.b, o.c, o.d, o.tx * i.resolution, o.ty * i.resolution);
                                    var p = t.baseTexture.resolution;
                                    16777215 !== e.tint ? (e.cachedTint === e.tint && e.tintedTexture.tintId === e._texture._updateID || (e.cachedTint = e.tint, e.tintedTexture = c.default.getTintedTexture(e, e.tint)), i.context.drawImage(e.tintedTexture, 0, 0, r * p, n * p, s * i.resolution, u * i.resolution, r * i.resolution, n * i.resolution)) : i.context.drawImage(t.baseTexture.source, t._frame.x * p, t._frame.y * p, r * p, n * p, s * i.resolution, u * i.resolution, r * i.resolution, n * i.resolution)
                                }
                            }, e.prototype.destroy = function() {
                                this.renderer = null
                            }, e
                        }();
                    i.default = d, s.default.registerPlugin("sprite", d)
                }, {
                    "../../const": 46,
                    "../../math": 70,
                    "../../renderers/canvas/CanvasRenderer": 77,
                    "./CanvasTinter": 104
                }],
                104: [function(e, t, i) {
                    "use strict";
                    i.__esModule = !0;
                    var r = e("../../utils"),
                        n = e("../../renderers/canvas/utils/canUseNewCanvasBlendModes"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = {
                            getTintedTexture: function(e, t) {
                                var i = e._texture;
                                t = s.roundColor(t);
                                var r = "#" + ("00000" + (0 | t).toString(16)).substr(-6);
                                i.tintCache = i.tintCache || {};
                                var n = i.tintCache[r],
                                    o = void 0;
                                if (n) {
                                    if (n.tintId === i._updateID) return i.tintCache[r];
                                    o = i.tintCache[r]
                                } else o = s.canvas || document.createElement("canvas");
                                if (s.tintMethod(i, t, o), o.tintId = i._updateID, s.convertTintToImage) {
                                    var a = new Image;
                                    a.src = o.toDataURL(), i.tintCache[r] = a
                                } else i.tintCache[r] = o, s.canvas = null;
                                return o
                            },
                            tintWithMultiply: function(e, t, i) {
                                var r = i.getContext("2d"),
                                    n = e._frame.clone(),
                                    o = e.baseTexture.resolution;
                                n.x *= o, n.y *= o, n.width *= o, n.height *= o, i.width = Math.ceil(n.width), i.height = Math.ceil(n.height), r.save(), r.fillStyle = "#" + ("00000" + (0 | t).toString(16)).substr(-6), r.fillRect(0, 0, n.width, n.height), r.globalCompositeOperation = "multiply", r.drawImage(e.baseTexture.source, n.x, n.y, n.width, n.height, 0, 0, n.width, n.height), r.globalCompositeOperation = "destination-atop", r.drawImage(e.baseTexture.source, n.x, n.y, n.width, n.height, 0, 0, n.width, n.height), r.restore()
                            },
                            tintWithOverlay: function(e, t, i) {
                                var r = i.getContext("2d"),
                                    n = e._frame.clone(),
                                    o = e.baseTexture.resolution;
                                n.x *= o, n.y *= o, n.width *= o, n.height *= o, i.width = Math.ceil(n.width), i.height = Math.ceil(n.height), r.save(), r.globalCompositeOperation = "copy", r.fillStyle = "#" + ("00000" + (0 | t).toString(16)).substr(-6), r.fillRect(0, 0, n.width, n.height), r.globalCompositeOperation = "destination-atop", r.drawImage(e.baseTexture.source, n.x, n.y, n.width, n.height, 0, 0, n.width, n.height), r.restore()
                            },
                            tintWithPerPixel: function(e, t, i) {
                                var n = i.getContext("2d"),
                                    o = e._frame.clone(),
                                    s = e.baseTexture.resolution;
                                o.x *= s, o.y *= s, o.width *= s, o.height *= s, i.width = Math.ceil(o.width), i.height = Math.ceil(o.height), n.save(), n.globalCompositeOperation = "copy", n.drawImage(e.baseTexture.source, o.x, o.y, o.width, o.height, 0, 0, o.width, o.height), n.restore();
                                for (var a = (0, r.hex2rgb)(t), l = a[0], u = a[1], c = a[2], h = n.getImageData(0, 0, o.width, o.height), d = h.data, p = 0; p < d.length; p += 4) d[p + 0] *= l, d[p + 1] *= u, d[p + 2] *= c;
                                n.putImageData(h, 0, 0)
                            },
                            roundColor: function(e) {
                                var t = s.cacheStepsPerColorChannel,
                                    i = (0, r.hex2rgb)(e);
                                return i[0] = Math.min(255, i[0] / t * t), i[1] = Math.min(255, i[1] / t * t), i[2] = Math.min(255, i[2] / t * t), (0, r.rgb2hex)(i)
                            },
                            cacheStepsPerColorChannel: 8,
                            convertTintToImage: !1,
                            canUseMultiply: (0, o.default)(),
                            tintMethod: 0
                        };
                    s.tintMethod = s.canUseMultiply ? s.tintWithMultiply : s.tintWithPerPixel, i.default = s
                }, {
                    "../../renderers/canvas/utils/canUseNewCanvasBlendModes": 80,
                    "../../utils": 125
                }],
                105: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                        function e(t) {
                            r(this, e), this.vertices = new ArrayBuffer(t), this.float32View = new Float32Array(this.vertices), this.uint32View = new Uint32Array(this.vertices)
                        }
                        return e.prototype.destroy = function() {
                            this.vertices = null, this.positions = null, this.uvs = null, this.colors = null
                        }, e
                    }();
                    i.default = n
                }, {}],
                106: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("../../renderers/webgl/utils/ObjectRenderer"),
                        l = r(a),
                        u = e("../../renderers/webgl/WebGLRenderer"),
                        c = r(u),
                        h = e("../../utils/createIndicesForQuads"),
                        d = r(h),
                        p = e("./generateMultiTextureShader"),
                        f = r(p),
                        _ = e("../../renderers/webgl/utils/checkMaxIfStatmentsInShader"),
                        m = r(_),
                        g = e("./BatchBuffer"),
                        v = r(g),
                        y = e("../../settings"),
                        b = r(y),
                        x = e("../../utils"),
                        T = e("pixi-gl-core"),
                        E = r(T),
                        S = e("bit-twiddle"),
                        P = r(S),
                        A = 0,
                        C = 0,
                        M = function(e) {
                            function t(i) {
                                n(this, t);
                                var r = o(this, e.call(this, i));
                                r.vertSize = 5, r.vertByteSize = 4 * r.vertSize, r.size = b.default.SPRITE_BATCH_SIZE, r.buffers = [];
                                for (var s = 1; s <= P.default.nextPow2(r.size); s *= 2) r.buffers.push(new v.default(4 * s * r.vertByteSize));
                                r.indices = (0, d.default)(r.size), r.shader = null, r.currentIndex = 0, r.groups = [];
                                for (var a = 0; a < r.size; a++) r.groups[a] = {
                                    textures: [],
                                    textureCount: 0,
                                    ids: [],
                                    size: 0,
                                    start: 0,
                                    blend: 0
                                };
                                return r.sprites = [], r.vertexBuffers = [], r.vaos = [], r.vaoMax = 2, r.vertexCount = 0, r.renderer.on("prerender", r.onPrerender, r), r
                            }
                            return s(t, e), t.prototype.onContextChange = function() {
                                var e = this.renderer.gl;
                                this.renderer.legacy ? this.MAX_TEXTURES = 1 : (this.MAX_TEXTURES = Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), b.default.SPRITE_MAX_TEXTURES), this.MAX_TEXTURES = (0, m.default)(this.MAX_TEXTURES, e)), this.shader = (0, f.default)(e, this.MAX_TEXTURES), this.indexBuffer = E.default.GLBuffer.createIndexBuffer(e, this.indices, e.STATIC_DRAW), this.renderer.bindVao(null);
                                for (var t = this.shader.attributes, i = 0; i < this.vaoMax; i++) {
                                    var r = this.vertexBuffers[i] = E.default.GLBuffer.createVertexBuffer(e, null, e.STREAM_DRAW),
                                        n = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(r, t.aVertexPosition, e.FLOAT, !1, this.vertByteSize, 0).addAttribute(r, t.aTextureCoord, e.UNSIGNED_SHORT, !0, this.vertByteSize, 8).addAttribute(r, t.aColor, e.UNSIGNED_BYTE, !0, this.vertByteSize, 12);
                                    t.aTextureId && n.addAttribute(r, t.aTextureId, e.FLOAT, !1, this.vertByteSize, 16), this.vaos[i] = n
                                }
                                this.vao = this.vaos[0], this.currentBlendMode = 99999, this.boundTextures = new Array(this.MAX_TEXTURES)
                            }, t.prototype.onPrerender = function() {
                                this.vertexCount = 0
                            }, t.prototype.render = function(e) {
                                this.currentIndex >= this.size && this.flush(), e._texture._uvs && (this.sprites[this.currentIndex++] = e)
                            }, t.prototype.flush = function() {
                                if (0 !== this.currentIndex) {
                                    var e = this.renderer.gl,
                                        t = this.MAX_TEXTURES,
                                        i = P.default.nextPow2(this.currentIndex),
                                        r = P.default.log2(i),
                                        n = this.buffers[r],
                                        o = this.sprites,
                                        s = this.groups,
                                        a = n.float32View,
                                        l = n.uint32View,
                                        u = this.boundTextures,
                                        c = this.renderer.boundTextures,
                                        h = this.renderer.textureGC.count,
                                        d = 0,
                                        p = void 0,
                                        f = void 0,
                                        _ = 1,
                                        m = 0,
                                        g = s[0],
                                        v = void 0,
                                        y = void 0,
                                        T = x.premultiplyBlendMode[o[0]._texture.baseTexture.premultipliedAlpha ? 1 : 0][o[0].blendMode];
                                    g.textureCount = 0, g.start = 0, g.blend = T, A++;
                                    var S = void 0;
                                    for (S = 0; S < t; ++S) {
                                        var M = c[S];
                                        M._enabled !== A ? (u[S] = M, M._virtalBoundId = S, M._enabled = A) : u[S] = this.renderer.emptyTextures[S]
                                    }
                                    for (A++, S = 0; S < this.currentIndex; ++S) {
                                        var R = o[S];
                                        o[S] = null, p = R._texture.baseTexture;
                                        var O = x.premultiplyBlendMode[Number(p.premultipliedAlpha)][R.blendMode];
                                        if (T !== O && (T = O, f = null, m = t, A++), f !== p && (f = p, p._enabled !== A)) {
                                            if (m === t && (A++, g.size = S - g.start, m = 0, g = s[_++], g.blend = T, g.textureCount = 0, g.start = S), p.touched = h, -1 === p._virtalBoundId)
                                                for (var w = 0; w < t; ++w) {
                                                    var I = (w + C) % t,
                                                        D = u[I];
                                                    if (D._enabled !== A) {
                                                        C++, D._virtalBoundId = -1, p._virtalBoundId = I, u[I] = p;
                                                        break
                                                    }
                                                }
                                            p._enabled = A, g.textureCount++, g.ids[m] = p._virtalBoundId, g.textures[m++] = p
                                        }
                                        if (v = R.vertexData, y = R._texture._uvs.uvsUint32, this.renderer.roundPixels) {
                                            var L = this.renderer.resolution;
                                            a[d] = (v[0] * L | 0) / L, a[d + 1] = (v[1] * L | 0) / L, a[d + 5] = (v[2] * L | 0) / L, a[d + 6] = (v[3] * L | 0) / L, a[d + 10] = (v[4] * L | 0) / L, a[d + 11] = (v[5] * L | 0) / L, a[d + 15] = (v[6] * L | 0) / L, a[d + 16] = (v[7] * L | 0) / L
                                        } else a[d] = v[0], a[d + 1] = v[1], a[d + 5] = v[2], a[d + 6] = v[3], a[d + 10] = v[4], a[d + 11] = v[5], a[d + 15] = v[6], a[d + 16] = v[7];
                                        l[d + 2] = y[0], l[d + 7] = y[1], l[d + 12] = y[2], l[d + 17] = y[3];
                                        var B = Math.min(R.worldAlpha, 1),
                                            F = B < 1 && p.premultipliedAlpha ? (0, x.premultiplyTint)(R._tintRGB, B) : R._tintRGB + (255 * B << 24);
                                        l[d + 3] = l[d + 8] = l[d + 13] = l[d + 18] = F, a[d + 4] = a[d + 9] = a[d + 14] = a[d + 19] = p._virtalBoundId, d += 20
                                    }
                                    if (g.size = S - g.start, b.default.CAN_UPLOAD_SAME_BUFFER) this.vertexBuffers[this.vertexCount].upload(n.vertices, 0, !0);
                                    else {
                                        if (this.vaoMax <= this.vertexCount) {
                                            this.vaoMax++;
                                            var N = this.shader.attributes,
                                                V = this.vertexBuffers[this.vertexCount] = E.default.GLBuffer.createVertexBuffer(e, null, e.STREAM_DRAW),
                                                k = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(V, N.aVertexPosition, e.FLOAT, !1, this.vertByteSize, 0).addAttribute(V, N.aTextureCoord, e.UNSIGNED_SHORT, !0, this.vertByteSize, 8).addAttribute(V, N.aColor, e.UNSIGNED_BYTE, !0, this.vertByteSize, 12);
                                            N.aTextureId && k.addAttribute(V, N.aTextureId, e.FLOAT, !1, this.vertByteSize, 16), this.vaos[this.vertexCount] = k
                                        }
                                        this.renderer.bindVao(this.vaos[this.vertexCount]), this.vertexBuffers[this.vertexCount].upload(n.vertices, 0, !1), this.vertexCount++
                                    }
                                    for (S = 0; S < t; ++S) c[S]._virtalBoundId = -1;
                                    for (S = 0; S < _; ++S) {
                                        for (var U = s[S], G = U.textureCount, z = 0; z < G; z++) f = U.textures[z], c[U.ids[z]] !== f && this.renderer.bindTexture(f, U.ids[z], !0), f._virtalBoundId = -1;
                                        this.renderer.state.setBlendMode(U.blend), e.drawElements(e.TRIANGLES, 6 * U.size, e.UNSIGNED_SHORT, 6 * U.start * 2)
                                    }
                                    this.currentIndex = 0
                                }
                            }, t.prototype.start = function() {
                                this.renderer.bindShader(this.shader), b.default.CAN_UPLOAD_SAME_BUFFER && (this.renderer.bindVao(this.vaos[this.vertexCount]), this.vertexBuffers[this.vertexCount].bind())
                            }, t.prototype.stop = function() {
                                this.flush()
                            }, t.prototype.destroy = function() {
                                for (var t = 0; t < this.vaoMax; t++) this.vertexBuffers[t] && this.vertexBuffers[t].destroy(), this.vaos[t] && this.vaos[t].destroy();
                                this.indexBuffer && this.indexBuffer.destroy(), this.renderer.off("prerender", this.onPrerender, this), e.prototype.destroy.call(this), this.shader && (this.shader.destroy(), this.shader = null), this.vertexBuffers = null, this.vaos = null, this.indexBuffer = null, this.indices = null, this.sprites = null;
                                for (var i = 0; i < this.buffers.length; ++i) this.buffers[i].destroy()
                            }, t
                        }(l.default);
                    i.default = M, c.default.registerPlugin("sprite", M)
                }, {
                    "../../renderers/webgl/WebGLRenderer": 84,
                    "../../renderers/webgl/utils/ObjectRenderer": 94,
                    "../../renderers/webgl/utils/checkMaxIfStatmentsInShader": 97,
                    "../../settings": 101,
                    "../../utils": 125,
                    "../../utils/createIndicesForQuads": 123,
                    "./BatchBuffer": 105,
                    "./generateMultiTextureShader": 107,
                    "bit-twiddle": 1,
                    "pixi-gl-core": 15
                }],
                107: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        var i = a;
                        i = i.replace(/%count%/gi, t), i = i.replace(/%forloop%/gi, n(t));
                        for (var r = new s.default(e, "precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vTextureId = aTextureId;\n    vColor = aColor;\n}\n", i), o = [], l = 0; l < t; l++) o[l] = l;
                        return r.bind(), r.uniforms.uSamplers = o, r
                    }

                    function n(e) {
                        var t = "";
                        t += "\n", t += "\n";
                        for (var i = 0; i < e; i++) i > 0 && (t += "\nelse "), i < e - 1 && (t += "if(textureId == " + i + ".0)"), t += "\n{", t += "\n\tcolor = texture2D(uSamplers[" + i + "], vTextureCoord);", t += "\n}";
                        return t += "\n", t += "\n"
                    }
                    i.__esModule = !0, i.default = r;
                    var o = e("../../Shader"),
                        s = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(o),
                        a = (e("path"), ["varying vec2 vTextureCoord;", "varying vec4 vColor;", "varying float vTextureId;", "uniform sampler2D uSamplers[%count%];", "void main(void){", "vec4 color;", "float textureId = floor(vTextureId+0.5);", "%forloop%", "gl_FragColor = color * vColor;", "}"].join("\n"))
                }, {
                    "../../Shader": 44,
                    path: 8
                }],
                108: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        l = e("../sprites/Sprite"),
                        u = r(l),
                        c = e("../textures/Texture"),
                        h = r(c),
                        d = e("../math"),
                        p = e("../utils"),
                        f = e("../const"),
                        _ = e("../settings"),
                        m = r(_),
                        g = e("./TextStyle"),
                        v = r(g),
                        y = e("./TextMetrics"),
                        b = r(y),
                        x = e("../utils/trimCanvas"),
                        T = r(x),
                        E = {
                            texture: !0,
                            children: !1,
                            baseTexture: !0
                        },
                        S = function(e) {
                            function t(i, r, s) {
                                n(this, t), s = s || document.createElement("canvas"), s.width = 3, s.height = 3;
                                var a = h.default.fromCanvas(s, m.default.SCALE_MODE, "text");
                                a.orig = new d.Rectangle, a.trim = new d.Rectangle;
                                var l = o(this, e.call(this, a));
                                return h.default.addToCache(l._texture, l._texture.baseTexture.textureCacheIds[0]), l.canvas = s, l.context = l.canvas.getContext("2d"), l.resolution = m.default.RESOLUTION, l._text = null, l._style = null, l._styleListener = null, l._font = "", l.text = i, l.style = r, l.localStyleID = -1, l
                            }
                            return s(t, e), t.prototype.updateText = function(e) {
                                var t = this._style;
                                if (this.localStyleID !== t.styleID && (this.dirty = !0, this.localStyleID = t.styleID), this.dirty || !e) {
                                    this._font = this._style.toFontString();
                                    var i = this.context,
                                        r = b.default.measureText(this._text, this._style, this._style.wordWrap, this.canvas),
                                        n = r.width,
                                        o = r.height,
                                        s = r.lines,
                                        a = r.lineHeight,
                                        l = r.lineWidths,
                                        u = r.maxLineWidth,
                                        c = r.fontProperties;
                                    this.canvas.width = Math.ceil((Math.max(1, n) + 2 * t.padding) * this.resolution), this.canvas.height = Math.ceil((Math.max(1, o) + 2 * t.padding) * this.resolution), i.scale(this.resolution, this.resolution), i.clearRect(0, 0, this.canvas.width, this.canvas.height), i.font = this._font, i.strokeStyle = t.stroke, i.lineWidth = t.strokeThickness, i.textBaseline = t.textBaseline, i.lineJoin = t.lineJoin, i.miterLimit = t.miterLimit;
                                    var h = void 0,
                                        d = void 0;
                                    if (t.dropShadow) {
                                        i.fillStyle = t.dropShadowColor, i.globalAlpha = t.dropShadowAlpha, i.shadowBlur = t.dropShadowBlur, t.dropShadowBlur > 0 && (i.shadowColor = t.dropShadowColor);
                                        for (var p = Math.cos(t.dropShadowAngle) * t.dropShadowDistance, f = Math.sin(t.dropShadowAngle) * t.dropShadowDistance, _ = 0; _ < s.length; _++) h = t.strokeThickness / 2, d = t.strokeThickness / 2 + _ * a + c.ascent, "right" === t.align ? h += u - l[_] : "center" === t.align && (h += (u - l[_]) / 2), t.fill && (this.drawLetterSpacing(s[_], h + p + t.padding, d + f + t.padding), t.stroke && t.strokeThickness && (i.strokeStyle = t.dropShadowColor, this.drawLetterSpacing(s[_], h + p + t.padding, d + f + t.padding, !0), i.strokeStyle = t.stroke))
                                    }
                                    i.shadowBlur = 0, i.globalAlpha = 1, i.fillStyle = this._generateFillStyle(t, s);
                                    for (var m = 0; m < s.length; m++) h = t.strokeThickness / 2, d = t.strokeThickness / 2 + m * a + c.ascent, "right" === t.align ? h += u - l[m] : "center" === t.align && (h += (u - l[m]) / 2), t.stroke && t.strokeThickness && this.drawLetterSpacing(s[m], h + t.padding, d + t.padding, !0), t.fill && this.drawLetterSpacing(s[m], h + t.padding, d + t.padding);
                                    this.updateTexture()
                                }
                            }, t.prototype.drawLetterSpacing = function(e, t, i) {
                                var r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3],
                                    n = this._style,
                                    o = n.letterSpacing;
                                if (0 === o) return void(r ? this.context.strokeText(e, t, i) : this.context.fillText(e, t, i));
                                for (var s = String.prototype.split.call(e, ""), a = t, l = 0, u = ""; l < e.length;) u = s[l++], r ? this.context.strokeText(u, a, i) : this.context.fillText(u, a, i), a += this.context.measureText(u).width + o
                            }, t.prototype.updateTexture = function() {
                                var e = this.canvas;
                                if (this._style.trim) {
                                    var t = (0, T.default)(e);
                                    t.data && (e.width = t.width, e.height = t.height, this.context.putImageData(t.data, 0, 0))
                                }
                                var i = this._texture,
                                    r = this._style,
                                    n = r.trim ? 0 : r.padding,
                                    o = i.baseTexture;
                                o.hasLoaded = !0, o.resolution = this.resolution, o.realWidth = e.width, o.realHeight = e.height, o.width = e.width / this.resolution, o.height = e.height / this.resolution, i.trim.width = i._frame.width = e.width / this.resolution, i.trim.height = i._frame.height = e.height / this.resolution, i.trim.x = -n, i.trim.y = -n, i.orig.width = i._frame.width - 2 * n, i.orig.height = i._frame.height - 2 * n, this._onTextureUpdate(), o.emit("update", o), this.dirty = !1
                            }, t.prototype.renderWebGL = function(t) {
                                this.resolution !== t.resolution && (this.resolution = t.resolution, this.dirty = !0), this.updateText(!0), e.prototype.renderWebGL.call(this, t)
                            }, t.prototype._renderCanvas = function(t) {
                                this.resolution !== t.resolution && (this.resolution = t.resolution, this.dirty = !0), this.updateText(!0), e.prototype._renderCanvas.call(this, t)
                            }, t.prototype.getLocalBounds = function(t) {
                                return this.updateText(!0), e.prototype.getLocalBounds.call(this, t)
                            }, t.prototype._calculateBounds = function() {
                                this.updateText(!0), this.calculateVertices(), this._bounds.addQuad(this.vertexData)
                            }, t.prototype._onStyleChange = function() {
                                this.dirty = !0
                            }, t.prototype._generateFillStyle = function(e, t) {
                                if (!Array.isArray(e.fill)) return e.fill;
                                if (navigator.isCocoonJS) return e.fill[0];
                                var i = void 0,
                                    r = void 0,
                                    n = void 0,
                                    o = void 0,
                                    s = this.canvas.width / this.resolution,
                                    a = this.canvas.height / this.resolution,
                                    l = e.fill.slice(),
                                    u = e.fillGradientStops.slice();
                                if (!u.length)
                                    for (var c = l.length + 1, h = 1; h < c; ++h) u.push(h / c);
                                if (l.unshift(e.fill[0]), u.unshift(0), l.push(e.fill[e.fill.length - 1]), u.push(1), e.fillGradientType === f.TEXT_GRADIENT.LINEAR_VERTICAL) {
                                    i = this.context.createLinearGradient(s / 2, 0, s / 2, a), r = (l.length + 1) * t.length, n = 0;
                                    for (var d = 0; d < t.length; d++) {
                                        n += 1;
                                        for (var p = 0; p < l.length; p++) o = "number" == typeof u[p] ? u[p] / t.length + d / t.length : n / r, i.addColorStop(o, l[p]), n++
                                    }
                                } else {
                                    i = this.context.createLinearGradient(0, a / 2, s, a / 2), r = l.length + 1, n = 1;
                                    for (var _ = 0; _ < l.length; _++) o = "number" == typeof u[_] ? u[_] : n / r, i.addColorStop(o, l[_]), n++
                                }
                                return i
                            }, t.prototype.destroy = function(t) {
                                "boolean" == typeof t && (t = {
                                    children: t
                                }), t = Object.assign({}, E, t), e.prototype.destroy.call(this, t), this.context = null, this.canvas = null, this._style = null
                            }, a(t, [{
                                key: "width",
                                get: function() {
                                    return this.updateText(!0), Math.abs(this.scale.x) * this._texture.orig.width
                                },
                                set: function(e) {
                                    this.updateText(!0);
                                    var t = (0, p.sign)(this.scale.x) || 1;
                                    this.scale.x = t * e / this._texture.orig.width, this._width = e
                                }
                            }, {
                                key: "height",
                                get: function() {
                                    return this.updateText(!0), Math.abs(this.scale.y) * this._texture.orig.height
                                },
                                set: function(e) {
                                    this.updateText(!0);
                                    var t = (0, p.sign)(this.scale.y) || 1;
                                    this.scale.y = t * e / this._texture.orig.height, this._height = e
                                }
                            }, {
                                key: "style",
                                get: function() {
                                    return this._style
                                },
                                set: function(e) {
                                    e = e || {}, e instanceof v.default ? this._style = e : this._style = new v.default(e), this.localStyleID = -1, this.dirty = !0
                                }
                            }, {
                                key: "text",
                                get: function() {
                                    return this._text
                                },
                                set: function(e) {
                                    e = String("" === e || null === e || void 0 === e ? " " : e), this._text !== e && (this._text = e, this.dirty = !0)
                                }
                            }]), t
                        }(u.default);
                    i.default = S
                }, {
                    "../const": 46,
                    "../math": 70,
                    "../settings": 101,
                    "../sprites/Sprite": 102,
                    "../textures/Texture": 115,
                    "../utils": 125,
                    "../utils/trimCanvas": 130,
                    "./TextMetrics": 109,
                    "./TextStyle": 110
                }],
                109: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                        function e(t, i, n, o, s, a, l, u, c) {
                            r(this, e), this.text = t, this.style = i, this.width = n, this.height = o, this.lines = s, this.lineWidths = a, this.lineHeight = l, this.maxLineWidth = u, this.fontProperties = c
                        }
                        return e.measureText = function(t, i, r) {
                            var n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : e._canvas;
                            r = void 0 === r || null === r ? i.wordWrap : r;
                            var o = i.toFontString(),
                                s = e.measureFont(o),
                                a = n.getContext("2d");
                            a.font = o;
                            for (var l = r ? e.wordWrap(t, i, n) : t, u = l.split(/(?:\r\n|\r|\n)/), c = new Array(u.length), h = 0, d = 0; d < u.length; d++) {
                                var p = a.measureText(u[d]).width + (u[d].length - 1) * i.letterSpacing;
                                c[d] = p, h = Math.max(h, p)
                            }
                            var f = h + i.strokeThickness;
                            i.dropShadow && (f += i.dropShadowDistance);
                            var _ = i.lineHeight || s.fontSize + i.strokeThickness,
                                m = Math.max(_, s.fontSize + i.strokeThickness) + (u.length - 1) * (_ + i.leading);
                            return i.dropShadow && (m += i.dropShadowDistance), new e(t, i, f, m, u, c, _ + i.leading, h, s)
                        }, e.wordWrap = function(t, i) {
                            for (var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : e._canvas, n = r.getContext("2d"), o = 0, s = "", a = "", l = {}, u = i.letterSpacing, c = i.whiteSpace, h = e.collapseSpaces(c), d = e.collapseNewlines(c), p = !h, f = i.wordWrapWidth + u, _ = e.tokenize(t), m = 0; m < _.length; m++) {
                                var g = _[m];
                                if (e.isNewline(g)) {
                                    if (!d) {
                                        a += e.addLine(s), p = !h, s = "", o = 0;
                                        continue
                                    }
                                    g = " "
                                }
                                if (h) {
                                    var v = e.isBreakingSpace(g),
                                        y = e.isBreakingSpace(s[s.length - 1]);
                                    if (v && y) continue
                                }
                                var b = e.getFromCache(g, u, l, n);
                                if (b > f)
                                    if ("" !== s && (a += e.addLine(s), s = "", o = 0), e.canBreakWords(g, i.breakWords))
                                        for (var x = g.split(""), T = 0; T < x.length; T++) {
                                            for (var E = x[T], S = 1; x[T + S];) {
                                                var P = x[T + S],
                                                    A = E[E.length - 1];
                                                if (e.canBreakChars(A, P, g, T, i.breakWords)) break;
                                                E += P, S++
                                            }
                                            T += E.length - 1;
                                            var C = e.getFromCache(E, u, l, n);
                                            C + o > f && (a += e.addLine(s), p = !1, s = "", o = 0), s += E, o += C
                                        } else {
                                            s.length > 0 && (a += e.addLine(s), s = "", o = 0);
                                            var M = m === _.length - 1;
                                            a += e.addLine(g, !M), p = !1, s = "", o = 0
                                        } else b + o > f && (p = !1, a += e.addLine(s), s = "", o = 0), (s.length > 0 || !e.isBreakingSpace(g) || p) && (s += g, o += b)
                            }
                            return a += e.addLine(s, !1)
                        }, e.addLine = function(t) {
                            var i = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
                            return t = e.trimRight(t), t = i ? t + "\n" : t
                        }, e.getFromCache = function(e, t, i, r) {
                            var n = i[e];
                            if (void 0 === n) {
                                var o = e.length * t;
                                n = r.measureText(e).width + o, i[e] = n
                            }
                            return n
                        }, e.collapseSpaces = function(e) {
                            return "normal" === e || "pre-line" === e
                        }, e.collapseNewlines = function(e) {
                            return "normal" === e
                        }, e.trimRight = function(t) {
                            if ("string" != typeof t) return "";
                            for (var i = t.length - 1; i >= 0; i--) {
                                var r = t[i];
                                if (!e.isBreakingSpace(r)) break;
                                t = t.slice(0, -1)
                            }
                            return t
                        }, e.isNewline = function(t) {
                            return "string" == typeof t && e._newlines.indexOf(t.charCodeAt(0)) >= 0
                        }, e.isBreakingSpace = function(t) {
                            return "string" == typeof t && e._breakingSpaces.indexOf(t.charCodeAt(0)) >= 0
                        }, e.tokenize = function(t) {
                            var i = [],
                                r = "";
                            if ("string" != typeof t) return i;
                            for (var n = 0; n < t.length; n++) {
                                var o = t[n];
                                e.isBreakingSpace(o) || e.isNewline(o) ? ("" !== r && (i.push(r), r = ""), i.push(o)) : r += o
                            }
                            return "" !== r && i.push(r), i
                        }, e.canBreakWords = function(e, t) {
                            return t
                        }, e.canBreakChars = function(e, t, i, r, n) {
                            return !0
                        }, e.measureFont = function(t) {
                            if (e._fonts[t]) return e._fonts[t];
                            var i = {},
                                r = e._canvas,
                                n = e._context;
                            n.font = t;
                            var o = e.METRICS_STRING + e.BASELINE_SYMBOL,
                                s = Math.ceil(n.measureText(o).width),
                                a = Math.ceil(n.measureText(e.BASELINE_SYMBOL).width),
                                l = 2 * a;
                            a = a * e.BASELINE_MULTIPLIER | 0, r.width = s, r.height = l, n.fillStyle = "#f00", n.fillRect(0, 0, s, l), n.font = t, n.textBaseline = "alphabetic", n.fillStyle = "#000", n.fillText(o, 0, a);
                            var u = n.getImageData(0, 0, s, l).data,
                                c = u.length,
                                h = 4 * s,
                                d = 0,
                                p = 0,
                                f = !1;
                            for (d = 0; d < a; ++d) {
                                for (var _ = 0; _ < h; _ += 4)
                                    if (255 !== u[p + _]) {
                                        f = !0;
                                        break
                                    }
                                if (f) break;
                                p += h
                            }
                            for (i.ascent = a - d, p = c - h, f = !1, d = l; d > a; --d) {
                                for (var m = 0; m < h; m += 4)
                                    if (255 !== u[p + m]) {
                                        f = !0;
                                        break
                                    }
                                if (f) break;
                                p -= h
                            }
                            return i.descent = d - a, i.fontSize = i.ascent + i.descent, e._fonts[t] = i, i
                        }, e.clearMetrics = function() {
                            var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
                            t ? delete e._fonts[t] : e._fonts = {}
                        }, e
                    }();
                    i.default = n;
                    var o = document.createElement("canvas");
                    o.width = o.height = 10, n._canvas = o, n._context = o.getContext("2d"), n._fonts = {}, n.METRICS_STRING = "|Éq", n.BASELINE_SYMBOL = "M", n.BASELINE_MULTIPLIER = 1.4, n._newlines = [10, 13], n._breakingSpaces = [9, 32, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8200, 8201, 8202, 8287, 12288]
                }, {}],
                110: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e) {
                        return "number" == typeof e ? (0, c.hex2string)(e) : ("string" == typeof e && 0 === e.indexOf("0x") && (e = e.replace("0x", "#")), e)
                    }

                    function o(e) {
                        if (Array.isArray(e)) {
                            for (var t = 0; t < e.length; ++t) e[t] = n(e[t]);
                            return e
                        }
                        return n(e)
                    }

                    function s(e, t) {
                        if (!Array.isArray(e) || !Array.isArray(t)) return !1;
                        if (e.length !== t.length) return !1;
                        for (var i = 0; i < e.length; ++i)
                            if (e[i] !== t[i]) return !1;
                        return !0
                    }

                    function a(e, t, i) {
                        for (var r in i) Array.isArray(t[r]) ? e[r] = t[r].slice() : e[r] = t[r]
                    }
                    i.__esModule = !0;
                    var l = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        u = e("../const"),
                        c = e("../utils"),
                        h = {
                            align: "left",
                            breakWords: !1,
                            dropShadow: !1,
                            dropShadowAlpha: 1,
                            dropShadowAngle: Math.PI / 6,
                            dropShadowBlur: 0,
                            dropShadowColor: "black",
                            dropShadowDistance: 5,
                            fill: "black",
                            fillGradientType: u.TEXT_GRADIENT.LINEAR_VERTICAL,
                            fillGradientStops: [],
                            fontFamily: "Arial",
                            fontSize: 26,
                            fontStyle: "normal",
                            fontVariant: "normal",
                            fontWeight: "normal",
                            letterSpacing: 0,
                            lineHeight: 0,
                            lineJoin: "miter",
                            miterLimit: 10,
                            padding: 0,
                            stroke: "black",
                            strokeThickness: 0,
                            textBaseline: "alphabetic",
                            trim: !1,
                            whiteSpace: "pre",
                            wordWrap: !1,
                            wordWrapWidth: 100,
                            leading: 0
                        },
                        d = ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui"],
                        p = function() {
                            function e(t) {
                                r(this, e), this.styleID = 0, this.reset(), a(this, t, t)
                            }
                            return e.prototype.clone = function() {
                                var t = {};
                                return a(t, this, h), new e(t)
                            }, e.prototype.reset = function() {
                                a(this, h, h)
                            }, e.prototype.toFontString = function() {
                                var e = "number" == typeof this.fontSize ? this.fontSize + "px" : this.fontSize,
                                    t = this.fontFamily;
                                Array.isArray(this.fontFamily) || (t = this.fontFamily.split(","));
                                for (var i = t.length - 1; i >= 0; i--) {
                                    var r = t[i].trim();
                                    !/([\"\'])[^\'\"]+\1/.test(r) && d.indexOf(r) < 0 && (r = '"' + r + '"'), t[i] = r
                                }
                                return this.fontStyle + " " + this.fontVariant + " " + this.fontWeight + " " + e + " " + t.join(",")
                            }, l(e, [{
                                key: "align",
                                get: function() {
                                    return this._align
                                },
                                set: function(e) {
                                    this._align !== e && (this._align = e, this.styleID++)
                                }
                            }, {
                                key: "breakWords",
                                get: function() {
                                    return this._breakWords
                                },
                                set: function(e) {
                                    this._breakWords !== e && (this._breakWords = e, this.styleID++)
                                }
                            }, {
                                key: "dropShadow",
                                get: function() {
                                    return this._dropShadow
                                },
                                set: function(e) {
                                    this._dropShadow !== e && (this._dropShadow = e, this.styleID++)
                                }
                            }, {
                                key: "dropShadowAlpha",
                                get: function() {
                                    return this._dropShadowAlpha
                                },
                                set: function(e) {
                                    this._dropShadowAlpha !== e && (this._dropShadowAlpha = e, this.styleID++)
                                }
                            }, {
                                key: "dropShadowAngle",
                                get: function() {
                                    return this._dropShadowAngle
                                },
                                set: function(e) {
                                    this._dropShadowAngle !== e && (this._dropShadowAngle = e, this.styleID++)
                                }
                            }, {
                                key: "dropShadowBlur",
                                get: function() {
                                    return this._dropShadowBlur
                                },
                                set: function(e) {
                                    this._dropShadowBlur !== e && (this._dropShadowBlur = e, this.styleID++)
                                }
                            }, {
                                key: "dropShadowColor",
                                get: function() {
                                    return this._dropShadowColor
                                },
                                set: function(e) {
                                    var t = o(e);
                                    this._dropShadowColor !== t && (this._dropShadowColor = t, this.styleID++)
                                }
                            }, {
                                key: "dropShadowDistance",
                                get: function() {
                                    return this._dropShadowDistance
                                },
                                set: function(e) {
                                    this._dropShadowDistance !== e && (this._dropShadowDistance = e, this.styleID++)
                                }
                            }, {
                                key: "fill",
                                get: function() {
                                    return this._fill
                                },
                                set: function(e) {
                                    var t = o(e);
                                    this._fill !== t && (this._fill = t, this.styleID++)
                                }
                            }, {
                                key: "fillGradientType",
                                get: function() {
                                    return this._fillGradientType
                                },
                                set: function(e) {
                                    this._fillGradientType !== e && (this._fillGradientType = e, this.styleID++)
                                }
                            }, {
                                key: "fillGradientStops",
                                get: function() {
                                    return this._fillGradientStops
                                },
                                set: function(e) {
                                    s(this._fillGradientStops, e) || (this._fillGradientStops = e, this.styleID++)
                                }
                            }, {
                                key: "fontFamily",
                                get: function() {
                                    return this._fontFamily
                                },
                                set: function(e) {
                                    this.fontFamily !== e && (this._fontFamily = e, this.styleID++)
                                }
                            }, {
                                key: "fontSize",
                                get: function() {
                                    return this._fontSize
                                },
                                set: function(e) {
                                    this._fontSize !== e && (this._fontSize = e, this.styleID++)
                                }
                            }, {
                                key: "fontStyle",
                                get: function() {
                                    return this._fontStyle
                                },
                                set: function(e) {
                                    this._fontStyle !== e && (this._fontStyle = e, this.styleID++)
                                }
                            }, {
                                key: "fontVariant",
                                get: function() {
                                    return this._fontVariant
                                },
                                set: function(e) {
                                    this._fontVariant !== e && (this._fontVariant = e, this.styleID++)
                                }
                            }, {
                                key: "fontWeight",
                                get: function() {
                                    return this._fontWeight
                                },
                                set: function(e) {
                                    this._fontWeight !== e && (this._fontWeight = e, this.styleID++)
                                }
                            }, {
                                key: "letterSpacing",
                                get: function() {
                                    return this._letterSpacing
                                },
                                set: function(e) {
                                    this._letterSpacing !== e && (this._letterSpacing = e, this.styleID++)
                                }
                            }, {
                                key: "lineHeight",
                                get: function() {
                                    return this._lineHeight
                                },
                                set: function(e) {
                                    this._lineHeight !== e && (this._lineHeight = e, this.styleID++)
                                }
                            }, {
                                key: "leading",
                                get: function() {
                                    return this._leading
                                },
                                set: function(e) {
                                    this._leading !== e && (this._leading = e, this.styleID++)
                                }
                            }, {
                                key: "lineJoin",
                                get: function() {
                                    return this._lineJoin
                                },
                                set: function(e) {
                                    this._lineJoin !== e && (this._lineJoin = e, this.styleID++)
                                }
                            }, {
                                key: "miterLimit",
                                get: function() {
                                    return this._miterLimit
                                },
                                set: function(e) {
                                    this._miterLimit !== e && (this._miterLimit = e, this.styleID++)
                                }
                            }, {
                                key: "padding",
                                get: function() {
                                    return this._padding
                                },
                                set: function(e) {
                                    this._padding !== e && (this._padding = e, this.styleID++)
                                }
                            }, {
                                key: "stroke",
                                get: function() {
                                    return this._stroke
                                },
                                set: function(e) {
                                    var t = o(e);
                                    this._stroke !== t && (this._stroke = t, this.styleID++)
                                }
                            }, {
                                key: "strokeThickness",
                                get: function() {
                                    return this._strokeThickness
                                },
                                set: function(e) {
                                    this._strokeThickness !== e && (this._strokeThickness = e, this.styleID++)
                                }
                            }, {
                                key: "textBaseline",
                                get: function() {
                                    return this._textBaseline
                                },
                                set: function(e) {
                                    this._textBaseline !== e && (this._textBaseline = e, this.styleID++)
                                }
                            }, {
                                key: "trim",
                                get: function() {
                                    return this._trim
                                },
                                set: function(e) {
                                    this._trim !== e && (this._trim = e, this.styleID++)
                                }
                            }, {
                                key: "whiteSpace",
                                get: function() {
                                    return this._whiteSpace
                                },
                                set: function(e) {
                                    this._whiteSpace !== e && (this._whiteSpace = e, this.styleID++)
                                }
                            }, {
                                key: "wordWrap",
                                get: function() {
                                    return this._wordWrap
                                },
                                set: function(e) {
                                    this._wordWrap !== e && (this._wordWrap = e, this.styleID++)
                                }
                            }, {
                                key: "wordWrapWidth",
                                get: function() {
                                    return this._wordWrapWidth
                                },
                                set: function(e) {
                                    this._wordWrapWidth !== e && (this._wordWrapWidth = e, this.styleID++)
                                }
                            }]), e
                        }();
                    i.default = p
                }, {
                    "../const": 46,
                    "../utils": 125
                }],
                111: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("./BaseTexture"),
                        l = r(a),
                        u = e("../settings"),
                        c = r(u),
                        h = function(e) {
                            function t() {
                                var i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 100,
                                    r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 100,
                                    s = arguments[2],
                                    a = arguments[3];
                                n(this, t);
                                var l = o(this, e.call(this, null, s));
                                return l.resolution = a || c.default.RESOLUTION, l.width = Math.ceil(i), l.height = Math.ceil(r), l.realWidth = l.width * l.resolution, l.realHeight = l.height * l.resolution, l.scaleMode = void 0 !== s ? s : c.default.SCALE_MODE, l.hasLoaded = !0, l._glRenderTargets = {}, l._canvasRenderTarget = null, l.valid = !1, l
                            }
                            return s(t, e), t.prototype.resize = function(e, t) {
                                e = Math.ceil(e), t = Math.ceil(t), e === this.width && t === this.height || (this.valid = e > 0 && t > 0, this.width = e, this.height = t, this.realWidth = this.width * this.resolution, this.realHeight = this.height * this.resolution, this.valid && this.emit("update", this))
                            }, t.prototype.destroy = function() {
                                e.prototype.destroy.call(this, !0), this.renderer = null
                            }, t
                        }(l.default);
                    i.default = h
                }, {
                    "../settings": 101,
                    "./BaseTexture": 112
                }],
                112: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("../utils"),
                        l = e("../settings"),
                        u = r(l),
                        c = e("eventemitter3"),
                        h = r(c),
                        d = e("../utils/determineCrossOrigin"),
                        p = r(d),
                        f = e("bit-twiddle"),
                        _ = r(f),
                        m = function(e) {
                            function t(i, r, s) {
                                n(this, t);
                                var l = o(this, e.call(this));
                                return l.uid = (0, a.uid)(), l.touched = 0, l.resolution = s || u.default.RESOLUTION, l.width = 100, l.height = 100, l.realWidth = 100, l.realHeight = 100, l.scaleMode = void 0 !== r ? r : u.default.SCALE_MODE, l.hasLoaded = !1, l.isLoading = !1, l.source = null, l.origSource = null, l.imageType = null, l.sourceScale = 1, l.premultipliedAlpha = !0, l.imageUrl = null, l.isPowerOfTwo = !1, l.mipmap = u.default.MIPMAP_TEXTURES, l.wrapMode = u.default.WRAP_MODE, l._glTextures = {}, l._enabled = 0, l._virtalBoundId = -1, l._destroyed = !1, l.textureCacheIds = [], i && l.loadSource(i), l
                            }
                            return s(t, e), t.prototype.update = function() {
                                "svg" !== this.imageType && (this.realWidth = this.source.naturalWidth || this.source.videoWidth || this.source.width, this.realHeight = this.source.naturalHeight || this.source.videoHeight || this.source.height, this._updateDimensions()), this.emit("update", this)
                            }, t.prototype._updateDimensions = function() {
                                this.width = this.realWidth / this.resolution, this.height = this.realHeight / this.resolution, this.isPowerOfTwo = _.default.isPow2(this.realWidth) && _.default.isPow2(this.realHeight)
                            }, t.prototype.loadSource = function(e) {
                                var t = this.isLoading;
                                this.hasLoaded = !1, this.isLoading = !1, t && this.source && (this.source.onload = null, this.source.onerror = null);
                                var i = !this.source;
                                if (this.source = e, (e.src && e.complete || e.getContext) && e.width && e.height) this._updateImageType(), "svg" === this.imageType ? this._loadSvgSource() : this._sourceLoaded(), i && this.emit("loaded", this);
                                else if (!e.getContext) {
                                    this.isLoading = !0;
                                    var r = this;
                                    if (e.onload = function() {
                                            if (r._updateImageType(), e.onload = null, e.onerror = null, r.isLoading) {
                                                if (r.isLoading = !1, r._sourceLoaded(), "svg" === r.imageType) return void r._loadSvgSource();
                                                r.emit("loaded", r)
                                            }
                                        }, e.onerror = function() {
                                            e.onload = null, e.onerror = null, r.isLoading && (r.isLoading = !1, r.emit("error", r))
                                        }, e.complete && e.src) {
                                        if (e.onload = null, e.onerror = null, "svg" === r.imageType) return void r._loadSvgSource();
                                        this.isLoading = !1, e.width && e.height ? (this._sourceLoaded(), t && this.emit("loaded", this)) : t && this.emit("error", this)
                                    }
                                }
                            }, t.prototype._updateImageType = function() {
                                if (this.imageUrl) {
                                    var e = (0, a.decomposeDataUri)(this.imageUrl),
                                        t = void 0;
                                    if (e && "image" === e.mediaType) {
                                        var i = e.subType.split("+")[0];
                                        if (!(t = (0, a.getUrlFileExtension)("." + i))) throw new Error("Invalid image type in data URI.")
                                    } else(t = (0, a.getUrlFileExtension)(this.imageUrl)) || (t = "png");
                                    this.imageType = t
                                }
                            }, t.prototype._loadSvgSource = function() {
                                if ("svg" === this.imageType) {
                                    var e = (0, a.decomposeDataUri)(this.imageUrl);
                                    e ? this._loadSvgSourceUsingDataUri(e) : this._loadSvgSourceUsingXhr()
                                }
                            }, t.prototype._loadSvgSourceUsingDataUri = function(e) {
                                var t = void 0;
                                if ("base64" === e.encoding) {
                                    if (!atob) throw new Error("Your browser doesn't support base64 conversions.");
                                    t = atob(e.data)
                                } else t = e.data;
                                this._loadSvgSourceUsingString(t)
                            }, t.prototype._loadSvgSourceUsingXhr = function() {
                                var e = this,
                                    t = new XMLHttpRequest;
                                t.onload = function() {
                                    if (t.readyState !== t.DONE || 200 !== t.status) throw new Error("Failed to load SVG using XHR.");
                                    e._loadSvgSourceUsingString(t.response)
                                }, t.onerror = function() {
                                    return e.emit("error", e)
                                }, t.open("GET", this.imageUrl, !0), t.send()
                            }, t.prototype._loadSvgSourceUsingString = function(e) {
                                var i = (0, a.getSvgSize)(e),
                                    r = i.width,
                                    n = i.height;
                                if (!r || !n) throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");
                                this.realWidth = Math.round(r * this.sourceScale), this.realHeight = Math.round(n * this.sourceScale), this._updateDimensions();
                                var o = document.createElement("canvas");
                                o.width = this.realWidth, o.height = this.realHeight, o._pixiId = "canvas_" + (0, a.uid)(), o.getContext("2d").drawImage(this.source, 0, 0, r, n, 0, 0, this.realWidth, this.realHeight), this.origSource = this.source, this.source = o, t.addToCache(this, o._pixiId), this.isLoading = !1, this._sourceLoaded(), this.emit("loaded", this)
                            }, t.prototype._sourceLoaded = function() {
                                this.hasLoaded = !0, this.update()
                            }, t.prototype.destroy = function() {
                                this.imageUrl && (delete a.TextureCache[this.imageUrl], this.imageUrl = null, navigator.isCocoonJS || (this.source.src = "")), this.source = null, this.dispose(), t.removeFromCache(this), this.textureCacheIds = null, this._destroyed = !0
                            }, t.prototype.dispose = function() {
                                this.emit("dispose", this)
                            }, t.prototype.updateSourceImage = function(e) {
                                this.source.src = e, this.loadSource(this.source)
                            }, t.fromImage = function(e, i, r, n) {
                                var o = a.BaseTextureCache[e];
                                if (!o) {
                                    var s = new Image;
                                    void 0 === i && 0 !== e.indexOf("data:") ? s.crossOrigin = (0, p.default)(e) : i && (s.crossOrigin = "string" == typeof i ? i : "anonymous"), o = new t(s, r), o.imageUrl = e, n && (o.sourceScale = n), o.resolution = (0, a.getResolutionOfUrl)(e), s.src = e, t.addToCache(o, e)
                                }
                                return o
                            }, t.fromCanvas = function(e, i) {
                                var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "canvas";
                                e._pixiId || (e._pixiId = r + "_" + (0, a.uid)());
                                var n = a.BaseTextureCache[e._pixiId];
                                return n || (n = new t(e, i), t.addToCache(n, e._pixiId)), n
                            }, t.from = function(e, i, r) {
                                if ("string" == typeof e) return t.fromImage(e, void 0, i, r);
                                if (e instanceof HTMLImageElement) {
                                    var n = e.src,
                                        o = a.BaseTextureCache[n];
                                    return o || (o = new t(e, i), o.imageUrl = n, r && (o.sourceScale = r), o.resolution = (0, a.getResolutionOfUrl)(n), t.addToCache(o, n)), o
                                }
                                return e instanceof HTMLCanvasElement ? t.fromCanvas(e, i) : e
                            }, t.addToCache = function(e, t) {
                                t && (-1 === e.textureCacheIds.indexOf(t) && e.textureCacheIds.push(t), a.BaseTextureCache[t], a.BaseTextureCache[t] = e)
                            }, t.removeFromCache = function(e) {
                                if ("string" == typeof e) {
                                    var t = a.BaseTextureCache[e];
                                    if (t) {
                                        var i = t.textureCacheIds.indexOf(e);
                                        return i > -1 && t.textureCacheIds.splice(i, 1), delete a.BaseTextureCache[e], t
                                    }
                                } else if (e && e.textureCacheIds) {
                                    for (var r = 0; r < e.textureCacheIds.length; ++r) delete a.BaseTextureCache[e.textureCacheIds[r]];
                                    return e.textureCacheIds.length = 0, e
                                }
                                return null
                            }, t
                        }(h.default);
                    i.default = m
                }, {
                    "../settings": 101,
                    "../utils": 125,
                    "../utils/determineCrossOrigin": 124,
                    "bit-twiddle": 1,
                    eventemitter3: 3
                }],
                113: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("./BaseRenderTexture"),
                        l = r(a),
                        u = e("./Texture"),
                        c = r(u),
                        h = function(e) {
                            function t(i, r) {
                                n(this, t);
                                var s = null;
                                if (!(i instanceof l.default)) {
                                    var a = arguments[1],
                                        u = arguments[2],
                                        c = arguments[3],
                                        h = arguments[4];
                                    s = arguments[0], r = null, i = new l.default(a, u, c, h)
                                }
                                var d = o(this, e.call(this, i, r));
                                return d.legacyRenderer = s, d.valid = !0, d._updateUvs(), d
                            }
                            return s(t, e), t.prototype.resize = function(e, t, i) {
                                e = Math.ceil(e), t = Math.ceil(t), this.valid = e > 0 && t > 0, this._frame.width = this.orig.width = e, this._frame.height = this.orig.height = t, i || this.baseTexture.resize(e, t), this._updateUvs()
                            }, t.create = function(e, i, r, n) {
                                return new t(new l.default(e, i, r, n))
                            }, t
                        }(c.default);
                    i.default = h
                }, {
                    "./BaseRenderTexture": 111,
                    "./Texture": 115
                }],
                114: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        o = e("../"),
                        s = e("../utils"),
                        a = function() {
                            function e(t, i) {
                                var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null;
                                r(this, e), this.baseTexture = t, this.textures = {}, this.animations = {}, this.data = i, this.resolution = this._updateResolution(n || this.baseTexture.imageUrl), this._frames = this.data.frames, this._frameKeys = Object.keys(this._frames), this._batchIndex = 0, this._callback = null
                            }
                            return n(e, null, [{
                                key: "BATCH_SIZE",
                                get: function() {
                                    return 1e3
                                }
                            }]), e.prototype._updateResolution = function(e) {
                                var t = this.data.meta.scale,
                                    i = (0, s.getResolutionOfUrl)(e, null);
                                return null === i && (i = void 0 !== t ? parseFloat(t) : 1), 1 !== i && (this.baseTexture.resolution = i, this.baseTexture.update()), i
                            }, e.prototype.parse = function(t) {
                                this._batchIndex = 0, this._callback = t, this._frameKeys.length <= e.BATCH_SIZE ? (this._processFrames(0), this._processAnimations(), this._parseComplete()) : this._nextBatch()
                            }, e.prototype._processFrames = function(t) {
                                for (var i = t, r = e.BATCH_SIZE, n = this.baseTexture.sourceScale; i - t < r && i < this._frameKeys.length;) {
                                    var s = this._frameKeys[i],
                                        a = this._frames[s],
                                        l = a.frame;
                                    if (l) {
                                        var u = null,
                                            c = null,
                                            h = !1 !== a.trimmed && a.sourceSize ? a.sourceSize : a.frame,
                                            d = new o.Rectangle(0, 0, Math.floor(h.w * n) / this.resolution, Math.floor(h.h * n) / this.resolution);
                                        u = a.rotated ? new o.Rectangle(Math.floor(l.x * n) / this.resolution, Math.floor(l.y * n) / this.resolution, Math.floor(l.h * n) / this.resolution, Math.floor(l.w * n) / this.resolution) : new o.Rectangle(Math.floor(l.x * n) / this.resolution, Math.floor(l.y * n) / this.resolution, Math.floor(l.w * n) / this.resolution, Math.floor(l.h * n) / this.resolution), !1 !== a.trimmed && a.spriteSourceSize && (c = new o.Rectangle(Math.floor(a.spriteSourceSize.x * n) / this.resolution, Math.floor(a.spriteSourceSize.y * n) / this.resolution, Math.floor(l.w * n) / this.resolution, Math.floor(l.h * n) / this.resolution)), this.textures[s] = new o.Texture(this.baseTexture, u, d, c, a.rotated ? 2 : 0, a.anchor), o.Texture.addToCache(this.textures[s], s)
                                    }
                                    i++
                                }
                            }, e.prototype._processAnimations = function() {
                                var e = this.data.animations || {};
                                for (var t in e) {
                                    this.animations[t] = [];
                                    for (var i = e[t], r = Array.isArray(i), n = 0, i = r ? i : i[Symbol.iterator]();;) {
                                        var o;
                                        if (r) {
                                            if (n >= i.length) break;
                                            o = i[n++]
                                        } else {
                                            if (n = i.next(), n.done) break;
                                            o = n.value
                                        }
                                        var s = o;
                                        this.animations[t].push(this.textures[s])
                                    }
                                }
                            }, e.prototype._parseComplete = function() {
                                var e = this._callback;
                                this._callback = null, this._batchIndex = 0, e.call(this, this.textures)
                            }, e.prototype._nextBatch = function() {
                                var t = this;
                                this._processFrames(this._batchIndex * e.BATCH_SIZE), this._batchIndex++, setTimeout(function() {
                                    t._batchIndex * e.BATCH_SIZE < t._frameKeys.length ? t._nextBatch() : (t._processAnimations(), t._parseComplete())
                                }, 0)
                            }, e.prototype.destroy = function() {
                                var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
                                for (var t in this.textures) this.textures[t].destroy();
                                this._frames = null, this._frameKeys = null, this.data = null, this.textures = null, e && this.baseTexture.destroy(), this.baseTexture = null
                            }, e
                        }();
                    i.default = a
                }, {
                    "../": 65,
                    "../utils": 125
                }],
                115: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }

                    function a(e) {
                        e.destroy = function() {}, e.on = function() {}, e.once = function() {}, e.emit = function() {}
                    }
                    i.__esModule = !0;
                    var l = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        u = e("./BaseTexture"),
                        c = r(u),
                        h = e("./VideoBaseTexture"),
                        d = r(h),
                        p = e("./TextureUvs"),
                        f = r(p),
                        _ = e("eventemitter3"),
                        m = r(_),
                        g = e("../math"),
                        v = e("../utils"),
                        y = e("../settings"),
                        b = r(y),
                        x = function(e) {
                            function t(i, r, s, a, l, u) {
                                n(this, t);
                                var c = o(this, e.call(this));
                                if (c.noFrame = !1, r || (c.noFrame = !0, r = new g.Rectangle(0, 0, 1, 1)), i instanceof t && (i = i.baseTexture), c.baseTexture = i, c._frame = r, c.trim = a, c.valid = !1, c.requiresUpdate = !1, c._uvs = null, c.orig = s || r, c._rotate = Number(l || 0), !0 === l) c._rotate = 2;
                                else if (c._rotate % 2 != 0) throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");
                                return i.hasLoaded ? (c.noFrame && (r = new g.Rectangle(0, 0, i.width, i.height), i.on("update", c.onBaseTextureUpdated, c)), c.frame = r) : i.once("loaded", c.onBaseTextureLoaded, c), c.defaultAnchor = u ? new g.Point(u.x, u.y) : new g.Point(0, 0), c._updateID = 0, c.transform = null, c.textureCacheIds = [], c
                            }
                            return s(t, e), t.prototype.update = function() {
                                this.baseTexture.update()
                            }, t.prototype.onBaseTextureLoaded = function(e) {
                                this._updateID++, this.noFrame ? this.frame = new g.Rectangle(0, 0, e.width, e.height) : this.frame = this._frame, this.baseTexture.on("update", this.onBaseTextureUpdated, this), this.emit("update", this)
                            }, t.prototype.onBaseTextureUpdated = function(e) {
                                this._updateID++, this._frame.width = e.width, this._frame.height = e.height, this.emit("update", this)
                            }, t.prototype.destroy = function(e) {
                                this.baseTexture && (e && (v.TextureCache[this.baseTexture.imageUrl] && t.removeFromCache(this.baseTexture.imageUrl), this.baseTexture.destroy()), this.baseTexture.off("update", this.onBaseTextureUpdated, this), this.baseTexture.off("loaded", this.onBaseTextureLoaded, this), this.baseTexture = null), this._frame = null, this._uvs = null, this.trim = null, this.orig = null, this.valid = !1, t.removeFromCache(this), this.textureCacheIds = null
                            }, t.prototype.clone = function() {
                                return new t(this.baseTexture, this.frame, this.orig, this.trim, this.rotate, this.defaultAnchor)
                            }, t.prototype._updateUvs = function() {
                                this._uvs || (this._uvs = new f.default), this._uvs.set(this._frame, this.baseTexture, this.rotate), this._updateID++
                            }, t.fromImage = function(e, i, r, n) {
                                var o = v.TextureCache[e];
                                return o || (o = new t(c.default.fromImage(e, i, r, n)), t.addToCache(o, e)), o
                            }, t.fromFrame = function(e) {
                                var t = v.TextureCache[e];
                                if (!t) throw new Error('The frameId "' + e + '" does not exist in the texture cache');
                                return t
                            }, t.fromCanvas = function(e, i) {
                                var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "canvas";
                                return new t(c.default.fromCanvas(e, i, r))
                            }, t.fromVideo = function(e, i, r, n) {
                                return "string" == typeof e ? t.fromVideoUrl(e, i, r, n) : new t(d.default.fromVideo(e, i, n))
                            }, t.fromVideoUrl = function(e, i, r, n) {
                                return new t(d.default.fromUrl(e, i, r, n))
                            }, t.from = function(e) {
                                if ("string" == typeof e) {
                                    var i = v.TextureCache[e];
                                    if (!i) {
                                        return null !== e.match(/\.(mp4|webm|ogg|h264|avi|mov)$/) ? t.fromVideoUrl(e) : t.fromImage(e)
                                    }
                                    return i
                                }
                                return e instanceof HTMLImageElement ? new t(c.default.from(e)) : e instanceof HTMLCanvasElement ? t.fromCanvas(e, b.default.SCALE_MODE, "HTMLCanvasElement") : e instanceof HTMLVideoElement ? t.fromVideo(e) : e instanceof c.default ? new t(e) : e
                            }, t.fromLoader = function(e, i, r) {
                                var n = new c.default(e, void 0, (0, v.getResolutionOfUrl)(i)),
                                    o = new t(n);
                                return n.imageUrl = i, r || (r = i), c.default.addToCache(o.baseTexture, r), t.addToCache(o, r), r !== i && (c.default.addToCache(o.baseTexture, i), t.addToCache(o, i)), o
                            }, t.addToCache = function(e, t) {
                                t && (-1 === e.textureCacheIds.indexOf(t) && e.textureCacheIds.push(t), v.TextureCache[t], v.TextureCache[t] = e)
                            }, t.removeFromCache = function(e) {
                                if ("string" == typeof e) {
                                    var t = v.TextureCache[e];
                                    if (t) {
                                        var i = t.textureCacheIds.indexOf(e);
                                        return i > -1 && t.textureCacheIds.splice(i, 1), delete v.TextureCache[e], t
                                    }
                                } else if (e && e.textureCacheIds) {
                                    for (var r = 0; r < e.textureCacheIds.length; ++r) v.TextureCache[e.textureCacheIds[r]] === e && delete v.TextureCache[e.textureCacheIds[r]];
                                    return e.textureCacheIds.length = 0, e
                                }
                                return null
                            }, l(t, [{
                                key: "frame",
                                get: function() {
                                    return this._frame
                                },
                                set: function(e) {
                                    this._frame = e, this.noFrame = !1;
                                    var t = e.x,
                                        i = e.y,
                                        r = e.width,
                                        n = e.height,
                                        o = t + r > this.baseTexture.width,
                                        s = i + n > this.baseTexture.height;
                                    if (o || s) {
                                        var a = o && s ? "and" : "or",
                                            l = "X: " + t + " + " + r + " = " + (t + r) + " > " + this.baseTexture.width,
                                            u = "Y: " + i + " + " + n + " = " + (i + n) + " > " + this.baseTexture.height;
                                        throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: " + l + " " + a + " " + u)
                                    }
                                    this.valid = r && n && this.baseTexture.hasLoaded, this.trim || this.rotate || (this.orig = e), this.valid && this._updateUvs()
                                }
                            }, {
                                key: "rotate",
                                get: function() {
                                    return this._rotate
                                },
                                set: function(e) {
                                    this._rotate = e, this.valid && this._updateUvs()
                                }
                            }, {
                                key: "width",
                                get: function() {
                                    return this.orig.width
                                }
                            }, {
                                key: "height",
                                get: function() {
                                    return this.orig.height
                                }
                            }]), t
                        }(m.default);
                    i.default = x, x.EMPTY = new x(new c.default), a(x.EMPTY), a(x.EMPTY.baseTexture), x.WHITE = function() {
                        var e = document.createElement("canvas");
                        e.width = 10, e.height = 10;
                        var t = e.getContext("2d");
                        return t.fillStyle = "white", t.fillRect(0, 0, 10, 10), new x(new c.default(e))
                    }(), a(x.WHITE), a(x.WHITE.baseTexture)
                }, {
                    "../math": 70,
                    "../settings": 101,
                    "../utils": 125,
                    "./BaseTexture": 112,
                    "./TextureUvs": 117,
                    "./VideoBaseTexture": 118,
                    eventemitter3: 3
                }],
                116: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        o = e("../math/Matrix"),
                        s = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(o),
                        a = new s.default,
                        l = function() {
                            function e(t, i) {
                                r(this, e), this._texture = t, this.mapCoord = new s.default, this.uClampFrame = new Float32Array(4), this.uClampOffset = new Float32Array(2), this._lastTextureID = -1, this.clampOffset = 0, this.clampMargin = void 0 === i ? .5 : i
                            }
                            return e.prototype.multiplyUvs = function(e, t) {
                                void 0 === t && (t = e);
                                for (var i = this.mapCoord, r = 0; r < e.length; r += 2) {
                                    var n = e[r],
                                        o = e[r + 1];
                                    t[r] = n * i.a + o * i.c + i.tx, t[r + 1] = n * i.b + o * i.d + i.ty
                                }
                                return t
                            }, e.prototype.update = function(e) {
                                var t = this._texture;
                                if (!t || !t.valid) return !1;
                                if (!e && this._lastTextureID === t._updateID) return !1;
                                this._lastTextureID = t._updateID;
                                var i = t._uvs;
                                this.mapCoord.set(i.x1 - i.x0, i.y1 - i.y0, i.x3 - i.x0, i.y3 - i.y0, i.x0, i.y0);
                                var r = t.orig,
                                    n = t.trim;
                                n && (a.set(r.width / n.width, 0, 0, r.height / n.height, -n.x / n.width, -n.y / n.height), this.mapCoord.append(a));
                                var o = t.baseTexture,
                                    s = this.uClampFrame,
                                    l = this.clampMargin / o.resolution,
                                    u = this.clampOffset;
                                return s[0] = (t._frame.x + l + u) / o.width, s[1] = (t._frame.y + l + u) / o.height, s[2] = (t._frame.x + t._frame.width - l + u) / o.width, s[3] = (t._frame.y + t._frame.height - l + u) / o.height, this.uClampOffset[0] = u / o.realWidth, this.uClampOffset[1] = u / o.realHeight, !0
                            }, n(e, [{
                                key: "texture",
                                get: function() {
                                    return this._texture
                                },
                                set: function(e) {
                                    this._texture = e, this._lastTextureID = -1
                                }
                            }]), e
                        }();
                    i.default = l
                }, {
                    "../math/Matrix": 67
                }],
                117: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../math/GroupD8"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = function() {
                            function e() {
                                r(this, e), this.x0 = 0, this.y0 = 0, this.x1 = 1, this.y1 = 0, this.x2 = 1, this.y2 = 1, this.x3 = 0, this.y3 = 1, this.uvsUint32 = new Uint32Array(4)
                            }
                            return e.prototype.set = function(e, t, i) {
                                var r = t.width,
                                    n = t.height;
                                if (i) {
                                    var s = e.width / 2 / r,
                                        a = e.height / 2 / n,
                                        l = e.x / r + s,
                                        u = e.y / n + a;
                                    i = o.default.add(i, o.default.NW), this.x0 = l + s * o.default.uX(i), this.y0 = u + a * o.default.uY(i), i = o.default.add(i, 2), this.x1 = l + s * o.default.uX(i), this.y1 = u + a * o.default.uY(i), i = o.default.add(i, 2), this.x2 = l + s * o.default.uX(i), this.y2 = u + a * o.default.uY(i), i = o.default.add(i, 2), this.x3 = l + s * o.default.uX(i), this.y3 = u + a * o.default.uY(i)
                                } else this.x0 = e.x / r, this.y0 = e.y / n, this.x1 = (e.x + e.width) / r, this.y1 = e.y / n, this.x2 = (e.x + e.width) / r, this.y2 = (e.y + e.height) / n, this.x3 = e.x / r, this.y3 = (e.y + e.height) / n;
                                this.uvsUint32[0] = (65535 & Math.round(65535 * this.y0)) << 16 | 65535 & Math.round(65535 * this.x0), this.uvsUint32[1] = (65535 & Math.round(65535 * this.y1)) << 16 | 65535 & Math.round(65535 * this.x1), this.uvsUint32[2] = (65535 & Math.round(65535 * this.y2)) << 16 | 65535 & Math.round(65535 * this.x2), this.uvsUint32[3] = (65535 & Math.round(65535 * this.y3)) << 16 | 65535 & Math.round(65535 * this.x3)
                            }, e
                        }();
                    i.default = s
                }, {
                    "../math/GroupD8": 66
                }],
                118: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }

                    function a(e, t) {
                        if (!t) {
                            var i = e.split("?").shift().toLowerCase();
                            t = "video/" + i.substr(i.lastIndexOf(".") + 1)
                        }
                        var r = document.createElement("source");
                        return r.src = e, r.type = t, r
                    }
                    i.__esModule = !0;
                    var l = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        u = e("./BaseTexture"),
                        c = r(u),
                        h = e("../utils"),
                        d = e("../ticker"),
                        p = e("../const"),
                        f = e("../utils/determineCrossOrigin"),
                        _ = r(f),
                        m = function(e) {
                            function t(i, r) {
                                var s = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
                                if (n(this, t), !i) throw new Error("No video source element specified.");
                                (i.readyState === i.HAVE_ENOUGH_DATA || i.readyState === i.HAVE_FUTURE_DATA) && i.width && i.height && (i.complete = !0);
                                var a = o(this, e.call(this, i, r));
                                return a.width = i.videoWidth, a.height = i.videoHeight, a._autoUpdate = !0, a._isAutoUpdating = !1, a.autoPlay = s, a.update = a.update.bind(a), a._onCanPlay = a._onCanPlay.bind(a), i.addEventListener("play", a._onPlayStart.bind(a)), i.addEventListener("pause", a._onPlayStop.bind(a)), a.hasLoaded = !1, a.__loaded = !1, a._isSourceReady() ? a._onCanPlay() : (i.addEventListener("canplay", a._onCanPlay), i.addEventListener("canplaythrough", a._onCanPlay)), a
                            }
                            return s(t, e), t.prototype._isSourcePlaying = function() {
                                var e = this.source;
                                return e.currentTime > 0 && !1 === e.paused && !1 === e.ended && e.readyState > 2
                            }, t.prototype._isSourceReady = function() {
                                return 3 === this.source.readyState || 4 === this.source.readyState
                            }, t.prototype._onPlayStart = function() {
                                this.hasLoaded || this._onCanPlay(), !this._isAutoUpdating && this.autoUpdate && (d.shared.add(this.update, this, p.UPDATE_PRIORITY.HIGH), this._isAutoUpdating = !0)
                            }, t.prototype._onPlayStop = function() {
                                this._isAutoUpdating && (d.shared.remove(this.update, this), this._isAutoUpdating = !1)
                            }, t.prototype._onCanPlay = function() {
                                this.hasLoaded = !0, this.source && (this.source.removeEventListener("canplay", this._onCanPlay), this.source.removeEventListener("canplaythrough", this._onCanPlay), this.width = this.source.videoWidth, this.height = this.source.videoHeight, this.__loaded || (this.__loaded = !0, this.emit("loaded", this)), this._isSourcePlaying() ? this._onPlayStart() : this.autoPlay && this.source.play())
                            }, t.prototype.destroy = function() {
                                this._isAutoUpdating && d.shared.remove(this.update, this), this.source && this.source._pixiId && (c.default.removeFromCache(this.source._pixiId), delete this.source._pixiId, this.source.pause(), this.source.src = "", this.source.load()), e.prototype.destroy.call(this)
                            }, t.fromVideo = function(e, i, r) {
                                e._pixiId || (e._pixiId = "video_" + (0, h.uid)());
                                var n = h.BaseTextureCache[e._pixiId];
                                return n || (n = new t(e, i, r), c.default.addToCache(n, e._pixiId)), n
                            }, t.fromUrl = function(e, i, r, n) {
                                var o = document.createElement("video");
                                o.setAttribute("webkit-playsinline", ""), o.setAttribute("playsinline", "");
                                var s = Array.isArray(e) ? e[0].src || e[0] : e.src || e;
                                if (void 0 === r && 0 !== s.indexOf("data:") ? o.crossOrigin = (0, _.default)(s) : r && (o.crossOrigin = "string" == typeof r ? r : "anonymous"), Array.isArray(e))
                                    for (var l = 0; l < e.length; ++l) o.appendChild(a(e[l].src || e[l], e[l].mime));
                                else o.appendChild(a(s, e.mime));
                                return o.load(), t.fromVideo(o, i, n)
                            }, l(t, [{
                                key: "autoUpdate",
                                get: function() {
                                    return this._autoUpdate
                                },
                                set: function(e) {
                                    e !== this._autoUpdate && (this._autoUpdate = e, !this._autoUpdate && this._isAutoUpdating ? (d.shared.remove(this.update, this), this._isAutoUpdating = !1) : this._autoUpdate && !this._isAutoUpdating && (d.shared.add(this.update, this, p.UPDATE_PRIORITY.HIGH), this._isAutoUpdating = !0))
                                }
                            }]), t
                        }(c.default);
                    i.default = m, m.fromUrls = m.fromUrl
                }, {
                    "../const": 46,
                    "../ticker": 121,
                    "../utils": 125,
                    "../utils/determineCrossOrigin": 124,
                    "./BaseTexture": 112
                }],
                119: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var o = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        s = e("../settings"),
                        a = r(s),
                        l = e("../const"),
                        u = e("./TickerListener"),
                        c = r(u),
                        h = function() {
                            function e() {
                                var t = this;
                                n(this, e), this._head = new c.default(null, null, 1 / 0), this._requestId = null, this._maxElapsedMS = 100, this.autoStart = !1, this.deltaTime = 1, this.elapsedMS = 1 / a.default.TARGET_FPMS, this.lastTime = -1, this.speed = 1, this.started = !1, this._tick = function(e) {
                                    t._requestId = null, t.started && (t.update(e), t.started && null === t._requestId && t._head.next && (t._requestId = requestAnimationFrame(t._tick)))
                                }
                            }
                            return e.prototype._requestIfNeeded = function() {
                                null === this._requestId && this._head.next && (this.lastTime = performance.now(), this._requestId = requestAnimationFrame(this._tick))
                            }, e.prototype._cancelIfNeeded = function() {
                                null !== this._requestId && (cancelAnimationFrame(this._requestId), this._requestId = null)
                            }, e.prototype._startIfPossible = function() {
                                this.started ? this._requestIfNeeded() : this.autoStart && this.start()
                            }, e.prototype.add = function(e, t) {
                                var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : l.UPDATE_PRIORITY.NORMAL;
                                return this._addListener(new c.default(e, t, i))
                            }, e.prototype.addOnce = function(e, t) {
                                var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : l.UPDATE_PRIORITY.NORMAL;
                                return this._addListener(new c.default(e, t, i, !0))
                            }, e.prototype._addListener = function(e) {
                                var t = this._head.next,
                                    i = this._head;
                                if (t) {
                                    for (; t;) {
                                        if (e.priority > t.priority) {
                                            e.connect(i);
                                            break
                                        }
                                        i = t, t = t.next
                                    }
                                    e.previous || e.connect(i)
                                } else e.connect(i);
                                return this._startIfPossible(), this
                            }, e.prototype.remove = function(e, t) {
                                for (var i = this._head.next; i;) i = i.match(e, t) ? i.destroy() : i.next;
                                return this._head.next || this._cancelIfNeeded(), this
                            }, e.prototype.start = function() {
                                this.started || (this.started = !0, this._requestIfNeeded())
                            }, e.prototype.stop = function() {
                                this.started && (this.started = !1, this._cancelIfNeeded())
                            }, e.prototype.destroy = function() {
                                this.stop();
                                for (var e = this._head.next; e;) e = e.destroy(!0);
                                this._head.destroy(), this._head = null
                            }, e.prototype.update = function() {
                                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : performance.now(),
                                    t = void 0;
                                if (e > this.lastTime) {
                                    t = this.elapsedMS = e - this.lastTime, t > this._maxElapsedMS && (t = this._maxElapsedMS), this.deltaTime = t * a.default.TARGET_FPMS * this.speed;
                                    for (var i = this._head, r = i.next; r;) r = r.emit(this.deltaTime);
                                    i.next || this._cancelIfNeeded()
                                } else this.deltaTime = this.elapsedMS = 0;
                                this.lastTime = e
                            }, o(e, [{
                                key: "FPS",
                                get: function() {
                                    return 1e3 / this.elapsedMS
                                }
                            }, {
                                key: "minFPS",
                                get: function() {
                                    return 1e3 / this._maxElapsedMS
                                },
                                set: function(e) {
                                    var t = Math.min(Math.max(0, e) / 1e3, a.default.TARGET_FPMS);
                                    this._maxElapsedMS = 1 / t
                                }
                            }]), e
                        }();
                    i.default = h
                }, {
                    "../const": 46,
                    "../settings": 101,
                    "./TickerListener": 120
                }],
                120: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                        function e(t) {
                            var i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null,
                                n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
                                o = arguments.length > 3 && void 0 !== arguments[3] && arguments[3];
                            r(this, e), this.fn = t, this.context = i, this.priority = n, this.once = o, this.next = null, this.previous = null, this._destroyed = !1
                        }
                        return e.prototype.match = function(e, t) {
                            return t = t || null, this.fn === e && this.context === t
                        }, e.prototype.emit = function(e) {
                            this.fn && (this.context ? this.fn.call(this.context, e) : this.fn(e));
                            var t = this.next;
                            return this.once && this.destroy(!0), this._destroyed && (this.next = null), t
                        }, e.prototype.connect = function(e) {
                            this.previous = e, e.next && (e.next.previous = this), this.next = e.next, e.next = this
                        }, e.prototype.destroy = function() {
                            var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
                            this._destroyed = !0, this.fn = null, this.context = null, this.previous && (this.previous.next = this.next), this.next && (this.next.previous = this.previous);
                            var t = this.next;
                            return this.next = e ? null : t, this.previous = null, t
                        }, e
                    }();
                    i.default = n
                }, {}],
                121: [function(e, t, i) {
                    "use strict";
                    i.__esModule = !0, i.Ticker = i.shared = void 0;
                    var r = e("./Ticker"),
                        n = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(r),
                        o = new n.default;
                    o.autoStart = !0, o.destroy = function() {}, i.shared = o, i.Ticker = n.default
                }, {
                    "./Ticker": 119
                }],
                122: [function(e, t, i) {
                    "use strict";

                    function r() {
                        return !(!!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform))
                    }
                    i.__esModule = !0, i.default = r
                }, {}],
                123: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        for (var t = 6 * e, i = new Uint16Array(t), r = 0, n = 0; r < t; r += 6, n += 4) i[r + 0] = n + 0, i[r + 1] = n + 1, i[r + 2] = n + 2, i[r + 3] = n + 0, i[r + 4] = n + 2, i[r + 5] = n + 3;
                        return i
                    }
                    i.__esModule = !0, i.default = r
                }, {}],
                124: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : window.location;
                        if (0 === e.indexOf("data:")) return "";
                        t = t || window.location, s || (s = document.createElement("a")), s.href = e, e = o.default.parse(s.href);
                        var i = !e.port && "" === t.port || e.port === t.port;
                        return e.hostname === t.hostname && i && e.protocol === t.protocol ? "" : "anonymous"
                    }
                    i.__esModule = !0, i.default = r;
                    var n = e("url"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n),
                        s = void 0
                }, {
                    url: 38
                }],
                125: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        if (e && e.__esModule) return e;
                        var t = {};
                        if (null != e)
                            for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                        return t.default = e, t
                    }

                    function n(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function o() {
                        return ++U
                    }

                    function s(e, t) {
                        return t = t || [], t[0] = (e >> 16 & 255) / 255, t[1] = (e >> 8 & 255) / 255, t[2] = (255 & e) / 255, t
                    }

                    function a(e) {
                        return e = e.toString(16), "#" + (e = "000000".substr(0, 6 - e.length) + e)
                    }

                    function l(e) {
                        return (255 * e[0] << 16) + (255 * e[1] << 8) + (255 * e[2] | 0)
                    }

                    function u(e, t) {
                        var i = P.default.RETINA_PREFIX.exec(e);
                        return i ? parseFloat(i[1]) : void 0 !== t ? t : 1
                    }

                    function c(e) {
                        var t = E.DATA_URI.exec(e);
                        if (t) return {
                            mediaType: t[1] ? t[1].toLowerCase() : void 0,
                            subType: t[2] ? t[2].toLowerCase() : void 0,
                            charset: t[3] ? t[3].toLowerCase() : void 0,
                            encoding: t[4] ? t[4].toLowerCase() : void 0,
                            data: t[5]
                        }
                    }

                    function h(e) {
                        var t = E.URL_FILE_EXTENSION.exec(e);
                        if (t) return t[1].toLowerCase()
                    }

                    function d(e) {
                        var t = E.SVG_SIZE.exec(e),
                            i = {};
                        return t && (i[t[1]] = Math.round(parseFloat(t[3])), i[t[5]] = Math.round(parseFloat(t[7]))), i
                    }

                    function p() {
                        G = !0
                    }

                    function f(e) {
                        if (!G) {
                            if (navigator.userAgent.toLowerCase().indexOf("chrome") > -1) {
                                var t = ["\n %c %c %c PixiJS " + E.VERSION + " - ✰ " + e + " ✰  %c  %c  http://www.pixijs.com/  %c %c ♥%c♥%c♥ \n\n", "background: #ff66a5; padding:5px 0;", "background: #ff66a5; padding:5px 0;", "color: #ff66a5; background: #030307; padding:5px 0;", "background: #ff66a5; padding:5px 0;", "background: #ffc3dc; padding:5px 0;", "background: #ff66a5; padding:5px 0;", "color: #ff2424; background: #fff; padding:5px 0;", "color: #ff2424; background: #fff; padding:5px 0;", "color: #ff2424; background: #fff; padding:5px 0;"];
                                window.console.log.apply(console, t)
                            } else window.console && window.console.log("PixiJS " + E.VERSION + " - " + e + " - http://www.pixijs.com/");
                            G = !0
                        }
                    }

                    function _() {
                        var e = {
                            stencil: !0,
                            failIfMajorPerformanceCaveat: !0
                        };
                        try {
                            if (!window.WebGLRenderingContext) return !1;
                            var t = document.createElement("canvas"),
                                i = t.getContext("webgl", e) || t.getContext("experimental-webgl", e),
                                r = !(!i || !i.getContextAttributes().stencil);
                            if (i) {
                                var n = i.getExtension("WEBGL_lose_context");
                                n && n.loseContext()
                            }
                            return i = null, r
                        } catch (e) {
                            return !1
                        }
                    }

                    function m(e) {
                        return 0 === e ? 0 : e < 0 ? -1 : 1
                    }

                    function g() {
                        var e = void 0;
                        for (e in z) z[e].destroy();
                        for (e in j) j[e].destroy()
                    }

                    function v() {
                        var e = void 0;
                        for (e in z) delete z[e];
                        for (e in j) delete j[e]
                    }

                    function y(e, t) {
                        return H[t ? 1 : 0][e]
                    }

                    function b(e, t) {
                        if (1 === t) return (255 * t << 24) + e;
                        if (0 === t) return 0;
                        var i = e >> 16 & 255,
                            r = e >> 8 & 255,
                            n = 255 & e;
                        return i = i * t + .5 | 0, r = r * t + .5 | 0, n = n * t + .5 | 0, (255 * t << 24) + (i << 16) + (r << 8) + n
                    }

                    function x(e, t, i, r) {
                        return i = i || new Float32Array(4), r || void 0 === r ? (i[0] = e[0] * t, i[1] = e[1] * t, i[2] = e[2] * t) : (i[0] = e[0], i[1] = e[1], i[2] = e[2]), i[3] = t, i
                    }

                    function T(e, t, i, r) {
                        return i = i || new Float32Array(4), i[0] = (e >> 16 & 255) / 255, i[1] = (e >> 8 & 255) / 255, i[2] = (255 & e) / 255, (r || void 0 === r) && (i[0] *= t, i[1] *= t, i[2] *= t), i[3] = t, i
                    }
                    i.__esModule = !0, i.premultiplyBlendMode = i.BaseTextureCache = i.TextureCache = i.earcut = i.mixins = i.pluginTarget = i.EventEmitter = i.removeItems = i.isMobile = void 0, i.uid = o, i.hex2rgb = s, i.hex2string = a, i.rgb2hex = l, i.getResolutionOfUrl = u, i.decomposeDataUri = c, i.getUrlFileExtension = h, i.getSvgSize = d, i.skipHello = p, i.sayHello = f, i.isWebGLSupported = _, i.sign = m, i.destroyTextureCache = g, i.clearTextureCache = v, i.correctBlendMode = y, i.premultiplyTint = b, i.premultiplyRgba = x, i.premultiplyTintToRgba = T;
                    var E = e("../const"),
                        S = e("../settings"),
                        P = n(S),
                        A = e("eventemitter3"),
                        C = n(A),
                        M = e("./pluginTarget"),
                        R = n(M),
                        O = e("./mixin"),
                        w = r(O),
                        I = e("ismobilejs"),
                        D = r(I),
                        L = e("remove-array-items"),
                        B = n(L),
                        F = e("./mapPremultipliedBlendModes"),
                        N = n(F),
                        V = e("earcut"),
                        k = n(V),
                        U = 0,
                        G = !1;
                    i.isMobile = D, i.removeItems = B.default, i.EventEmitter = C.default, i.pluginTarget = R.default, i.mixins = w, i.earcut = k.default;
                    var z = i.TextureCache = Object.create(null),
                        j = i.BaseTextureCache = Object.create(null),
                        H = i.premultiplyBlendMode = (0, N.default)()
                }, {
                    "../const": 46,
                    "../settings": 101,
                    "./mapPremultipliedBlendModes": 126,
                    "./mixin": 128,
                    "./pluginTarget": 129,
                    earcut: 2,
                    eventemitter3: 3,
                    ismobilejs: 4,
                    "remove-array-items": 31
                }],
                126: [function(e, t, i) {
                    "use strict";

                    function r() {
                        for (var e = [], t = [], i = 0; i < 32; i++) e[i] = i, t[i] = i;
                        e[n.BLEND_MODES.NORMAL_NPM] = n.BLEND_MODES.NORMAL, e[n.BLEND_MODES.ADD_NPM] = n.BLEND_MODES.ADD, e[n.BLEND_MODES.SCREEN_NPM] = n.BLEND_MODES.SCREEN, t[n.BLEND_MODES.NORMAL] = n.BLEND_MODES.NORMAL_NPM, t[n.BLEND_MODES.ADD] = n.BLEND_MODES.ADD_NPM, t[n.BLEND_MODES.SCREEN] = n.BLEND_MODES.SCREEN_NPM;
                        var r = [];
                        return r.push(t), r.push(e), r
                    }
                    i.__esModule = !0, i.default = r;
                    var n = e("../const")
                }, {
                    "../const": 46
                }],
                127: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return o.default.tablet || o.default.phone ? 4 : e
                    }
                    i.__esModule = !0, i.default = r;
                    var n = e("ismobilejs"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n)
                }, {
                    ismobilejs: 4
                }],
                128: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (e && t)
                            for (var i = Object.keys(t), r = 0; r < i.length; ++r) {
                                var n = i[r];
                                Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n))
                            }
                    }

                    function n(e, t) {
                        s.push(e, t)
                    }

                    function o() {
                        for (var e = 0; e < s.length; e += 2) r(s[e], s[e + 1]);
                        s.length = 0
                    }
                    i.__esModule = !0, i.mixin = r, i.delayMixin = n, i.performMixins = o;
                    var s = []
                }, {}],
                129: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        e.__plugins = {}, e.registerPlugin = function(t, i) {
                            e.__plugins[t] = i
                        }, e.prototype.initPlugins = function() {
                            this.plugins = this.plugins || {};
                            for (var t in e.__plugins) this.plugins[t] = new e.__plugins[t](this)
                        }, e.prototype.destroyPlugins = function() {
                            for (var e in this.plugins) this.plugins[e].destroy(), this.plugins[e] = null;
                            this.plugins = null
                        }
                    }
                    i.__esModule = !0, i.default = {
                        mixin: function(e) {
                            r(e)
                        }
                    }
                }, {}],
                130: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        var t = e.width,
                            i = e.height,
                            r = e.getContext("2d"),
                            n = r.getImageData(0, 0, t, i),
                            o = n.data,
                            s = o.length,
                            a = {
                                top: null,
                                left: null,
                                right: null,
                                bottom: null
                            },
                            l = null,
                            u = void 0,
                            c = void 0,
                            h = void 0;
                        for (u = 0; u < s; u += 4) 0 !== o[u + 3] && (c = u / 4 % t, h = ~~(u / 4 / t), null === a.top && (a.top = h), null === a.left ? a.left = c : c < a.left && (a.left = c), null === a.right ? a.right = c + 1 : a.right < c && (a.right = c + 1), null === a.bottom ? a.bottom = h : a.bottom < h && (a.bottom = h));
                        return null !== a.top && (t = a.right - a.left, i = a.bottom - a.top + 1, l = r.getImageData(a.left, a.top, t, i)), {
                            height: i,
                            width: t,
                            data: l
                        }
                    }
                    i.__esModule = !0, i.default = r
                }, {}],
                131: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        if (!o[e]) {
                            var t = (new Error).stack;
                            void 0 === t || (t = t.split("\n").splice(3).join("\n"), console.groupCollapsed), o[e] = !0
                        }
                    }

                    function n(e) {
                        var t = e.mesh,
                            i = e.particles,
                            n = e.extras,
                            o = e.filters,
                            s = e.prepare,
                            a = e.loaders,
                            l = e.interaction;
                        Object.defineProperties(e, {
                            SpriteBatch: {
                                get: function() {
                                    throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")
                                }
                            },
                            AssetLoader: {
                                get: function() {
                                    throw new ReferenceError("The loader system was overhauled in PixiJS v3, please see the new PIXI.loaders.Loader class.")
                                }
                            },
                            Stage: {
                                get: function() {
                                    return r("You do not need to use a PIXI Stage any more, you can simply render any container."), e.Container
                                }
                            },
                            DisplayObjectContainer: {
                                get: function() {
                                    return r("DisplayObjectContainer has been shortened to Container, please use Container from now on."), e.Container
                                }
                            },
                            Strip: {
                                get: function() {
                                    return r("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."), t.Mesh
                                }
                            },
                            Rope: {
                                get: function() {
                                    return r("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."), t.Rope
                                }
                            },
                            ParticleContainer: {
                                get: function() {
                                    return r("The ParticleContainer class has been moved to particles.ParticleContainer, please use particles.ParticleContainer from now on."), i.ParticleContainer
                                }
                            },
                            MovieClip: {
                                get: function() {
                                    return r("The MovieClip class has been moved to extras.AnimatedSprite, please use extras.AnimatedSprite."), n.AnimatedSprite
                                }
                            },
                            TilingSprite: {
                                get: function() {
                                    return r("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."), n.TilingSprite
                                }
                            },
                            BitmapText: {
                                get: function() {
                                    return r("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."), n.BitmapText
                                }
                            },
                            blendModes: {
                                get: function() {
                                    return r("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."), e.BLEND_MODES
                                }
                            },
                            scaleModes: {
                                get: function() {
                                    return r("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."), e.SCALE_MODES
                                }
                            },
                            BaseTextureCache: {
                                get: function() {
                                    return r("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."), e.utils.BaseTextureCache
                                }
                            },
                            TextureCache: {
                                get: function() {
                                    return r("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."), e.utils.TextureCache
                                }
                            },
                            math: {
                                get: function() {
                                    return r("The math namespace is deprecated, please access members already accessible on PIXI."), e
                                }
                            },
                            AbstractFilter: {
                                get: function() {
                                    return r("AstractFilter has been renamed to Filter, please use PIXI.Filter"), e.Filter
                                }
                            },
                            TransformManual: {
                                get: function() {
                                    return r("TransformManual has been renamed to TransformBase, please update your pixi-spine"), e.TransformBase
                                }
                            },
                            TARGET_FPMS: {
                                get: function() {
                                    return r("PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS"), e.settings.TARGET_FPMS
                                },
                                set: function(t) {
                                    r("PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS"), e.settings.TARGET_FPMS = t
                                }
                            },
                            FILTER_RESOLUTION: {
                                get: function() {
                                    return r("PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION"), e.settings.FILTER_RESOLUTION
                                },
                                set: function(t) {
                                    r("PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION"), e.settings.FILTER_RESOLUTION = t
                                }
                            },
                            RESOLUTION: {
                                get: function() {
                                    return r("PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION"), e.settings.RESOLUTION
                                },
                                set: function(t) {
                                    r("PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION"), e.settings.RESOLUTION = t
                                }
                            },
                            MIPMAP_TEXTURES: {
                                get: function() {
                                    return r("PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES"), e.settings.MIPMAP_TEXTURES
                                },
                                set: function(t) {
                                    r("PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES"), e.settings.MIPMAP_TEXTURES = t
                                }
                            },
                            SPRITE_BATCH_SIZE: {
                                get: function() {
                                    return r("PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE"), e.settings.SPRITE_BATCH_SIZE
                                },
                                set: function(t) {
                                    r("PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE"), e.settings.SPRITE_BATCH_SIZE = t
                                }
                            },
                            SPRITE_MAX_TEXTURES: {
                                get: function() {
                                    return r("PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES"), e.settings.SPRITE_MAX_TEXTURES
                                },
                                set: function(t) {
                                    r("PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES"), e.settings.SPRITE_MAX_TEXTURES = t
                                }
                            },
                            RETINA_PREFIX: {
                                get: function() {
                                    return r("PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX"), e.settings.RETINA_PREFIX
                                },
                                set: function(t) {
                                    r("PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX"), e.settings.RETINA_PREFIX = t
                                }
                            },
                            DEFAULT_RENDER_OPTIONS: {
                                get: function() {
                                    return r("PIXI.DEFAULT_RENDER_OPTIONS has been deprecated, please use PIXI.settings.DEFAULT_RENDER_OPTIONS"), e.settings.RENDER_OPTIONS
                                }
                            }
                        });
                        for (var u = [{
                                parent: "TRANSFORM_MODE",
                                target: "TRANSFORM_MODE"
                            }, {
                                parent: "GC_MODES",
                                target: "GC_MODE"
                            }, {
                                parent: "WRAP_MODES",
                                target: "WRAP_MODE"
                            }, {
                                parent: "SCALE_MODES",
                                target: "SCALE_MODE"
                            }, {
                                parent: "PRECISION",
                                target: "PRECISION_FRAGMENT"
                            }], c = 0; c < u.length; c++) ! function(t) {
                            var i = u[t];
                            Object.defineProperty(e[i.parent], "DEFAULT", {
                                get: function() {
                                    return r("PIXI." + i.parent + ".DEFAULT has been deprecated, please use PIXI.settings." + i.target), e.settings[i.target]
                                },
                                set: function(t) {
                                    r("PIXI." + i.parent + ".DEFAULT has been deprecated, please use PIXI.settings." + i.target), e.settings[i.target] = t
                                }
                            })
                        }(c);
                        Object.defineProperties(e.settings, {
                            PRECISION: {
                                get: function() {
                                    return r("PIXI.settings.PRECISION has been deprecated, please use PIXI.settings.PRECISION_FRAGMENT"), e.settings.PRECISION_FRAGMENT
                                },
                                set: function(t) {
                                    r("PIXI.settings.PRECISION has been deprecated, please use PIXI.settings.PRECISION_FRAGMENT"), e.settings.PRECISION_FRAGMENT = t
                                }
                            }
                        }), n.AnimatedSprite && Object.defineProperties(n, {
                            MovieClip: {
                                get: function() {
                                    return r("The MovieClip class has been renamed to AnimatedSprite, please use AnimatedSprite from now on."), n.AnimatedSprite
                                }
                            }
                        }), n && Object.defineProperties(n, {
                            TextureTransform: {
                                get: function() {
                                    return r("The TextureTransform class has been renamed to TextureMatrix, please use PIXI.TextureMatrix from now on."), e.TextureMatrix
                                }
                            }
                        }), e.DisplayObject.prototype.generateTexture = function(e, t, i) {
                            return r("generateTexture has moved to the renderer, please use renderer.generateTexture(displayObject)"), e.generateTexture(this, t, i)
                        }, e.Graphics.prototype.generateTexture = function(e, t) {
                            return r("graphics generate texture has moved to the renderer. Or to render a graphics to a texture using canvas please use generateCanvasTexture"), this.generateCanvasTexture(e, t)
                        }, e.GroupD8.isSwapWidthHeight = function(t) {
                            return r("GroupD8.isSwapWidthHeight was renamed to GroupD8.isVertical"), e.GroupD8.isVertical(t)
                        }, e.RenderTexture.prototype.render = function(e, t, i, n) {
                            this.legacyRenderer.render(e, this, i, t, !n), r("RenderTexture.render is now deprecated, please use renderer.render(displayObject, renderTexture)")
                        }, e.RenderTexture.prototype.getImage = function(e) {
                            return r("RenderTexture.getImage is now deprecated, please use renderer.extract.image(target)"), this.legacyRenderer.extract.image(e)
                        }, e.RenderTexture.prototype.getBase64 = function(e) {
                            return r("RenderTexture.getBase64 is now deprecated, please use renderer.extract.base64(target)"), this.legacyRenderer.extract.base64(e)
                        }, e.RenderTexture.prototype.getCanvas = function(e) {
                            return r("RenderTexture.getCanvas is now deprecated, please use renderer.extract.canvas(target)"), this.legacyRenderer.extract.canvas(e)
                        }, e.RenderTexture.prototype.getPixels = function(e) {
                            return r("RenderTexture.getPixels is now deprecated, please use renderer.extract.pixels(target)"), this.legacyRenderer.pixels(e)
                        }, e.Sprite.prototype.setTexture = function(e) {
                            this.texture = e, r("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")
                        }, n.BitmapText && (n.BitmapText.prototype.setText = function(e) {
                            this.text = e, r("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")
                        }), e.Text.prototype.setText = function(e) {
                            this.text = e, r("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")
                        }, e.Text.calculateFontProperties = function(t) {
                            return r("Text.calculateFontProperties is now deprecated, please use the TextMetrics.measureFont"), e.TextMetrics.measureFont(t)
                        }, Object.defineProperties(e.Text, {
                            fontPropertiesCache: {
                                get: function() {
                                    return r("Text.fontPropertiesCache is deprecated"), e.TextMetrics._fonts
                                }
                            },
                            fontPropertiesCanvas: {
                                get: function() {
                                    return r("Text.fontPropertiesCanvas is deprecated"), e.TextMetrics._canvas
                                }
                            },
                            fontPropertiesContext: {
                                get: function() {
                                    return r("Text.fontPropertiesContext is deprecated"), e.TextMetrics._context
                                }
                            }
                        }), e.Text.prototype.setStyle = function(e) {
                            this.style = e, r("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")
                        }, e.Text.prototype.determineFontProperties = function(t) {
                            return r("determineFontProperties is now deprecated, please use TextMetrics.measureFont method"), e.TextMetrics.measureFont(t)
                        }, e.Text.getFontStyle = function(t) {
                            return r("getFontStyle is now deprecated, please use TextStyle.toFontString() instead"), t = t || {}, t instanceof e.TextStyle || (t = new e.TextStyle(t)), t.toFontString()
                        }, Object.defineProperties(e.TextStyle.prototype, {
                            font: {
                                get: function() {
                                    r("text style property 'font' is now deprecated, please use the 'fontFamily', 'fontSize', 'fontStyle', 'fontVariant' and 'fontWeight' properties from now on");
                                    var e = "number" == typeof this._fontSize ? this._fontSize + "px" : this._fontSize;
                                    return this._fontStyle + " " + this._fontVariant + " " + this._fontWeight + " " + e + " " + this._fontFamily
                                },
                                set: function(e) {
                                    r("text style property 'font' is now deprecated, please use the 'fontFamily','fontSize',fontStyle','fontVariant' and 'fontWeight' properties from now on"), e.indexOf("italic") > 1 ? this._fontStyle = "italic" : e.indexOf("oblique") > -1 ? this._fontStyle = "oblique" : this._fontStyle = "normal", e.indexOf("small-caps") > -1 ? this._fontVariant = "small-caps" : this._fontVariant = "normal";
                                    var t = e.split(" "),
                                        i = -1;
                                    this._fontSize = 26;
                                    for (var n = 0; n < t.length; ++n)
                                        if (t[n].match(/(px|pt|em|%)/)) {
                                            i = n, this._fontSize = t[n];
                                            break
                                        }
                                    this._fontWeight = "normal";
                                    for (var o = 0; o < i; ++o)
                                        if (t[o].match(/(bold|bolder|lighter|100|200|300|400|500|600|700|800|900)/)) {
                                            this._fontWeight = t[o];
                                            break
                                        }
                                    if (i > -1 && i < t.length - 1) {
                                        this._fontFamily = "";
                                        for (var s = i + 1; s < t.length; ++s) this._fontFamily += t[s] + " ";
                                        this._fontFamily = this._fontFamily.slice(0, -1)
                                    } else this._fontFamily = "Arial";
                                    this.styleID++
                                }
                            }
                        }), e.Texture.prototype.setFrame = function(e) {
                            this.frame = e, r("setFrame is now deprecated, please use the frame property, e.g: myTexture.frame = frame;")
                        }, e.Texture.addTextureToCache = function(t, i) {
                            e.Texture.addToCache(t, i), r("Texture.addTextureToCache is deprecated, please use Texture.addToCache from now on.")
                        }, e.Texture.removeTextureFromCache = function(t) {
                            return r("Texture.removeTextureFromCache is deprecated, please use Texture.removeFromCache from now on. Be aware that Texture.removeFromCache does not automatically its BaseTexture from the BaseTextureCache. For that, use BaseTexture.removeFromCache"), e.BaseTexture.removeFromCache(t), e.Texture.removeFromCache(t)
                        }, Object.defineProperties(o, {
                            AbstractFilter: {
                                get: function() {
                                    return r("AstractFilter has been renamed to Filter, please use PIXI.Filter"), e.AbstractFilter
                                }
                            },
                            SpriteMaskFilter: {
                                get: function() {
                                    return r("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."), e.SpriteMaskFilter
                                }
                            },
                            VoidFilter: {
                                get: function() {
                                    return r("VoidFilter has been renamed to AlphaFilter, please use PIXI.filters.AlphaFilter"), o.AlphaFilter
                                }
                            }
                        }), e.utils.uuid = function() {
                            return r("utils.uuid() is deprecated, please use utils.uid() from now on."), e.utils.uid()
                        }, e.utils.canUseNewCanvasBlendModes = function() {
                            return r("utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on"), e.CanvasTinter.canUseMultiply
                        };
                        var h = !0;
                        if (Object.defineProperty(e.utils, "_saidHello", {
                                set: function(e) {
                                    e && (r("PIXI.utils._saidHello is deprecated, please use PIXI.utils.skipHello()"), this.skipHello()), h = e
                                },
                                get: function() {
                                    return h
                                }
                            }), s.BasePrepare && (s.BasePrepare.prototype.register = function(e, t) {
                                return r("renderer.plugins.prepare.register is now deprecated, please use renderer.plugins.prepare.registerFindHook & renderer.plugins.prepare.registerUploadHook"), e && this.registerFindHook(e), t && this.registerUploadHook(t), this
                            }), s.canvas && Object.defineProperty(s.canvas, "UPLOADS_PER_FRAME", {
                                set: function() {
                                    r("PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please set renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer")
                                },
                                get: function() {
                                    return r("PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please use renderer.plugins.prepare.limiter"), NaN
                                }
                            }), s.webgl && Object.defineProperty(s.webgl, "UPLOADS_PER_FRAME", {
                                set: function() {
                                    r("PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please set renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer")
                                },
                                get: function() {
                                    return r("PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please use renderer.plugins.prepare.limiter"), NaN
                                }
                            }), a.Loader) {
                            var d = a.Resource,
                                p = a.Loader;
                            Object.defineProperties(d.prototype, {
                                isJson: {
                                    get: function() {
                                        return r("The isJson property is deprecated, please use `resource.type === Resource.TYPE.JSON`."), this.type === d.TYPE.JSON
                                    }
                                },
                                isXml: {
                                    get: function() {
                                        return r("The isXml property is deprecated, please use `resource.type === Resource.TYPE.XML`."), this.type === d.TYPE.XML
                                    }
                                },
                                isImage: {
                                    get: function() {
                                        return r("The isImage property is deprecated, please use `resource.type === Resource.TYPE.IMAGE`."), this.type === d.TYPE.IMAGE
                                    }
                                },
                                isAudio: {
                                    get: function() {
                                        return r("The isAudio property is deprecated, please use `resource.type === Resource.TYPE.AUDIO`."), this.type === d.TYPE.AUDIO
                                    }
                                },
                                isVideo: {
                                    get: function() {
                                        return r("The isVideo property is deprecated, please use `resource.type === Resource.TYPE.VIDEO`."), this.type === d.TYPE.VIDEO
                                    }
                                }
                            }), Object.defineProperties(p.prototype, {
                                before: {
                                    get: function() {
                                        return r("The before() method is deprecated, please use pre()."), this.pre
                                    }
                                },
                                after: {
                                    get: function() {
                                        return r("The after() method is deprecated, please use use()."), this.use
                                    }
                                }
                            })
                        }
                        l.interactiveTarget && Object.defineProperty(l.interactiveTarget, "defaultCursor", {
                            set: function(e) {
                                r("Property defaultCursor has been replaced with 'cursor'. "), this.cursor = e
                            },
                            get: function() {
                                return r("Property defaultCursor has been replaced with 'cursor'. "), this.cursor
                            }
                        }), l.InteractionManager && (Object.defineProperty(l.InteractionManager, "defaultCursorStyle", {
                            set: function(e) {
                                r("Property defaultCursorStyle has been replaced with 'cursorStyles.default'. "), this.cursorStyles.default = e
                            },
                            get: function() {
                                return r("Property defaultCursorStyle has been replaced with 'cursorStyles.default'. "), this.cursorStyles.default
                            }
                        }), Object.defineProperty(l.InteractionManager, "currentCursorStyle", {
                            set: function(e) {
                                r("Property currentCursorStyle has been removed.See the currentCursorMode property, which works differently."), this.currentCursorMode = e
                            },
                            get: function() {
                                return r("Property currentCursorStyle has been removed.See the currentCursorMode property, which works differently."), this.currentCursorMode
                            }
                        }))
                    }
                    i.__esModule = !0, i.default = n;
                    var o = {}
                }, {}],
                132: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../../core"),
                        o = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(n),
                        s = new o.Rectangle,
                        a = function() {
                            function e(t) {
                                r(this, e), this.renderer = t, t.extract = this
                            }
                            return e.prototype.image = function(e) {
                                var t = new Image;
                                return t.src = this.base64(e), t
                            }, e.prototype.base64 = function(e) {
                                return this.canvas(e).toDataURL()
                            }, e.prototype.canvas = function(e) {
                                var t = this.renderer,
                                    i = void 0,
                                    r = void 0,
                                    n = void 0,
                                    a = void 0;
                                e && (a = e instanceof o.RenderTexture ? e : t.generateTexture(e)), a ? (i = a.baseTexture._canvasRenderTarget.context, r = a.baseTexture._canvasRenderTarget.resolution, n = a.frame) : (i = t.rootContext, n = s, n.width = this.renderer.width, n.height = this.renderer.height);
                                var l = n.width * r,
                                    u = n.height * r,
                                    c = new o.CanvasRenderTarget(l, u, 1),
                                    h = i.getImageData(n.x * r, n.y * r, l, u);
                                return c.context.putImageData(h, 0, 0), c.canvas
                            }, e.prototype.pixels = function(e) {
                                var t = this.renderer,
                                    i = void 0,
                                    r = void 0,
                                    n = void 0,
                                    a = void 0;
                                return e && (a = e instanceof o.RenderTexture ? e : t.generateTexture(e)), a ? (i = a.baseTexture._canvasRenderTarget.context, r = a.baseTexture._canvasRenderTarget.resolution, n = a.frame) : (i = t.rootContext, n = s, n.width = t.width, n.height = t.height), i.getImageData(0, 0, n.width * r, n.height * r).data
                            }, e.prototype.destroy = function() {
                                this.renderer.extract = null, this.renderer = null
                            }, e
                        }();
                    i.default = a, o.CanvasRenderer.registerPlugin("extract", a)
                }, {
                    "../../core": 65
                }],
                133: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0;
                    var n = e("./webgl/WebGLExtract");
                    Object.defineProperty(i, "webgl", {
                        enumerable: !0,
                        get: function() {
                            return r(n).default
                        }
                    });
                    var o = e("./canvas/CanvasExtract");
                    Object.defineProperty(i, "canvas", {
                        enumerable: !0,
                        get: function() {
                            return r(o).default
                        }
                    })
                }, {
                    "./canvas/CanvasExtract": 132,
                    "./webgl/WebGLExtract": 134
                }],
                134: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../../core"),
                        o = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(n),
                        s = new o.Rectangle,
                        a = function() {
                            function e(t) {
                                r(this, e), this.renderer = t, t.extract = this
                            }
                            return e.prototype.image = function(e) {
                                var t = new Image;
                                return t.src = this.base64(e), t
                            }, e.prototype.base64 = function(e) {
                                return this.canvas(e).toDataURL()
                            }, e.prototype.canvas = function(e) {
                                var t = this.renderer,
                                    i = void 0,
                                    r = void 0,
                                    n = void 0,
                                    a = !1,
                                    l = void 0,
                                    u = !1;
                                e && (e instanceof o.RenderTexture ? l = e : (l = this.renderer.generateTexture(e), u = !0)), l ? (i = l.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID], r = i.resolution, n = l.frame, a = !1) : (i = this.renderer.rootRenderTarget, r = i.resolution, a = !0, n = s, n.width = i.size.width, n.height = i.size.height);
                                var c = n.width * r,
                                    h = n.height * r,
                                    d = new o.CanvasRenderTarget(c, h, 1);
                                if (i) {
                                    t.bindRenderTarget(i);
                                    var p = new Uint8Array(4 * c * h),
                                        f = t.gl;
                                    f.readPixels(n.x * r, n.y * r, c, h, f.RGBA, f.UNSIGNED_BYTE, p);
                                    var _ = d.context.getImageData(0, 0, c, h);
                                    _.data.set(p), d.context.putImageData(_, 0, 0), a && (d.context.scale(1, -1), d.context.drawImage(d.canvas, 0, -h))
                                }
                                return u && l.destroy(!0), d.canvas
                            }, e.prototype.pixels = function(e) {
                                var t = this.renderer,
                                    i = void 0,
                                    r = void 0,
                                    n = void 0,
                                    a = void 0,
                                    l = !1;
                                e && (e instanceof o.RenderTexture ? a = e : (a = this.renderer.generateTexture(e), l = !0)), a ? (i = a.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID], r = i.resolution, n = a.frame) : (i = this.renderer.rootRenderTarget, r = i.resolution, n = s, n.width = i.size.width, n.height = i.size.height);
                                var u = n.width * r,
                                    c = n.height * r,
                                    h = new Uint8Array(4 * u * c);
                                if (i) {
                                    t.bindRenderTarget(i);
                                    var d = t.gl;
                                    d.readPixels(n.x * r, n.y * r, u, c, d.RGBA, d.UNSIGNED_BYTE, h)
                                }
                                return l && a.destroy(!0), h
                            }, e.prototype.destroy = function() {
                                this.renderer.extract = null, this.renderer = null
                            }, e
                        }();
                    i.default = a, o.WebGLRenderer.registerPlugin("extract", a)
                }, {
                    "../../core": 65
                }],
                135: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("../core"),
                        l = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(a),
                        u = function(e) {
                            function t(i, o) {
                                r(this, t);
                                var s = n(this, e.call(this, i[0] instanceof l.Texture ? i[0] : i[0].texture));
                                return s._textures = null, s._durations = null, s.textures = i, s._autoUpdate = !1 !== o, s.animationSpeed = 1, s.loop = !0, s.onComplete = null, s.onFrameChange = null, s.onLoop = null, s._currentTime = 0, s.playing = !1, s
                            }
                            return o(t, e), t.prototype.stop = function() {
                                this.playing && (this.playing = !1, this._autoUpdate && l.ticker.shared.remove(this.update, this))
                            }, t.prototype.play = function() {
                                this.playing || (this.playing = !0, this._autoUpdate && l.ticker.shared.add(this.update, this, l.UPDATE_PRIORITY.HIGH))
                            }, t.prototype.gotoAndStop = function(e) {
                                this.stop();
                                var t = this.currentFrame;
                                this._currentTime = e, t !== this.currentFrame && this.updateTexture()
                            }, t.prototype.gotoAndPlay = function(e) {
                                var t = this.currentFrame;
                                this._currentTime = e, t !== this.currentFrame && this.updateTexture(), this.play()
                            }, t.prototype.update = function(e) {
                                var t = this.animationSpeed * e,
                                    i = this.currentFrame;
                                if (null !== this._durations) {
                                    var r = this._currentTime % 1 * this._durations[this.currentFrame];
                                    for (r += t / 60 * 1e3; r < 0;) this._currentTime--, r += this._durations[this.currentFrame];
                                    var n = Math.sign(this.animationSpeed * e);
                                    for (this._currentTime = Math.floor(this._currentTime); r >= this._durations[this.currentFrame];) r -= this._durations[this.currentFrame] * n, this._currentTime += n;
                                    this._currentTime += r / this._durations[this.currentFrame]
                                } else this._currentTime += t;
                                this._currentTime < 0 && !this.loop ? (this.gotoAndStop(0), this.onComplete && this.onComplete()) : this._currentTime >= this._textures.length && !this.loop ? (this.gotoAndStop(this._textures.length - 1), this.onComplete && this.onComplete()) : i !== this.currentFrame && (this.loop && this.onLoop && (this.animationSpeed > 0 && this.currentFrame < i ? this.onLoop() : this.animationSpeed < 0 && this.currentFrame > i && this.onLoop()), this.updateTexture())
                            }, t.prototype.updateTexture = function() {
                                this._texture = this._textures[this.currentFrame], this._textureID = -1, this.cachedTint = 16777215, this.onFrameChange && this.onFrameChange(this.currentFrame)
                            }, t.prototype.destroy = function(t) {
                                this.stop(), e.prototype.destroy.call(this, t)
                            }, t.fromFrames = function(e) {
                                for (var i = [], r = 0; r < e.length; ++r) i.push(l.Texture.fromFrame(e[r]));
                                return new t(i)
                            }, t.fromImages = function(e) {
                                for (var i = [], r = 0; r < e.length; ++r) i.push(l.Texture.fromImage(e[r]));
                                return new t(i)
                            }, s(t, [{
                                key: "totalFrames",
                                get: function() {
                                    return this._textures.length
                                }
                            }, {
                                key: "textures",
                                get: function() {
                                    return this._textures
                                },
                                set: function(e) {
                                    if (e[0] instanceof l.Texture) this._textures = e, this._durations = null;
                                    else {
                                        this._textures = [], this._durations = [];
                                        for (var t = 0; t < e.length; t++) this._textures.push(e[t].texture), this._durations.push(e[t].time)
                                    }
                                    this.gotoAndStop(0), this.updateTexture()
                                }
                            }, {
                                key: "currentFrame",
                                get: function() {
                                    var e = Math.floor(this._currentTime) % this._textures.length;
                                    return e < 0 && (e += this._textures.length), e
                                }
                            }]), t
                        }(l.Sprite);
                    i.default = u
                }, {
                    "../core": 65
                }],
                136: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        l = e("../core"),
                        u = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(l),
                        c = e("../core/math/ObservablePoint"),
                        h = r(c),
                        d = e("../core/utils"),
                        p = e("../core/settings"),
                        f = r(p),
                        _ = function(e) {
                            function t(i) {
                                var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
                                n(this, t);
                                var s = o(this, e.call(this));
                                return s._textWidth = 0, s._textHeight = 0, s._glyphs = [], s._font = {
                                    tint: void 0 !== r.tint ? r.tint : 16777215,
                                    align: r.align || "left",
                                    name: null,
                                    size: 0
                                }, s.font = r.font, s._text = i, s._maxWidth = 0, s._maxLineHeight = 0, s._letterSpacing = 0, s._anchor = new h.default(function() {
                                    s.dirty = !0
                                }, s, 0, 0), s.dirty = !1, s.updateText(), s
                            }
                            return s(t, e), t.prototype.updateText = function() {
                                for (var e = t.fonts[this._font.name], i = this._font.size / e.size, r = new u.Point, n = [], o = [], s = this.text.replace(/(?:\r\n|\r)/g, "\n"), a = s.length, l = this._maxWidth * e.size / this._font.size, c = null, h = 0, d = 0, p = 0, f = -1, _ = 0, m = 0, g = 0, v = 0; v < a; v++) {
                                    var y = s.charCodeAt(v),
                                        b = s.charAt(v);
                                    if (/(?:\s)/.test(b) && (f = v, _ = h), "\r" !== b && "\n" !== b) {
                                        var x = e.chars[y];
                                        x && (c && x.kerning[c] && (r.x += x.kerning[c]), n.push({
                                            texture: x.texture,
                                            line: p,
                                            charCode: y,
                                            position: new u.Point(r.x + x.xOffset + this._letterSpacing / 2, r.y + x.yOffset)
                                        }), r.x += x.xAdvance + this._letterSpacing, h = r.x, g = Math.max(g, x.yOffset + x.texture.height), c = y, -1 !== f && l > 0 && r.x > l && (++m, u.utils.removeItems(n, 1 + f - m, 1 + v - f), v = f, f = -1, o.push(_), d = Math.max(d, _), p++, r.x = 0, r.y += e.lineHeight, c = null))
                                    } else o.push(h), d = Math.max(d, h), ++p, ++m, r.x = 0, r.y += e.lineHeight, c = null
                                }
                                var T = s.charAt(s.length - 1);
                                "\r" !== T && "\n" !== T && (/(?:\s)/.test(T) && (h = _), o.push(h), d = Math.max(d, h));
                                for (var E = [], S = 0; S <= p; S++) {
                                    var P = 0;
                                    "right" === this._font.align ? P = d - o[S] : "center" === this._font.align && (P = (d - o[S]) / 2), E.push(P)
                                }
                                for (var A = n.length, C = this.tint, M = 0; M < A; M++) {
                                    var R = this._glyphs[M];
                                    R ? R.texture = n[M].texture : (R = new u.Sprite(n[M].texture), this._glyphs.push(R)), R.position.x = (n[M].position.x + E[n[M].line]) * i, R.position.y = n[M].position.y * i, R.scale.x = R.scale.y = i, R.tint = C, R.parent || this.addChild(R)
                                }
                                for (var O = A; O < this._glyphs.length; ++O) this.removeChild(this._glyphs[O]);
                                if (this._textWidth = d * i, this._textHeight = (r.y + e.lineHeight) * i, 0 !== this.anchor.x || 0 !== this.anchor.y)
                                    for (var w = 0; w < A; w++) this._glyphs[w].x -= this._textWidth * this.anchor.x, this._glyphs[w].y -= this._textHeight * this.anchor.y;
                                this._maxLineHeight = g * i
                            }, t.prototype.updateTransform = function() {
                                this.validate(), this.containerUpdateTransform()
                            }, t.prototype.getLocalBounds = function() {
                                return this.validate(), e.prototype.getLocalBounds.call(this)
                            }, t.prototype.validate = function() {
                                this.dirty && (this.updateText(), this.dirty = !1)
                            }, t.registerFont = function(e, i) {
                                var r = {},
                                    n = e.getElementsByTagName("info")[0],
                                    o = e.getElementsByTagName("common")[0],
                                    s = e.getElementsByTagName("page"),
                                    a = (0, d.getResolutionOfUrl)(s[0].getAttribute("file"), f.default.RESOLUTION),
                                    l = {};
                                r.font = n.getAttribute("face"), r.size = parseInt(n.getAttribute("size"), 10), r.lineHeight = parseInt(o.getAttribute("lineHeight"), 10) / a, r.chars = {}, i instanceof u.Texture && (i = [i]);
                                for (var c = 0; c < s.length; c++) {
                                    var h = s[c].getAttribute("id"),
                                        p = s[c].getAttribute("file");
                                    l[h] = i instanceof Array ? i[c] : i[p]
                                }
                                for (var _ = e.getElementsByTagName("char"), m = 0; m < _.length; m++) {
                                    var g = _[m],
                                        v = parseInt(g.getAttribute("id"), 10),
                                        y = g.getAttribute("page") || 0,
                                        b = new u.Rectangle(parseInt(g.getAttribute("x"), 10) / a + l[y].frame.x / a, parseInt(g.getAttribute("y"), 10) / a + l[y].frame.y / a, parseInt(g.getAttribute("width"), 10) / a, parseInt(g.getAttribute("height"), 10) / a);
                                    r.chars[v] = {
                                        xOffset: parseInt(g.getAttribute("xoffset"), 10) / a,
                                        yOffset: parseInt(g.getAttribute("yoffset"), 10) / a,
                                        xAdvance: parseInt(g.getAttribute("xadvance"), 10) / a,
                                        kerning: {},
                                        texture: new u.Texture(l[y].baseTexture, b),
                                        page: y
                                    }
                                }
                                for (var x = e.getElementsByTagName("kerning"), T = 0; T < x.length; T++) {
                                    var E = x[T],
                                        S = parseInt(E.getAttribute("first"), 10) / a,
                                        P = parseInt(E.getAttribute("second"), 10) / a,
                                        A = parseInt(E.getAttribute("amount"), 10) / a;
                                    r.chars[P] && (r.chars[P].kerning[S] = A)
                                }
                                return t.fonts[r.font] = r, r
                            }, a(t, [{
                                key: "tint",
                                get: function() {
                                    return this._font.tint
                                },
                                set: function(e) {
                                    this._font.tint = "number" == typeof e && e >= 0 ? e : 16777215, this.dirty = !0
                                }
                            }, {
                                key: "align",
                                get: function() {
                                    return this._font.align
                                },
                                set: function(e) {
                                    this._font.align = e || "left", this.dirty = !0
                                }
                            }, {
                                key: "anchor",
                                get: function() {
                                    return this._anchor
                                },
                                set: function(e) {
                                    "number" == typeof e ? this._anchor.set(e) : this._anchor.copy(e)
                                }
                            }, {
                                key: "font",
                                get: function() {
                                    return this._font
                                },
                                set: function(e) {
                                    e && ("string" == typeof e ? (e = e.split(" "), this._font.name = 1 === e.length ? e[0] : e.slice(1).join(" "), this._font.size = e.length >= 2 ? parseInt(e[0], 10) : t.fonts[this._font.name].size) : (this._font.name = e.name, this._font.size = "number" == typeof e.size ? e.size : parseInt(e.size, 10)), this.dirty = !0)
                                }
                            }, {
                                key: "text",
                                get: function() {
                                    return this._text
                                },
                                set: function(e) {
                                    e = e.toString() || " ", this._text !== e && (this._text = e, this.dirty = !0)
                                }
                            }, {
                                key: "maxWidth",
                                get: function() {
                                    return this._maxWidth
                                },
                                set: function(e) {
                                    this._maxWidth !== e && (this._maxWidth = e, this.dirty = !0)
                                }
                            }, {
                                key: "maxLineHeight",
                                get: function() {
                                    return this.validate(), this._maxLineHeight
                                }
                            }, {
                                key: "textWidth",
                                get: function() {
                                    return this.validate(), this._textWidth
                                }
                            }, {
                                key: "letterSpacing",
                                get: function() {
                                    return this._letterSpacing
                                },
                                set: function(e) {
                                    this._letterSpacing !== e && (this._letterSpacing = e, this.dirty = !0)
                                }
                            }, {
                                key: "textHeight",
                                get: function() {
                                    return this.validate(), this._textHeight
                                }
                            }]), t
                        }(u.Container);
                    i.default = _, _.fonts = {}
                }, {
                    "../core": 65,
                    "../core/math/ObservablePoint": 68,
                    "../core/settings": 101,
                    "../core/utils": 125
                }],
                137: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("../core"),
                        l = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(a),
                        u = e("../core/sprites/canvas/CanvasTinter"),
                        c = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(u),
                        h = new l.Point,
                        d = function(e) {
                            function t(i) {
                                var o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 100,
                                    s = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 100;
                                r(this, t);
                                var a = n(this, e.call(this, i));
                                return a.tileTransform = new l.TransformStatic, a._width = o, a._height = s, a._canvasPattern = null, a.uvTransform = i.transform || new l.TextureMatrix(i), a.pluginName = "tilingSprite", a.uvRespectAnchor = !1, a
                            }
                            return o(t, e), t.prototype._onTextureUpdate = function() {
                                this.uvTransform && (this.uvTransform.texture = this._texture), this.cachedTint = 16777215
                            }, t.prototype._renderWebGL = function(e) {
                                var t = this._texture;
                                t && t.valid && (this.tileTransform.updateLocalTransform(), this.uvTransform.update(), e.setObjectRenderer(e.plugins[this.pluginName]), e.plugins[this.pluginName].render(this))
                            }, t.prototype._renderCanvas = function(e) {
                                var t = this._texture;
                                if (t.baseTexture.hasLoaded) {
                                    var i = e.context,
                                        r = this.worldTransform,
                                        n = e.resolution,
                                        o = 2 === t.rotate,
                                        s = t.baseTexture,
                                        a = s.resolution,
                                        u = this.tilePosition.x / this.tileScale.x % t.orig.width * a,
                                        h = this.tilePosition.y / this.tileScale.y % t.orig.height * a;
                                    if (this._textureID !== this._texture._updateID || this.cachedTint !== this.tint) {
                                        this._textureID = this._texture._updateID;
                                        var d = new l.CanvasRenderTarget(t.orig.width, t.orig.height, a);
                                        if (16777215 !== this.tint) this.tintedTexture = c.default.getTintedTexture(this, this.tint), d.context.drawImage(this.tintedTexture, 0, 0);
                                        else {
                                            var p = t._frame.x * a,
                                                f = t._frame.y * a,
                                                _ = t._frame.width * a,
                                                m = t._frame.height * a,
                                                g = (t.trim ? t.trim.width : t.orig.width) * a,
                                                v = (t.trim ? t.trim.height : t.orig.height) * a,
                                                y = (t.trim ? t.trim.x : 0) * a,
                                                b = (t.trim ? t.trim.y : 0) * a;
                                            o ? (d.context.rotate(-Math.PI / 2), d.context.translate(-v, 0), d.context.drawImage(s.source, p, f, _, m, -b, y, v, g)) : d.context.drawImage(s.source, p, f, _, m, y, b, g, v)
                                        }
                                        this.cachedTint = this.tint, this._canvasPattern = d.context.createPattern(d.canvas, "repeat")
                                    }
                                    i.globalAlpha = this.worldAlpha, i.setTransform(r.a * n, r.b * n, r.c * n, r.d * n, r.tx * n, r.ty * n), e.setBlendMode(this.blendMode), i.fillStyle = this._canvasPattern, i.scale(this.tileScale.x / a, this.tileScale.y / a);
                                    var x = this.anchor.x * -this._width * a,
                                        T = this.anchor.y * -this._height * a;
                                    this.uvRespectAnchor ? (i.translate(u, h), i.fillRect(-u + x, -h + T, this._width / this.tileScale.x * a, this._height / this.tileScale.y * a)) : (i.translate(u + x, h + T), i.fillRect(-u, -h, this._width / this.tileScale.x * a, this._height / this.tileScale.y * a))
                                }
                            }, t.prototype._calculateBounds = function() {
                                var e = this._width * -this._anchor._x,
                                    t = this._height * -this._anchor._y,
                                    i = this._width * (1 - this._anchor._x),
                                    r = this._height * (1 - this._anchor._y);
                                this._bounds.addFrame(this.transform, e, t, i, r)
                            }, t.prototype.getLocalBounds = function(t) {
                                return 0 === this.children.length ? (this._bounds.minX = this._width * -this._anchor._x, this._bounds.minY = this._height * -this._anchor._y, this._bounds.maxX = this._width * (1 - this._anchor._x), this._bounds.maxY = this._height * (1 - this._anchor._y), t || (this._localBoundsRect || (this._localBoundsRect = new l.Rectangle), t = this._localBoundsRect), this._bounds.getRectangle(t)) : e.prototype.getLocalBounds.call(this, t)
                            }, t.prototype.containsPoint = function(e) {
                                this.worldTransform.applyInverse(e, h);
                                var t = this._width,
                                    i = this._height,
                                    r = -t * this.anchor._x;
                                if (h.x >= r && h.x < r + t) {
                                    var n = -i * this.anchor._y;
                                    if (h.y >= n && h.y < n + i) return !0
                                }
                                return !1
                            }, t.prototype.destroy = function(t) {
                                e.prototype.destroy.call(this, t), this.tileTransform = null, this.uvTransform = null
                            }, t.from = function(e, i, r) {
                                return new t(l.Texture.from(e), i, r)
                            }, t.fromFrame = function(e, i, r) {
                                var n = l.utils.TextureCache[e];
                                if (!n) throw new Error('The frameId "' + e + '" does not exist in the texture cache ' + this);
                                return new t(n, i, r)
                            }, t.fromImage = function(e, i, r, n, o) {
                                return new t(l.Texture.fromImage(e, n, o), i, r)
                            }, s(t, [{
                                key: "clampMargin",
                                get: function() {
                                    return this.uvTransform.clampMargin
                                },
                                set: function(e) {
                                    this.uvTransform.clampMargin = e, this.uvTransform.update(!0)
                                }
                            }, {
                                key: "tileScale",
                                get: function() {
                                    return this.tileTransform.scale
                                },
                                set: function(e) {
                                    this.tileTransform.scale.copy(e)
                                }
                            }, {
                                key: "tilePosition",
                                get: function() {
                                    return this.tileTransform.position
                                },
                                set: function(e) {
                                    this.tileTransform.position.copy(e)
                                }
                            }, {
                                key: "width",
                                get: function() {
                                    return this._width
                                },
                                set: function(e) {
                                    this._width = e
                                }
                            }, {
                                key: "height",
                                get: function() {
                                    return this._height
                                },
                                set: function(e) {
                                    this._height = e
                                }
                            }]), t
                        }(l.Sprite);
                    i.default = d
                }, {
                    "../core": 65,
                    "../core/sprites/canvas/CanvasTinter": 104
                }],
                138: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    var o = e("../core"),
                        s = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(o),
                        a = e("../core/textures/Texture"),
                        l = r(a),
                        u = e("../core/textures/BaseTexture"),
                        c = r(u),
                        h = e("../core/utils"),
                        d = s.DisplayObject,
                        p = new s.Matrix;
                    d.prototype._cacheAsBitmap = !1, d.prototype._cacheData = !1;
                    var f = function e() {
                        n(this, e), this.textureCacheId = null, this.originalRenderWebGL = null, this.originalRenderCanvas = null, this.originalCalculateBounds = null, this.originalGetLocalBounds = null, this.originalUpdateTransform = null, this.originalHitTest = null, this.originalDestroy = null, this.originalMask = null, this.originalFilterArea = null, this.sprite = null
                    };
                    Object.defineProperties(d.prototype, {
                        cacheAsBitmap: {
                            get: function() {
                                return this._cacheAsBitmap
                            },
                            set: function(e) {
                                if (this._cacheAsBitmap !== e) {
                                    this._cacheAsBitmap = e;
                                    var t = void 0;
                                    e ? (this._cacheData || (this._cacheData = new f), t = this._cacheData, t.originalRenderWebGL = this.renderWebGL, t.originalRenderCanvas = this.renderCanvas, t.originalUpdateTransform = this.updateTransform, t.originalCalculateBounds = this._calculateBounds, t.originalGetLocalBounds = this.getLocalBounds, t.originalDestroy = this.destroy, t.originalContainsPoint = this.containsPoint, t.originalMask = this._mask, t.originalFilterArea = this.filterArea, this.renderWebGL = this._renderCachedWebGL, this.renderCanvas = this._renderCachedCanvas, this.destroy = this._cacheAsBitmapDestroy) : (t = this._cacheData, t.sprite && this._destroyCachedDisplayObject(), this.renderWebGL = t.originalRenderWebGL, this.renderCanvas = t.originalRenderCanvas, this._calculateBounds = t.originalCalculateBounds, this.getLocalBounds = t.originalGetLocalBounds, this.destroy = t.originalDestroy, this.updateTransform = t.originalUpdateTransform, this.containsPoint = t.originalContainsPoint, this._mask = t.originalMask, this.filterArea = t.originalFilterArea)
                                }
                            }
                        }
                    }), d.prototype._renderCachedWebGL = function(e) {
                        !this.visible || this.worldAlpha <= 0 || !this.renderable || (this._initCachedDisplayObject(e), this._cacheData.sprite.transform._worldID = this.transform._worldID, this._cacheData.sprite.worldAlpha = this.worldAlpha, this._cacheData.sprite._renderWebGL(e))
                    }, d.prototype._initCachedDisplayObject = function(e) {
                        if (!this._cacheData || !this._cacheData.sprite) {
                            var t = this.alpha;
                            this.alpha = 1, e.currentRenderer.flush();
                            var i = this.getLocalBounds().clone();
                            if (this._filters && this._filters.length) {
                                var r = this._filters[0].padding;
                                i.pad(r)
                            }
                            i.ceil(s.settings.RESOLUTION);
                            var n = e._activeRenderTarget,
                                o = e.filterManager.filterStack,
                                a = s.RenderTexture.create(i.width, i.height),
                                u = "cacheAsBitmap_" + (0, h.uid)();
                            this._cacheData.textureCacheId = u, c.default.addToCache(a.baseTexture, u), l.default.addToCache(a, u);
                            var d = p;
                            d.tx = -i.x, d.ty = -i.y, this.transform.worldTransform.identity(), this.renderWebGL = this._cacheData.originalRenderWebGL, e.render(this, a, !0, d, !0), e.bindRenderTarget(n), e.filterManager.filterStack = o, this.renderWebGL = this._renderCachedWebGL, this.updateTransform = this.displayObjectUpdateTransform, this._mask = null, this.filterArea = null;
                            var f = new s.Sprite(a);
                            f.transform.worldTransform = this.transform.worldTransform, f.anchor.x = -i.x / i.width, f.anchor.y = -i.y / i.height, f.alpha = t, f._bounds = this._bounds, this._calculateBounds = this._calculateCachedBounds, this.getLocalBounds = this._getCachedLocalBounds, this._cacheData.sprite = f, this.transform._parentID = -1, this.parent ? this.updateTransform() : (this.parent = e._tempDisplayObjectParent, this.updateTransform(), this.parent = null), this.containsPoint = f.containsPoint.bind(f)
                        }
                    }, d.prototype._renderCachedCanvas = function(e) {
                        !this.visible || this.worldAlpha <= 0 || !this.renderable || (this._initCachedDisplayObjectCanvas(e), this._cacheData.sprite.worldAlpha = this.worldAlpha, this._cacheData.sprite._renderCanvas(e))
                    }, d.prototype._initCachedDisplayObjectCanvas = function(e) {
                        if (!this._cacheData || !this._cacheData.sprite) {
                            var t = this.getLocalBounds(),
                                i = this.alpha;
                            this.alpha = 1;
                            var r = e.context;
                            t.ceil(s.settings.RESOLUTION);
                            var n = s.RenderTexture.create(t.width, t.height),
                                o = "cacheAsBitmap_" + (0, h.uid)();
                            this._cacheData.textureCacheId = o, c.default.addToCache(n.baseTexture, o), l.default.addToCache(n, o);
                            var a = p;
                            this.transform.localTransform.copy(a), a.invert(), a.tx -= t.x, a.ty -= t.y, this.renderCanvas = this._cacheData.originalRenderCanvas, e.render(this, n, !0, a, !1), e.context = r, this.renderCanvas = this._renderCachedCanvas, this.calculateBounds = this._calculateCachedBounds, this._mask = null, this.filterArea = null;
                            var u = new s.Sprite(n);
                            u.transform.worldTransform = this.transform.worldTransform, u.anchor.x = -t.x / t.width, u.anchor.y = -t.y / t.height,
                                u._bounds = this._bounds, u.alpha = i, this.parent ? this.updateTransform() : (this.parent = e._tempDisplayObjectParent, this.updateTransform(), this.parent = null), this.updateTransform = this.displayObjectUpdateTransform, this._cacheData.sprite = u, this.containsPoint = u.containsPoint.bind(u)
                        }
                    }, d.prototype._calculateCachedBounds = function() {
                        this._bounds.clear(), this._cacheData.sprite.transform._worldID = this.transform._worldID, this._cacheData.sprite._calculateBounds(), this._lastBoundsID = this._boundsID
                    }, d.prototype._getCachedLocalBounds = function() {
                        return this._cacheData.sprite.getLocalBounds()
                    }, d.prototype._destroyCachedDisplayObject = function() {
                        this._cacheData.sprite._texture.destroy(!0), this._cacheData.sprite = null, c.default.removeFromCache(this._cacheData.textureCacheId), l.default.removeFromCache(this._cacheData.textureCacheId), this._cacheData.textureCacheId = null
                    }, d.prototype._cacheAsBitmapDestroy = function(e) {
                        this.cacheAsBitmap = !1, this.destroy(e)
                    }
                }, {
                    "../core": 65,
                    "../core/textures/BaseTexture": 112,
                    "../core/textures/Texture": 115,
                    "../core/utils": 125
                }],
                139: [function(e, t, i) {
                    "use strict";
                    var r = e("../core"),
                        n = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(r);
                    n.DisplayObject.prototype.name = null, n.Container.prototype.getChildByName = function(e) {
                        for (var t = 0; t < this.children.length; t++)
                            if (this.children[t].name === e) return this.children[t];
                        return null
                    }
                }, {
                    "../core": 65
                }],
                140: [function(e, t, i) {
                    "use strict";
                    var r = e("../core"),
                        n = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(r);
                    n.DisplayObject.prototype.getGlobalPosition = function() {
                        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new n.Point,
                            t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
                        return this.parent ? this.parent.toGlobal(this.position, e, t) : (e.x = this.position.x, e.y = this.position.y), e
                    }
                }, {
                    "../core": 65
                }],
                141: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0, i.BitmapText = i.TilingSpriteRenderer = i.TilingSprite = i.AnimatedSprite = void 0;
                    var n = e("./AnimatedSprite");
                    Object.defineProperty(i, "AnimatedSprite", {
                        enumerable: !0,
                        get: function() {
                            return r(n).default
                        }
                    });
                    var o = e("./TilingSprite");
                    Object.defineProperty(i, "TilingSprite", {
                        enumerable: !0,
                        get: function() {
                            return r(o).default
                        }
                    });
                    var s = e("./webgl/TilingSpriteRenderer");
                    Object.defineProperty(i, "TilingSpriteRenderer", {
                        enumerable: !0,
                        get: function() {
                            return r(s).default
                        }
                    });
                    var a = e("./BitmapText");
                    Object.defineProperty(i, "BitmapText", {
                        enumerable: !0,
                        get: function() {
                            return r(a).default
                        }
                    }), e("./cacheAsBitmap"), e("./getChildByName"), e("./getGlobalPosition")
                }, {
                    "./AnimatedSprite": 135,
                    "./BitmapText": 136,
                    "./TilingSprite": 137,
                    "./cacheAsBitmap": 138,
                    "./getChildByName": 139,
                    "./getGlobalPosition": 140,
                    "./webgl/TilingSpriteRenderer": 142
                }],
                142: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = e("../../core"),
                        a = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(s),
                        l = e("../../core/const"),
                        u = (e("path"), new a.Matrix),
                        c = function(e) {
                            function t(i) {
                                r(this, t);
                                var o = n(this, e.call(this, i));
                                return o.shader = null, o.simpleShader = null, o.quad = null, o
                            }
                            return o(t, e), t.prototype.onContextChange = function() {
                                var e = this.renderer.gl;
                                this.shader = new a.Shader(e, "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n", "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n    vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\n    coord = (uMapCoord * vec3(coord, 1.0)).xy;\n    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n    vec4 sample = texture2D(uSampler, coord);\n    gl_FragColor = sample * uColor;\n}\n"), this.simpleShader = new a.Shader(e, "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n", "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n    vec4 sample = texture2D(uSampler, vTextureCoord);\n    gl_FragColor = sample * uColor;\n}\n"), this.renderer.bindVao(null), this.quad = new a.Quad(e, this.renderer.state.attribState), this.quad.initVao(this.shader)
                            }, t.prototype.render = function(e) {
                                var t = this.renderer,
                                    i = this.quad;
                                t.bindVao(i.vao);
                                var r = i.vertices;
                                r[0] = r[6] = e._width * -e.anchor.x, r[1] = r[3] = e._height * -e.anchor.y, r[2] = r[4] = e._width * (1 - e.anchor.x), r[5] = r[7] = e._height * (1 - e.anchor.y), e.uvRespectAnchor && (r = i.uvs, r[0] = r[6] = -e.anchor.x, r[1] = r[3] = -e.anchor.y, r[2] = r[4] = 1 - e.anchor.x, r[5] = r[7] = 1 - e.anchor.y), i.upload();
                                var n = e._texture,
                                    o = n.baseTexture,
                                    s = e.tileTransform.localTransform,
                                    c = e.uvTransform,
                                    h = o.isPowerOfTwo && n.frame.width === o.width && n.frame.height === o.height;
                                h && (o._glTextures[t.CONTEXT_UID] ? h = o.wrapMode !== l.WRAP_MODES.CLAMP : o.wrapMode === l.WRAP_MODES.CLAMP && (o.wrapMode = l.WRAP_MODES.REPEAT));
                                var d = h ? this.simpleShader : this.shader;
                                t.bindShader(d);
                                var p = n.width,
                                    f = n.height,
                                    _ = e._width,
                                    m = e._height;
                                u.set(s.a * p / _, s.b * p / m, s.c * f / _, s.d * f / m, s.tx / _, s.ty / m), u.invert(), h ? u.prepend(c.mapCoord) : (d.uniforms.uMapCoord = c.mapCoord.toArray(!0), d.uniforms.uClampFrame = c.uClampFrame, d.uniforms.uClampOffset = c.uClampOffset), d.uniforms.uTransform = u.toArray(!0), d.uniforms.uColor = a.utils.premultiplyTintToRgba(e.tint, e.worldAlpha, d.uniforms.uColor, o.premultipliedAlpha), d.uniforms.translationMatrix = e.transform.worldTransform.toArray(!0), d.uniforms.uSampler = t.bindTexture(n), t.setBlendMode(a.utils.correctBlendMode(e.blendMode, o.premultipliedAlpha)), i.vao.draw(this.renderer.gl.TRIANGLES, 6, 0)
                            }, t
                        }(a.ObjectRenderer);
                    i.default = c, a.WebGLRenderer.registerPlugin("tilingSprite", c)
                }, {
                    "../../core": 65,
                    "../../core/const": 46,
                    path: 8
                }],
                143: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("../../core"),
                        l = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(a),
                        u = (e("path"), function(e) {
                            function t() {
                                var i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1;
                                r(this, t);
                                var o = n(this, e.call(this, "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}", "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n   gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n"));
                                return o.alpha = i, o.glShaderKey = "alpha", o
                            }
                            return o(t, e), s(t, [{
                                key: "alpha",
                                get: function() {
                                    return this.uniforms.uAlpha
                                },
                                set: function(e) {
                                    this.uniforms.uAlpha = e
                                }
                            }]), t
                        }(l.Filter));
                    i.default = u
                }, {
                    "../../core": 65,
                    path: 8
                }],
                144: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        l = e("../../core"),
                        u = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(l),
                        c = e("./BlurXFilter"),
                        h = r(c),
                        d = e("./BlurYFilter"),
                        p = r(d),
                        f = function(e) {
                            function t(i, r, s, a) {
                                n(this, t);
                                var l = o(this, e.call(this));
                                return l.blurXFilter = new h.default(i, r, s, a), l.blurYFilter = new p.default(i, r, s, a), l.padding = 0, l.resolution = s || u.settings.RESOLUTION, l.quality = r || 4, l.blur = i || 8, l
                            }
                            return s(t, e), t.prototype.apply = function(e, t, i) {
                                var r = e.getRenderTarget(!0);
                                this.blurXFilter.apply(e, t, r, !0), this.blurYFilter.apply(e, r, i, !1), e.returnRenderTarget(r)
                            }, a(t, [{
                                key: "blur",
                                get: function() {
                                    return this.blurXFilter.blur
                                },
                                set: function(e) {
                                    this.blurXFilter.blur = this.blurYFilter.blur = e, this.padding = 2 * Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength))
                                }
                            }, {
                                key: "quality",
                                get: function() {
                                    return this.blurXFilter.quality
                                },
                                set: function(e) {
                                    this.blurXFilter.quality = this.blurYFilter.quality = e
                                }
                            }, {
                                key: "blurX",
                                get: function() {
                                    return this.blurXFilter.blur
                                },
                                set: function(e) {
                                    this.blurXFilter.blur = e, this.padding = 2 * Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength))
                                }
                            }, {
                                key: "blurY",
                                get: function() {
                                    return this.blurYFilter.blur
                                },
                                set: function(e) {
                                    this.blurYFilter.blur = e, this.padding = 2 * Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength))
                                }
                            }, {
                                key: "blendMode",
                                get: function() {
                                    return this.blurYFilter._blendMode
                                },
                                set: function(e) {
                                    this.blurYFilter._blendMode = e
                                }
                            }]), t
                        }(u.Filter);
                    i.default = f
                }, {
                    "../../core": 65,
                    "./BlurXFilter": 145,
                    "./BlurYFilter": 146
                }],
                145: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        l = e("../../core"),
                        u = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(l),
                        c = e("./generateBlurVertSource"),
                        h = r(c),
                        d = e("./generateBlurFragSource"),
                        p = r(d),
                        f = e("./getMaxBlurKernelSize"),
                        _ = r(f),
                        m = function(e) {
                            function t(i, r, s, a) {
                                n(this, t), a = a || 5;
                                var l = (0, h.default)(a, !0),
                                    c = (0, p.default)(a),
                                    d = o(this, e.call(this, l, c));
                                return d.resolution = s || u.settings.RESOLUTION, d._quality = 0, d.quality = r || 4, d.strength = i || 8, d.firstRun = !0, d
                            }
                            return s(t, e), t.prototype.apply = function(e, t, i, r) {
                                if (this.firstRun) {
                                    var n = e.renderer.gl,
                                        o = (0, _.default)(n);
                                    this.vertexSrc = (0, h.default)(o, !0), this.fragmentSrc = (0, p.default)(o), this.firstRun = !1
                                }
                                if (this.uniforms.strength = 1 / i.size.width * (i.size.width / t.size.width), this.uniforms.strength *= this.strength, this.uniforms.strength /= this.passes, 1 === this.passes) e.applyFilter(this, t, i, r);
                                else {
                                    for (var s = e.getRenderTarget(!0), a = t, l = s, u = 0; u < this.passes - 1; u++) {
                                        e.applyFilter(this, a, l, !0);
                                        var c = l;
                                        l = a, a = c
                                    }
                                    e.applyFilter(this, a, i, r), e.returnRenderTarget(s)
                                }
                            }, a(t, [{
                                key: "blur",
                                get: function() {
                                    return this.strength
                                },
                                set: function(e) {
                                    this.padding = 2 * Math.abs(e), this.strength = e
                                }
                            }, {
                                key: "quality",
                                get: function() {
                                    return this._quality
                                },
                                set: function(e) {
                                    this._quality = e, this.passes = e
                                }
                            }]), t
                        }(u.Filter);
                    i.default = m
                }, {
                    "../../core": 65,
                    "./generateBlurFragSource": 147,
                    "./generateBlurVertSource": 148,
                    "./getMaxBlurKernelSize": 149
                }],
                146: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        l = e("../../core"),
                        u = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(l),
                        c = e("./generateBlurVertSource"),
                        h = r(c),
                        d = e("./generateBlurFragSource"),
                        p = r(d),
                        f = e("./getMaxBlurKernelSize"),
                        _ = r(f),
                        m = function(e) {
                            function t(i, r, s, a) {
                                n(this, t), a = a || 5;
                                var l = (0, h.default)(a, !1),
                                    c = (0, p.default)(a),
                                    d = o(this, e.call(this, l, c));
                                return d.resolution = s || u.settings.RESOLUTION, d._quality = 0, d.quality = r || 4, d.strength = i || 8, d.firstRun = !0, d
                            }
                            return s(t, e), t.prototype.apply = function(e, t, i, r) {
                                if (this.firstRun) {
                                    var n = e.renderer.gl,
                                        o = (0, _.default)(n);
                                    this.vertexSrc = (0, h.default)(o, !1), this.fragmentSrc = (0, p.default)(o), this.firstRun = !1
                                }
                                if (this.uniforms.strength = 1 / i.size.height * (i.size.height / t.size.height), this.uniforms.strength *= this.strength, this.uniforms.strength /= this.passes, 1 === this.passes) e.applyFilter(this, t, i, r);
                                else {
                                    for (var s = e.getRenderTarget(!0), a = t, l = s, u = 0; u < this.passes - 1; u++) {
                                        e.applyFilter(this, a, l, !0);
                                        var c = l;
                                        l = a, a = c
                                    }
                                    e.applyFilter(this, a, i, r), e.returnRenderTarget(s)
                                }
                            }, a(t, [{
                                key: "blur",
                                get: function() {
                                    return this.strength
                                },
                                set: function(e) {
                                    this.padding = 2 * Math.abs(e), this.strength = e
                                }
                            }, {
                                key: "quality",
                                get: function() {
                                    return this._quality
                                },
                                set: function(e) {
                                    this._quality = e, this.passes = e
                                }
                            }]), t
                        }(u.Filter);
                    i.default = m
                }, {
                    "../../core": 65,
                    "./generateBlurFragSource": 147,
                    "./generateBlurVertSource": 148,
                    "./getMaxBlurKernelSize": 149
                }],
                147: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        for (var t = n[e], i = t.length, r = o, s = "", a = "gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;", l = void 0, u = 0; u < e; u++) {
                            var c = a.replace("%index%", u);
                            l = u, u >= i && (l = e - u - 1), c = c.replace("%value%", t[l]), s += c, s += "\n"
                        }
                        return r = r.replace("%blur%", s), r = r.replace("%size%", e)
                    }
                    i.__esModule = !0, i.default = r;
                    var n = {
                            5: [.153388, .221461, .250301],
                            7: [.071303, .131514, .189879, .214607],
                            9: [.028532, .067234, .124009, .179044, .20236],
                            11: [.0093, .028002, .065984, .121703, .175713, .198596],
                            13: [.002406, .009255, .027867, .065666, .121117, .174868, .197641],
                            15: [489e-6, .002403, .009246, .02784, .065602, .120999, .174697, .197448]
                        },
                        o = ["varying vec2 vBlurTexCoords[%size%];", "uniform sampler2D uSampler;", "void main(void)", "{", "    gl_FragColor = vec4(0.0);", "    %blur%", "}"].join("\n")
                }, {}],
                148: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        var i = Math.ceil(e / 2),
                            r = n,
                            o = "",
                            s = void 0;
                        s = t ? "vBlurTexCoords[%index%] = aTextureCoord + vec2(%sampleIndex% * strength, 0.0);" : "vBlurTexCoords[%index%] = aTextureCoord + vec2(0.0, %sampleIndex% * strength);";
                        for (var a = 0; a < e; a++) {
                            var l = s.replace("%index%", a);
                            l = l.replace("%sampleIndex%", a - (i - 1) + ".0"), o += l, o += "\n"
                        }
                        return r = r.replace("%blur%", o), r = r.replace("%size%", e)
                    }
                    i.__esModule = !0, i.default = r;
                    var n = ["attribute vec2 aVertexPosition;", "attribute vec2 aTextureCoord;", "uniform float strength;", "uniform mat3 projectionMatrix;", "varying vec2 vBlurTexCoords[%size%];", "void main(void)", "{", "gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);", "%blur%", "}"].join("\n")
                }, {}],
                149: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        for (var t = e.getParameter(e.MAX_VARYING_VECTORS), i = 15; i > t;) i -= 2;
                        return i
                    }
                    i.__esModule = !0, i.default = r
                }, {}],
                150: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("../../core"),
                        l = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(a),
                        u = (e("path"), function(e) {
                            function t() {
                                r(this, t);
                                var i = n(this, e.call(this, "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}", "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n    vec4 c = texture2D(uSampler, vTextureCoord);\n\n    if (uAlpha == 0.0) {\n        gl_FragColor = c;\n        return;\n    }\n\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\n    if (c.a > 0.0) {\n      c.rgb /= c.a;\n    }\n\n    vec4 result;\n\n    result.r = (m[0] * c.r);\n        result.r += (m[1] * c.g);\n        result.r += (m[2] * c.b);\n        result.r += (m[3] * c.a);\n        result.r += m[4];\n\n    result.g = (m[5] * c.r);\n        result.g += (m[6] * c.g);\n        result.g += (m[7] * c.b);\n        result.g += (m[8] * c.a);\n        result.g += m[9];\n\n    result.b = (m[10] * c.r);\n       result.b += (m[11] * c.g);\n       result.b += (m[12] * c.b);\n       result.b += (m[13] * c.a);\n       result.b += m[14];\n\n    result.a = (m[15] * c.r);\n       result.a += (m[16] * c.g);\n       result.a += (m[17] * c.b);\n       result.a += (m[18] * c.a);\n       result.a += m[19];\n\n    vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n    // Premultiply alpha again.\n    rgb *= result.a;\n\n    gl_FragColor = vec4(rgb, result.a);\n}\n"));
                                return i.uniforms.m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], i.alpha = 1, i
                            }
                            return o(t, e), t.prototype._loadMatrix = function(e) {
                                var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
                                    i = e;
                                t && (this._multiply(i, this.uniforms.m, e), i = this._colorMatrix(i)), this.uniforms.m = i
                            }, t.prototype._multiply = function(e, t, i) {
                                return e[0] = t[0] * i[0] + t[1] * i[5] + t[2] * i[10] + t[3] * i[15], e[1] = t[0] * i[1] + t[1] * i[6] + t[2] * i[11] + t[3] * i[16], e[2] = t[0] * i[2] + t[1] * i[7] + t[2] * i[12] + t[3] * i[17], e[3] = t[0] * i[3] + t[1] * i[8] + t[2] * i[13] + t[3] * i[18], e[4] = t[0] * i[4] + t[1] * i[9] + t[2] * i[14] + t[3] * i[19] + t[4], e[5] = t[5] * i[0] + t[6] * i[5] + t[7] * i[10] + t[8] * i[15], e[6] = t[5] * i[1] + t[6] * i[6] + t[7] * i[11] + t[8] * i[16], e[7] = t[5] * i[2] + t[6] * i[7] + t[7] * i[12] + t[8] * i[17], e[8] = t[5] * i[3] + t[6] * i[8] + t[7] * i[13] + t[8] * i[18], e[9] = t[5] * i[4] + t[6] * i[9] + t[7] * i[14] + t[8] * i[19] + t[9], e[10] = t[10] * i[0] + t[11] * i[5] + t[12] * i[10] + t[13] * i[15], e[11] = t[10] * i[1] + t[11] * i[6] + t[12] * i[11] + t[13] * i[16], e[12] = t[10] * i[2] + t[11] * i[7] + t[12] * i[12] + t[13] * i[17], e[13] = t[10] * i[3] + t[11] * i[8] + t[12] * i[13] + t[13] * i[18], e[14] = t[10] * i[4] + t[11] * i[9] + t[12] * i[14] + t[13] * i[19] + t[14], e[15] = t[15] * i[0] + t[16] * i[5] + t[17] * i[10] + t[18] * i[15], e[16] = t[15] * i[1] + t[16] * i[6] + t[17] * i[11] + t[18] * i[16], e[17] = t[15] * i[2] + t[16] * i[7] + t[17] * i[12] + t[18] * i[17], e[18] = t[15] * i[3] + t[16] * i[8] + t[17] * i[13] + t[18] * i[18], e[19] = t[15] * i[4] + t[16] * i[9] + t[17] * i[14] + t[18] * i[19] + t[19], e
                            }, t.prototype._colorMatrix = function(e) {
                                var t = new Float32Array(e);
                                return t[4] /= 255, t[9] /= 255, t[14] /= 255, t[19] /= 255, t
                            }, t.prototype.brightness = function(e, t) {
                                var i = [e, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(i, t)
                            }, t.prototype.greyscale = function(e, t) {
                                var i = [e, e, e, 0, 0, e, e, e, 0, 0, e, e, e, 0, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(i, t)
                            }, t.prototype.blackAndWhite = function(e) {
                                var t = [.3, .6, .1, 0, 0, .3, .6, .1, 0, 0, .3, .6, .1, 0, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(t, e)
                            }, t.prototype.hue = function(e, t) {
                                e = (e || 0) / 180 * Math.PI;
                                var i = Math.cos(e),
                                    r = Math.sin(e),
                                    n = Math.sqrt,
                                    o = 1 / 3,
                                    s = n(o),
                                    a = i + (1 - i) * o,
                                    l = o * (1 - i) - s * r,
                                    u = o * (1 - i) + s * r,
                                    c = o * (1 - i) + s * r,
                                    h = i + o * (1 - i),
                                    d = o * (1 - i) - s * r,
                                    p = o * (1 - i) - s * r,
                                    f = o * (1 - i) + s * r,
                                    _ = i + o * (1 - i),
                                    m = [a, l, u, 0, 0, c, h, d, 0, 0, p, f, _, 0, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(m, t)
                            }, t.prototype.contrast = function(e, t) {
                                var i = (e || 0) + 1,
                                    r = -.5 * (i - 1),
                                    n = [i, 0, 0, 0, r, 0, i, 0, 0, r, 0, 0, i, 0, r, 0, 0, 0, 1, 0];
                                this._loadMatrix(n, t)
                            }, t.prototype.saturate = function() {
                                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                                    t = arguments[1],
                                    i = 2 * e / 3 + 1,
                                    r = -.5 * (i - 1),
                                    n = [i, r, r, 0, 0, r, i, r, 0, 0, r, r, i, 0, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(n, t)
                            }, t.prototype.desaturate = function() {
                                this.saturate(-1)
                            }, t.prototype.negative = function(e) {
                                var t = [-1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(t, e)
                            }, t.prototype.sepia = function(e) {
                                var t = [.393, .7689999, .18899999, 0, 0, .349, .6859999, .16799999, 0, 0, .272, .5339999, .13099999, 0, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(t, e)
                            }, t.prototype.technicolor = function(e) {
                                var t = [1.9125277891456083, -.8545344976951645, -.09155508482755585, 0, 11.793603434377337, -.3087833385928097, 1.7658908555458428, -.10601743074722245, 0, -70.35205161461398, -.231103377548616, -.7501899197440212, 1.847597816108189, 0, 30.950940869491138, 0, 0, 0, 1, 0];
                                this._loadMatrix(t, e)
                            }, t.prototype.polaroid = function(e) {
                                var t = [1.438, -.062, -.062, 0, 0, -.122, 1.378, -.122, 0, 0, -.016, -.016, 1.483, 0, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(t, e)
                            }, t.prototype.toBGR = function(e) {
                                var t = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(t, e)
                            }, t.prototype.kodachrome = function(e) {
                                var t = [1.1285582396593525, -.3967382283601348, -.03992559172921793, 0, 63.72958762196502, -.16404339962244616, 1.0835251566291304, -.05498805115633132, 0, 24.732407896706203, -.16786010706155763, -.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0, 0, 1, 0];
                                this._loadMatrix(t, e)
                            }, t.prototype.browni = function(e) {
                                var t = [.5997023498159715, .34553243048391263, -.2708298674538042, 0, 47.43192855600873, -.037703249837783157, .8609577587992641, .15059552388459913, 0, -36.96841498319127, .24113635128153335, -.07441037908422492, .44972182064877153, 0, -7.562075277591283, 0, 0, 0, 1, 0];
                                this._loadMatrix(t, e)
                            }, t.prototype.vintage = function(e) {
                                var t = [.6279345635605994, .3202183420819367, -.03965408211312453, 0, 9.651285835294123, .02578397704808868, .6441188644374771, .03259127616149294, 0, 7.462829176470591, .0466055556782719, -.0851232987247891, .5241648018700465, 0, 5.159190588235296, 0, 0, 0, 1, 0];
                                this._loadMatrix(t, e)
                            }, t.prototype.colorTone = function(e, t, i, r, n) {
                                e = e || .2, t = t || .15, i = i || 16770432, r = r || 3375104;
                                var o = (i >> 16 & 255) / 255,
                                    s = (i >> 8 & 255) / 255,
                                    a = (255 & i) / 255,
                                    l = (r >> 16 & 255) / 255,
                                    u = (r >> 8 & 255) / 255,
                                    c = (255 & r) / 255,
                                    h = [.3, .59, .11, 0, 0, o, s, a, e, 0, l, u, c, t, 0, o - l, s - u, a - c, 0, 0];
                                this._loadMatrix(h, n)
                            }, t.prototype.night = function(e, t) {
                                e = e || .1;
                                var i = [-2 * e, -e, 0, 0, 0, -e, 0, e, 0, 0, 0, e, 2 * e, 0, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(i, t)
                            }, t.prototype.predator = function(e, t) {
                                var i = [11.224130630493164 * e, -4.794486999511719 * e, -2.8746118545532227 * e, 0 * e, .40342438220977783 * e, -3.6330697536468506 * e, 9.193157196044922 * e, -2.951810836791992 * e, 0 * e, -1.316135048866272 * e, -3.2184197902679443 * e, -4.2375030517578125 * e, 7.476448059082031 * e, 0 * e, .8044459223747253 * e, 0, 0, 0, 1, 0];
                                this._loadMatrix(i, t)
                            }, t.prototype.lsd = function(e) {
                                var t = [2, -.4, .5, 0, 0, -.5, 2, -.4, 0, 0, -.4, -.5, 3, 0, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(t, e)
                            }, t.prototype.reset = function() {
                                var e = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
                                this._loadMatrix(e, !1)
                            }, s(t, [{
                                key: "matrix",
                                get: function() {
                                    return this.uniforms.m
                                },
                                set: function(e) {
                                    this.uniforms.m = e
                                }
                            }, {
                                key: "alpha",
                                get: function() {
                                    return this.uniforms.uAlpha
                                },
                                set: function(e) {
                                    this.uniforms.uAlpha = e
                                }
                            }]), t
                        }(l.Filter));
                    i.default = u, u.prototype.grayscale = u.prototype.greyscale
                }, {
                    "../../core": 65,
                    path: 8
                }],
                151: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("../../core"),
                        l = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(a),
                        u = (e("path"), function(e) {
                            function t(i, o) {
                                r(this, t);
                                var s = new l.Matrix;
                                i.renderable = !1;
                                var a = n(this, e.call(this, "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nvoid main(void)\n{\n   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n   vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n   vTextureCoord = aTextureCoord;\n}", "varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n  vec4 map =  texture2D(mapSampler, vFilterCoord);\n\n  map -= 0.5;\n  map.xy *= scale / filterArea.xy;\n\n  gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), filterClamp.xy, filterClamp.zw));\n}\n"));
                                return a.maskSprite = i, a.maskMatrix = s, a.uniforms.mapSampler = i._texture, a.uniforms.filterMatrix = s, a.uniforms.scale = {
                                    x: 1,
                                    y: 1
                                }, null !== o && void 0 !== o || (o = 20), a.scale = new l.Point(o, o), a
                            }
                            return o(t, e), t.prototype.apply = function(e, t, i) {
                                this.uniforms.filterMatrix = e.calculateSpriteMatrix(this.maskMatrix, this.maskSprite), this.uniforms.scale.x = this.scale.x, this.uniforms.scale.y = this.scale.y, e.applyFilter(this, t, i)
                            }, s(t, [{
                                key: "map",
                                get: function() {
                                    return this.uniforms.mapSampler
                                },
                                set: function(e) {
                                    this.uniforms.mapSampler = e
                                }
                            }]), t
                        }(l.Filter));
                    i.default = u
                }, {
                    "../../core": 65,
                    path: 8
                }],
                152: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = e("../../core"),
                        a = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(s),
                        l = (e("path"), function(e) {
                            function t() {
                                return r(this, t),
                                    n(this, e.call(this, "\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform vec4 filterArea;\n\nvarying vec2 vTextureCoord;\n\nvec2 mapCoord( vec2 coord )\n{\n    coord *= filterArea.xy;\n    coord += filterArea.zw;\n\n    return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n    coord -= filterArea.zw;\n    coord /= filterArea.xy;\n\n    return coord;\n}\n\nvoid texcoords(vec2 fragCoord, vec2 resolution,\n               out vec2 v_rgbNW, out vec2 v_rgbNE,\n               out vec2 v_rgbSW, out vec2 v_rgbSE,\n               out vec2 v_rgbM) {\n    vec2 inverseVP = 1.0 / resolution.xy;\n    v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n    v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n    v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n    v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n    v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n   vTextureCoord = aTextureCoord;\n\n   vec2 fragCoord = vTextureCoord * filterArea.xy;\n\n   texcoords(fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}", 'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n \n --\n \n From:\n https://github.com/mitsuhiko/webgl-meincraft\n \n Copyright (c) 2011 by Armin Ronacher.\n \n Some rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n \n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n \n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n \n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN   (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL   (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX     8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution,\n          vec2 v_rgbNW, vec2 v_rgbNE,\n          vec2 v_rgbSW, vec2 v_rgbSE,\n          vec2 v_rgbM) {\n    vec4 color;\n    mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\n    vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n    vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n    vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n    vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n    vec4 texColor = texture2D(tex, v_rgbM);\n    vec3 rgbM  = texColor.xyz;\n    vec3 luma = vec3(0.299, 0.587, 0.114);\n    float lumaNW = dot(rgbNW, luma);\n    float lumaNE = dot(rgbNE, luma);\n    float lumaSW = dot(rgbSW, luma);\n    float lumaSE = dot(rgbSE, luma);\n    float lumaM  = dot(rgbM,  luma);\n    float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n    float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n    \n    mediump vec2 dir;\n    dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n    dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n    \n    float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n                          (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n    \n    float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n    dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n              max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n                  dir * rcpDirMin)) * inverseVP;\n    \n    vec3 rgbA = 0.5 * (\n                       texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n                       texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n    vec3 rgbB = rgbA * 0.5 + 0.25 * (\n                                     texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n                                     texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n    \n    float lumaB = dot(rgbB, luma);\n    if ((lumaB < lumaMin) || (lumaB > lumaMax))\n        color = vec4(rgbA, texColor.a);\n    else\n        color = vec4(rgbB, texColor.a);\n    return color;\n}\n\nvoid main() {\n\n      vec2 fragCoord = vTextureCoord * filterArea.xy;\n\n      vec4 color;\n\n    color = fxaa(uSampler, fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n      gl_FragColor = color;\n}\n'))
                            }
                            return o(t, e), t
                        }(a.Filter));
                    i.default = l
                }, {
                    "../../core": 65,
                    path: 8
                }],
                153: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0;
                    var n = e("./fxaa/FXAAFilter");
                    Object.defineProperty(i, "FXAAFilter", {
                        enumerable: !0,
                        get: function() {
                            return r(n).default
                        }
                    });
                    var o = e("./noise/NoiseFilter");
                    Object.defineProperty(i, "NoiseFilter", {
                        enumerable: !0,
                        get: function() {
                            return r(o).default
                        }
                    });
                    var s = e("./displacement/DisplacementFilter");
                    Object.defineProperty(i, "DisplacementFilter", {
                        enumerable: !0,
                        get: function() {
                            return r(s).default
                        }
                    });
                    var a = e("./blur/BlurFilter");
                    Object.defineProperty(i, "BlurFilter", {
                        enumerable: !0,
                        get: function() {
                            return r(a).default
                        }
                    });
                    var l = e("./blur/BlurXFilter");
                    Object.defineProperty(i, "BlurXFilter", {
                        enumerable: !0,
                        get: function() {
                            return r(l).default
                        }
                    });
                    var u = e("./blur/BlurYFilter");
                    Object.defineProperty(i, "BlurYFilter", {
                        enumerable: !0,
                        get: function() {
                            return r(u).default
                        }
                    });
                    var c = e("./colormatrix/ColorMatrixFilter");
                    Object.defineProperty(i, "ColorMatrixFilter", {
                        enumerable: !0,
                        get: function() {
                            return r(c).default
                        }
                    });
                    var h = e("./alpha/AlphaFilter");
                    Object.defineProperty(i, "AlphaFilter", {
                        enumerable: !0,
                        get: function() {
                            return r(h).default
                        }
                    })
                }, {
                    "./alpha/AlphaFilter": 143,
                    "./blur/BlurFilter": 144,
                    "./blur/BlurXFilter": 145,
                    "./blur/BlurYFilter": 146,
                    "./colormatrix/ColorMatrixFilter": 150,
                    "./displacement/DisplacementFilter": 151,
                    "./fxaa/FXAAFilter": 152,
                    "./noise/NoiseFilter": 154
                }],
                154: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("../../core"),
                        l = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(a),
                        u = (e("path"), function(e) {
                            function t() {
                                var i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : .5,
                                    o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Math.random();
                                r(this, t);
                                var s = n(this, e.call(this, "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}", "precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n    return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n    vec4 color = texture2D(uSampler, vTextureCoord);\n    float randomValue = rand(gl_FragCoord.xy * uSeed);\n    float diff = (randomValue - 0.5) * uNoise;\n\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\n    if (color.a > 0.0) {\n        color.rgb /= color.a;\n    }\n\n    color.r += diff;\n    color.g += diff;\n    color.b += diff;\n\n    // Premultiply alpha again.\n    color.rgb *= color.a;\n\n    gl_FragColor = color;\n}\n"));
                                return s.noise = i, s.seed = o, s
                            }
                            return o(t, e), s(t, [{
                                key: "noise",
                                get: function() {
                                    return this.uniforms.uNoise
                                },
                                set: function(e) {
                                    this.uniforms.uNoise = e
                                }
                            }, {
                                key: "seed",
                                get: function() {
                                    return this.uniforms.uSeed
                                },
                                set: function(e) {
                                    this.uniforms.uSeed = e
                                }
                            }]), t
                        }(l.Filter));
                    i.default = u
                }, {
                    "../../core": 65,
                    path: 8
                }],
                155: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        o = e("../core"),
                        s = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(o),
                        a = function() {
                            function e() {
                                r(this, e), this.global = new s.Point, this.target = null, this.originalEvent = null, this.identifier = null, this.isPrimary = !1, this.button = 0, this.buttons = 0, this.width = 0, this.height = 0, this.tiltX = 0, this.tiltY = 0, this.pointerType = null, this.pressure = 0, this.rotationAngle = 0, this.twist = 0, this.tangentialPressure = 0
                            }
                            return e.prototype.getLocalPosition = function(e, t, i) {
                                return e.worldTransform.applyInverse(i || this.global, t)
                            }, e.prototype.copyEvent = function(e) {
                                e.isPrimary && (this.isPrimary = !0), this.button = e.button, this.buttons = Number.isInteger(e.buttons) ? e.buttons : e.which, this.width = e.width, this.height = e.height, this.tiltX = e.tiltX, this.tiltY = e.tiltY, this.pointerType = e.pointerType, this.pressure = e.pressure, this.rotationAngle = e.rotationAngle, this.twist = e.twist || 0, this.tangentialPressure = e.tangentialPressure || 0
                            }, e.prototype.reset = function() {
                                this.isPrimary = !1
                            }, n(e, [{
                                key: "pointerId",
                                get: function() {
                                    return this.identifier
                                }
                            }]), e
                        }();
                    i.default = a
                }, {
                    "../core": 65
                }],
                156: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                        function e() {
                            r(this, e), this.stopped = !1, this.target = null, this.currentTarget = null, this.type = null, this.data = null
                        }
                        return e.prototype.stopPropagation = function() {
                            this.stopped = !0
                        }, e.prototype.reset = function() {
                            this.stopped = !1, this.currentTarget = null, this.target = null
                        }, e
                    }();
                    i.default = n
                }, {}],
                157: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
                            return typeof e
                        } : function(e) {
                            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
                        },
                        l = e("../core"),
                        u = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(l),
                        c = e("./InteractionData"),
                        h = r(c),
                        d = e("./InteractionEvent"),
                        p = r(d),
                        f = e("./InteractionTrackingData"),
                        _ = r(f),
                        m = e("eventemitter3"),
                        g = r(m),
                        v = e("./interactiveTarget"),
                        y = r(v);
                    u.utils.mixins.delayMixin(u.DisplayObject.prototype, y.default);
                    var b = 1,
                        x = {
                            target: null,
                            data: {
                                global: null
                            }
                        },
                        T = function(e) {
                            function t(i, r) {
                                n(this, t);
                                var s = o(this, e.call(this));
                                return r = r || {}, s.renderer = i, s.autoPreventDefault = void 0 === r.autoPreventDefault || r.autoPreventDefault, s.interactionFrequency = r.interactionFrequency || 10, s.mouse = new h.default, s.mouse.identifier = b, s.mouse.global.set(-999999), s.activeInteractionData = {}, s.activeInteractionData[b] = s.mouse, s.interactionDataPool = [], s.eventData = new p.default, s.interactionDOMElement = null, s.moveWhenInside = !1, s.eventsAdded = !1, s.mouseOverRenderer = !1, s.supportsTouchEvents = "ontouchstart" in window, s.supportsPointerEvents = !!window.PointerEvent, s.onPointerUp = s.onPointerUp.bind(s), s.processPointerUp = s.processPointerUp.bind(s), s.onPointerCancel = s.onPointerCancel.bind(s), s.processPointerCancel = s.processPointerCancel.bind(s), s.onPointerDown = s.onPointerDown.bind(s), s.processPointerDown = s.processPointerDown.bind(s), s.onPointerMove = s.onPointerMove.bind(s), s.processPointerMove = s.processPointerMove.bind(s), s.onPointerOut = s.onPointerOut.bind(s), s.processPointerOverOut = s.processPointerOverOut.bind(s), s.onPointerOver = s.onPointerOver.bind(s), s.cursorStyles = {
                                    default: "inherit",
                                    pointer: "pointer"
                                }, s.currentCursorMode = null, s.cursor = null, s._tempPoint = new u.Point, s.resolution = 1, s.setTargetElement(s.renderer.view, s.renderer.resolution), s
                            }
                            return s(t, e), t.prototype.hitTest = function(e, t) {
                                return x.target = null, x.data.global = e, t || (t = this.renderer._lastObjectRendered), this.processInteractive(x, t, null, !0), x.target
                            }, t.prototype.setTargetElement = function(e) {
                                var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
                                this.removeEvents(), this.interactionDOMElement = e, this.resolution = t, this.addEvents()
                            }, t.prototype.addEvents = function() {
                                this.interactionDOMElement && (u.ticker.shared.add(this.update, this, u.UPDATE_PRIORITY.INTERACTION), window.navigator.msPointerEnabled ? (this.interactionDOMElement.style["-ms-content-zooming"] = "none", this.interactionDOMElement.style["-ms-touch-action"] = "none") : this.supportsPointerEvents && (this.interactionDOMElement.style["touch-action"] = "none"), this.supportsPointerEvents ? (window.document.addEventListener("pointermove", this.onPointerMove, !0), this.interactionDOMElement.addEventListener("pointerdown", this.onPointerDown, !0), this.interactionDOMElement.addEventListener("pointerleave", this.onPointerOut, !0), this.interactionDOMElement.addEventListener("pointerover", this.onPointerOver, !0), window.addEventListener("pointercancel", this.onPointerCancel, !0), window.addEventListener("pointerup", this.onPointerUp, !0)) : (window.document.addEventListener("mousemove", this.onPointerMove, !0), this.interactionDOMElement.addEventListener("mousedown", this.onPointerDown, !0), this.interactionDOMElement.addEventListener("mouseout", this.onPointerOut, !0), this.interactionDOMElement.addEventListener("mouseover", this.onPointerOver, !0), window.addEventListener("mouseup", this.onPointerUp, !0)), this.supportsTouchEvents && (this.interactionDOMElement.addEventListener("touchstart", this.onPointerDown, !0), this.interactionDOMElement.addEventListener("touchcancel", this.onPointerCancel, !0), this.interactionDOMElement.addEventListener("touchend", this.onPointerUp, !0), this.interactionDOMElement.addEventListener("touchmove", this.onPointerMove, !0)), this.eventsAdded = !0)
                            }, t.prototype.removeEvents = function() {
                                this.interactionDOMElement && (u.ticker.shared.remove(this.update, this), window.navigator.msPointerEnabled ? (this.interactionDOMElement.style["-ms-content-zooming"] = "", this.interactionDOMElement.style["-ms-touch-action"] = "") : this.supportsPointerEvents && (this.interactionDOMElement.style["touch-action"] = ""), this.supportsPointerEvents ? (window.document.removeEventListener("pointermove", this.onPointerMove, !0), this.interactionDOMElement.removeEventListener("pointerdown", this.onPointerDown, !0), this.interactionDOMElement.removeEventListener("pointerleave", this.onPointerOut, !0), this.interactionDOMElement.removeEventListener("pointerover", this.onPointerOver, !0), window.removeEventListener("pointercancel", this.onPointerCancel, !0), window.removeEventListener("pointerup", this.onPointerUp, !0)) : (window.document.removeEventListener("mousemove", this.onPointerMove, !0), this.interactionDOMElement.removeEventListener("mousedown", this.onPointerDown, !0), this.interactionDOMElement.removeEventListener("mouseout", this.onPointerOut, !0), this.interactionDOMElement.removeEventListener("mouseover", this.onPointerOver, !0), window.removeEventListener("mouseup", this.onPointerUp, !0)), this.supportsTouchEvents && (this.interactionDOMElement.removeEventListener("touchstart", this.onPointerDown, !0), this.interactionDOMElement.removeEventListener("touchcancel", this.onPointerCancel, !0), this.interactionDOMElement.removeEventListener("touchend", this.onPointerUp, !0), this.interactionDOMElement.removeEventListener("touchmove", this.onPointerMove, !0)), this.interactionDOMElement = null, this.eventsAdded = !1)
                            }, t.prototype.update = function(e) {
                                if (this._deltaTime += e, !(this._deltaTime < this.interactionFrequency) && (this._deltaTime = 0, this.interactionDOMElement)) {
                                    if (this.didMove) return void(this.didMove = !1);
                                    this.cursor = null;
                                    for (var t in this.activeInteractionData)
                                        if (this.activeInteractionData.hasOwnProperty(t)) {
                                            var i = this.activeInteractionData[t];
                                            if (i.originalEvent && "touch" !== i.pointerType) {
                                                var r = this.configureInteractionEventForDOMEvent(this.eventData, i.originalEvent, i);
                                                this.processInteractive(r, this.renderer._lastObjectRendered, this.processPointerOverOut, !0)
                                            }
                                        }
                                    this.setCursorMode(this.cursor)
                                }
                            }, t.prototype.setCursorMode = function(e) {
                                if (e = e || "default", this.currentCursorMode !== e) {
                                    this.currentCursorMode = e;
                                    var t = this.cursorStyles[e];
                                    if (t) switch (void 0 === t ? "undefined" : a(t)) {
                                        case "string":
                                            this.interactionDOMElement.style.cursor = t;
                                            break;
                                        case "function":
                                            t(e);
                                            break;
                                        case "object":
                                            Object.assign(this.interactionDOMElement.style, t)
                                    } else "string" != typeof e || Object.prototype.hasOwnProperty.call(this.cursorStyles, e) || (this.interactionDOMElement.style.cursor = e)
                                }
                            }, t.prototype.dispatchEvent = function(e, t, i) {
                                i.stopped || (i.currentTarget = e, i.type = t, e.emit(t, i), e[t] && e[t](i))
                            }, t.prototype.mapPositionToPoint = function(e, t, i) {
                                var r = void 0;
                                r = this.interactionDOMElement.parentElement ? this.interactionDOMElement.getBoundingClientRect() : {
                                    x: 0,
                                    y: 0,
                                    width: 0,
                                    height: 0
                                };
                                var n = navigator.isCocoonJS ? this.resolution : 1 / this.resolution;
                                e.x = (t - r.left) * (this.interactionDOMElement.width / r.width) * n, e.y = (i - r.top) * (this.interactionDOMElement.height / r.height) * n
                            }, t.prototype.processInteractive = function(e, t, i, r, n) {
                                if (!t || !t.visible) return !1;
                                var o = e.data.global;
                                n = t.interactive || n;
                                var s = !1,
                                    a = n,
                                    l = !0;
                                if (t.hitArea ? (r && (t.worldTransform.applyInverse(o, this._tempPoint), t.hitArea.contains(this._tempPoint.x, this._tempPoint.y) ? s = !0 : (r = !1, l = !1)), a = !1) : t._mask && r && (t._mask.containsPoint(o) || (r = !1, l = !1)), l && t.interactiveChildren && t.children)
                                    for (var u = t.children, c = u.length - 1; c >= 0; c--) {
                                        var h = u[c],
                                            d = this.processInteractive(e, h, i, r, a);
                                        if (d) {
                                            if (!h.parent) continue;
                                            a = !1, d && (e.target && (r = !1), s = !0)
                                        }
                                    }
                                return n && (r && !e.target && !t.hitArea && t.containsPoint && t.containsPoint(o) && (s = !0), t.interactive && (s && !e.target && (e.target = t), i && i(e, t, !!s))), s
                            }, t.prototype.onPointerDown = function(e) {
                                if (!this.supportsTouchEvents || "touch" !== e.pointerType) {
                                    var t = this.normalizeToPointerData(e);
                                    this.autoPreventDefault && t[0].isNormalized && e.preventDefault();
                                    for (var i = t.length, r = 0; r < i; r++) {
                                        var n = t[r],
                                            o = this.getInteractionDataForPointerId(n),
                                            s = this.configureInteractionEventForDOMEvent(this.eventData, n, o);
                                        if (s.data.originalEvent = e, this.processInteractive(s, this.renderer._lastObjectRendered, this.processPointerDown, !0), this.emit("pointerdown", s), "touch" === n.pointerType) this.emit("touchstart", s);
                                        else if ("mouse" === n.pointerType || "pen" === n.pointerType) {
                                            var a = 2 === n.button;
                                            this.emit(a ? "rightdown" : "mousedown", this.eventData)
                                        }
                                    }
                                }
                            }, t.prototype.processPointerDown = function(e, t, i) {
                                var r = e.data,
                                    n = e.data.identifier;
                                if (i)
                                    if (t.trackedPointers[n] || (t.trackedPointers[n] = new _.default(n)), this.dispatchEvent(t, "pointerdown", e), "touch" === r.pointerType) this.dispatchEvent(t, "touchstart", e);
                                    else if ("mouse" === r.pointerType || "pen" === r.pointerType) {
                                    var o = 2 === r.button;
                                    o ? t.trackedPointers[n].rightDown = !0 : t.trackedPointers[n].leftDown = !0, this.dispatchEvent(t, o ? "rightdown" : "mousedown", e)
                                }
                            }, t.prototype.onPointerComplete = function(e, t, i) {
                                for (var r = this.normalizeToPointerData(e), n = r.length, o = e.target !== this.interactionDOMElement ? "outside" : "", s = 0; s < n; s++) {
                                    var a = r[s],
                                        l = this.getInteractionDataForPointerId(a),
                                        u = this.configureInteractionEventForDOMEvent(this.eventData, a, l);
                                    if (u.data.originalEvent = e, this.processInteractive(u, this.renderer._lastObjectRendered, i, t || !o), this.emit(t ? "pointercancel" : "pointerup" + o, u), "mouse" === a.pointerType || "pen" === a.pointerType) {
                                        var c = 2 === a.button;
                                        this.emit(c ? "rightup" + o : "mouseup" + o, u)
                                    } else "touch" === a.pointerType && (this.emit(t ? "touchcancel" : "touchend" + o, u), this.releaseInteractionDataForPointerId(a.pointerId, l))
                                }
                            }, t.prototype.onPointerCancel = function(e) {
                                this.supportsTouchEvents && "touch" === e.pointerType || this.onPointerComplete(e, !0, this.processPointerCancel)
                            }, t.prototype.processPointerCancel = function(e, t) {
                                var i = e.data,
                                    r = e.data.identifier;
                                void 0 !== t.trackedPointers[r] && (delete t.trackedPointers[r], this.dispatchEvent(t, "pointercancel", e), "touch" === i.pointerType && this.dispatchEvent(t, "touchcancel", e))
                            }, t.prototype.onPointerUp = function(e) {
                                this.supportsTouchEvents && "touch" === e.pointerType || this.onPointerComplete(e, !1, this.processPointerUp)
                            }, t.prototype.processPointerUp = function(e, t, i) {
                                var r = e.data,
                                    n = e.data.identifier,
                                    o = t.trackedPointers[n],
                                    s = "touch" === r.pointerType,
                                    a = "mouse" === r.pointerType || "pen" === r.pointerType,
                                    l = !1;
                                if (a) {
                                    var u = 2 === r.button,
                                        c = _.default.FLAGS,
                                        h = u ? c.RIGHT_DOWN : c.LEFT_DOWN,
                                        d = void 0 !== o && o.flags & h;
                                    i ? (this.dispatchEvent(t, u ? "rightup" : "mouseup", e), d && (this.dispatchEvent(t, u ? "rightclick" : "click", e), l = !0)) : d && this.dispatchEvent(t, u ? "rightupoutside" : "mouseupoutside", e), o && (u ? o.rightDown = !1 : o.leftDown = !1)
                                }
                                i ? (this.dispatchEvent(t, "pointerup", e), s && this.dispatchEvent(t, "touchend", e), o && (a && !l || this.dispatchEvent(t, "pointertap", e), s && (this.dispatchEvent(t, "tap", e), o.over = !1))) : o && (this.dispatchEvent(t, "pointerupoutside", e), s && this.dispatchEvent(t, "touchendoutside", e)), o && o.none && delete t.trackedPointers[n]
                            }, t.prototype.onPointerMove = function(e) {
                                if (!this.supportsTouchEvents || "touch" !== e.pointerType) {
                                    var t = this.normalizeToPointerData(e);
                                    "mouse" !== t[0].pointerType && "pen" !== t[0].pointerType || (this.didMove = !0, this.cursor = null);
                                    for (var i = t.length, r = 0; r < i; r++) {
                                        var n = t[r],
                                            o = this.getInteractionDataForPointerId(n),
                                            s = this.configureInteractionEventForDOMEvent(this.eventData, n, o);
                                        s.data.originalEvent = e;
                                        var a = "touch" !== n.pointerType || this.moveWhenInside;
                                        this.processInteractive(s, this.renderer._lastObjectRendered, this.processPointerMove, a), this.emit("pointermove", s), "touch" === n.pointerType && this.emit("touchmove", s), "mouse" !== n.pointerType && "pen" !== n.pointerType || this.emit("mousemove", s)
                                    }
                                    "mouse" === t[0].pointerType && this.setCursorMode(this.cursor)
                                }
                            }, t.prototype.processPointerMove = function(e, t, i) {
                                var r = e.data,
                                    n = "touch" === r.pointerType,
                                    o = "mouse" === r.pointerType || "pen" === r.pointerType;
                                o && this.processPointerOverOut(e, t, i), this.moveWhenInside && !i || (this.dispatchEvent(t, "pointermove", e), n && this.dispatchEvent(t, "touchmove", e), o && this.dispatchEvent(t, "mousemove", e))
                            }, t.prototype.onPointerOut = function(e) {
                                if (!this.supportsTouchEvents || "touch" !== e.pointerType) {
                                    var t = this.normalizeToPointerData(e),
                                        i = t[0];
                                    "mouse" === i.pointerType && (this.mouseOverRenderer = !1, this.setCursorMode(null));
                                    var r = this.getInteractionDataForPointerId(i),
                                        n = this.configureInteractionEventForDOMEvent(this.eventData, i, r);
                                    n.data.originalEvent = i, this.processInteractive(n, this.renderer._lastObjectRendered, this.processPointerOverOut, !1), this.emit("pointerout", n), "mouse" === i.pointerType || "pen" === i.pointerType ? this.emit("mouseout", n) : this.releaseInteractionDataForPointerId(r.identifier)
                                }
                            }, t.prototype.processPointerOverOut = function(e, t, i) {
                                var r = e.data,
                                    n = e.data.identifier,
                                    o = "mouse" === r.pointerType || "pen" === r.pointerType,
                                    s = t.trackedPointers[n];
                                i && !s && (s = t.trackedPointers[n] = new _.default(n)), void 0 !== s && (i && this.mouseOverRenderer ? (s.over || (s.over = !0, this.dispatchEvent(t, "pointerover", e), o && this.dispatchEvent(t, "mouseover", e)), o && null === this.cursor && (this.cursor = t.cursor)) : s.over && (s.over = !1, this.dispatchEvent(t, "pointerout", this.eventData), o && this.dispatchEvent(t, "mouseout", e), s.none && delete t.trackedPointers[n]))
                            }, t.prototype.onPointerOver = function(e) {
                                var t = this.normalizeToPointerData(e),
                                    i = t[0],
                                    r = this.getInteractionDataForPointerId(i),
                                    n = this.configureInteractionEventForDOMEvent(this.eventData, i, r);
                                n.data.originalEvent = i, "mouse" === i.pointerType && (this.mouseOverRenderer = !0), this.emit("pointerover", n), "mouse" !== i.pointerType && "pen" !== i.pointerType || this.emit("mouseover", n)
                            }, t.prototype.getInteractionDataForPointerId = function(e) {
                                var t = e.pointerId,
                                    i = void 0;
                                return t === b || "mouse" === e.pointerType ? i = this.mouse : this.activeInteractionData[t] ? i = this.activeInteractionData[t] : (i = this.interactionDataPool.pop() || new h.default, i.identifier = t, this.activeInteractionData[t] = i), i.copyEvent(e), i
                            }, t.prototype.releaseInteractionDataForPointerId = function(e) {
                                var t = this.activeInteractionData[e];
                                t && (delete this.activeInteractionData[e], t.reset(), this.interactionDataPool.push(t))
                            }, t.prototype.configureInteractionEventForDOMEvent = function(e, t, i) {
                                return e.data = i, this.mapPositionToPoint(i.global, t.clientX, t.clientY), navigator.isCocoonJS && "touch" === t.pointerType && (i.global.x = i.global.x / this.resolution, i.global.y = i.global.y / this.resolution), "touch" === t.pointerType && (t.globalX = i.global.x, t.globalY = i.global.y), i.originalEvent = t, e.reset(), e
                            }, t.prototype.normalizeToPointerData = function(e) {
                                var t = [];
                                if (this.supportsTouchEvents && e instanceof TouchEvent)
                                    for (var i = 0, r = e.changedTouches.length; i < r; i++) {
                                        var n = e.changedTouches[i];
                                        void 0 === n.button && (n.button = e.touches.length ? 1 : 0), void 0 === n.buttons && (n.buttons = e.touches.length ? 1 : 0), void 0 === n.isPrimary && (n.isPrimary = 1 === e.touches.length && "touchstart" === e.type), void 0 === n.width && (n.width = n.radiusX || 1), void 0 === n.height && (n.height = n.radiusY || 1), void 0 === n.tiltX && (n.tiltX = 0), void 0 === n.tiltY && (n.tiltY = 0), void 0 === n.pointerType && (n.pointerType = "touch"), void 0 === n.pointerId && (n.pointerId = n.identifier || 0), void 0 === n.pressure && (n.pressure = n.force || .5), void 0 === n.twist && (n.twist = 0), void 0 === n.tangentialPressure && (n.tangentialPressure = 0), void 0 === n.layerX && (n.layerX = n.offsetX = n.clientX), void 0 === n.layerY && (n.layerY = n.offsetY = n.clientY), n.isNormalized = !0, t.push(n)
                                    } else !(e instanceof MouseEvent) || this.supportsPointerEvents && e instanceof window.PointerEvent ? t.push(e) : (void 0 === e.isPrimary && (e.isPrimary = !0), void 0 === e.width && (e.width = 1), void 0 === e.height && (e.height = 1), void 0 === e.tiltX && (e.tiltX = 0), void 0 === e.tiltY && (e.tiltY = 0), void 0 === e.pointerType && (e.pointerType = "mouse"), void 0 === e.pointerId && (e.pointerId = b), void 0 === e.pressure && (e.pressure = .5), void 0 === e.twist && (e.twist = 0), void 0 === e.tangentialPressure && (e.tangentialPressure = 0), e.isNormalized = !0, t.push(e));
                                return t
                            }, t.prototype.destroy = function() {
                                this.removeEvents(), this.removeAllListeners(), this.renderer = null, this.mouse = null, this.eventData = null, this.interactionDOMElement = null, this.onPointerDown = null, this.processPointerDown = null, this.onPointerUp = null, this.processPointerUp = null, this.onPointerCancel = null, this.processPointerCancel = null, this.onPointerMove = null, this.processPointerMove = null, this.onPointerOut = null, this.processPointerOverOut = null, this.onPointerOver = null, this._tempPoint = null
                            }, t
                        }(g.default);
                    i.default = T, u.WebGLRenderer.registerPlugin("interaction", T), u.CanvasRenderer.registerPlugin("interaction", T)
                }, {
                    "../core": 65,
                    "./InteractionData": 155,
                    "./InteractionEvent": 156,
                    "./InteractionTrackingData": 158,
                    "./interactiveTarget": 160,
                    eventemitter3: 3
                }],
                158: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        o = function() {
                            function e(t) {
                                r(this, e), this._pointerId = t, this._flags = e.FLAGS.NONE
                            }
                            return e.prototype._doSet = function(e, t) {
                                this._flags = t ? this._flags | e : this._flags & ~e
                            }, n(e, [{
                                key: "pointerId",
                                get: function() {
                                    return this._pointerId
                                }
                            }, {
                                key: "flags",
                                get: function() {
                                    return this._flags
                                },
                                set: function(e) {
                                    this._flags = e
                                }
                            }, {
                                key: "none",
                                get: function() {
                                    return this._flags === this.constructor.FLAGS.NONE
                                }
                            }, {
                                key: "over",
                                get: function() {
                                    return 0 != (this._flags & this.constructor.FLAGS.OVER)
                                },
                                set: function(e) {
                                    this._doSet(this.constructor.FLAGS.OVER, e)
                                }
                            }, {
                                key: "rightDown",
                                get: function() {
                                    return 0 != (this._flags & this.constructor.FLAGS.RIGHT_DOWN)
                                },
                                set: function(e) {
                                    this._doSet(this.constructor.FLAGS.RIGHT_DOWN, e)
                                }
                            }, {
                                key: "leftDown",
                                get: function() {
                                    return 0 != (this._flags & this.constructor.FLAGS.LEFT_DOWN)
                                },
                                set: function(e) {
                                    this._doSet(this.constructor.FLAGS.LEFT_DOWN, e)
                                }
                            }]), e
                        }();
                    i.default = o, o.FLAGS = Object.freeze({
                        NONE: 0,
                        OVER: 1,
                        LEFT_DOWN: 2,
                        RIGHT_DOWN: 4
                    })
                }, {}],
                159: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0;
                    var n = e("./InteractionData");
                    Object.defineProperty(i, "InteractionData", {
                        enumerable: !0,
                        get: function() {
                            return r(n).default
                        }
                    });
                    var o = e("./InteractionManager");
                    Object.defineProperty(i, "InteractionManager", {
                        enumerable: !0,
                        get: function() {
                            return r(o).default
                        }
                    });
                    var s = e("./interactiveTarget");
                    Object.defineProperty(i, "interactiveTarget", {
                        enumerable: !0,
                        get: function() {
                            return r(s).default
                        }
                    });
                    var a = e("./InteractionTrackingData");
                    Object.defineProperty(i, "InteractionTrackingData", {
                        enumerable: !0,
                        get: function() {
                            return r(a).default
                        }
                    });
                    var l = e("./InteractionEvent");
                    Object.defineProperty(i, "InteractionEvent", {
                        enumerable: !0,
                        get: function() {
                            return r(l).default
                        }
                    })
                }, {
                    "./InteractionData": 155,
                    "./InteractionEvent": 156,
                    "./InteractionManager": 157,
                    "./InteractionTrackingData": 158,
                    "./interactiveTarget": 160
                }],
                160: [function(e, t, i) {
                    "use strict";
                    i.__esModule = !0, i.default = {
                        interactive: !1,
                        interactiveChildren: !0,
                        hitArea: null,
                        get buttonMode() {
                            return "pointer" === this.cursor
                        },
                        set buttonMode(e) {
                            e ? this.cursor = "pointer" : "pointer" === this.cursor && (this.cursor = null)
                        },
                        cursor: null,
                        get trackedPointers() {
                            return void 0 === this._trackedPointers && (this._trackedPointers = {}), this._trackedPointers
                        },
                        _trackedPointers: void 0
                    }
                }, {}],
                161: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        e.bitmapFont = a.BitmapText.registerFont(e.data, t)
                    }
                    i.__esModule = !0, i.parse = r, i.default = function() {
                        return function(e, t) {
                            if (!e.data || e.type !== s.Resource.TYPE.XML) return void t();
                            if (0 === e.data.getElementsByTagName("page").length || 0 === e.data.getElementsByTagName("info").length || null === e.data.getElementsByTagName("info")[0].getAttribute("face")) return void t();
                            var i = e.isDataUrl ? "" : o.dirname(e.url);
                            e.isDataUrl && ("." === i && (i = ""), this.baseUrl && i && "/" === this.baseUrl.charAt(this.baseUrl.length - 1) && (i += "/")), (i = i.replace(this.baseUrl, "")) && "/" !== i.charAt(i.length - 1) && (i += "/");
                            for (var n = e.data.getElementsByTagName("page"), a = {}, l = function(i) {
                                    a[i.metadata.pageFile] = i.texture, Object.keys(a).length === n.length && (r(e, a), t())
                                }, u = 0; u < n.length; ++u) {
                                var c = n[u].getAttribute("file"),
                                    h = i + c,
                                    d = !1;
                                for (var p in this.resources) {
                                    var f = this.resources[p];
                                    if (f.url === h) {
                                        f.metadata.pageFile = c, f.texture ? l(f) : f.onAfterMiddleware.add(l), d = !0;
                                        break
                                    }
                                }
                                if (!d) {
                                    var _ = {
                                        crossOrigin: e.crossOrigin,
                                        loadType: s.Resource.LOAD_TYPE.IMAGE,
                                        metadata: Object.assign({
                                            pageFile: c
                                        }, e.metadata.imageMetadata),
                                        parentResource: e
                                    };
                                    this.add(h, _, l)
                                }
                            }
                        }
                    };
                    var n = e("path"),
                        o = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(n),
                        s = e("resource-loader"),
                        a = e("../extras")
                }, {
                    "../extras": 141,
                    path: 8,
                    "resource-loader": 36
                }],
                162: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0, i.shared = i.Resource = i.textureParser = i.getResourcePath = i.spritesheetParser = i.parseBitmapFontData = i.bitmapFontParser = i.Loader = void 0;
                    var n = e("./bitmapFontParser");
                    Object.defineProperty(i, "bitmapFontParser", {
                        enumerable: !0,
                        get: function() {
                            return r(n).default
                        }
                    }), Object.defineProperty(i, "parseBitmapFontData", {
                        enumerable: !0,
                        get: function() {
                            return n.parse
                        }
                    });
                    var o = e("./spritesheetParser");
                    Object.defineProperty(i, "spritesheetParser", {
                        enumerable: !0,
                        get: function() {
                            return r(o).default
                        }
                    }), Object.defineProperty(i, "getResourcePath", {
                        enumerable: !0,
                        get: function() {
                            return o.getResourcePath
                        }
                    });
                    var s = e("./textureParser");
                    Object.defineProperty(i, "textureParser", {
                        enumerable: !0,
                        get: function() {
                            return r(s).default
                        }
                    });
                    var a = e("resource-loader");
                    Object.defineProperty(i, "Resource", {
                        enumerable: !0,
                        get: function() {
                            return a.Resource
                        }
                    });
                    var l = e("../core/Application"),
                        u = r(l),
                        c = e("./loader"),
                        h = r(c);
                    i.Loader = h.default;
                    var d = new h.default;
                    d.destroy = function() {}, i.shared = d;
                    var p = u.default.prototype;
                    p._loader = null, Object.defineProperty(p, "loader", {
                        get: function() {
                            if (!this._loader) {
                                var e = this._options.sharedLoader;
                                this._loader = e ? d : new h.default
                            }
                            return this._loader
                        }
                    }), p._parentDestroy = p.destroy, p.destroy = function(e, t) {
                        this._loader && (this._loader.destroy(), this._loader = null), this._parentDestroy(e, t)
                    }
                }, {
                    "../core/Application": 43,
                    "./bitmapFontParser": 161,
                    "./loader": 163,
                    "./spritesheetParser": 164,
                    "./textureParser": 165,
                    "resource-loader": 36
                }],
                163: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("resource-loader"),
                        l = r(a),
                        u = e("resource-loader/lib/middlewares/parsing/blob"),
                        c = e("eventemitter3"),
                        h = r(c),
                        d = e("./textureParser"),
                        p = r(d),
                        f = e("./spritesheetParser"),
                        _ = r(f),
                        m = e("./bitmapFontParser"),
                        g = r(m),
                        v = function(e) {
                            function t(i, r) {
                                n(this, t);
                                var s = o(this, e.call(this, i, r));
                                h.default.call(s);
                                for (var a = 0; a < t._pixiMiddleware.length; ++a) s.use(t._pixiMiddleware[a]());
                                return s.onStart.add(function(e) {
                                    return s.emit("start", e)
                                }), s.onProgress.add(function(e, t) {
                                    return s.emit("progress", e, t)
                                }), s.onError.add(function(e, t, i) {
                                    return s.emit("error", e, t, i)
                                }), s.onLoad.add(function(e, t) {
                                    return s.emit("load", e, t)
                                }), s.onComplete.add(function(e, t) {
                                    return s.emit("complete", e, t)
                                }), s
                            }
                            return s(t, e), t.addPixiMiddleware = function(e) {
                                t._pixiMiddleware.push(e)
                            }, t.prototype.destroy = function() {
                                this.removeAllListeners(), this.reset()
                            }, t
                        }(l.default);
                    i.default = v;
                    for (var y in h.default.prototype) v.prototype[y] = h.default.prototype[y];
                    v._pixiMiddleware = [u.blobMiddlewareFactory, p.default, _.default, g.default];
                    var b = l.default.Resource;
                    b.setExtensionXhrType("fnt", b.XHR_RESPONSE_TYPE.DOCUMENT)
                }, {
                    "./bitmapFontParser": 161,
                    "./spritesheetParser": 164,
                    "./textureParser": 165,
                    eventemitter3: 3,
                    "resource-loader": 36,
                    "resource-loader/lib/middlewares/parsing/blob": 37
                }],
                164: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        return e.isDataUrl ? e.data.meta.image : s.default.resolve(e.url.replace(t, ""), e.data.meta.image)
                    }
                    i.__esModule = !0, i.default = function() {
                        return function(e, t) {
                            var i = e.name + "_image";
                            if (!e.data || e.type !== n.Resource.TYPE.JSON || !e.data.frames || this.resources[i]) return void t();
                            var o = {
                                    crossOrigin: e.crossOrigin,
                                    metadata: e.metadata.imageMetadata,
                                    parentResource: e
                                },
                                s = r(e, this.baseUrl);
                            this.add(i, s, o, function(i) {
                                if (i.error) return void t(i.error);
                                var r = new a.Spritesheet(i.texture.baseTexture, e.data, e.url);
                                r.parse(function() {
                                    e.spritesheet = r, e.textures = r.textures, t()
                                })
                            })
                        }
                    }, i.getResourcePath = r;
                    var n = e("resource-loader"),
                        o = e("url"),
                        s = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(o),
                        a = e("../core")
                }, {
                    "../core": 65,
                    "resource-loader": 36,
                    url: 38
                }],
                165: [function(e, t, i) {
                    "use strict";
                    i.__esModule = !0, i.default = function() {
                        return function(e, t) {
                            e.data && e.type === r.Resource.TYPE.IMAGE && (e.texture = o.default.fromLoader(e.data, e.url, e.name)), t()
                        }
                    };
                    var r = e("resource-loader"),
                        n = e("../core/textures/Texture"),
                        o = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(n)
                }, {
                    "../core/textures/Texture": 115,
                    "resource-loader": 36
                }],
                166: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("../core"),
                        l = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(a),
                        u = e("../core/textures/Texture"),
                        c = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(u),
                        h = new l.Point,
                        d = new l.Polygon,
                        p = function(e) {
                            function t(i, o, s, a, u) {
                                r(this, t);
                                var h = n(this, e.call(this));
                                return h._texture = i || c.default.EMPTY, h.uvs = s || new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), h.vertices = o || new Float32Array([0, 0, 100, 0, 100, 100, 0, 100]), h.indices = a || new Uint16Array([0, 1, 3, 2]), h.dirty = 0, h.indexDirty = 0, h.vertexDirty = 0, h.autoUpdate = !0, h.blendMode = l.BLEND_MODES.NORMAL, h.canvasPadding = l.settings.MESH_CANVAS_PADDING, h.drawMode = u || t.DRAW_MODES.TRIANGLE_MESH, h.shader = null, h.tintRgb = new Float32Array([1, 1, 1]), h._glDatas = {}, h._uvTransform = new l.TextureMatrix(h._texture), h.uploadUvTransform = !1, h.pluginName = "mesh", h
                            }
                            return o(t, e), t.prototype._renderWebGL = function(e) {
                                this.refresh(), e.setObjectRenderer(e.plugins[this.pluginName]), e.plugins[this.pluginName].render(this)
                            }, t.prototype._renderCanvas = function(e) {
                                this.refresh(), e.plugins[this.pluginName].render(this)
                            }, t.prototype._onTextureUpdate = function() {
                                this._uvTransform.texture = this._texture, this.refresh()
                            }, t.prototype.multiplyUvs = function() {
                                this.uploadUvTransform || this._uvTransform.multiplyUvs(this.uvs)
                            }, t.prototype.refresh = function(e) {
                                this.autoUpdate && this.vertexDirty++, this._uvTransform.update(e) && this._refresh()
                            }, t.prototype._refresh = function() {}, t.prototype._calculateBounds = function() {
                                this._bounds.addVertices(this.transform, this.vertices, 0, this.vertices.length)
                            }, t.prototype.containsPoint = function(e) {
                                if (!this.getBounds().contains(e.x, e.y)) return !1;
                                this.worldTransform.applyInverse(e, h);
                                for (var i = this.vertices, r = d.points, n = this.indices, o = this.indices.length, s = this.drawMode === t.DRAW_MODES.TRIANGLES ? 3 : 1, a = 0; a + 2 < o; a += s) {
                                    var l = 2 * n[a],
                                        u = 2 * n[a + 1],
                                        c = 2 * n[a + 2];
                                    if (r[0] = i[l], r[1] = i[l + 1], r[2] = i[u], r[3] = i[u + 1], r[4] = i[c], r[5] = i[c + 1], d.contains(h.x, h.y)) return !0
                                }
                                return !1
                            }, t.prototype.destroy = function(t) {
                                for (var i in this._glDatas) {
                                    var r = this._glDatas[i];
                                    r.destroy ? r.destroy() : (r.vertexBuffer && (r.vertexBuffer.destroy(), r.vertexBuffer = null), r.indexBuffer && (r.indexBuffer.destroy(), r.indexBuffer = null), r.uvBuffer && (r.uvBuffer.destroy(), r.uvBuffer = null), r.vao && (r.vao.destroy(), r.vao = null))
                                }
                                this._glDatas = null, e.prototype.destroy.call(this, t)
                            }, s(t, [{
                                key: "texture",
                                get: function() {
                                    return this._texture
                                },
                                set: function(e) {
                                    this._texture !== e && (this._texture = e, e && (e.baseTexture.hasLoaded ? this._onTextureUpdate() : e.once("update", this._onTextureUpdate, this)))
                                }
                            }, {
                                key: "tint",
                                get: function() {
                                    return l.utils.rgb2hex(this.tintRgb)
                                },
                                set: function(e) {
                                    this.tintRgb = l.utils.hex2rgb(e, this.tintRgb)
                                }
                            }]), t
                        }(l.Container);
                    i.default = p, p.DRAW_MODES = {
                        TRIANGLE_MESH: 0,
                        TRIANGLES: 1
                    }
                }, {
                    "../core": 65,
                    "../core/textures/Texture": 115
                }],
                167: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("./Plane"),
                        l = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(a),
                        u = 10,
                        c = function(e) {
                            function t(i, o, s, a, l) {
                                r(this, t);
                                var c = n(this, e.call(this, i, 4, 4));
                                return c._origWidth = i.orig.width, c._origHeight = i.orig.height, c._width = c._origWidth, c._height = c._origHeight, c._leftWidth = void 0 !== o ? o : u, c._rightWidth = void 0 !== a ? a : u, c._topHeight = void 0 !== s ? s : u, c._bottomHeight = void 0 !== l ? l : u, c.refresh(!0), c
                            }
                            return o(t, e), t.prototype.updateHorizontalVertices = function() {
                                var e = this.vertices,
                                    t = this._topHeight + this._bottomHeight,
                                    i = this._height > t ? 1 : this._height / t;
                                e[9] = e[11] = e[13] = e[15] = this._topHeight * i, e[17] = e[19] = e[21] = e[23] = this._height - this._bottomHeight * i, e[25] = e[27] = e[29] = e[31] = this._height
                            }, t.prototype.updateVerticalVertices = function() {
                                var e = this.vertices,
                                    t = this._leftWidth + this._rightWidth,
                                    i = this._width > t ? 1 : this._width / t;
                                e[2] = e[10] = e[18] = e[26] = this._leftWidth * i, e[4] = e[12] = e[20] = e[28] = this._width - this._rightWidth * i, e[6] = e[14] = e[22] = e[30] = this._width
                            }, t.prototype._renderCanvas = function(e) {
                                var t = e.context;
                                t.globalAlpha = this.worldAlpha, e.setBlendMode(this.blendMode);
                                var i = this.worldTransform,
                                    r = e.resolution;
                                e.roundPixels ? t.setTransform(i.a * r, i.b * r, i.c * r, i.d * r, i.tx * r | 0, i.ty * r | 0) : t.setTransform(i.a * r, i.b * r, i.c * r, i.d * r, i.tx * r, i.ty * r);
                                var n = this._texture.baseTexture,
                                    o = n.source,
                                    s = n.width * n.resolution,
                                    a = n.height * n.resolution;
                                this.drawSegment(t, o, s, a, 0, 1, 10, 11), this.drawSegment(t, o, s, a, 2, 3, 12, 13), this.drawSegment(t, o, s, a, 4, 5, 14, 15), this.drawSegment(t, o, s, a, 8, 9, 18, 19), this.drawSegment(t, o, s, a, 10, 11, 20, 21), this.drawSegment(t, o, s, a, 12, 13, 22, 23), this.drawSegment(t, o, s, a, 16, 17, 26, 27), this.drawSegment(t, o, s, a, 18, 19, 28, 29), this.drawSegment(t, o, s, a, 20, 21, 30, 31)
                            }, t.prototype.drawSegment = function(e, t, i, r, n, o, s, a) {
                                var l = this.uvs,
                                    u = this.vertices,
                                    c = (l[s] - l[n]) * i,
                                    h = (l[a] - l[o]) * r,
                                    d = u[s] - u[n],
                                    p = u[a] - u[o];
                                c < 1 && (c = 1), h < 1 && (h = 1), d < 1 && (d = 1), p < 1 && (p = 1), e.drawImage(t, l[n] * i, l[o] * r, c, h, u[n], u[o], d, p)
                            }, t.prototype._refresh = function() {
                                e.prototype._refresh.call(this);
                                var t = this.uvs,
                                    i = this._texture;
                                this._origWidth = i.orig.width, this._origHeight = i.orig.height;
                                var r = 1 / this._origWidth,
                                    n = 1 / this._origHeight;
                                t[0] = t[8] = t[16] = t[24] = 0, t[1] = t[3] = t[5] = t[7] = 0, t[6] = t[14] = t[22] = t[30] = 1, t[25] = t[27] = t[29] = t[31] = 1, t[2] = t[10] = t[18] = t[26] = r * this._leftWidth, t[4] = t[12] = t[20] = t[28] = 1 - r * this._rightWidth, t[9] = t[11] = t[13] = t[15] = n * this._topHeight, t[17] = t[19] = t[21] = t[23] = 1 - n * this._bottomHeight, this.updateHorizontalVertices(), this.updateVerticalVertices(), this.dirty++, this.multiplyUvs()
                            }, s(t, [{
                                key: "width",
                                get: function() {
                                    return this._width
                                },
                                set: function(e) {
                                    this._width = e, this._refresh()
                                }
                            }, {
                                key: "height",
                                get: function() {
                                    return this._height
                                },
                                set: function(e) {
                                    this._height = e, this._refresh()
                                }
                            }, {
                                key: "leftWidth",
                                get: function() {
                                    return this._leftWidth
                                },
                                set: function(e) {
                                    this._leftWidth = e, this._refresh()
                                }
                            }, {
                                key: "rightWidth",
                                get: function() {
                                    return this._rightWidth
                                },
                                set: function(e) {
                                    this._rightWidth = e, this._refresh()
                                }
                            }, {
                                key: "topHeight",
                                get: function() {
                                    return this._topHeight
                                },
                                set: function(e) {
                                    this._topHeight = e, this._refresh()
                                }
                            }, {
                                key: "bottomHeight",
                                get: function() {
                                    return this._bottomHeight
                                },
                                set: function(e) {
                                    this._bottomHeight = e, this._refresh()
                                }
                            }]), t
                        }(l.default);
                    i.default = c
                }, {
                    "./Plane": 168
                }],
                168: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = e("./Mesh"),
                        a = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(s),
                        l = function(e) {
                            function t(i, o, s) {
                                r(this, t);
                                var l = n(this, e.call(this, i));
                                return l._ready = !0, l.verticesX = o || 10, l.verticesY = s || 10, l.drawMode = a.default.DRAW_MODES.TRIANGLES, l.refresh(), l
                            }
                            return o(t, e), t.prototype._refresh = function() {
                                for (var e = this._texture, t = this.verticesX * this.verticesY, i = [], r = [], n = [], o = [], s = this.verticesX - 1, a = this.verticesY - 1, l = e.width / s, u = e.height / a, c = 0; c < t; c++) {
                                    var h = c % this.verticesX,
                                        d = c / this.verticesX | 0;
                                    i.push(h * l, d * u), n.push(h / s, d / a)
                                }
                                for (var p = s * a, f = 0; f < p; f++) {
                                    var _ = f % s,
                                        m = f / s | 0,
                                        g = m * this.verticesX + _,
                                        v = m * this.verticesX + _ + 1,
                                        y = (m + 1) * this.verticesX + _,
                                        b = (m + 1) * this.verticesX + _ + 1;
                                    o.push(g, v, y), o.push(v, b, y)
                                }
                                this.vertices = new Float32Array(i), this.uvs = new Float32Array(n), this.colors = new Float32Array(r), this.indices = new Uint16Array(o), this.dirty++, this.indexDirty++, this.multiplyUvs()
                            }, t.prototype._onTextureUpdate = function() {
                                a.default.prototype._onTextureUpdate.call(this), this._ready && this.refresh()
                            }, t
                        }(a.default);
                    i.default = l
                }, {
                    "./Mesh": 166
                }],
                169: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = e("./Mesh"),
                        a = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(s),
                        l = function(e) {
                            function t(i, o) {
                                r(this, t);
                                var s = n(this, e.call(this, i));
                                return s.points = o, s.vertices = new Float32Array(4 * o.length), s.uvs = new Float32Array(4 * o.length), s.colors = new Float32Array(2 * o.length), s.indices = new Uint16Array(2 * o.length), s.autoUpdate = !0, s.refresh(), s
                            }
                            return o(t, e), t.prototype._refresh = function() {
                                var e = this.points;
                                if (!(e.length < 1) && this._texture._uvs) {
                                    this.vertices.length / 4 !== e.length && (this.vertices = new Float32Array(4 * e.length), this.uvs = new Float32Array(4 * e.length), this.colors = new Float32Array(2 * e.length), this.indices = new Uint16Array(2 * e.length));
                                    var t = this.uvs,
                                        i = this.indices,
                                        r = this.colors;
                                    t[0] = 0, t[1] = 0, t[2] = 0, t[3] = 1, r[0] = 1, r[1] = 1, i[0] = 0, i[1] = 1;
                                    for (var n = e.length, o = 1; o < n; o++) {
                                        var s = 4 * o,
                                            a = o / (n - 1);
                                        t[s] = a, t[s + 1] = 0, t[s + 2] = a, t[s + 3] = 1, s = 2 * o, r[s] = 1, r[s + 1] = 1, s = 2 * o, i[s] = s, i[s + 1] = s + 1
                                    }
                                    this.dirty++, this.indexDirty++, this.multiplyUvs(), this.refreshVertices()
                                }
                            }, t.prototype.refreshVertices = function() {
                                var e = this.points;
                                if (!(e.length < 1))
                                    for (var t = e[0], i = void 0, r = 0, n = 0, o = this.vertices, s = e.length, a = 0; a < s; a++) {
                                        var l = e[a],
                                            u = 4 * a;
                                        i = a < e.length - 1 ? e[a + 1] : l, n = -(i.x - t.x), r = i.y - t.y;
                                        var c = 10 * (1 - a / (s - 1));
                                        c > 1 && (c = 1);
                                        var h = Math.sqrt(r * r + n * n),
                                            d = this._texture.height / 2;
                                        r /= h, n /= h, r *= d, n *= d, o[u] = l.x + r, o[u + 1] = l.y + n, o[u + 2] = l.x - r, o[u + 3] = l.y - n, t = l
                                    }
                            }, t.prototype.updateTransform = function() {
                                this.autoUpdate && this.refreshVertices(), this.containerUpdateTransform()
                            }, t
                        }(a.default);
                    i.default = l
                }, {
                    "./Mesh": 166
                }],
                170: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = e("../../core"),
                        o = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(n),
                        s = e("../Mesh"),
                        a = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(s),
                        l = function() {
                            function e(t) {
                                r(this, e), this.renderer = t
                            }
                            return e.prototype.render = function(e) {
                                var t = this.renderer,
                                    i = t.context,
                                    r = e.worldTransform,
                                    n = t.resolution;
                                t.roundPixels ? i.setTransform(r.a * n, r.b * n, r.c * n, r.d * n, r.tx * n | 0, r.ty * n | 0) : i.setTransform(r.a * n, r.b * n, r.c * n, r.d * n, r.tx * n, r.ty * n), t.context.globalAlpha = e.worldAlpha, t.setBlendMode(e.blendMode), e.drawMode === a.default.DRAW_MODES.TRIANGLE_MESH ? this._renderTriangleMesh(e) : this._renderTriangles(e)
                            }, e.prototype._renderTriangleMesh = function(e) {
                                for (var t = e.vertices.length / 2, i = 0; i < t - 2; i++) {
                                    var r = 2 * i;
                                    this._renderDrawTriangle(e, r, r + 2, r + 4)
                                }
                            }, e.prototype._renderTriangles = function(e) {
                                for (var t = e.indices, i = t.length, r = 0; r < i; r += 3) {
                                    var n = 2 * t[r],
                                        o = 2 * t[r + 1],
                                        s = 2 * t[r + 2];
                                    this._renderDrawTriangle(e, n, o, s)
                                }
                            }, e.prototype._renderDrawTriangle = function(e, t, i, r) {
                                var n = this.renderer.context,
                                    o = e.uvs,
                                    s = e.vertices,
                                    a = e._texture;
                                if (a.valid) {
                                    var l = a.baseTexture,
                                        u = l.source,
                                        c = l.width,
                                        h = l.height,
                                        d = void 0,
                                        p = void 0,
                                        f = void 0,
                                        _ = void 0,
                                        m = void 0,
                                        g = void 0;
                                    if (e.uploadUvTransform) {
                                        var v = e._uvTransform.mapCoord;
                                        d = (o[t] * v.a + o[t + 1] * v.c + v.tx) * l.width, p = (o[i] * v.a + o[i + 1] * v.c + v.tx) * l.width, f = (o[r] * v.a + o[r + 1] * v.c + v.tx) * l.width, _ = (o[t] * v.b + o[t + 1] * v.d + v.ty) * l.height, m = (o[i] * v.b + o[i + 1] * v.d + v.ty) * l.height, g = (o[r] * v.b + o[r + 1] * v.d + v.ty) * l.height
                                    } else d = o[t] * l.width, p = o[i] * l.width, f = o[r] * l.width, _ = o[t + 1] * l.height, m = o[i + 1] * l.height, g = o[r + 1] * l.height;
                                    var y = s[t],
                                        b = s[i],
                                        x = s[r],
                                        T = s[t + 1],
                                        E = s[i + 1],
                                        S = s[r + 1],
                                        P = e.canvasPadding / this.renderer.resolution;
                                    if (P > 0) {
                                        var A = P / Math.abs(e.worldTransform.a),
                                            C = P / Math.abs(e.worldTransform.d),
                                            M = (y + b + x) / 3,
                                            R = (T + E + S) / 3,
                                            O = y - M,
                                            w = T - R,
                                            I = Math.sqrt(O * O + w * w);
                                        y = M + O / I * (I + A), T = R + w / I * (I + C), O = b - M, w = E - R, I = Math.sqrt(O * O + w * w), b = M + O / I * (I + A), E = R + w / I * (I + C), O = x - M, w = S - R, I = Math.sqrt(O * O + w * w), x = M + O / I * (I + A), S = R + w / I * (I + C)
                                    }
                                    n.save(), n.beginPath(), n.moveTo(y, T), n.lineTo(b, E), n.lineTo(x, S), n.closePath(), n.clip();
                                    var D = d * m + _ * f + p * g - m * f - _ * p - d * g,
                                        L = y * m + _ * x + b * g - m * x - _ * b - y * g,
                                        B = d * b + y * f + p * x - b * f - y * p - d * x,
                                        F = d * m * x + _ * b * f + y * p * g - y * m * f - _ * p * x - d * b * g,
                                        N = T * m + _ * S + E * g - m * S - _ * E - T * g,
                                        V = d * E + T * f + p * S - E * f - T * p - d * S,
                                        k = d * m * S + _ * E * f + T * p * g - T * m * f - _ * p * S - d * E * g;
                                    n.transform(L / D, N / D, B / D, V / D, F / D, k / D), n.drawImage(u, 0, 0, c * l.resolution, h * l.resolution, 0, 0, c, h), n.restore(), this.renderer.invalidateBlendMode()
                                }
                            }, e.prototype.renderMeshFlat = function(e) {
                                var t = this.renderer.context,
                                    i = e.vertices,
                                    r = i.length / 2;
                                t.beginPath();
                                for (var n = 1; n < r - 2; ++n) {
                                    var o = 2 * n,
                                        s = i[o],
                                        a = i[o + 1],
                                        l = i[o + 2],
                                        u = i[o + 3],
                                        c = i[o + 4],
                                        h = i[o + 5];
                                    t.moveTo(s, a), t.lineTo(l, u), t.lineTo(c, h)
                                }
                                t.fillStyle = "#FF0000", t.fill(), t.closePath()
                            }, e.prototype.destroy = function() {
                                this.renderer = null
                            }, e
                        }();
                    i.default = l, o.CanvasRenderer.registerPlugin("mesh", l)
                }, {
                    "../../core": 65,
                    "../Mesh": 166
                }],
                171: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0;
                    var n = e("./Mesh");
                    Object.defineProperty(i, "Mesh", {
                        enumerable: !0,
                        get: function() {
                            return r(n).default
                        }
                    });
                    var o = e("./webgl/MeshRenderer");
                    Object.defineProperty(i, "MeshRenderer", {
                        enumerable: !0,
                        get: function() {
                            return r(o).default
                        }
                    });
                    var s = e("./canvas/CanvasMeshRenderer");
                    Object.defineProperty(i, "CanvasMeshRenderer", {
                        enumerable: !0,
                        get: function() {
                            return r(s).default
                        }
                    });
                    var a = e("./Plane");
                    Object.defineProperty(i, "Plane", {
                        enumerable: !0,
                        get: function() {
                            return r(a).default
                        }
                    });
                    var l = e("./NineSlicePlane");
                    Object.defineProperty(i, "NineSlicePlane", {
                        enumerable: !0,
                        get: function() {
                            return r(l).default
                        }
                    });
                    var u = e("./Rope");
                    Object.defineProperty(i, "Rope", {
                        enumerable: !0,
                        get: function() {
                            return r(u).default
                        }
                    })
                }, {
                    "./Mesh": 166,
                    "./NineSlicePlane": 167,
                    "./Plane": 168,
                    "./Rope": 169,
                    "./canvas/CanvasMeshRenderer": 170,
                    "./webgl/MeshRenderer": 172
                }],
                172: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("../../core"),
                        l = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(a),
                        u = e("pixi-gl-core"),
                        c = r(u),
                        h = e("../Mesh"),
                        d = r(h),
                        p = (e("path"), l.Matrix.IDENTITY),
                        f = function(e) {
                            function t(i) {
                                n(this, t);
                                var r = o(this, e.call(this, i));
                                return r.shader = null, r
                            }
                            return s(t, e), t.prototype.onContextChange = function() {
                                var e = this.renderer.gl;
                                this.shader = new l.Shader(e, "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n", "varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n    gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n")
                            }, t.prototype.render = function(e) {
                                var t = this.renderer,
                                    i = t.gl,
                                    r = e._texture;
                                if (r.valid) {
                                    var n = e._glDatas[t.CONTEXT_UID];
                                    n || (t.bindVao(null), n = {
                                        shader: this.shader,
                                        vertexBuffer: c.default.GLBuffer.createVertexBuffer(i, e.vertices, i.STREAM_DRAW),
                                        uvBuffer: c.default.GLBuffer.createVertexBuffer(i, e.uvs, i.STREAM_DRAW),
                                        indexBuffer: c.default.GLBuffer.createIndexBuffer(i, e.indices, i.STATIC_DRAW),
                                        vao: null,
                                        dirty: e.dirty,
                                        indexDirty: e.indexDirty,
                                        vertexDirty: e.vertexDirty
                                    }, n.vao = new c.default.VertexArrayObject(i).addIndex(n.indexBuffer).addAttribute(n.vertexBuffer, n.shader.attributes.aVertexPosition, i.FLOAT, !1, 8, 0).addAttribute(n.uvBuffer, n.shader.attributes.aTextureCoord, i.FLOAT, !1, 8, 0), e._glDatas[t.CONTEXT_UID] = n), t.bindVao(n.vao), e.dirty !== n.dirty && (n.dirty = e.dirty, n.uvBuffer.upload(e.uvs)), e.indexDirty !== n.indexDirty && (n.indexDirty = e.indexDirty, n.indexBuffer.upload(e.indices)), e.vertexDirty !== n.vertexDirty && (n.vertexDirty = e.vertexDirty, n.vertexBuffer.upload(e.vertices)), t.bindShader(n.shader), n.shader.uniforms.uSampler = t.bindTexture(r), t.state.setBlendMode(l.utils.correctBlendMode(e.blendMode, r.baseTexture.premultipliedAlpha)), n.shader.uniforms.uTransform && (e.uploadUvTransform ? n.shader.uniforms.uTransform = e._uvTransform.mapCoord.toArray(!0) : n.shader.uniforms.uTransform = p.toArray(!0)), n.shader.uniforms.translationMatrix = e.worldTransform.toArray(!0), n.shader.uniforms.uColor = l.utils.premultiplyRgba(e.tintRgb, e.worldAlpha, n.shader.uniforms.uColor, r.baseTexture.premultipliedAlpha);
                                    var o = e.drawMode === d.default.DRAW_MODES.TRIANGLE_MESH ? i.TRIANGLE_STRIP : i.TRIANGLES;
                                    n.vao.draw(o, e.indices.length, 0)
                                }
                            }, t
                        }(l.ObjectRenderer);
                    i.default = f, l.WebGLRenderer.registerPlugin("mesh", f)
                }, {
                    "../../core": 65,
                    "../Mesh": 166,
                    path: 8,
                    "pixi-gl-core": 15
                }],
                173: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = function() {
                            function e(e, t) {
                                for (var i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
                                }
                            }
                            return function(t, i, r) {
                                return i && e(t.prototype, i), r && e(t, r), t
                            }
                        }(),
                        a = e("../core"),
                        l = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(a),
                        u = e("../core/utils"),
                        c = function(e) {
                            function t() {
                                var i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1500,
                                    o = arguments[1],
                                    s = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 16384,
                                    a = arguments.length > 3 && void 0 !== arguments[3] && arguments[3];
                                r(this, t);
                                var u = n(this, e.call(this));
                                return s > 16384 && (s = 16384), s > i && (s = i), u._properties = [!1, !0, !1, !1, !1], u._maxSize = i, u._batchSize = s, u._glBuffers = {}, u._bufferUpdateIDs = [], u._updateID = 0, u.interactiveChildren = !1, u.blendMode = l.BLEND_MODES.NORMAL, u.autoResize = a, u.roundPixels = !0, u.baseTexture = null, u.setProperties(o), u._tint = 0, u.tintRgb = new Float32Array(4), u.tint = 16777215, u
                            }
                            return o(t, e), t.prototype.setProperties = function(e) {
                                e && (this._properties[0] = "vertices" in e || "scale" in e ? !!e.vertices || !!e.scale : this._properties[0], this._properties[1] = "position" in e ? !!e.position : this._properties[1], this._properties[2] = "rotation" in e ? !!e.rotation : this._properties[2], this._properties[3] = "uvs" in e ? !!e.uvs : this._properties[3], this._properties[4] = "tint" in e || "alpha" in e ? !!e.tint || !!e.alpha : this._properties[4])
                            }, t.prototype.updateTransform = function() {
                                this.displayObjectUpdateTransform()
                            }, t.prototype.renderWebGL = function(e) {
                                var t = this;
                                this.visible && !(this.worldAlpha <= 0) && this.children.length && this.renderable && (this.baseTexture || (this.baseTexture = this.children[0]._texture.baseTexture, this.baseTexture.hasLoaded || this.baseTexture.once("update", function() {
                                    return t.onChildrenChange(0)
                                })), e.setObjectRenderer(e.plugins.particle), e.plugins.particle.render(this))
                            }, t.prototype.onChildrenChange = function(e) {
                                for (var t = Math.floor(e / this._batchSize); this._bufferUpdateIDs.length < t;) this._bufferUpdateIDs.push(0);
                                this._bufferUpdateIDs[t] = ++this._updateID
                            }, t.prototype.renderCanvas = function(e) {
                                if (this.visible && !(this.worldAlpha <= 0) && this.children.length && this.renderable) {
                                    var t = e.context,
                                        i = this.worldTransform,
                                        r = !0,
                                        n = 0,
                                        o = 0,
                                        s = 0,
                                        a = 0;
                                    e.setBlendMode(this.blendMode), t.globalAlpha = this.worldAlpha, this.displayObjectUpdateTransform();
                                    for (var l = 0; l < this.children.length; ++l) {
                                        var u = this.children[l];
                                        if (u.visible) {
                                            var c = u._texture.frame;
                                            if (t.globalAlpha = this.worldAlpha * u.alpha, u.rotation % (2 * Math.PI) == 0) r && (t.setTransform(i.a, i.b, i.c, i.d, i.tx * e.resolution, i.ty * e.resolution), r = !1), n = u.anchor.x * (-c.width * u.scale.x) + u.position.x + .5, o = u.anchor.y * (-c.height * u.scale.y) + u.position.y + .5, s = c.width * u.scale.x, a = c.height * u.scale.y;
                                            else {
                                                r || (r = !0), u.displayObjectUpdateTransform();
                                                var h = u.worldTransform;
                                                e.roundPixels ? t.setTransform(h.a, h.b, h.c, h.d, h.tx * e.resolution | 0, h.ty * e.resolution | 0) : t.setTransform(h.a, h.b, h.c, h.d, h.tx * e.resolution, h.ty * e.resolution), n = u.anchor.x * -c.width + .5, o = u.anchor.y * -c.height + .5, s = c.width, a = c.height
                                            }
                                            var d = u._texture.baseTexture.resolution;
                                            t.drawImage(u._texture.baseTexture.source, c.x * d, c.y * d, c.width * d, c.height * d, n * e.resolution, o * e.resolution, s * e.resolution, a * e.resolution)
                                        }
                                    }
                                }
                            }, t.prototype.destroy = function(t) {
                                if (e.prototype.destroy.call(this, t), this._buffers)
                                    for (var i = 0; i < this._buffers.length; ++i) this._buffers[i].destroy();
                                this._properties = null, this._buffers = null, this._bufferUpdateIDs = null
                            }, s(t, [{
                                key: "tint",
                                get: function() {
                                    return this._tint
                                },
                                set: function(e) {
                                    this._tint = e, (0, u.hex2rgb)(e, this.tintRgb)
                                }
                            }]), t
                        }(l.Container);
                    i.default = c
                }, {
                    "../core": 65,
                    "../core/utils": 125
                }],
                174: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0;
                    var n = e("./ParticleContainer");
                    Object.defineProperty(i, "ParticleContainer", {
                        enumerable: !0,
                        get: function() {
                            return r(n).default
                        }
                    });
                    var o = e("./webgl/ParticleRenderer");
                    Object.defineProperty(i, "ParticleRenderer", {
                        enumerable: !0,
                        get: function() {
                            return r(o).default
                        }
                    })
                }, {
                    "./ParticleContainer": 173,
                    "./webgl/ParticleRenderer": 176
                }],
                175: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var o = e("pixi-gl-core"),
                        s = r(o),
                        a = e("../../core/utils/createIndicesForQuads"),
                        l = r(a),
                        u = function() {
                            function e(t, i, r, o) {
                                n(this, e), this.gl = t, this.size = o, this.dynamicProperties = [], this.staticProperties = [];
                                for (var s = 0; s < i.length; ++s) {
                                    var a = i[s];
                                    a = {
                                        attribute: a.attribute,
                                        size: a.size,
                                        uploadFunction: a.uploadFunction,
                                        unsignedByte: a.unsignedByte,
                                        offset: a.offset
                                    }, r[s] ? this.dynamicProperties.push(a) : this.staticProperties.push(a)
                                }
                                this.staticStride = 0, this.staticBuffer = null, this.staticData = null, this.staticDataUint32 = null, this.dynamicStride = 0, this.dynamicBuffer = null, this.dynamicData = null, this.dynamicDataUint32 = null, this._updateID = 0, this.initBuffers()
                            }
                            return e.prototype.initBuffers = function() {
                                var e = this.gl,
                                    t = 0;
                                this.indices = (0, l.default)(this.size), this.indexBuffer = s.default.GLBuffer.createIndexBuffer(e, this.indices, e.STATIC_DRAW), this.dynamicStride = 0;
                                for (var i = 0; i < this.dynamicProperties.length; ++i) {
                                    var r = this.dynamicProperties[i];
                                    r.offset = t, t += r.size, this.dynamicStride += r.size
                                }
                                var n = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);
                                this.dynamicData = new Float32Array(n), this.dynamicDataUint32 = new Uint32Array(n), this.dynamicBuffer = s.default.GLBuffer.createVertexBuffer(e, n, e.STREAM_DRAW);
                                var o = 0;
                                this.staticStride = 0;
                                for (var a = 0; a < this.staticProperties.length; ++a) {
                                    var u = this.staticProperties[a];
                                    u.offset = o, o += u.size, this.staticStride += u.size
                                }
                                var c = new ArrayBuffer(this.size * this.staticStride * 4 * 4);
                                this.staticData = new Float32Array(c), this.staticDataUint32 = new Uint32Array(c), this.staticBuffer = s.default.GLBuffer.createVertexBuffer(e, c, e.STATIC_DRAW), this.vao = new s.default.VertexArrayObject(e).addIndex(this.indexBuffer);
                                for (var h = 0; h < this.dynamicProperties.length; ++h) {
                                    var d = this.dynamicProperties[h];
                                    d.unsignedByte ? this.vao.addAttribute(this.dynamicBuffer, d.attribute, e.UNSIGNED_BYTE, !0, 4 * this.dynamicStride, 4 * d.offset) : this.vao.addAttribute(this.dynamicBuffer, d.attribute, e.FLOAT, !1, 4 * this.dynamicStride, 4 * d.offset)
                                }
                                for (var p = 0; p < this.staticProperties.length; ++p) {
                                    var f = this.staticProperties[p];
                                    f.unsignedByte ? this.vao.addAttribute(this.staticBuffer, f.attribute, e.UNSIGNED_BYTE, !0, 4 * this.staticStride, 4 * f.offset) : this.vao.addAttribute(this.staticBuffer, f.attribute, e.FLOAT, !1, 4 * this.staticStride, 4 * f.offset)
                                }
                            }, e.prototype.uploadDynamic = function(e, t, i) {
                                for (var r = 0; r < this.dynamicProperties.length; r++) {
                                    var n = this.dynamicProperties[r];
                                    n.uploadFunction(e, t, i, n.unsignedByte ? this.dynamicDataUint32 : this.dynamicData, this.dynamicStride, n.offset)
                                }
                                this.dynamicBuffer.upload()
                            }, e.prototype.uploadStatic = function(e, t, i) {
                                for (var r = 0; r < this.staticProperties.length; r++) {
                                    var n = this.staticProperties[r];
                                    n.uploadFunction(e, t, i, n.unsignedByte ? this.staticDataUint32 : this.staticData, this.staticStride, n.offset)
                                }
                                this.staticBuffer.upload()
                            }, e.prototype.destroy = function() {
                                this.dynamicProperties = null, this.dynamicBuffer.destroy(), this.dynamicBuffer = null, this.dynamicData = null, this.dynamicDataUint32 = null, this.staticProperties = null, this.staticBuffer.destroy(), this.staticBuffer = null,
                                    this.staticData = null, this.staticDataUint32 = null
                            }, e
                        }();
                    i.default = u
                }, {
                    "../../core/utils/createIndicesForQuads": 123,
                    "pixi-gl-core": 15
                }],
                176: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }

                    function n(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function o(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function s(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var a = e("../../core"),
                        l = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(a),
                        u = e("./ParticleShader"),
                        c = r(u),
                        h = e("./ParticleBuffer"),
                        d = r(h),
                        p = e("../../core/utils"),
                        f = function(e) {
                            function t(i) {
                                n(this, t);
                                var r = o(this, e.call(this, i));
                                return r.shader = null, r.indexBuffer = null, r.properties = null, r.tempMatrix = new l.Matrix, r.CONTEXT_UID = 0, r
                            }
                            return s(t, e), t.prototype.onContextChange = function() {
                                var e = this.renderer.gl;
                                this.CONTEXT_UID = this.renderer.CONTEXT_UID, this.shader = new c.default(e), this.properties = [{
                                    attribute: this.shader.attributes.aVertexPosition,
                                    size: 2,
                                    uploadFunction: this.uploadVertices,
                                    offset: 0
                                }, {
                                    attribute: this.shader.attributes.aPositionCoord,
                                    size: 2,
                                    uploadFunction: this.uploadPosition,
                                    offset: 0
                                }, {
                                    attribute: this.shader.attributes.aRotation,
                                    size: 1,
                                    uploadFunction: this.uploadRotation,
                                    offset: 0
                                }, {
                                    attribute: this.shader.attributes.aTextureCoord,
                                    size: 2,
                                    uploadFunction: this.uploadUvs,
                                    offset: 0
                                }, {
                                    attribute: this.shader.attributes.aColor,
                                    size: 1,
                                    unsignedByte: !0,
                                    uploadFunction: this.uploadTint,
                                    offset: 0
                                }]
                            }, t.prototype.start = function() {
                                this.renderer.bindShader(this.shader)
                            }, t.prototype.render = function(e) {
                                var t = e.children,
                                    i = e._maxSize,
                                    r = e._batchSize,
                                    n = this.renderer,
                                    o = t.length;
                                if (0 !== o) {
                                    o > i && (o = i);
                                    var s = e._glBuffers[n.CONTEXT_UID];
                                    s || (s = e._glBuffers[n.CONTEXT_UID] = this.generateBuffers(e));
                                    var a = t[0]._texture.baseTexture;
                                    this.renderer.setBlendMode(l.utils.correctBlendMode(e.blendMode, a.premultipliedAlpha));
                                    var u = n.gl,
                                        c = e.worldTransform.copy(this.tempMatrix);
                                    c.prepend(n._activeRenderTarget.projectionMatrix), this.shader.uniforms.projectionMatrix = c.toArray(!0), this.shader.uniforms.uColor = l.utils.premultiplyRgba(e.tintRgb, e.worldAlpha, this.shader.uniforms.uColor, a.premultipliedAlpha), this.shader.uniforms.uSampler = n.bindTexture(a);
                                    for (var h = !1, d = 0, p = 0; d < o; d += r, p += 1) {
                                        var f = o - d;
                                        if (f > r && (f = r), p >= s.length) {
                                            if (!e.autoResize) break;
                                            s.push(this._generateOneMoreBuffer(e))
                                        }
                                        var _ = s[p];
                                        _.uploadDynamic(t, d, f);
                                        var m = e._bufferUpdateIDs[p] || 0;
                                        h = h || _._updateID < m, h && (_._updateID = e._updateID, _.uploadStatic(t, d, f)), n.bindVao(_.vao), _.vao.draw(u.TRIANGLES, 6 * f)
                                    }
                                }
                            }, t.prototype.generateBuffers = function(e) {
                                for (var t = this.renderer.gl, i = [], r = e._maxSize, n = e._batchSize, o = e._properties, s = 0; s < r; s += n) i.push(new d.default(t, this.properties, o, n));
                                return i
                            }, t.prototype._generateOneMoreBuffer = function(e) {
                                var t = this.renderer.gl,
                                    i = e._batchSize,
                                    r = e._properties;
                                return new d.default(t, this.properties, r, i)
                            }, t.prototype.uploadVertices = function(e, t, i, r, n, o) {
                                for (var s = 0, a = 0, l = 0, u = 0, c = 0; c < i; ++c) {
                                    var h = e[t + c],
                                        d = h._texture,
                                        p = h.scale.x,
                                        f = h.scale.y,
                                        _ = d.trim,
                                        m = d.orig;
                                    _ ? (a = _.x - h.anchor.x * m.width, s = a + _.width, u = _.y - h.anchor.y * m.height, l = u + _.height) : (s = m.width * (1 - h.anchor.x), a = m.width * -h.anchor.x, l = m.height * (1 - h.anchor.y), u = m.height * -h.anchor.y), r[o] = a * p, r[o + 1] = u * f, r[o + n] = s * p, r[o + n + 1] = u * f, r[o + 2 * n] = s * p, r[o + 2 * n + 1] = l * f, r[o + 3 * n] = a * p, r[o + 3 * n + 1] = l * f, o += 4 * n
                                }
                            }, t.prototype.uploadPosition = function(e, t, i, r, n, o) {
                                for (var s = 0; s < i; s++) {
                                    var a = e[t + s].position;
                                    r[o] = a.x, r[o + 1] = a.y, r[o + n] = a.x, r[o + n + 1] = a.y, r[o + 2 * n] = a.x, r[o + 2 * n + 1] = a.y, r[o + 3 * n] = a.x, r[o + 3 * n + 1] = a.y, o += 4 * n
                                }
                            }, t.prototype.uploadRotation = function(e, t, i, r, n, o) {
                                for (var s = 0; s < i; s++) {
                                    var a = e[t + s].rotation;
                                    r[o] = a, r[o + n] = a, r[o + 2 * n] = a, r[o + 3 * n] = a, o += 4 * n
                                }
                            }, t.prototype.uploadUvs = function(e, t, i, r, n, o) {
                                for (var s = 0; s < i; ++s) {
                                    var a = e[t + s]._texture._uvs;
                                    a ? (r[o] = a.x0, r[o + 1] = a.y0, r[o + n] = a.x1, r[o + n + 1] = a.y1, r[o + 2 * n] = a.x2, r[o + 2 * n + 1] = a.y2, r[o + 3 * n] = a.x3, r[o + 3 * n + 1] = a.y3, o += 4 * n) : (r[o] = 0, r[o + 1] = 0, r[o + n] = 0, r[o + n + 1] = 0, r[o + 2 * n] = 0, r[o + 2 * n + 1] = 0, r[o + 3 * n] = 0, r[o + 3 * n + 1] = 0, o += 4 * n)
                                }
                            }, t.prototype.uploadTint = function(e, t, i, r, n, o) {
                                for (var s = 0; s < i; ++s) {
                                    var a = e[t + s],
                                        l = a._texture.baseTexture.premultipliedAlpha,
                                        u = a.alpha,
                                        c = u < 1 && l ? (0, p.premultiplyTint)(a._tintRGB, u) : a._tintRGB + (255 * u << 24);
                                    r[o] = c, r[o + n] = c, r[o + 2 * n] = c, r[o + 3 * n] = c, o += 4 * n
                                }
                            }, t.prototype.destroy = function() {
                                this.renderer.gl && this.renderer.gl.deleteBuffer(this.indexBuffer), e.prototype.destroy.call(this), this.shader.destroy(), this.indices = null, this.tempMatrix = null
                            }, t
                        }(l.ObjectRenderer);
                    i.default = f, l.WebGLRenderer.registerPlugin("particle", f)
                }, {
                    "../../core": 65,
                    "../../core/utils": 125,
                    "./ParticleBuffer": 175,
                    "./ParticleShader": 177
                }],
                177: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }
                    i.__esModule = !0;
                    var s = e("../../core/Shader"),
                        a = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(s),
                        l = function(e) {
                            function t(i) {
                                return r(this, t), n(this, e.call(this, i, ["attribute vec2 aVertexPosition;", "attribute vec2 aTextureCoord;", "attribute vec4 aColor;", "attribute vec2 aPositionCoord;", "attribute float aRotation;", "uniform mat3 projectionMatrix;", "uniform vec4 uColor;", "varying vec2 vTextureCoord;", "varying vec4 vColor;", "void main(void){", "   float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);", "   float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);", "   vec2 v = vec2(x, y);", "   v = v + aPositionCoord;", "   gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);", "   vTextureCoord = aTextureCoord;", "   vColor = aColor * uColor;", "}"].join("\n"), ["varying vec2 vTextureCoord;", "varying vec4 vColor;", "uniform sampler2D uSampler;", "void main(void){", "  vec4 color = texture2D(uSampler, vTextureCoord) * vColor;", "  gl_FragColor = color;", "}"].join("\n")))
                            }
                            return o(t, e), t
                        }(a.default);
                    i.default = l
                }, {
                    "../../core/Shader": 44
                }],
                178: [function(e, t, i) {
                    "use strict";
                    Math.sign || (Math.sign = function(e) {
                        return e = Number(e), 0 === e || isNaN(e) ? e : e > 0 ? 1 : -1
                    })
                }, {}],
                179: [function(e, t, i) {
                    "use strict";
                    Number.isInteger || (Number.isInteger = function(e) {
                        return "number" == typeof e && isFinite(e) && Math.floor(e) === e
                    })
                }, {}],
                180: [function(e, t, i) {
                    "use strict";
                    var r = e("object-assign"),
                        n = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(r);
                    Object.assign || (Object.assign = n.default)
                }, {
                    "object-assign": 6
                }],
                181: [function(e, t, i) {
                    "use strict";
                    e("./Object.assign"), e("./requestAnimationFrame"), e("./Math.sign"), e("./Number.isInteger"), window.ArrayBuffer || (window.ArrayBuffer = Array), window.Float32Array || (window.Float32Array = Array), window.Uint32Array || (window.Uint32Array = Array), window.Uint16Array || (window.Uint16Array = Array)
                }, {
                    "./Math.sign": 178,
                    "./Number.isInteger": 179,
                    "./Object.assign": 180,
                    "./requestAnimationFrame": 182
                }],
                182: [function(e, t, i) {
                    (function(e) {
                        "use strict";
                        if (Date.now && Date.prototype.getTime || (Date.now = function() {
                                return (new Date).getTime()
                            }), !e.performance || !e.performance.now) {
                            var t = Date.now();
                            e.performance || (e.performance = {}), e.performance.now = function() {
                                return Date.now() - t
                            }
                        }
                        for (var i = Date.now(), r = ["ms", "moz", "webkit", "o"], n = 0; n < r.length && !e.requestAnimationFrame; ++n) {
                            var o = r[n];
                            e.requestAnimationFrame = e[o + "RequestAnimationFrame"], e.cancelAnimationFrame = e[o + "CancelAnimationFrame"] || e[o + "CancelRequestAnimationFrame"]
                        }
                        e.requestAnimationFrame || (e.requestAnimationFrame = function(e) {
                            if ("function" != typeof e) throw new TypeError(e + "is not a function");
                            var t = Date.now(),
                                r = 16 + i - t;
                            return r < 0 && (r = 0), i = t, setTimeout(function() {
                                i = Date.now(), e(performance.now())
                            }, r)
                        }), e.cancelAnimationFrame || (e.cancelAnimationFrame = function(e) {
                            return clearTimeout(e)
                        })
                    }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
                }, {}],
                183: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        var i = !1;
                        if (e && e._textures && e._textures.length)
                            for (var r = 0; r < e._textures.length; r++)
                                if (e._textures[r] instanceof d.Texture) {
                                    var n = e._textures[r].baseTexture; - 1 === t.indexOf(n) && (t.push(n), i = !0)
                                }
                        return i
                    }

                    function o(e, t) {
                        return e instanceof d.BaseTexture && (-1 === t.indexOf(e) && t.push(e), !0)
                    }

                    function s(e, t) {
                        if (e._texture && e._texture instanceof d.Texture) {
                            var i = e._texture.baseTexture;
                            return -1 === t.indexOf(i) && t.push(i), !0
                        }
                        return !1
                    }

                    function a(e, t) {
                        return t instanceof d.Text && (t.updateText(!0), !0)
                    }

                    function l(e, t) {
                        if (t instanceof d.TextStyle) {
                            var i = t.toFontString();
                            return d.TextMetrics.measureFont(i), !0
                        }
                        return !1
                    }

                    function u(e, t) {
                        if (e instanceof d.Text) {
                            -1 === t.indexOf(e.style) && t.push(e.style), -1 === t.indexOf(e) && t.push(e);
                            var i = e._texture.baseTexture;
                            return -1 === t.indexOf(i) && t.push(i), !0
                        }
                        return !1
                    }

                    function c(e, t) {
                        return e instanceof d.TextStyle && (-1 === t.indexOf(e) && t.push(e), !0)
                    }
                    i.__esModule = !0;
                    var h = e("../core"),
                        d = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(h),
                        p = e("./limiters/CountLimiter"),
                        f = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(p),
                        _ = d.ticker.shared;
                    d.settings.UPLOADS_PER_FRAME = 4;
                    var m = function() {
                        function e(t) {
                            var i = this;
                            r(this, e), this.limiter = new f.default(d.settings.UPLOADS_PER_FRAME), this.renderer = t, this.uploadHookHelper = null, this.queue = [], this.addHooks = [], this.uploadHooks = [], this.completes = [], this.ticking = !1, this.delayedTick = function() {
                                i.queue && i.prepareItems()
                            }, this.registerFindHook(u), this.registerFindHook(c), this.registerFindHook(n), this.registerFindHook(o), this.registerFindHook(s), this.registerUploadHook(a), this.registerUploadHook(l)
                        }
                        return e.prototype.upload = function(e, t) {
                            "function" == typeof e && (t = e, e = null), e && this.add(e), this.queue.length ? (t && this.completes.push(t), this.ticking || (this.ticking = !0, _.addOnce(this.tick, this, d.UPDATE_PRIORITY.UTILITY))) : t && t()
                        }, e.prototype.tick = function() {
                            setTimeout(this.delayedTick, 0)
                        }, e.prototype.prepareItems = function() {
                            for (this.limiter.beginFrame(); this.queue.length && this.limiter.allowedToUpload();) {
                                var e = this.queue[0],
                                    t = !1;
                                if (e && !e._destroyed)
                                    for (var i = 0, r = this.uploadHooks.length; i < r; i++)
                                        if (this.uploadHooks[i](this.uploadHookHelper, e)) {
                                            this.queue.shift(), t = !0;
                                            break
                                        }
                                t || this.queue.shift()
                            }
                            if (this.queue.length) _.addOnce(this.tick, this, d.UPDATE_PRIORITY.UTILITY);
                            else {
                                this.ticking = !1;
                                var n = this.completes.slice(0);
                                this.completes.length = 0;
                                for (var o = 0, s = n.length; o < s; o++) n[o]()
                            }
                        }, e.prototype.registerFindHook = function(e) {
                            return e && this.addHooks.push(e), this
                        }, e.prototype.registerUploadHook = function(e) {
                            return e && this.uploadHooks.push(e), this
                        }, e.prototype.add = function(e) {
                            for (var t = 0, i = this.addHooks.length; t < i && !this.addHooks[t](e, this.queue); t++);
                            if (e instanceof d.Container)
                                for (var r = e.children.length - 1; r >= 0; r--) this.add(e.children[r]);
                            return this
                        }, e.prototype.destroy = function() {
                            this.ticking && _.remove(this.tick, this), this.ticking = !1, this.addHooks = null, this.uploadHooks = null, this.renderer = null, this.completes = null, this.queue = null, this.limiter = null, this.uploadHookHelper = null
                        }, e
                    }();
                    i.default = m
                }, {
                    "../core": 65,
                    "./limiters/CountLimiter": 186
                }],
                184: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }

                    function s(e, t) {
                        if (t instanceof l.BaseTexture) {
                            var i = t.source,
                                r = 0 === i.width ? e.canvas.width : Math.min(e.canvas.width, i.width),
                                n = 0 === i.height ? e.canvas.height : Math.min(e.canvas.height, i.height);
                            return e.ctx.drawImage(i, 0, 0, r, n, 0, 0, e.canvas.width, e.canvas.height), !0
                        }
                        return !1
                    }
                    i.__esModule = !0;
                    var a = e("../../core"),
                        l = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(a),
                        u = e("../BasePrepare"),
                        c = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(u),
                        h = 16,
                        d = function(e) {
                            function t(i) {
                                r(this, t);
                                var o = n(this, e.call(this, i));
                                return o.uploadHookHelper = o, o.canvas = document.createElement("canvas"), o.canvas.width = h, o.canvas.height = h, o.ctx = o.canvas.getContext("2d"), o.registerUploadHook(s), o
                            }
                            return o(t, e), t.prototype.destroy = function() {
                                e.prototype.destroy.call(this), this.ctx = null, this.canvas = null
                            }, t
                        }(c.default);
                    i.default = d, l.CanvasRenderer.registerPlugin("prepare", d)
                }, {
                    "../../core": 65,
                    "../BasePrepare": 183
                }],
                185: [function(e, t, i) {
                    "use strict";

                    function r(e) {
                        return e && e.__esModule ? e : {
                            default: e
                        }
                    }
                    i.__esModule = !0;
                    var n = e("./webgl/WebGLPrepare");
                    Object.defineProperty(i, "webgl", {
                        enumerable: !0,
                        get: function() {
                            return r(n).default
                        }
                    });
                    var o = e("./canvas/CanvasPrepare");
                    Object.defineProperty(i, "canvas", {
                        enumerable: !0,
                        get: function() {
                            return r(o).default
                        }
                    });
                    var s = e("./BasePrepare");
                    Object.defineProperty(i, "BasePrepare", {
                        enumerable: !0,
                        get: function() {
                            return r(s).default
                        }
                    });
                    var a = e("./limiters/CountLimiter");
                    Object.defineProperty(i, "CountLimiter", {
                        enumerable: !0,
                        get: function() {
                            return r(a).default
                        }
                    });
                    var l = e("./limiters/TimeLimiter");
                    Object.defineProperty(i, "TimeLimiter", {
                        enumerable: !0,
                        get: function() {
                            return r(l).default
                        }
                    })
                }, {
                    "./BasePrepare": 183,
                    "./canvas/CanvasPrepare": 184,
                    "./limiters/CountLimiter": 186,
                    "./limiters/TimeLimiter": 187,
                    "./webgl/WebGLPrepare": 188
                }],
                186: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                        function e(t) {
                            r(this, e), this.maxItemsPerFrame = t, this.itemsLeft = 0
                        }
                        return e.prototype.beginFrame = function() {
                            this.itemsLeft = this.maxItemsPerFrame
                        }, e.prototype.allowedToUpload = function() {
                            return this.itemsLeft-- > 0
                        }, e
                    }();
                    i.default = n
                }, {}],
                187: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }
                    i.__esModule = !0;
                    var n = function() {
                        function e(t) {
                            r(this, e), this.maxMilliseconds = t, this.frameStart = 0
                        }
                        return e.prototype.beginFrame = function() {
                            this.frameStart = Date.now()
                        }, e.prototype.allowedToUpload = function() {
                            return Date.now() - this.frameStart < this.maxMilliseconds
                        }, e
                    }();
                    i.default = n
                }, {}],
                188: [function(e, t, i) {
                    "use strict";

                    function r(e, t) {
                        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
                    }

                    function n(e, t) {
                        if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                        return !t || "object" != typeof t && "function" != typeof t ? e : t
                    }

                    function o(e, t) {
                        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
                        e.prototype = Object.create(t && t.prototype, {
                            constructor: {
                                value: e,
                                enumerable: !1,
                                writable: !0,
                                configurable: !0
                            }
                        }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
                    }

                    function s(e, t) {
                        return t instanceof c.BaseTexture && (t._glTextures[e.CONTEXT_UID] || e.textureManager.updateTexture(t), !0)
                    }

                    function a(e, t) {
                        return t instanceof c.Graphics && ((t.dirty || t.clearDirty || !t._webGL[e.plugins.graphics.CONTEXT_UID]) && e.plugins.graphics.updateGraphics(t), !0)
                    }

                    function l(e, t) {
                        return e instanceof c.Graphics && (t.push(e), !0)
                    }
                    i.__esModule = !0;
                    var u = e("../../core"),
                        c = function(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }(u),
                        h = e("../BasePrepare"),
                        d = function(e) {
                            return e && e.__esModule ? e : {
                                default: e
                            }
                        }(h),
                        p = function(e) {
                            function t(i) {
                                r(this, t);
                                var o = n(this, e.call(this, i));
                                return o.uploadHookHelper = o.renderer, o.registerFindHook(l), o.registerUploadHook(s), o.registerUploadHook(a), o
                            }
                            return o(t, e), t
                        }(d.default);
                    i.default = p, c.WebGLRenderer.registerPlugin("prepare", p)
                }, {
                    "../../core": 65,
                    "../BasePrepare": 183
                }],
                189: [function(e, t, i) {
                    (function(t) {
                        "use strict";

                        function r(e) {
                            if (e && e.__esModule) return e;
                            var t = {};
                            if (null != e)
                                for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
                            return t.default = e, t
                        }
                        i.__esModule = !0, i.loader = i.prepare = i.particles = i.mesh = i.loaders = i.interaction = i.filters = i.extras = i.extract = i.accessibility = void 0;
                        var n = e("./polyfill");
                        Object.keys(n).forEach(function(e) {
                            "default" !== e && "__esModule" !== e && Object.defineProperty(i, e, {
                                enumerable: !0,
                                get: function() {
                                    return n[e]
                                }
                            })
                        });
                        var o = e("./core");
                        Object.keys(o).forEach(function(e) {
                            "default" !== e && "__esModule" !== e && Object.defineProperty(i, e, {
                                enumerable: !0,
                                get: function() {
                                    return o[e]
                                }
                            })
                        });
                        var s = e("./deprecation"),
                            a = function(e) {
                                return e && e.__esModule ? e : {
                                    default: e
                                }
                            }(s),
                            l = e("./accessibility"),
                            u = r(l),
                            c = e("./extract"),
                            h = r(c),
                            d = e("./extras"),
                            p = r(d),
                            f = e("./filters"),
                            _ = r(f),
                            m = e("./interaction"),
                            g = r(m),
                            v = e("./loaders"),
                            y = r(v),
                            b = e("./mesh"),
                            x = r(b),
                            T = e("./particles"),
                            E = r(T),
                            S = e("./prepare"),
                            P = r(S);
                        o.utils.mixins.performMixins();
                        var A = y.shared || null;
                        i.accessibility = u, i.extract = h, i.extras = p, i.filters = _, i.interaction = g, i.loaders = y, i.mesh = x, i.particles = E, i.prepare = P, i.loader = A, "function" == typeof a.default && (0, a.default)(i), t.PIXI = i
                    }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
                }, {
                    "./accessibility": 42,
                    "./core": 65,
                    "./deprecation": 131,
                    "./extract": 133,
                    "./extras": 141,
                    "./filters": 153,
                    "./interaction": 159,
                    "./loaders": 162,
                    "./mesh": 171,
                    "./particles": 174,
                    "./polyfill": 181,
                    "./prepare": 185
                }]
            }, {}, [189])(189)
        }), define("skbJet/component/utils/Interface", [], function() {
            function e(e, t) {
                if (this.functions = e || [], t)
                    for (var i = 0; i < t.functions.length; i++) this.functions.indexOf(t.functions[i]) < 0 && this.functions.push(t.functions[i])
            }

            function t() {
                throw "Not implemented yet."
            }
            return e.prototype.implementedBy = function(e) {
                for (var i = 0; i < this.functions.length; i++) e[this.functions[i]] || (e[this.functions[i]] = t)
            }, e.prototype.isImplementedBy = function(e) {
                for (var t = 0; t < this.functions.length; t++) {
                    var i = e[this.functions[t]];
                    if (!i || "function" != typeof i) return !1
                }
                return !0
            }, e
        }), define("skbJet/component/gladRenderer/IgladRenderer", ["skbJet/component/utils/Interface"], function(e) {
            return new e(["init", "showScene", "fitSize", "getSize", "setSize", "getTicker", "forceRender", "getSprite", "getAnimation"])
        }), define("skbJet/component/gladRenderer/gladUtil", [], function() {
            function e(e, t) {
                function i(e) {
                    var t = e._style;
                    if (t && (t._width && (t._width = Number(t._width) * r), t._height && (t._height = Number(t._height) * r), t._top && (t._top = Number(t._top) * r), t._left && (t._left = Number(t._left) * r), t._background && t._background._position && (t._background._position._x && (t._background._position._x = Number(t._background._position._x) * r), t._background._position._y && (t._background._position._y = Number(t._background._position._y) * r)), t._font && t._font._size && (t._font._size = Number(t._font._size) * r), t._text && t._text._lineHeight && (t._text._lineHeight = Number(t._text._lineHeight) * r), t._text && t._text._strokeWidth && (t._text._strokeWidth = Number(t._text._strokeWidth) * r)), e._SPRITES)
                        for (var n = 0; n < e._SPRITES.length; n++) i(e._SPRITES[n])
                }
                var r = t || 2;
                e._width && (e._width = Number(e._width) * r), e._height && (e._height = Number(e._height) * r);
                for (var n = 0; n < e._SCENES.length; n++) {
                    for (var o = 0; o < e._SCENES[n]._LAYERS.length; o++) i(e._SCENES[n]._LAYERS[o]);
                    for (var s = 0; s < e._SCENES[n]._ANIMATIONS.length; s++) {
                        var a = e._SCENES[n]._ANIMATIONS[s];
                        if ("_KEY_FRAME_ANIMATION" !== a._type) throw "Other animation type not support conver sprite pixel rate yet.";
                        for (var l = 0; l < a._keyFrames.length; l++)
                            for (var u = 0; u < a._keyFrames[l]._SPRITES.length; u++) i(a._keyFrames[l]._SPRITES[u])
                    }
                }
            }

            function t(e) {
                function t(e) {
                    if (e && e._style && e._style._text && e._style._text._token && (e._style._text._token = " "), e && e._SPRITES)
                        for (var i = 0; i < e._SPRITES.length; i++) t(e._SPRITES[i])
                }
                for (var i = 0; i < e._SCENES.length; i++)
                    for (var r = 0; r < e._SCENES[i]._LAYERS.length; r++) t(e._SCENES[i]._LAYERS[r])
            }

            function i(e, t) {
                if (e[t])
                    for (var i in e) t === i ? e[i].show(!0) : e[i].show(!1)
            }

            function r(e, t) {
                var i = e - t;
                return (i = i > 0 ? i : -i) <= 1
            }

            function n(e, t, i, n, s) {
                if (!(0 === i || 0 === n || 0 === e || 0 === t || r(e, o.w) && r(t, o.h))) {
                    o.w = e, o.h = t;
                    var a, l, u = n / i;
                    t / e > u ? (a = Math.round(e), l = Math.round(e * u), s.style.transform = "translate(0px," + (t - l) / 2 + "px)") : (l = Math.round(t), a = Math.round(t / u), s.style.transform = "translate(" + (e - a) / 2 + "px,0px)"), s.style.width = a + "px", s.style.height = l + "px"
                }
            }
            var o = {
                w: -1,
                h: -1
            };
            return {
                convertPixelRate: e,
                clearGladDataText: t,
                showScene: i,
                fitSize: n
            }
        }), define("skbJet/component/gladPixiRenderer/globalStore", [], function() {
            return {
                lib: {},
                animMap: {},
                gameConfigOption: {}
            }
        }), define("skbJet/component/utils/PauseTimer", [], function() {
            function e(t, i) {
                this.index = e.index++, e.map[this.index] = this, this.callBack = t, this.delay = i, this.startTime = Date.now(), this.pauseTime = null;
                var r = this;
                this._innerIndex = window.setTimeout(function() {
                    delete e.map[r.index], r.callBack()
                }, i)
            }

            function t(e, i) {
                this.index = t.index++, t.map[this.index] = this, this.callBack = e, this.delay = i, this.startTime = Date.now(), this.pauseTime = null, this._innerTimeoutIndex = null;
                var r = this;
                this._innerIndex = window.setInterval(r.callBack, i)
            }

            function i(t, i) {
                return new e(t, i).index
            }

            function r(t) {
                e.map[t] && e.map[t].clear()
            }

            function n(e, i) {
                return new t(e, i).index
            }

            function o(e) {
                t.map[e] && t.map[e].clear()
            }

            function s() {
                t.pause(), e.pause()
            }

            function a() {
                t.resume(), e.resume()
            }
            e.index = 1, e.map = {}, e.pause = function() {
                for (var t in e.map) e.map[t] && e.map[t].pause()
            }, e.resume = function() {
                for (var t in e.map) e.map[t] && e.map[t].resume()
            }, e.prototype.pause = function() {
                var e = this;
                e._innerIndex && (window.clearTimeout(e._innerIndex), e.pauseTime = Date.now() - e.startTime, e._innerIndex = null)
            }, e.prototype.resume = function() {
                var t = this;
                t._innerIndex || null === t.pauseTime || void 0 === t.pauseTime || (this._innerIndex = window.setTimeout(function() {
                    delete e.map[t.index], t.callBack()
                }, t.delay - t.pauseTime), t.startTime = Date.now() - t.pauseTime, this.pauseTime = null)
            }, e.prototype.clear = function() {
                var t = this;
                t._innerIndex && (window.clearTimeout(t._innerIndex), t._innerIndex = null), delete e.map[t.index]
            }, t.index = 1, t.map = {}, t.pause = function() {
                for (var e in t.map) t.map[e] && t.map[e].pause()
            }, t.resume = function() {
                for (var e in t.map) t.map[e] && t.map[e].resume()
            }, t.prototype.pause = function() {
                var e = this;
                e._innerIndex ? (window.clearInterval(e._innerIndex), e.pauseTime = (Date.now() - e.startTime) % e.delay, e._innerIndex = null, e._innerTimeoutIndex = null) : e._innerTimeoutIndex && (window.clearTimeout(e._innerTimeoutIndex), e.pauseTime = Date.now() - e.startTime, e._innerIndex = null, e._innerTimeoutIndex = null)
            }, t.prototype.resume = function() {
                var e = this;
                e._innerIndex || e._innerTimeoutIndex || null === e.pauseTime || void 0 === e.pauseTime || (e._innerTimeoutIndex = window.setTimeout(function() {
                    e._innerIndex = window.setInterval(e.callBack, e.delay), e._innerTimeoutIndex = null, e.callBack()
                }, e.delay - e.pauseTime), e.startTime = Date.now() - e.pauseTime, this.pauseTime = null)
            }, t.prototype.clear = function() {
                var e = this;
                e._innerIndex ? (window.clearInterval(e._innerIndex), e._innerIndex = null, e._innerTimeoutIndex = null) : e._innerTimeoutIndex && (window.clearTimeout(e._innerTimeoutIndex), e._innerIndex = null, e._innerTimeoutIndex = null), delete t.map[e.index]
            };
            var l = {
                setTimeout: i,
                clearTimeout: r,
                setInterval: n,
                clearInterval: o,
                pause: s,
                resume: a
            };
            return document.addEventListener("visibilitychange", function() {
                "hidden" === document.visibilityState ? l.pause() : l.resume()
            }), l
        }), define("skbJet/component/gladRenderer/view/IViewObject", ["skbJet/component/utils/Interface"], function(e) {
            return new e(["getChildren", "getParent", "getData", "show"])
        }), define("skbJet/component/gladRenderer/view/ISprite", ["skbJet/component/utils/Interface", "skbJet/component/gladRenderer/view/IViewObject"], function(e, t) {
            return new e(["getCurrentStyle", "draw", "addChildFromData", "getText", "setText", "getTextWidth", "setImage", "getImage", "on", "off", "getName", "getParent", "setTextAutoFit", "updateCurrentStyle", "toLocal", "toGlobal"], t)
        }), define("skbJet/component/gladRenderer/view/spriteUtil", [], function() {
            function e(e) {
                return e.match(/^_/) ? e.substring(1) : e
            }

            function t() {
                return {
                    _width: 0,
                    _height: 0,
                    _top: 0,
                    _left: 0,
                    _opacity: 1,
                    _background: {
                        _color: null,
                        _imagePlate: null,
                        _position: {
                            _x: 0,
                            _y: 0
                        }
                    },
                    _transform: {
                        _scale: {
                            _x: 1,
                            _y: 1
                        },
                        _rotate: 0
                    },
                    _text: {
                        _align: "center",
                        _color: "000000",
                        _token: "",
                        _lineHeight: 12,
                        _strokeWidth: 0,
                        _strokeColor: "",
                        _gradient: {
                            _color: ["000000", "000000"],
                            _stop: [0, 1],
                            _orientation: "vertical"
                        }
                    },
                    _font: {
                        _size: 12,
                        _weight: "normal"
                    },
                    _display: "block"
                }
            }

            function i(e, t) {
                if (!t) return e;
                if (null != t._width && "" !== t._width && (e._width = Number(t._width)), null != t._height && "" !== t._height && (e._height = Number(t._height)), null != t._left && "" !== t._left && (e._left = Number(t._left)), null != t._top && "" !== t._top && (e._top = Number(t._top)), null != t._opacity && ("string" == typeof t._opacity && "" === t._opacity || (e._opacity = Number(t._opacity))), t._background ? (t._background._color && (e._background._color = t._background._color), t._background._imagePlate && e._background._imagePlate !== t._background._imagePlate ? (e._background._imagePlate = t._background._imagePlate, e._background._imagePlateUpdateFlag = !0) : e._background._imagePlateUpdateFlag = !1, t._background._position && (null != t._background._position._x && "" !== t._background._position._x && (e._background._position._x = Number(t._background._position._x)), null != t._background._position._y && "" !== t._background._position._y && (e._background._position._y = Number(t._background._position._y)))) : e._background._imagePlateUpdateFlag = !1, t._transform) {
                    if (t._transform._scale) {
                        if (null != t._transform._scale._x && ("string" != typeof t._transform._scale._x || "" !== t._transform._scale._x)) {
                            var i = Number(t._transform._scale._x);
                            e._transform._scale._x = i
                        }
                        if (null != t._transform._scale._y && ("string" != typeof t._transform._scale._y || "" !== t._transform._scale._y)) {
                            var i = Number(t._transform._scale._y);
                            e._transform._scale._y = i
                        }
                    }
                    null != t._transform._rotate && "" !== t._transform._rotate && (e._transform._rotate = Number(t._transform._rotate))
                }
                return t._text && (t._text._align && (e._text._align = t._text._align), t._text._color && (e._text._color = t._text._color), null != t._text._token && (e._text._token = t._text._token), null != t._text._strokeWidth && (e._text._strokeWidth = t._text._strokeWidth), null != t._text._strokeColor && (e._text._strokeColor = t._text._strokeColor), t._text._gradient && (null != t._text._gradient._color && (e._text._gradient._color = t._text._gradient._color), null != t._text._gradient._stop && (e._text._gradient._stop = t._text._gradient._stop), null != t._text._gradient._orientation && (e._text._gradient._orientation = t._text._gradient._orientation)), null != t._text._lineHeight ? e._text._lineHeight = t._text._lineHeight : t._font && t._font._size && (e._text._gradient && (e._text._gradient._color.length > 2 || e._text._gradient._stop[0] !== e._text._gradient._stop[1]) ? e._text._lineHeight = 1.2 * t._font._size : e._text._lineHeight = t._font._size)), t._font && (t._font._size && (e._font._size = t._font._size), t._font._weight && (e._font._weight = t._font._weight), t._font._family && (e._font._family = t._font._family)), t._display && (e._display = t._display), t._overflow && (e._overflow = t._overflow), e
            }

            function r(e) {
                return !(null === e || void 0 === e || "" === e)
            }

            function n(e, t) {
                var r = e.getCurrentStyle();
                if (!r) throw "Sprite style not init yet.";
                i(r, t), e.draw()
            }

            function o(e, t) {
                var i = e.getCurrentStyle(),
                    r = i._width,
                    n = i._height,
                    o = i._top,
                    s = i._left,
                    a = i._transform._scale._x,
                    l = i._transform._scale._y,
                    u = i._transform._rotate * Math.PI / 180,
                    c = t.x,
                    h = t.y;
                c = c - s - r / 2, h = h - o - n / 2;
                var d = c * Math.cos(u) + h * Math.sin(u),
                    p = h * Math.cos(u) - c * Math.sin(u);
                return c = d / a, h = p / l, c += r / 2, h += n / 2, {
                    x: c,
                    y: h
                }
            }

            function s(e, t) {
                for (var i = [], r = t; e._currentStyle && (i.push(e), e.parent);) e = e.parent;
                for (var n = i.length - 1; n >= 0; n--) e = i[n], r = o(e, r);
                return r
            }

            function a(e, t) {
                var i = e.getCurrentStyle(),
                    r = i._width,
                    n = i._height,
                    o = i._top,
                    s = i._left,
                    a = i._transform._scale._x,
                    l = i._transform._scale._y,
                    u = i._transform._rotate * Math.PI / 180,
                    c = t.x,
                    h = t.y;
                c -= r / 2, h -= n / 2, c *= a, h *= l;
                var d = c * Math.cos(u) - h * Math.sin(u),
                    p = h * Math.cos(u) + c * Math.sin(u);
                return c = d + s + r / 2, h = p + o + n / 2, {
                    x: c,
                    y: h
                }
            }

            function l(e, t) {
                for (var i = t; e._currentStyle && i && (i = a(e, i), e.parent);) e = e.parent;
                return i
            }
            return {
                removeUnderLinePrefix: e,
                getDefaultStyle: t,
                updateStyle: i,
                updateCurrentStyle: n,
                isNotEmpty: r,
                toLocal: s,
                toGlobal: l
            }
        }), define("skbJet/component/gladPixiRenderer/Sprite", ["com/pixijs/pixi", "skbJet/component/gladRenderer/view/ISprite", "skbJet/component/gladRenderer/view/spriteUtil", "skbJet/component/gladPixiRenderer/globalStore"], function(e, t, i, r) {
            function n(e) {
                this.sprites = {}, this.data = e, r.lib[e._name] = this, this._currentStyle = a(), this.updateCurrentStyle(this.data._style);
                for (var t = 0; t < e._SPRITES.length; t++) this.addChildFromData(e._SPRITES[t])
            }

            function o() {
                var t = {};
                for (var i in e.utils.TextureCache) {
                    var r = i.match(/^(\w+)_\d+$/);
                    if (r) {
                        var n = r[1];
                        t[n] || (t[n] = []), t[n].push(i)
                    }
                }
                for (var o in t) t[o].sort(function(e, t) {
                    return parseInt(e.match(/\d+$/)[0]) - parseInt(t.match(/\d+$/)[0])
                });
                return t
            }
            var s = i.removeUnderLinePrefix,
                a = i.getDefaultStyle,
                l = i.updateStyle,
                u = i.isNotEmpty;
            t.implementedBy(n.prototype), n.prototype.getChildren = function() {
                return this.sprites
            }, n.prototype.getData = function() {
                return this.data
            }, n.prototype.getCurrentStyle = function() {
                return this._currentStyle
            }, n.prototype.draw = function() {
                var t = this;
                t.pixiContainer || (t.pixiContainer = new e.Container, t.pixiContainer.name = t.data._name);
                var i = t._currentStyle,
                    n = t.pixiContainer,
                    o = Number(i._width),
                    a = Number(i._height);
                if (n.pivot.x = o / 2, n.pivot.y = a / 2, n.x = Number(i._left) + n.pivot.x, n.y = Number(i._top) + n.pivot.y, u(i._background)) {
                    if (u(i._background._color)) {
                        var l = i._background._color + "";
                        if ("#" === l.charAt(0) && (l = l.substring(1)), l = l.toUpperCase(), n.$bgColor && n.$bgColor._color !== l) {
                            var c = n.$bgColor;
                            n.removeChild(c), c.destroy(), n.$bgColor = null
                        }
                        n.$bgColor || (n.$bgColor = new e.Graphics, n.addChild(n.$bgColor), n.$bgColor.width = o, n.$bgColor.height = a, n.$bgColor._color = l, n.$bgColor.beginFill(Number("0x" + l), 1), n.$bgColor.drawRect(0, 0, o, a), n.$bgColor.endFill()), n.$bgColor.width = o, n.$bgColor.height = a
                    }
                    if (n.$sprite || (n.$sprite = new e.Sprite, n.addChildAt(n.$sprite, 0)), n.$sprite.width = o, n.$sprite.height = a, u(i._background._imagePlate) && i._background._imagePlateUpdateFlag) {
                        var h = s(i._background._imagePlate);
                        n.$sprite.texture = e.Texture.fromFrame(h)
                    }
                }
                if (u(i._text) && u(i._text._token)) {
                    n.$text || (n.$text = new e.Text, n.addChild(n.$text));
                    var d = n.$text;
                    if (u(i._text._align) && (d.style.align = i._text._align), u(i._text._color) && (d.style.fill = "#" + i._text._color), u(i._text._strokeWidth) && (d.style.strokeThickness = i._text._strokeWidth, d.style.miterLimit = 2.6), u(i._text._strokeColor) && (d.style.stroke = "#" + i._text._strokeColor), 2 !== i._text._gradient._color.length || i._text._gradient._color[1] !== i._text._gradient._color[0]) {
                        for (var p = [], f = 0; f < i._text._gradient._color.length; f++) p[f] = "#" + i._text._gradient._color[f];
                        d.style.fill = p, d.style.fillGradientStops = i._text._gradient._stop, "horizontal" === i._text._gradient._orientation ? d.style.fillGradientType = e.TEXT_GRADIENT.LINEAR_HORIZONTAL : d.style.fillGradientType = e.TEXT_GRADIENT.LINEAR_VERTICAL
                    }
                    u(i._font) && (u(i._font._family) && (d.style.fontFamily = i._font._family.split(",")[0]), u(i._font._size) && (d.style.fontSize = i._font._size), u(i._font._weight) && (d.style.fontWeight = "" + i._font._weight)), u(i._text._lineHeight) && (d.style.lineHeight = Number(i._text._lineHeight)), u(i._width) && (d.style.wordWrapWidth = Number(i._width), d.style.wordWrap = !0), u(i._height) && (t.padding > 0 ? d.style.padding = t.padding : r.gameConfigOption.defaultPadding ? d.style.padding = r.gameConfigOption.defaultPadding : 0 === d.style.padding && (d.style.padding = 1)), d.text = i._text._token, u(i._font) && u(i._font._size) && t.autoFontFitText && (d.style.wordWrap = !1, d.scale.set(1), d.width > o && d.scale.set(o / d.width),
                        d.y = Math.floor(a * (1 - d.scale.y) / 2));
                    var _ = d.style.align;
                    d.x = "right" === _ ? o - d.width : "center" === _ ? n.x - d.width / 2 - Number(i._left) : 0
                } else n.$text && (n.$text.text = "");
                u(i._transform) && u(i._transform._scale) && (u(i._transform._scale._x) && (n.scale.x = Number(i._transform._scale._x)), u(i._transform._scale._y) && (n.scale.y = Number(i._transform._scale._y))), u(i._transform) && u(i._transform._rotate) && (n.rotation = Number(i._transform._rotate) * Math.PI / 180), u(i._opacity) && (n.alpha = Number(i._opacity))
            }, n.prototype.updateCurrentStyle = function(e) {
                i.updateCurrentStyle(this, e)
            }, n.prototype.addChildFromData = function(e) {
                var t = new n(e);
                return this.sprites[e._name] = t, t.parent = this, this.pixiContainer.addChild(t.pixiContainer), t
            }, n.prototype.setText = function(e) {
                this.updateCurrentStyle({
                    _text: {
                        _token: e
                    }
                })
            }, n.prototype.getText = function() {
                return this.pixiContainer.$text.text
            }, n.prototype.getTextWidth = function() {
                return this.pixiContainer.$text.width
            }, n.prototype.setImage = function(t) {
                e.utils.TextureCache[t] && (l(this._currentStyle, {
                    _background: {
                        _imagePlate: t
                    }
                }), this.pixiContainer.$sprite.texture = e.Texture.fromFrame(t))
            }, n.prototype.getImage = function() {
                return this._currentStyle && this._currentStyle._background ? this._currentStyle._background._imagePlate : null
            }, n.prototype.on = function(e, t) {
                if (this.pixiContainer.interactive = !0, "click" === e) this.pixiContainer.on("touchstart", t), this.pixiContainer.on("click", t);
                else if ("mouseover" === e) this.pixiContainer.on(e, t);
                else if ("mouseout" === e) this.pixiContainer.on("mouseout", t), "ontouchend" in window && this.pixiContainer.on("touchendoutside", t);
                else if ("mousedown" === e) "ontouchstart" in window ? this.pixiContainer.on("touchstart", t) : this.pixiContainer.on("mousedown", t);
                else if ("mouseup" === e) this.pixiContainer.on("mouseup", t), "ontouchend" in window && this.pixiContainer.on("touchend", t);
                else if ("mouseupoutside" === e) "ontouchend" in window ? this.pixiContainer.on("touchendoutside", t) : this.pixiContainer.on("mouseupoutside", t);
                else {
                    if ("mousemove" !== e) throw "Not supported event!";
                    "ontouchmove" in window ? this.pixiContainer.on("touchmove", t) : this.pixiContainer.on("mousemove", t)
                }
            }, n.prototype.off = function(e, t) {
                if ("click" === e) this.pixiContainer.off("touchstart", t), this.pixiContainer.off("click", t);
                else if ("mouseover" === e) this.pixiContainer.off("mouseover", t);
                else if ("mouseout" === e) this.pixiContainer.off("mouseout", t), "ontouchend" in window && this.pixiContainer.off("touchendoutside", t);
                else if ("mousedown" === e) "ontouchstart" in window ? this.pixiContainer.off("touchstart", t) : this.pixiContainer.off("mousedown", t);
                else if ("mouseup" === e) this.pixiContainer.off("mouseup", t), "ontouchend" in window && this.pixiContainer.off("touchend", t);
                else if ("mouseupoutside" === e) "ontouchend" in window ? this.pixiContainer.off("touchendoutside", t) : this.pixiContainer.off("mouseupoutside", t);
                else {
                    if ("mousemove" !== e) throw "Not supported event!";
                    "ontouchmove" in window ? this.pixiContainer.off("touchmove", t) : this.pixiContainer.off("mousemove", t)
                }
            }, n.prototype.toLocal = function(e) {
                return i.toLocal(this, e)
            }, n.prototype.toGlobal = function(e) {
                return i.toGlobal(this, e)
            }, n.prototype.getName = function() {
                return this.data._name
            }, n.prototype.getParent = function() {
                return this.parent
            }, n.prototype.show = function(e) {
                this.pixiContainer.visible = !!e
            };
            var c = null;
            return n.addSpriteSheetAnimation = function(e, t) {
                c || (c = o()), c[e] = t
            }, n.getSpriteSheetAnimationFrameArray = function(e) {
                return c || (c = o()), c[e]
            }, n.prototype.gotoAndPlay = function(t, i, r, n) {
                if (c || (c = o()), !c[t]) throw "Cannot find sprite animation " + t;
                this.pixiContainer.$sprite ? this.pixiContainer.$sprite.animName !== t && (this.pixiContainer.removeChild(this.pixiContainer.$sprite).destroy(), this.pixiContainer.$sprite = e.extras.AnimatedSprite.fromFrames(c[t]), this.pixiContainer.addChildAt(this.pixiContainer.$sprite, this.data._style._background && this.data._style._background._color ? 1 : 0), this.pixiContainer.$sprite.width = Number(this._currentStyle._width), this.pixiContainer.$sprite.height = Number(this._currentStyle._height)) : (this.pixiContainer.$sprite = e.extras.AnimatedSprite.fromFrames(c[t]), this.pixiContainer.addChildAt(this.pixiContainer.$sprite, this.data._style._background._color ? 1 : 0)), this.pixiContainer.$sprite.animName = t, this.pixiContainer.$sprite.animationSpeed = i || 1, this.pixiContainer.$sprite.loop = !!r;
                var s = this;
                this.pixiContainer.$sprite.onComplete = function() {
                    "function" == typeof s.onComplete && s.onComplete()
                }, (!n || n < 0) && (n = 0), this.pixiContainer.$sprite.gotoAndPlay(n)
            }, n.prototype.stopPlay = function() {
                this.pixiContainer.$sprite && this.pixiContainer.$sprite.stop && this.pixiContainer.$sprite.stop()
            }, n.prototype.gotoAndStop = function(e) {
                this.pixiContainer.$sprite && this.pixiContainer.$sprite.gotoAndStop && this.pixiContainer.$sprite.gotoAndStop(e)
            }, n.prototype.onComplete = null, n.prototype.autoFontFitText = !1, n.prototype.setTextAutoFit = function(e) {
                this.autoFontFitText = e
            }, n
        }), define("skbJet/component/gladPixiRenderer/Layer", ["com/pixijs/pixi", "skbJet/component/gladPixiRenderer/Sprite", "skbJet/component/gladRenderer/view/IViewObject", "skbJet/component/gladPixiRenderer/globalStore"], function(e, t, i, r) {
            function n(i) {
                this.sprites = {}, this.data = i, r.lib[i._name] = this, this.pixiContainer = new e.Container, this.pixiContainer.name = i._name;
                for (var n = 0; n < i._SPRITES.length; n++) {
                    var o = i._SPRITES[n];
                    this.sprites[o._name] = new t(o), this.sprites[o._name].parent = this, this.pixiContainer.addChild(this.sprites[o._name].pixiContainer)
                }
            }
            return i.implementedBy(n.prototype), n.prototype.getChildren = function() {
                return this.sprites
            }, n.prototype.getParent = function() {
                return null
            }, n.prototype.getData = function() {
                return this.data
            }, n.prototype.show = function(e) {
                this.pixiContainer.visible = !!e
            }, n
        }), define("skbJet/component/gladRenderer/animation/IAnimation", ["skbJet/component/utils/Interface"], function(e) {
            return new e(["isPlaying", "onTick"])
        }), define("skbJet/component/gladRenderer/animation/KeyFrameAnimation", ["skbJet/component/gladRenderer/animation/IAnimation"], function(e) {
            function t() {}

            function i(e, t, i, r, n, o) {
                if (e.animData = t, o || (o = e.animData._name), t._keyFrames && t._keyFrames.length > 0) {
                    var s = t._keyFrames[t._keyFrames.length - 1];
                    e.maxTime = Number(s._time), e._spritesNameList = [];
                    for (var a = 0; a < s._SPRITES.length; a++) e._spritesNameList.push(s._SPRITES[a]._name);
                    if (n)
                        for (var a = 0; a < n.length && a < s._SPRITES.length; a++) e._spritesNameList[a] = n[a]
                }
                e._name = o, e._gladObjLib = r, e._gladAnimMap = i, i[o] = e
            }

            function r(e) {
                e.pause(), e.timeCount = 0, e.loopCount = 0, e.loopNumber = 1, e._frameIndex = 0
            }

            function n(e, t, i) {
                var r = Number(e);
                return (Number(t) - r) * i + r
            }

            function o(e, t, i) {
                if (t = Number(t), e.animData._keyFrames.length <= 1 || t <= 0) return 0;
                i || (i = 0);
                for (var r = i; r < e.animData._keyFrames.length; r++)
                    if (t <= Number(e.animData._keyFrames[r]._time) && t > Number(e.animData._keyFrames[r - 1]._time)) return r;
                return e.animData._keyFrames.length
            }

            function s(e) {
                return !(null === e || void 0 === e || "" === e)
            }

            function a(e, t, i, r) {
                if (i._style) {
                    var o = e._style,
                        a = t._style,
                        l = i._style;
                    s(l._width) && (a._width = n(o._width, l._width, r)), s(l._height) && (a._height = n(o._height, l._height, r)), s(l._top) && (a._top = n(o._top, l._top, r)), s(l._left) && (a._left = n(o._left, l._left, r)), s(l._opacity) && (a._opacity = n(o._opacity, l._opacity, r)), s(l._background) && (a._background = {}, s(l._background._position) && (a._background._position = {}, s(l._background._position._x) && (a._background._position._x = n(o._background._position._x, l._background._position._x, r)), s(l._background._position._y) && (a._background._position._y = n(o._background._position._y, l._background._position._y, r)))), s(l._transform) && (a._transform = {}, s(l._transform._rotate) && (a._transform._rotate = n(o._transform._rotate, l._transform._rotate, r)), s(l._transform._scale) && (a._transform._scale = {}, s(l._transform._scale._x) && (a._transform._scale._x = n(o._transform._scale._x, l._transform._scale._x, r)), s(l._transform._scale._y) && (a._transform._scale._y = n(o._transform._scale._y, l._transform._scale._y, r))), s(l._transform._skew) && (a._transform._skew = {}, s(l._transform._skew._x) && (a._transform._skew._x = n(o._transform._skew._x, l._transform._skew._x, r)), s(l._transform._skew._y) && (a._transform._skew._y = n(o._transform._skew._y, l._transform._skew._y, r))))
                }
            }
            return e.implementedBy(t.prototype), t.prototype._isPlaying = !1, t.prototype.animData = null, t.prototype.maxTime = 0, t.prototype.timeCount = 0, t.prototype.loopCount = 0, t.prototype.loopNumber = 1, t.prototype._frameIndex = 0, t.prototype._onStart = null, t.prototype._onEnd = null, t.prototype._onComplete = null, t.prototype._onLoop = null, t.prototype._onFrame = null, t.prototype._onResume = null, t.prototype._gladObjLib = null, t.prototype._gladAnimMap = null, t.prototype.isPlaying = function() {
                return this._isPlaying
            }, t.prototype.init = function(e, t, r) {
                i(this, e, t, r)
            }, t.prototype.onTick = function(e) {
                if (this._isPlaying) {
                    if (0 === this.timeCount && 0 === this.loopCount && this._onStart ? this._onStart() : (this.timeCount > 0 || this.loopCount > 0) && this._onResume && this._onResume(), this.timeCount += e, this.timeCount >= this.maxTime) {
                        if (++this.loopCount >= this.loopNumber) return this.updateStyleToTime(this.maxTime), r(this), void(this._onComplete && this._onComplete());
                        this.timeCount = 0, this._frameIndex = 0, this._onLoop && this._onLoop()
                    }
                    this.updateStyleToTime(this.timeCount)
                }
            }, t.prototype.updateStyleToTime = function(e) {
                if (!(e < 0 || e > this.maxTime)) {
                    var t = this.getFrameAtTime(e);
                    if (t._SPRITES)
                        for (var i = 0; i < this._spritesNameList.length; i++) {
                            var r = this._gladObjLib[this._spritesNameList[i]];
                            r.updateCurrentStyle(t._SPRITES[i]._style)
                        }
                }
            }, t.prototype.play = function(e) {
                this.maxTime <= 0 || !0 !== this._isPlaying && ("number" == typeof e && (e = {
                    loopNumber: e
                }), e || (e = {}), e.loopNumber ? this.loopNumber = e.loopNumber : this.loopNumber = 1, e.startTime ? this.timeCount = e.startTime : this.timeCount = 0, this._isPlaying = !0)
            }, t.prototype.stop = function() {
                this._isPlaying && (r(this), this._onEnd && this._onEnd())
            }, t.prototype.pause = function() {
                this._isPlaying = !1
            }, t.prototype.clone = function(e, r) {
                var n = new t;
                return i(n, this.animData, this._gladAnimMap, this._gladObjLib, e, r), n
            }, t.prototype.getFrameAtTime = function(e) {
                var t = this;
                if (e = Number(e), 1 === t.animData._keyFrames.length) return e === Number(t.animData._keyFrames[0]._time) ? t.animData._keyFrames[0] : null;
                t._frameIndex = o(t, e, t._frameIndex);
                var i = t.animData._keyFrames[t._frameIndex];
                if (null == i) return null;
                if (i && i._time === e) return i;
                var r = t.animData._keyFrames[t._frameIndex - 1],
                    n = {
                        _time: e,
                        _SPRITES: []
                    },
                    s = n._time;
                t.animData._step && (s = t.animData._step * Math.floor(n._time / t.animData._step));
                for (var l = (s - r._time) / (i._time - r._time), u = 0; u < i._SPRITES.length; u++) {
                    var c = i._SPRITES[u],
                        h = r._SPRITES[u];
                    if (h._id !== c._id) throw "Error: sprite list dismatch in animation frames";
                    var d = {
                        _id: c._id,
                        _name: c._name,
                        _style: {}
                    };
                    a(h, d, c, l), n._SPRITES.push(d)
                }
                return n
            }, t
        }), define("skbJet/component/gladPixiRenderer/KeyFrameAnimation", ["skbJet/component/gladRenderer/animation/KeyFrameAnimation", "skbJet/component/gladPixiRenderer/globalStore"], function(e, t) {
            function i(e) {
                this.init(e, t.animMap, t.lib), this.updateStyleIfPlaying = this.onTick
            }
            return i.prototype = new e, i
        }), define("skbJet/component/gladPixiRenderer/Scene", ["com/pixijs/pixi", "skbJet/component/gladPixiRenderer/Layer", "skbJet/component/gladPixiRenderer/KeyFrameAnimation", "skbJet/component/gladRenderer/view/IViewObject", "skbJet/component/gladRenderer/view/spriteUtil", "skbJet/component/gladPixiRenderer/globalStore"], function(e, t, i, r, n, o) {
            function s(r) {
                this.layers = {}, this.data = r, o.lib[r._name] = this, this.pixiContainer = new e.Container, this.pixiContainer.name = r._name;
                for (var n = 0; n < r._LAYERS.length; n++) {
                    var s = r._LAYERS[n];
                    this.layers[s._name] = new t(s), this.layers[s._name].parent = this, this.pixiContainer.addChild(this.layers[s._name].pixiContainer)
                }
                this._animations = [], this.show = function(e) {
                    this.pixiContainer.visible = e
                };
                for (var n = 0; n < r._ANIMATIONS.length; n++) {
                    "_KEY_FRAME_ANIMATION" === r._ANIMATIONS[n]._type && new i(r._ANIMATIONS[n])
                }
            }
            var a;
            r.implementedBy(s.prototype), s.prototype.getChildren = function() {
                return this.layers
            }, s.prototype.getParent = function() {
                return null
            }, s.prototype.getData = function() {
                return this.data
            };
            var l = n.isNotEmpty;
            return s.prototype.updateCurrentStyle = function(e) {
                var t = this.pixiContainer,
                    i = e,
                    r = Number(i._width),
                    n = Number(i._height);
                r || (a || (a = require("skbJet/component/gladPixiRenderer/gladPixiRenderer")), r = a.getSize().width), n || (a || (a = require("skbJet/component/gladPixiRenderer/gladPixiRenderer")), n = a.getSize().height), t.pivot.x = r / 2, t.pivot.y = n / 2, t.x = Number(i._left) + t.pivot.x, t.y = Number(i._top) + t.pivot.y, l(i._transform) && l(i._transform._scale) && (l(i._transform._scale._x) && (t.scale.x = Number(i._transform._scale._x)), l(i._transform._scale._y) && (t.scale.y = Number(i._transform._scale._y))), l(i._transform) && l(i._transform._rotate) && (t.rotation = Number(i._transform._rotate) * Math.PI / 180), l(i._opacity) && (t.alpha = Number(i._opacity))
            }, s
        }), define("skbJet/component/gladPixiRenderer/gladPixiRenderer", ["com/pixijs/pixi", "skbJet/component/gladRenderer/IgladRenderer", "skbJet/component/gladRenderer/gladUtil", "skbJet/component/gladPixiRenderer/globalStore", "skbJet/component/utils/PauseTimer", "skbJet/component/gladPixiRenderer/Scene"], function(e, t, i, r, n, o) {
            function s(e, t) {
                e === b.width && t === b.height || (b.width = e, b.height = t, h.resize(b.width, b.height), c(x.width, x.height))
            }

            function a(t, r, n) {
                d = t, d || (d = window._gladData), i.convertPixelRate(d, 2), i.clearGladDataText(d), r || (r = document.getElementById("game")), _ = r, !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform) && !window.MSStream && (e.settings.PRECISION_FRAGMENT = e.PRECISION.HIGH), h = "webgl" === n ? new e.WebGLRenderer(d._width, d._height, {
                    transparent: !0,
                    resolution: 1,
                    antialias: !0
                }) : "2d" === n ? new e.CanvasRenderer(d._width, d._height, {
                    transparent: !0,
                    resolution: 1,
                    antialias: !0
                }) : e.autoDetectRenderer(d._width, d._height, {
                    transparent: !0,
                    resolution: 1,
                    antialias: !0
                }), _.appendChild(h.view), x.width = d._width, x.height = d._height, s(d._width, d._height), f = new e.Container;
                for (var a = 0; a < d._SCENES.length; a++) {
                    var u = d._SCENES[a];
                    g[u._name] = new o(u), f.addChild(g[u._name].pixiContainer)
                }
                p = new e.ticker.Ticker, p.add(function() {
                    for (var e in v) v[e].updateStyleIfPlaying ? v[e].updateStyleIfPlaying(p.elapsedMS) : v[e].onTick(p.elapsedMS);
                    h.render(f)
                }), p.start(), document.addEventListener("visibilitychange", function() {
                    "hidden" === document.visibilityState ? p.stop() : p.start()
                }), l(r)
            }

            function l(e) {
                var t, i = !!window.PointerEvent;
                t = i ? "pointerdown" : "mousedown", e.addEventListener(t, function(e) {
                    e && 1 === e.button && e.stopPropagation()
                }, !0)
            }

            function u(e) {
                i.showScene(g, e)
            }

            function c(e, t) {
                var r = Number(h.view.width),
                    n = Number(h.view.height);
                x.width = e, x.height = t, i.fitSize(e, t, r, n, h.view)
            }
            var h, d, p, f, _, m = r.lib,
                g = {},
                v = r.animMap,
                y = r.gameConfigOption,
                b = {
                    width: 0,
                    height: 0
                },
                x = {
                    width: 0,
                    height: 0
                },
                T = {
                    init: a,
                    lib: m,
                    fitSize: c,
                    showScene: u,
                    animMap: v,
                    gameConfigOption: y,
                    setSize: s,
                    getSize: function() {
                        return {
                            width: b.width,
                            height: b.height
                        }
                    },
                    getPixiRenderer: function() {
                        return h
                    },
                    getTicker: function() {
                        return p
                    },
                    getTimer: function() {
                        return n
                    },
                    forceRender: function() {
                        h.render(f)
                    },
                    getSprite: function(e) {
                        return m[e]
                    },
                    getAnimation: function(e) {
                        return v[e]
                    }
                };
            return t.implementedBy(T), T
        }), define("skbJet/component/resourceLoader/resourceLib", [], function() {
            return {}
        }), define("skbJet/component/resourceLoader/Util", [], function() {
            var e = {};
            return e.httpGetJson = function(t, i, r) {
                e.httpGetText(t, function(e) {
                    i(JSON.parse(e))
                }, r)
            }, e.httpGetText = function(e, t, i) {
                var r = new XMLHttpRequest;
                r.addEventListener("load", function(e) {
                    e.target.status >= 200 && e.target.status < 300 ? t(e.target.responseText) : i()
                }), r.addEventListener("error", i), r.addEventListener("timeout", i), r.open("GET", e), r.send()
            }, e.removeQueryStr = function(e) {
                var t = e.match(/(.*)\?/);
                return t ? t[1] : e
            }, e.getFileNameFromPath = function(e) {
                var t = e.match(/\/?([^\/]+)$/);
                return t ? t[1] : e
            }, e.getFileExt = function(t, i) {
                t = e.removeQueryStr(t), t = e.getFileNameFromPath(t);
                var r = t.match(/\.(\w+)$/);
                return r && r[1] ? i ? r[1].toLowerCase() : r[1] : null
            }, e.getFileNameWithoutExt = function(t) {
                t = e.removeQueryStr(t), t = e.getFileNameFromPath(t);
                var i = t.match(/(.*)(\.\w+)+$/);
                return i ? i[1] : t
            }, e.getParentFolder = function(t) {
                t = e.removeQueryStr(t);
                var i = e.getFileNameFromPath(t);
                return t.substring(0, t.length - i.length)
            }, e
        }), define("skbJet/component/resourceLoader/LoaderContext", [], function() {
            function e(e, t, i) {
                this.assetPackUrl = e, this.languageCode = t, this.skinCode = i, this.totalResAmount = 0, this.currentLoaded = 0, this.gameFolder = null, this.i18nParent = null, this.queryStr = "", window._cacheFlag && window._cacheFlag.queryStr && (this.queryStr = window._cacheFlag.queryStr), this.fileListMap = {
                    i18n: null
                }, this.subLoaderMap = {}, this.onFileLoaded = function() {}, this.onLoadFailed = function() {}
            }
            return e
        }), define("skbJet/component/resourceLoader/LoaderChainHandler", [], function() {
            function e() {}
            return e.prototype.next = null, e.prototype.handle = null, e
        }), define("skbJet/component/resourceLoader/handlers/languageListHandler", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/LoaderChainHandler"], function(e, t) {
            function i(e, t) {
                for (var i = {}, r = 0; r < e.length; r++) i[e[r]] = [e[r].toLowerCase()], e[r].indexOf("_") > -1 ? i[e[r]].push(e[r].replace("_", "-").toLowerCase()) : e[r].indexOf("-") > -1 && i[e[r]].push(e[r].replace("-", "_").toLowerCase());
                var n;
                for (var o in i)
                    if (i[o].indexOf("i18n/" + t.languageCode.toLowerCase() + ".json") >= 0) {
                        n = o.substring(o.lastIndexOf("/") + 1, o.lastIndexOf("."));
                        break
                    }
                if (!n)
                    for (var o in i)
                        if (i[o].indexOf("i18n/default.json") >= 0) {
                            n = o.substring(o.lastIndexOf("/") + 1, o.lastIndexOf("."));
                            break
                        }
                if (!n)
                    for (var o in i)
                        if (i[o].indexOf("i18n/en.json") >= 0) {
                            n = o.substring(o.lastIndexOf("/") + 1, o.lastIndexOf("."));
                            break
                        }
                return !!n && (t.languageCode = n, !0)
            }

            function r(t) {
                var i = t.gameFolder,
                    r = !1;
                if (window.location.search.match(/&?custom=true&?/) && (r = !0), window.gtk && window.gtk.jLottery && window.gtk.jLottery.embeddedParams && window.gtk.jLottery.embeddedParams.custom && (r = !0), r) {
                    var n, o = window.location.pathname;
                    o.match(/\/splash\.html$/) || o.match(/\/launcher\.html$/) ? (n = e.getParentFolder(o), n = n.match(/\/([^\/]+\/)$/)[1]) : n = t.gameFolder.match(/\/([^\/]+\/)$/)[1], i = "/custom_lang/" + t.skinCode + "/" + n
                }
                return i
            }
            var n = new t;
            return n.handle = function(t) {
                t.languageCode = t.languageCode || "default", t.languageCode = t.languageCode.toLowerCase();
                var o = t.assetPackUrl.substring(0, t.assetPackUrl.lastIndexOf("/"));
                t.gameFolder = o.substring(0, o.lastIndexOf("/") + 1), t.i18nParent = r(t), e.httpGetJson(t.i18nParent + "i18n.json" + t.queryStr, function(e) {
                    i(e.i18n, t) ? n.next.handle(t) : t.onLoadFailed()
                }, t.onLoadFailed)
            }, n
        }), define("skbJet/component/resourceLoader/handlers/skinListHandler", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/LoaderChainHandler"], function(e, t) {
            function i(e, t) {
                for (var i = 0; i < e.length; i++) {
                    var r = e[i];
                    if (r = r.substring(r.lastIndexOf("/") + 1, r.lastIndexOf(".")), t.skinCode.toLowerCase() === r.toLowerCase()) return
                }
                t.skinCode = "default"
            }
            var r = new t;
            return r.handle = function(t) {
                t.skinCode = t.skinCode || "default";
                var n = t.i18nParent + "i18n/" + t.languageCode + ".json" + t.queryStr;
                e.httpGetJson(n, function(e) {
                    i(e[t.languageCode], t), r.next.handle(t)
                }, t.onLoadFailed)
            }, r
        }), define("skbJet/component/resourceLoader/handlers/fileListHandler", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/LoaderChainHandler"], function(e, t) {
            function i(e, t, i, r) {
                r.fileListMap[e] || (r.fileListMap[e] = {});
                for (var n = 0; n < t.length; n++) r.fileListMap[e][t[n]] = i
            }

            function r(t, r) {
                var o = t.assetPackUrl + ".json" + t.queryStr;
                e.httpGetJson(o, function(e) {
                    for (var o in e) i(o, e[o], t.gameFolder + "assetPacks/", t);
                    var a = t.assetPackUrl.substring(t.assetPackUrl.lastIndexOf("assetPacks"));
                    r && r.indexOf(t.skinCode + "/" + a + ".json") > -1 ? n(t, a) : s.next.handle(t)
                }, t.onLoadFailed)
            }

            function n(t, r) {
                var n = t.i18nParent + "i18n/" + t.languageCode + "/" + t.skinCode + "/",
                    o = n + r + ".json" + t.queryStr;
                e.httpGetJson(o, function(e) {
                    for (var r in e) i(r, e[r], n + "assetPacks/", t);
                    s.next.handle(t)
                }, t.onLoadFailed)
            }

            function o(t) {
                var n = t.i18nParent + "i18n/",
                    o = n + t.languageCode + "/",
                    s = o + t.skinCode + ".json" + t.queryStr;
                e.httpGetJson(s, function(e) {
                    i("i18n", e[t.skinCode], o, t), r(t, e.assetPacks)
                }, t.onLoadFailed)
            }
            var s = new t;
            return s.handle = o, s
        }), define("skbJet/component/resourceLoader/handlers/fileLoadHandler", ["skbJet/component/resourceLoader/LoaderChainHandler"], function(e) {
            function t(e, t, i) {
                setTimeout(function() {
                    e.load(t, i)
                }, 1)
            }
            var i = new e;
            return i.handle = function(e) {
                for (var i in e.fileListMap) e.subLoaderMap[i] && t(e.subLoaderMap[i], e.fileListMap[i], {
                    onFileLoaded: e.onFileLoaded,
                    onLoadFailed: e.onLoadFailed,
                    queryStr: e.queryStr
                })
            }, i.addSubLoader = function(e, t, i) {
                e.subLoaderMap[t] = i
            }, i.summary = function(e) {
                var t = 0,
                    i = 0,
                    r = !0;
                for (var n in e.fileListMap) e.subLoaderMap[n] && (t += e.subLoaderMap[n].getTotal(), i += e.subLoaderMap[n].getCurrent(), r = r && e.subLoaderMap[n].isComplete());
                return {
                    total: t,
                    current: i,
                    complete: r
                }
            }, i
        }), define("skbJet/component/resourceLoader/ResourceLoader", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/LoaderContext", "skbJet/component/resourceLoader/handlers/languageListHandler", "skbJet/component/resourceLoader/handlers/skinListHandler", "skbJet/component/resourceLoader/handlers/fileListHandler", "skbJet/component/resourceLoader/handlers/fileLoadHandler"], function(e, t, i, r, n, o) {
            function s(e, s, a) {
                this.context = new t(e, s, a), this.loadChain = [i, r, n, o]
            }
            var a;
            return s.prototype.load = function(e, t) {
                for (var i = 0; i < this.loadChain.length - 1; i++) this.loadChain[i].next = this.loadChain[i + 1];
                this.context.onFileLoaded = e, this.context.onLoadFailed = t, this.loadChain[0].handle(this.context)
            }, s.prototype.addSubLoader = function(e, t) {
                o.addSubLoader(this.context, e, t)
            }, s.prototype.currentProgress = function() {
                return o.summary(this.context)
            }, s.initDefault = function(e, t, i) {
                if (a) throw "Default loader already inited.";
                a = new s(e, t, i)
            }, s.getDefault = function() {
                return a
            }, s.setDefault = function(e) {
                a = e
            }, s.prototype.addHeartBeat = function(e, t) {
                function i() {
                    var t = r.currentProgress();
                    if (t.complete) return clearInterval(r.heartBeatInterval), void(r.heartBeatInterval = null);
                    e(t)
                }
                var r = this;
                r.heartBeatInterval && (clearInterval(r.heartBeatInterval), r.heartBeatInterval = null), t || (t = 5e3), r.heartBeatInterval = setInterval(i, t)
            }, s.prototype.removeHeartBeat = function() {
                var e = this;
                if (e.heartBeatInterval) return clearInterval(e.heartBeatInterval), void(e.heartBeatInterval = null)
            }, s
        }), define("skbJet/component/resourceLoader/AbstractSubLoader", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/resourceLib"], function(e, t) {
            function i() {}

            function r() {}
            return r.prototype._initOptions = function(e, i) {
                this._count = {
                    total: 0,
                    current: 0,
                    complete: !1
                }, this.options = i || {}, this.options.type = this.options.type || e, t[this.options.type] || (t[this.options.type] = {})
            }, r.prototype.getTotal = function() {
                return this._count.total
            }, r.prototype.getCurrent = function() {
                return this._count.current
            }, r.prototype.isComplete = function() {
                return this._count.complete
            }, r.prototype._prepareLoad = function(e) {
                e = e || {}, this._count.total = 0, this._count.current = 0, e.queryStr = e.queryStr ? e.queryStr : "", e.onFileLoaded = e.onFileLoaded ? e.onFileLoaded : i, e.onLoadFailed = e.onLoadFailed ? e.onLoadFailed : i;
                for (var t in e) this.options[t] = e[t]
            }, r.prototype.load = function(i, r) {
                this._prepareLoad(r);
                var n = [];
                for (var o in i)
                    if (i[o]) {
                        if (this.options.fileExtFilterList) {
                            var s = e.getFileExt(o, !0);
                            if (this.options.fileExtFilterList.indexOf(s) < 0) continue
                        }
                        this._count.total++, n.push(o)
                    }
                if (0 === this._count.total) return this._count.complete = !0, void this.options.onFileLoaded();
                for (var a = this, l = 0; l < n.length; l++) {
                    var o = n[l];
                    this._doLoadFile(i[o] + o + this.options.queryStr, function(e) {
                        return function(i) {
                            a._count.current++, a._count.current === a._count.total && (a._count.complete = !0), t[a.options.type] = t[a.options.type] || {}, t[a.options.type][e] = i, a.options.onFileLoaded()
                        }
                    }(e.getFileNameWithoutExt(o)), this.options.onLoadFailed)
                }
            }, r.prototype._doLoadFile = function(e, t, i) {
                throw "Not implemented yet. Params: url:" + e + "   success:" + t + "   fail:" + i
            }, r
        }), define("skbJet/component/resourceLoader/subLoaders/TextFilesSubLoader", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/AbstractSubLoader"], function(e, t) {
            function i(e) {
                this._initOptions("_text_files", e)
            }
            return i.prototype = new t, i.prototype._doLoadFile = function(t, i, r) {
                "json" === e.getFileExt(t, !0) && this.options.parseJson ? e.httpGetJson(t, i, r) : e.httpGetText(t, i, r)
            }, i
        }), define("skbJet/component/resourceLoader/subLoaders/HtmlTagSubLoader", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/AbstractSubLoader"], function(e, t) {
            function i(e) {
                this._initOptions("_html_tags", e)
            }
            return i.prototype = new t, i.prototype._doLoadFile = function(e, t, i) {
                var r = document.createElement(this.options.tagName);
                if (r.onload = function() {
                        t(r)
                    }, r.onerror = i, this.options.parentTag && this.options.parentTag.appendChild(r), this.options.tagAttributes)
                    for (var n in this.options.tagAttributes) r.setAttribute(n, this.options.tagAttributes[n]);
                r.src = e
            }, i
        }), define("skbJet/component/pixiResourceLoader/PixiSpriteSubLoader", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/AbstractSubLoader", "com/pixijs/pixi"], function(e, t, i) {
            function r(e) {
                e = e || {}, e.fileExtFilterList = ["json"], this._initOptions("sprites", e)
            }
            return r.prototype = new t, r.prototype._load = r.prototype.load, r.prototype.load = function(t, r) {
                this.loader = new i.loaders.Loader, this.loader.defaultQueryString = "?" === r.queryStr.charAt(0) ? r.queryStr.replace("?", "") : r.queryStr, r.queryStr = null, this._load(t, r);
                var n = this;
                this.loader.on("load", function(t, r) {
                    if (r.textures) {
                        for (var o in r.textures) {
                            var s = e.getFileNameWithoutExt(o);
                            i.Texture.addToCache(r.textures[o], s)
                        }
                        n._count.current++, n.options.onFileLoaded()
                    }
                }), this.loader.once("complete", function() {
                    n._count.current === n._count.total && (n._count.complete = !0, n.options.onFileLoaded())
                }), this.loader.on("error", this.options.onLoadFailed), this.loader.load()
            }, r.prototype._doLoadFile = function(t) {
                var i = e.getFileNameWithoutExt(t);
                this.loader.add(i, t)
            }, r
        }), define("skbJet/component/pixiResourceLoader/PixiImageSubLoader", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/AbstractSubLoader", "com/pixijs/pixi"], function(e, t, i) {
            function r(e) {
                this._initOptions("images", e)
            }
            return r.prototype = new t, r.prototype._load = r.prototype.load, r.prototype.load = function(e, t) {
                this.loader = new i.loaders.Loader, this._load(e, t);
                var r = this;
                this.loader.on("load", function(e, t) {
                    i.Texture.addToCache(t.texture, t.name), r._count.current++, r.options.onFileLoaded()
                }), this.loader.once("complete", function() {
                    r._count.current === r._count.total && (r._count.complete = !0, r.options.onFileLoaded())
                }), this.loader.on("error", this.options.onLoadFailed), this.loader.load()
            }, r.prototype._doLoadFile = function(t) {
                var i = e.getFileNameWithoutExt(t);
                this.loader.add(i, t)
            }, r
        }), define("skbJet/component/pixiResourceLoader/pixiResourceLoader", ["skbJet/component/gameMsgBus/GameMsgBus", "com/pixijs/pixi", "skbJet/component/resourceLoader/resourceLib", "skbJet/component/resourceLoader/ResourceLoader", "skbJet/component/resourceLoader/subLoaders/TextFilesSubLoader", "skbJet/component/resourceLoader/subLoaders/HtmlTagSubLoader", "skbJet/component/pixiResourceLoader/PixiSpriteSubLoader", "skbJet/component/pixiResourceLoader/PixiImageSubLoader"], function(e, t, i, r, n, o, s, a) {
            function l(t) {
                var r = "resourceLoader." + ("default" === t ? "loadProgress" : "deferredLoadProgress");
                return function() {
                    p[t] = d[t].currentProgress(), p[t].complete && (h.i18n = i.i18n.game || {}, h.i18n.helpHTML = i.i18n.help, h.i18n.paytableHTML = i.i18n.paytable, h.i18n.gameConfig = i.i18n.gameConfig), e.publish(r, {
                        label: t,
                        total: p[t].total,
                        current: p[t].current,
                        complete: p[t].complete
                    })
                }
            }

            function u(t) {
                return function() {
                    e.publish("toPlatform", {
                        channel: "Kernel",
                        topic: "LoadProgress",
                        data: {
                            id: "game",
                            items: p[t].total,
                            current: p[t].current,
                            label: t,
                            complete: !1,
                            fail: !0
                        }
                    })
                }
            }

            function c(e) {
                if (t.utils.TextureCache[e]) {
                    var i = t.utils.TextureCache[e],
                        r = new t.CanvasRenderer(i.orig.width, i.orig.height, {
                            transparent: !0
                        }),
                        n = new t.Sprite(i);
                    _.addChild(n), r.render(_);
                    var o = new Image;
                    o.src = r.view.toDataURL(), f[e] = o, _.removeChild(n)
                }
            }
            i.sounds = i.sounds || {}, i.images = i.images || {}, i.layout = i.layout || {}, i.sprites = i.sprites || {}, i.i18n = i.i18n || {};
            var h = {
                    audio: i.sounds,
                    images: i.images,
                    layout: i.layout,
                    sprites: i.sprites,
                    i18n: null
                },
                d = {},
                p = {
                    default: {}
                };
            h.load = function(e, t, i) {
                r.initDefault(e, t, i), d.default = r.getDefault(), d.default.addSubLoader("images", new a({
                    type: "images"
                })), d.default.addSubLoader("sprites", new s({
                    type: "sprites"
                }));
                var c = new n({
                    type: "i18n",
                    parseJson: !0
                });
                return c.origLoad = c.load, c.load = function(e, t) {
                    for (var i in e) i.match(/splash\.json$/) && delete e[i];
                    this.origLoad(e, t)
                }, d.default.addSubLoader("i18n", c), d.default.addSubLoader("layout", new o({
                    tagName: "script",
                    tagAttributes: {
                        type: "text/javascript"
                    },
                    fileExtFilterList: ["js"],
                    parentTag: document.getElementsByTagName("head")[0]
                })), d.default.load(l("default"), u("default")), d.default
            }, h.loadDeferred = function(e, t, i, n) {
                return p[t] = {}, d[t] = new r(e, i, n), d[t].addSubLoader("images", new a({
                    type: "images"
                })), d[t].addSubLoader("sprites", new s({
                    type: "sprites"
                })), d[t].load(l(t), u(t)), d[t]
            };
            var f = {},
                _ = new t.Container;
            return h.getImgObj = function(e) {
                return f[e] || c(e), f[e]
            }, h
        }), define("skbJet/componentManchester/webfontLoader/FontSubLoader", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/AbstractSubLoader"], function(e, t) {
            function i(e) {
                e = e || {}, e.fileExtFilterList = ["json"], e.checkInterval = e.checkInterval || 250, e.timeout = e.timeout || 3e4, e.testString = e.testString || "abcdefghijklmnopqrstuvwxyz 1234567890_-", this._initOptions("fonts", e), this._testCanvas = document.createElement("canvas"), this._testCtx = this._testCanvas.getContext("2d")
            }
            return i.prototype = new t, i.prototype._doLoadFile = function(t, i, r) {
                var n = {
                        woff: "woff",
                        woff2: "woff2",
                        ttf: "truetype"
                    },
                    o = ["woff2", "woff", "ttf"],
                    s = this._testCtx,
                    a = this.options;
                e.httpGetJson(t, function(l) {
                    function u() {
                        g += 1, s.font = f + l.family + ", sans-serif", s.measureText(a.testString).width !== _ ? i() : g > a.timeout / a.checkInterval ? r() : setTimeout(u, a.checkInterval)
                    }
                    var c = e.getParentFolder(t);
                    "string" == typeof l.files && (l.files = [l.files]), l.files.sort(function(t, i) {
                        return o.indexOf(e.getFileExt(t, !0)) > o.indexOf(e.getFileExt(i, !0))
                    });
                    var h = l.files.map(function(t) {
                        var i = "url(" + c + t + a.queryStr + ") ",
                            r = e.getFileExt(t, !0);
                        return i += 'format("' + n[r] + '")'
                    });
                    if ("FontFace" in window) {
                        var d = new window.FontFace(l.family, h[0], l);
                        d.display = "block", document.fonts.add(d), d.load().then(function() {
                            i()
                        }).catch(function() {
                            r()
                        })
                    } else {
                        var p = "@font-face {";
                        p += 'font-family: "' + l.family + '";', p += "src: " + h.join(", ") + ";", p += "font-weight: " + (l.weight || "normal") + ";", p += "font-style: " + (l.style || "normal") + ";", p += "font-display: block; }";
                        var f = (l.style || "normal") + " " + (l.weight || "normal") + " 30px ";
                        s.font = f + "sans-serif";
                        var _ = s.measureText(a.testString).width,
                            m = document.createElement("style");
                        document.head.appendChild(m), m.sheet.insertRule(p, 0);
                        var g = 0;
                        u()
                    }
                }, r)
            }, i
        }), this.createjs = this.createjs || {},
        function() {
            var e = createjs.SoundJS = createjs.SoundJS || {};
            e.version = "1.0.0", e.buildDate = "Thu, 14 Sep 2017 19:47:47 GMT"
        }(), this.createjs = this.createjs || {}, createjs.extend = function(e, t) {
            "use strict";

            function i() {
                this.constructor = e
            }
            return i.prototype = t.prototype, e.prototype = new i
        }, this.createjs = this.createjs || {}, createjs.promote = function(e, t) {
            "use strict";
            var i = e.prototype,
                r = Object.getPrototypeOf && Object.getPrototypeOf(i) || i.__proto__;
            if (r) {
                i[(t += "_") + "constructor"] = r.constructor;
                for (var n in r) i.hasOwnProperty(n) && "function" == typeof r[n] && (i[t + n] = r[n])
            }
            return e
        }, this.createjs = this.createjs || {}, createjs.deprecate = function(e, t) {
            "use strict";
            return function() {
                return console && console.warn, e && e.apply(this, arguments)
            }
        }, this.createjs = this.createjs || {}, createjs.indexOf = function(e, t) {
            "use strict";
            for (var i = 0, r = e.length; r > i; i++)
                if (t === e[i]) return i;
            return -1
        }, this.createjs = this.createjs || {},
        function() {
            "use strict";
            createjs.proxy = function(e, t) {
                var i = Array.prototype.slice.call(arguments, 2);
                return function() {
                    return e.apply(t, Array.prototype.slice.call(arguments, 0).concat(i))
                }
            }
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e() {
                throw "BrowserDetect cannot be instantiated"
            }
            var t = e.agent = window.navigator.userAgent;
            e.isWindowPhone = t.indexOf("IEMobile") > -1 || t.indexOf("Windows Phone") > -1, e.isFirefox = t.indexOf("Firefox") > -1, e.isOpera = null != window.opera, e.isChrome = t.indexOf("Chrome") > -1, e.isIOS = (t.indexOf("iPod") > -1 || t.indexOf("iPhone") > -1 || t.indexOf("iPad") > -1) && !e.isWindowPhone, e.isAndroid = t.indexOf("Android") > -1 && !e.isWindowPhone, e.isBlackberry = t.indexOf("Blackberry") > -1, createjs.BrowserDetect = e
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e() {
                this._listeners = null, this._captureListeners = null
            }
            var t = e.prototype;
            e.initialize = function(e) {
                e.addEventListener = t.addEventListener, e.on = t.on, e.removeEventListener = e.off = t.removeEventListener, e.removeAllEventListeners = t.removeAllEventListeners, e.hasEventListener = t.hasEventListener, e.dispatchEvent = t.dispatchEvent, e._dispatchEvent = t._dispatchEvent, e.willTrigger = t.willTrigger
            }, t.addEventListener = function(e, t, i) {
                var r;
                r = i ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {};
                var n = r[e];
                return n && this.removeEventListener(e, t, i), n = r[e], n ? n.push(t) : r[e] = [t], t
            }, t.on = function(e, t, i, r, n, o) {
                return t.handleEvent && (i = i || t, t = t.handleEvent), i = i || this, this.addEventListener(e, function(e) {
                    t.call(i, e, n), r && e.remove()
                }, o)
            }, t.removeEventListener = function(e, t, i) {
                var r = i ? this._captureListeners : this._listeners;
                if (r) {
                    var n = r[e];
                    if (n)
                        for (var o = 0, s = n.length; s > o; o++)
                            if (n[o] == t) {
                                1 == s ? delete r[e] : n.splice(o, 1);
                                break
                            }
                }
            }, t.off = t.removeEventListener, t.removeAllEventListeners = function(e) {
                e ? (this._listeners && delete this._listeners[e], this._captureListeners && delete this._captureListeners[e]) : this._listeners = this._captureListeners = null
            }, t.dispatchEvent = function(e, t, i) {
                if ("string" == typeof e) {
                    var r = this._listeners;
                    if (!(t || r && r[e])) return !0;
                    e = new createjs.Event(e, t, i)
                } else e.target && e.clone && (e = e.clone());
                try {
                    e.target = this
                } catch (e) {}
                if (e.bubbles && this.parent) {
                    for (var n = this, o = [n]; n.parent;) o.push(n = n.parent);
                    var s, a = o.length;
                    for (s = a - 1; s >= 0 && !e.propagationStopped; s--) o[s]._dispatchEvent(e, 1 + (0 == s));
                    for (s = 1; a > s && !e.propagationStopped; s++) o[s]._dispatchEvent(e, 3)
                } else this._dispatchEvent(e, 2);
                return !e.defaultPrevented
            }, t.hasEventListener = function(e) {
                var t = this._listeners,
                    i = this._captureListeners;
                return !!(t && t[e] || i && i[e])
            }, t.willTrigger = function(e) {
                for (var t = this; t;) {
                    if (t.hasEventListener(e)) return !0;
                    t = t.parent
                }
                return !1
            }, t.toString = function() {
                return "[EventDispatcher]"
            }, t._dispatchEvent = function(e, t) {
                var i, r, n = 2 >= t ? this._captureListeners : this._listeners;
                if (e && n && (r = n[e.type]) && (i = r.length)) {
                    try {
                        e.currentTarget = this
                    } catch (e) {}
                    try {
                        e.eventPhase = 0 | t
                    } catch (e) {}
                    e.removed = !1, r = r.slice();
                    for (var o = 0; i > o && !e.immediatePropagationStopped; o++) {
                        var s = r[o];
                        s.handleEvent ? s.handleEvent(e) : s(e), e.removed && (this.off(e.type, s, 1 == t), e.removed = !1)
                    }
                }
                2 === t && this._dispatchEvent(e, 2.1)
            }, createjs.EventDispatcher = e
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e, t, i) {
                this.type = e, this.target = null, this.currentTarget = null, this.eventPhase = 0, this.bubbles = !!t, this.cancelable = !!i, this.timeStamp = (new Date).getTime(), this.defaultPrevented = !1, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.removed = !1
            }
            var t = e.prototype;
            t.preventDefault = function() {
                this.defaultPrevented = this.cancelable && !0
            }, t.stopPropagation = function() {
                this.propagationStopped = !0
            }, t.stopImmediatePropagation = function() {
                this.immediatePropagationStopped = this.propagationStopped = !0
            }, t.remove = function() {
                this.removed = !0
            }, t.clone = function() {
                return new e(this.type, this.bubbles, this.cancelable)
            }, t.set = function(e) {
                for (var t in e) this[t] = e[t];
                return this
            }, t.toString = function() {
                return "[Event (type=" + this.type + ")]"
            }, createjs.Event = e
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e, t, i) {
                this.Event_constructor("error"), this.title = e, this.message = t, this.data = i
            }
            createjs.extend(e, createjs.Event).clone = function() {
                return new createjs.ErrorEvent(this.title, this.message, this.data)
            }, createjs.ErrorEvent = createjs.promote(e, "Event")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e, t) {
                this.Event_constructor("progress"), this.loaded = e, this.total = null == t ? 1 : t, this.progress = 0 == t ? 0 : this.loaded / this.total
            }
            createjs.extend(e, createjs.Event).clone = function() {
                return new createjs.ProgressEvent(this.loaded, this.total)
            }, createjs.ProgressEvent = createjs.promote(e, "Event")
        }(window), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e() {
                this.src = null, this.type = null, this.id = null, this.maintainOrder = !1, this.callback = null, this.data = null, this.method = createjs.Methods.GET, this.values = null, this.headers = null, this.withCredentials = !1, this.mimeType = null, this.crossOrigin = null, this.loadTimeout = i.LOAD_TIMEOUT_DEFAULT
            }
            var t = e.prototype = {},
                i = e;
            i.LOAD_TIMEOUT_DEFAULT = 8e3, i.create = function(t) {
                if ("string" == typeof t) {
                    var r = new e;
                    return r.src = t, r
                }
                if (t instanceof i) return t;
                if (t instanceof Object && t.src) return null == t.loadTimeout && (t.loadTimeout = i.LOAD_TIMEOUT_DEFAULT), t;
                throw new Error("Type not recognized.")
            }, t.set = function(e) {
                for (var t in e) this[t] = e[t];
                return this
            }, createjs.LoadItem = i
        }(), this.createjs = this.createjs || {},
        function() {
            var e = {};
            e.POST = "POST", e.GET = "GET", createjs.Methods = e
        }(), this.createjs = this.createjs || {},
        function() {
            var e = {};
            e.BINARY = "binary", e.CSS = "css", e.FONT = "font", e.FONTCSS = "fontcss", e.IMAGE = "image", e.JAVASCRIPT = "javascript", e.JSON = "json", e.JSONP = "jsonp", e.MANIFEST = "manifest", e.SOUND = "sound", e.VIDEO = "video", e.SPRITESHEET = "spritesheet", e.SVG = "svg", e.TEXT = "text", e.XML = "xml", createjs.Types = e
        }(),
        function() {
            var e = {};
            e.a = function() {
                return e.el("a")
            }, e.svg = function() {
                return e.el("svg")
            }, e.object = function() {
                return e.el("object")
            }, e.image = function() {
                return e.el("image")
            }, e.img = function() {
                return e.el("img")
            }, e.style = function() {
                return e.el("style")
            }, e.link = function() {
                return e.el("link")
            }, e.script = function() {
                return e.el("script")
            }, e.audio = function() {
                return e.el("audio")
            }, e.video = function() {
                return e.el("video")
            }, e.text = function(e) {
                return document.createTextNode(e)
            }, e.el = function(e) {
                return document.createElement(e)
            }, createjs.Elements = e
        }(),
        function() {
            var e = {
                container: null
            };
            e.appendToHead = function(t) {
                e.getHead().appendChild(t)
            }, e.appendToBody = function(t) {
                if (null == e.container) {
                    e.container = document.createElement("div"), e.container.id = "preloadjs-container";
                    var i = e.container.style;
                    i.visibility = "hidden", i.position = "absolute", i.width = e.container.style.height = "10px", i.overflow = "hidden", i.transform = i.msTransform = i.webkitTransform = i.oTransform = "translate(-10px, -10px)", e.getBody().appendChild(e.container)
                }
                e.container.appendChild(t)
            }, e.getHead = function() {
                return document.head || document.getElementsByTagName("head")[0]
            }, e.getBody = function() {
                return document.body || document.getElementsByTagName("body")[0]
            }, e.removeChild = function(e) {
                e.parent && e.parent.removeChild(e)
            }, e.isImageTag = function(e) {
                return e instanceof HTMLImageElement
            }, e.isAudioTag = function(e) {
                return !!window.HTMLAudioElement && e instanceof HTMLAudioElement
            }, e.isVideoTag = function(e) {
                return !!window.HTMLVideoElement && e instanceof HTMLVideoElement
            }, createjs.DomUtils = e
        }(),
        function() {
            var e = {};
            e.isBinary = function(e) {
                switch (e) {
                    case createjs.Types.IMAGE:
                    case createjs.Types.BINARY:
                        return !0;
                    default:
                        return !1
                }
            }, e.isText = function(e) {
                switch (e) {
                    case createjs.Types.TEXT:
                    case createjs.Types.JSON:
                    case createjs.Types.MANIFEST:
                    case createjs.Types.XML:
                    case createjs.Types.CSS:
                    case createjs.Types.SVG:
                    case createjs.Types.JAVASCRIPT:
                    case createjs.Types.SPRITESHEET:
                        return !0;
                    default:
                        return !1
                }
            }, e.getTypeByExtension = function(e) {
                if (null == e) return createjs.Types.TEXT;
                switch (e.toLowerCase()) {
                    case "jpeg":
                    case "jpg":
                    case "gif":
                    case "png":
                    case "webp":
                    case "bmp":
                        return createjs.Types.IMAGE;
                    case "ogg":
                    case "mp3":
                    case "webm":
                        return createjs.Types.SOUND;
                    case "mp4":
                    case "webm":
                    case "ts":
                        return createjs.Types.VIDEO;
                    case "json":
                        return createjs.Types.JSON;
                    case "xml":
                        return createjs.Types.XML;
                    case "css":
                        return createjs.Types.CSS;
                    case "js":
                        return createjs.Types.JAVASCRIPT;
                    case "svg":
                        return createjs.Types.SVG;
                    default:
                        return createjs.Types.TEXT
                }
            }, createjs.RequestUtils = e
        }(),
        function() {
            var e = {};
            e.ABSOLUTE_PATT = /^(?:\w+:)?\/{2}/i, e.RELATIVE_PATT = /^[.\/]*?\//i, e.EXTENSION_PATT = /\/?[^\/]+\.(\w{1,5})$/i, e.parseURI = function(t) {
                var i = {
                    absolute: !1,
                    relative: !1,
                    protocol: null,
                    hostname: null,
                    port: null,
                    pathname: null,
                    search: null,
                    hash: null,
                    host: null
                };
                if (null == t) return i;
                var r = createjs.Elements.a();
                r.href = t;
                for (var n in i) n in r && (i[n] = r[n]);
                var o = t.indexOf("?");
                o > -1 && (t = t.substr(0, o));
                var s;
                return e.ABSOLUTE_PATT.test(t) ? i.absolute = !0 : e.RELATIVE_PATT.test(t) && (i.relative = !0), (s = t.match(e.EXTENSION_PATT)) && (i.extension = s[1].toLowerCase()), i
            }, e.formatQueryString = function(e, t) {
                if (null == e) throw new Error("You must specify data.");
                var i = [];
                for (var r in e) i.push(r + "=" + escape(e[r]));
                return t && (i = i.concat(t)), i.join("&")
            }, e.buildURI = function(e, t) {
                if (null == t) return e;
                var i = [],
                    r = e.indexOf("?");
                if (-1 != r) {
                    var n = e.slice(r + 1);
                    i = i.concat(n.split("&"))
                }
                return -1 != r ? e.slice(0, r) + "?" + this.formatQueryString(t, i) : e + "?" + this.formatQueryString(t, i)
            }, e.isCrossDomain = function(e) {
                var t = createjs.Elements.a();
                t.href = e.src;
                var i = createjs.Elements.a();
                return i.href = location.href, "" != t.hostname && (t.port != i.port || t.protocol != i.protocol || t.hostname != i.hostname)
            }, e.isLocal = function(e) {
                var t = createjs.Elements.a();
                return t.href = e.src, "" == t.hostname && "file:" == t.protocol
            }, createjs.URLUtils = e
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e, t, i) {
                this.EventDispatcher_constructor(), this.loaded = !1, this.canceled = !1, this.progress = 0, this.type = i, this.resultFormatter = null, this._item = e ? createjs.LoadItem.create(e) : null, this._preferXHR = t, this._result = null, this._rawResult = null, this._loadedItems = null, this._tagSrcAttribute = null, this._tag = null
            }
            var t = createjs.extend(e, createjs.EventDispatcher),
                i = e;
            try {
                Object.defineProperties(i, {
                    POST: {
                        get: createjs.deprecate(function() {
                            return createjs.Methods.POST
                        }, "AbstractLoader.POST")
                    },
                    GET: {
                        get: createjs.deprecate(function() {
                            return createjs.Methods.GET
                        }, "AbstractLoader.GET")
                    },
                    BINARY: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.BINARY
                        }, "AbstractLoader.BINARY")
                    },
                    CSS: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.CSS
                        }, "AbstractLoader.CSS")
                    },
                    FONT: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.FONT
                        }, "AbstractLoader.FONT")
                    },
                    FONTCSS: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.FONTCSS
                        }, "AbstractLoader.FONTCSS")
                    },
                    IMAGE: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.IMAGE
                        }, "AbstractLoader.IMAGE")
                    },
                    JAVASCRIPT: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.JAVASCRIPT
                        }, "AbstractLoader.JAVASCRIPT")
                    },
                    JSON: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.JSON
                        }, "AbstractLoader.JSON")
                    },
                    JSONP: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.JSONP
                        }, "AbstractLoader.JSONP")
                    },
                    MANIFEST: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.MANIFEST
                        }, "AbstractLoader.MANIFEST")
                    },
                    SOUND: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.SOUND
                        }, "AbstractLoader.SOUND")
                    },
                    VIDEO: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.VIDEO
                        }, "AbstractLoader.VIDEO")
                    },
                    SPRITESHEET: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.SPRITESHEET
                        }, "AbstractLoader.SPRITESHEET")
                    },
                    SVG: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.SVG
                        }, "AbstractLoader.SVG")
                    },
                    TEXT: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.TEXT
                        }, "AbstractLoader.TEXT")
                    },
                    XML: {
                        get: createjs.deprecate(function() {
                            return createjs.Types.XML
                        }, "AbstractLoader.XML")
                    }
                })
            } catch (e) {}
            t.getItem = function() {
                return this._item
            }, t.getResult = function(e) {
                return e ? this._rawResult : this._result
            }, t.getTag = function() {
                return this._tag
            }, t.setTag = function(e) {
                this._tag = e
            }, t.load = function() {
                this._createRequest(), this._request.on("complete", this, this), this._request.on("progress", this, this), this._request.on("loadStart", this, this), this._request.on("abort", this, this), this._request.on("timeout", this, this), this._request.on("error", this, this);
                var e = new createjs.Event("initialize");
                e.loader = this._request, this.dispatchEvent(e), this._request.load()
            }, t.cancel = function() {
                this.canceled = !0, this.destroy()
            }, t.destroy = function() {
                this._request && (this._request.removeAllEventListeners(), this._request.destroy()), this._request = null, this._item = null, this._rawResult = null, this._result = null, this._loadItems = null, this.removeAllEventListeners()
            }, t.getLoadedItems = function() {
                return this._loadedItems
            }, t._createRequest = function() {
                this._request = this._preferXHR ? new createjs.XHRRequest(this._item) : new createjs.TagRequest(this._item, this._tag || this._createTag(), this._tagSrcAttribute)
            }, t._createTag = function() {
                return null
            }, t._sendLoadStart = function() {
                this._isCanceled() || this.dispatchEvent("loadstart")
            }, t._sendProgress = function(e) {
                if (!this._isCanceled()) {
                    var t = null;
                    "number" == typeof e ? (this.progress = e, t = new createjs.ProgressEvent(this.progress)) : (t = e, this.progress = e.loaded / e.total, t.progress = this.progress, (isNaN(this.progress) || 1 / 0 == this.progress) && (this.progress = 0)), this.hasEventListener("progress") && this.dispatchEvent(t)
                }
            }, t._sendComplete = function() {
                if (!this._isCanceled()) {
                    this.loaded = !0;
                    var e = new createjs.Event("complete");
                    e.rawResult = this._rawResult, null != this._result && (e.result = this._result), this.dispatchEvent(e)
                }
            }, t._sendError = function(e) {
                !this._isCanceled() && this.hasEventListener("error") && (null == e && (e = new createjs.ErrorEvent("PRELOAD_ERROR_EMPTY")), this.dispatchEvent(e))
            }, t._isCanceled = function() {
                return !(null != window.createjs && !this.canceled)
            }, t.resultFormatter = null, t.handleEvent = function(e) {
                switch (e.type) {
                    case "complete":
                        this._rawResult = e.target._response;
                        var t = this.resultFormatter && this.resultFormatter(this);
                        t instanceof Function ? t.call(this, createjs.proxy(this._resultFormatSuccess, this), createjs.proxy(this._resultFormatFailed, this)) : (this._result = t || this._rawResult, this._sendComplete());
                        break;
                    case "progress":
                        this._sendProgress(e);
                        break;
                    case "error":
                        this._sendError(e);
                        break;
                    case "loadstart":
                        this._sendLoadStart();
                        break;
                    case "abort":
                    case "timeout":
                        this._isCanceled() || this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_" + e.type.toUpperCase() + "_ERROR"))
                }
            }, t._resultFormatSuccess = function(e) {
                this._result = e, this._sendComplete()
            }, t._resultFormatFailed = function(e) {
                this._sendError(e)
            }, t.toString = function() {
                return "[PreloadJS AbstractLoader]"
            }, createjs.AbstractLoader = createjs.promote(e, "EventDispatcher")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e, t, i) {
                this.AbstractLoader_constructor(e, t, i), this.resultFormatter = this._formatResult, this._tagSrcAttribute = "src", this.on("initialize", this._updateXHR, this)
            }
            var t = createjs.extend(e, createjs.AbstractLoader);
            t.load = function() {
                this._tag || (this._tag = this._createTag(this._item.src)), this._tag.preload = "auto", this._tag.load(), this.AbstractLoader_load()
            }, t._createTag = function() {}, t._createRequest = function() {
                this._request = this._preferXHR ? new createjs.XHRRequest(this._item) : new createjs.MediaTagRequest(this._item, this._tag || this._createTag(), this._tagSrcAttribute)
            }, t._updateXHR = function(e) {
                e.loader.setResponseType && e.loader.setResponseType("blob")
            }, t._formatResult = function(e) {
                if (this._tag.removeEventListener && this._tag.removeEventListener("canplaythrough", this._loadedHandler), this._tag.onstalled = null, this._preferXHR) {
                    var t = window.URL || window.webkitURL,
                        i = e.getResult(!0);
                    e.getTag().src = t.createObjectURL(i)
                }
                return e.getTag()
            }, createjs.AbstractMediaLoader = createjs.promote(e, "AbstractLoader")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";
            var e = function(e) {
                    this._item = e
                },
                t = createjs.extend(e, createjs.EventDispatcher);
            t.load = function() {}, t.destroy = function() {}, t.cancel = function() {}, createjs.AbstractRequest = createjs.promote(e, "EventDispatcher")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e, t, i) {
                this.AbstractRequest_constructor(e), this._tag = t, this._tagSrcAttribute = i, this._loadedHandler = createjs.proxy(this._handleTagComplete, this), this._addedToDOM = !1
            }
            var t = createjs.extend(e, createjs.AbstractRequest);
            t.load = function() {
                this._tag.onload = createjs.proxy(this._handleTagComplete, this), this._tag.onreadystatechange = createjs.proxy(this._handleReadyStateChange, this), this._tag.onerror = createjs.proxy(this._handleError, this);
                var e = new createjs.Event("initialize");
                e.loader = this._tag, this.dispatchEvent(e), this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), this._item.loadTimeout), this._tag[this._tagSrcAttribute] = this._item.src, null == this._tag.parentNode && (createjs.DomUtils.appendToBody(this._tag), this._addedToDOM = !0)
            }, t.destroy = function() {
                this._clean(), this._tag = null, this.AbstractRequest_destroy()
            }, t._handleReadyStateChange = function() {
                clearTimeout(this._loadTimeout);
                var e = this._tag;
                ("loaded" == e.readyState || "complete" == e.readyState) && this._handleTagComplete()
            }, t._handleError = function() {
                this._clean(), this.dispatchEvent("error")
            }, t._handleTagComplete = function() {
                this._rawResult = this._tag, this._result = this.resultFormatter && this.resultFormatter(this) || this._rawResult, this._clean(), this.dispatchEvent("complete")
            }, t._handleTimeout = function() {
                this._clean(), this.dispatchEvent(new createjs.Event("timeout"))
            }, t._clean = function() {
                this._tag.onload = null, this._tag.onreadystatechange = null, this._tag.onerror = null, this._addedToDOM && null != this._tag.parentNode && this._tag.parentNode.removeChild(this._tag), clearTimeout(this._loadTimeout)
            }, t._handleStalled = function() {}, createjs.TagRequest = createjs.promote(e, "AbstractRequest")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e, t, i) {
                this.AbstractRequest_constructor(e), this._tag = t, this._tagSrcAttribute = i, this._loadedHandler = createjs.proxy(this._handleTagComplete, this)
            }
            var t = createjs.extend(e, createjs.TagRequest);
            t.load = function() {
                var e = createjs.proxy(this._handleStalled, this);
                this._stalledCallback = e;
                var t = createjs.proxy(this._handleProgress, this);
                this._handleProgress = t, this._tag.addEventListener("stalled", e), this._tag.addEventListener("progress", t), this._tag.addEventListener && this._tag.addEventListener("canplaythrough", this._loadedHandler, !1), this.TagRequest_load()
            }, t._handleReadyStateChange = function() {
                clearTimeout(this._loadTimeout);
                var e = this._tag;
                ("loaded" == e.readyState || "complete" == e.readyState) && this._handleTagComplete()
            }, t._handleStalled = function() {}, t._handleProgress = function(e) {
                if (e && !(e.loaded > 0 && 0 == e.total)) {
                    var t = new createjs.ProgressEvent(e.loaded, e.total);
                    this.dispatchEvent(t)
                }
            }, t._clean = function() {
                this._tag.removeEventListener && this._tag.removeEventListener("canplaythrough", this._loadedHandler), this._tag.removeEventListener("stalled", this._stalledCallback), this._tag.removeEventListener("progress", this._progressCallback), this.TagRequest__clean()
            }, createjs.MediaTagRequest = createjs.promote(e, "TagRequest")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e) {
                this.AbstractRequest_constructor(e), this._request = null, this._loadTimeout = null, this._xhrLevel = 1, this._response = null, this._rawResponse = null, this._canceled = !1, this._handleLoadStartProxy = createjs.proxy(this._handleLoadStart, this), this._handleProgressProxy = createjs.proxy(this._handleProgress, this), this._handleAbortProxy = createjs.proxy(this._handleAbort, this), this._handleErrorProxy = createjs.proxy(this._handleError, this), this._handleTimeoutProxy = createjs.proxy(this._handleTimeout, this), this._handleLoadProxy = createjs.proxy(this._handleLoad, this), this._handleReadyStateChangeProxy = createjs.proxy(this._handleReadyStateChange, this), this._createXHR(e)
            }
            var t = createjs.extend(e, createjs.AbstractRequest);
            e.ACTIVEX_VERSIONS = ["Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"], t.getResult = function(e) {
                return e && this._rawResponse ? this._rawResponse : this._response
            }, t.cancel = function() {
                this.canceled = !0, this._clean(), this._request.abort()
            }, t.load = function() {
                if (null == this._request) return void this._handleError();
                null != this._request.addEventListener ? (this._request.addEventListener("loadstart", this._handleLoadStartProxy, !1), this._request.addEventListener("progress", this._handleProgressProxy, !1), this._request.addEventListener("abort", this._handleAbortProxy, !1), this._request.addEventListener("error", this._handleErrorProxy, !1), this._request.addEventListener("timeout", this._handleTimeoutProxy, !1), this._request.addEventListener("load", this._handleLoadProxy, !1), this._request.addEventListener("readystatechange", this._handleReadyStateChangeProxy, !1)) : (this._request.onloadstart = this._handleLoadStartProxy, this._request.onprogress = this._handleProgressProxy, this._request.onabort = this._handleAbortProxy, this._request.onerror = this._handleErrorProxy, this._request.ontimeout = this._handleTimeoutProxy, this._request.onload = this._handleLoadProxy, this._request.onreadystatechange = this._handleReadyStateChangeProxy), 1 == this._xhrLevel && (this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), this._item.loadTimeout));
                try {
                    this._item.values ? this._request.send(createjs.URLUtils.formatQueryString(this._item.values)) : this._request.send()
                } catch (e) {
                    this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND", null, e))
                }
            }, t.setResponseType = function(e) {
                "blob" === e && (e = window.URL ? "blob" : "arraybuffer", this._responseType = e), this._request.responseType = e
            }, t.getAllResponseHeaders = function() {
                return this._request.getAllResponseHeaders instanceof Function ? this._request.getAllResponseHeaders() : null
            }, t.getResponseHeader = function(e) {
                return this._request.getResponseHeader instanceof Function ? this._request.getResponseHeader(e) : null
            }, t._handleProgress = function(e) {
                if (e && !(e.loaded > 0 && 0 == e.total)) {
                    var t = new createjs.ProgressEvent(e.loaded, e.total);
                    this.dispatchEvent(t)
                }
            }, t._handleLoadStart = function() {
                clearTimeout(this._loadTimeout), this.dispatchEvent("loadstart")
            }, t._handleAbort = function(e) {
                this._clean(), this.dispatchEvent(new createjs.ErrorEvent("XHR_ABORTED", null, e))
            }, t._handleError = function(e) {
                this._clean(), this.dispatchEvent(new createjs.ErrorEvent(e.message))
            }, t._handleReadyStateChange = function() {
                4 == this._request.readyState && this._handleLoad()
            }, t._handleLoad = function() {
                if (!this.loaded) {
                    this.loaded = !0;
                    var e = this._checkError();
                    if (e) return void this._handleError(e);
                    if (this._response = this._getResponse(), "arraybuffer" === this._responseType) try {
                        this._response = new Blob([this._response])
                    } catch (e) {
                        if (window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder, "TypeError" === e.name && window.BlobBuilder) {
                            var t = new BlobBuilder;
                            t.append(this._response), this._response = t.getBlob()
                        }
                    }
                    this._clean(), this.dispatchEvent(new createjs.Event("complete"))
                }
            }, t._handleTimeout = function(e) {
                this._clean(), this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT", null, e))
            }, t._checkError = function() {
                var e = parseInt(this._request.status);
                return e >= 400 && 599 >= e ? new Error(e) : 0 == e && /^https?:/.test(location.protocol) ? new Error(0) : null
            }, t._getResponse = function() {
                if (null != this._response) return this._response;
                if (null != this._request.response) return this._request.response;
                try {
                    if (null != this._request.responseText) return this._request.responseText
                } catch (e) {}
                try {
                    if (null != this._request.responseXML) return this._request.responseXML
                } catch (e) {}
                return null
            }, t._createXHR = function(e) {
                var t = createjs.URLUtils.isCrossDomain(e),
                    i = {},
                    r = null;
                if (window.XMLHttpRequest) r = new XMLHttpRequest, t && void 0 === r.withCredentials && window.XDomainRequest && (r = new XDomainRequest);
                else {
                    for (var n = 0, o = s.ACTIVEX_VERSIONS.length; o > n; n++) {
                        var a = s.ACTIVEX_VERSIONS[n];
                        try {
                            r = new ActiveXObject(a);
                            break
                        } catch (e) {}
                    }
                    if (null == r) return !1
                }
                null == e.mimeType && createjs.RequestUtils.isText(e.type) && (e.mimeType = "text/plain; charset=utf-8"), e.mimeType && r.overrideMimeType && r.overrideMimeType(e.mimeType), this._xhrLevel = "string" == typeof r.responseType ? 2 : 1;
                var l = null;
                if (l = e.method == createjs.Methods.GET ? createjs.URLUtils.buildURI(e.src, e.values) : e.src, r.open(e.method || createjs.Methods.GET, l, !0), t && r instanceof XMLHttpRequest && 1 == this._xhrLevel && (i.Origin = location.origin), e.values && e.method == createjs.Methods.POST && (i["Content-Type"] = "application/x-www-form-urlencoded"), t || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest"), e.headers)
                    for (var u in e.headers) i[u] = e.headers[u];
                for (u in i) r.setRequestHeader(u, i[u]);
                return r instanceof XMLHttpRequest && void 0 !== e.withCredentials && (r.withCredentials = e.withCredentials), this._request = r, !0
            }, t._clean = function() {
                clearTimeout(this._loadTimeout), null != this._request.removeEventListener ? (this._request.removeEventListener("loadstart", this._handleLoadStartProxy), this._request.removeEventListener("progress", this._handleProgressProxy), this._request.removeEventListener("abort", this._handleAbortProxy), this._request.removeEventListener("error", this._handleErrorProxy), this._request.removeEventListener("timeout", this._handleTimeoutProxy), this._request.removeEventListener("load", this._handleLoadProxy), this._request.removeEventListener("readystatechange", this._handleReadyStateChangeProxy)) : (this._request.onloadstart = null, this._request.onprogress = null, this._request.onabort = null, this._request.onerror = null, this._request.ontimeout = null, this._request.onload = null, this._request.onreadystatechange = null)
            }, t.toString = function() {
                return "[PreloadJS XHRRequest]"
            }, createjs.XHRRequest = createjs.promote(e, "AbstractRequest")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e, t) {
                this.AbstractMediaLoader_constructor(e, t, createjs.Types.SOUND), createjs.DomUtils.isAudioTag(e) ? this._tag = e : createjs.DomUtils.isAudioTag(e.src) ? this._tag = e : createjs.DomUtils.isAudioTag(e.tag) && (this._tag = createjs.DomUtils.isAudioTag(e) ? e : e.src), null != this._tag && (this._preferXHR = !1)
            }
            var t = createjs.extend(e, createjs.AbstractMediaLoader);
            e.canLoadItem = function(e) {
                return e.type == createjs.Types.SOUND
            }, t._createTag = function(e) {
                var t = createjs.Elements.audio();
                return t.autoplay = !1, t.preload = "none", t.src = e, t
            }, createjs.SoundLoader = createjs.promote(e, "AbstractMediaLoader")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";
            var e = function() {
                    this.interrupt = null, this.delay = null, this.offset = null, this.loop = null, this.volume = null, this.pan = null, this.startTime = null, this.duration = null
                },
                t = e.prototype = {},
                i = e;
            i.create = function(e) {
                if ("string" == typeof e) return console && (console.warn || console.log)("Deprecated behaviour. Sound.play takes a configuration object instead of individual arguments. See docs for info."), (new createjs.PlayPropsConfig).set({
                    interrupt: e
                });
                if (null == e || e instanceof i || e instanceof Object) return (new createjs.PlayPropsConfig).set(e);
                if (null == e) throw new Error("PlayProps configuration not recognized.")
            }, t.set = function(e) {
                if (null != e)
                    for (var t in e) this[t] = e[t];
                return this
            }, t.toString = function() {
                return "[PlayPropsConfig]"
            }, createjs.PlayPropsConfig = i
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e() {
                throw "Sound cannot be instantiated"
            }

            function t(e, t) {
                this.init(e, t)
            }
            var i = e;
            i.INTERRUPT_ANY = "any", i.INTERRUPT_EARLY = "early", i.INTERRUPT_LATE = "late", i.INTERRUPT_NONE = "none", i.PLAY_INITED = "playInited", i.PLAY_SUCCEEDED = "playSucceeded", i.PLAY_INTERRUPTED = "playInterrupted", i.PLAY_FINISHED = "playFinished", i.PLAY_FAILED = "playFailed", i.SUPPORTED_EXTENSIONS = ["mp3", "ogg", "opus", "mpeg", "wav", "m4a", "mp4", "aiff", "wma", "mid"], i.EXTENSION_MAP = {
                m4a: "mp4"
            }, i.FILE_PATTERN = /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([\/.]*?(?:[^?]+)?\/)?((?:[^\/?]+)\.(\w+))(?:\?(\S+)?)?$/, i.defaultInterruptBehavior = i.INTERRUPT_NONE, i.alternateExtensions = [], i.activePlugin = null, i._masterVolume = 1, i._getMasterVolume = function() {
                return this._masterVolume
            }, i.getVolume = createjs.deprecate(i._getMasterVolume, "Sound.getVolume"), i._setMasterVolume = function(e) {
                if (null != Number(e) && (e = Math.max(0, Math.min(1, e)), i._masterVolume = e, !this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(e)))
                    for (var t = this._instances, r = 0, n = t.length; n > r; r++) t[r].setMasterVolume(e)
            }, i.setVolume = createjs.deprecate(i._setMasterVolume, "Sound.setVolume"), i._masterMute = !1, i._getMute = function() {
                return this._masterMute
            }, i.getMute = createjs.deprecate(i._getMute, "Sound.getMute"), i._setMute = function(e) {
                if (null != e && (this._masterMute = e, !this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(e)))
                    for (var t = this._instances, i = 0, r = t.length; r > i; i++) t[i].setMasterMute(e)
            }, i.setMute = createjs.deprecate(i._setMute, "Sound.setMute"), i._getCapabilities = function() {
                return null == i.activePlugin ? null : i.activePlugin._capabilities
            }, i.getCapabilities = createjs.deprecate(i._getCapabilities, "Sound.getCapabilities"), Object.defineProperties(i, {
                volume: {
                    get: i._getMasterVolume,
                    set: i._setMasterVolume
                },
                muted: {
                    get: i._getMute,
                    set: i._setMute
                },
                capabilities: {
                    get: i._getCapabilities
                }
            }), i._pluginsRegistered = !1, i._lastID = 0, i._instances = [], i._idHash = {}, i._preloadHash = {}, i._defaultPlayPropsHash = {}, i.addEventListener = null, i.removeEventListener = null, i.removeAllEventListeners = null, i.dispatchEvent = null, i.hasEventListener = null, i._listeners = null, createjs.EventDispatcher.initialize(i), i.getPreloadHandlers = function() {
                return {
                    callback: createjs.proxy(i.initLoad, i),
                    types: ["sound"],
                    extensions: i.SUPPORTED_EXTENSIONS
                }
            }, i._handleLoadComplete = function(e) {
                var t = e.target.getItem().src;
                if (i._preloadHash[t])
                    for (var r = 0, n = i._preloadHash[t].length; n > r; r++) {
                        var o = i._preloadHash[t][r];
                        if (i._preloadHash[t][r] = !0, i.hasEventListener("fileload")) {
                            var e = new createjs.Event("fileload");
                            e.src = o.src, e.id = o.id, e.data = o.data, e.sprite = o.sprite, i.dispatchEvent(e)
                        }
                    }
            }, i._handleLoadError = function(e) {
                var t = e.target.getItem().src;
                if (i._preloadHash[t])
                    for (var r = 0, n = i._preloadHash[t].length; n > r; r++) {
                        var o = i._preloadHash[t][r];
                        if (i._preloadHash[t][r] = !1, i.hasEventListener("fileerror")) {
                            var e = new createjs.Event("fileerror");
                            e.src = o.src, e.id = o.id, e.data = o.data, e.sprite = o.sprite, i.dispatchEvent(e)
                        }
                    }
            }, i._registerPlugin = function(e) {
                return !!e.isSupported() && (i.activePlugin = new e, !0)
            }, i.registerPlugins = function(e) {
                i._pluginsRegistered = !0;
                for (var t = 0, r = e.length; r > t; t++)
                    if (i._registerPlugin(e[t])) return !0;
                return !1
            }, i.initializeDefaultPlugins = function() {
                return null != i.activePlugin || !i._pluginsRegistered && !!i.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin])
            }, i.isReady = function() {
                return null != i.activePlugin
            }, i.initLoad = function(e) {
                return "video" == e.type || i._registerSound(e)
            }, i._registerSound = function(e) {
                if (!i.initializeDefaultPlugins()) return !1;
                var r;
                if (e.src instanceof Object ? (r = i._parseSrc(e.src), r.src = e.path + r.src) : r = i._parsePath(e.src), null == r) return !1;
                e.src = r.src, e.type = "sound";
                var n = e.data,
                    o = null;
                if (null != n && (isNaN(n.channels) ? isNaN(n) || (o = parseInt(n)) : o = parseInt(n.channels), n.audioSprite))
                    for (var s, a = n.audioSprite.length; a--;) s = n.audioSprite[a], i._idHash[s.id] = {
                        src: e.src,
                        startTime: parseInt(s.startTime),
                        duration: parseInt(s.duration)
                    }, s.defaultPlayProps && (i._defaultPlayPropsHash[s.id] = createjs.PlayPropsConfig.create(s.defaultPlayProps));
                null != e.id && (i._idHash[e.id] = {
                    src: e.src
                });
                var l = i.activePlugin.register(e);
                return t.create(e.src, o), null != n && isNaN(n) ? e.data.channels = o || t.maxPerChannel() : e.data = o || t.maxPerChannel(), l.type && (e.type = l.type), e.defaultPlayProps && (i._defaultPlayPropsHash[e.src] = createjs.PlayPropsConfig.create(e.defaultPlayProps)), l
            }, i.registerSound = function(e, t, r, n, o) {
                var s = {
                    src: e,
                    id: t,
                    data: r,
                    defaultPlayProps: o
                };
                e instanceof Object && e.src && (n = t, s = e), s = createjs.LoadItem.create(s), s.path = n, null == n || s.src instanceof Object || (s.src = n + s.src);
                var a = i._registerSound(s);
                if (!a) return !1;
                if (i._preloadHash[s.src] || (i._preloadHash[s.src] = []), i._preloadHash[s.src].push(s), 1 == i._preloadHash[s.src].length) a.on("complete", this._handleLoadComplete, this), a.on("error", this._handleLoadError, this), i.activePlugin.preload(a);
                else if (1 == i._preloadHash[s.src][0]) return !0;
                return s
            }, i.registerSounds = function(e, t) {
                var i = [];
                e.path && (t ? t += e.path : t = e.path, e = e.manifest);
                for (var r = 0, n = e.length; n > r; r++) i[r] = createjs.Sound.registerSound(e[r].src, e[r].id, e[r].data, t, e[r].defaultPlayProps);
                return i
            }, i.removeSound = function(e, r) {
                if (null == i.activePlugin) return !1;
                e instanceof Object && e.src && (e = e.src);
                var n;
                if (e instanceof Object ? n = i._parseSrc(e) : (e = i._getSrcById(e).src, n = i._parsePath(e)), null == n) return !1;
                e = n.src, null != r && (e = r + e);
                for (var o in i._idHash) i._idHash[o].src == e && delete i._idHash[o];
                return t.removeSrc(e), delete i._preloadHash[e], i.activePlugin.removeSound(e), !0
            }, i.removeSounds = function(e, t) {
                var i = [];
                e.path && (t ? t += e.path : t = e.path, e = e.manifest);
                for (var r = 0, n = e.length; n > r; r++) i[r] = createjs.Sound.removeSound(e[r].src, t);
                return i
            }, i.removeAllSounds = function() {
                i._idHash = {}, i._preloadHash = {}, t.removeAll(), i.activePlugin && i.activePlugin.removeAllSounds()
            }, i.loadComplete = function(e) {
                if (!i.isReady()) return !1;
                var t = i._parsePath(e);
                return e = t ? i._getSrcById(t.src).src : i._getSrcById(e).src, void 0 != i._preloadHash[e] && 1 == i._preloadHash[e][0]
            }, i._parsePath = function(e) {
                "string" != typeof e && (e = e.toString());
                var t = e.match(i.FILE_PATTERN);
                if (null == t) return !1;
                for (var r = t[4], n = t[5], o = i.capabilities, s = 0; !o[n];)
                    if (n = i.alternateExtensions[s++], s > i.alternateExtensions.length) return null;
                return e = e.replace("." + t[5], "." + n), {
                    name: r,
                    src: e,
                    extension: n
                }
            }, i._parseSrc = function(e) {
                var t = {
                        name: void 0,
                        src: void 0,
                        extension: void 0
                    },
                    r = i.capabilities;
                for (var n in e)
                    if (e.hasOwnProperty(n) && r[n]) {
                        t.src = e[n], t.extension = n;
                        break
                    }
                if (!t.src) return !1;
                var o = t.src.lastIndexOf("/");
                return t.name = -1 != o ? t.src.slice(o + 1) : t.src, t
            }, i.play = function(e, t) {
                var r = createjs.PlayPropsConfig.create(t),
                    n = i.createInstance(e, r.startTime, r.duration);
                return i._playInstance(n, r) || n._playFailed(), n
            }, i.createInstance = function(e, r, n) {
                if (!i.initializeDefaultPlugins()) return new createjs.DefaultSoundInstance(e, r, n);
                var o = i._defaultPlayPropsHash[e];
                e = i._getSrcById(e);
                var s = i._parsePath(e.src),
                    a = null;
                return null != s && null != s.src ? (t.create(s.src), null == r && (r = e.startTime), a = i.activePlugin.create(s.src, r, n || e.duration), (o = o || i._defaultPlayPropsHash[s.src]) && a.applyPlayProps(o)) : a = new createjs.DefaultSoundInstance(e, r, n), a.uniqueId = i._lastID++, a
            }, i.stop = function() {
                for (var e = this._instances, t = e.length; t--;) e[t].stop()
            }, i.setDefaultPlayProps = function(e, t) {
                e = i._getSrcById(e), i._defaultPlayPropsHash[i._parsePath(e.src).src] = createjs.PlayPropsConfig.create(t)
            }, i.getDefaultPlayProps = function(e) {
                return e = i._getSrcById(e), i._defaultPlayPropsHash[i._parsePath(e.src).src]
            }, i._playInstance = function(e, t) {
                var r = i._defaultPlayPropsHash[e.src] || {};
                if (null == t.interrupt && (t.interrupt = r.interrupt || i.defaultInterruptBehavior), null == t.delay && (t.delay = r.delay || 0), null == t.offset && (t.offset = e.position), null == t.loop && (t.loop = e.loop), null == t.volume && (t.volume = e.volume), null == t.pan && (t.pan = e.pan), 0 == t.delay) {
                    if (!i._beginPlaying(e, t)) return !1
                } else {
                    var n = setTimeout(function() {
                        i._beginPlaying(e, t)
                    }, t.delay);
                    e.delayTimeoutId = n
                }
                return this._instances.push(e), !0
            }, i._beginPlaying = function(e, i) {
                if (!t.add(e, i.interrupt)) return !1;
                if (!e._beginPlaying(i)) {
                    var r = createjs.indexOf(this._instances, e);
                    return r > -1 && this._instances.splice(r, 1), !1
                }
                return !0
            }, i._getSrcById = function(e) {
                return i._idHash[e] || {
                    src: e
                }
            }, i._playFinished = function(e) {
                t.remove(e);
                var i = createjs.indexOf(this._instances, e);
                i > -1 && this._instances.splice(i, 1)
            }, createjs.Sound = e, t.channels = {}, t.create = function(e, i) {
                return null == t.get(e) && (t.channels[e] = new t(e, i), !0)
            }, t.removeSrc = function(e) {
                var i = t.get(e);
                return null != i && (i._removeAll(), delete t.channels[e], !0)
            }, t.removeAll = function() {
                for (var e in t.channels) t.channels[e]._removeAll();
                t.channels = {}
            }, t.add = function(e, i) {
                var r = t.get(e.src);
                return null != r && r._add(e, i)
            }, t.remove = function(e) {
                var i = t.get(e.src);
                return null != i && (i._remove(e), !0)
            }, t.maxPerChannel = function() {
                return r.maxDefault
            }, t.get = function(e) {
                return t.channels[e]
            };
            var r = t.prototype;
            r.constructor = t, r.src = null, r.max = null, r.maxDefault = 100, r.length = 0, r.init = function(e, t) {
                this.src = e, this.max = t || this.maxDefault, -1 == this.max && (this.max = this.maxDefault), this._instances = []
            }, r._get = function(e) {
                return this._instances[e]
            }, r._add = function(e, t) {
                return !!this._getSlot(t, e) && (this._instances.push(e), this.length++, !0)
            }, r._remove = function(e) {
                var t = createjs.indexOf(this._instances, e);
                return -1 != t && (this._instances.splice(t, 1), this.length--, !0)
            }, r._removeAll = function() {
                for (var e = this.length - 1; e >= 0; e--) this._instances[e].stop()
            }, r._getSlot = function(t) {
                var i, r;
                if (t != e.INTERRUPT_NONE && null == (r = this._get(0))) return !0;
                for (var n = 0, o = this.max; o > n; n++) {
                    if (null == (i = this._get(n))) return !0;
                    if (i.playState == e.PLAY_FINISHED || i.playState == e.PLAY_INTERRUPTED || i.playState == e.PLAY_FAILED) {
                        r = i;
                        break
                    }
                    t != e.INTERRUPT_NONE && (t == e.INTERRUPT_EARLY && i.position < r.position || t == e.INTERRUPT_LATE && i.position > r.position) && (r = i)
                }
                return null != r && (r._interrupt(), this._remove(r), !0)
            }, r.toString = function() {
                return "[Sound SoundChannel]"
            }
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";
            var e = function(e, t, i, r) {
                    this.EventDispatcher_constructor(), this.src = e, this.uniqueId = -1, this.playState = null, this.delayTimeoutId = null, this._volume = 1, Object.defineProperty(this, "volume", {
                        get: this._getVolume,
                        set: this._setVolume
                    }), this._pan = 0, Object.defineProperty(this, "pan", {
                        get: this._getPan,
                        set: this._setPan
                    }), this._startTime = Math.max(0, t || 0), Object.defineProperty(this, "startTime", {
                        get: this._getStartTime,
                        set: this._setStartTime
                    }), this._duration = Math.max(0, i || 0), Object.defineProperty(this, "duration", {
                        get: this._getDuration,
                        set: this._setDuration
                    }), this._playbackResource = null, Object.defineProperty(this, "playbackResource", {
                        get: this._getPlaybackResource,
                        set: this._setPlaybackResource
                    }), !1 !== r && !0 !== r && this._setPlaybackResource(r), this._position = 0, Object.defineProperty(this, "position", {
                        get: this._getPosition,
                        set: this._setPosition
                    }), this._loop = 0, Object.defineProperty(this, "loop", {
                        get: this._getLoop,
                        set: this._setLoop
                    }), this._muted = !1, Object.defineProperty(this, "muted", {
                        get: this._getMuted,
                        set: this._setMuted
                    }), this._paused = !1, Object.defineProperty(this, "paused", {
                        get: this._getPaused,
                        set: this._setPaused
                    })
                },
                t = createjs.extend(e, createjs.EventDispatcher);
            t.play = function(e) {
                var t = createjs.PlayPropsConfig.create(e);
                return this.playState == createjs.Sound.PLAY_SUCCEEDED ? (this.applyPlayProps(t), void(this._paused && this._setPaused(!1))) : (this._cleanUp(), createjs.Sound._playInstance(this, t), this)
            }, t.stop = function() {
                return this._position = 0, this._paused = !1, this._handleStop(), this._cleanUp(), this.playState = createjs.Sound.PLAY_FINISHED, this
            }, t.destroy = function() {
                this._cleanUp(), this.src = null, this.playbackResource = null, this.removeAllEventListeners()
            }, t.applyPlayProps = function(e) {
                return null != e.offset && this._setPosition(e.offset), null != e.loop && this._setLoop(e.loop), null != e.volume && this._setVolume(e.volume), null != e.pan && this._setPan(e.pan), null != e.startTime && (this._setStartTime(e.startTime), this._setDuration(e.duration)), this
            }, t.toString = function() {
                return "[AbstractSoundInstance]"
            }, t._getPaused = function() {
                return this._paused
            }, t._setPaused = function(e) {
                return !0 !== e && !1 !== e || this._paused == e || 1 == e && this.playState != createjs.Sound.PLAY_SUCCEEDED ? void 0 : (this._paused = e, e ? this._pause() : this._resume(), clearTimeout(this.delayTimeoutId), this)
            }, t._setVolume = function(e) {
                return e == this._volume ? this : (this._volume = Math.max(0, Math.min(1, e)), this._muted || this._updateVolume(), this)
            }, t._getVolume = function() {
                return this._volume
            }, t._setMuted = function(e) {
                return !0 === e || !1 === e ? (this._muted = e, this._updateVolume(), this) : void 0
            }, t._getMuted = function() {
                return this._muted
            }, t._setPan = function(e) {
                return e == this._pan ? this : (this._pan = Math.max(-1, Math.min(1, e)), this._updatePan(), this)
            }, t._getPan = function() {
                return this._pan
            }, t._getPosition = function() {
                return this._paused || this.playState != createjs.Sound.PLAY_SUCCEEDED || (this._position = this._calculateCurrentPosition()), this._position
            }, t._setPosition = function(e) {
                return this._position = Math.max(0, e), this.playState == createjs.Sound.PLAY_SUCCEEDED && this._updatePosition(), this
            }, t._getStartTime = function() {
                return this._startTime
            }, t._setStartTime = function(e) {
                return e == this._startTime ? this : (this._startTime = Math.max(0, e || 0), this._updateStartTime(), this)
            }, t._getDuration = function() {
                return this._duration
            }, t._setDuration = function(e) {
                return e == this._duration ? this : (this._duration = Math.max(0, e || 0), this._updateDuration(), this)
            }, t._setPlaybackResource = function(e) {
                return this._playbackResource = e, 0 == this._duration && this._playbackResource && this._setDurationFromSource(), this
            }, t._getPlaybackResource = function() {
                return this._playbackResource
            }, t._getLoop = function() {
                return this._loop
            }, t._setLoop = function(e) {
                null != this._playbackResource && (0 != this._loop && 0 == e ? this._removeLooping(e) : 0 == this._loop && 0 != e && this._addLooping(e)), this._loop = e
            }, t._sendEvent = function(e) {
                var t = new createjs.Event(e);
                this.dispatchEvent(t)
            }, t._cleanUp = function() {
                clearTimeout(this.delayTimeoutId), this._handleCleanUp(), this._paused = !1, createjs.Sound._playFinished(this)
            }, t._interrupt = function() {
                this._cleanUp(), this.playState = createjs.Sound.PLAY_INTERRUPTED, this._sendEvent("interrupted")
            }, t._beginPlaying = function(e) {
                return this._setPosition(e.offset), this._setLoop(e.loop), this._setVolume(e.volume), this._setPan(e.pan), null != e.startTime && (this._setStartTime(e.startTime), this._setDuration(e.duration)), null != this._playbackResource && this._position < this._duration ? (this._paused = !1, this._handleSoundReady(), this.playState = createjs.Sound.PLAY_SUCCEEDED, this._sendEvent("succeeded"), !0) : (this._playFailed(), !1)
            }, t._playFailed = function() {
                this._cleanUp(), this.playState = createjs.Sound.PLAY_FAILED, this._sendEvent("failed")
            }, t._handleSoundComplete = function() {
                return this._position = 0, 0 != this._loop ? (this._loop--, this._handleLoop(), void this._sendEvent("loop")) : (this._cleanUp(), this.playState = createjs.Sound.PLAY_FINISHED, void this._sendEvent("complete"))
            }, t._handleSoundReady = function() {}, t._updateVolume = function() {}, t._updatePan = function() {}, t._updateStartTime = function() {}, t._updateDuration = function() {}, t._setDurationFromSource = function() {}, t._calculateCurrentPosition = function() {}, t._updatePosition = function() {}, t._removeLooping = function() {}, t._addLooping = function() {}, t._pause = function() {}, t._resume = function() {}, t._handleStop = function() {}, t._handleCleanUp = function() {}, t._handleLoop = function() {}, createjs.AbstractSoundInstance = createjs.promote(e, "EventDispatcher"), createjs.DefaultSoundInstance = createjs.AbstractSoundInstance
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";
            var e = function() {
                    this._capabilities = null, this._loaders = {}, this._audioSources = {}, this._soundInstances = {}, this._volume = 1, this._loaderClass, this._soundInstanceClass
                },
                t = e.prototype;
            e._capabilities = null, e.isSupported = function() {
                return !0
            }, t.register = function(e) {
                var t = this._loaders[e.src];
                return t && !t.canceled ? this._loaders[e.src] : (this._audioSources[e.src] = !0, this._soundInstances[e.src] = [], t = new this._loaderClass(e), t.on("complete", this._handlePreloadComplete, this), this._loaders[e.src] = t, t)
            }, t.preload = function(e) {
                e.on("error", this._handlePreloadError, this), e.load()
            }, t.isPreloadStarted = function(e) {
                return null != this._audioSources[e]
            }, t.isPreloadComplete = function(e) {
                return !(null == this._audioSources[e] || 1 == this._audioSources[e])
            }, t.removeSound = function(e) {
                if (this._soundInstances[e]) {
                    for (var t = this._soundInstances[e].length; t--;) {
                        this._soundInstances[e][t].destroy()
                    }
                    delete this._soundInstances[e], delete this._audioSources[e], this._loaders[e] && this._loaders[e].destroy(), delete this._loaders[e]
                }
            }, t.removeAllSounds = function() {
                for (var e in this._audioSources) this.removeSound(e)
            }, t.create = function(e, t, i) {
                this.isPreloadStarted(e) || this.preload(this.register(e));
                var r = new this._soundInstanceClass(e, t, i, this._audioSources[e]);
                return this._soundInstances[e] && this._soundInstances[e].push(r), r.setMasterVolume && r.setMasterVolume(createjs.Sound.volume), r.setMasterMute && r.setMasterMute(createjs.Sound.muted), r
            }, t.setVolume = function(e) {
                return this._volume = e, this._updateVolume(), !0
            }, t.getVolume = function() {
                return this._volume
            }, t.setMute = function() {
                return this._updateVolume(), !0
            }, t.toString = function() {
                return "[AbstractPlugin]"
            }, t._handlePreloadComplete = function(e) {
                var t = e.target.getItem().src;
                this._audioSources[t] = e.result;
                for (var i = 0, r = this._soundInstances[t].length; r > i; i++) {
                    this._soundInstances[t][i].setPlaybackResource(this._audioSources[t]), this._soundInstances[t] = null
                }
            }, t._handlePreloadError = function() {}, t._updateVolume = function() {}, createjs.AbstractPlugin = e
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e) {
                this.AbstractLoader_constructor(e, !0, createjs.Types.SOUND)
            }
            var t = createjs.extend(e, createjs.AbstractLoader);
            e.context = null, t.toString = function() {
                return "[WebAudioLoader]"
            }, t._createRequest = function() {
                this._request = new createjs.XHRRequest(this._item, !1), this._request.setResponseType("arraybuffer")
            }, t._sendComplete = function() {
                e.context.decodeAudioData(this._rawResult, createjs.proxy(this._handleAudioDecoded, this), createjs.proxy(this._sendError, this))
            }, t._handleAudioDecoded = function(e) {
                this._result = e, this.AbstractLoader__sendComplete()
            }, createjs.WebAudioLoader = createjs.promote(e, "AbstractLoader")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e, t, r, n) {
                this.AbstractSoundInstance_constructor(e, t, r, n), this.gainNode = i.context.createGain(), this.panNode = i.context.createPanner(), this.panNode.panningModel = i._panningModel, this.panNode.connect(this.gainNode), this._updatePan(), this.sourceNode = null, this._soundCompleteTimeout = null, this._sourceNodeNext = null, this._playbackStartTime = 0, this._endedHandler = createjs.proxy(this._handleSoundComplete, this)
            }
            var t = createjs.extend(e, createjs.AbstractSoundInstance),
                i = e;
            i.context = null, i._scratchBuffer = null, i.destinationNode = null, i._panningModel = "equalpower", t.destroy = function() {
                this.AbstractSoundInstance_destroy(), this.panNode.disconnect(0), this.panNode = null, this.gainNode.disconnect(0), this.gainNode = null
            }, t.toString = function() {
                return "[WebAudioSoundInstance]"
            }, t._updatePan = function() {
                this.panNode.setPosition(this._pan, 0, -.5)
            }, t._removeLooping = function() {
                this._sourceNodeNext = this._cleanUpAudioNode(this._sourceNodeNext)
            }, t._addLooping = function() {
                this.playState == createjs.Sound.PLAY_SUCCEEDED && (this._sourceNodeNext = this._createAndPlayAudioNode(this._playbackStartTime, 0))
            }, t._setDurationFromSource = function() {
                this._duration = 1e3 * this.playbackResource.duration
            }, t._handleCleanUp = function() {
                this.sourceNode && this.playState == createjs.Sound.PLAY_SUCCEEDED && (this.sourceNode = this._cleanUpAudioNode(this.sourceNode), this._sourceNodeNext = this._cleanUpAudioNode(this._sourceNodeNext)), 0 != this.gainNode.numberOfOutputs && this.gainNode.disconnect(0), clearTimeout(this._soundCompleteTimeout), this._playbackStartTime = 0
            }, t._cleanUpAudioNode = function(e) {
                if (e) {
                    if (e.stop(0), e.disconnect(0), createjs.BrowserDetect.isIOS) try {
                        e.buffer = i._scratchBuffer
                    } catch (e) {}
                    e = null
                }
                return e
            }, t._handleSoundReady = function() {
                this.gainNode.connect(i.destinationNode);
                var e = .001 * this._duration,
                    t = Math.min(.001 * Math.max(0, this._position), e);
                this.sourceNode = this._createAndPlayAudioNode(i.context.currentTime - e, t), this._playbackStartTime = this.sourceNode.startTime - t, this._soundCompleteTimeout = setTimeout(this._endedHandler, 1e3 * (e - t)), 0 != this._loop && (this._sourceNodeNext = this._createAndPlayAudioNode(this._playbackStartTime, 0))
            }, t._createAndPlayAudioNode = function(e, t) {
                var r = i.context.createBufferSource();
                r.buffer = this.playbackResource, r.connect(this.panNode);
                var n = .001 * this._duration;
                return r.startTime = e + n, r.start(r.startTime, t + .001 * this._startTime, n - t), r
            }, t._pause = function() {
                this._position = 1e3 * (i.context.currentTime - this._playbackStartTime), this.sourceNode = this._cleanUpAudioNode(this.sourceNode), this._sourceNodeNext = this._cleanUpAudioNode(this._sourceNodeNext), 0 != this.gainNode.numberOfOutputs && this.gainNode.disconnect(0), clearTimeout(this._soundCompleteTimeout)
            }, t._resume = function() {
                this._handleSoundReady()
            }, t._updateVolume = function() {
                var e = this._muted ? 0 : this._volume;
                e != this.gainNode.gain.value && (this.gainNode.gain.value = e)
            }, t._calculateCurrentPosition = function() {
                return 1e3 * (i.context.currentTime - this._playbackStartTime)
            }, t._updatePosition = function() {
                this.sourceNode = this._cleanUpAudioNode(this.sourceNode), this._sourceNodeNext = this._cleanUpAudioNode(this._sourceNodeNext), clearTimeout(this._soundCompleteTimeout), this._paused || this._handleSoundReady()
            }, t._handleLoop = function() {
                this._cleanUpAudioNode(this.sourceNode), this.sourceNode = this._sourceNodeNext, this._playbackStartTime = this.sourceNode.startTime, this._sourceNodeNext = this._createAndPlayAudioNode(this._playbackStartTime, 0), this._soundCompleteTimeout = setTimeout(this._endedHandler, this._duration)
            }, t._updateDuration = function() {
                this.playState == createjs.Sound.PLAY_SUCCEEDED && (this._pause(), this._resume())
            }, createjs.WebAudioSoundInstance = createjs.promote(e, "AbstractSoundInstance")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e() {
                this.AbstractPlugin_constructor(), this._panningModel = i._panningModel, this.context = i.context, this.dynamicsCompressorNode = this.context.createDynamicsCompressor(), this.dynamicsCompressorNode.connect(this.context.destination), this.gainNode = this.context.createGain(), this.gainNode.connect(this.dynamicsCompressorNode), createjs.WebAudioSoundInstance.destinationNode = this.gainNode, this._capabilities = i._capabilities, this._loaderClass = createjs.WebAudioLoader, this._soundInstanceClass = createjs.WebAudioSoundInstance, this._addPropsToClasses()
            }
            var t = createjs.extend(e, createjs.AbstractPlugin),
                i = e;
            i._capabilities = null, i._panningModel = "equalpower", i.context = null, i._scratchBuffer = null, i._unlocked = !1, i.DEFAULT_SAMPLE_RATE = 44100, i.isSupported = function() {
                var e = createjs.BrowserDetect.isIOS || createjs.BrowserDetect.isAndroid || createjs.BrowserDetect.isBlackberry;
                return !("file:" == location.protocol && !e && !this._isFileXHRSupported()) && (i._generateCapabilities(), null != i.context)
            }, i.playEmptySound = function() {
                if (null != i.context) {
                    var e = i.context.createBufferSource();
                    e.buffer = i._scratchBuffer, e.connect(i.context.destination), e.start(0, 0, 0)
                }
            }, i._isFileXHRSupported = function() {
                var e = !0,
                    t = new XMLHttpRequest;
                try {
                    t.open("GET", "WebAudioPluginTest.fail", !1)
                } catch (t) {
                    return e = !1
                }
                t.onerror = function() {
                    e = !1
                }, t.onload = function() {
                    e = 404 == this.status || 200 == this.status || 0 == this.status && "" != this.response
                };
                try {
                    t.send()
                } catch (t) {
                    e = !1
                }
                return e
            }, i._generateCapabilities = function() {
                if (null == i._capabilities) {
                    var e = document.createElement("audio");
                    if (null == e.canPlayType) return null;
                    if (null == i.context && (i.context = i._createAudioContext(), null == i.context)) return null;
                    null == i._scratchBuffer && (i._scratchBuffer = i.context.createBuffer(1, 1, 22050)), i._compatibilitySetUp(), "ontouchstart" in window && "running" != i.context.state && (i._unlock(), document.addEventListener("mousedown", i._unlock, !0), document.addEventListener("touchstart", i._unlock, !0), document.addEventListener("touchend", i._unlock, !0)), i._capabilities = {
                        panning: !0,
                        volume: !0,
                        tracks: -1
                    };
                    for (var t = createjs.Sound.SUPPORTED_EXTENSIONS, r = createjs.Sound.EXTENSION_MAP, n = 0, o = t.length; o > n; n++) {
                        var s = t[n],
                            a = r[s] || s;
                        i._capabilities[s] = "no" != e.canPlayType("audio/" + s) && "" != e.canPlayType("audio/" + s) || "no" != e.canPlayType("audio/" + a) && "" != e.canPlayType("audio/" + a)
                    }
                    i.context.destination.numberOfChannels < 2 && (i._capabilities.panning = !1)
                }
            }, i._createAudioContext = function() {
                var e = window.AudioContext || window.webkitAudioContext;
                if (null == e) return null;
                var t = new e;
                if (/(iPhone|iPad)/i.test(navigator.userAgent) && t.sampleRate !== i.DEFAULT_SAMPLE_RATE) {
                    var r = t.createBuffer(1, 1, i.DEFAULT_SAMPLE_RATE),
                        n = t.createBufferSource();
                    n.buffer = r, n.connect(t.destination), n.start(0), n.disconnect(), t.close(), t = new e
                }
                return t
            }, i._compatibilitySetUp = function() {
                if (i._panningModel = "equalpower", !i.context.createGain) {
                    i.context.createGain = i.context.createGainNode;
                    var e = i.context.createBufferSource();
                    e.__proto__.start = e.__proto__.noteGrainOn, e.__proto__.stop = e.__proto__.noteOff, i._panningModel = 0
                }
            }, i._unlock = function() {
                i._unlocked || (i.playEmptySound(), "running" == i.context.state && (document.removeEventListener("mousedown", i._unlock, !0), document.removeEventListener("touchend", i._unlock, !0), document.removeEventListener("touchstart", i._unlock, !0), i._unlocked = !0))
            }, t.toString = function() {
                return "[WebAudioPlugin]"
            }, t._addPropsToClasses = function() {
                var e = this._soundInstanceClass;
                e.context = this.context, e._scratchBuffer = i._scratchBuffer, e.destinationNode = this.gainNode, e._panningModel = this._panningModel, this._loaderClass.context = this.context
            }, t._updateVolume = function() {
                var e = createjs.Sound._masterMute ? 0 : this._volume;
                e != this.gainNode.gain.value && (this.gainNode.gain.value = e)
            }, createjs.WebAudioPlugin = createjs.promote(e, "AbstractPlugin")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e() {
                throw "HTMLAudioTagPool cannot be instantiated"
            }

            function t() {
                this._tags = []
            }
            var i = e;
            i._tags = {}, i._tagPool = new t, i._tagUsed = {}, i.get = function(e) {
                var t = i._tags[e];
                return null == t ? (t = i._tags[e] = i._tagPool.get(), t.src = e) : i._tagUsed[e] ? (t = i._tagPool.get(), t.src = e) : i._tagUsed[e] = !0, t
            }, i.set = function(e, t) {
                t == i._tags[e] ? i._tagUsed[e] = !1 : i._tagPool.set(t)
            }, i.remove = function(e) {
                var t = i._tags[e];
                return null != t && (i._tagPool.set(t), delete i._tags[e], delete i._tagUsed[e], !0)
            }, i.getDuration = function(e) {
                var t = i._tags[e];
                return null != t && t.duration ? 1e3 * t.duration : 0
            }, createjs.HTMLAudioTagPool = e;
            var r = t.prototype;
            r.constructor = t, r.get = function() {
                var e;
                return e = 0 == this._tags.length ? this._createTag() : this._tags.pop(), null == e.parentNode && document.body.appendChild(e), e
            }, r.set = function(e) {
                -1 == createjs.indexOf(this._tags, e) && (this._tags.src = null, this._tags.push(e))
            }, r.toString = function() {
                return "[TagPool]"
            }, r._createTag = function() {
                var e = document.createElement("audio");
                return e.autoplay = !1, e.preload = "none", e
            }
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e(e, t, i, r) {
                this.AbstractSoundInstance_constructor(e, t, i, r), this._audioSpriteStopTime = null, this._delayTimeoutId = null, this._endedHandler = createjs.proxy(this._handleSoundComplete, this), this._readyHandler = createjs.proxy(this._handleTagReady, this), this._stalledHandler = createjs.proxy(this._playFailed, this), this._audioSpriteEndHandler = createjs.proxy(this._handleAudioSpriteLoop, this), this._loopHandler = createjs.proxy(this._handleSoundComplete, this), i ? this._audioSpriteStopTime = .001 * (t + i) : this._duration = createjs.HTMLAudioTagPool.getDuration(this.src)
            }
            var t = createjs.extend(e, createjs.AbstractSoundInstance);
            t.setMasterVolume = function() {
                this._updateVolume()
            }, t.setMasterMute = function() {
                this._updateVolume()
            }, t.toString = function() {
                return "[HTMLAudioSoundInstance]"
            }, t._removeLooping = function() {
                null != this._playbackResource && (this._playbackResource.loop = !1, this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this._loopHandler, !1))
            }, t._addLooping = function() {
                null == this._playbackResource || this._audioSpriteStopTime || (this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this._loopHandler, !1), this._playbackResource.loop = !0)
            }, t._handleCleanUp = function() {
                var e = this._playbackResource;
                if (null != e) {
                    e.pause(), e.loop = !1, e.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED, this._endedHandler, !1), e.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY, this._readyHandler, !1), e.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED, this._stalledHandler, !1), e.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this._loopHandler, !1), e.removeEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE, this._audioSpriteEndHandler, !1);
                    try {
                        e.currentTime = this._startTime
                    } catch (e) {}
                    createjs.HTMLAudioTagPool.set(this.src, e), this._playbackResource = null
                }
            }, t._beginPlaying = function(e) {
                return this._playbackResource = createjs.HTMLAudioTagPool.get(this.src), this.AbstractSoundInstance__beginPlaying(e)
            }, t._handleSoundReady = function() {
                if (4 !== this._playbackResource.readyState) {
                    var e = this._playbackResource;
                    return e.addEventListener(createjs.HTMLAudioPlugin._AUDIO_READY, this._readyHandler, !1), e.addEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED, this._stalledHandler, !1), e.preload = "auto", void e.load()
                }
                this._updateVolume(), this._playbackResource.currentTime = .001 * (this._startTime + this._position), this._audioSpriteStopTime ? this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE, this._audioSpriteEndHandler, !1) : (this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED, this._endedHandler, !1), 0 != this._loop && (this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this._loopHandler, !1), this._playbackResource.loop = !0)), this._playbackResource.play()
            }, t._handleTagReady = function() {
                this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY, this._readyHandler, !1), this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED, this._stalledHandler, !1), this._handleSoundReady()
            }, t._pause = function() {
                this._playbackResource.pause()
            }, t._resume = function() {
                this._playbackResource.play()
            }, t._updateVolume = function() {
                if (null != this._playbackResource) {
                    var e = this._muted || createjs.Sound._masterMute ? 0 : this._volume * createjs.Sound._masterVolume;
                    e != this._playbackResource.volume && (this._playbackResource.volume = e)
                }
            }, t._calculateCurrentPosition = function() {
                return 1e3 * this._playbackResource.currentTime - this._startTime
            }, t._updatePosition = function() {
                this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this._loopHandler, !1), this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this._handleSetPositionSeek, !1);
                try {
                    this._playbackResource.currentTime = .001 * (this._position + this._startTime)
                } catch (e) {
                    this._handleSetPositionSeek(null)
                }
            }, t._handleSetPositionSeek = function() {
                null != this._playbackResource && (this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this._handleSetPositionSeek, !1), this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this._loopHandler, !1))
            }, t._handleAudioSpriteLoop = function() {
                this._playbackResource.currentTime <= this._audioSpriteStopTime || (this._playbackResource.pause(), 0 == this._loop ? this._handleSoundComplete(null) : (this._position = 0, this._loop--, this._playbackResource.currentTime = .001 * this._startTime, this._paused || this._playbackResource.play(), this._sendEvent("loop")))
            }, t._handleLoop = function() {
                0 == this._loop && (this._playbackResource.loop = !1, this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this._loopHandler, !1))
            }, t._updateStartTime = function() {
                this._audioSpriteStopTime = .001 * (this._startTime + this._duration), this.playState == createjs.Sound.PLAY_SUCCEEDED && (this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED, this._endedHandler, !1), this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE, this._audioSpriteEndHandler, !1))
            }, t._updateDuration = function() {
                this._audioSpriteStopTime = .001 * (this._startTime + this._duration), this.playState == createjs.Sound.PLAY_SUCCEEDED && (this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED, this._endedHandler, !1), this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE, this._audioSpriteEndHandler, !1))
            }, t._setDurationFromSource = function() {
                this._duration = createjs.HTMLAudioTagPool.getDuration(this.src), this._playbackResource = null
            }, createjs.HTMLAudioSoundInstance = createjs.promote(e, "AbstractSoundInstance")
        }(), this.createjs = this.createjs || {},
        function() {
            "use strict";

            function e() {
                this.AbstractPlugin_constructor(), this._capabilities = i._capabilities, this._loaderClass = createjs.SoundLoader, this._soundInstanceClass = createjs.HTMLAudioSoundInstance
            }
            var t = createjs.extend(e, createjs.AbstractPlugin),
                i = e;
            i.MAX_INSTANCES = 30, i._AUDIO_READY = "canplaythrough", i._AUDIO_ENDED = "ended", i._AUDIO_SEEKED = "seeked", i._AUDIO_STALLED = "stalled", i._TIME_UPDATE = "timeupdate", i._capabilities = null, i.isSupported = function() {
                return i._generateCapabilities(), null != i._capabilities
            }, i._generateCapabilities = function() {
                if (null == i._capabilities) {
                    var e = document.createElement("audio");
                    if (null == e.canPlayType) return null;
                    i._capabilities = {
                        panning: !1,
                        volume: !0,
                        tracks: -1
                    };
                    for (var t = createjs.Sound.SUPPORTED_EXTENSIONS, r = createjs.Sound.EXTENSION_MAP, n = 0, o = t.length; o > n; n++) {
                        var s = t[n],
                            a = r[s] || s;
                        i._capabilities[s] = "no" != e.canPlayType("audio/" + s) && "" != e.canPlayType("audio/" + s) || "no" != e.canPlayType("audio/" + a) && "" != e.canPlayType("audio/" + a)
                    }
                }
            }, t.register = function(e) {
                var t = createjs.HTMLAudioTagPool.get(e.src),
                    i = this.AbstractPlugin_register(e);
                return i.setTag(t), i
            }, t.removeSound = function(e) {
                this.AbstractPlugin_removeSound(e), createjs.HTMLAudioTagPool.remove(e)
            }, t.create = function(e, t, i) {
                var r = this.AbstractPlugin_create(e, t, i);
                return r.playbackResource = null, r
            }, t.toString = function() {
                return "[HTMLAudioPlugin]"
            }, t.setVolume = t.getVolume = t.setMute = null, createjs.HTMLAudioPlugin = createjs.promote(e, "AbstractPlugin")
        }(), define("game/components/createJsAudioPlayer/soundjs", function(e) {
            return function() {
                return e.createjs
            }
        }(this)), define("game/components/createJsAudioPlayer/SoundSprite", ["game/components/createJsAudioPlayer/soundjs"], function(e) {
            function t(e, t, i, r, n) {
                var o = this;
                void 0 === n && (n = !1), this._volume = 1, this._pan = 0, this._loop = 0, this._soundInstances = [], this._position = 0, this._overlap = !1, this.onSoundLoop = function(e) {}, this.onSoundComplete = function(e) {
                    var t = o._soundInstances.indexOf(e.target);
                    t > -1 && o._soundInstances.splice(t, 1)
                }, this._spriteId = e, this._soundId = t, this._startTime = i, this._duration = r, this._overlap = n
            }
            return this && this.__extends || function(e, t) {
                function i() {
                    this.constructor = e
                }
                for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]);
                e.prototype = null === t ? Object.create(t) : (i.prototype = t.prototype, new i)
            }, t.prototype.play = function() {
                if (this._soundInstances.length <= 0 || this._overlap) {
                    var t = e.Sound.play(this._soundId, {
                        interrupt: e.Sound.INTERRUPT_NONE,
                        loop: this._loop,
                        volume: this._volume,
                        pan: this._pan,
                        startTime: this._startTime,
                        duration: this._duration
                    });
                    t.position = this._position, this._soundInstances.push(t), t.addEventListener("loop", this.onSoundLoop), t.addEventListener("complete", this.onSoundComplete)
                } else
                    for (var i = 0, r = this._soundInstances; i < r.length; i++) {
                        var n = r[i];
                        n.play()
                    }
            }, t.prototype.stop = function() {
                if (this._soundInstances.length > 0)
                    for (; this._soundInstances.length > 0;) {
                        var e = this._soundInstances.pop();
                        e.stop()
                    }
            }, t.prototype.pause = function() {
                if (this._soundInstances.length > 0)
                    for (var e = 0, t = this._soundInstances; e < t.length; e++) {
                        var i = t[e];
                        i.paused = !0
                    }
            }, t.prototype.resume = function() {
                if (this._soundInstances.length > 0)
                    for (var e = 0, t = this._soundInstances; e < t.length; e++) {
                        var i = t[e];
                        i.paused = !1
                    }
            }, Object.defineProperty(t.prototype, "position", {
                get: function() {
                    return this._soundInstances.length > 0 ? this._soundInstances[this._soundInstances.length - 1].position : 0
                },
                set: function(e) {
                    if (this._position = e, this._soundInstances.length > 0)
                        for (var t = 0, i = this._soundInstances; t < i.length; t++) {
                            var r = i[t];
                            r.position = this._position
                        }
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(t.prototype, "spriteId", {
                get: function() {
                    return this._spriteId
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(t.prototype, "volume", {
                get: function() {
                    return this._volume
                },
                set: function(e) {
                    if (this._volume = e, this._soundInstances.length > 0)
                        for (var t = 0, i = this._soundInstances; t < i.length; t++) {
                            var r = i[t];
                            r.volume = this.volume
                        }
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(t.prototype, "pan", {
                get: function() {
                    return this._pan
                },
                set: function(e) {
                    if (this._pan = e, this._soundInstances.length > 0)
                        for (var t = 0, i = this._soundInstances; t < i.length; t++) {
                            var r = i[t];
                            r.pan = this.pan
                        }
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(t.prototype, "loop", {
                get: function() {
                    return this._soundInstances.length > 0 ? this._soundInstances[this._soundInstances.length - 1].loop : this._loop
                },
                set: function(e) {
                    if (this._loop = e, this._soundInstances.length > 0)
                        for (var t = 0, i = this._soundInstances; t < i.length; t++) {
                            var r = i[t];
                            r.loop = this.loop
                        }
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(t.prototype, "duration", {
                get: function() {
                    return this._duration
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(t.prototype, "overlap", {
                get: function() {
                    return this._overlap
                },
                enumerable: !0,
                configurable: !0
            }), t
        }), define("game/components/createJsAudioPlayer/SoundSpriteList", ["game/components/createJsAudioPlayer/soundjs"], function(e) {
            function t(e, t, i, r) {
                var n = this;
                void 0 === i && (i = "sequential"), void 0 === r && (r = !1), this._volume = 1, this._pan = 0, this._loop = 0, this._soundInstances = [], this._position = 0, this._overlap = !1, this._currentIndex = -1, this.onSoundLoop = function(e) {}, this.onSoundComplete = function(e) {
                    var t = n._soundInstances.indexOf(e.target);
                    t > -1 && n._soundInstances.splice(t, 1)
                }, this._spriteId = e, this._soundSpriteDefs = t, this._type = i, this._overlap = r
            }
            return this && this.__extends || function(e, t) {
                function i() {
                    this.constructor = e
                }
                for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]);
                e.prototype = null === t ? Object.create(t) : (i.prototype = t.prototype, new i)
            }, t.prototype.updateIndex = function() {
                if ("sequential" === this._type || this._soundSpriteDefs.length <= 1) ++this._currentIndex >= this._soundSpriteDefs.length && (this._currentIndex = 0);
                else {
                    for (var e = this._currentIndex; e === this._currentIndex;) e = Math.floor(Math.random() * this._soundSpriteDefs.length);
                    this._currentIndex = e
                }
            }, t.prototype.resetIndex = function() {
                this._currentIndex = -1
            }, t.prototype.play = function() {
                this.updateIndex();
                var t = this._soundSpriteDefs[this._currentIndex];
                if (this._soundInstances.length <= 0 || this._overlap) {
                    var i = e.Sound.play(t.soundId, {
                        interrupt: e.Sound.INTERRUPT_NONE,
                        loop: this.loop,
                        volume: this._volume,
                        pan: this._pan,
                        startTime: t.startTime,
                        duration: t.duration
                    });
                    i.position = this._position, this._soundInstances.push(i), i.addEventListener("loop", this.onSoundLoop), i.addEventListener("complete", this.onSoundComplete)
                } else
                    for (var r = 0, n = this._soundInstances; r < n.length; r++) {
                        var o = n[r];
                        o.play()
                    }
            }, t.prototype.stop = function() {
                if (this._soundInstances.length > 0)
                    for (; this._soundInstances.length > 0;) {
                        var e = this._soundInstances.pop();
                        e.stop()
                    }
            }, t.prototype.pause = function() {
                if (this._soundInstances.length > 0)
                    for (var e = 0, t = this._soundInstances; e < t.length; e++) {
                        var i = t[e];
                        i.paused = !0
                    }
            }, t.prototype.resume = function() {
                if (this._soundInstances.length > 0)
                    for (var e = 0, t = this._soundInstances; e < t.length; e++) {
                        var i = t[e];
                        i.paused = !1
                    }
            }, Object.defineProperty(t.prototype, "position", {
                get: function() {
                    return this._soundInstances.length > 0 ? this._soundInstances[this._soundInstances.length - 1].position : 0
                },
                set: function(e) {
                    if (this._position = e, this._soundInstances.length > 0)
                        for (var t = 0, i = this._soundInstances; t < i.length; t++) {
                            var r = i[t];
                            r.position = this._position
                        }
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(t.prototype, "spriteId", {
                get: function() {
                    return this._spriteId
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(t.prototype, "volume", {
                get: function() {
                    return this._volume
                },
                set: function(e) {
                    if (this._volume = e, this._soundInstances.length > 0)
                        for (var t = 0, i = this._soundInstances; t < i.length; t++) {
                            var r = i[t];
                            r.volume = this.volume
                        }
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(t.prototype, "pan", {
                get: function() {
                    return this._pan
                },
                set: function(e) {
                    if (this._pan = e, this._soundInstances.length > 0)
                        for (var t = 0, i = this._soundInstances; t < i.length; t++) {
                            var r = i[t];
                            r.pan = this.pan
                        }
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(t.prototype, "loop", {
                get: function() {
                    return this._soundInstances.length > 0 ? this._soundInstances[this._soundInstances.length - 1].loop : this._loop
                },
                set: function(e) {
                    if (this._loop = e, this._soundInstances.length > 0)
                        for (var t = 0, i = this._soundInstances; t < i.length; t++) {
                            var r = i[t];
                            r.loop = this.loop
                        }
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(t.prototype, "overlap", {
                get: function() {
                    return this._overlap
                },
                enumerable: !0,
                configurable: !0
            }), t
        });
    var e = "undefined" != typeof module && module.exports && "undefined" != typeof global ? global : this || window;
    (e._gsQueue || (e._gsQueue = [])).push(function() {
            "use strict";
            e._gsDefine("TweenMax", ["core.Animation", "core.SimpleTimeline", "TweenLite"], function(e, t, i) {
                    var r = function(e) {
                            var t, i = [],
                                r = e.length;
                            for (t = 0; t !== r; i.push(e[t++]));
                            return i
                        },
                        n = function(e, t, i) {
                            var r, n, o = e.cycle;
                            for (r in o) n = o[r], e[r] = "function" == typeof n ? n(i, t[i]) : n[i % n.length];
                            delete e.cycle
                        },
                        o = function(e, t, r) {
                            i.call(this, e, t, r), this._cycle = 0, this._yoyo = !0 === this.vars.yoyo || !!this.vars.yoyoEase, this._repeat = this.vars.repeat || 0, this._repeatDelay = this.vars.repeatDelay || 0, this._dirty = !0, this.render = o.prototype.render
                        },
                        s = i._internals,
                        a = s.isSelector,
                        l = s.isArray,
                        u = o.prototype = i.to({}, .1, {}),
                        c = [];
                    o.version = "1.20.1", u.constructor = o, u.kill()._gc = !1, o.killTweensOf = o.killDelayedCallsTo = i.killTweensOf, o.getTweensOf = i.getTweensOf, o.lagSmoothing = i.lagSmoothing, o.ticker = i.ticker, o.render = i.render, u.invalidate = function() {
                        return this._yoyo = !0 === this.vars.yoyo || !!this.vars.yoyoEase, this._repeat = this.vars.repeat || 0, this._repeatDelay = this.vars.repeatDelay || 0, this._yoyoEase = null, this._uncache(!0), i.prototype.invalidate.call(this)
                    }, u.updateTo = function(e, t) {
                        var r, n = this.ratio,
                            o = this.vars.immediateRender || e.immediateRender;
                        t && this._startTime < this._timeline._time && (this._startTime = this._timeline._time, this._uncache(!1), this._gc ? this._enabled(!0, !1) : this._timeline.insert(this, this._startTime - this._delay));
                        for (r in e) this.vars[r] = e[r];
                        if (this._initted || o)
                            if (t) this._initted = !1, o && this.render(0, !0, !0);
                            else if (this._gc && this._enabled(!0, !1), this._notifyPluginsOfEnabled && this._firstPT && i._onPluginEvent("_onDisable", this), this._time / this._duration > .998) {
                            var s = this._totalTime;
                            this.render(0, !0, !1), this._initted = !1, this.render(s, !0, !1)
                        } else if (this._initted = !1, this._init(), this._time > 0 || o)
                            for (var a, l = 1 / (1 - n), u = this._firstPT; u;) a = u.s + u.c, u.c *= l, u.s = a - u.c, u = u._next;
                        return this
                    }, u.render = function(e, t, r) {
                        this._initted || 0 === this._duration && this.vars.repeat && this.invalidate();
                        var n, o, a, l, u, c, h, d, p, f = this._dirty ? this.totalDuration() : this._totalDuration,
                            _ = this._time,
                            m = this._totalTime,
                            g = this._cycle,
                            v = this._duration,
                            y = this._rawPrevTime;
                        if (e >= f - 1e-7 && e >= 0 ? (this._totalTime = f, this._cycle = this._repeat, this._yoyo && 0 != (1 & this._cycle) ? (this._time = 0, this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0) : (this._time = v, this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1), this._reversed || (n = !0, o = "onComplete", r = r || this._timeline.autoRemoveChildren), 0 === v && (this._initted || !this.vars.lazy || r) && (this._startTime === this._timeline._duration && (e = 0), (y < 0 || e <= 0 && e >= -1e-7 || 1e-10 === y && "isPause" !== this.data) && y !== e && (r = !0, y > 1e-10 && (o = "onReverseComplete")), this._rawPrevTime = d = !t || e || y === e ? e : 1e-10)) : e < 1e-7 ? (this._totalTime = this._time = this._cycle = 0, this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0, (0 !== m || 0 === v && y > 0) && (o = "onReverseComplete", n = this._reversed), e < 0 && (this._active = !1, 0 === v && (this._initted || !this.vars.lazy || r) && (y >= 0 && (r = !0), this._rawPrevTime = d = !t || e || y === e ? e : 1e-10)), this._initted || (r = !0)) : (this._totalTime = this._time = e, 0 !== this._repeat && (l = v + this._repeatDelay, this._cycle = this._totalTime / l >> 0, 0 !== this._cycle && this._cycle === this._totalTime / l && m <= e && this._cycle--, this._time = this._totalTime - this._cycle * l, this._yoyo && 0 != (1 & this._cycle) && (this._time = v - this._time, (p = this._yoyoEase || this.vars.yoyoEase) && (this._yoyoEase || (!0 !== p || this._initted ? this._yoyoEase = p = !0 === p ? this._ease : p instanceof Ease ? p : Ease.map[p] : (p = this.vars.ease, this._yoyoEase = p = p ? p instanceof Ease ? p : "function" == typeof p ? new Ease(p, this.vars.easeParams) : Ease.map[p] || i.defaultEase : i.defaultEase)), this.ratio = p ? 1 - p.getRatio((v - this._time) / v) : 0)), this._time > v ? this._time = v : this._time < 0 && (this._time = 0)), this._easeType && !p ? (u = this._time / v, c = this._easeType, h = this._easePower, (1 === c || 3 === c && u >= .5) && (u = 1 - u), 3 === c && (u *= 2), 1 === h ? u *= u : 2 === h ? u *= u * u : 3 === h ? u *= u * u * u : 4 === h && (u *= u * u * u * u), 1 === c ? this.ratio = 1 - u : 2 === c ? this.ratio = u : this._time / v < .5 ? this.ratio = u / 2 : this.ratio = 1 - u / 2) : p || (this.ratio = this._ease.getRatio(this._time / v))), _ === this._time && !r && g === this._cycle) return void(m !== this._totalTime && this._onUpdate && (t || this._callback("onUpdate")));
                        if (!this._initted) {
                            if (this._init(), !this._initted || this._gc) return;
                            if (!r && this._firstPT && (!1 !== this.vars.lazy && this._duration || this.vars.lazy && !this._duration)) return this._time = _, this._totalTime = m, this._rawPrevTime = y, this._cycle = g, s.lazyTweens.push(this), void(this._lazy = [e, t]);
                            !this._time || n || p ? n && this._ease._calcEnd && !p && (this.ratio = this._ease.getRatio(0 === this._time ? 0 : 1)) : this.ratio = this._ease.getRatio(this._time / v)
                        }
                        for (!1 !== this._lazy && (this._lazy = !1), this._active || !this._paused && this._time !== _ && e >= 0 && (this._active = !0), 0 === m && (2 === this._initted && e > 0 && this._init(), this._startAt && (e >= 0 ? this._startAt.render(e, t, r) : o || (o = "_dummyGS")), this.vars.onStart && (0 === this._totalTime && 0 !== v || t || this._callback("onStart"))), a = this._firstPT; a;) a.f ? a.t[a.p](a.c * this.ratio + a.s) : a.t[a.p] = a.c * this.ratio + a.s, a = a._next;
                        this._onUpdate && (e < 0 && this._startAt && this._startTime && this._startAt.render(e, t, r), t || (this._totalTime !== m || o) && this._callback("onUpdate")), this._cycle !== g && (t || this._gc || this.vars.onRepeat && this._callback("onRepeat")), o && (this._gc && !r || (e < 0 && this._startAt && !this._onUpdate && this._startTime && this._startAt.render(e, t, r), n && (this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[o] && this._callback(o), 0 === v && 1e-10 === this._rawPrevTime && 1e-10 !== d && (this._rawPrevTime = 0)))
                    }, o.to = function(e, t, i) {
                        return new o(e, t, i)
                    }, o.from = function(e, t, i) {
                        return i.runBackwards = !0, i.immediateRender = 0 != i.immediateRender, new o(e, t, i)
                    }, o.fromTo = function(e, t, i, r) {
                        return r.startAt = i, r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender, new o(e, t, r)
                    }, o.staggerTo = o.allTo = function(e, t, s, u, h, d, p) {
                        u = u || 0;
                        var f, _, m, g, v = 0,
                            y = [],
                            b = function() {
                                s.onComplete && s.onComplete.apply(s.onCompleteScope || this, arguments), h.apply(p || s.callbackScope || this, d || c)
                            },
                            x = s.cycle,
                            T = s.startAt && s.startAt.cycle;
                        for (l(e) || ("string" == typeof e && (e = i.selector(e) || e), a(e) && (e = r(e))), e = e || [], u < 0 && (e = r(e), e.reverse(), u *= -1), f = e.length - 1, m = 0; m <= f; m++) {
                            _ = {};
                            for (g in s) _[g] = s[g];
                            if (x && (n(_, e, m), null != _.duration && (t = _.duration, delete _.duration)), T) {
                                T = _.startAt = {};
                                for (g in s.startAt) T[g] = s.startAt[g];
                                n(_.startAt, e, m)
                            }
                            _.delay = v + (_.delay || 0), m === f && h && (_.onComplete = b), y[m] = new o(e[m], t, _), v += u
                        }
                        return y
                    }, o.staggerFrom = o.allFrom = function(e, t, i, r, n, s, a) {
                        return i.runBackwards = !0, i.immediateRender = 0 != i.immediateRender, o.staggerTo(e, t, i, r, n, s, a)
                    }, o.staggerFromTo = o.allFromTo = function(e, t, i, r, n, s, a, l) {
                        return r.startAt = i, r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender, o.staggerTo(e, t, r, n, s, a, l)
                    }, o.delayedCall = function(e, t, i, r, n) {
                        return new o(t, 0, {
                            delay: e,
                            onComplete: t,
                            onCompleteParams: i,
                            callbackScope: r,
                            onReverseComplete: t,
                            onReverseCompleteParams: i,
                            immediateRender: !1,
                            useFrames: n,
                            overwrite: 0
                        })
                    }, o.set = function(e, t) {
                        return new o(e, 0, t)
                    }, o.isTweening = function(e) {
                        return i.getTweensOf(e, !0).length > 0
                    };
                    var h = function(e, t) {
                            for (var r = [], n = 0, o = e._first; o;) o instanceof i ? r[n++] = o : (t && (r[n++] = o), r = r.concat(h(o, t)), n = r.length), o = o._next;
                            return r
                        },
                        d = o.getAllTweens = function(t) {
                            return h(e._rootTimeline, t).concat(h(e._rootFramesTimeline, t))
                        };
                    o.killAll = function(e, i, r, n) {
                        null == i && (i = !0), null == r && (r = !0);
                        var o, s, a, l = d(0 != n),
                            u = l.length,
                            c = i && r && n;
                        for (a = 0; a < u; a++) s = l[a], (c || s instanceof t || (o = s.target === s.vars.onComplete) && r || i && !o) && (e ? s.totalTime(s._reversed ? 0 : s.totalDuration()) : s._enabled(!1, !1))
                    }, o.killChildTweensOf = function(e, t) {
                        if (null != e) {
                            var n, u, c, h, d, p = s.tweenLookup;
                            if ("string" == typeof e && (e = i.selector(e) || e), a(e) && (e = r(e)), l(e))
                                for (h = e.length; --h > -1;) o.killChildTweensOf(e[h], t);
                            else {
                                n = [];
                                for (c in p)
                                    for (u = p[c].target.parentNode; u;) u === e && (n = n.concat(p[c].tweens)), u = u.parentNode;
                                for (d = n.length, h = 0; h < d; h++) t && n[h].totalTime(n[h].totalDuration()), n[h]._enabled(!1, !1)
                            }
                        }
                    };
                    var p = function(e, i, r, n) {
                        i = !1 !== i, r = !1 !== r, n = !1 !== n;
                        for (var o, s, a = d(n), l = i && r && n, u = a.length; --u > -1;) s = a[u], (l || s instanceof t || (o = s.target === s.vars.onComplete) && r || i && !o) && s.paused(e)
                    };
                    return o.pauseAll = function(e, t, i) {
                        p(!0, e, t, i)
                    }, o.resumeAll = function(e, t, i) {
                        p(!1, e, t, i)
                    }, o.globalTimeScale = function(t) {
                        var r = e._rootTimeline,
                            n = i.ticker.time;
                        return arguments.length ? (t = t || 1e-10, r._startTime = n - (n - r._startTime) * r._timeScale / t, r = e._rootFramesTimeline, n = i.ticker.frame, r._startTime = n - (n - r._startTime) * r._timeScale / t, r._timeScale = e._rootTimeline._timeScale = t, t) : r._timeScale
                    }, u.progress = function(e, t) {
                        return arguments.length ? this.totalTime(this.duration() * (this._yoyo && 0 != (1 & this._cycle) ? 1 - e : e) + this._cycle * (this._duration + this._repeatDelay), t) : this._time / this.duration()
                    }, u.totalProgress = function(e, t) {
                        return arguments.length ? this.totalTime(this.totalDuration() * e, t) : this._totalTime / this.totalDuration()
                    }, u.time = function(e, t) {
                        return arguments.length ? (this._dirty && this.totalDuration(), e > this._duration && (e = this._duration), this._yoyo && 0 != (1 & this._cycle) ? e = this._duration - e + this._cycle * (this._duration + this._repeatDelay) : 0 !== this._repeat && (e += this._cycle * (this._duration + this._repeatDelay)), this.totalTime(e, t)) : this._time
                    }, u.duration = function(t) {
                        return arguments.length ? e.prototype.duration.call(this, t) : this._duration
                    }, u.totalDuration = function(e) {
                        return arguments.length ? -1 === this._repeat ? this : this.duration((e - this._repeat * this._repeatDelay) / (this._repeat + 1)) : (this._dirty && (this._totalDuration = -1 === this._repeat ? 999999999999 : this._duration * (this._repeat + 1) + this._repeatDelay * this._repeat, this._dirty = !1), this._totalDuration)
                    }, u.repeat = function(e) {
                        return arguments.length ? (this._repeat = e, this._uncache(!0)) : this._repeat
                    }, u.repeatDelay = function(e) {
                        return arguments.length ? (this._repeatDelay = e, this._uncache(!0)) : this._repeatDelay
                    }, u.yoyo = function(e) {
                        return arguments.length ? (this._yoyo = e, this) : this._yoyo
                    }, o
                }, !0), e._gsDefine("TimelineLite", ["core.Animation", "core.SimpleTimeline", "TweenLite"], function(t, i, r) {
                    var n = function(e) {
                            i.call(this, e), this._labels = {}, this.autoRemoveChildren = !0 === this.vars.autoRemoveChildren, this.smoothChildTiming = !0 === this.vars.smoothChildTiming, this._sortChildren = !0, this._onUpdate = this.vars.onUpdate;
                            var t, r, n = this.vars;
                            for (r in n) t = n[r], l(t) && -1 !== t.join("").indexOf("{self}") && (n[r] = this._swapSelfInParams(t));
                            l(n.tweens) && this.add(n.tweens, 0, n.align, n.stagger)
                        },
                        o = r._internals,
                        s = n._internals = {},
                        a = o.isSelector,
                        l = o.isArray,
                        u = o.lazyTweens,
                        c = o.lazyRender,
                        h = e._gsDefine.globals,
                        d = function(e) {
                            var t, i = {};
                            for (t in e) i[t] = e[t];
                            return i
                        },
                        p = function(e, t, i) {
                            var r, n, o = e.cycle;
                            for (r in o) n = o[r], e[r] = "function" == typeof n ? n(i, t[i]) : n[i % n.length];
                            delete e.cycle
                        },
                        f = s.pauseCallback = function() {},
                        _ = function(e) {
                            var t, i = [],
                                r = e.length;
                            for (t = 0; t !== r; i.push(e[t++]));
                            return i
                        },
                        m = n.prototype = new i;
                    return n.version = "1.20.1", m.constructor = n, m.kill()._gc = m._forcingPlayhead = m._hasPause = !1, m.to = function(e, t, i, n) {
                        var o = i.repeat && h.TweenMax || r;
                        return t ? this.add(new o(e, t, i), n) : this.set(e, i, n)
                    }, m.from = function(e, t, i, n) {
                        return this.add((i.repeat && h.TweenMax || r).from(e, t, i), n)
                    }, m.fromTo = function(e, t, i, n, o) {
                        var s = n.repeat && h.TweenMax || r;
                        return t ? this.add(s.fromTo(e, t, i, n), o) : this.set(e, n, o)
                    }, m.staggerTo = function(e, t, i, o, s, l, u, c) {
                        var h, f, m = new n({
                                onComplete: l,
                                onCompleteParams: u,
                                callbackScope: c,
                                smoothChildTiming: this.smoothChildTiming
                            }),
                            g = i.cycle;
                        for ("string" == typeof e && (e = r.selector(e) || e), e = e || [], a(e) && (e = _(e)), o = o || 0, o < 0 && (e = _(e), e.reverse(), o *= -1), f = 0; f < e.length; f++) h = d(i), h.startAt && (h.startAt = d(h.startAt), h.startAt.cycle && p(h.startAt, e, f)), g && (p(h, e, f), null != h.duration && (t = h.duration, delete h.duration)), m.to(e[f], t, h, f * o);
                        return this.add(m, s)
                    }, m.staggerFrom = function(e, t, i, r, n, o, s, a) {
                        return i.immediateRender = 0 != i.immediateRender, i.runBackwards = !0, this.staggerTo(e, t, i, r, n, o, s, a)
                    }, m.staggerFromTo = function(e, t, i, r, n, o, s, a, l) {
                        return r.startAt = i, r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender, this.staggerTo(e, t, r, n, o, s, a, l)
                    }, m.call = function(e, t, i, n) {
                        return this.add(r.delayedCall(0, e, t, i), n)
                    }, m.set = function(e, t, i) {
                        return i = this._parseTimeOrLabel(i, 0, !0), null == t.immediateRender && (t.immediateRender = i === this._time && !this._paused), this.add(new r(e, 0, t), i)
                    }, n.exportRoot = function(e, t) {
                        e = e || {}, null == e.smoothChildTiming && (e.smoothChildTiming = !0);
                        var i, o, s = new n(e),
                            a = s._timeline;
                        for (null == t && (t = !0), a._remove(s, !0), s._startTime = 0, s._rawPrevTime = s._time = s._totalTime = a._time, i = a._first; i;) o = i._next, t && i instanceof r && i.target === i.vars.onComplete || s.add(i, i._startTime - i._delay), i = o;
                        return a.add(s, 0), s
                    }, m.add = function(e, o, s, a) {
                        var u, c, h, d, p, f;
                        if ("number" != typeof o && (o = this._parseTimeOrLabel(o, 0, !0, e)), !(e instanceof t)) {
                            if (e instanceof Array || e && e.push && l(e)) {
                                for (s = s || "normal", a = a || 0, u = o, c = e.length, h = 0; h < c; h++) l(d = e[h]) && (d = new n({
                                    tweens: d
                                })), this.add(d, u), "string" != typeof d && "function" != typeof d && ("sequence" === s ? u = d._startTime + d.totalDuration() / d._timeScale : "start" === s && (d._startTime -= d.delay())), u += a;
                                return this._uncache(!0)
                            }
                            if ("string" == typeof e) return this.addLabel(e, o);
                            if ("function" != typeof e) throw "Cannot add " + e + " into the timeline; it is not a tween, timeline, function, or string.";
                            e = r.delayedCall(0, e)
                        }
                        if (i.prototype.add.call(this, e, o), e._time && e.render((this.rawTime() - e._startTime) * e._timeScale, !1, !1), (this._gc || this._time === this._duration) && !this._paused && this._duration < this.duration())
                            for (p = this, f = p.rawTime() > e._startTime; p._timeline;) f && p._timeline.smoothChildTiming ? p.totalTime(p._totalTime, !0) : p._gc && p._enabled(!0, !1), p = p._timeline;
                        return this
                    }, m.remove = function(e) {
                        if (e instanceof t) {
                            this._remove(e, !1);
                            var i = e._timeline = e.vars.useFrames ? t._rootFramesTimeline : t._rootTimeline;
                            return e._startTime = (e._paused ? e._pauseTime : i._time) - (e._reversed ? e.totalDuration() - e._totalTime : e._totalTime) / e._timeScale, this
                        }
                        if (e instanceof Array || e && e.push && l(e)) {
                            for (var r = e.length; --r > -1;) this.remove(e[r]);
                            return this
                        }
                        return "string" == typeof e ? this.removeLabel(e) : this.kill(null, e)
                    }, m._remove = function(e, t) {
                        return i.prototype._remove.call(this, e, t), this._last ? this._time > this.duration() && (this._time = this._duration, this._totalTime = this._totalDuration) : this._time = this._totalTime = this._duration = this._totalDuration = 0, this
                    }, m.append = function(e, t) {
                        return this.add(e, this._parseTimeOrLabel(null, t, !0, e))
                    }, m.insert = m.insertMultiple = function(e, t, i, r) {
                        return this.add(e, t || 0, i, r)
                    }, m.appendMultiple = function(e, t, i, r) {
                        return this.add(e, this._parseTimeOrLabel(null, t, !0, e), i, r)
                    }, m.addLabel = function(e, t) {
                        return this._labels[e] = this._parseTimeOrLabel(t), this
                    }, m.addPause = function(e, t, i, n) {
                        var o = r.delayedCall(0, f, i, n || this);
                        return o.vars.onComplete = o.vars.onReverseComplete = t, o.data = "isPause", this._hasPause = !0, this.add(o, e)
                    }, m.removeLabel = function(e) {
                        return delete this._labels[e], this
                    }, m.getLabelTime = function(e) {
                        return null != this._labels[e] ? this._labels[e] : -1
                    }, m._parseTimeOrLabel = function(e, i, r, n) {
                        var o, s;
                        if (n instanceof t && n.timeline === this) this.remove(n);
                        else if (n && (n instanceof Array || n.push && l(n)))
                            for (s = n.length; --s > -1;) n[s] instanceof t && n[s].timeline === this && this.remove(n[s]);
                        if (o = this.duration() > 99999999999 ? this.recent().endTime(!1) : this._duration, "string" == typeof i) return this._parseTimeOrLabel(i, r && "number" == typeof e && null == this._labels[i] ? e - o : 0, r);
                        if (i = i || 0, "string" != typeof e || !isNaN(e) && null == this._labels[e]) null == e && (e = o);
                        else {
                            if (-1 === (s = e.indexOf("="))) return null == this._labels[e] ? r ? this._labels[e] = o + i : i : this._labels[e] + i;
                            i = parseInt(e.charAt(s - 1) + "1", 10) * Number(e.substr(s + 1)), e = s > 1 ? this._parseTimeOrLabel(e.substr(0, s - 1), 0, r) : o
                        }
                        return Number(e) + i
                    }, m.seek = function(e, t) {
                        return this.totalTime("number" == typeof e ? e : this._parseTimeOrLabel(e), !1 !== t)
                    }, m.stop = function() {
                        return this.paused(!0)
                    }, m.gotoAndPlay = function(e, t) {
                        return this.play(e, t)
                    }, m.gotoAndStop = function(e, t) {
                        return this.pause(e, t)
                    }, m.render = function(e, t, i) {
                        this._gc && this._enabled(!0, !1);
                        var r, n, o, s, a, l, h, d = this._dirty ? this.totalDuration() : this._totalDuration,
                            p = this._time,
                            f = this._startTime,
                            _ = this._timeScale,
                            m = this._paused;
                        if (e >= d - 1e-7 && e >= 0) this._totalTime = this._time = d, this._reversed || this._hasPausedChild() || (n = !0, s = "onComplete", a = !!this._timeline.autoRemoveChildren, 0 === this._duration && (e <= 0 && e >= -1e-7 || this._rawPrevTime < 0 || 1e-10 === this._rawPrevTime) && this._rawPrevTime !== e && this._first && (a = !0, this._rawPrevTime > 1e-10 && (s = "onReverseComplete"))), this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : 1e-10, e = d + 1e-4;
                        else if (e < 1e-7)
                            if (this._totalTime = this._time = 0, (0 !== p || 0 === this._duration && 1e-10 !== this._rawPrevTime && (this._rawPrevTime > 0 || e < 0 && this._rawPrevTime >= 0)) && (s = "onReverseComplete", n = this._reversed), e < 0) this._active = !1, this._timeline.autoRemoveChildren && this._reversed ? (a = n = !0, s = "onReverseComplete") : this._rawPrevTime >= 0 && this._first && (a = !0), this._rawPrevTime = e;
                            else {
                                if (this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : 1e-10, 0 === e && n)
                                    for (r = this._first; r && 0 === r._startTime;) r._duration || (n = !1), r = r._next;
                                e = 0, this._initted || (a = !0)
                            }
                        else {
                            if (this._hasPause && !this._forcingPlayhead && !t) {
                                if (e >= p)
                                    for (r = this._first; r && r._startTime <= e && !l;) r._duration || "isPause" !== r.data || r.ratio || 0 === r._startTime && 0 === this._rawPrevTime || (l = r), r = r._next;
                                else
                                    for (r = this._last; r && r._startTime >= e && !l;) r._duration || "isPause" === r.data && r._rawPrevTime > 0 && (l = r), r = r._prev;
                                l && (this._time = e = l._startTime, this._totalTime = e + this._cycle * (this._totalDuration + this._repeatDelay))
                            }
                            this._totalTime = this._time = this._rawPrevTime = e
                        }
                        if (this._time !== p && this._first || i || a || l) {
                            if (this._initted || (this._initted = !0), this._active || !this._paused && this._time !== p && e > 0 && (this._active = !0), 0 === p && this.vars.onStart && (0 === this._time && this._duration || t || this._callback("onStart")), (h = this._time) >= p)
                                for (r = this._first; r && (o = r._next, h === this._time && (!this._paused || m));)(r._active || r._startTime <= h && !r._paused && !r._gc) && (l === r && this.pause(), r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, i) : r.render((e - r._startTime) * r._timeScale, t, i)), r = o;
                            else
                                for (r = this._last; r && (o = r._prev, h === this._time && (!this._paused || m));) {
                                    if (r._active || r._startTime <= p && !r._paused && !r._gc) {
                                        if (l === r) {
                                            for (l = r._prev; l && l.endTime() > this._time;) l.render(l._reversed ? l.totalDuration() - (e - l._startTime) * l._timeScale : (e - l._startTime) * l._timeScale, t, i), l = l._prev;
                                            l = null, this.pause()
                                        }
                                        r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, i) : r.render((e - r._startTime) * r._timeScale, t, i)
                                    }
                                    r = o
                                }
                            this._onUpdate && (t || (u.length && c(), this._callback("onUpdate"))), s && (this._gc || f !== this._startTime && _ === this._timeScale || (0 === this._time || d >= this.totalDuration()) && (n && (u.length && c(), this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[s] && this._callback(s)))
                        }
                    }, m._hasPausedChild = function() {
                        for (var e = this._first; e;) {
                            if (e._paused || e instanceof n && e._hasPausedChild()) return !0;
                            e = e._next
                        }
                        return !1
                    }, m.getChildren = function(e, t, i, n) {
                        n = n || -9999999999;
                        for (var o = [], s = this._first, a = 0; s;) s._startTime < n || (s instanceof r ? !1 !== t && (o[a++] = s) : (!1 !== i && (o[a++] = s), !1 !== e && (o = o.concat(s.getChildren(!0, t, i)), a = o.length))), s = s._next;
                        return o
                    }, m.getTweensOf = function(e, t) {
                        var i, n, o = this._gc,
                            s = [],
                            a = 0;
                        for (o && this._enabled(!0, !0), i = r.getTweensOf(e), n = i.length; --n > -1;)(i[n].timeline === this || t && this._contains(i[n])) && (s[a++] = i[n]);
                        return o && this._enabled(!1, !0), s
                    }, m.recent = function() {
                        return this._recent
                    }, m._contains = function(e) {
                        for (var t = e.timeline; t;) {
                            if (t === this) return !0;
                            t = t.timeline
                        }
                        return !1
                    }, m.shiftChildren = function(e, t, i) {
                        i = i || 0;
                        for (var r, n = this._first, o = this._labels; n;) n._startTime >= i && (n._startTime += e), n = n._next;
                        if (t)
                            for (r in o) o[r] >= i && (o[r] += e);
                        return this._uncache(!0)
                    }, m._kill = function(e, t) {
                        if (!e && !t) return this._enabled(!1, !1);
                        for (var i = t ? this.getTweensOf(t) : this.getChildren(!0, !0, !1), r = i.length, n = !1; --r > -1;) i[r]._kill(e, t) && (n = !0);
                        return n
                    }, m.clear = function(e) {
                        var t = this.getChildren(!1, !0, !0),
                            i = t.length;
                        for (this._time = this._totalTime = 0; --i > -1;) t[i]._enabled(!1, !1);
                        return !1 !== e && (this._labels = {}), this._uncache(!0)
                    }, m.invalidate = function() {
                        for (var e = this._first; e;) e.invalidate(), e = e._next;
                        return t.prototype.invalidate.call(this)
                    }, m._enabled = function(e, t) {
                        if (e === this._gc)
                            for (var r = this._first; r;) r._enabled(e, !0), r = r._next;
                        return i.prototype._enabled.call(this, e, t)
                    }, m.totalTime = function(e, i, r) {
                        this._forcingPlayhead = !0;
                        var n = t.prototype.totalTime.apply(this, arguments);
                        return this._forcingPlayhead = !1, n
                    }, m.duration = function(e) {
                        return arguments.length ? (0 !== this.duration() && 0 !== e && this.timeScale(this._duration / e), this) : (this._dirty && this.totalDuration(), this._duration)
                    }, m.totalDuration = function(e) {
                        if (!arguments.length) {
                            if (this._dirty) {
                                for (var t, i, r = 0, n = this._last, o = 999999999999; n;) t = n._prev, n._dirty && n.totalDuration(), n._startTime > o && this._sortChildren && !n._paused ? this.add(n, n._startTime - n._delay) : o = n._startTime, n._startTime < 0 && !n._paused && (r -= n._startTime, this._timeline.smoothChildTiming && (this._startTime += n._startTime / this._timeScale), this.shiftChildren(-n._startTime, !1, -9999999999), o = 0), i = n._startTime + n._totalDuration / n._timeScale, i > r && (r = i), n = t;
                                this._duration = this._totalDuration = r, this._dirty = !1
                            }
                            return this._totalDuration
                        }
                        return e && this.totalDuration() ? this.timeScale(this._totalDuration / e) : this
                    }, m.paused = function(e) {
                        if (!e)
                            for (var i = this._first, r = this._time; i;) i._startTime === r && "isPause" === i.data && (i._rawPrevTime = 0), i = i._next;
                        return t.prototype.paused.apply(this, arguments)
                    }, m.usesFrames = function() {
                        for (var e = this._timeline; e._timeline;) e = e._timeline;
                        return e === t._rootFramesTimeline
                    }, m.rawTime = function(e) {
                        return e && (this._paused || this._repeat && this.time() > 0 && this.totalProgress() < 1) ? this._totalTime % (this._duration + this._repeatDelay) : this._paused ? this._totalTime : (this._timeline.rawTime(e) - this._startTime) * this._timeScale
                    }, n
                }, !0), e._gsDefine("TimelineMax", ["TimelineLite", "TweenLite", "easing.Ease"], function(t, i, r) {
                    var n = function(e) {
                            t.call(this, e), this._repeat = this.vars.repeat || 0, this._repeatDelay = this.vars.repeatDelay || 0, this._cycle = 0, this._yoyo = !0 === this.vars.yoyo, this._dirty = !0
                        },
                        o = i._internals,
                        s = o.lazyTweens,
                        a = o.lazyRender,
                        l = e._gsDefine.globals,
                        u = new r(null, null, 1, 0),
                        c = n.prototype = new t;
                    return c.constructor = n, c.kill()._gc = !1, n.version = "1.20.1", c.invalidate = function() {
                        return this._yoyo = !0 === this.vars.yoyo, this._repeat = this.vars.repeat || 0, this._repeatDelay = this.vars.repeatDelay || 0, this._uncache(!0), t.prototype.invalidate.call(this)
                    }, c.addCallback = function(e, t, r, n) {
                        return this.add(i.delayedCall(0, e, r, n), t)
                    }, c.removeCallback = function(e, t) {
                        if (e)
                            if (null == t) this._kill(null, e);
                            else
                                for (var i = this.getTweensOf(e, !1), r = i.length, n = this._parseTimeOrLabel(t); --r > -1;) i[r]._startTime === n && i[r]._enabled(!1, !1);
                        return this
                    }, c.removePause = function(e) {
                        return this.removeCallback(t._internals.pauseCallback, e)
                    }, c.tweenTo = function(e, t) {
                        t = t || {};
                        var r, n, o, s = {
                                ease: u,
                                useFrames: this.usesFrames(),
                                immediateRender: !1
                            },
                            a = t.repeat && l.TweenMax || i;
                        for (n in t) s[n] = t[n];
                        return s.time = this._parseTimeOrLabel(e), r = Math.abs(Number(s.time) - this._time) / this._timeScale || .001, o = new a(this, r, s), s.onStart = function() {
                            o.target.paused(!0), o.vars.time !== o.target.time() && r === o.duration() && o.duration(Math.abs(o.vars.time - o.target.time()) / o.target._timeScale), t.onStart && t.onStart.apply(t.onStartScope || t.callbackScope || o, t.onStartParams || [])
                        }, o
                    }, c.tweenFromTo = function(e, t, i) {
                        i = i || {}, e = this._parseTimeOrLabel(e), i.startAt = {
                            onComplete: this.seek,
                            onCompleteParams: [e],
                            callbackScope: this
                        }, i.immediateRender = !1 !== i.immediateRender;
                        var r = this.tweenTo(t, i);
                        return r.duration(Math.abs(r.vars.time - e) / this._timeScale || .001)
                    }, c.render = function(e, t, i) {
                        this._gc && this._enabled(!0, !1);
                        var r, n, o, l, u, c, h, d, p = this._dirty ? this.totalDuration() : this._totalDuration,
                            f = this._duration,
                            _ = this._time,
                            m = this._totalTime,
                            g = this._startTime,
                            v = this._timeScale,
                            y = this._rawPrevTime,
                            b = this._paused,
                            x = this._cycle;
                        if (e >= p - 1e-7 && e >= 0) this._locked || (this._totalTime = p, this._cycle = this._repeat), this._reversed || this._hasPausedChild() || (n = !0, l = "onComplete", u = !!this._timeline.autoRemoveChildren, 0 === this._duration && (e <= 0 && e >= -1e-7 || y < 0 || 1e-10 === y) && y !== e && this._first && (u = !0, y > 1e-10 && (l = "onReverseComplete"))), this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : 1e-10, this._yoyo && 0 != (1 & this._cycle) ? this._time = e = 0 : (this._time = f, e = f + 1e-4);
                        else if (e < 1e-7)
                            if (this._locked || (this._totalTime = this._cycle = 0), this._time = 0, (0 !== _ || 0 === f && 1e-10 !== y && (y > 0 || e < 0 && y >= 0) && !this._locked) && (l = "onReverseComplete", n = this._reversed), e < 0) this._active = !1, this._timeline.autoRemoveChildren && this._reversed ? (u = n = !0, l = "onReverseComplete") : y >= 0 && this._first && (u = !0), this._rawPrevTime = e;
                            else {
                                if (this._rawPrevTime = f || !t || e || this._rawPrevTime === e ? e : 1e-10, 0 === e && n)
                                    for (r = this._first; r && 0 === r._startTime;) r._duration || (n = !1), r = r._next;
                                e = 0, this._initted || (u = !0)
                            }
                        else if (0 === f && y < 0 && (u = !0), this._time = this._rawPrevTime = e, this._locked || (this._totalTime = e, 0 !== this._repeat && (c = f + this._repeatDelay, this._cycle = this._totalTime / c >> 0, 0 !== this._cycle && this._cycle === this._totalTime / c && m <= e && this._cycle--, this._time = this._totalTime - this._cycle * c, this._yoyo && 0 != (1 & this._cycle) && (this._time = f - this._time), this._time > f ? (this._time = f, e = f + 1e-4) : this._time < 0 ? this._time = e = 0 : e = this._time)), this._hasPause && !this._forcingPlayhead && !t) {
                            if ((e = this._time) >= _ || this._repeat && x !== this._cycle)
                                for (r = this._first; r && r._startTime <= e && !h;) r._duration || "isPause" !== r.data || r.ratio || 0 === r._startTime && 0 === this._rawPrevTime || (h = r), r = r._next;
                            else
                                for (r = this._last; r && r._startTime >= e && !h;) r._duration || "isPause" === r.data && r._rawPrevTime > 0 && (h = r), r = r._prev;
                            h && h._startTime < f && (this._time = e = h._startTime, this._totalTime = e + this._cycle * (this._totalDuration + this._repeatDelay))
                        }
                        if (this._cycle !== x && !this._locked) {
                            var T = this._yoyo && 0 != (1 & x),
                                E = T === (this._yoyo && 0 != (1 & this._cycle)),
                                S = this._totalTime,
                                P = this._cycle,
                                A = this._rawPrevTime,
                                C = this._time;
                            if (this._totalTime = x * f, this._cycle < x ? T = !T : this._totalTime += f, this._time = _, this._rawPrevTime = 0 === f ? y - 1e-4 : y, this._cycle = x, this._locked = !0, _ = T ? 0 : f, this.render(_, t, 0 === f), t || this._gc || this.vars.onRepeat && (this._cycle = P, this._locked = !1, this._callback("onRepeat")), _ !== this._time) return;
                            if (E && (this._cycle = x, this._locked = !0, _ = T ? f + 1e-4 : -1e-4, this.render(_, !0, !1)), this._locked = !1, this._paused && !b) return;
                            this._time = C, this._totalTime = S, this._cycle = P, this._rawPrevTime = A
                        }
                        if (!(this._time !== _ && this._first || i || u || h)) return void(m !== this._totalTime && this._onUpdate && (t || this._callback("onUpdate")));
                        if (this._initted || (this._initted = !0), this._active || !this._paused && this._totalTime !== m && e > 0 && (this._active = !0), 0 === m && this.vars.onStart && (0 === this._totalTime && this._totalDuration || t || this._callback("onStart")), (d = this._time) >= _)
                            for (r = this._first; r && (o = r._next, d === this._time && (!this._paused || b));)(r._active || r._startTime <= this._time && !r._paused && !r._gc) && (h === r && this.pause(), r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, i) : r.render((e - r._startTime) * r._timeScale, t, i)), r = o;
                        else
                            for (r = this._last; r && (o = r._prev, d === this._time && (!this._paused || b));) {
                                if (r._active || r._startTime <= _ && !r._paused && !r._gc) {
                                    if (h === r) {
                                        for (h = r._prev; h && h.endTime() > this._time;) h.render(h._reversed ? h.totalDuration() - (e - h._startTime) * h._timeScale : (e - h._startTime) * h._timeScale, t, i), h = h._prev;
                                        h = null, this.pause()
                                    }
                                    r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, i) : r.render((e - r._startTime) * r._timeScale, t, i)
                                }
                                r = o
                            }
                        this._onUpdate && (t || (s.length && a(), this._callback("onUpdate"))), l && (this._locked || this._gc || g !== this._startTime && v === this._timeScale || (0 === this._time || p >= this.totalDuration()) && (n && (s.length && a(), this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[l] && this._callback(l)))
                    }, c.getActive = function(e, t, i) {
                        null == e && (e = !0), null == t && (t = !0), null == i && (i = !1);
                        var r, n, o = [],
                            s = this.getChildren(e, t, i),
                            a = 0,
                            l = s.length;
                        for (r = 0; r < l; r++) n = s[r], n.isActive() && (o[a++] = n);
                        return o
                    }, c.getLabelAfter = function(e) {
                        e || 0 !== e && (e = this._time);
                        var t, i = this.getLabelsArray(),
                            r = i.length;
                        for (t = 0; t < r; t++)
                            if (i[t].time > e) return i[t].name;
                        return null
                    }, c.getLabelBefore = function(e) {
                        null == e && (e = this._time);
                        for (var t = this.getLabelsArray(), i = t.length; --i > -1;)
                            if (t[i].time < e) return t[i].name;
                        return null
                    }, c.getLabelsArray = function() {
                        var e, t = [],
                            i = 0;
                        for (e in this._labels) t[i++] = {
                            time: this._labels[e],
                            name: e
                        };
                        return t.sort(function(e, t) {
                            return e.time - t.time
                        }), t
                    }, c.invalidate = function() {
                        return this._locked = !1, t.prototype.invalidate.call(this)
                    }, c.progress = function(e, t) {
                        return arguments.length ? this.totalTime(this.duration() * (this._yoyo && 0 != (1 & this._cycle) ? 1 - e : e) + this._cycle * (this._duration + this._repeatDelay), t) : this._time / this.duration() || 0
                    }, c.totalProgress = function(e, t) {
                        return arguments.length ? this.totalTime(this.totalDuration() * e, t) : this._totalTime / this.totalDuration() || 0
                    }, c.totalDuration = function(e) {
                        return arguments.length ? -1 !== this._repeat && e ? this.timeScale(this.totalDuration() / e) : this : (this._dirty && (t.prototype.totalDuration.call(this), this._totalDuration = -1 === this._repeat ? 999999999999 : this._duration * (this._repeat + 1) + this._repeatDelay * this._repeat), this._totalDuration)
                    }, c.time = function(e, t) {
                        return arguments.length ? (this._dirty && this.totalDuration(), e > this._duration && (e = this._duration), this._yoyo && 0 != (1 & this._cycle) ? e = this._duration - e + this._cycle * (this._duration + this._repeatDelay) : 0 !== this._repeat && (e += this._cycle * (this._duration + this._repeatDelay)), this.totalTime(e, t)) : this._time
                    }, c.repeat = function(e) {
                        return arguments.length ? (this._repeat = e, this._uncache(!0)) : this._repeat
                    }, c.repeatDelay = function(e) {
                        return arguments.length ? (this._repeatDelay = e, this._uncache(!0)) : this._repeatDelay
                    }, c.yoyo = function(e) {
                        return arguments.length ? (this._yoyo = e, this) : this._yoyo
                    }, c.currentLabel = function(e) {
                        return arguments.length ? this.seek(e, !0) : this.getLabelBefore(this._time + 1e-8)
                    }, n
                }, !0),
                function() {
                    var t = 180 / Math.PI,
                        i = [],
                        r = [],
                        n = [],
                        o = {},
                        s = e._gsDefine.globals,
                        a = function(e, t, i, r) {
                            i === r && (i = r - (r - t) / 1e6), e === t && (t = e + (i - e) / 1e6), this.a = e, this.b = t, this.c = i, this.d = r, this.da = r - e, this.ca = i - e, this.ba = t - e
                        },
                        l = function(e, t, i, r) {
                            var n = {
                                    a: e
                                },
                                o = {},
                                s = {},
                                a = {
                                    c: r
                                },
                                l = (e + t) / 2,
                                u = (t + i) / 2,
                                c = (i + r) / 2,
                                h = (l + u) / 2,
                                d = (u + c) / 2,
                                p = (d - h) / 8;
                            return n.b = l + (e - l) / 4, o.b = h + p, n.c = o.a = (n.b + o.b) / 2, o.c = s.a = (h + d) / 2, s.b = d - p, a.b = c + (r - c) / 4, s.c = a.a = (s.b + a.b) / 2, [n, o, s, a]
                        },
                        u = function(e, t, o, s, a) {
                            var u, c, h, d, p, f, _, m, g, v, y, b, x, T = e.length - 1,
                                E = 0,
                                S = e[0].a;
                            for (u = 0; u < T; u++) p = e[E], c = p.a, h = p.d, d = e[E + 1].d, a ? (y = i[u], b = r[u], x = (b + y) * t * .25 / (s ? .5 : n[u] || .5), f = h - (h - c) * (s ? .5 * t : 0 !== y ? x / y : 0), _ = h + (d - h) * (s ? .5 * t : 0 !== b ? x / b : 0), m = h - (f + ((_ - f) * (3 * y / (y + b) + .5) / 4 || 0))) : (f = h - (h - c) * t * .5, _ = h + (d - h) * t * .5, m = h - (f + _) / 2), f += m, _ += m, p.c = g = f, p.b = 0 !== u ? S : S = p.a + .6 * (p.c - p.a), p.da = h - c, p.ca = g - c, p.ba = S - c, o ? (v = l(c, S, g, h), e.splice(E, 1, v[0], v[1], v[2], v[3]), E += 4) : E++, S = _;
                            p = e[E], p.b = S, p.c = S + .4 * (p.d - S), p.da = p.d - p.a, p.ca = p.c - p.a, p.ba = S - p.a, o && (v = l(p.a, S, p.c, p.d), e.splice(E, 1, v[0], v[1], v[2], v[3]))
                        },
                        c = function(e, t, n, o) {
                            var s, l, u, c, h, d, p = [];
                            if (o)
                                for (e = [o].concat(e), l = e.length; --l > -1;) "string" == typeof(d = e[l][t]) && "=" === d.charAt(1) && (e[l][t] = o[t] + Number(d.charAt(0) + d.substr(2)));
                            if ((s = e.length - 2) < 0) return p[0] = new a(e[0][t], 0, 0, e[0][t]), p;
                            for (l = 0; l < s; l++) u = e[l][t], c = e[l + 1][t], p[l] = new a(u, 0, 0, c), n && (h = e[l + 2][t], i[l] = (i[l] || 0) + (c - u) * (c - u), r[l] = (r[l] || 0) + (h - c) * (h - c));
                            return p[l] = new a(e[l][t], 0, 0, e[l + 1][t]), p
                        },
                        h = function(e, t, s, a, l, h) {
                            var d, p, f, _, m, g, v, y, b = {},
                                x = [],
                                T = h || e[0];
                            l = "string" == typeof l ? "," + l + "," : ",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,", null == t && (t = 1);
                            for (p in e[0]) x.push(p);
                            if (e.length > 1) {
                                for (y = e[e.length - 1], v = !0, d = x.length; --d > -1;)
                                    if (p = x[d], Math.abs(T[p] - y[p]) > .05) {
                                        v = !1;
                                        break
                                    }
                                v && (e = e.concat(), h && e.unshift(h), e.push(e[1]), h = e[e.length - 3])
                            }
                            for (i.length = r.length = n.length = 0, d = x.length; --d > -1;) p = x[d], o[p] = -1 !== l.indexOf("," + p + ","), b[p] = c(e, p, o[p], h);
                            for (d = i.length; --d > -1;) i[d] = Math.sqrt(i[d]), r[d] = Math.sqrt(r[d]);
                            if (!a) {
                                for (d = x.length; --d > -1;)
                                    if (o[p])
                                        for (f = b[x[d]], g = f.length - 1, _ = 0; _ < g; _++) m = f[_ + 1].da / r[_] + f[_].da / i[_] || 0, n[_] = (n[_] || 0) + m * m;
                                for (d = n.length; --d > -1;) n[d] = Math.sqrt(n[d])
                            }
                            for (d = x.length, _ = s ? 4 : 1; --d > -1;) p = x[d], f = b[p], u(f, t, s, a, o[p]), v && (f.splice(0, _), f.splice(f.length - _, _));
                            return b
                        },
                        d = function(e, t, i) {
                            t = t || "soft";
                            var r, n, o, s, l, u, c, h, d, p, f, _ = {},
                                m = "cubic" === t ? 3 : 2,
                                g = "soft" === t,
                                v = [];
                            if (g && i && (e = [i].concat(e)), null == e || e.length < m + 1) throw "invalid Bezier data";
                            for (d in e[0]) v.push(d);
                            for (u = v.length; --u > -1;) {
                                for (d = v[u], _[d] = l = [], p = 0, h = e.length, c = 0; c < h; c++) r = null == i ? e[c][d] : "string" == typeof(f = e[c][d]) && "=" === f.charAt(1) ? i[d] + Number(f.charAt(0) + f.substr(2)) : Number(f), g && c > 1 && c < h - 1 && (l[p++] = (r + l[p - 2]) / 2), l[p++] = r;
                                for (h = p - m + 1, p = 0, c = 0; c < h; c += m) r = l[c], n = l[c + 1], o = l[c + 2], s = 2 === m ? 0 : l[c + 3], l[p++] = f = 3 === m ? new a(r, n, o, s) : new a(r, (2 * n + r) / 3, (2 * n + o) / 3, o);
                                l.length = p
                            }
                            return _
                        },
                        p = function(e, t, i) {
                            for (var r, n, o, s, a, l, u, c, h, d, p, f = 1 / i, _ = e.length; --_ > -1;)
                                for (d = e[_], o = d.a, s = d.d - o, a = d.c - o, l = d.b - o, r = n = 0, c = 1; c <= i; c++) u = f * c, h = 1 - u, r = n - (n = (u * u * s + 3 * h * (u * a + h * l)) * u), p = _ * i + c - 1, t[p] = (t[p] || 0) + r * r
                        },
                        f = function(e, t) {
                            t = t >> 0 || 6;
                            var i, r, n, o, s = [],
                                a = [],
                                l = 0,
                                u = 0,
                                c = t - 1,
                                h = [],
                                d = [];
                            for (i in e) p(e[i], s, t);
                            for (n = s.length, r = 0; r < n; r++) l += Math.sqrt(s[r]), o = r % t, d[o] = l, o === c && (u += l, o = r / t >> 0, h[o] = d, a[o] = u, l = 0, d = []);
                            return {
                                length: u,
                                lengths: a,
                                segments: h
                            }
                        },
                        _ = e._gsDefine.plugin({
                            propName: "bezier",
                            priority: -1,
                            version: "1.3.8",
                            API: 2,
                            global: !0,
                            init: function(e, t, i) {
                                this._target = e, t instanceof Array && (t = {
                                    values: t
                                }), this._func = {}, this._mod = {}, this._props = [], this._timeRes = null == t.timeResolution ? 6 : parseInt(t.timeResolution, 10);
                                var r, n, o, s, a, l = t.values || [],
                                    u = {},
                                    c = l[0],
                                    p = t.autoRotate || i.vars.orientToBezier;
                                this._autoRotate = p ? p instanceof Array ? p : [
                                    ["x", "y", "rotation", !0 === p ? 0 : Number(p) || 0]
                                ] : null;
                                for (r in c) this._props.push(r);
                                for (o = this._props.length; --o > -1;) r = this._props[o], this._overwriteProps.push(r), n = this._func[r] = "function" == typeof e[r], u[r] = n ? e[r.indexOf("set") || "function" != typeof e["get" + r.substr(3)] ? r : "get" + r.substr(3)]() : parseFloat(e[r]), a || u[r] !== l[0][r] && (a = u);
                                if (this._beziers = "cubic" !== t.type && "quadratic" !== t.type && "soft" !== t.type ? h(l, isNaN(t.curviness) ? 1 : t.curviness, !1, "thruBasic" === t.type, t.correlate, a) : d(l, t.type, u), this._segCount = this._beziers[r].length, this._timeRes) {
                                    var _ = f(this._beziers, this._timeRes);
                                    this._length = _.length, this._lengths = _.lengths, this._segments = _.segments, this._l1 = this._li = this._s1 = this._si = 0, this._l2 = this._lengths[0], this._curSeg = this._segments[0], this._s2 = this._curSeg[0], this._prec = 1 / this._curSeg.length
                                }
                                if (p = this._autoRotate)
                                    for (this._initialRotations = [], p[0] instanceof Array || (this._autoRotate = p = [p]), o = p.length; --o > -1;) {
                                        for (s = 0; s < 3; s++) r = p[o][s], this._func[r] = "function" == typeof e[r] && e[r.indexOf("set") || "function" != typeof e["get" + r.substr(3)] ? r : "get" + r.substr(3)];
                                        r = p[o][2], this._initialRotations[o] = (this._func[r] ? this._func[r].call(this._target) : this._target[r]) || 0, this._overwriteProps.push(r)
                                    }
                                return this._startRatio = i.vars.runBackwards ? 1 : 0, !0
                            },
                            set: function(e) {
                                var i, r, n, o, s, a, l, u, c, h, d = this._segCount,
                                    p = this._func,
                                    f = this._target,
                                    _ = e !== this._startRatio;
                                if (this._timeRes) {
                                    if (c = this._lengths, h = this._curSeg, e *= this._length, n = this._li, e > this._l2 && n < d - 1) {
                                        for (u = d - 1; n < u && (this._l2 = c[++n]) <= e;);
                                        this._l1 = c[n - 1], this._li = n, this._curSeg = h = this._segments[n], this._s2 = h[this._s1 = this._si = 0]
                                    } else if (e < this._l1 && n > 0) {
                                        for (; n > 0 && (this._l1 = c[--n]) >= e;);
                                        0 === n && e < this._l1 ? this._l1 = 0 : n++, this._l2 = c[n], this._li = n, this._curSeg = h = this._segments[n], this._s1 = h[(this._si = h.length - 1) - 1] || 0, this._s2 = h[this._si]
                                    }
                                    if (i = n, e -= this._l1, n = this._si, e > this._s2 && n < h.length - 1) {
                                        for (u = h.length - 1; n < u && (this._s2 = h[++n]) <= e;);
                                        this._s1 = h[n - 1], this._si = n
                                    } else if (e < this._s1 && n > 0) {
                                        for (; n > 0 && (this._s1 = h[--n]) >= e;);
                                        0 === n && e < this._s1 ? this._s1 = 0 : n++, this._s2 = h[n], this._si = n
                                    }
                                    a = (n + (e - this._s1) / (this._s2 - this._s1)) * this._prec || 0
                                } else i = e < 0 ? 0 : e >= 1 ? d - 1 : d * e >> 0, a = (e - i * (1 / d)) * d;
                                for (r = 1 - a, n = this._props.length; --n > -1;) o = this._props[n], s = this._beziers[o][i], l = (a * a * s.da + 3 * r * (a * s.ca + r * s.ba)) * a + s.a, this._mod[o] && (l = this._mod[o](l, f)), p[o] ? f[o](l) : f[o] = l;
                                if (this._autoRotate) {
                                    var m, g, v, y, b, x, T, E = this._autoRotate;
                                    for (n = E.length; --n > -1;) o = E[n][2], x = E[n][3] || 0, T = !0 === E[n][4] ? 1 : t, s = this._beziers[E[n][0]], m = this._beziers[E[n][1]], s && m && (s = s[i], m = m[i], g = s.a + (s.b - s.a) * a, y = s.b + (s.c - s.b) * a, g += (y - g) * a, y += (s.c + (s.d - s.c) * a - y) * a, v = m.a + (m.b - m.a) * a, b = m.b + (m.c - m.b) * a, v += (b - v) * a, b += (m.c + (m.d - m.c) * a - b) * a, l = _ ? Math.atan2(b - v, y - g) * T + x : this._initialRotations[n], this._mod[o] && (l = this._mod[o](l, f)), p[o] ? f[o](l) : f[o] = l)
                                }
                            }
                        }),
                        m = _.prototype;
                    _.bezierThrough = h, _.cubicToQuadratic = l, _._autoCSS = !0, _.quadraticToCubic = function(e, t, i) {
                        return new a(e, (2 * t + e) / 3, (2 * t + i) / 3, i)
                    }, _._cssRegister = function() {
                        var e = s.CSSPlugin;
                        if (e) {
                            var t = e._internals,
                                i = t._parseToProxy,
                                r = t._setPluginRatio,
                                n = t.CSSPropTween;
                            t._registerComplexSpecialProp("bezier", {
                                parser: function(e, t, o, s, a, l) {
                                    t instanceof Array && (t = {
                                        values: t
                                    }), l = new _;
                                    var u, c, h, d = t.values,
                                        p = d.length - 1,
                                        f = [],
                                        m = {};
                                    if (p < 0) return a;
                                    for (u = 0; u <= p; u++) h = i(e, d[u], s, a, l, p !== u), f[u] = h.end;
                                    for (c in t) m[c] = t[c];
                                    return m.values = f, a = new n(e, "bezier", 0, 0, h.pt, 2), a.data = h, a.plugin = l, a.setRatio = r, 0 === m.autoRotate && (m.autoRotate = !0), !m.autoRotate || m.autoRotate instanceof Array || (u = !0 === m.autoRotate ? 0 : Number(m.autoRotate), m.autoRotate = null != h.end.left ? [
                                        ["left", "top", "rotation", u, !1]
                                    ] : null != h.end.x && [
                                        ["x", "y", "rotation", u, !1]
                                    ]), m.autoRotate && (s._transform || s._enableTransforms(!1), h.autoRotate = s._target._gsTransform, h.proxy.rotation = h.autoRotate.rotation || 0, s._overwriteProps.push("rotation")), l._onInitTween(h.proxy, m, s._tween), a
                                }
                            })
                        }
                    }, m._mod = function(e) {
                        for (var t, i = this._overwriteProps, r = i.length; --r > -1;)(t = e[i[r]]) && "function" == typeof t && (this._mod[i[r]] = t)
                    }, m._kill = function(e) {
                        var t, i, r = this._props;
                        for (t in this._beziers)
                            if (t in e)
                                for (delete this._beziers[t], delete this._func[t], i = r.length; --i > -1;) r[i] === t && r.splice(i, 1);
                        if (r = this._autoRotate)
                            for (i = r.length; --i > -1;) e[r[i][2]] && r.splice(i, 1);
                        return this._super._kill.call(this, e)
                    }
                }(), e._gsDefine("plugins.CSSPlugin", ["plugins.TweenPlugin", "TweenLite"], function(t, i) {
                    var r, n, o, s, a = function() {
                            t.call(this, "css"), this._overwriteProps.length = 0, this.setRatio = a.prototype.setRatio
                        },
                        l = e._gsDefine.globals,
                        u = {},
                        c = a.prototype = new t("css");
                    c.constructor = a, a.version = "1.20.0", a.API = 2, a.defaultTransformPerspective = 0, a.defaultSkewType = "compensated", a.defaultSmoothOrigin = !0, c = "px", a.suffixMap = {
                        top: c,
                        right: c,
                        bottom: c,
                        left: c,
                        width: c,
                        height: c,
                        fontSize: c,
                        padding: c,
                        margin: c,
                        perspective: c,
                        lineHeight: ""
                    };
                    var h, d, p, f, _, m, g, v, y = /(?:\-|\.|\b)(\d|\.|e\-)+/g,
                        b = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,
                        x = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,
                        T = /(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,
                        E = /(?:\d|\-|\+|=|#|\.)*/g,
                        S = /opacity *= *([^)]*)/i,
                        P = /opacity:([^;]*)/i,
                        A = /alpha\(opacity *=.+?\)/i,
                        C = /^(rgb|hsl)/,
                        M = /([A-Z])/g,
                        R = /-([a-z])/gi,
                        O = /(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,
                        w = function(e, t) {
                            return t.toUpperCase()
                        },
                        I = /(?:Left|Right|Width)/i,
                        D = /(M11|M12|M21|M22)=[\d\-\.e]+/gi,
                        L = /progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,
                        B = /,(?=[^\)]*(?:\(|$))/gi,
                        F = /[\s,\(]/i,
                        N = Math.PI / 180,
                        V = 180 / Math.PI,
                        k = {},
                        U = {
                            style: {}
                        },
                        G = e.document || {
                            createElement: function() {
                                return U
                            }
                        },
                        z = function(e, t) {
                            return G.createElementNS ? G.createElementNS(t || "http://www.w3.org/1999/xhtml", e) : G.createElement(e)
                        },
                        j = z("div"),
                        H = z("img"),
                        W = a._internals = {
                            _specialProps: u
                        },
                        X = (e.navigator || {}).userAgent || "",
                        Y = function() {
                            var e = X.indexOf("Android"),
                                t = z("a");
                            return p = -1 !== X.indexOf("Safari") && -1 === X.indexOf("Chrome") && (-1 === e || parseFloat(X.substr(e + 8, 2)) > 3), _ = p && parseFloat(X.substr(X.indexOf("Version/") + 8, 2)) < 6, f = -1 !== X.indexOf("Firefox"), (/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(X) || /Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(X)) && (m = parseFloat(RegExp.$1)), !!t && (t.style.cssText = "top:1px;opacity:.55;", /^0.55/.test(t.style.opacity))
                        }(),
                        q = function(e) {
                            return S.test("string" == typeof e ? e : (e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? parseFloat(RegExp.$1) / 100 : 1
                        },
                        K = function(t) {
                            e.console
                        },
                        Q = "",
                        Z = "",
                        J = function(e, t) {
                            t = t || j;
                            var i, r, n = t.style;
                            if (void 0 !== n[e]) return e;
                            for (e = e.charAt(0).toUpperCase() + e.substr(1), i = ["O", "Moz", "ms", "Ms", "Webkit"], r = 5; --r > -1 && void 0 === n[i[r] + e];);
                            return r >= 0 ? (Z = 3 === r ? "ms" : i[r], Q = "-" + Z.toLowerCase() + "-", Z + e) : null
                        },
                        $ = G.defaultView ? G.defaultView.getComputedStyle : function() {},
                        ee = a.getStyle = function(e, t, i, r, n) {
                            var o;
                            return Y || "opacity" !== t ? (!r && e.style[t] ? o = e.style[t] : (i = i || $(e)) ? o = i[t] || i.getPropertyValue(t) || i.getPropertyValue(t.replace(M, "-$1").toLowerCase()) : e.currentStyle && (o = e.currentStyle[t]), null == n || o && "none" !== o && "auto" !== o && "auto auto" !== o ? o : n) : q(e)
                        },
                        te = W.convertToPixels = function(e, t, r, n, o) {
                            if ("px" === n || !n && "lineHeight" !== t) return r;
                            if ("auto" === n || !r) return 0;
                            var s, l, u, c = I.test(t),
                                h = e,
                                d = j.style,
                                p = r < 0,
                                f = 1 === r;
                            if (p && (r = -r), f && (r *= 100), "lineHeight" !== t || n)
                                if ("%" === n && -1 !== t.indexOf("border")) s = r / 100 * (c ? e.clientWidth : e.clientHeight);
                                else {
                                    if (d.cssText = "border:0 solid red;position:" + ee(e, "position") + ";line-height:0;", "%" !== n && h.appendChild && "v" !== n.charAt(0) && "rem" !== n) d[c ? "borderLeftWidth" : "borderTopWidth"] = r + n;
                                    else {
                                        if (h = e.parentNode || G.body, -1 !== ee(h, "display").indexOf("flex") && (d.position = "absolute"), l = h._gsCache, u = i.ticker.frame, l && c && l.time === u) return l.width * r / 100;
                                        d[c ? "width" : "height"] = r + n
                                    }
                                    h.appendChild(j), s = parseFloat(j[c ? "offsetWidth" : "offsetHeight"]), h.removeChild(j), c && "%" === n && !1 !== a.cacheWidths && (l = h._gsCache = h._gsCache || {}, l.time = u, l.width = s / r * 100), 0 !== s || o || (s = te(e, t, r, n, !0))
                                }
                            else l = $(e).lineHeight, e.style.lineHeight = r, s = parseFloat($(e).lineHeight), e.style.lineHeight = l;
                            return f && (s /= 100), p ? -s : s
                        },
                        ie = W.calculateOffset = function(e, t, i) {
                            if ("absolute" !== ee(e, "position", i)) return 0;
                            var r = "left" === t ? "Left" : "Top",
                                n = ee(e, "margin" + r, i);
                            return e["offset" + r] - (te(e, t, parseFloat(n), n.replace(E, "")) || 0)
                        },
                        re = function(e, t) {
                            var i, r, n, o = {};
                            if (t = t || $(e, null))
                                if (i = t.length)
                                    for (; --i > -1;) n = t[i], -1 !== n.indexOf("-transform") && Oe !== n || (o[n.replace(R, w)] = t.getPropertyValue(n));
                                else
                                    for (i in t) - 1 !== i.indexOf("Transform") && Re !== i || (o[i] = t[i]);
                            else if (t = e.currentStyle || e.style)
                                for (i in t) "string" == typeof i && void 0 === o[i] && (o[i.replace(R, w)] = t[i]);
                            return Y || (o.opacity = q(e)), r = He(e, t, !1), o.rotation = r.rotation, o.skewX = r.skewX, o.scaleX = r.scaleX, o.scaleY = r.scaleY, o.x = r.x, o.y = r.y, Ie && (o.z = r.z, o.rotationX = r.rotationX, o.rotationY = r.rotationY, o.scaleZ = r.scaleZ), o.filters && delete o.filters, o
                        },
                        ne = function(e, t, i, r, n) {
                            var o, s, a, l = {},
                                u = e.style;
                            for (s in i) "cssText" !== s && "length" !== s && isNaN(s) && (t[s] !== (o = i[s]) || n && n[s]) && -1 === s.indexOf("Origin") && ("number" != typeof o && "string" != typeof o || (l[s] = "auto" !== o || "left" !== s && "top" !== s ? "" !== o && "auto" !== o && "none" !== o || "string" != typeof t[s] || "" === t[s].replace(T, "") ? o : 0 : ie(e, s), void 0 !== u[s] && (a = new ye(u, s, u[s], a))));
                            if (r)
                                for (s in r) "className" !== s && (l[s] = r[s]);
                            return {
                                difs: l,
                                firstMPT: a
                            }
                        },
                        oe = {
                            width: ["Left", "Right"],
                            height: ["Top", "Bottom"]
                        },
                        se = ["marginLeft", "marginRight", "marginTop", "marginBottom"],
                        ae = function(e, t, i) {
                            if ("svg" === (e.nodeName + "").toLowerCase()) return (i || $(e))[t] || 0;
                            if (e.getCTM && Ge(e)) return e.getBBox()[t] || 0;
                            var r = parseFloat("width" === t ? e.offsetWidth : e.offsetHeight),
                                n = oe[t],
                                o = n.length;
                            for (i = i || $(e, null); --o > -1;) r -= parseFloat(ee(e, "padding" + n[o], i, !0)) || 0, r -= parseFloat(ee(e, "border" + n[o] + "Width", i, !0)) || 0;
                            return r
                        },
                        le = function(e, t) {
                            if ("contain" === e || "auto" === e || "auto auto" === e) return e + " ";
                            null != e && "" !== e || (e = "0 0");
                            var i, r = e.split(" "),
                                n = -1 !== e.indexOf("left") ? "0%" : -1 !== e.indexOf("right") ? "100%" : r[0],
                                o = -1 !== e.indexOf("top") ? "0%" : -1 !== e.indexOf("bottom") ? "100%" : r[1];
                            if (r.length > 3 && !t) {
                                for (r = e.split(", ").join(",").split(","), e = [], i = 0; i < r.length; i++) e.push(le(r[i]));
                                return e.join(",")
                            }
                            return null == o ? o = "center" === n ? "50%" : "0" : "center" === o && (o = "50%"), ("center" === n || isNaN(parseFloat(n)) && -1 === (n + "").indexOf("=")) && (n = "50%"), e = n + " " + o + (r.length > 2 ? " " + r[2] : ""), t && (t.oxp = -1 !== n.indexOf("%"), t.oyp = -1 !== o.indexOf("%"), t.oxr = "=" === n.charAt(1), t.oyr = "=" === o.charAt(1), t.ox = parseFloat(n.replace(T, "")), t.oy = parseFloat(o.replace(T, "")), t.v = e), t || e
                        },
                        ue = function(e, t) {
                            return "function" == typeof e && (e = e(v, g)), "string" == typeof e && "=" === e.charAt(1) ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) : parseFloat(e) - parseFloat(t) || 0
                        },
                        ce = function(e, t) {
                            return "function" == typeof e && (e = e(v, g)), null == e ? t : "string" == typeof e && "=" === e.charAt(1) ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) + t : parseFloat(e) || 0
                        },
                        he = function(e, t, i, r) {
                            var n, o, s, a, l;
                            return "function" == typeof e && (e = e(v, g)), null == e ? a = t : "number" == typeof e ? a = e : (n = 360, o = e.split("_"), l = "=" === e.charAt(1), s = (l ? parseInt(e.charAt(0) + "1", 10) * parseFloat(o[0].substr(2)) : parseFloat(o[0])) * (-1 === e.indexOf("rad") ? 1 : V) - (l ? 0 : t), o.length && (r && (r[i] = t + s), -1 !== e.indexOf("short") && (s %= n) !== s % (n / 2) && (s = s < 0 ? s + n : s - n), -1 !== e.indexOf("_cw") && s < 0 ? s = (s + 9999999999 * n) % n - (s / n | 0) * n : -1 !== e.indexOf("ccw") && s > 0 && (s = (s - 9999999999 * n) % n - (s / n | 0) * n)), a = t + s), a < 1e-6 && a > -1e-6 && (a = 0), a
                        },
                        de = {
                            aqua: [0, 255, 255],
                            lime: [0, 255, 0],
                            silver: [192, 192, 192],
                            black: [0, 0, 0],
                            maroon: [128, 0, 0],
                            teal: [0, 128, 128],
                            blue: [0, 0, 255],
                            navy: [0, 0, 128],
                            white: [255, 255, 255],
                            fuchsia: [255, 0, 255],
                            olive: [128, 128, 0],
                            yellow: [255, 255, 0],
                            orange: [255, 165, 0],
                            gray: [128, 128, 128],
                            purple: [128, 0, 128],
                            green: [0, 128, 0],
                            red: [255, 0, 0],
                            pink: [255, 192, 203],
                            cyan: [0, 255, 255],
                            transparent: [255, 255, 255, 0]
                        },
                        pe = function(e, t, i) {
                            return e = e < 0 ? e + 1 : e > 1 ? e - 1 : e, 255 * (6 * e < 1 ? t + (i - t) * e * 6 : e < .5 ? i : 3 * e < 2 ? t + (i - t) * (2 / 3 - e) * 6 : t) + .5 | 0
                        },
                        fe = a.parseColor = function(e, t) {
                            var i, r, n, o, s, a, l, u, c, h, d;
                            if (e)
                                if ("number" == typeof e) i = [e >> 16, e >> 8 & 255, 255 & e];
                                else {
                                    if ("," === e.charAt(e.length - 1) && (e = e.substr(0, e.length - 1)), de[e]) i = de[e];
                                    else if ("#" === e.charAt(0)) 4 === e.length && (r = e.charAt(1), n = e.charAt(2), o = e.charAt(3), e = "#" + r + r + n + n + o + o), e = parseInt(e.substr(1), 16), i = [e >> 16, e >> 8 & 255, 255 & e];
                                    else if ("hsl" === e.substr(0, 3))
                                        if (i = d = e.match(y), t) {
                                            if (-1 !== e.indexOf("=")) return e.match(b)
                                        } else s = Number(i[0]) % 360 / 360, a = Number(i[1]) / 100, l = Number(i[2]) / 100, n = l <= .5 ? l * (a + 1) : l + a - l * a, r = 2 * l - n, i.length > 3 && (i[3] = Number(e[3])), i[0] = pe(s + 1 / 3, r, n), i[1] = pe(s, r, n), i[2] = pe(s - 1 / 3, r, n);
                                    else i = e.match(y) || de.transparent;
                                    i[0] = Number(i[0]), i[1] = Number(i[1]), i[2] = Number(i[2]), i.length > 3 && (i[3] = Number(i[3]))
                                }
                            else i = de.black;
                            return t && !d && (r = i[0] / 255, n = i[1] / 255, o = i[2] / 255, u = Math.max(r, n, o), c = Math.min(r, n, o), l = (u + c) / 2, u === c ? s = a = 0 : (h = u - c, a = l > .5 ? h / (2 - u - c) : h / (u + c), s = u === r ? (n - o) / h + (n < o ? 6 : 0) : u === n ? (o - r) / h + 2 : (r - n) / h + 4, s *= 60), i[0] = s + .5 | 0, i[1] = 100 * a + .5 | 0, i[2] = 100 * l + .5 | 0), i
                        },
                        _e = function(e, t) {
                            var i, r, n, o = e.match(me) || [],
                                s = 0,
                                a = "";
                            if (!o.length) return e;
                            for (i = 0; i < o.length; i++) r = o[i], n = e.substr(s, e.indexOf(r, s) - s), s += n.length + r.length, r = fe(r, t), 3 === r.length && r.push(1), a += n + (t ? "hsla(" + r[0] + "," + r[1] + "%," + r[2] + "%," + r[3] : "rgba(" + r.join(",")) + ")";
                            return a + e.substr(s)
                        },
                        me = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b";
                    for (c in de) me += "|" + c + "\\b";
                    me = new RegExp(me + ")", "gi"), a.colorStringFilter = function(e) {
                        var t, i = e[0] + " " + e[1];
                        me.test(i) && (t = -1 !== i.indexOf("hsl(") || -1 !== i.indexOf("hsla("), e[0] = _e(e[0], t), e[1] = _e(e[1], t)), me.lastIndex = 0
                    }, i.defaultStringFilter || (i.defaultStringFilter = a.colorStringFilter);
                    var ge = function(e, t, i, r) {
                            if (null == e) return function(e) {
                                return e
                            };
                            var n, o = t ? (e.match(me) || [""])[0] : "",
                                s = e.split(o).join("").match(x) || [],
                                a = e.substr(0, e.indexOf(s[0])),
                                l = ")" === e.charAt(e.length - 1) ? ")" : "",
                                u = -1 !== e.indexOf(" ") ? " " : ",",
                                c = s.length,
                                h = c > 0 ? s[0].replace(y, "") : "";
                            return c ? n = t ? function(e) {
                                var t, d, p, f;
                                if ("number" == typeof e) e += h;
                                else if (r && B.test(e)) {
                                    for (f = e.replace(B, "|").split("|"), p = 0; p < f.length; p++) f[p] = n(f[p]);
                                    return f.join(",")
                                }
                                if (t = (e.match(me) || [o])[0], d = e.split(t).join("").match(x) || [], p = d.length, c > p--)
                                    for (; ++p < c;) d[p] = i ? d[(p - 1) / 2 | 0] : s[p];
                                return a + d.join(u) + u + t + l + (-1 !== e.indexOf("inset") ? " inset" : "")
                            } : function(e) {
                                var t, o, d;
                                if ("number" == typeof e) e += h;
                                else if (r && B.test(e)) {
                                    for (o = e.replace(B, "|").split("|"), d = 0; d < o.length; d++) o[d] = n(o[d]);
                                    return o.join(",")
                                }
                                if (t = e.match(x) || [], d = t.length, c > d--)
                                    for (; ++d < c;) t[d] = i ? t[(d - 1) / 2 | 0] : s[d];
                                return a + t.join(u) + l
                            } : function(e) {
                                return e
                            }
                        },
                        ve = function(e) {
                            return e = e.split(","),
                                function(t, i, r, n, o, s, a) {
                                    var l, u = (i + "").split(" ");
                                    for (a = {}, l = 0; l < 4; l++) a[e[l]] = u[l] = u[l] || u[(l - 1) / 2 >> 0];
                                    return n.parse(t, a, o, s)
                                }
                        },
                        ye = (W._setPluginRatio = function(e) {
                            this.plugin.setRatio(e);
                            for (var t, i, r, n, o, s = this.data, a = s.proxy, l = s.firstMPT; l;) t = a[l.v], l.r ? t = Math.round(t) : t < 1e-6 && t > -1e-6 && (t = 0), l.t[l.p] = t, l = l._next;
                            if (s.autoRotate && (s.autoRotate.rotation = s.mod ? s.mod(a.rotation, this.t) : a.rotation), 1 === e || 0 === e)
                                for (l = s.firstMPT, o = 1 === e ? "e" : "b"; l;) {
                                    if (i = l.t, i.type) {
                                        if (1 === i.type) {
                                            for (n = i.xs0 + i.s + i.xs1, r = 1; r < i.l; r++) n += i["xn" + r] + i["xs" + (r + 1)];
                                            i[o] = n
                                        }
                                    } else i[o] = i.s + i.xs0;
                                    l = l._next
                                }
                        }, function(e, t, i, r, n) {
                            this.t = e, this.p = t, this.v = i, this.r = n, r && (r._prev = this, this._next = r)
                        }),
                        be = (W._parseToProxy = function(e, t, i, r, n, o) {
                            var s, a, l, u, c, h = r,
                                d = {},
                                p = {},
                                f = i._transform,
                                _ = k;
                            for (i._transform = null, k = t, r = c = i.parse(e, t, r, n), k = _, o && (i._transform = f, h && (h._prev = null, h._prev && (h._prev._next = null))); r && r !== h;) {
                                if (r.type <= 1 && (a = r.p, p[a] = r.s + r.c, d[a] = r.s, o || (u = new ye(r, "s", a, u, r.r), r.c = 0), 1 === r.type))
                                    for (s = r.l; --s > 0;) l = "xn" + s, a = r.p + "_" + l, p[a] = r.data[l], d[a] = r[l], o || (u = new ye(r, l, a, u, r.rxp[l]));
                                r = r._next
                            }
                            return {
                                proxy: d,
                                end: p,
                                firstMPT: u,
                                pt: c
                            }
                        }, W.CSSPropTween = function(e, t, i, n, o, a, l, u, c, h, d) {
                            this.t = e, this.p = t, this.s = i, this.c = n, this.n = l || t, e instanceof be || s.push(this.n), this.r = u, this.type = a || 0, c && (this.pr = c, r = !0), this.b = void 0 === h ? i : h, this.e = void 0 === d ? i + n : d, o && (this._next = o, o._prev = this)
                        }),
                        xe = function(e, t, i, r, n, o) {
                            var s = new be(e, t, i, r - i, n, -1, o);
                            return s.b = i, s.e = s.xs0 = r, s
                        },
                        Te = a.parseComplex = function(e, t, i, r, n, o, s, l, u, c) {
                            i = i || o || "", "function" == typeof r && (r = r(v, g)), s = new be(e, t, 0, 0, s, c ? 2 : 1, null, !1, l, i, r), r += "", n && me.test(r + i) && (r = [i, r], a.colorStringFilter(r), i = r[0], r = r[1]);
                            var d, p, f, _, m, x, T, E, S, P, A, C, M, R = i.split(", ").join(",").split(" "),
                                O = r.split(", ").join(",").split(" "),
                                w = R.length,
                                I = !1 !== h;
                            for (-1 === r.indexOf(",") && -1 === i.indexOf(",") || (R = R.join(" ").replace(B, ", ").split(" "), O = O.join(" ").replace(B, ", ").split(" "), w = R.length), w !== O.length && (R = (o || "").split(" "), w = R.length), s.plugin = u, s.setRatio = c, me.lastIndex = 0, d = 0; d < w; d++)
                                if (_ = R[d], m = O[d], (E = parseFloat(_)) || 0 === E) s.appendXtra("", E, ue(m, E), m.replace(b, ""), I && -1 !== m.indexOf("px"), !0);
                                else if (n && me.test(_)) C = m.indexOf(")") + 1, C = ")" + (C ? m.substr(C) : ""), M = -1 !== m.indexOf("hsl") && Y, P = m, _ = fe(_, M), m = fe(m, M), S = _.length + m.length > 6, S && !Y && 0 === m[3] ? (s["xs" + s.l] += s.l ? " transparent" : "transparent", s.e = s.e.split(O[d]).join("transparent")) : (Y || (S = !1), M ? s.appendXtra(P.substr(0, P.indexOf("hsl")) + (S ? "hsla(" : "hsl("), _[0], ue(m[0], _[0]), ",", !1, !0).appendXtra("", _[1], ue(m[1], _[1]), "%,", !1).appendXtra("", _[2], ue(m[2], _[2]), S ? "%," : "%" + C, !1) : s.appendXtra(P.substr(0, P.indexOf("rgb")) + (S ? "rgba(" : "rgb("), _[0], m[0] - _[0], ",", !0, !0).appendXtra("", _[1], m[1] - _[1], ",", !0).appendXtra("", _[2], m[2] - _[2], S ? "," : C, !0), S && (_ = _.length < 4 ? 1 : _[3], s.appendXtra("", _, (m.length < 4 ? 1 : m[3]) - _, C, !1))), me.lastIndex = 0;
                            else if (x = _.match(y)) {
                                if (!(T = m.match(b)) || T.length !== x.length) return s;
                                for (f = 0, p = 0; p < x.length; p++) A = x[p], P = _.indexOf(A, f), s.appendXtra(_.substr(f, P - f), Number(A), ue(T[p], A), "", I && "px" === _.substr(P + A.length, 2), 0 === p), f = P + A.length;
                                s["xs" + s.l] += _.substr(f)
                            } else s["xs" + s.l] += s.l || s["xs" + s.l] ? " " + m : m;
                            if (-1 !== r.indexOf("=") && s.data) {
                                for (C = s.xs0 + s.data.s, d = 1; d < s.l; d++) C += s["xs" + d] + s.data["xn" + d];
                                s.e = C + s["xs" + d]
                            }
                            return s.l || (s.type = -1, s.xs0 = s.e), s.xfirst || s
                        },
                        Ee = 9;
                    for (c = be.prototype, c.l = c.pr = 0; --Ee > 0;) c["xn" + Ee] = 0, c["xs" + Ee] = "";
                    c.xs0 = "", c._next = c._prev = c.xfirst = c.data = c.plugin = c.setRatio = c.rxp = null, c.appendXtra = function(e, t, i, r, n, o) {
                        var s = this,
                            a = s.l;
                        return s["xs" + a] += o && (a || s["xs" + a]) ? " " + e : e || "", i || 0 === a || s.plugin ? (s.l++, s.type = s.setRatio ? 2 : 1, s["xs" + s.l] = r || "", a > 0 ? (s.data["xn" + a] = t + i, s.rxp["xn" + a] = n, s["xn" + a] = t, s.plugin || (s.xfirst = new be(s, "xn" + a, t, i, s.xfirst || s, 0, s.n, n, s.pr), s.xfirst.xs0 = 0), s) : (s.data = {
                            s: t + i
                        }, s.rxp = {}, s.s = t, s.c = i, s.r = n, s)) : (s["xs" + a] += t + (r || ""), s)
                    };
                    var Se = function(e, t) {
                            t = t || {}, this.p = t.prefix ? J(e) || e : e, u[e] = u[this.p] = this, this.format = t.formatter || ge(t.defaultValue, t.color, t.collapsible, t.multi), t.parser && (this.parse = t.parser), this.clrs = t.color, this.multi = t.multi, this.keyword = t.keyword, this.dflt = t.defaultValue, this.pr = t.priority || 0
                        },
                        Pe = W._registerComplexSpecialProp = function(e, t, i) {
                            "object" != typeof t && (t = {
                                parser: i
                            });
                            var r, n = e.split(","),
                                o = t.defaultValue;
                            for (i = i || [o], r = 0; r < n.length; r++) t.prefix = 0 === r && t.prefix, t.defaultValue = i[r] || o, new Se(n[r], t)
                        },
                        Ae = W._registerPluginProp = function(e) {
                            if (!u[e]) {
                                var t = e.charAt(0).toUpperCase() + e.substr(1) + "Plugin";
                                Pe(e, {
                                    parser: function(e, i, r, n, o, s, a) {
                                        var c = l.com.greensock.plugins[t];
                                        return c ? (c._cssRegister(), u[r].parse(e, i, r, n, o, s, a)) : (K(), o)
                                    }
                                })
                            }
                        };
                    c = Se.prototype, c.parseComplex = function(e, t, i, r, n, o) {
                        var s, a, l, u, c, h, d = this.keyword;
                        if (this.multi && (B.test(i) || B.test(t) ? (a = t.replace(B, "|").split("|"), l = i.replace(B, "|").split("|")) : d && (a = [t], l = [i])), l) {
                            for (u = l.length > a.length ? l.length : a.length, s = 0; s < u; s++) t = a[s] = a[s] || this.dflt, i = l[s] = l[s] || this.dflt, d && (c = t.indexOf(d), h = i.indexOf(d), c !== h && (-1 === h ? a[s] = a[s].split(d).join("") : -1 === c && (a[s] += " " + d)));
                            t = a.join(", "), i = l.join(", ")
                        }
                        return Te(e, this.p, t, i, this.clrs, this.dflt, r, this.pr, n, o)
                    }, c.parse = function(e, t, i, r, n, s, a) {
                        return this.parseComplex(e.style, this.format(ee(e, this.p, o, !1, this.dflt)), this.format(t), n, s)
                    }, a.registerSpecialProp = function(e, t, i) {
                        Pe(e, {
                            parser: function(e, r, n, o, s, a, l) {
                                var u = new be(e, n, 0, 0, s, 2, n, !1, i);
                                return u.plugin = a, u.setRatio = t(e, r, o._tween, n), u
                            },
                            priority: i
                        })
                    }, a.useSVGTransformAttr = !0;
                    var Ce, Me = "scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),
                        Re = J("transform"),
                        Oe = Q + "transform",
                        we = J("transformOrigin"),
                        Ie = null !== J("perspective"),
                        De = W.Transform = function() {
                            this.perspective = parseFloat(a.defaultTransformPerspective) || 0, this.force3D = !(!1 === a.defaultForce3D || !Ie) && (a.defaultForce3D || "auto")
                        },
                        Le = e.SVGElement,
                        Be = function(e, t, i) {
                            var r, n = G.createElementNS("http://www.w3.org/2000/svg", e),
                                o = /([a-z])([A-Z])/g;
                            for (r in i) n.setAttributeNS(null, r.replace(o, "$1-$2").toLowerCase(), i[r]);
                            return t.appendChild(n), n
                        },
                        Fe = G.documentElement || {},
                        Ne = function() {
                            var t, i, r, n = m || /Android/i.test(X) && !e.chrome;
                            return G.createElementNS && !n && (t = Be("svg", Fe), i = Be("rect", t, {
                                width: 100,
                                height: 50,
                                x: 100
                            }), r = i.getBoundingClientRect().width, i.style[we] = "50% 50%", i.style[Re] = "scaleX(0.5)", n = r === i.getBoundingClientRect().width && !(f && Ie), Fe.removeChild(t)), n
                        }(),
                        Ve = function(e, t, i, r, n, o) {
                            var s, l, u, c, h, d, p, f, _, m, g, v, y, b, x = e._gsTransform,
                                T = je(e, !0);
                            x && (y = x.xOrigin, b = x.yOrigin), (!r || (s = r.split(" ")).length < 2) && (p = e.getBBox(), 0 === p.x && 0 === p.y && p.width + p.height === 0 && (p = {
                                x: parseFloat(e.hasAttribute("x") ? e.getAttribute("x") : e.hasAttribute("cx") ? e.getAttribute("cx") : 0) || 0,
                                y: parseFloat(e.hasAttribute("y") ? e.getAttribute("y") : e.hasAttribute("cy") ? e.getAttribute("cy") : 0) || 0,
                                width: 0,
                                height: 0
                            }), t = le(t).split(" "), s = [(-1 !== t[0].indexOf("%") ? parseFloat(t[0]) / 100 * p.width : parseFloat(t[0])) + p.x, (-1 !== t[1].indexOf("%") ? parseFloat(t[1]) / 100 * p.height : parseFloat(t[1])) + p.y]), i.xOrigin = c = parseFloat(s[0]), i.yOrigin = h = parseFloat(s[1]), r && T !== ze && (d = T[0], p = T[1], f = T[2], _ = T[3], m = T[4], g = T[5], (v = d * _ - p * f) && (l = c * (_ / v) + h * (-f / v) + (f * g - _ * m) / v, u = c * (-p / v) + h * (d / v) - (d * g - p * m) / v, c = i.xOrigin = s[0] = l, h = i.yOrigin = s[1] = u)), x && (o && (i.xOffset = x.xOffset, i.yOffset = x.yOffset, x = i), n || !1 !== n && !1 !== a.defaultSmoothOrigin ? (l = c - y, u = h - b, x.xOffset += l * T[0] + u * T[2] - l, x.yOffset += l * T[1] + u * T[3] - u) : x.xOffset = x.yOffset = 0), o || e.setAttribute("data-svg-origin", s.join(" "))
                        },
                        ke = function(e) {
                            var t, i = z("svg", this.ownerSVGElement.getAttribute("xmlns") || "http://www.w3.org/2000/svg"),
                                r = this.parentNode,
                                n = this.nextSibling,
                                o = this.style.cssText;
                            if (Fe.appendChild(i), i.appendChild(this), this.style.display = "block", e) try {
                                t = this.getBBox(), this._originalGetBBox = this.getBBox, this.getBBox = ke
                            } catch (e) {} else this._originalGetBBox && (t = this._originalGetBBox());
                            return n ? r.insertBefore(this, n) : r.appendChild(this), Fe.removeChild(i), this.style.cssText = o, t
                        },
                        Ue = function(e) {
                            try {
                                return e.getBBox()
                            } catch (t) {
                                return ke.call(e, !0)
                            }
                        },
                        Ge = function(e) {
                            return !(!(Le && e.getCTM && Ue(e)) || e.parentNode && !e.ownerSVGElement)
                        },
                        ze = [1, 0, 0, 1, 0, 0],
                        je = function(e, t) {
                            var i, r, n, o, s, a, l = e._gsTransform || new De,
                                u = e.style;
                            if (Re ? r = ee(e, Oe, null, !0) : e.currentStyle && (r = e.currentStyle.filter.match(D), r = r && 4 === r.length ? [r[0].substr(4), Number(r[2].substr(4)), Number(r[1].substr(4)), r[3].substr(4), l.x || 0, l.y || 0].join(",") : ""), i = !r || "none" === r || "matrix(1, 0, 0, 1, 0, 0)" === r, !Re || !(a = "none" === $(e).display) && e.parentNode || (a && (o = u.display, u.display = "block"), e.parentNode || (s = 1, Fe.appendChild(e)), r = ee(e, Oe, null, !0), i = !r || "none" === r || "matrix(1, 0, 0, 1, 0, 0)" === r, o ? u.display = o : a && qe(u, "display"), s && Fe.removeChild(e)), (l.svg || e.getCTM && Ge(e)) && (i && -1 !== (u[Re] + "").indexOf("matrix") && (r = u[Re], i = 0), n = e.getAttribute("transform"), i && n && (-1 !== n.indexOf("matrix") ? (r = n, i = 0) : -1 !== n.indexOf("translate") && (r = "matrix(1,0,0,1," + n.match(/(?:\-|\b)[\d\-\.e]+\b/gi).join(",") + ")", i = 0))), i) return ze;
                            for (n = (r || "").match(y) || [], Ee = n.length; --Ee > -1;) o = Number(n[Ee]), n[Ee] = (s = o - (o |= 0)) ? (1e5 * s + (s < 0 ? -.5 : .5) | 0) / 1e5 + o : o;
                            return t && n.length > 6 ? [n[0], n[1], n[4], n[5], n[12], n[13]] : n
                        },
                        He = W.getTransform = function(e, t, r, n) {
                            if (e._gsTransform && r && !n) return e._gsTransform;
                            var o, s, l, u, c, h, d = r ? e._gsTransform || new De : new De,
                                p = d.scaleX < 0,
                                f = Ie ? parseFloat(ee(e, we, t, !1, "0 0 0").split(" ")[2]) || d.zOrigin || 0 : 0,
                                _ = parseFloat(a.defaultTransformPerspective) || 0;
                            if (d.svg = !(!e.getCTM || !Ge(e)), d.svg && (Ve(e, ee(e, we, t, !1, "50% 50%") + "", d, e.getAttribute("data-svg-origin")), Ce = a.useSVGTransformAttr || Ne), (o = je(e)) !== ze) {
                                if (16 === o.length) {
                                    var m, g, v, y, b, x = o[0],
                                        T = o[1],
                                        E = o[2],
                                        S = o[3],
                                        P = o[4],
                                        A = o[5],
                                        C = o[6],
                                        M = o[7],
                                        R = o[8],
                                        O = o[9],
                                        w = o[10],
                                        I = o[12],
                                        D = o[13],
                                        L = o[14],
                                        B = o[11],
                                        F = Math.atan2(C, w);
                                    d.zOrigin && (L = -d.zOrigin, I = R * L - o[12], D = O * L - o[13], L = w * L + d.zOrigin - o[14]), d.rotationX = F * V, F && (y = Math.cos(-F), b = Math.sin(-F), m = P * y + R * b, g = A * y + O * b, v = C * y + w * b, R = P * -b + R * y, O = A * -b + O * y, w = C * -b + w * y, B = M * -b + B * y, P = m, A = g, C = v), F = Math.atan2(-E, w), d.rotationY = F * V, F && (y = Math.cos(-F), b = Math.sin(-F), m = x * y - R * b, g = T * y - O * b, v = E * y - w * b, O = T * b + O * y, w = E * b + w * y, B = S * b + B * y, x = m, T = g, E = v), F = Math.atan2(T, x), d.rotation = F * V, F && (y = Math.cos(F), b = Math.sin(F), m = x * y + T * b, g = P * y + A * b, v = R * y + O * b, T = T * y - x * b, A = A * y - P * b, O = O * y - R * b, x = m, P = g, R = v), d.rotationX && Math.abs(d.rotationX) + Math.abs(d.rotation) > 359.9 && (d.rotationX = d.rotation = 0, d.rotationY = 180 - d.rotationY), F = Math.atan2(P, A), d.scaleX = (1e5 * Math.sqrt(x * x + T * T + E * E) + .5 | 0) / 1e5, d.scaleY = (1e5 * Math.sqrt(A * A + C * C) + .5 | 0) / 1e5, d.scaleZ = (1e5 * Math.sqrt(R * R + O * O + w * w) + .5 | 0) / 1e5, x /= d.scaleX, P /= d.scaleY, T /= d.scaleX, A /= d.scaleY, Math.abs(F) > 2e-5 ? (d.skewX = F * V, P = 0, "simple" !== d.skewType && (d.scaleY *= 1 / Math.cos(F))) : d.skewX = 0, d.perspective = B ? 1 / (B < 0 ? -B : B) : 0, d.x = I, d.y = D, d.z = L, d.svg && (d.x -= d.xOrigin - (d.xOrigin * x - d.yOrigin * P), d.y -= d.yOrigin - (d.yOrigin * T - d.xOrigin * A))
                                } else if (!Ie || n || !o.length || d.x !== o[4] || d.y !== o[5] || !d.rotationX && !d.rotationY) {
                                    var N = o.length >= 6,
                                        k = N ? o[0] : 1,
                                        U = o[1] || 0,
                                        G = o[2] || 0,
                                        z = N ? o[3] : 1;
                                    d.x = o[4] || 0, d.y = o[5] || 0, l = Math.sqrt(k * k + U * U), u = Math.sqrt(z * z + G * G), c = k || U ? Math.atan2(U, k) * V : d.rotation || 0, h = G || z ? Math.atan2(G, z) * V + c : d.skewX || 0, d.scaleX = l, d.scaleY = u, d.rotation = c, d.skewX = h, Ie && (d.rotationX = d.rotationY = d.z = 0, d.perspective = _, d.scaleZ = 1), d.svg && (d.x -= d.xOrigin - (d.xOrigin * k + d.yOrigin * G), d.y -= d.yOrigin - (d.xOrigin * U + d.yOrigin * z))
                                }
                                Math.abs(d.skewX) > 90 && Math.abs(d.skewX) < 270 && (p ? (d.scaleX *= -1, d.skewX += d.rotation <= 0 ? 180 : -180, d.rotation += d.rotation <= 0 ? 180 : -180) : (d.scaleY *= -1, d.skewX += d.skewX <= 0 ? 180 : -180)), d.zOrigin = f;
                                for (s in d) d[s] < 2e-5 && d[s] > -2e-5 && (d[s] = 0)
                            }
                            return r && (e._gsTransform = d, d.svg && (Ce && e.style[Re] ? i.delayedCall(.001, function() {
                                qe(e.style, Re)
                            }) : !Ce && e.getAttribute("transform") && i.delayedCall(.001, function() {
                                e.removeAttribute("transform")
                            }))), d
                        },
                        We = function(e) {
                            var t, i, r = this.data,
                                n = -r.rotation * N,
                                o = n + r.skewX * N,
                                s = (Math.cos(n) * r.scaleX * 1e5 | 0) / 1e5,
                                a = (Math.sin(n) * r.scaleX * 1e5 | 0) / 1e5,
                                l = (Math.sin(o) * -r.scaleY * 1e5 | 0) / 1e5,
                                u = (Math.cos(o) * r.scaleY * 1e5 | 0) / 1e5,
                                c = this.t.style,
                                h = this.t.currentStyle;
                            if (h) {
                                i = a, a = -l, l = -i, t = h.filter, c.filter = "";
                                var d, p, f = this.t.offsetWidth,
                                    _ = this.t.offsetHeight,
                                    g = "absolute" !== h.position,
                                    v = "progid:DXImageTransform.Microsoft.Matrix(M11=" + s + ", M12=" + a + ", M21=" + l + ", M22=" + u,
                                    y = r.x + f * r.xPercent / 100,
                                    b = r.y + _ * r.yPercent / 100;
                                if (null != r.ox && (d = (r.oxp ? f * r.ox * .01 : r.ox) - f / 2, p = (r.oyp ? _ * r.oy * .01 : r.oy) - _ / 2, y += d - (d * s + p * a), b += p - (d * l + p * u)), g ? (d = f / 2, p = _ / 2, v += ", Dx=" + (d - (d * s + p * a) + y) + ", Dy=" + (p - (d * l + p * u) + b) + ")") : v += ", sizingMethod='auto expand')", -1 !== t.indexOf("DXImageTransform.Microsoft.Matrix(") ? c.filter = t.replace(L, v) : c.filter = v + " " + t, 0 !== e && 1 !== e || 1 === s && 0 === a && 0 === l && 1 === u && (g && -1 === v.indexOf("Dx=0, Dy=0") || S.test(t) && 100 !== parseFloat(RegExp.$1) || -1 === t.indexOf(t.indexOf("Alpha")) && c.removeAttribute("filter")), !g) {
                                    var x, T, P, A = m < 8 ? 1 : -1;
                                    for (d = r.ieOffsetX || 0, p = r.ieOffsetY || 0, r.ieOffsetX = Math.round((f - ((s < 0 ? -s : s) * f + (a < 0 ? -a : a) * _)) / 2 + y), r.ieOffsetY = Math.round((_ - ((u < 0 ? -u : u) * _ + (l < 0 ? -l : l) * f)) / 2 + b), Ee = 0; Ee < 4; Ee++) T = se[Ee], x = h[T], i = -1 !== x.indexOf("px") ? parseFloat(x) : te(this.t, T, parseFloat(x), x.replace(E, "")) || 0, P = i !== r[T] ? Ee < 2 ? -r.ieOffsetX : -r.ieOffsetY : Ee < 2 ? d - r.ieOffsetX : p - r.ieOffsetY, c[T] = (r[T] = Math.round(i - P * (0 === Ee || 2 === Ee ? 1 : A))) + "px"
                                }
                            }
                        },
                        Xe = W.set3DTransformRatio = W.setTransformRatio = function(e) {
                            var t, i, r, n, o, s, a, l, u, c, h, d, p, _, m, g, v, y, b, x, T, E, S, P = this.data,
                                A = this.t.style,
                                C = P.rotation,
                                M = P.rotationX,
                                R = P.rotationY,
                                O = P.scaleX,
                                w = P.scaleY,
                                I = P.scaleZ,
                                D = P.x,
                                L = P.y,
                                B = P.z,
                                F = P.svg,
                                V = P.perspective,
                                k = P.force3D,
                                U = P.skewY,
                                G = P.skewX;
                            if (U && (G += U, C += U), ((1 === e || 0 === e) && "auto" === k && (this.tween._totalTime === this.tween._totalDuration || !this.tween._totalTime) || !k) && !B && !V && !R && !M && 1 === I || Ce && F || !Ie) return void(C || G || F ? (C *= N, E = G * N, S = 1e5, i = Math.cos(C) * O, o = Math.sin(C) * O, r = Math.sin(C - E) * -w, s = Math.cos(C - E) * w, E && "simple" === P.skewType && (t = Math.tan(E - U * N), t = Math.sqrt(1 + t * t), r *= t, s *= t, U && (t = Math.tan(U * N), t = Math.sqrt(1 + t * t), i *= t, o *= t)), F && (D += P.xOrigin - (P.xOrigin * i + P.yOrigin * r) + P.xOffset, L += P.yOrigin - (P.xOrigin * o + P.yOrigin * s) + P.yOffset, Ce && (P.xPercent || P.yPercent) && (m = this.t.getBBox(), D += .01 * P.xPercent * m.width, L += .01 * P.yPercent * m.height), m = 1e-6, D < m && D > -m && (D = 0), L < m && L > -m && (L = 0)), b = (i * S | 0) / S + "," + (o * S | 0) / S + "," + (r * S | 0) / S + "," + (s * S | 0) / S + "," + D + "," + L + ")", F && Ce ? this.t.setAttribute("transform", "matrix(" + b) : A[Re] = (P.xPercent || P.yPercent ? "translate(" + P.xPercent + "%," + P.yPercent + "%) matrix(" : "matrix(") + b) : A[Re] = (P.xPercent || P.yPercent ? "translate(" + P.xPercent + "%," + P.yPercent + "%) matrix(" : "matrix(") + O + ",0,0," + w + "," + D + "," + L + ")");
                            if (f && (m = 1e-4, O < m && O > -m && (O = I = 2e-5), w < m && w > -m && (w = I = 2e-5), !V || P.z || P.rotationX || P.rotationY || (V = 0)), C || G) C *= N, g = i = Math.cos(C), v = o = Math.sin(C), G && (C -= G * N, g = Math.cos(C), v = Math.sin(C), "simple" === P.skewType && (t = Math.tan((G - U) * N),
                                t = Math.sqrt(1 + t * t), g *= t, v *= t, P.skewY && (t = Math.tan(U * N), t = Math.sqrt(1 + t * t), i *= t, o *= t))), r = -v, s = g;
                            else {
                                if (!(R || M || 1 !== I || V || F)) return void(A[Re] = (P.xPercent || P.yPercent ? "translate(" + P.xPercent + "%," + P.yPercent + "%) translate3d(" : "translate3d(") + D + "px," + L + "px," + B + "px)" + (1 !== O || 1 !== w ? " scale(" + O + "," + w + ")" : ""));
                                i = s = 1, r = o = 0
                            }
                            c = 1, n = a = l = u = h = d = 0, p = V ? -1 / V : 0, _ = P.zOrigin, m = 1e-6, x = ",", T = "0", C = R * N, C && (g = Math.cos(C), v = Math.sin(C), l = -v, h = p * -v, n = i * v, a = o * v, c = g, p *= g, i *= g, o *= g), C = M * N, C && (g = Math.cos(C), v = Math.sin(C), t = r * g + n * v, y = s * g + a * v, u = c * v, d = p * v, n = r * -v + n * g, a = s * -v + a * g, c *= g, p *= g, r = t, s = y), 1 !== I && (n *= I, a *= I, c *= I, p *= I), 1 !== w && (r *= w, s *= w, u *= w, d *= w), 1 !== O && (i *= O, o *= O, l *= O, h *= O), (_ || F) && (_ && (D += n * -_, L += a * -_, B += c * -_ + _), F && (D += P.xOrigin - (P.xOrigin * i + P.yOrigin * r) + P.xOffset, L += P.yOrigin - (P.xOrigin * o + P.yOrigin * s) + P.yOffset), D < m && D > -m && (D = T), L < m && L > -m && (L = T), B < m && B > -m && (B = 0)), b = P.xPercent || P.yPercent ? "translate(" + P.xPercent + "%," + P.yPercent + "%) matrix3d(" : "matrix3d(", b += (i < m && i > -m ? T : i) + x + (o < m && o > -m ? T : o) + x + (l < m && l > -m ? T : l), b += x + (h < m && h > -m ? T : h) + x + (r < m && r > -m ? T : r) + x + (s < m && s > -m ? T : s), M || R || 1 !== I ? (b += x + (u < m && u > -m ? T : u) + x + (d < m && d > -m ? T : d) + x + (n < m && n > -m ? T : n), b += x + (a < m && a > -m ? T : a) + x + (c < m && c > -m ? T : c) + x + (p < m && p > -m ? T : p) + x) : b += ",0,0,0,0,1,0,", b += D + x + L + x + B + x + (V ? 1 + -B / V : 1) + ")", A[Re] = b
                        };
                    c = De.prototype, c.x = c.y = c.z = c.skewX = c.skewY = c.rotation = c.rotationX = c.rotationY = c.zOrigin = c.xPercent = c.yPercent = c.xOffset = c.yOffset = 0, c.scaleX = c.scaleY = c.scaleZ = 1, Pe("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin", {
                        parser: function(e, t, i, r, n, s, l) {
                            if (r._lastParsedTransform === l) return n;
                            r._lastParsedTransform = l;
                            var u, c = l.scale && "function" == typeof l.scale ? l.scale : 0;
                            "function" == typeof l[i] && (u = l[i], l[i] = t), c && (l.scale = c(v, e));
                            var h, d, p, f, _, m, y, b, x, T = e._gsTransform,
                                E = e.style,
                                S = Me.length,
                                P = l,
                                A = {},
                                C = He(e, o, !0, P.parseTransform),
                                M = P.transform && ("function" == typeof P.transform ? P.transform(v, g) : P.transform);
                            if (C.skewType = P.skewType || C.skewType || a.defaultSkewType, r._transform = C, M && "string" == typeof M && Re) d = j.style, d[Re] = M, d.display = "block", d.position = "absolute", G.body.appendChild(j), h = He(j, null, !1), "simple" === C.skewType && (h.scaleY *= Math.cos(h.skewX * N)), C.svg && (m = C.xOrigin, y = C.yOrigin, h.x -= C.xOffset, h.y -= C.yOffset, (P.transformOrigin || P.svgOrigin) && (M = {}, Ve(e, le(P.transformOrigin), M, P.svgOrigin, P.smoothOrigin, !0), m = M.xOrigin, y = M.yOrigin, h.x -= M.xOffset - C.xOffset, h.y -= M.yOffset - C.yOffset), (m || y) && (b = je(j, !0), h.x -= m - (m * b[0] + y * b[2]), h.y -= y - (m * b[1] + y * b[3]))), G.body.removeChild(j), h.perspective || (h.perspective = C.perspective), null != P.xPercent && (h.xPercent = ce(P.xPercent, C.xPercent)), null != P.yPercent && (h.yPercent = ce(P.yPercent, C.yPercent));
                            else if ("object" == typeof P) {
                                if (h = {
                                        scaleX: ce(null != P.scaleX ? P.scaleX : P.scale, C.scaleX),
                                        scaleY: ce(null != P.scaleY ? P.scaleY : P.scale, C.scaleY),
                                        scaleZ: ce(P.scaleZ, C.scaleZ),
                                        x: ce(P.x, C.x),
                                        y: ce(P.y, C.y),
                                        z: ce(P.z, C.z),
                                        xPercent: ce(P.xPercent, C.xPercent),
                                        yPercent: ce(P.yPercent, C.yPercent),
                                        perspective: ce(P.transformPerspective, C.perspective)
                                    }, null != (_ = P.directionalRotation))
                                    if ("object" == typeof _)
                                        for (d in _) P[d] = _[d];
                                    else P.rotation = _;
                                "string" == typeof P.x && -1 !== P.x.indexOf("%") && (h.x = 0, h.xPercent = ce(P.x, C.xPercent)), "string" == typeof P.y && -1 !== P.y.indexOf("%") && (h.y = 0, h.yPercent = ce(P.y, C.yPercent)), h.rotation = he("rotation" in P ? P.rotation : "shortRotation" in P ? P.shortRotation + "_short" : "rotationZ" in P ? P.rotationZ : C.rotation, C.rotation, "rotation", A), Ie && (h.rotationX = he("rotationX" in P ? P.rotationX : "shortRotationX" in P ? P.shortRotationX + "_short" : C.rotationX || 0, C.rotationX, "rotationX", A), h.rotationY = he("rotationY" in P ? P.rotationY : "shortRotationY" in P ? P.shortRotationY + "_short" : C.rotationY || 0, C.rotationY, "rotationY", A)), h.skewX = he(P.skewX, C.skewX), h.skewY = he(P.skewY, C.skewY)
                            }
                            for (Ie && null != P.force3D && (C.force3D = P.force3D, f = !0), p = C.force3D || C.z || C.rotationX || C.rotationY || h.z || h.rotationX || h.rotationY || h.perspective, p || null == P.scale || (h.scaleZ = 1); --S > -1;) x = Me[S], ((M = h[x] - C[x]) > 1e-6 || M < -1e-6 || null != P[x] || null != k[x]) && (f = !0, n = new be(C, x, C[x], M, n), x in A && (n.e = A[x]), n.xs0 = 0, n.plugin = s, r._overwriteProps.push(n.n));
                            return M = P.transformOrigin, C.svg && (M || P.svgOrigin) && (m = C.xOffset, y = C.yOffset, Ve(e, le(M), h, P.svgOrigin, P.smoothOrigin), n = xe(C, "xOrigin", (T ? C : h).xOrigin, h.xOrigin, n, "transformOrigin"), n = xe(C, "yOrigin", (T ? C : h).yOrigin, h.yOrigin, n, "transformOrigin"), m === C.xOffset && y === C.yOffset || (n = xe(C, "xOffset", T ? m : C.xOffset, C.xOffset, n, "transformOrigin"), n = xe(C, "yOffset", T ? y : C.yOffset, C.yOffset, n, "transformOrigin")), M = "0px 0px"), (M || Ie && p && C.zOrigin) && (Re ? (f = !0, x = we, M = (M || ee(e, x, o, !1, "50% 50%")) + "", n = new be(E, x, 0, 0, n, -1, "transformOrigin"), n.b = E[x], n.plugin = s, Ie ? (d = C.zOrigin, M = M.split(" "), C.zOrigin = (M.length > 2 && (0 === d || "0px" !== M[2]) ? parseFloat(M[2]) : d) || 0, n.xs0 = n.e = M[0] + " " + (M[1] || "50%") + " 0px", n = new be(C, "zOrigin", 0, 0, n, -1, n.n), n.b = d, n.xs0 = n.e = C.zOrigin) : n.xs0 = n.e = M) : le(M + "", C)), f && (r._transformType = C.svg && Ce || !p && 3 !== this._transformType ? 2 : 3), u && (l[i] = u), c && (l.scale = c), n
                        },
                        prefix: !0
                    }), Pe("boxShadow", {
                        defaultValue: "0px 0px 0px 0px #999",
                        prefix: !0,
                        color: !0,
                        multi: !0,
                        keyword: "inset"
                    }), Pe("borderRadius", {
                        defaultValue: "0px",
                        parser: function(e, t, i, r, s, a) {
                            t = this.format(t);
                            var l, u, c, h, d, p, f, _, m, g, v, y, b, x, T, E, S = ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius"],
                                P = e.style;
                            for (m = parseFloat(e.offsetWidth), g = parseFloat(e.offsetHeight), l = t.split(" "), u = 0; u < S.length; u++) this.p.indexOf("border") && (S[u] = J(S[u])), d = h = ee(e, S[u], o, !1, "0px"), -1 !== d.indexOf(" ") && (h = d.split(" "), d = h[0], h = h[1]), p = c = l[u], f = parseFloat(d), y = d.substr((f + "").length), b = "=" === p.charAt(1), b ? (_ = parseInt(p.charAt(0) + "1", 10), p = p.substr(2), _ *= parseFloat(p), v = p.substr((_ + "").length - (_ < 0 ? 1 : 0)) || "") : (_ = parseFloat(p), v = p.substr((_ + "").length)), "" === v && (v = n[i] || y), v !== y && (x = te(e, "borderLeft", f, y), T = te(e, "borderTop", f, y), "%" === v ? (d = x / m * 100 + "%", h = T / g * 100 + "%") : "em" === v ? (E = te(e, "borderLeft", 1, "em"), d = x / E + "em", h = T / E + "em") : (d = x + "px", h = T + "px"), b && (p = parseFloat(d) + _ + v, c = parseFloat(h) + _ + v)), s = Te(P, S[u], d + " " + h, p + " " + c, !1, "0px", s);
                            return s
                        },
                        prefix: !0,
                        formatter: ge("0px 0px 0px 0px", !1, !0)
                    }), Pe("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius", {
                        defaultValue: "0px",
                        parser: function(e, t, i, r, n, s) {
                            return Te(e.style, i, this.format(ee(e, i, o, !1, "0px 0px")), this.format(t), !1, "0px", n)
                        },
                        prefix: !0,
                        formatter: ge("0px 0px", !1, !0)
                    }), Pe("backgroundPosition", {
                        defaultValue: "0 0",
                        parser: function(e, t, i, r, n, s) {
                            var a, l, u, c, h, d, p = "background-position",
                                f = o || $(e, null),
                                _ = this.format((f ? m ? f.getPropertyValue(p + "-x") + " " + f.getPropertyValue(p + "-y") : f.getPropertyValue(p) : e.currentStyle.backgroundPositionX + " " + e.currentStyle.backgroundPositionY) || "0 0"),
                                g = this.format(t);
                            if (-1 !== _.indexOf("%") != (-1 !== g.indexOf("%")) && g.split(",").length < 2 && (d = ee(e, "backgroundImage").replace(O, "")) && "none" !== d) {
                                for (a = _.split(" "), l = g.split(" "), H.setAttribute("src", d), u = 2; --u > -1;) _ = a[u], (c = -1 !== _.indexOf("%")) !== (-1 !== l[u].indexOf("%")) && (h = 0 === u ? e.offsetWidth - H.width : e.offsetHeight - H.height, a[u] = c ? parseFloat(_) / 100 * h + "px" : parseFloat(_) / h * 100 + "%");
                                _ = a.join(" ")
                            }
                            return this.parseComplex(e.style, _, g, n, s)
                        },
                        formatter: le
                    }), Pe("backgroundSize", {
                        defaultValue: "0 0",
                        formatter: function(e) {
                            return e += "", le(-1 === e.indexOf(" ") ? e + " " + e : e)
                        }
                    }), Pe("perspective", {
                        defaultValue: "0px",
                        prefix: !0
                    }), Pe("perspectiveOrigin", {
                        defaultValue: "50% 50%",
                        prefix: !0
                    }), Pe("transformStyle", {
                        prefix: !0
                    }), Pe("backfaceVisibility", {
                        prefix: !0
                    }), Pe("userSelect", {
                        prefix: !0
                    }), Pe("margin", {
                        parser: ve("marginTop,marginRight,marginBottom,marginLeft")
                    }), Pe("padding", {
                        parser: ve("paddingTop,paddingRight,paddingBottom,paddingLeft")
                    }), Pe("clip", {
                        defaultValue: "rect(0px,0px,0px,0px)",
                        parser: function(e, t, i, r, n, s) {
                            var a, l, u;
                            return m < 9 ? (l = e.currentStyle, u = m < 8 ? " " : ",", a = "rect(" + l.clipTop + u + l.clipRight + u + l.clipBottom + u + l.clipLeft + ")", t = this.format(t).split(",").join(u)) : (a = this.format(ee(e, this.p, o, !1, this.dflt)), t = this.format(t)), this.parseComplex(e.style, a, t, n, s)
                        }
                    }), Pe("textShadow", {
                        defaultValue: "0px 0px 0px #999",
                        color: !0,
                        multi: !0
                    }), Pe("autoRound,strictUnits", {
                        parser: function(e, t, i, r, n) {
                            return n
                        }
                    }), Pe("border", {
                        defaultValue: "0px solid #000",
                        parser: function(e, t, i, r, n, s) {
                            var a = ee(e, "borderTopWidth", o, !1, "0px"),
                                l = this.format(t).split(" "),
                                u = l[0].replace(E, "");
                            return "px" !== u && (a = parseFloat(a) / te(e, "borderTopWidth", 1, u) + u), this.parseComplex(e.style, this.format(a + " " + ee(e, "borderTopStyle", o, !1, "solid") + " " + ee(e, "borderTopColor", o, !1, "#000")), l.join(" "), n, s)
                        },
                        color: !0,
                        formatter: function(e) {
                            var t = e.split(" ");
                            return t[0] + " " + (t[1] || "solid") + " " + (e.match(me) || ["#000"])[0]
                        }
                    }), Pe("borderWidth", {
                        parser: ve("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")
                    }), Pe("float,cssFloat,styleFloat", {
                        parser: function(e, t, i, r, n, o) {
                            var s = e.style,
                                a = "cssFloat" in s ? "cssFloat" : "styleFloat";
                            return new be(s, a, 0, 0, n, -1, i, !1, 0, s[a], t)
                        }
                    });
                    var Ye = function(e) {
                        var t, i = this.t,
                            r = i.filter || ee(this.data, "filter") || "",
                            n = this.s + this.c * e | 0;
                        100 === n && (-1 === r.indexOf("atrix(") && -1 === r.indexOf("radient(") && -1 === r.indexOf("oader(") ? (i.removeAttribute("filter"), t = !ee(this.data, "filter")) : (i.filter = r.replace(A, ""), t = !0)), t || (this.xn1 && (i.filter = r = r || "alpha(opacity=" + n + ")"), -1 === r.indexOf("pacity") ? 0 === n && this.xn1 || (i.filter = r + " alpha(opacity=" + n + ")") : i.filter = r.replace(S, "opacity=" + n))
                    };
                    Pe("opacity,alpha,autoAlpha", {
                        defaultValue: "1",
                        parser: function(e, t, i, r, n, s) {
                            var a = parseFloat(ee(e, "opacity", o, !1, "1")),
                                l = e.style,
                                u = "autoAlpha" === i;
                            return "string" == typeof t && "=" === t.charAt(1) && (t = ("-" === t.charAt(0) ? -1 : 1) * parseFloat(t.substr(2)) + a), u && 1 === a && "hidden" === ee(e, "visibility", o) && 0 !== t && (a = 0), Y ? n = new be(l, "opacity", a, t - a, n) : (n = new be(l, "opacity", 100 * a, 100 * (t - a), n), n.xn1 = u ? 1 : 0, l.zoom = 1, n.type = 2, n.b = "alpha(opacity=" + n.s + ")", n.e = "alpha(opacity=" + (n.s + n.c) + ")", n.data = e, n.plugin = s, n.setRatio = Ye), u && (n = new be(l, "visibility", 0, 0, n, -1, null, !1, 0, 0 !== a ? "inherit" : "hidden", 0 === t ? "hidden" : "inherit"), n.xs0 = "inherit", r._overwriteProps.push(n.n), r._overwriteProps.push(i)), n
                        }
                    });
                    var qe = function(e, t) {
                            t && (e.removeProperty ? ("ms" !== t.substr(0, 2) && "webkit" !== t.substr(0, 6) || (t = "-" + t), e.removeProperty(t.replace(M, "-$1").toLowerCase())) : e.removeAttribute(t))
                        },
                        Ke = function(e) {
                            if (this.t._gsClassPT = this, 1 === e || 0 === e) {
                                this.t.setAttribute("class", 0 === e ? this.b : this.e);
                                for (var t = this.data, i = this.t.style; t;) t.v ? i[t.p] = t.v : qe(i, t.p), t = t._next;
                                1 === e && this.t._gsClassPT === this && (this.t._gsClassPT = null)
                            } else this.t.getAttribute("class") !== this.e && this.t.setAttribute("class", this.e)
                        };
                    Pe("className", {
                        parser: function(e, t, i, n, s, a, l) {
                            var u, c, h, d, p, f = e.getAttribute("class") || "",
                                _ = e.style.cssText;
                            if (s = n._classNamePT = new be(e, i, 0, 0, s, 2), s.setRatio = Ke, s.pr = -11, r = !0, s.b = f, c = re(e, o), h = e._gsClassPT) {
                                for (d = {}, p = h.data; p;) d[p.p] = 1, p = p._next;
                                h.setRatio(1)
                            }
                            return e._gsClassPT = s, s.e = "=" !== t.charAt(1) ? t : f.replace(new RegExp("(?:\\s|^)" + t.substr(2) + "(?![\\w-])"), "") + ("+" === t.charAt(0) ? " " + t.substr(2) : ""), e.setAttribute("class", s.e), u = ne(e, c, re(e), l, d), e.setAttribute("class", f), s.data = u.firstMPT, e.style.cssText = _, s = s.xfirst = n.parse(e, u.difs, s, a)
                        }
                    });
                    var Qe = function(e) {
                        if ((1 === e || 0 === e) && this.data._totalTime === this.data._totalDuration && "isFromStart" !== this.data.data) {
                            var t, i, r, n, o, s = this.t.style,
                                a = u.transform.parse;
                            if ("all" === this.e) s.cssText = "", n = !0;
                            else
                                for (t = this.e.split(" ").join("").split(","), r = t.length; --r > -1;) i = t[r], u[i] && (u[i].parse === a ? n = !0 : i = "transformOrigin" === i ? we : u[i].p), qe(s, i);
                            n && (qe(s, Re), (o = this.t._gsTransform) && (o.svg && (this.t.removeAttribute("data-svg-origin"), this.t.removeAttribute("transform")), delete this.t._gsTransform))
                        }
                    };
                    for (Pe("clearProps", {
                            parser: function(e, t, i, n, o) {
                                return o = new be(e, i, 0, 0, o, 2), o.setRatio = Qe, o.e = t, o.pr = -10, o.data = n._tween, r = !0, o
                            }
                        }), c = "bezier,throwProps,physicsProps,physics2D".split(","), Ee = c.length; Ee--;) Ae(c[Ee]);
                    c = a.prototype, c._firstPT = c._lastParsedTransform = c._transform = null, c._onInitTween = function(e, t, i, l) {
                        if (!e.nodeType) return !1;
                        this._target = g = e, this._tween = i, this._vars = t, v = l, h = t.autoRound, r = !1, n = t.suffixMap || a.suffixMap, o = $(e, ""), s = this._overwriteProps;
                        var c, f, m, y, b, x, T, E, S, A = e.style;
                        if (d && "" === A.zIndex && ("auto" !== (c = ee(e, "zIndex", o)) && "" !== c || this._addLazySet(A, "zIndex", 0)), "string" == typeof t && (y = A.cssText, c = re(e, o), A.cssText = y + ";" + t, c = ne(e, c, re(e)).difs, !Y && P.test(t) && (c.opacity = parseFloat(RegExp.$1)), t = c, A.cssText = y), t.className ? this._firstPT = f = u.className.parse(e, t.className, "className", this, null, null, t) : this._firstPT = f = this.parse(e, t, null), this._transformType) {
                            for (S = 3 === this._transformType, Re ? p && (d = !0, "" === A.zIndex && ("auto" !== (T = ee(e, "zIndex", o)) && "" !== T || this._addLazySet(A, "zIndex", 0)), _ && this._addLazySet(A, "WebkitBackfaceVisibility", this._vars.WebkitBackfaceVisibility || (S ? "visible" : "hidden"))) : A.zoom = 1, m = f; m && m._next;) m = m._next;
                            E = new be(e, "transform", 0, 0, null, 2), this._linkCSSP(E, null, m), E.setRatio = Re ? Xe : We, E.data = this._transform || He(e, o, !0), E.tween = i, E.pr = -1, s.pop()
                        }
                        if (r) {
                            for (; f;) {
                                for (x = f._next, m = y; m && m.pr > f.pr;) m = m._next;
                                (f._prev = m ? m._prev : b) ? f._prev._next = f: y = f, (f._next = m) ? m._prev = f : b = f, f = x
                            }
                            this._firstPT = y
                        }
                        return !0
                    }, c.parse = function(e, t, i, r) {
                        var s, a, l, c, d, p, f, _, m, y, b = e.style;
                        for (s in t) {
                            if (p = t[s], "function" == typeof p && (p = p(v, g)), a = u[s]) i = a.parse(e, p, s, this, i, r, t);
                            else {
                                if ("--" === s.substr(0, 2)) {
                                    this._tween._propLookup[s] = this._addTween.call(this._tween, e.style, "setProperty", $(e).getPropertyValue(s) + "", p + "", s, !1, s);
                                    continue
                                }
                                d = ee(e, s, o) + "", m = "string" == typeof p, "color" === s || "fill" === s || "stroke" === s || -1 !== s.indexOf("Color") || m && C.test(p) ? (m || (p = fe(p), p = (p.length > 3 ? "rgba(" : "rgb(") + p.join(",") + ")"), i = Te(b, s, d, p, !0, "transparent", i, 0, r)) : m && F.test(p) ? i = Te(b, s, d, p, !0, null, i, 0, r) : (l = parseFloat(d), f = l || 0 === l ? d.substr((l + "").length) : "", "" !== d && "auto" !== d || ("width" === s || "height" === s ? (l = ae(e, s, o), f = "px") : "left" === s || "top" === s ? (l = ie(e, s, o), f = "px") : (l = "opacity" !== s ? 0 : 1, f = "")), y = m && "=" === p.charAt(1), y ? (c = parseInt(p.charAt(0) + "1", 10), p = p.substr(2), c *= parseFloat(p), _ = p.replace(E, "")) : (c = parseFloat(p), _ = m ? p.replace(E, "") : ""), "" === _ && (_ = s in n ? n[s] : f), p = c || 0 === c ? (y ? c + l : c) + _ : t[s], f !== _ && ("" === _ && "lineHeight" !== s || (c || 0 === c) && l && (l = te(e, s, l, f), "%" === _ ? (l /= te(e, s, 100, "%") / 100, !0 !== t.strictUnits && (d = l + "%")) : "em" === _ || "rem" === _ || "vw" === _ || "vh" === _ ? l /= te(e, s, 1, _) : "px" !== _ && (c = te(e, s, c, _), _ = "px"), y && (c || 0 === c) && (p = c + l + _))), y && (c += l), !l && 0 !== l || !c && 0 !== c ? void 0 !== b[s] && (p || p + "" != "NaN" && null != p) ? (i = new be(b, s, c || l || 0, 0, i, -1, s, !1, 0, d, p), i.xs0 = "none" !== p || "display" !== s && -1 === s.indexOf("Style") ? p : d) : K(t[s]) : (i = new be(b, s, l, c - l, i, 0, s, !1 !== h && ("px" === _ || "zIndex" === s), 0, d, p), i.xs0 = _))
                            }
                            r && i && !i.plugin && (i.plugin = r)
                        }
                        return i
                    }, c.setRatio = function(e) {
                        var t, i, r, n = this._firstPT;
                        if (1 !== e || this._tween._time !== this._tween._duration && 0 !== this._tween._time)
                            if (e || this._tween._time !== this._tween._duration && 0 !== this._tween._time || -1e-6 === this._tween._rawPrevTime)
                                for (; n;) {
                                    if (t = n.c * e + n.s, n.r ? t = Math.round(t) : t < 1e-6 && t > -1e-6 && (t = 0), n.type)
                                        if (1 === n.type)
                                            if (2 === (r = n.l)) n.t[n.p] = n.xs0 + t + n.xs1 + n.xn1 + n.xs2;
                                            else if (3 === r) n.t[n.p] = n.xs0 + t + n.xs1 + n.xn1 + n.xs2 + n.xn2 + n.xs3;
                                    else if (4 === r) n.t[n.p] = n.xs0 + t + n.xs1 + n.xn1 + n.xs2 + n.xn2 + n.xs3 + n.xn3 + n.xs4;
                                    else if (5 === r) n.t[n.p] = n.xs0 + t + n.xs1 + n.xn1 + n.xs2 + n.xn2 + n.xs3 + n.xn3 + n.xs4 + n.xn4 + n.xs5;
                                    else {
                                        for (i = n.xs0 + t + n.xs1, r = 1; r < n.l; r++) i += n["xn" + r] + n["xs" + (r + 1)];
                                        n.t[n.p] = i
                                    } else -1 === n.type ? n.t[n.p] = n.xs0 : n.setRatio && n.setRatio(e);
                                    else n.t[n.p] = t + n.xs0;
                                    n = n._next
                                } else
                                    for (; n;) 2 !== n.type ? n.t[n.p] = n.b : n.setRatio(e), n = n._next;
                            else
                                for (; n;) {
                                    if (2 !== n.type)
                                        if (n.r && -1 !== n.type)
                                            if (t = Math.round(n.s + n.c), n.type) {
                                                if (1 === n.type) {
                                                    for (r = n.l, i = n.xs0 + t + n.xs1, r = 1; r < n.l; r++) i += n["xn" + r] + n["xs" + (r + 1)];
                                                    n.t[n.p] = i
                                                }
                                            } else n.t[n.p] = t + n.xs0;
                                    else n.t[n.p] = n.e;
                                    else n.setRatio(e);
                                    n = n._next
                                }
                    }, c._enableTransforms = function(e) {
                        this._transform = this._transform || He(this._target, o, !0), this._transformType = this._transform.svg && Ce || !e && 3 !== this._transformType ? 2 : 3
                    };
                    var Ze = function(e) {
                        this.t[this.p] = this.e, this.data._linkCSSP(this, this._next, null, !0)
                    };
                    c._addLazySet = function(e, t, i) {
                        var r = this._firstPT = new be(e, t, 0, 0, this._firstPT, 2);
                        r.e = i, r.setRatio = Ze, r.data = this
                    }, c._linkCSSP = function(e, t, i, r) {
                        return e && (t && (t._prev = e), e._next && (e._next._prev = e._prev), e._prev ? e._prev._next = e._next : this._firstPT === e && (this._firstPT = e._next, r = !0), i ? i._next = e : r || null !== this._firstPT || (this._firstPT = e), e._next = t, e._prev = i), e
                    }, c._mod = function(e) {
                        for (var t = this._firstPT; t;) "function" == typeof e[t.p] && e[t.p] === Math.round && (t.r = 1), t = t._next
                    }, c._kill = function(e) {
                        var i, r, n, o = e;
                        if (e.autoAlpha || e.alpha) {
                            o = {};
                            for (r in e) o[r] = e[r];
                            o.opacity = 1, o.autoAlpha && (o.visibility = 1)
                        }
                        for (e.className && (i = this._classNamePT) && (n = i.xfirst, n && n._prev ? this._linkCSSP(n._prev, i._next, n._prev._prev) : n === this._firstPT && (this._firstPT = i._next), i._next && this._linkCSSP(i._next, i._next._next, n._prev), this._classNamePT = null), i = this._firstPT; i;) i.plugin && i.plugin !== r && i.plugin._kill && (i.plugin._kill(e), r = i.plugin), i = i._next;
                        return t.prototype._kill.call(this, o)
                    };
                    var Je = function(e, t, i) {
                        var r, n, o, s;
                        if (e.slice)
                            for (n = e.length; --n > -1;) Je(e[n], t, i);
                        else
                            for (r = e.childNodes, n = r.length; --n > -1;) o = r[n], s = o.type, o.style && (t.push(re(o)), i && i.push(o)), 1 !== s && 9 !== s && 11 !== s || !o.childNodes.length || Je(o, t, i)
                    };
                    return a.cascadeTo = function(e, t, r) {
                        var n, o, s, a, l = i.to(e, t, r),
                            u = [l],
                            c = [],
                            h = [],
                            d = [],
                            p = i._internals.reservedProps;
                        for (e = l._targets || l.target, Je(e, c, d), l.render(t, !0, !0), Je(e, h), l.render(0, !0, !0), l._enabled(!0), n = d.length; --n > -1;)
                            if (o = ne(d[n], c[n], h[n]), o.firstMPT) {
                                o = o.difs;
                                for (s in r) p[s] && (o[s] = r[s]);
                                a = {};
                                for (s in o) a[s] = c[n][s];
                                u.push(i.fromTo(d[n], t, a, o))
                            }
                        return u
                    }, t.activate([a]), a
                }, !0),
                function() {
                    var t = e._gsDefine.plugin({
                            propName: "roundProps",
                            version: "1.6.0",
                            priority: -1,
                            API: 2,
                            init: function(e, t, i) {
                                return this._tween = i, !0
                            }
                        }),
                        i = function(e) {
                            for (; e;) e.f || e.blob || (e.m = Math.round), e = e._next
                        },
                        r = t.prototype;
                    r._onInitAllProps = function() {
                        for (var e, t, r, n = this._tween, o = n.vars.roundProps.join ? n.vars.roundProps : n.vars.roundProps.split(","), s = o.length, a = {}, l = n._propLookup.roundProps; --s > -1;) a[o[s]] = Math.round;
                        for (s = o.length; --s > -1;)
                            for (e = o[s], t = n._firstPT; t;) r = t._next, t.pg ? t.t._mod(a) : t.n === e && (2 === t.f && t.t ? i(t.t._firstPT) : (this._add(t.t, e, t.s, t.c), r && (r._prev = t._prev), t._prev ? t._prev._next = r : n._firstPT === t && (n._firstPT = r), t._next = t._prev = null, n._propLookup[e] = l)), t = r;
                        return !1
                    }, r._add = function(e, t, i, r) {
                        this._addTween(e, t, i, i + r, t, Math.round), this._overwriteProps.push(t)
                    }
                }(),
                function() {
                    e._gsDefine.plugin({
                        propName: "attr",
                        API: 2,
                        version: "0.6.1",
                        init: function(e, t, i, r) {
                            var n, o;
                            if ("function" != typeof e.setAttribute) return !1;
                            for (n in t) o = t[n], "function" == typeof o && (o = o(r, e)), this._addTween(e, "setAttribute", e.getAttribute(n) + "", o + "", n, !1, n), this._overwriteProps.push(n);
                            return !0
                        }
                    })
                }(), e._gsDefine.plugin({
                    propName: "directionalRotation",
                    version: "0.3.1",
                    API: 2,
                    init: function(e, t, i, r) {
                        "object" != typeof t && (t = {
                            rotation: t
                        }), this.finals = {};
                        var n, o, s, a, l, u, c = !0 === t.useRadians ? 2 * Math.PI : 360;
                        for (n in t) "useRadians" !== n && (a = t[n], "function" == typeof a && (a = a(r, e)), u = (a + "").split("_"), o = u[0], s = parseFloat("function" != typeof e[n] ? e[n] : e[n.indexOf("set") || "function" != typeof e["get" + n.substr(3)] ? n : "get" + n.substr(3)]()), a = this.finals[n] = "string" == typeof o && "=" === o.charAt(1) ? s + parseInt(o.charAt(0) + "1", 10) * Number(o.substr(2)) : Number(o) || 0, l = a - s, u.length && (o = u.join("_"), -1 !== o.indexOf("short") && (l %= c) !== l % (c / 2) && (l = l < 0 ? l + c : l - c), -1 !== o.indexOf("_cw") && l < 0 ? l = (l + 9999999999 * c) % c - (l / c | 0) * c : -1 !== o.indexOf("ccw") && l > 0 && (l = (l - 9999999999 * c) % c - (l / c | 0) * c)), (l > 1e-6 || l < -1e-6) && (this._addTween(e, n, s, s + l, n), this._overwriteProps.push(n)));
                        return !0
                    },
                    set: function(e) {
                        var t;
                        if (1 !== e) this._super.setRatio.call(this, e);
                        else
                            for (t = this._firstPT; t;) t.f ? t.t[t.p](this.finals[t.p]) : t.t[t.p] = this.finals[t.p], t = t._next
                    }
                })._autoCSS = !0, e._gsDefine("easing.Back", ["easing.Ease"], function(t) {
                    var i, r, n, o = e.GreenSockGlobals || e,
                        s = o.com.greensock,
                        a = 2 * Math.PI,
                        l = Math.PI / 2,
                        u = s._class,
                        c = function(e, i) {
                            var r = u("easing." + e, function() {}, !0),
                                n = r.prototype = new t;
                            return n.constructor = r, n.getRatio = i, r
                        },
                        h = t.register || function() {},
                        d = function(e, t, i, r, n) {
                            var o = u("easing." + e, {
                                easeOut: new t,
                                easeIn: new i,
                                easeInOut: new r
                            }, !0);
                            return h(o, e), o
                        },
                        p = function(e, t, i) {
                            this.t = e, this.v = t, i && (this.next = i, i.prev = this, this.c = i.v - t, this.gap = i.t - e)
                        },
                        f = function(e, i) {
                            var r = u("easing." + e, function(e) {
                                    this._p1 = e || 0 === e ? e : 1.70158, this._p2 = 1.525 * this._p1
                                }, !0),
                                n = r.prototype = new t;
                            return n.constructor = r, n.getRatio = i, n.config = function(e) {
                                return new r(e)
                            }, r
                        },
                        _ = d("Back", f("BackOut", function(e) {
                            return (e -= 1) * e * ((this._p1 + 1) * e + this._p1) + 1
                        }), f("BackIn", function(e) {
                            return e * e * ((this._p1 + 1) * e - this._p1)
                        }), f("BackInOut", function(e) {
                            return (e *= 2) < 1 ? .5 * e * e * ((this._p2 + 1) * e - this._p2) : .5 * ((e -= 2) * e * ((this._p2 + 1) * e + this._p2) + 2)
                        })),
                        m = u("easing.SlowMo", function(e, t, i) {
                            t = t || 0 === t ? t : .7, null == e ? e = .7 : e > 1 && (e = 1), this._p = 1 !== e ? t : 0, this._p1 = (1 - e) / 2, this._p2 = e, this._p3 = this._p1 + this._p2, this._calcEnd = !0 === i
                        }, !0),
                        g = m.prototype = new t;
                    return g.constructor = m, g.getRatio = function(e) {
                        var t = e + (.5 - e) * this._p;
                        return e < this._p1 ? this._calcEnd ? 1 - (e = 1 - e / this._p1) * e : t - (e = 1 - e / this._p1) * e * e * e * t : e > this._p3 ? this._calcEnd ? 1 - (e = (e - this._p3) / this._p1) * e : t + (e - t) * (e = (e - this._p3) / this._p1) * e * e * e : this._calcEnd ? 1 : t
                    }, m.ease = new m(.7, .7), g.config = m.config = function(e, t, i) {
                        return new m(e, t, i)
                    }, i = u("easing.SteppedEase", function(e, t) {
                        e = e || 1, this._p1 = 1 / e, this._p2 = e + (t ? 0 : 1), this._p3 = t ? 1 : 0
                    }, !0), g = i.prototype = new t, g.constructor = i, g.getRatio = function(e) {
                        return e < 0 ? e = 0 : e >= 1 && (e = .999999999), ((this._p2 * e | 0) + this._p3) * this._p1
                    }, g.config = i.config = function(e, t) {
                        return new i(e, t)
                    }, r = u("easing.RoughEase", function(e) {
                        e = e || {};
                        for (var i, r, n, o, s, a, l = e.taper || "none", u = [], c = 0, h = 0 | (e.points || 20), d = h, f = !1 !== e.randomize, _ = !0 === e.clamp, m = e.template instanceof t ? e.template : null, g = "number" == typeof e.strength ? .4 * e.strength : .4; --d > -1;) i = f ? Math.random() : 1 / h * d, r = m ? m.getRatio(i) : i, "none" === l ? n = g : "out" === l ? (o = 1 - i, n = o * o * g) : "in" === l ? n = i * i * g : i < .5 ? (o = 2 * i, n = o * o * .5 * g) : (o = 2 * (1 - i), n = o * o * .5 * g), f ? r += Math.random() * n - .5 * n : d % 2 ? r += .5 * n : r -= .5 * n, _ && (r > 1 ? r = 1 : r < 0 && (r = 0)), u[c++] = {
                            x: i,
                            y: r
                        };
                        for (u.sort(function(e, t) {
                                return e.x - t.x
                            }), a = new p(1, 1, null), d = h; --d > -1;) s = u[d], a = new p(s.x, s.y, a);
                        this._prev = new p(0, 0, 0 !== a.t ? a : a.next)
                    }, !0), g = r.prototype = new t, g.constructor = r, g.getRatio = function(e) {
                        var t = this._prev;
                        if (e > t.t) {
                            for (; t.next && e >= t.t;) t = t.next;
                            t = t.prev
                        } else
                            for (; t.prev && e <= t.t;) t = t.prev;
                        return this._prev = t, t.v + (e - t.t) / t.gap * t.c
                    }, g.config = function(e) {
                        return new r(e)
                    }, r.ease = new r, d("Bounce", c("BounceOut", function(e) {
                        return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375
                    }), c("BounceIn", function(e) {
                        return (e = 1 - e) < 1 / 2.75 ? 1 - 7.5625 * e * e : e < 2 / 2.75 ? 1 - (7.5625 * (e -= 1.5 / 2.75) * e + .75) : e < 2.5 / 2.75 ? 1 - (7.5625 * (e -= 2.25 / 2.75) * e + .9375) : 1 - (7.5625 * (e -= 2.625 / 2.75) * e + .984375)
                    }), c("BounceInOut", function(e) {
                        var t = e < .5;
                        return e = t ? 1 - 2 * e : 2 * e - 1, e < 1 / 2.75 ? e *= 7.5625 * e : e = e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375, t ? .5 * (1 - e) : .5 * e + .5
                    })), d("Circ", c("CircOut", function(e) {
                        return Math.sqrt(1 - (e -= 1) * e)
                    }), c("CircIn", function(e) {
                        return -(Math.sqrt(1 - e * e) - 1)
                    }), c("CircInOut", function(e) {
                        return (e *= 2) < 1 ? -.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1)
                    })), n = function(e, i, r) {
                        var n = u("easing." + e, function(e, t) {
                                this._p1 = e >= 1 ? e : 1, this._p2 = (t || r) / (e < 1 ? e : 1), this._p3 = this._p2 / a * (Math.asin(1 / this._p1) || 0), this._p2 = a / this._p2
                            }, !0),
                            o = n.prototype = new t;
                        return o.constructor = n, o.getRatio = i, o.config = function(e, t) {
                            return new n(e, t)
                        }, n
                    }, d("Elastic", n("ElasticOut", function(e) {
                        return this._p1 * Math.pow(2, -10 * e) * Math.sin((e - this._p3) * this._p2) + 1
                    }, .3), n("ElasticIn", function(e) {
                        return -this._p1 * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - this._p3) * this._p2)
                    }, .3), n("ElasticInOut", function(e) {
                        return (e *= 2) < 1 ? this._p1 * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - this._p3) * this._p2) * -.5 : this._p1 * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - this._p3) * this._p2) * .5 + 1
                    }, .45)), d("Expo", c("ExpoOut", function(e) {
                        return 1 - Math.pow(2, -10 * e)
                    }), c("ExpoIn", function(e) {
                        return Math.pow(2, 10 * (e - 1)) - .001
                    }), c("ExpoInOut", function(e) {
                        return (e *= 2) < 1 ? .5 * Math.pow(2, 10 * (e - 1)) : .5 * (2 - Math.pow(2, -10 * (e - 1)))
                    })), d("Sine", c("SineOut", function(e) {
                        return Math.sin(e * l)
                    }), c("SineIn", function(e) {
                        return 1 - Math.cos(e * l)
                    }), c("SineInOut", function(e) {
                        return -.5 * (Math.cos(Math.PI * e) - 1)
                    })), u("easing.EaseLookup", {
                        find: function(e) {
                            return t.map[e]
                        }
                    }, !0), h(o.SlowMo, "SlowMo", "ease,"), h(r, "RoughEase", "ease,"), h(i, "SteppedEase", "ease,"), _
                }, !0)
        }), e._gsDefine && e._gsQueue.pop()(),
        function(e, t) {
            "use strict";
            var i = {},
                r = e.document,
                n = e.GreenSockGlobals = e.GreenSockGlobals || e;
            if (!n.TweenLite) {
                var o, s, a, l, u, c = function(e) {
                        var t, i = e.split("."),
                            r = n;
                        for (t = 0; t < i.length; t++) r[i[t]] = r = r[i[t]] || {};
                        return r
                    },
                    h = c("com.greensock"),
                    d = function(e) {
                        var t, i = [],
                            r = e.length;
                        for (t = 0; t !== r; i.push(e[t++]));
                        return i
                    },
                    p = function() {},
                    f = function() {
                        var e = Object.prototype.toString,
                            t = e.call([]);
                        return function(i) {
                            return null != i && (i instanceof Array || "object" == typeof i && !!i.push && e.call(i) === t)
                        }
                    }(),
                    _ = {},
                    m = function(t, r, o, s) {
                        this.sc = _[t] ? _[t].sc : [], _[t] = this, this.gsClass = null, this.func = o;
                        var a = [];
                        this.check = function(l) {
                            for (var u, h, d, p, f = r.length, g = f; --f > -1;)(u = _[r[f]] || new m(r[f], [])).gsClass ? (a[f] = u.gsClass, g--) : l && u.sc.push(this);
                            if (0 === g && o) {
                                if (h = ("com.greensock." + t).split("."), d = h.pop(), p = c(h.join("."))[d] = this.gsClass = o.apply(o, a), s)
                                    if (n[d] = i[d] = p, "undefined" != typeof module && module.exports)
                                        if ("TweenMax" === t) {
                                            module.exports = i.TweenMax = p;
                                            for (f in i) p[f] = i[f]
                                        } else i.TweenMax && (i.TweenMax[d] = p);
                                else "function" == typeof define && define.amd && define((e.GreenSockAMDPath ? e.GreenSockAMDPath + "/" : "") + t.split(".").pop(), [], function() {
                                    return p
                                });
                                for (f = 0; f < this.sc.length; f++) this.sc[f].check()
                            }
                        }, this.check(!0)
                    },
                    g = e._gsDefine = function(e, t, i, r) {
                        return new m(e, t, i, r)
                    },
                    v = h._class = function(e, t, i) {
                        return t = t || function() {}, g(e, [], function() {
                            return t
                        }, i), t
                    };
                g.globals = n;
                var y = [0, 0, 1, 1],
                    b = v("easing.Ease", function(e, t, i, r) {
                        this._func = e, this._type = i || 0, this._power = r || 0, this._params = t ? y.concat(t) : y
                    }, !0),
                    x = b.map = {},
                    T = b.register = function(e, t, i, r) {
                        for (var n, o, s, a, l = t.split(","), u = l.length, c = (i || "easeIn,easeOut,easeInOut").split(","); --u > -1;)
                            for (o = l[u], n = r ? v("easing." + o, null, !0) : h.easing[o] || {}, s = c.length; --s > -1;) a = c[s], x[o + "." + a] = x[a + o] = n[a] = e.getRatio ? e : e[a] || new e
                    };
                for (a = b.prototype, a._calcEnd = !1, a.getRatio = function(e) {
                        if (this._func) return this._params[0] = e, this._func.apply(null, this._params);
                        var t = this._type,
                            i = this._power,
                            r = 1 === t ? 1 - e : 2 === t ? e : e < .5 ? 2 * e : 2 * (1 - e);
                        return 1 === i ? r *= r : 2 === i ? r *= r * r : 3 === i ? r *= r * r * r : 4 === i && (r *= r * r * r * r), 1 === t ? 1 - r : 2 === t ? r : e < .5 ? r / 2 : 1 - r / 2
                    }, o = ["Linear", "Quad", "Cubic", "Quart", "Quint,Strong"], s = o.length; --s > -1;) a = o[s] + ",Power" + s, T(new b(null, null, 1, s), a, "easeOut", !0), T(new b(null, null, 2, s), a, "easeIn" + (0 === s ? ",easeNone" : "")), T(new b(null, null, 3, s), a, "easeInOut");
                x.linear = h.easing.Linear.easeIn, x.swing = h.easing.Quad.easeInOut;
                var E = v("events.EventDispatcher", function(e) {
                    this._listeners = {}, this._eventTarget = e || this
                });
                a = E.prototype, a.addEventListener = function(e, t, i, r, n) {
                    n = n || 0;
                    var o, s, a = this._listeners[e],
                        c = 0;
                    for (this !== l || u || l.wake(), null == a && (this._listeners[e] = a = []), s = a.length; --s > -1;) o = a[s], o.c === t && o.s === i ? a.splice(s, 1) : 0 === c && o.pr < n && (c = s + 1);
                    a.splice(c, 0, {
                        c: t,
                        s: i,
                        up: r,
                        pr: n
                    })
                }, a.removeEventListener = function(e, t) {
                    var i, r = this._listeners[e];
                    if (r)
                        for (i = r.length; --i > -1;)
                            if (r[i].c === t) return void r.splice(i, 1)
                }, a.dispatchEvent = function(e) {
                    var t, i, r, n = this._listeners[e];
                    if (n)
                        for (t = n.length, t > 1 && (n = n.slice(0)), i = this._eventTarget; --t > -1;)(r = n[t]) && (r.up ? r.c.call(r.s || i, {
                            type: e,
                            target: i
                        }) : r.c.call(r.s || i))
                };
                var S = e.requestAnimationFrame,
                    P = e.cancelAnimationFrame,
                    A = Date.now || function() {
                        return (new Date).getTime()
                    },
                    C = A();
                for (o = ["ms", "moz", "webkit", "o"], s = o.length; --s > -1 && !S;) S = e[o[s] + "RequestAnimationFrame"], P = e[o[s] + "CancelAnimationFrame"] || e[o[s] + "CancelRequestAnimationFrame"];
                v("Ticker", function(e, t) {
                    var i, n, o, s, a, c = this,
                        h = A(),
                        d = !(!1 === t || !S) && "auto",
                        f = 500,
                        _ = 33,
                        m = function(e) {
                            var t, r, l = A() - C;
                            l > f && (h += l - _), C += l, c.time = (C - h) / 1e3, t = c.time - a, (!i || t > 0 || !0 === e) && (c.frame++, a += t + (t >= s ? .004 : s - t), r = !0), !0 !== e && (o = n(m)), r && c.dispatchEvent("tick")
                        };
                    E.call(c), c.time = c.frame = 0, c.tick = function() {
                        m(!0)
                    }, c.lagSmoothing = function(e, t) {
                        f = e || 1e10, _ = Math.min(t, f, 0)
                    }, c.sleep = function() {
                        null != o && (d && P ? P(o) : clearTimeout(o), n = p, o = null, c === l && (u = !1))
                    }, c.wake = function(e) {
                        null !== o ? c.sleep() : e ? h += -C + (C = A()) : c.frame > 10 && (C = A() - f + 5), n = 0 === i ? p : d && S ? S : function(e) {
                            return setTimeout(e, 1e3 * (a - c.time) + 1 | 0)
                        }, c === l && (u = !0), m(2)
                    }, c.fps = function(e) {
                        if (!arguments.length) return i;
                        i = e, s = 1 / (i || 60), a = this.time + s, c.wake()
                    }, c.useRAF = function(e) {
                        if (!arguments.length) return d;
                        c.sleep(), d = e, c.fps(i)
                    }, c.fps(e), setTimeout(function() {
                        "auto" === d && c.frame < 5 && "hidden" !== r.visibilityState && c.useRAF(!1)
                    }, 1500)
                }), a = h.Ticker.prototype = new h.events.EventDispatcher, a.constructor = h.Ticker;
                var M = v("core.Animation", function(e, t) {
                    if (this.vars = t = t || {}, this._duration = this._totalDuration = e || 0, this._delay = Number(t.delay) || 0, this._timeScale = 1, this._active = !0 === t.immediateRender, this.data = t.data, this._reversed = !0 === t.reversed, q) {
                        u || l.wake();
                        var i = this.vars.useFrames ? Y : q;
                        i.add(this, i._time), this.vars.paused && this.paused(!0)
                    }
                });
                l = M.ticker = new h.Ticker, a = M.prototype, a._dirty = a._gc = a._initted = a._paused = !1, a._totalTime = a._time = 0, a._rawPrevTime = -1, a._next = a._last = a._onUpdate = a._timeline = a.timeline = null, a._paused = !1;
                var R = function() {
                    u && A() - C > 2e3 && "hidden" !== r.visibilityState && l.wake();
                    var e = setTimeout(R, 2e3);
                    e.unref && e.unref()
                };
                R(), a.play = function(e, t) {
                    return null != e && this.seek(e, t), this.reversed(!1).paused(!1)
                }, a.pause = function(e, t) {
                    return null != e && this.seek(e, t), this.paused(!0)
                }, a.resume = function(e, t) {
                    return null != e && this.seek(e, t), this.paused(!1)
                }, a.seek = function(e, t) {
                    return this.totalTime(Number(e), !1 !== t)
                }, a.restart = function(e, t) {
                    return this.reversed(!1).paused(!1).totalTime(e ? -this._delay : 0, !1 !== t, !0)
                }, a.reverse = function(e, t) {
                    return null != e && this.seek(e || this.totalDuration(), t), this.reversed(!0).paused(!1)
                }, a.render = function(e, t, i) {}, a.invalidate = function() {
                    return this._time = this._totalTime = 0, this._initted = this._gc = !1, this._rawPrevTime = -1, !this._gc && this.timeline || this._enabled(!0), this
                }, a.isActive = function() {
                    var e, t = this._timeline,
                        i = this._startTime;
                    return !t || !this._gc && !this._paused && t.isActive() && (e = t.rawTime(!0)) >= i && e < i + this.totalDuration() / this._timeScale - 1e-7
                }, a._enabled = function(e, t) {
                    return u || l.wake(), this._gc = !e, this._active = this.isActive(), !0 !== t && (e && !this.timeline ? this._timeline.add(this, this._startTime - this._delay) : !e && this.timeline && this._timeline._remove(this, !0)), !1
                }, a._kill = function(e, t) {
                    return this._enabled(!1, !1)
                }, a.kill = function(e, t) {
                    return this._kill(e, t), this
                }, a._uncache = function(e) {
                    for (var t = e ? this : this.timeline; t;) t._dirty = !0, t = t.timeline;
                    return this
                }, a._swapSelfInParams = function(e) {
                    for (var t = e.length, i = e.concat(); --t > -1;) "{self}" === e[t] && (i[t] = this);
                    return i
                }, a._callback = function(e) {
                    var t = this.vars,
                        i = t[e],
                        r = t[e + "Params"],
                        n = t[e + "Scope"] || t.callbackScope || this;
                    switch (r ? r.length : 0) {
                        case 0:
                            i.call(n);
                            break;
                        case 1:
                            i.call(n, r[0]);
                            break;
                        case 2:
                            i.call(n, r[0], r[1]);
                            break;
                        default:
                            i.apply(n, r)
                    }
                }, a.eventCallback = function(e, t, i, r) {
                    if ("on" === (e || "").substr(0, 2)) {
                        var n = this.vars;
                        if (1 === arguments.length) return n[e];
                        null == t ? delete n[e] : (n[e] = t, n[e + "Params"] = f(i) && -1 !== i.join("").indexOf("{self}") ? this._swapSelfInParams(i) : i, n[e + "Scope"] = r), "onUpdate" === e && (this._onUpdate = t)
                    }
                    return this
                }, a.delay = function(e) {
                    return arguments.length ? (this._timeline.smoothChildTiming && this.startTime(this._startTime + e - this._delay), this._delay = e, this) : this._delay
                }, a.duration = function(e) {
                    return arguments.length ? (this._duration = this._totalDuration = e, this._uncache(!0), this._timeline.smoothChildTiming && this._time > 0 && this._time < this._duration && 0 !== e && this.totalTime(this._totalTime * (e / this._duration), !0), this) : (this._dirty = !1, this._duration)
                }, a.totalDuration = function(e) {
                    return this._dirty = !1, arguments.length ? this.duration(e) : this._totalDuration
                }, a.time = function(e, t) {
                    return arguments.length ? (this._dirty && this.totalDuration(), this.totalTime(e > this._duration ? this._duration : e, t)) : this._time
                }, a.totalTime = function(e, t, i) {
                    if (u || l.wake(), !arguments.length) return this._totalTime;
                    if (this._timeline) {
                        if (e < 0 && !i && (e += this.totalDuration()), this._timeline.smoothChildTiming) {
                            this._dirty && this.totalDuration();
                            var r = this._totalDuration,
                                n = this._timeline;
                            if (e > r && !i && (e = r), this._startTime = (this._paused ? this._pauseTime : n._time) - (this._reversed ? r - e : e) / this._timeScale, n._dirty || this._uncache(!1), n._timeline)
                                for (; n._timeline;) n._timeline._time !== (n._startTime + n._totalTime) / n._timeScale && n.totalTime(n._totalTime, !0), n = n._timeline
                        }
                        this._gc && this._enabled(!0, !1), this._totalTime === e && 0 !== this._duration || (L.length && Q(), this.render(e, t, !1), L.length && Q())
                    }
                    return this
                }, a.progress = a.totalProgress = function(e, t) {
                    var i = this.duration();
                    return arguments.length ? this.totalTime(i * e, t) : i ? this._time / i : this.ratio
                }, a.startTime = function(e) {
                    return arguments.length ? (e !== this._startTime && (this._startTime = e, this.timeline && this.timeline._sortChildren && this.timeline.add(this, e - this._delay)), this) : this._startTime
                }, a.endTime = function(e) {
                    return this._startTime + (0 != e ? this.totalDuration() : this.duration()) / this._timeScale
                }, a.timeScale = function(e) {
                    if (!arguments.length) return this._timeScale;
                    if (e = e || 1e-10, this._timeline && this._timeline.smoothChildTiming) {
                        var t = this._pauseTime,
                            i = t || 0 === t ? t : this._timeline.totalTime();
                        this._startTime = i - (i - this._startTime) * this._timeScale / e
                    }
                    return this._timeScale = e, this._uncache(!1)
                }, a.reversed = function(e) {
                    return arguments.length ? (e != this._reversed && (this._reversed = e, this.totalTime(this._timeline && !this._timeline.smoothChildTiming ? this.totalDuration() - this._totalTime : this._totalTime, !0)), this) : this._reversed
                }, a.paused = function(e) {
                    if (!arguments.length) return this._paused;
                    var t, i, r = this._timeline;
                    return e != this._paused && r && (u || e || l.wake(), t = r.rawTime(), i = t - this._pauseTime, !e && r.smoothChildTiming && (this._startTime += i, this._uncache(!1)), this._pauseTime = e ? t : null, this._paused = e, this._active = this.isActive(), !e && 0 !== i && this._initted && this.duration() && (t = r.smoothChildTiming ? this._totalTime : (t - this._startTime) / this._timeScale, this.render(t, t === this._totalTime, !0))), this._gc && !e && this._enabled(!0, !1), this
                };
                var O = v("core.SimpleTimeline", function(e) {
                    M.call(this, 0, e), this.autoRemoveChildren = this.smoothChildTiming = !0
                });
                a = O.prototype = new M, a.constructor = O, a.kill()._gc = !1, a._first = a._last = a._recent = null, a._sortChildren = !1, a.add = a.insert = function(e, t, i, r) {
                    var n, o;
                    if (e._startTime = Number(t || 0) + e._delay, e._paused && this !== e._timeline && (e._pauseTime = e._startTime + (this.rawTime() - e._startTime) / e._timeScale), e.timeline && e.timeline._remove(e, !0), e.timeline = e._timeline = this, e._gc && e._enabled(!0, !0), n = this._last, this._sortChildren)
                        for (o = e._startTime; n && n._startTime > o;) n = n._prev;
                    return n ? (e._next = n._next, n._next = e) : (e._next = this._first, this._first = e), e._next ? e._next._prev = e : this._last = e, e._prev = n, this._recent = e, this._timeline && this._uncache(!0), this
                }, a._remove = function(e, t) {
                    return e.timeline === this && (t || e._enabled(!1, !0), e._prev ? e._prev._next = e._next : this._first === e && (this._first = e._next), e._next ? e._next._prev = e._prev : this._last === e && (this._last = e._prev), e._next = e._prev = e.timeline = null, e === this._recent && (this._recent = this._last), this._timeline && this._uncache(!0)), this
                }, a.render = function(e, t, i) {
                    var r, n = this._first;
                    for (this._totalTime = this._time = this._rawPrevTime = e; n;) r = n._next, (n._active || e >= n._startTime && !n._paused && !n._gc) && (n._reversed ? n.render((n._dirty ? n.totalDuration() : n._totalDuration) - (e - n._startTime) * n._timeScale, t, i) : n.render((e - n._startTime) * n._timeScale, t, i)), n = r
                }, a.rawTime = function() {
                    return u || l.wake(), this._totalTime
                };
                var w = v("TweenLite", function(t, i, r) {
                        if (M.call(this, i, r), this.render = w.prototype.render, null == t) throw "Cannot tween a null target.";
                        this.target = t = "string" != typeof t ? t : w.selector(t) || t;
                        var n, o, s, a = t.jquery || t.length && t !== e && t[0] && (t[0] === e || t[0].nodeType && t[0].style && !t.nodeType),
                            l = this.vars.overwrite;
                        if (this._overwrite = l = null == l ? X[w.defaultOverwrite] : "number" == typeof l ? l >> 0 : X[l], (a || t instanceof Array || t.push && f(t)) && "number" != typeof t[0])
                            for (this._targets = s = d(t), this._propLookup = [], this._siblings = [], n = 0; n < s.length; n++) o = s[n], o ? "string" != typeof o ? o.length && o !== e && o[0] && (o[0] === e || o[0].nodeType && o[0].style && !o.nodeType) ? (s.splice(n--, 1), this._targets = s = s.concat(d(o))) : (this._siblings[n] = Z(o, this, !1), 1 === l && this._siblings[n].length > 1 && $(o, this, null, 1, this._siblings[n])) : "string" == typeof(o = s[n--] = w.selector(o)) && s.splice(n + 1, 1) : s.splice(n--, 1);
                        else this._propLookup = {}, this._siblings = Z(t, this, !1), 1 === l && this._siblings.length > 1 && $(t, this, null, 1, this._siblings);
                        (this.vars.immediateRender || 0 === i && 0 === this._delay && !1 !== this.vars.immediateRender) && (this._time = -1e-10, this.render(Math.min(0, -this._delay)))
                    }, !0),
                    I = function(t) {
                        return t && t.length && t !== e && t[0] && (t[0] === e || t[0].nodeType && t[0].style && !t.nodeType)
                    },
                    D = function(e, t) {
                        var i, r = {};
                        for (i in e) W[i] || i in t && "transform" !== i && "x" !== i && "y" !== i && "width" !== i && "height" !== i && "className" !== i && "border" !== i || !(!z[i] || z[i] && z[i]._autoCSS) || (r[i] = e[i], delete e[i]);
                        e.css = r
                    };
                a = w.prototype = new M, a.constructor = w, a.kill()._gc = !1, a.ratio = 0, a._firstPT = a._targets = a._overwrittenProps = a._startAt = null, a._notifyPluginsOfEnabled = a._lazy = !1, w.version = "1.20.1", w.defaultEase = a._ease = new b(null, null, 1, 1), w.defaultOverwrite = "auto", w.ticker = l, w.autoSleep = 120, w.lagSmoothing = function(e, t) {
                    l.lagSmoothing(e, t)
                }, w.selector = e.$ || e.jQuery || function(t) {
                    var i = e.$ || e.jQuery;
                    return i ? (w.selector = i, i(t)) : void 0 === r ? t : r.querySelectorAll ? r.querySelectorAll(t) : r.getElementById("#" === t.charAt(0) ? t.substr(1) : t)
                };
                var L = [],
                    B = {},
                    F = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,
                    N = /[\+-]=-?[\.\d]/,
                    V = function(e) {
                        for (var t, i = this._firstPT; i;) t = i.blob ? 1 === e && this.end ? this.end : e ? this.join("") : this.start : i.c * e + i.s, i.m ? t = i.m(t, this._target || i.t) : t < 1e-6 && t > -1e-6 && !i.blob && (t = 0), i.f ? i.fp ? i.t[i.p](i.fp, t) : i.t[i.p](t) : i.t[i.p] = t, i = i._next
                    },
                    k = function(e, t, i, r) {
                        var n, o, s, a, l, u, c, h = [],
                            d = 0,
                            p = "",
                            f = 0;
                        for (h.start = e, h.end = t, e = h[0] = e + "", t = h[1] = t + "", i && (i(h), e = h[0], t = h[1]), h.length = 0, n = e.match(F) || [], o = t.match(F) || [], r && (r._next = null, r.blob = 1, h._firstPT = h._applyPT = r), l = o.length, a = 0; a < l; a++) c = o[a], u = t.substr(d, t.indexOf(c, d) - d), p += u || !a ? u : ",", d += u.length, f ? f = (f + 1) % 5 : "rgba(" === u.substr(-5) && (f = 1), c === n[a] || n.length <= a ? p += c : (p && (h.push(p), p = ""), s = parseFloat(n[a]), h.push(s), h._firstPT = {
                            _next: h._firstPT,
                            t: h,
                            p: h.length - 1,
                            s: s,
                            c: ("=" === c.charAt(1) ? parseInt(c.charAt(0) + "1", 10) * parseFloat(c.substr(2)) : parseFloat(c) - s) || 0,
                            f: 0,
                            m: f && f < 4 ? Math.round : 0
                        }), d += c.length;
                        return p += t.substr(d), p && h.push(p), h.setRatio = V, N.test(t) && (h.end = 0), h
                    },
                    U = function(e, t, i, r, n, o, s, a, l) {
                        "function" == typeof r && (r = r(l || 0, e));
                        var u, c = typeof e[t],
                            h = "function" !== c ? "" : t.indexOf("set") || "function" != typeof e["get" + t.substr(3)] ? t : "get" + t.substr(3),
                            d = "get" !== i ? i : h ? s ? e[h](s) : e[h]() : e[t],
                            p = "string" == typeof r && "=" === r.charAt(1),
                            f = {
                                t: e,
                                p: t,
                                s: d,
                                f: "function" === c,
                                pg: 0,
                                n: n || t,
                                m: o ? "function" == typeof o ? o : Math.round : 0,
                                pr: 0,
                                c: p ? parseInt(r.charAt(0) + "1", 10) * parseFloat(r.substr(2)) : parseFloat(r) - d || 0
                            };
                        if (("number" != typeof d || "number" != typeof r && !p) && (s || isNaN(d) || !p && isNaN(r) || "boolean" == typeof d || "boolean" == typeof r ? (f.fp = s, u = k(d, p ? parseFloat(f.s) + f.c : r, a || w.defaultStringFilter, f), f = {
                                t: u,
                                p: "setRatio",
                                s: 0,
                                c: 1,
                                f: 2,
                                pg: 0,
                                n: n || t,
                                pr: 0,
                                m: 0
                            }) : (f.s = parseFloat(d), p || (f.c = parseFloat(r) - f.s || 0))), f.c) return (f._next = this._firstPT) && (f._next._prev = f), this._firstPT = f, f
                    },
                    G = w._internals = {
                        isArray: f,
                        isSelector: I,
                        lazyTweens: L,
                        blobDif: k
                    },
                    z = w._plugins = {},
                    j = G.tweenLookup = {},
                    H = 0,
                    W = G.reservedProps = {
                        ease: 1,
                        delay: 1,
                        overwrite: 1,
                        onComplete: 1,
                        onCompleteParams: 1,
                        onCompleteScope: 1,
                        useFrames: 1,
                        runBackwards: 1,
                        startAt: 1,
                        onUpdate: 1,
                        onUpdateParams: 1,
                        onUpdateScope: 1,
                        onStart: 1,
                        onStartParams: 1,
                        onStartScope: 1,
                        onReverseComplete: 1,
                        onReverseCompleteParams: 1,
                        onReverseCompleteScope: 1,
                        onRepeat: 1,
                        onRepeatParams: 1,
                        onRepeatScope: 1,
                        easeParams: 1,
                        yoyo: 1,
                        immediateRender: 1,
                        repeat: 1,
                        repeatDelay: 1,
                        data: 1,
                        paused: 1,
                        reversed: 1,
                        autoCSS: 1,
                        lazy: 1,
                        onOverwrite: 1,
                        callbackScope: 1,
                        stringFilter: 1,
                        id: 1,
                        yoyoEase: 1
                    },
                    X = {
                        none: 0,
                        all: 1,
                        auto: 2,
                        concurrent: 3,
                        allOnStart: 4,
                        preexisting: 5,
                        true: 1,
                        false: 0
                    },
                    Y = M._rootFramesTimeline = new O,
                    q = M._rootTimeline = new O,
                    K = 30,
                    Q = G.lazyRender = function() {
                        var e, t = L.length;
                        for (B = {}; --t > -1;)(e = L[t]) && !1 !== e._lazy && (e.render(e._lazy[0], e._lazy[1], !0), e._lazy = !1);
                        L.length = 0
                    };
                q._startTime = l.time, Y._startTime = l.frame, q._active = Y._active = !0, setTimeout(Q, 1), M._updateRoot = w.render = function() {
                    var e, t, i;
                    if (L.length && Q(), q.render((l.time - q._startTime) * q._timeScale, !1, !1), Y.render((l.frame - Y._startTime) * Y._timeScale, !1, !1), L.length && Q(), l.frame >= K) {
                        K = l.frame + (parseInt(w.autoSleep, 10) || 120);
                        for (i in j) {
                            for (t = j[i].tweens, e = t.length; --e > -1;) t[e]._gc && t.splice(e, 1);
                            0 === t.length && delete j[i]
                        }
                        if ((!(i = q._first) || i._paused) && w.autoSleep && !Y._first && 1 === l._listeners.tick.length) {
                            for (; i && i._paused;) i = i._next;
                            i || l.sleep()
                        }
                    }
                }, l.addEventListener("tick", M._updateRoot);
                var Z = function(e, t, i) {
                        var r, n, o = e._gsTweenID;
                        if (j[o || (e._gsTweenID = o = "t" + H++)] || (j[o] = {
                                target: e,
                                tweens: []
                            }), t && (r = j[o].tweens, r[n = r.length] = t, i))
                            for (; --n > -1;) r[n] === t && r.splice(n, 1);
                        return j[o].tweens
                    },
                    J = function(e, t, i, r) {
                        var n, o, s = e.vars.onOverwrite;
                        return s && (n = s(e, t, i, r)), s = w.onOverwrite, s && (o = s(e, t, i, r)), !1 !== n && !1 !== o
                    },
                    $ = function(e, t, i, r, n) {
                        var o, s, a, l;
                        if (1 === r || r >= 4) {
                            for (l = n.length, o = 0; o < l; o++)
                                if ((a = n[o]) !== t) a._gc || a._kill(null, e, t) && (s = !0);
                                else if (5 === r) break;
                            return s
                        }
                        var u, c = t._startTime + 1e-10,
                            h = [],
                            d = 0,
                            p = 0 === t._duration;
                        for (o = n.length; --o > -1;)(a = n[o]) === t || a._gc || a._paused || (a._timeline !== t._timeline ? (u = u || ee(t, 0, p), 0 === ee(a, u, p) && (h[d++] = a)) : a._startTime <= c && a._startTime + a.totalDuration() / a._timeScale > c && ((p || !a._initted) && c - a._startTime <= 2e-10 || (h[d++] = a)));
                        for (o = d; --o > -1;)
                            if (a = h[o], 2 === r && a._kill(i, e, t) && (s = !0), 2 !== r || !a._firstPT && a._initted) {
                                if (2 !== r && !J(a, t)) continue;
                                a._enabled(!1, !1) && (s = !0)
                            }
                        return s
                    },
                    ee = function(e, t, i) {
                        for (var r = e._timeline, n = r._timeScale, o = e._startTime; r._timeline;) {
                            if (o += r._startTime, n *= r._timeScale, r._paused) return -100;
                            r = r._timeline
                        }
                        return o /= n, o > t ? o - t : i && o === t || !e._initted && o - t < 2e-10 ? 1e-10 : (o += e.totalDuration() / e._timeScale / n) > t + 1e-10 ? 0 : o - t - 1e-10
                    };
                a._init = function() {
                    var e, t, i, r, n, o, s = this.vars,
                        a = this._overwrittenProps,
                        l = this._duration,
                        u = !!s.immediateRender,
                        c = s.ease;
                    if (s.startAt) {
                        this._startAt && (this._startAt.render(-1, !0), this._startAt.kill()), n = {};
                        for (r in s.startAt) n[r] = s.startAt[r];
                        if (n.overwrite = !1, n.immediateRender = !0, n.lazy = u && !1 !== s.lazy, n.startAt = n.delay = null, n.onUpdate = s.onUpdate, n.onUpdateScope = s.onUpdateScope || s.callbackScope || this, this._startAt = w.to(this.target, 0, n), u)
                            if (this._time > 0) this._startAt = null;
                            else if (0 !== l) return
                    } else if (s.runBackwards && 0 !== l)
                        if (this._startAt) this._startAt.render(-1, !0), this._startAt.kill(), this._startAt = null;
                        else {
                            0 !== this._time && (u = !1), i = {};
                            for (r in s) W[r] && "autoCSS" !== r || (i[r] = s[r]);
                            if (i.overwrite = 0, i.data = "isFromStart", i.lazy = u && !1 !== s.lazy, i.immediateRender = u, this._startAt = w.to(this.target, 0, i), u) {
                                if (0 === this._time) return
                            } else this._startAt._init(), this._startAt._enabled(!1), this.vars.immediateRender && (this._startAt = null)
                        }
                    if (this._ease = c = c ? c instanceof b ? c : "function" == typeof c ? new b(c, s.easeParams) : x[c] || w.defaultEase : w.defaultEase, s.easeParams instanceof Array && c.config && (this._ease = c.config.apply(c, s.easeParams)), this._easeType = this._ease._type, this._easePower = this._ease._power, this._firstPT = null, this._targets)
                        for (o = this._targets.length, e = 0; e < o; e++) this._initProps(this._targets[e], this._propLookup[e] = {}, this._siblings[e], a ? a[e] : null, e) && (t = !0);
                    else t = this._initProps(this.target, this._propLookup, this._siblings, a, 0);
                    if (t && w._onPluginEvent("_onInitAllProps", this), a && (this._firstPT || "function" != typeof this.target && this._enabled(!1, !1)), s.runBackwards)
                        for (i = this._firstPT; i;) i.s += i.c, i.c = -i.c, i = i._next;
                    this._onUpdate = s.onUpdate, this._initted = !0
                }, a._initProps = function(t, i, r, n, o) {
                    var s, a, l, u, c, h;
                    if (null == t) return !1;
                    B[t._gsTweenID] && Q(), this.vars.css || t.style && t !== e && t.nodeType && z.css && !1 !== this.vars.autoCSS && D(this.vars, t);
                    for (s in this.vars)
                        if (h = this.vars[s], W[s]) h && (h instanceof Array || h.push && f(h)) && -1 !== h.join("").indexOf("{self}") && (this.vars[s] = h = this._swapSelfInParams(h, this));
                        else if (z[s] && (u = new z[s])._onInitTween(t, this.vars[s], this, o)) {
                        for (this._firstPT = c = {
                                _next: this._firstPT,
                                t: u,
                                p: "setRatio",
                                s: 0,
                                c: 1,
                                f: 1,
                                n: s,
                                pg: 1,
                                pr: u._priority,
                                m: 0
                            }, a = u._overwriteProps.length; --a > -1;) i[u._overwriteProps[a]] = this._firstPT;
                        (u._priority || u._onInitAllProps) && (l = !0), (u._onDisable || u._onEnable) && (this._notifyPluginsOfEnabled = !0), c._next && (c._next._prev = c)
                    } else i[s] = U.call(this, t, s, "get", h, s, 0, null, this.vars.stringFilter, o);
                    return n && this._kill(n, t) ? this._initProps(t, i, r, n, o) : this._overwrite > 1 && this._firstPT && r.length > 1 && $(t, this, i, this._overwrite, r) ? (this._kill(i, t), this._initProps(t, i, r, n, o)) : (this._firstPT && (!1 !== this.vars.lazy && this._duration || this.vars.lazy && !this._duration) && (B[t._gsTweenID] = !0), l)
                }, a.render = function(e, t, i) {
                    var r, n, o, s, a = this._time,
                        l = this._duration,
                        u = this._rawPrevTime;
                    if (e >= l - 1e-7 && e >= 0) this._totalTime = this._time = l, this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1, this._reversed || (r = !0, n = "onComplete", i = i || this._timeline.autoRemoveChildren), 0 === l && (this._initted || !this.vars.lazy || i) && (this._startTime === this._timeline._duration && (e = 0), (u < 0 || e <= 0 && e >= -1e-7 || 1e-10 === u && "isPause" !== this.data) && u !== e && (i = !0, u > 1e-10 && (n = "onReverseComplete")), this._rawPrevTime = s = !t || e || u === e ? e : 1e-10);
                    else if (e < 1e-7) this._totalTime = this._time = 0, this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0, (0 !== a || 0 === l && u > 0) && (n = "onReverseComplete", r = this._reversed), e < 0 && (this._active = !1, 0 === l && (this._initted || !this.vars.lazy || i) && (u >= 0 && (1e-10 !== u || "isPause" !== this.data) && (i = !0), this._rawPrevTime = s = !t || e || u === e ? e : 1e-10)), (!this._initted || this._startAt && this._startAt.progress()) && (i = !0);
                    else if (this._totalTime = this._time = e, this._easeType) {
                        var c = e / l,
                            h = this._easeType,
                            d = this._easePower;
                        (1 === h || 3 === h && c >= .5) && (c = 1 - c), 3 === h && (c *= 2), 1 === d ? c *= c : 2 === d ? c *= c * c : 3 === d ? c *= c * c * c : 4 === d && (c *= c * c * c * c), this.ratio = 1 === h ? 1 - c : 2 === h ? c : e / l < .5 ? c / 2 : 1 - c / 2
                    } else this.ratio = this._ease.getRatio(e / l);
                    if (this._time !== a || i) {
                        if (!this._initted) {
                            if (this._init(), !this._initted || this._gc) return;
                            if (!i && this._firstPT && (!1 !== this.vars.lazy && this._duration || this.vars.lazy && !this._duration)) return this._time = this._totalTime = a, this._rawPrevTime = u, L.push(this), void(this._lazy = [e, t]);
                            this._time && !r ? this.ratio = this._ease.getRatio(this._time / l) : r && this._ease._calcEnd && (this.ratio = this._ease.getRatio(0 === this._time ? 0 : 1))
                        }
                        for (!1 !== this._lazy && (this._lazy = !1), this._active || !this._paused && this._time !== a && e >= 0 && (this._active = !0), 0 === a && (this._startAt && (e >= 0 ? this._startAt.render(e, t, i) : n || (n = "_dummyGS")), this.vars.onStart && (0 === this._time && 0 !== l || t || this._callback("onStart"))), o = this._firstPT; o;) o.f ? o.t[o.p](o.c * this.ratio + o.s) : o.t[o.p] = o.c * this.ratio + o.s, o = o._next;
                        this._onUpdate && (e < 0 && this._startAt && -1e-4 !== e && this._startAt.render(e, t, i), t || (this._time !== a || r || i) && this._callback("onUpdate")), n && (this._gc && !i || (e < 0 && this._startAt && !this._onUpdate && -1e-4 !== e && this._startAt.render(e, t, i), r && (this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[n] && this._callback(n), 0 === l && 1e-10 === this._rawPrevTime && 1e-10 !== s && (this._rawPrevTime = 0)))
                    }
                }, a._kill = function(e, t, i) {
                    if ("all" === e && (e = null), null == e && (null == t || t === this.target)) return this._lazy = !1, this._enabled(!1, !1);
                    t = "string" != typeof t ? t || this._targets || this.target : w.selector(t) || t;
                    var r, n, o, s, a, l, u, c, h, d = i && this._time && i._startTime === this._startTime && this._timeline === i._timeline;
                    if ((f(t) || I(t)) && "number" != typeof t[0])
                        for (r = t.length; --r > -1;) this._kill(e, t[r], i) && (l = !0);
                    else {
                        if (this._targets) {
                            for (r = this._targets.length; --r > -1;)
                                if (t === this._targets[r]) {
                                    a = this._propLookup[r] || {}, this._overwrittenProps = this._overwrittenProps || [], n = this._overwrittenProps[r] = e ? this._overwrittenProps[r] || {} : "all";
                                    break
                                }
                        } else {
                            if (t !== this.target) return !1;
                            a = this._propLookup, n = this._overwrittenProps = e ? this._overwrittenProps || {} : "all"
                        }
                        if (a) {
                            if (u = e || a, c = e !== n && "all" !== n && e !== a && ("object" != typeof e || !e._tempKill), i && (w.onOverwrite || this.vars.onOverwrite)) {
                                for (o in u) a[o] && (h || (h = []), h.push(o));
                                if ((h || !e) && !J(this, i, t, h)) return !1
                            }
                            for (o in u)(s = a[o]) && (d && (s.f ? s.t[s.p](s.s) : s.t[s.p] = s.s, l = !0), s.pg && s.t._kill(u) && (l = !0), s.pg && 0 !== s.t._overwriteProps.length || (s._prev ? s._prev._next = s._next : s === this._firstPT && (this._firstPT = s._next), s._next && (s._next._prev = s._prev), s._next = s._prev = null), delete a[o]), c && (n[o] = 1);
                            !this._firstPT && this._initted && this._enabled(!1, !1)
                        }
                    }
                    return l
                }, a.invalidate = function() {
                    return this._notifyPluginsOfEnabled && w._onPluginEvent("_onDisable", this), this._firstPT = this._overwrittenProps = this._startAt = this._onUpdate = null, this._notifyPluginsOfEnabled = this._active = this._lazy = !1, this._propLookup = this._targets ? {} : [], M.prototype.invalidate.call(this), this.vars.immediateRender && (this._time = -1e-10, this.render(Math.min(0, -this._delay))), this
                }, a._enabled = function(e, t) {
                    if (u || l.wake(), e && this._gc) {
                        var i, r = this._targets;
                        if (r)
                            for (i = r.length; --i > -1;) this._siblings[i] = Z(r[i], this, !0);
                        else this._siblings = Z(this.target, this, !0)
                    }
                    return M.prototype._enabled.call(this, e, t), !(!this._notifyPluginsOfEnabled || !this._firstPT) && w._onPluginEvent(e ? "_onEnable" : "_onDisable", this)
                }, w.to = function(e, t, i) {
                    return new w(e, t, i)
                }, w.from = function(e, t, i) {
                    return i.runBackwards = !0, i.immediateRender = 0 != i.immediateRender, new w(e, t, i)
                }, w.fromTo = function(e, t, i, r) {
                    return r.startAt = i, r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender, new w(e, t, r)
                }, w.delayedCall = function(e, t, i, r, n) {
                    return new w(t, 0, {
                        delay: e,
                        onComplete: t,
                        onCompleteParams: i,
                        callbackScope: r,
                        onReverseComplete: t,
                        onReverseCompleteParams: i,
                        immediateRender: !1,
                        lazy: !1,
                        useFrames: n,
                        overwrite: 0
                    })
                }, w.set = function(e, t) {
                    return new w(e, 0, t)
                }, w.getTweensOf = function(e, t) {
                    if (null == e) return [];
                    e = "string" != typeof e ? e : w.selector(e) || e;
                    var i, r, n, o;
                    if ((f(e) || I(e)) && "number" != typeof e[0]) {
                        for (i = e.length, r = []; --i > -1;) r = r.concat(w.getTweensOf(e[i], t));
                        for (i = r.length; --i > -1;)
                            for (o = r[i], n = i; --n > -1;) o === r[n] && r.splice(i, 1)
                    } else if (e._gsTweenID)
                        for (r = Z(e).concat(), i = r.length; --i > -1;)(r[i]._gc || t && !r[i].isActive()) && r.splice(i, 1);
                    return r || []
                }, w.killTweensOf = w.killDelayedCallsTo = function(e, t, i) {
                    "object" == typeof t && (i = t, t = !1);
                    for (var r = w.getTweensOf(e, t), n = r.length; --n > -1;) r[n]._kill(i, e)
                };
                var te = v("plugins.TweenPlugin", function(e, t) {
                    this._overwriteProps = (e || "").split(","), this._propName = this._overwriteProps[0], this._priority = t || 0, this._super = te.prototype
                }, !0);
                if (a = te.prototype, te.version = "1.19.0", te.API = 2, a._firstPT = null, a._addTween = U, a.setRatio = V, a._kill = function(e) {
                        var t, i = this._overwriteProps,
                            r = this._firstPT;
                        if (null != e[this._propName]) this._overwriteProps = [];
                        else
                            for (t = i.length; --t > -1;) null != e[i[t]] && i.splice(t, 1);
                        for (; r;) null != e[r.n] && (r._next && (r._next._prev = r._prev), r._prev ? (r._prev._next = r._next, r._prev = null) : this._firstPT === r && (this._firstPT = r._next)), r = r._next;
                        return !1
                    }, a._mod = a._roundProps = function(e) {
                        for (var t, i = this._firstPT; i;) t = e[this._propName] || null != i.n && e[i.n.split(this._propName + "_").join("")], t && "function" == typeof t && (2 === i.f ? i.t._applyPT.m = t : i.m = t), i = i._next
                    }, w._onPluginEvent = function(e, t) {
                        var i, r, n, o, s, a = t._firstPT;
                        if ("_onInitAllProps" === e) {
                            for (; a;) {
                                for (s = a._next, r = n; r && r.pr > a.pr;) r = r._next;
                                (a._prev = r ? r._prev : o) ? a._prev._next = a: n = a, (a._next = r) ? r._prev = a : o = a, a = s
                            }
                            a = t._firstPT = n
                        }
                        for (; a;) a.pg && "function" == typeof a.t[e] && a.t[e]() && (i = !0), a = a._next;
                        return i
                    }, te.activate = function(e) {
                        for (var t = e.length; --t > -1;) e[t].API === te.API && (z[(new e[t])._propName] = e[t]);
                        return !0
                    }, g.plugin = function(e) {
                        if (!(e && e.propName && e.init && e.API)) throw "illegal plugin definition.";
                        var t, i = e.propName,
                            r = e.priority || 0,
                            n = e.overwriteProps,
                            o = {
                                init: "_onInitTween",
                                set: "setRatio",
                                kill: "_kill",
                                round: "_mod",
                                mod: "_mod",
                                initAll: "_onInitAllProps"
                            },
                            s = v("plugins." + i.charAt(0).toUpperCase() + i.substr(1) + "Plugin", function() {
                                te.call(this, i, r), this._overwriteProps = n || []
                            }, !0 === e.global),
                            a = s.prototype = new te(i);
                        a.constructor = s, s.API = e.API;
                        for (t in o) "function" == typeof e[t] && (a[o[t]] = e[t]);
                        return s.version = e.version, te.activate([s]), s
                    }, o = e._gsQueue) {
                    for (s = 0; s < o.length; s++) o[s]();
                    for (a in _) _[a].func || e.console.log("GSAP encountered missing dependency: " + a)
                }
                u = !1
            }
        }("undefined" != typeof module && module.exports && "undefined" != typeof global ? global : this || window), define("com/gsap/TweenMax", function(e) {
            return function() {
                return e.TweenMax
            }
        }(this)), define("game/components/createJsAudioPlayer/SoundManager", ["game/components/createJsAudioPlayer/SoundSprite", "game/components/createJsAudioPlayer/SoundSpriteList", "game/components/createJsAudioPlayer/soundjs", "com/gsap/TweenMax"], function(e, t, i, r) {
            function n() {
                this.onDelayTimer = function(e) {
                    var i = this;
                    if ("execute" === e.command.toLowerCase()) i.execute(e.commandId);
                    else {
                        var n = e.spriteId;
                        null == n && (n = e.spriteListId), null == n && (n = e.spriteListId);
                        var o = this.getSoundSprite(n);
                        if (null != o) switch (e.command.toLowerCase()) {
                            case "play":
                                if (null != e.volume && (o.volume = e.volume), null != e.pan && (o.pan = e.pan), null != e.loop && (o.loop = e.loop), null != e.startPosition && (o.position = e.startPosition), null != e.sync) {
                                    var s = i.getSoundSprite(e.sync);
                                    null != s && (o.position = s.position)
                                }
                                o.play();
                                break;
                            case "set":
                                null != e.volume && (o.volume = e.volume), null != e.pan && (o.pan = e.pan), null != e.loop && (o.loop = e.loop), null != e.startPosition && (o.position = e.startPosition);
                                break;
                            case "pause":
                                o.pause();
                                break;
                            case "resume":
                                o.resume();
                                break;
                            case "stop":
                                o.stop();
                                break;
                            case "resetspritelist":
                                o instanceof t && o.resetIndex();
                                break;
                            case "tween":
                                var a = {};
                                null != e.volume && (a.volume = o.volume, this._parentTweens.push(r.to(a, e.duration / 1e3, {
                                    volume: e.volume,
                                    ease: window.Linear.easeNone,
                                    onUpdate: function() {
                                        o.volume = a.volume
                                    }
                                }))), null != e.pan && (a.pan = o.pan, this._parentTweens.push(r.to(o, e.duration / 1e3, {
                                    _pan: a.pan,
                                    ease: window.Linear.easeNone,
                                    onUpdate: function() {
                                        o.pan = o._pan
                                    }
                                })))
                        }
                    }
                }.bind(this)
            }
            var o = null;
            return n.prototype._soundSprites = {}, n.prototype._commands = {}, n.prototype._timers = {}, n.prototype._muted = !1, n.prototype._platformMuted = !1, n.prototype._orientationMute = !1, n.prototype._parentFolder = "", n.prototype._parentTweens = [], n.prototype.setSounds = function(r) {
                    i.Sound.alternateExtensions = ["mp3"], this._soundManifest = r.soundManifest;
                    for (var n in r.soundDefinitions.soundSprites) {
                        var o = r.soundDefinitions.soundSprites[n],
                            s = new e(n, o.soundId, o.startTime, o.duration, o.overlap);
                        this._soundSprites[n] = s
                    }
                    for (var a in r.soundDefinitions.spriteList) {
                        for (var l = [], u = 0, c = r.soundDefinitions.spriteList[a].items; u < c.length; u++) {
                            var n = c[u],
                                o = r.soundDefinitions.soundSprites[n];
                            null != o && l.push(o)
                        }
                        var s = new t(a, l, r.soundDefinitions.spriteList[a].type, r.soundDefinitions.spriteList[a].overlap);
                        this._soundSprites[a] = s
                    }
                    for (var h in r.soundDefinitions.commands) this._commands[h] = r.soundDefinitions.commands[h];
                    var d, p, f = this;
                    void 0 !== document.hidden ? (p = "hidden", d = "visibilitychange") : void 0 !== document.msHidden ? (p = "msHidden", d = "msvisibilitychange") : void 0 !== document.webkitHidden && (p = "webkitHidden", d = "webkitvisibilitychange"), document.addEventListener(d, function() {
                        f._platformMuted || f.setMute(document[p])
                    }, !1), document.addEventListener("click", function(e) {
                        String(e), i.WebAudioSoundInstance.context.resume()
                    }, !1)
                }, n.prototype.setMute = function(e) {
                    this._muted || this._orientationMute || i.Sound.muted === e || (i.Sound.muted = e)
                }, n.prototype.setPlatformMute = function(e) {
                    this._platformMuted = e, this.setMute(e)
                }, n.prototype.getSoundSprite = function(e) {
                    return null != e ? (this._soundSprites[e], this._soundSprites[e]) : null
                }, n.prototype.execute = function(e) {
                    if (this._commands.hasOwnProperty(e)) {
                        this.clearTimersAndTweens(e);
                        for (var t = this._commands[e], i = 0; i < t.length; i++) {
                            var r = t[i];
                            if (null != r.delay || r.delay <= 0) {
                                var n = setTimeout(this.onDelayTimer, r.delay, r),
                                    o = r.spriteId;
                                null == o && (o = r.spriteListId);
                                var s = this.getSoundSprite(o),
                                    a = null == s || s.overlap;
                                "play" === r.command.toLowerCase() && a || this.addTimer(r, n)
                            } else this.onDelayTimer(r)
                        }
                    }
                }, n.prototype.getSpriteIds = function(e, t) {
                    if (void 0 === t && (t = 0), t > 10) throw new Error("[SoundManager] Error: reach max recursive call : " + e.commandId);
                    t++;
                    var i = [];
                    if (null != e.spriteId) i.push(e.spriteId);
                    else if (null != e.spriteListId) i.push(e.spriteListId);
                    else if (null != e.commandId)
                        for (var r = 0, n = this._commands[e.commandId]; r < n.length; r++) {
                            var o = n[r];
                            i = i.concat(this.getSpriteIds(o, t))
                        }
                    return i.filter(function(e, t, i) {
                        return i.indexOf(e) === t
                    })
                }, n.prototype.addTimer = function(e, t) {
                    for (var i = 0, r = this.getSpriteIds(e); i < r.length; i++) {
                        var n = r[i];
                        this._timers.hasOwnProperty(n) || (this._timers[n] = []), this._timers[n].push(t)
                    }
                }, n.prototype.clearTimersAndTweens = function(e) {
                    for (var t = [], i = 0, r = this._commands[e]; i < r.length; i++) {
                        var n = r[i];
                        t = t.concat(this.getSpriteIds(n))
                    }
                    t = t.filter(function(e, t, i) {
                        return i.indexOf(e) === t
                    });
                    for (var o = 0, s = t; o < s.length; o++) {
                        var a = s[o];
                        if (null != this.getSoundSprite(a)) {
                            for (var l in this._parentTweens) this._parentTweens[l].kill();
                            this._parentTweens = []
                        }
                        if (this._timers[a]) {
                            for (var u = 0; u < this._timers[a].length; u++) clearTimeout(this._timers[a][u]);
                            this._timers[a] = []
                        }
                    }
                }, n.prototype.setParentFolder = function(e) {
                    this._parentFolder = e
                }, Object.defineProperty(n.prototype, "mute", {
                    get: function() {
                        return this._muted
                    },
                    set: function(e) {
                        this._muted = e, this.updateCreateJsMuteState()
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(n.prototype, "orientationMute", {
                    get: function() {
                        return this._orientationMute
                    },
                    set: function(e) {
                        this._orientationMute = e, this.updateCreateJsMuteState()
                    },
                    enumerable: !0,
                    configurable: !0
                }), n.prototype.updateCreateJsMuteState = function() {
                    var e = this._muted || this._orientationMute;
                    i.Sound.muted !== e && (i.Sound.muted = e)
                }, Object.defineProperty(n.prototype, "soundManifest", {
                    get: function() {
                        return this._soundManifest
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(n.prototype, "soundSprites", {
                    get: function() {
                        return this._soundSprites
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(n.prototype, "commands", {
                    get: function() {
                        return this._commands
                    },
                    enumerable: !0,
                    configurable: !0
                }),
                function() {
                    return o = o || new n
                }
        }), define("game/components/createJsAudioPlayer/CreateJsAudioSubLoader", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/AbstractSubLoader", "skbJet/component/resourceLoader/resourceLib", "skbJet/component/gameMsgBus/GameMsgBus", "game/components/createJsAudioPlayer/SoundManager", "game/components/createJsAudioPlayer/soundjs"], function(e, t, i, r, n, o) {
            function s(e) {
                e = e || {}, e.fileExtFilterList = ["json"], e.fileLoadList = ["ogg"], this._initOptions("tinfoilsounds", e)
            }
            return s.prototype = new t, s.prototype._doLoadFile = function(t, i, r) {
                e.httpGetJson(t, function(r) {
                    var s = e.getParentFolder(t);
                    n().setParentFolder(s), o.Sound.on("fileload", i), n().setSounds(r), Object.keys(r.soundManifest).forEach(function(e) {
                        var t = String(r.soundManifest[e].src);
                        r.soundManifest[e].src = s + t + "?v=" + window._cacheFlag.gameVersion + "&t=" + window._cacheFlag.revisionTag
                    }), o.Sound.registerSounds(r.soundManifest)
                }, r)
            }, s.prototype.load = function(t, r) {
                this._prepareLoad(r);
                var n = [];
                for (var o in t)
                    if (t[o] && this.options.fileExtFilterList) {
                        var s = e.getFileExt(o, !0);
                        if (this.options.fileLoadList.indexOf(s) >= 0) this._count.total++;
                        else {
                            if (!(this.options.fileExtFilterList.indexOf(s) >= 0)) continue;
                            n.push(o)
                        }
                    }
                if (0 === this._count.total) return this._count.complete = !0, void this.options.onFileLoaded();
                for (var a = this, l = 0; l < n.length; l++) {
                    var o = n[l];
                    this._doLoadFile(t[o] + o + this.options.queryStr, function(e) {
                        return function(t) {
                            a._count.current++, a._count.current === a._count.total && (a._count.complete = !0), i[a.options.type] = i[a.options.type] || {}, i[a.options.type][e] = t, a.options.onFileLoaded()
                        }
                    }(e.getFileNameWithoutExt(o)), this.options.onLoadFailed)
                }
            }, s
        }), define("game/loaders/bitmapFontLoader/BitmapFontSubLoader", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/AbstractSubLoader", "com/pixijs/pixi"], function(e, t, i) {
            function r(e) {
                e = e || {}, e.fileExtFilterList = ["xml"], e.fileLoadList = ["png"], this._initOptions("bitmapfonts", e), this._fileLoadTracker = {}
            }
            return r.prototype = new t, r.prototype._load = r.prototype.load, r.prototype.load = function(e, t) {
                this.loader = new i.loaders.Loader, this.loader.defaultQueryString = t.queryStr, this._load(e, t);
                var r = this;
                this.loader.on("load", function(e, t) {
                    if (t.name.endsWith("_image")) {
                        i.Texture.addToCache(e.resources[t.name].texture, t.name);
                        var n = t.name.substring(0, t.name.indexOf("_image"));
                        r._fileLoadTracker.hasOwnProperty(n) && r._count.current++
                    } else {
                        var o = t.name + "_image";
                        r._fileLoadTracker.hasOwnProperty(o) && r._count.current++
                    }
                    r._fileLoadTracker[t.name] = !0
                }), this.loader.once("complete", function() {
                    r._count.current === r._count.total && (r._count.complete = !0, r.options.onFileLoaded())
                }), this.loader.on("error", this.options.onLoadFailed), this.loader.load()
            }, r.prototype._doLoadFile = function(t, i) {
                var r = e.getFileNameWithoutExt(t);
                this.loader.add(r, t).load(i)
            }, r
        }), define("game/loaders/pixiLocSpriteSubLoader", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/AbstractSubLoader", "com/pixijs/pixi"], function(e, t, i) {
            function r(e, t) {
                e = e || {}, e.fileExtFilterList = ["json"], n = "default", ["en-us", "en-ca", "fr-ca"].indexOf(t.toLowerCase()) >= 0 ? n = "us" : ["en-pa"].indexOf(t.toLowerCase()) >= 0 && (n = "en-PA"), this._initOptions("locSprites/" + n, e)
            }
            var n = "default";
            return r.prototype = new t, r.prototype._load = r.prototype.load, r.prototype.load = function(t, r) {
                this.loader = new i.loaders.Loader, this.loader.defaultQueryString = "?" === r.queryStr.charAt(0) ? r.queryStr.replace("?", "") : r.queryStr, r.queryStr = null;
                for (var o in t) o.indexOf("/" + n + "/") < 0 && delete t[o];
                this._load(t, r);
                var s = this;
                this.loader.on("load", function(t, r) {
                    if (r.textures) {
                        for (var n in r.textures) {
                            var o = e.getFileNameWithoutExt(n);
                            i.Texture.addToCache(r.textures[n], o)
                        }
                        s._count.current++, s.options.onFileLoaded()
                    }
                }), this.loader.once("complete", function() {
                    s._count.current === s._count.total && (s._count.complete = !0, s.options.onFileLoaded())
                }), this.loader.on("error", this.options.onLoadFailed), this.loader.load()
            }, r.prototype._doLoadFile = function(t) {
                var i = e.getFileNameWithoutExt(t);
                this.loader.add(i, t)
            }, r
        }), define("game/components/chaseLight/chaseLightManager", [], function() {
            function e() {
                i = {}, this.AddSpec = function(e, t) {
                    i[e] = i[e] || {}, i[e].spec = i[e].spec || {}, i[e].spec.sprites = t.sprites
                }, this.AddAnimation = function(e, t, r) {
                    i[e] = i[e] || {}, i[e].spec = i[e].spec || {}, i[e].spec.animations = i[e].spec.animations || {}, i[e].spec.animations[t] = r
                }, this.GetSpec = function(e) {
                    return i.hasOwnProperty(e) || (i[e] = {}), i[e]
                }
            }
            var t = null,
                i = null;
            return function() {
                return t = t || new e
            }
        }), define("game/components/chaseLight/chaseLightJSONSubLoader", ["skbJet/component/resourceLoader/Util", "skbJet/component/resourceLoader/AbstractSubLoader", "skbJet/component/resourceLoader/resourceLib", "skbJet/component/gameMsgBus/GameMsgBus", "game/components/chaseLight/chaseLightManager"], function(e, t, i, r, n) {
            function o(e) {
                e = e || {}, e.fileExtFilterList = ["json"], this._initOptions("chaseLightJSON", e)
            }
            return o.prototype = new t, o.prototype._doLoadFile = function(t, i, r) {
                e.httpGetJson(t, function(e) {
                    "spec" === e.type ? (n().AddSpec(e.name, e.spec), i()) : "animation" === e.type && (n().AddAnimation(e.specName, e.name, e.animation), i())
                }, r)
            }, o
        }), define("game/loaders/loadController", ["require", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "skbJet/component/resourceLoader/ResourceLoader", "skbJet/componentManchester/webfontLoader/FontSubLoader", "game/components/createJsAudioPlayer/CreateJsAudioSubLoader", "game/loaders/bitmapFontLoader/BitmapFontSubLoader", "game/loaders/pixiLocSpriteSubLoader", "game/components/chaseLight/chaseLightJSONSubLoader", "skbJet/component/gameMsgBus/GameMsgBus"], function(e) {
            function t(e) {
                p.publish("toPlatform", {
                    channel: "Kernel",
                    topic: "LoadProgress",
                    data: {
                        id: "game",
                        items: e.total + 1,
                        current: e.current,
                        complete: !1
                    }
                }), e.complete && (o.gameConfigOption.defaultPadding = 10, o.init(null, null, null), o.showScene("_GameScene"), o.lib._GameScene.pixiContainer.alpha = 0, p.publish("toPlatform", {
                    channel: "Kernel",
                    topic: "LoadProgress",
                    data: {
                        id: "game",
                        items: e.total + 1,
                        current: e.total + 1,
                        complete: !0
                    }
                }))
            }
            var i, r, n, o = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                s = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                a = e("skbJet/component/resourceLoader/ResourceLoader"),
                l = e("skbJet/componentManchester/webfontLoader/FontSubLoader"),
                u = e("game/components/createJsAudioPlayer/CreateJsAudioSubLoader"),
                c = e("game/loaders/bitmapFontLoader/BitmapFontSubLoader"),
                h = e("game/loaders/pixiLocSpriteSubLoader"),
                d = e("game/components/chaseLight/chaseLightJSONSubLoader"),
                p = e("skbJet/component/gameMsgBus/GameMsgBus");
            return p.subscribe("resourceLoader.loadProgress", t), i = window.location.search.match(/&?assetPack=([^&]+)&?/)[1],
                r = window.location.search.match(/&?language=([^&]+)&?/)[1], n = window.location.search.match(/&?skincode=([^&]+)&?/)[1], s.load("assetPacks/" + i, r, n), a.getDefault().addSubLoader("locSprites", new h({
                    type: "locSprites"
                }, r)), a.getDefault().addSubLoader("fonts", new l), a.getDefault().addSubLoader("tinfoilsounds", new u({
                    type: "tinfoilsounds"
                })), a.getDefault().addSubLoader("bitmapfonts", new c({
                    type: "bitmapfonts"
                })), a.getDefault().addSubLoader("chaseLightJSON", new d({
                    type: "chaseLightJSON"
                })), a.getDefault().addHeartBeat(t), {
                    assetPack: i,
                    langCode: r,
                    skinCode: n
                }
        }), define("game/data/setupData", [], function() {
            return {
                VERSION: "v0.3.19",
                PORTRAIT: "portrait",
                LANDSCAPE: "landscape",
                DEV: !0,
                BASEGAME_GRID_REFS: [
                    ["L0C0R0", "L0C0R1", "L0C0R2", "L0C1R0", "L0C1R1", "L0C1R2", "L0C2R0", "L0C2R1", "L0C2R2", "L0C3R0", "L0C3R1", "L0C3R2", "L0C4R0", "L0C4R1", "L0C4R2"],
                    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
                ],
                BASE_GAME: "BaseGame",
                FREE_SPINS: "CliffHangersFreeSpin",
                PUNCH_A_BUNCH: "PunchABunch",
                PORTRAIT_REEL_SCALE: .758,
                PUNCH_A_BUNCH_ACCEPT_REJECT: "PunchABunchAcceptReject",
                BONUS_WHEEL: "BonusWheel",
                PLINKO_PICK_REVEAL: "PlinkoPickReveal",
                PLINKO_POSITION_PICKER: "PlinkoPositionPicker"
            }
        }), define("game/data/stateEvents", ["skbJet/component/gameMsgBus/GameMsgBus"], function(e) {
            return {
                publish: function(t, i) {
                    void 0 === i && (i = {}), i.type = t, e.publish(t, i)
                },
                delayedPublish: function(t, i, r) {
                    void 0 === r && (r = {}), void 0 === i && (i = 10), r.type = t, setTimeout(function() {
                        e.publish(t, r)
                    }, i)
                },
                NEXT_STATE: "nextState",
                STATE_CHANGED: "stateChanged",
                START_BASE_SPIN: "se_startBaseSpin",
                FROM_BEFORE_SHOW_STAGE: "se_fromBeforeShowStage",
                FROM_START_GAME_INITIAL: "se_fromStartGameInitial",
                FROM_RECOVERY_GAME_IN_PROGRESS: "se_fromRecoveryGameInProgress",
                FROM_RECOVERY_GAME_IN_PROGRESS_NEXT: "se_fromRecoveryGameInProgressNext",
                FROM_BEFORE_REQUEST: "se_fromBeforeRequest",
                FROM_MAKE_REQUEST: "se_fromMakeRequest",
                FROM_RESOLVE_STAGE: "se_fromResolveStage",
                FROM_START_ROLLUP: "se_fromStartRollup",
                FROM_END_GAME: "se_fromEndGame",
                FROM_BEGIN_NEW_GAME: "se_fromBeginNewGame",
                FROM_EXIT_STAGE: "se_fromExitStage",
                FROM_EXIT_STAGE_MOD4: "se_fromExitStageMod4",
                FROM_EXIT_STAGE_MOD4_FREE_SPIN: "se_fromExitStageMod4FreeSpin",
                FROM_FREE_SPIN_EXIT_ROLLUP: "se_fromFreeSpinExitRollup",
                FROM_ENTER_NEXT_STAGE: "se_fromEnterNextStage",
                FROM_IN_PROGRESS_STAGE: "se_fromInProgressStage",
                FROM_ABORT_NEXT_STAGE: "se_fromAbortNextStage",
                FROM_RESET_NEXT_STAGE: "se_fromResetNextStage"
            }
        }), define("game/stateMachine/SMController", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "game/data/stateEvents"], function(e) {
            "use strict";
            var t = e("skbJet/component/gameMsgBus/GameMsgBus"),
                i = e("game/data/stateEvents"),
                r = function() {
                    function e(e) {
                        e.type === i.FROM_BEGIN_NEW_GAME || e.type === i.FROM_START_GAME_INITIAL ? (n = "StartUp.beforeShowStage", o = "StartUp", i.publish(i.STATE_CHANGED, {
                            state: n,
                            gameState: o
                        })) : r && e.type !== i.FROM_BEGIN_NEW_GAME ? (r = !1, n = e.type, i.publish(i.STATE_CHANGED, {
                            state: n,
                            gameState: o
                        }), i.publish(i.NEXT_STATE)) : (n = e.type, i.publish(i.STATE_CHANGED, {
                            state: n,
                            gameState: o
                        }), i.publish(i.NEXT_STATE))
                    }
                    var r = !0,
                        n = null,
                        o = null;
                    this.init = function() {
                        t.subscribe(i.FROM_BEFORE_SHOW_STAGE, e), t.subscribe(i.FROM_START_GAME_INITIAL, e), t.subscribe(i.FROM_RECOVERY_GAME_IN_PROGRESS, e), t.subscribe(i.FROM_RECOVERY_GAME_IN_PROGRESS_NEXT, e), t.subscribe(i.START_BASE_SPIN, e), t.subscribe(i.FROM_BEFORE_REQUEST, e), t.subscribe(i.FROM_MAKE_REQUEST, e), t.subscribe(i.FROM_RESOLVE_STAGE, e), t.subscribe(i.FROM_START_ROLLUP, e), t.subscribe(i.FROM_FREE_SPIN_EXIT_ROLLUP, e), t.subscribe(i.FROM_END_GAME, e), t.subscribe(i.FROM_EXIT_STAGE, e), t.subscribe(i.FROM_BEGIN_NEW_GAME, e), t.subscribe(i.FROM_ENTER_NEXT_STAGE, e), t.subscribe(i.FROM_IN_PROGRESS_STAGE, e), t.subscribe(i.FROM_ABORT_NEXT_STAGE, e), t.subscribe(i.FROM_RESET_NEXT_STAGE, e), t.subscribe(i.FROM_EXIT_STAGE_MOD4, e), t.subscribe(i.FROM_EXIT_STAGE_MOD4_FREE_SPIN, e)
                    }
                };
            return r.prototype.constructor = r, r
        }), define("game/commonUI/slot/betData", ["require", "skbJet/component/gameMsgBus/GameMsgBus"], function(e) {
            function t(e) {
                var t = e.PaytableResponse.PatternSliderInfo,
                    i = e.GameLogicResponse.PatternSliderInput;
                r._betInfo = t.BetInfo.Step instanceof Array ? t.BetInfo.Step : [t.BetInfo.Step], r._patternInfo = t.PatternInfo.Step instanceof Array ? t.PatternInfo.Step : [t.PatternInfo.Step], r._patternsBet = i.PatternsBet, r._betPerPattern = i.BetPerPattern
            }
            var i = e("skbJet/component/gameMsgBus/GameMsgBus"),
                r = {
                    _betPerPattern: 0,
                    _patternsBet: 0,
                    _betInfo: null,
                    _patternInfo: null
                };
            return i.subscribe("platformMsg/ClientService/Game.Init", t), {
                get _betPerPattern() {
                    return r._betPerPattern
                },
                set _betPerPattern(e) {
                    r._betPerPattern = e, i.publish("BetData.BetPerPattern", e), i.publish("BetData.TotalBet", this.totalBet)
                },
                get _patternsBet() {
                    return r._patternsBet
                },
                set _patternsBet(e) {
                    r._patternsBet = e, i.publish("BetData.PatternsBet", e), i.publish("BetData.TotalBet", this.totalBet)
                },
                get betPerPattern() {
                    return r._betPerPattern
                },
                get maxBetPerPattern() {
                    return r._betInfo[r._betInfo.length - 1]
                },
                get minBetPerPattern() {
                    return r._betInfo[0]
                },
                get patternsBet() {
                    return r._patternsBet
                },
                get maxPatternsBet() {
                    return r._patternInfo[r._patternInfo.length - 1]
                },
                get minPatternsBet() {
                    return r._patternInfo[0]
                },
                get betInfo() {
                    return r._betInfo
                },
                get patternInfo() {
                    return r._patternInfo
                },
                get totalBet() {
                    return r._betPerPattern * r._patternsBet
                },
                get maxTotalBet() {
                    return this.maxPatternsBet * this.maxBetPerPattern
                },
                get minTotalBet() {
                    return this.minPatternsBet * this.minBetPerPattern
                }
            }
        }), define("skbJet/componentManchester/rgsModel/proxyFix", [], function() {
            function e(e, t, i) {
                var r;
                if (i = i || "@name", e instanceof Array) {
                    for (r = 0; r < e.length; ++r)
                        if (e[r][i] === t) return e[r]
                } else if (e[i] === t) return e
            }

            function t(e) {
                return e
            }

            function i(e) {
                return e instanceof Array ? e : void 0 !== e ? [e] : []
            }

            function r(e) {
                return parseFloat(e) || 0
            }

            function n(e) {
                return parseInt(e, 10) || 0
            }

            function o(e) {
                return "true" === e
            }

            function s(e) {
                return e instanceof Array ? e : e ? [e] : []
            }
            return Object.freeze({
                namedNode: e,
                singleNode: t,
                multipleNode: i,
                toNumber: r,
                toInt: n,
                toBoolean: o,
                array: s
            })
        }), define("skbJet/componentManchester/rgsModel/proxyCachedNode", ["require", "./proxyFix"], function(e) {
            "use strict";

            function t(e, t) {
                var i = e.call(t);
                return i instanceof Object && (i = Object.freeze(i)), i
            }
            var i = e("./proxyFix");
            return function(e, r) {
                function n(n, o, s) {
                    var a, l = e[n];
                    if (s = s || "", d[n] || (d[n] = Object.create(null)), !r[n]) throw new Error("No model for " + n);
                    return d[n][s] || (l && (a = i.namedNode(l, s, o)), a && (d[n][s] = t(r[n], a))), d[n][s]
                }

                function o(n) {
                    var o = e[n];
                    if (!r[n]) throw new Error("No model for " + n);
                    return d[n] || (o = i.multipleNode(o), d[n] = o && Object.freeze(o.map(function(e) {
                        return t(r[n], e)
                    }))), d[n]
                }

                function s(n, o) {
                    var s = e[n];
                    if (!r[n]) throw new Error("No model for " + n);
                    if (!d[n]) {
                        var a;
                        s = i.multipleNode(s), s && (s.forEach(function(e) {
                            var i = t(r[n], e);
                            void 0 !== i && (a = a || {}, a[e[o]] = i)
                        }), a instanceof Object && (a = Object.freeze(a))), d[n] = a
                    }
                    return d[n]
                }

                function a(n) {
                    var o = e[n];
                    if (!r[n]) throw new Error("No model for " + n);
                    return !d[n] && o && (d[n] = t(r[n], i.singleNode(o))), d[n]
                }

                function l(e, t) {
                    return function(i) {
                        return n(e, t, i)
                    }
                }

                function u(e) {
                    return function() {
                        return a(e)
                    }
                }

                function c(e) {
                    return function() {
                        return o(e)
                    }
                }

                function h(e, t) {
                    return function() {
                        return s(e, t)
                    }
                }
                var d = Object.create(null);
                return Object.freeze({
                    named: l,
                    single: u,
                    multiple: c,
                    mapped: h
                })
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/ActionInput", [], function() {
            "use strict";
            return function() {
                return {
                    Action: this.Action
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/Balances", [], function() {
            "use strict";
            return function() {
                return this
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/HighlightOutcome", ["require", "./../proxyFix", "./../proxyCachedNode"], function(e) {
            "use strict";

            function t(e) {
                return e["#text"] ? 0 === e["#text"].length ? [] : e["#text"].split(",") : Object.freeze(i.multipleNode(e.Cell).map(function(e) {
                    return e["@name"]
                }, {}))
            }
            var i = e("./../proxyFix"),
                r = e("./../proxyCachedNode"),
                n = {
                    Highlight: function() {
                        return {
                            type: this["@type"],
                            cells: t(this)
                        }
                    }
                };
            return function() {
                var e = r(this, n);
                return {
                    type: this["@type"],
                    Highlight: e.mapped("Highlight", "@name").call(this)
                }
            }
        }), define("skbJet/componentManchester/rgsModel/proxyNode", ["require", "./proxyFix"], function(e) {
            "use strict";

            function t(e, t) {
                var i = e.call(t);
                return i instanceof Object && (i = Object.freeze(i)), i
            }
            var i = e("./proxyFix");
            return function(e, r) {
                function n(n) {
                    var o = e[n];
                    if (o) return o = i.multipleNode(o), Object.freeze(o.map(function(e) {
                        return t(r[n], e)
                    }))
                }

                function o(t) {
                    var n = e[t];
                    return Object.freeze(r[t].call(i.singleNode(n)))
                }

                function s(n, o) {
                    var s = e[n],
                        a = {};
                    if (s) return s = i.multipleNode(s), s.forEach(function(e) {
                        a[e[o]] = t(r[n], e)
                    }), Object.freeze(a)
                }
                return Object.freeze({
                    single: o,
                    multiple: n,
                    mapped: s
                })
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/JackpotOutcome", ["require", "./../proxyFix", "./../proxyNode"], function(e) {
            "use strict";
            var t = e("./../proxyFix"),
                i = e("./../proxyNode"),
                r = {
                    Jackpot: function() {
                        return {
                            id: this["@id"],
                            level: t.toInt(this["@level"]),
                            value: t.toNumber(this["@value"])
                        }
                    }
                };
            return function() {
                return i(this, r).mapped("Jackpot", "@name")
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/LadderOutcome", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return {
                    Ladder: {
                        Value: t.toInt(this.Ladder["#text"]),
                        Level: t.namedNode(this.Ladder["@level"])
                    }
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/MultiplierOutcome", ["require", "./../proxyFix", "./../proxyCachedNode"], function(e) {
            "use strict";
            var t = e("./../proxyFix"),
                i = e("./../proxyCachedNode"),
                r = {
                    Multiplier: function() {
                        return t.toNumber(this["#text"])
                    }
                };
            return function() {
                return {
                    Multiplier: i(this, r).named("Multiplier")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/OutcomeDetail", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return {
                    Stage: this.Stage,
                    NextStage: this.NextStage,
                    Balance: t.toNumber(this.Balance),
                    GameStatus: this.GameStatus,
                    Settled: t.toNumber(this.Settled),
                    Pending: t.toNumber(this.Pending),
                    Payout: t.toNumber(this.Payout)
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/PatternSliderInput", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return {
                    BetPerPattern: t.toNumber(this.BetPerPattern),
                    PatternsBet: t.toNumber(this.PatternsBet)
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/PickerOutcome", ["require", "./../proxyFix", "./../proxyNode", "./../proxyCachedNode"], function(e) {
            "use strict";
            var t = e("./../proxyFix"),
                i = e("./../proxyNode"),
                r = e("./../proxyCachedNode"),
                n = {
                    Feature: function() {
                        var e = this["@value"],
                            i = this["@type"];
                        switch (i) {
                            case "credits":
                            case "multiplier":
                                e = t.toInt(e)
                        }
                        return {
                            type: i,
                            value: e
                        }
                    }
                },
                o = {
                    Pick: function() {
                        var e = i(this, n);
                        return {
                            name: this["@name"],
                            picked: t.toBoolean(this["@picked"]),
                            Feature: e.multiple("Feature")
                        }
                    }
                },
                s = {
                    Layer: function() {
                        var e = i(this, o);
                        return {
                            index: t.toInt(this["@index"]),
                            Pick: e.multiple("Pick")
                        }
                    }
                };
            return function() {
                return {
                    Layer: r(this, s).named("Layer")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/PickerSummaryOutcome", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return {
                    awarded: t.toInt(this.Awarded),
                    incrementTriggered: t.toBoolean(this.IncrementTriggered),
                    initAwarded: t.toInt(this.InitAwarded),
                    maxPicksAwarded: t.toBoolean(this.MaxPicksAwarded),
                    pickCount: t.toInt(this.PickCount),
                    picksRemaining: t.toInt(this.PicksRemaining),
                    CurrentLayer: Object.freeze({
                        index: t.toInt(this.CurrentLayer["@index"]),
                        name: this.CurrentLayer["@name"]
                    })
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/PopulationOutcome", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                if (this["#text"]) return this["#text"].split(",");
                var e = t.multipleNode(this.Entry);
                return {
                    stop: e.map(function(e) {
                        return t.toInt(e["@stripIndex"])
                    }),
                    map: e.reduce(function(e, i) {
                        return t.multipleNode(i.Cell).forEach(function(t) {
                            e[t["@name"]] = t["#text"]
                        }), e
                    }, {})
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/PatternOutcome", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return this["#text"] ? this["#text"].split(",") : {
                    map: t.multipleNode(this.Pattern).reduce(function(e, i) {
                        return t.multipleNode(i.Cell).forEach(function(t) {
                            e[t["@name"]] = t["#text"]
                        }), e
                    }, {})
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/PrizeOutcome", ["require", "./../proxyFix", "./../proxyCachedNode"], function(e) {
            "use strict";
            var t = e("./../proxyFix"),
                i = e("./../proxyCachedNode"),
                r = {
                    Prize: function() {
                        return {
                            betMultiplier: t.toInt(this["@betMultiplier"]),
                            multiplier: t.toInt(this["@multiplier"]),
                            name: this["@name"],
                            pay: t.toNumber(this["@pay"]),
                            payName: this["@payName"],
                            symbolCount: t.toInt(this["@symbolCount"]),
                            totalPay: t.toNumber(this["@totalPay"]),
                            ways: t.toInt(this["@ways"])
                        }
                    }
                };
            return function() {
                var e = i(this, r);
                return {
                    multiplier: t.toInt(this["@multiplier"]),
                    pay: t.toNumber(this["@pay"]),
                    stage: this["@stage"],
                    totalPay: t.toNumber(this["@totalPay"]),
                    type: this["@type"],
                    Prize: e.multiple("Prize").call(this)
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/TriggerOutcome", ["require", "./../proxyNode"], function(e) {
            "use strict";
            var t = e("./../proxyNode"),
                i = {
                    Trigger: function() {
                        return {
                            name: this["@name"],
                            priority: this["@priority"],
                            stageConnector: this["@stageConnector"]
                        }
                    }
                };
            return function() {
                var e = t(this, i);
                return {
                    component: this["@component"],
                    stage: this["@stage"],
                    Triggers: e.mapped("Trigger", "@name")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/AwardCapOutcome", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return {
                    AwardCapExceeded: t.toBoolean(this.AwardCapExceeded)
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/FreeSpinOutcome", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return {
                    Awarded: t.toInt(this.Awarded),
                    Count: t.toInt(this.Count),
                    Countdown: t.toInt(this.Countdown),
                    IncrementTriggered: t.toBoolean(this.IncrementTriggered),
                    InitAwarded: t.toInt(this.InitAwarded),
                    MaxAwarded: t.toBoolean(this.MaxAwarded),
                    MaxSpinsHit: t.toBoolean(this.MaxSpinsHit),
                    TotalAwarded: t.toInt(this.TotalAwarded)
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/PickerInput", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                var e = [],
                    i = t.multiple(this.Pick).reduce(function(t, i) {
                        var r = i["@name"];
                        return t[r] = i["#text"], e.push(r), t
                    }, {});
                return Object.freeze({
                    names: Object.freeze(e),
                    Picks: Object.freeze(i)
                })
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/PlayerHistoryOutcome", ["require", "./../proxyCachedNode", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyCachedNode"),
                i = e("./../proxyFix"),
                r = {
                    PlayerHistory: function() {
                        return i.multipleNode(this.PastResult).reduce(function(e, t) {
                            return e[t["@index"]] = t["#text"], e
                        }, [])
                    }
                };
            return function() {
                return {
                    PlayerHistory: t(this, r).named("PlayerHistory")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/KeyValuePairOutcome", ["require", "./../proxyNode"], function(e) {
            "use strict";
            var t = e("./../proxyNode"),
                i = {
                    Mapping: function() {
                        return this["@value"]
                    }
                };
            return function() {
                return t(this, i).mapped("Mapping", "@key")
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/PromotionalFreeSpin", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return {
                    count: t.toInt(this["@count"])
                }
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse/WagerInput", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                var e = t.multipleNode(this.Wager).map(function(e) {
                    return Object.freeze({
                        name: e["@name"],
                        wager: t.toInt(e["#text"])
                    })
                });
                return Object.freeze({
                    Wager: Object.freeze(e)
                })
            }
        }), define("skbJet/componentManchester/rgsModel/GameLogicResponse", ["require", "./proxyCachedNode", "./GameLogicResponse/ActionInput", "./GameLogicResponse/Balances", "./GameLogicResponse/HighlightOutcome", "./GameLogicResponse/JackpotOutcome", "./GameLogicResponse/LadderOutcome", "./GameLogicResponse/MultiplierOutcome", "./GameLogicResponse/OutcomeDetail", "./GameLogicResponse/PatternSliderInput", "./GameLogicResponse/PickerOutcome", "./GameLogicResponse/PickerSummaryOutcome", "./GameLogicResponse/PopulationOutcome", "./GameLogicResponse/PatternOutcome", "./GameLogicResponse/PrizeOutcome", "./GameLogicResponse/TriggerOutcome", "./GameLogicResponse/AwardCapOutcome", "./GameLogicResponse/FreeSpinOutcome", "./GameLogicResponse/PickerInput", "./GameLogicResponse/PlayerHistoryOutcome", "./GameLogicResponse/KeyValuePairOutcome", "./GameLogicResponse/PromotionalFreeSpin", "./GameLogicResponse/WagerInput"], function(e) {
            "use strict";
            var t = e("./proxyCachedNode"),
                i = Object.freeze({
                    ActionInput: e("./GameLogicResponse/ActionInput"),
                    Balances: e("./GameLogicResponse/Balances"),
                    HighlightOutcome: e("./GameLogicResponse/HighlightOutcome"),
                    JackpotOutcome: e("./GameLogicResponse/JackpotOutcome"),
                    LadderOutcome: e("./GameLogicResponse/LadderOutcome"),
                    MultiplierOutcome: e("./GameLogicResponse/MultiplierOutcome"),
                    OutcomeDetail: e("./GameLogicResponse/OutcomeDetail"),
                    PatternSliderInput: e("./GameLogicResponse/PatternSliderInput"),
                    PickerOutcome: e("./GameLogicResponse/PickerOutcome"),
                    PickerSummaryOutcome: e("./GameLogicResponse/PickerSummaryOutcome"),
                    PopulationOutcome: e("./GameLogicResponse/PopulationOutcome"),
                    PatternOutcome: e("./GameLogicResponse/PatternOutcome"),
                    PrizeOutcome: e("./GameLogicResponse/PrizeOutcome"),
                    TriggerOutcome: e("./GameLogicResponse/TriggerOutcome"),
                    AwardCapOutcome: e("./GameLogicResponse/AwardCapOutcome"),
                    FreeSpinOutcome: e("./GameLogicResponse/FreeSpinOutcome"),
                    PickerInput: e("./GameLogicResponse/PickerInput"),
                    PlayerHistoryOutcome: e("./GameLogicResponse/PlayerHistoryOutcome"),
                    KeyValuePairOutcome: e("./GameLogicResponse/KeyValuePairOutcome"),
                    PromotionalFreeSpin: e("./GameLogicResponse/PromotionalFreeSpin"),
                    WagerInput: e("./GameLogicResponse/WagerInput")
                });
            return function(e) {
                var r = t(e, i);
                return Object.freeze({
                    ActionInput: r.named("ActionInput"),
                    Balances: r.single("Balances")(),
                    HighlightOutcome: r.named("HighlightOutcome"),
                    JackpotOutcome: r.mapped("JackpotOutcome", "@name"),
                    LadderOutcome: r.named("LadderOutcome"),
                    MultiplierOutcome: r.named("MultiplierOutcome"),
                    OutcomeDetail: r.single("OutcomeDetail")(),
                    PatternSliderInput: r.single("PatternSliderInput"),
                    PickerOutcome: r.named("PickerOutcome"),
                    PickerSummaryOutcome: r.named("PickerSummaryOutcome"),
                    PopulationOutcome: r.named("PopulationOutcome"),
                    PatternOutcome: r.named("PatternOutcome"),
                    PrizeOutcome: r.named("PrizeOutcome"),
                    TriggerOutcome: r.named("TriggerOutcome"),
                    AwardCapOutcome: r.named("AwardCapOutcome"),
                    FreeSpinOutcome: r.named("FreeSpinOutcome"),
                    PickerInput: r.named("PickerInput"),
                    PlayerHistoryOutcome: r.named("PlayerHistoryOutcome"),
                    KeyValuePairOutcome: r.named("KeyValuePairOutcome"),
                    PromotionalFreeSpin: r.single("PromotionalFreeSpin"),
                    WagerInput: r.named("WagerInput")
                })
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/AwardCapInfo", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return t.toNumber(this.CurrencyCap.AwardCap)
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/PaytableStatistics", [], function() {
            "use strict";
            return function() {
                return {
                    description: this["@description"],
                    maxRTP: this["@maxRTP"],
                    minRTP: this["@minRTP"],
                    name: this["@name"],
                    type: this["@type"]
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/PatternSliderInfo", ["require", "./../proxyFix", "./../proxyCachedNode"], function(e) {
            "use strict";
            var t = e("./../proxyFix"),
                i = e("./../proxyCachedNode"),
                r = {
                    BetInfo: function() {
                        return {
                            min: this["@min"],
                            max: this["@max"],
                            Step: t.multipleNode(this.Step)
                        }
                    },
                    PatternInfo: function() {
                        return {
                            min: this["@min"],
                            max: this["@max"],
                            Step: t.multipleNode(this.Step)
                        }
                    }
                };
            return function() {
                var e = i(this, r);
                return {
                    BetInfo: e.single("BetInfo"),
                    PatternInfo: e.single("PatternInfo")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/StripInfo", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return t.multipleNode(this.Strip).map(function(e) {
                    if (e["#text"]) return e["#text"].split(",");
                    var i = t.multipleNode(e.Stop);
                    return Object.keys(i).map(function(e) {
                        return i[e]["@symbolID"]
                    })
                })
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/LadderInfo", ["require", "./../proxyCachedNode"], function(e) {
            "use strict";
            var t = e("./../proxyCachedNode"),
                i = {
                    InputEvents: function() {
                        return {
                            isExtraIncrement: this["@isExtraIncrement"],
                            ladderIncrement: this["@ladderIncrement"]
                        }
                    },
                    OutputEvents: function() {
                        return {
                            minTriggerCount: this["@minTriggerCount"],
                            extraIncrement: this["@extraIncrement"]
                        }
                    }
                };
            return function() {
                var e = t(this, i);
                return {
                    InputEvents: e.mapped("InputEvents", "@triggerName"),
                    OutputEvents: e.mapped("OutputEvents", "@triggerName")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/TriggerInfo", ["require", "./../proxyFix", "./../proxyNode"], function(e) {
            "use strict";

            function t(e) {
                var t = e["@category"];
                if (!(n[t] instanceof Function)) throw new Error('No compiler for Condition with @category "' + t + '"');
                return n[t](e)
            }
            var i = e("./../proxyFix"),
                r = e("./../proxyNode"),
                n = {
                    TRIGGER: function(e) {
                        return function(t) {
                            return e["@value"] === t
                        }
                    },
                    OR: function(e) {
                        var r = i.multipleNode(e.Condition).map(function(e) {
                            return t(e)
                        });
                        return function(e) {
                            return r.some(function(t) {
                                return t(e)
                            })
                        }
                    },
                    AND: function(e) {
                        var r = i.multipleNode(e.Condition).map(function(e) {
                            return t(e)
                        });
                        return function(e) {
                            return r.every(function(t) {
                                return t(e)
                            })
                        }
                    },
                    NOT: function(e) {
                        var i = t(e.Condition);
                        return function(e) {
                            return !i(e)
                        }
                    }
                },
                o = {
                    Trigger: function() {
                        return {
                            priority: i.toInt(this["@priority"]),
                            Condition: t(this.Condition)
                        }
                    }
                };
            return function() {
                return {
                    Trigger: r(this, o).mapped("Trigger", "@name")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/KeyValuePairInfo", ["require", "./../proxyNode"], function(e) {
            "use strict";
            var t = e("./../proxyNode"),
                i = {
                    Mapping: function() {
                        return this["@value"]
                    }
                };
            return function() {
                return t(this, i).mapped("Mapping", "@key")
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/KeyValueListInfo", ["require", "./../proxyFix", "./../proxyNode"], function(e) {
            "use strict";
            var t = e("./../proxyFix"),
                i = e("./../proxyNode"),
                r = {
                    Mapping: function() {
                        return t.multipleNode(this.Entry).map(function(e) {
                            return e["@value"]
                        })
                    }
                };
            return function() {
                return i(this, r).mapped("Mapping", "@key")
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/MultiplierInfo", ["require", "./../proxyFix", "./../proxyNode", "./../proxyCachedNode"], function(e) {
            "use strict";
            var t = e("./../proxyFix"),
                i = e("./../proxyNode"),
                r = e("./../proxyCachedNode"),
                n = {
                    Action: function() {
                        return {
                            strategy: this["@strategy"],
                            value: t.toInt(this["@value"])
                        }
                    }
                },
                o = {
                    Trigger: function() {
                        return {
                            Action: i(this, n).multiple("Action")
                        }
                    }
                };
            return function() {
                return {
                    Trigger: r(this, o).named("Trigger")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/PickerInfo", ["require", "./../proxyFix", "./../proxyNode"], function(e) {
            "use strict";
            var t = e("./../proxyFix"),
                i = e("./../proxyNode"),
                r = {
                    Layer: function() {
                        return t.multipleNode(this.Pick).reduce(function(e, t) {
                            return e[t["@name"]] = t["@cellName"], e
                        }, {})
                    }
                };
            return function() {
                var e = i(this, r);
                return {
                    InitialLayer: t.toInt(this.InitialLayer),
                    InitialPickCount: t.toInt(this.InitialPickCount),
                    MaxPicksPerTurn: t.toInt(this.MaxPicksPerTurn),
                    MaxTotalPicks: t.toInt(this.MaxTotalPicks),
                    MinPicks: t.toInt(this.MinPicks),
                    Layers: e.mapped("Layer", "@index")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/PrizeInfo", ["require", "./../proxyFix", "./../proxyNode"], function(e) {
            "use strict";
            var t = e("./../proxyFix"),
                i = e("./../proxyNode"),
                r = {
                    PrizePay: function() {
                        return t.toInt(this["@value"])
                    }
                },
                n = {
                    Prize: function() {
                        var e = i(this, r);
                        return {
                            name: this["@name"],
                            PrizePay: e.mapped("PrizePay", "@count")
                        }
                    }
                };
            return function() {
                return {
                    Prize: i(this, n).multiple("Prize")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/SelectiveStackingInfo", ["require", "./../proxyNode"], function(e) {
            "use strict";
            var t = e("./../proxyNode"),
                i = {
                    SelectiveStackingSymbolList: function() {
                        return this["@name"]
                    }
                };
            return function() {
                var e = t(this, i);
                return {
                    DefaultSchema: this.DefaultSchema,
                    SelectiveStackingSymbolList: e.multiple("SelectiveStackingSymbolList")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/Jackpot", ["require", "./../proxyNode"], function(e) {
            "use strict";
            var t = e("./../proxyNode"),
                i = {
                    BetBandMap: function() {
                        return {
                            bandId: this["@bandId"]
                        }
                    }
                };
            return function() {
                var e = t(this, i);
                return {
                    id: this["@id"],
                    BetBandMap: e.mapped("BetBandMap", "@totalBet")
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/ChipValues", [], function() {
            "use strict";
            return function() {
                return {
                    min: this["@min"],
                    max: this["@min"],
                    Chip: this.Chip
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/GameData", ["require", "./../proxyCachedNode", "./ChipValues", "./KeyValuePairInfo"], function(e) {
            "use strict";
            var t = e("./../proxyCachedNode"),
                i = Object.freeze({
                    ChipValues: e("./ChipValues"),
                    KeyValuePairInfo: e("./KeyValuePairInfo")
                });
            return function() {
                var e = t(this, i);
                return Object.freeze({
                    ChipValues: e.single("ChipValues"),
                    KeyValuePairInfo: e.named("KeyValuePairInfo")
                })
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/TableInfo", ["require", "./../proxyFix", "./../proxyCachedNode"], function(e) {
            "use strict";
            var t = e("./../proxyFix"),
                i = e("./../proxyCachedNode"),
                r = {
                    Chips: function() {
                        return t.multipleNode(this.Chip)
                    }
                };
            return function() {
                return {
                    Chips: i(this, r).named("Chips", "@currency"),
                    MaxSpotBetDivider: t.toNumber(this.MaxSpotBetDivider),
                    MinChipValue: t.toNumber(this.MinChipValue),
                    SideBetMax: t.toNumber(this.SideBetMax),
                    SideBetMin: t.toNumber(this.SideBetMin),
                    TableMax: t.toNumber(this.TableMax),
                    TableMin: t.toNumber(this.TableMin)
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/GameBetInfo", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return {
                    MinChipValue: t.toNumber(this.MinChipValue),
                    MinBet: t.toNumber(this.MinBet),
                    MaxBet: t.toNumber(this.MaxBet),
                    MinSideBet: t.toNumber(this.MinSideBet),
                    MaxSideBet: t.toNumber(this.MaxSideBet)
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse/PersonalProgressiveInfo", ["require", "./../proxyFix"], function(e) {
            "use strict";
            var t = e("./../proxyFix");
            return function() {
                return {
                    precision: t.toNumber(this["@precision"]),
                    strategy: this["@strategy"]
                }
            }
        }), define("skbJet/componentManchester/rgsModel/PaytableResponse", ["require", "./proxyCachedNode", "./PaytableResponse/AwardCapInfo", "./PaytableResponse/PaytableStatistics", "./PaytableResponse/PatternSliderInfo", "./PaytableResponse/StripInfo", "./PaytableResponse/LadderInfo", "./PaytableResponse/TriggerInfo", "./PaytableResponse/KeyValuePairInfo", "./PaytableResponse/KeyValueListInfo", "./PaytableResponse/MultiplierInfo", "./PaytableResponse/PickerInfo", "./PaytableResponse/PrizeInfo", "./PaytableResponse/SelectiveStackingInfo", "./PaytableResponse/Jackpot", "./PaytableResponse/GameData", "./PaytableResponse/TableInfo", "./PaytableResponse/GameBetInfo", "./PaytableResponse/PersonalProgressiveInfo"], function(e) {
            "use strict";
            var t = e("./proxyCachedNode"),
                i = Object.freeze({
                    AwardCapInfo: e("./PaytableResponse/AwardCapInfo"),
                    PaytableStatistics: e("./PaytableResponse/PaytableStatistics"),
                    PatternSliderInfo: e("./PaytableResponse/PatternSliderInfo"),
                    StripInfo: e("./PaytableResponse/StripInfo"),
                    LadderInfo: e("./PaytableResponse/LadderInfo"),
                    TriggerInfo: e("./PaytableResponse/TriggerInfo"),
                    KeyValuePairInfo: e("./PaytableResponse/KeyValuePairInfo"),
                    KeyValueListInfo: e("./PaytableResponse/KeyValueListInfo"),
                    MultiplierInfo: e("./PaytableResponse/MultiplierInfo"),
                    PickerInfo: e("./PaytableResponse/PickerInfo"),
                    PrizeInfo: e("./PaytableResponse/PrizeInfo"),
                    SelectiveStackingInfo: e("./PaytableResponse/SelectiveStackingInfo"),
                    Jackpot: e("./PaytableResponse/Jackpot"),
                    GameData: e("./PaytableResponse/GameData"),
                    TableInfo: e("./PaytableResponse/TableInfo"),
                    GameBetInfo: e("./PaytableResponse/GameBetInfo"),
                    PersonalProgressiveInfo: e("./PaytableResponse/PersonalProgressiveInfo")
                });
            return function(e) {
                var r = t(e, i);
                return Object.freeze({
                    AwardCapInfo: r.single("AwardCapInfo"),
                    PaytableStatistics: r.single("PaytableStatistics"),
                    PatternSliderInfo: r.single("PatternSliderInfo"),
                    StripInfo: r.named("StripInfo"),
                    LadderInfo: r.named("LadderInfo"),
                    TriggerInfo: r.named("TriggerInfo"),
                    KeyValuePairInfo: r.named("KeyValuePairInfo"),
                    KeyValueListInfo: r.named("KeyValueListInfo"),
                    MultiplierInfo: r.named("MultiplierInfo"),
                    PickerInfo: r.named("PickerInfo"),
                    PrizeInfo: r.named("PrizeInfo"),
                    SelectiveStackingInfo: r.single("SelectiveStackingInfo"),
                    Jackpot: r.single("Jackpot"),
                    GameData: r.single("GameData"),
                    TableInfo: r.named("TableInfo"),
                    GameBetInfo: r.single("GameBetInfo"),
                    PersonalProgressiveInfo: r.single("PersonalProgressiveInfo")
                })
            }
        }), define("skbJet/componentManchester/rgsModel/CurrencyResponse", ["require", "./proxyFix"], function(e) {
            "use strict";
            var t = e("./proxyFix");
            return function(e) {
                return function(i, r, n) {
                    function o(e) {
                        return (e * n).toFixed(c)
                    }

                    function s(e, t) {
                        var i, r = o(e).split("."),
                            n = (+r[0]).toString(),
                            s = r[1] || 0;
                        if (p)
                            for (; i = n.match(/^(\d+)(\d\d\d)(.*)$/);) n = i[1].concat(p, i[2], i[3]);
                        return t = t && 0 == +s, h.concat(n, t ? "" : f, t ? "" : s, d)
                    }
                    r = r.toLowerCase();
                    var a = e.filter(function(e) {
                        return e["@currencyCode"] === i
                    });
                    a = a.find(function(e) {
                        return e["@language"] && e["@language"].toLowerCase() === r
                    }) || a.find(function(e) {
                        return void 0 === e["@language"]
                    });
                    var l = a["@currencyCode"],
                        u = "true" === a.MAJOR_SYMBOL_PADDING_SPACE ? " " : "",
                        c = t.toInt(a.DECIMAL_PRECISION),
                        h = "left" === a.MAJOR_SYMBOL_ALIGNMENT ? a.MAJOR_SYMBOL + u : "",
                        d = "right" === a.MAJOR_SYMBOL_ALIGNMENT ? u + a.MAJOR_SYMBOL : "",
                        p = ("yes" === a.USE_THOUSANDS_SEPARATOR ? a.THOUSANDS_SEPARATOR : "").replace("_", " "),
                        f = (c ? a.DECIMAL_SEPARATOR : "").replace("_", " ");
                    return n = n || Math.pow(10, -c), Object.freeze({
                        toString: function() {
                            return l
                        },
                        toStakeUnits: function(e) {
                            return e / n
                        },
                        toCurrency: o,
                        formatFloat: function(e, t) {
                            return s(e / n, t)
                        },
                        format: s,
                        formatShort: function(e) {
                            return s(e, 1)
                        },
                        formatLong: function(e) {
                            return s(e, 0)
                        }
                    })
                }
            }
        }), define("skbJet/componentManchester/rgsModel/rgsModel", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "./GameLogicResponse", "./PaytableResponse", "./CurrencyResponse"], function(e) {
            "use strict";

            function t(e) {
                a.gameLogic = n(e.GameLogicResponse), a.paytable = o(e.PaytableResponse), a.currency = s(e.CurrencyResponse)
            }

            function i(e) {
                a.gameLogic = n(e.response)
            }
            var r = e("skbJet/component/gameMsgBus/GameMsgBus"),
                n = e("./GameLogicResponse"),
                o = e("./PaytableResponse"),
                s = e("./CurrencyResponse"),
                a = Object.seal({
                    gameLogic: {},
                    paytable: {},
                    currency: {}
                });
            return r.subscribe("platformMsg/ClientService/Game.Init", t), r.subscribe("onResolveStage", i), a
        }), define("skbJet/component/currencyHelper/Currency", [], function() {
            function e(e) {
                this.currencyData = e, this.decimalPrecision = Number(e.DECIMAL_PRECISION)
            }

            function t(e, t) {
                var i = Math.floor(e);
                if ("no" === t.USE_THOUSANDS_SEPARATOR) return i + "";
                for (var r = ""; i.toString().length > 3;) {
                    var n = i.toString().length - 3,
                        o = t.THOUSANDS_SEPARATOR;
                    o = "_" === o ? " " : o, r = o + i.toString().substring(n) + r, i = parseInt(i.toString().substring(0, n))
                }
                return r = i + r
            }

            function i(e, t, i) {
                if (!isNaN(e = Number(e))) {
                    if (i <= 0) return "";
                    var r = e.toFixed(i),
                        n = r.indexOf(".");
                    return -1 === n ? "" : t.DECIMAL_SEPARATOR + r.substring(n + 1)
                }
            }
            return e.prototype.formatBalance = function(e) {
                var r = t(Number(e), this.currencyData) + i(Number(e), this.currencyData, this.decimalPrecision);
                return "left" === this.currencyData.MAJOR_SYMBOL_ALIGNMENT ? r = "false" === this.currencyData.MAJOR_SYMBOL_PADDING_SPACE || !1 === this.currencyData.MAJOR_SYMBOL_PADDING_SPACE ? this.currencyData.MAJOR_SYMBOL + r : this.currencyData.MAJOR_SYMBOL + " " + r : "false" === this.currencyData.MAJOR_SYMBOL_PADDING_SPACE || !1 === this.currencyData.MAJOR_SYMBOL_PADDING_SPACE ? r += this.currencyData.MAJOR_SYMBOL : r = r + " " + this.currencyData.MAJOR_SYMBOL, r
            }, e.prototype.formatDecimal = function(e) {
                return e = Number(e), this.decimalPrecision <= 0 ? e : e.toFixed(this.decimalPrecision)
            }, e.prototype.formatFloat = function(e) {
                return e = Number(e), Number(this.decimalPrecision <= 0 ? e : e.toFixed(this.decimalPrecision))
            }, e.prototype.getCurrencyCode = function() {
                return this.currencyData["@currencyCode"]
            }, e
        }),
        define("skbJet/component/currencyHelper/currencyHelper", ["skbJet/component/gameMsgBus/GameMsgBus", "skbJet/component/currencyHelper/Currency"], function(e, t) {
            function i(e) {
                if (Array.isArray(e.CurrencyResponse))
                    for (var i = 0; i < e.CurrencyResponse.length; i++) {
                        var r = new t(e.CurrencyResponse[i].CURRENCY);
                        p[r.getCurrencyCode()] = r
                    } else {
                        var r = new t(e.CurrencyResponse.CURRENCY);
                        p[d] = r
                    }
            }

            function r(e) {
                h = Number(e.serverConfig.denomamount), d = e.gameConfig.currencycode
            }

            function n(e, t) {
                return t || (t = d), p[t] ? p[t].formatBalance(e) : ""
            }

            function o(e) {
                return l(e.replace(/[^\d.]/g, ""))
            }

            function s(e, t) {
                return t || (t = d), p[t] ? p[t].formatDecimal(e) : ""
            }

            function a(e) {
                if (!isNaN(e = Number(e))) return parseInt(e)
            }

            function l(e, t) {
                return t || (t = d), p[t] ? p[t].formatFloat(e) : ""
            }

            function u(e) {
                return e * (1e3 * h) / 1e3
            }

            function c(e) {
                return 1e3 * e / (1e3 * h)
            }
            var h, d, p = {};
            return e.subscribe("platformMsg/ClientService/Game.Init", i), e.subscribe("platformMsg/Kernel/System.Init", r), {
                formatBalance: n,
                formatFloat: l,
                formatInteger: a,
                convertToNumber: o,
                formatDecimal: s,
                fromStakeUnits: u,
                toStakeUnits: c
            }
        }), define("game/core/PlatformManager", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "game/commonUI/slot/betData", "skbJet/componentManchester/rgsModel/rgsModel", "skbJet/component/currencyHelper/currencyHelper", "game/data/gameEvents", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            "use strict";

            function t() {}

            function i(e) {
                y = R.i18n.Game, x = A.paytable.PatternSliderInfo().PatternInfo(), T = A.gameLogic.PatternSliderInput().PatternsBet, E = A.gameLogic.PatternSliderInput().BetPerPattern, b = A.paytable.PatternSliderInfo().BetInfo().Step, r()
            }

            function r() {
                n(), o(), s(), a(), c(), d(), l(x.min !== x.max), u(b.length > 0), h(!0)
            }

            function n() {
                S.publish(M.PLATFORM_TO_PLATFORM, {
                    channel: "Game",
                    topic: "Game.Register",
                    data: {
                        options: [{
                            name: "stake",
                            text: y.consoleBet,
                            type: "stake",
                            enabled: 0,
                            value: 0,
                            valueText: "0"
                        }]
                    }
                })
            }

            function o() {
                S.publish(M.PLATFORM_TO_PLATFORM, {
                    channel: "Game",
                    topic: "Game.Control",
                    data: {
                        name: "stake",
                        event: "change",
                        params: [C.fromStakeUnits(P.totalBet), C.formatBalance(C.fromStakeUnits(P.totalBet))]
                    }
                })
            }

            function s() {
                S.publish(M.PLATFORM_TO_PLATFORM, {
                    channel: "Game",
                    topic: "Game.Register",
                    data: {
                        options: [{
                            type: "list",
                            name: "patternsBet",
                            text: y.selectorPatterns,
                            enabled: 1,
                            valueText: x.Step,
                            values: x.Step,
                            value: T
                        }]
                    }
                })
            }

            function a() {
                S.publish(M.PLATFORM_TO_PLATFORM, {
                    channel: "Game",
                    topic: "Game.Register",
                    data: {
                        options: [{
                            type: "list",
                            name: "betPerPattern",
                            text: y.selectorBetPerPattern,
                            enabled: 1,
                            valueText: b.map(function(e) {
                                return C.formatBalance(C.fromStakeUnits(e))
                            }),
                            values: b,
                            value: E
                        }]
                    }
                })
            }

            function l(e) {
                S.publish(M.PLATFORM_TO_PLATFORM, {
                    channel: "Game",
                    topic: "Game.Control",
                    data: {
                        name: "patternsBet",
                        event: "enable",
                        params: [e ? 1 : 0]
                    }
                })
            }

            function u(e) {
                S.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.Control",
                    data: {
                        name: "betPerPattern",
                        event: "enable",
                        params: [e ? 1 : 0]
                    }
                })
            }

            function c() {
                S.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.Register",
                    data: {
                        options: [{
                            type: "command",
                            name: "paytable",
                            text: R.i18n.MenuCommand.payTable,
                            enabled: 0
                        }]
                    }
                }), S.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.Register",
                    data: {
                        options: [{
                            type: "command",
                            name: "howToPlay",
                            text: R.i18n.MenuCommand.howToPlay,
                            enabled: 0
                        }]
                    }
                })
            }

            function h(e) {
                S.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.Control",
                    data: {
                        name: "howToPlay",
                        event: "enable",
                        params: [e ? 1 : 0]
                    }
                }), S.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.Control",
                    data: {
                        name: "paytable",
                        event: "enable",
                        params: [e ? 1 : 0]
                    }
                })
            }

            function d() {
                S.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.Register",
                    data: {
                        options: [{
                            name: "sound",
                            text: "Sound",
                            type: "list",
                            enabled: 1,
                            value: 0,
                            values: ["0", "1"],
                            valueText: ["On", "Off"]
                        }]
                    }
                })
            }

            function p(e) {
                "BaseGame" === e.nextStage && _()
            }

            function f(e) {
                m()
            }

            function _() {
                S.publish(M.PLATFORM_TO_PLATFORM, {
                    channel: "Game",
                    topic: "Game.DeductStake",
                    data: C.fromStakeUnits(P.totalBet)
                })
            }

            function m() {
                null == w.playDataPayload && g(), S.publish(M.PLATFORM_TO_PLATFORM, {
                    channel: "Game",
                    topic: "Game.PlayData",
                    data: w.playDataPayload
                }), w.playDataPayload = null
            }

            function g() {
                I = {
                    ActionInput: {
                        Action: "play"
                    },
                    PatternSliderInput: {
                        BetPerPattern: P.betPerPattern,
                        PatternsBet: P.patternsBet
                    }
                }, w.playDataPayload = I
            }

            function v(e) {
                "sound" === e.option && ("0" === e.value ? O().setPlatformMute(0) : "1" === e.value && O().setPlatformMute(1))
            }
            var y, b, x, T, E, S = e("skbJet/component/gameMsgBus/GameMsgBus"),
                P = e("game/commonUI/slot/betData"),
                A = e("skbJet/componentManchester/rgsModel/rgsModel"),
                C = e("skbJet/component/currencyHelper/currencyHelper"),
                M = e("game/data/gameEvents"),
                R = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                O = e("game/components/createJsAudioPlayer/SoundManager"),
                w = null,
                I = {
                    ActionInput: {
                        Action: "play"
                    },
                    PatternSliderInput: {
                        BetPerPattern: P.betPerPattern,
                        PatternsBet: P.patternsBet
                    }
                };
            return t.prototype.playDataPayload = null, t.prototype.initConsole = function(e) {
                    i(e)
                }, t.prototype.enableControls = function(e) {
                    u(e), h(e)
                }, t.prototype.enableGameInfo = function(e) {
                    h(e)
                }, t.prototype.subscribeToMsgBus = function() {
                    S.subscribe(M.ON_BEFORE_REQUEST, p), S.subscribe(M.ON_MAKE_REQUEST, f), S.subscribe(M.PLATFORM_CONSOLE_BET_UPDATE, v)
                }, t.prototype.unsubscribeToMsgBus = function() {
                    S.unsubscribe(M.ON_BEFORE_REQUEST, p), S.unsubscribe(M.ON_MAKE_REQUEST, f), S.subscunsubscriberibe(M.PLATFORM_CONSOLE_BET_UPDATE, v)
                },
                function() {
                    return w = w || new t
                }
        }), define("game/core/ConsoleManager", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "game/data/gameEvents"], function(e) {
            "use strict";

            function t() {}

            function i(e) {
                e.option
            }
            var r = e("skbJet/component/gameMsgBus/GameMsgBus"),
                n = e("game/data/gameEvents"),
                o = null;
            return t.prototype.subscribeToMsgBus = function() {
                    r.subscribe(n.PLATFORM_CONSOLE_BET_UPDATE, i)
                }, t.prototype.unsubscribeToMsgBus = function() {
                    r.unsubscribe(n.PLATFORM_CONSOLE_BET_UPDATE, i)
                },
                function() {
                    return o = o || new t
                }
        }), define("game/configs/baseReelConfig", [], function() {
            var e = [0, 0],
                t = [194, 194],
                i = [8.8, 0];
            return {
                reelName: "BaseGame.Reels",
                symbolSlotWidth: t[0],
                symbolSlotHeight: t[1],
                symbolSpacingW: i[0],
                symbolSpacingH: i[1],
                options: {
                    clip: [{
                        x: e[0] - 10,
                        y: e[1] - 40,
                        w: 5 * t[0] + 4 * i[0] + 20,
                        h: 3 * t[1] + 2 * i[1] - 1 + 80
                    }],
                    pos: {
                        x: 10,
                        y: 40
                    },
                    reels: [{
                        symbolCount: 3
                    }, {
                        symbolCount: 3
                    }, {
                        symbolCount: 3
                    }, {
                        symbolCount: 3
                    }, {
                        symbolCount: 3
                    }]
                },
                symbolsMap: {
                    s01: "s01",
                    s02: "s02",
                    s03: "s03",
                    s04: "s04",
                    s05: "s05",
                    s06: "s06",
                    s07: "s07",
                    s08: "s08",
                    s09: "s09",
                    b01: "b01",
                    w04: "w01"
                },
                symbolNames: ["s01", "s02", "s03", "s04", "s05", "s06", "s07", "s08", "b01", "w01"],
                spriteMap: {
                    s01: "S01_Static",
                    s02: "S02_Static",
                    s03: "S03_Static",
                    s04: "S04_Static",
                    s05: "S05_Static",
                    s06: "S06_Static",
                    s07: "S07_Static",
                    s08: "S08_Static",
                    b01: "B01_Static",
                    w01: "W01_Static"
                },
                spriteOffsets: {
                    b01: {
                        x: -32.5,
                        y: -39,
                        z: 2
                    }
                },
                StripInfo: {},
                locationsMap: ["L0C0R0", "L0C0R1", "L0C0R2", "L0C1R0", "L0C1R1", "L0C1R2", "L0C2R0", "L0C2R1", "L0C2R2", "L0C3R0", "L0C3R1", "L0C3R2", "L0C4R0", "L0C4R1", "L0C4R2"]
            }
        }), define("game/utils/miscUtils", ["require", "game/data/setupData", "com/pixijs/pixi", "game/configs/baseReelConfig"], function(e) {
            function t() {
                if (g.DEV) {
                    for (var e = ["NORMAL", "IMPORTANT", "WARNING", "BEWARE", "SUPER_IMPORTANT"], t = [], i = 0; i < arguments.length; i++) t.push(arguments[i]);
                    for (var r = e.indexOf(t[t.length - 1]), n = e[r > -1 ? r : 0], o = "", s = r > -1 ? t.length - 1 : t.length, i = 0; i < s; i++) o += t[i] + (i < s - 1 ? ", " : "");
                    n === e[4] || n === e[3] || n === e[2] || e[1]
                }
            }

            function i(e) {
                var t = [];
                for (var i in e) t.push(i);
                return t
            }

            function r(e, t, i) {
                void 0 === i && (i = !1);
                return e = e.pixiContainer ? e.pixiContainer : e, e.rotation = (i ? e.rotation : 0) + .0174532925 * t, n(e)
            }

            function n(e) {
                if (!e.rotation && e.pixiContainer) e = e.pixiContainer;
                else if (!e.pixiContainer && !e.rotation) return void t("miscUtils.getDegrees - " + e + " is not a MovieClip or Sprite with rotation property!", "WARNING");
                return e.rotation / .0174532925
            }

            function o(e) {
                return .0174532925 * e
            }

            function s(e) {
                return e / .0174532925
            }

            function a(e, i) {
                return e[i] ? e[i] : (t("MISSING ASSET: '" + i + "'", "WARNING"), null)
            }

            function l(e, i) {
                if (void 0 === i && (i = "topLeft"), v.Texture.fromFrame(e)) {
                    var r = v.Texture.fromFrame(e),
                        n = new v.Sprite(r);
                    return "centre" === i ? n.anchor.set(.5, .5) : "centreRight" === i ? n.anchor.set(1, .5) : "centreLeft" === i ? n.anchor.set(0, .5) : "bottomRight" === i ? n.anchor.set(1, 1) : "bottomCentre" === i && n.anchor.set(.5, 1), n
                }
                return t("miscUtils.spriteFromTexture(" + e + ") - Does not exist!", "WARNING"), {}
            }

            function u(e, i, r, n, o, s, a, l) {
                var u = [];
                void 0 === n && (n = 2), void 0 === o && (o = 1), void 0 === s && (s = !1), void 0 === l && (l = !1), void 0 === a && (a = !1);
                for (var c = [], h = i; h <= r; h += l ? 2 : 1) {
                    var d = e + function(e) {
                        return 3 === n ? e > 99 ? e : e > 9 ? "0" + e : "00" + e : 2 === n ? e > 9 ? e : "0" + e : e
                    }(h);
                    s ? c.push(d) : (u.push(v.Texture.fromFrame(d)), a && c.push(d))
                }
                if (a || s) {
                    c = c.reverse();
                    for (var h = 1; h < c.length; h++) u.push(v.Texture.fromFrame(c[h]))
                }
                if (u.length > 0) {
                    var p = new v.extras.AnimatedSprite(u);
                    return p.animationSpeed = o, p
                }
                return t("miscUtils.createMovieClip() no frames found for:'" + e + "'!", "WARNING"), {}
            }

            function c(e, t, i, r, n, o) {
                void 0 === r && (r = 2), void 0 === n && (n = !1), void 0 === o && (o = 0);
                var s, a = [],
                    l = [],
                    u = [];
                for (s = t; s <= i; s++) {
                    var c = e + function(e) {
                        return 3 === r ? e > 99 ? e : e > 9 ? "0" + e : "00" + e : 2 === r ? e > 9 ? e : "0" + e : e
                    }(s);
                    a.push(c), l.push(c)
                }
                if (n && (l = l.reverse(), a = a.concat(l)), o > 0) {
                    for (s = 0; s < o; s++) u = u.concat(a);
                    return u
                }
                return a
            }

            function h(e, i, r) {
                var n = [];
                void 0 === i && (i = 1), void 0 === r && (r = "centre");
                for (var o = 0; o < e.length; o++) {
                    var s = e[o];
                    v.Texture.fromFrame(s) ? n.push(v.Texture.fromFrame(s)) : t("miscUtils.createMovieClip() frame:'" + s + "' not found!", "WARNING")
                }
                if (n.length > 0) {
                    var a = new v.extras.AnimatedSprite(n);
                    return a.animationSpeed = i, "centre" === r ? a.anchor.set(.5, .5) : "bottomRight" === r ? a.anchor.set(1, 1) : "bottomCentre" === r ? a.anchor.set(.5, 1) : "topCentre" === r && a.anchor.set(.5, 0), a
                }
                return t("miscUtils.createMovieClipFromArray() no frame assets found! '" + e + "'", "WARNING"), {}
            }

            function d(e, t) {
                var i = [];
                if (e.length > -1)
                    for (var r = 0; r < e.length; r++) e[r][t] && i.push(e[r][t]);
                else i.push(e[t]);
                return i
            }

            function p(e, t, i) {
                if (void 0 === i && (i = !1), e.length > -1) {
                    for (var r = 0; r < e.length; r++) {
                        if (i && e[r]["@name"].toLowerCase().indexOf(t.toLowerCase()) > -1) return e[r];
                        if (e[r]["@name"] === t) return e[r]
                    }
                    return null
                }
                return i && e["@name"].toLowerCase().indexOf(t.toLowerCase()) > -1 ? e : e["@name"] === t ? e : null
            }

            function f(e) {
                var i = y.locationsMap.indexOf(e);
                return i > -1 && i < 25 ? y.locationCellMap[i] : (t("winlineView.parseIndividualWinline() - impossible cell Number detected: " + i, "WARNING"), null)
            }

            function _(e, t, i, r, n, o, s) {
                var a = new v.Graphics;
                o > 0 && a.lineStyle(o, s), a.beginFill(i, void 0 === n ? 1 : n), a.drawRoundedRect(0, 0, t[0], t[1], r), a.endFill();
                var l = new v.Sprite(a.generateCanvasTexture());
                return e.addChild(l), l
            }

            function m(e, t, i, r) {
                void 0 === r && (r = !1);
                var n = function(e) {
                        return {
                            r: parseInt(e.substring(0, 2), 16),
                            g: parseInt(e.substring(2, 4), 16),
                            b: parseInt(e.substring(4), 16)
                        }
                    },
                    o = function(e) {
                        var t = (e >> 0).toString(16);
                        return 1 === t.length ? "0" + t : t
                    },
                    s = function(e) {
                        if (-1 === e.toString().indexOf("#")) {
                            for (e = e.toString(16); e.length < 6;) e = "0" + e;
                            return e
                        }
                        return e.substring(1)
                    },
                    a = n(s(e)),
                    l = n(s(t)),
                    u = o(a.r * i + l.r * (1 - i)),
                    c = o(a.g * i + l.g * (1 - i)),
                    h = o(a.b * i + l.b * (1 - i)),
                    d = u + c + h + "";
                return r ? "#" + d : parseInt("0x" + d)
            }
            var g = e("game/data/setupData"),
                v = e("com/pixijs/pixi"),
                y = e("game/configs/baseReelConfig");
            return {
                log: t,
                keysInObject: i,
                rotateDegrees: r,
                getDegrees: n,
                degToRad: o,
                radToDeg: s,
                checkExists: a,
                spriteFromTexture: l,
                createMovieClip: u,
                createMovieClipFromArray: h,
                createFrameNameArray: c,
                getDataFromElement: d,
                getElementFromName: p,
                cellFromLocationID: f,
                makeRect: _,
                blendHexColours: m
            }
        }), define("game/components/winSequence/anticipationAnim", ["require", "com/pixijs/pixi", "game/utils/miscUtils", "game/configs/baseReelConfig"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = e("game/utils/miscUtils"),
                r = e("game/configs/baseReelConfig"),
                n = function() {
                    function e() {
                        null != o && (n.removeChild(o), o.onComplete = null, o.stop()), o = i.createMovieClip("anticipation_anim_loop_", 6, 18, 3, .5), o.loop = !0, o.x = s.x, o.y = s.y, n.addChild(o), o.play()
                    }
                    t.Container.call(this);
                    var n = this,
                        o = null,
                        s = {
                            x: 0,
                            y: 0
                        };
                    this.play = function() {
                        o = i.createMovieClip("anticipation_anim_intro_", 0, 5, 3, .2), o.loop = !1, s.x = r.options.clip[0].x + 4 * r.symbolSlotWidth + 5 * r.symbolSpacingW, s.x += r.symbolSlotWidth / 2 - o.width / 2, s.y = r.options.clip[0].y - (o.height - r.options.clip[0].h) / 2, o.x = s.x, o.y = s.y, o.onComplete = e, n.addChild(o), o.play()
                    }, this.playOutro = function(e) {
                        null != o && (n.removeChild(o), o.onComplete = null, o.stop()), o = i.createMovieClip("anticipation_anim_outro_", 19, 24, 3, 1), o.loop = !1, o.x = s.x, o.y = s.y, n.addChild(o), o.onComplete = e, o.play()
                    }, this.stop = function() {
                        o.stop(), o.onComplete = null, o = null
                    }
                };
            return n.prototype = Object.create(t.Container.prototype), n.prototype.constructor = n, n
        }), define("game/commonUI/slot/layouts/desktop", [], function() {
            var e = {
                    x: 1290,
                    y: 750,
                    enabledTexture: "desktop_spinButtonEnabled",
                    disabledTexture: "desktop_spinButtonDisabled",
                    pressedTexture: "desktop_spinButtonPressed",
                    overTexture: "desktop_spinButtonOver"
                },
                t = {
                    x: 1290,
                    y: 750,
                    enabledTexture: "desktop_skipButtonEnabled",
                    disabledTexture: "desktop_skipButtonDisabled",
                    pressedTexture: "desktop_skipButtonPressed",
                    overTexture: "desktop_skipButtonOver"
                },
                i = {
                    x: 1290,
                    y: 750,
                    enabledTexture: "desktop_playButtonEnabled",
                    disabledTexture: "desktop_playButtonDisabled",
                    pressedTexture: "desktop_playButtonPressed",
                    overTexture: "desktop_playButtonOver"
                },
                r = {
                    x: 1190,
                    y: 765,
                    _meter: {
                        y: -75,
                        frame: "desktop_autoSpinCounterBackground"
                    },
                    _startButton: {
                        enabledTexture: "desktop_autoSpinButtonEnabled",
                        disabledTexture: "desktop_autoSpinButtonDisabled",
                        pressedTexture: "desktop_autoSpinButtonPressed",
                        overTexture: "desktop_autoSpinButtonOver"
                    },
                    _stopButton: {
                        enabledTexture: "desktop_autoSpinStopButtonEnabled",
                        disabledTexture: "desktop_autoSpinStopButtonDisabled",
                        pressedTexture: "desktop_autoSpinStopButtonPressed",
                        overTexture: "desktop_autoSpinStopButtonOver"
                    }
                },
                n = {
                    x: 1290,
                    y: 750,
                    targetTexture: "desktop_playButtonEnabled"
                };
            return {
                baseGame: {
                    footer: {
                        x: 740,
                        y: 740,
                        height: 70,
                        frame: "desktop_basegameMeter",
                        dividerFrame: "desktop_basegameMeterDivider",
                        fixedWidth: !1,
                        patternsBet: {
                            minWidth: 180,
                            visible: !0,
                            _valueText: {
                                y: 25
                            },
                            _labelText: {
                                y: -2
                            },
                            pivot: {
                                y: 22.5
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 26
                            },
                            labelStyle: {
                                fontSize: 26
                            },
                            index: 1
                        },
                        betPerPattern: {
                            minWidth: 180,
                            visible: !0,
                            _valueText: {
                                y: 25
                            },
                            _labelText: {
                                y: -2
                            },
                            pivot: {
                                y: 22.5
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 26
                            },
                            labelStyle: {
                                fontSize: 26
                            },
                            index: 2
                        },
                        totalBet: {
                            minWidth: 100,
                            visible: !0,
                            _valueText: {
                                y: 25
                            },
                            _labelText: {
                                y: -2
                            },
                            pivot: {
                                y: 22.5
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 26
                            },
                            labelStyle: {
                                fontSize: 26
                            },
                            index: 3,
                            buttonsVisible: !0,
                            plus: {
                                x: 85,
                                y: 22.5,
                                enabledTexture: "desktop_plusButtonEnabled",
                                disabledTexture: "desktop_plusButtonDisabled",
                                pressedTexture: "desktop_plusButtonPressed",
                                overTexture: "desktop_plusButtonOver"
                            },
                            minus: {
                                x: -85,
                                y: 22.5,
                                enabledTexture: "desktop_minusButtonEnabled",
                                disabledTexture: "desktop_minusButtonDisabled",
                                pressedTexture: "desktop_minusButtonPressed",
                                overTexture: "desktop_minusButtonOver"
                            }
                        },
                        win: {
                            minWidth: 180,
                            _valueText: {
                                y: 25
                            },
                            _labelText: {
                                y: -2
                            },
                            pivot: {
                                y: 22.5
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 26
                            },
                            labelStyle: {
                                fontSize: 26
                            },
                            index: 4
                        },
                        balance: {
                            minWidth: 180,
                            _valueText: {
                                y: 25
                            },
                            _labelText: {
                                y: -2
                            },
                            pivot: {
                                y: 22.5
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 22
                            },
                            labelStyle: {
                                fontSize: 26
                            },
                            index: 5
                        },
                        promoSpins: {
                            minWidth: 140,
                            _valueText: {
                                y: 25
                            },
                            _labelText: {
                                y: -2
                            },
                            pivot: {
                                y: 22.5
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 26
                            },
                            labelStyle: {
                                fontSize: 26
                            },
                            index: 5
                        },
                        buttonBackground: {
                            minWidth: 300,
                            visible: !0,
                            pivot: {
                                y: 22.5
                            },
                            index: 6
                        }
                    },
                    spin: e,
                    skip: t,
                    play: i,
                    autoSpin: r,
                    activityAnim: n,
                    betConfig: null,
                    prompt: null
                },
                freeSpins: {
                    footer: {
                        x: 820,
                        y: 740,
                        height: 70,
                        frame: "desktop_basegameMeter",
                        dividerFrame: "desktop_basegameMeterDivider",
                        fixedWidth: !1,
                        spins: {
                            minWidth: 400,
                            _valueText: {
                                y: 25
                            },
                            _labelText: {
                                y: -2
                            },
                            pivot: {
                                y: 22.5
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 26
                            },
                            labelStyle: {
                                fontSize: 26
                            },
                            index: 1
                        },
                        win: {
                            minWidth: 400,
                            _valueText: {
                                y: 25
                            },
                            _labelText: {
                                y: -2
                            },
                            pivot: {
                                y: 22.5
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 26
                            },
                            labelStyle: {
                                fontSize: 26
                            },
                            index: 2
                        },
                        bonusWin: {
                            minWidth: 400,
                            _valueText: {
                                y: 25
                            },
                            _labelText: {
                                y: -2
                            },
                            pivot: {
                                y: 22.5
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 26
                            },
                            labelStyle: {
                                fontSize: 26
                            },
                            index: 3
                        },
                        buttonBackground: {
                            minWidth: 300,
                            visible: !0,
                            pivot: {
                                y: 22.5
                            },
                            index: 4
                        }
                    },
                    spin: e,
                    skip: t,
                    play: i,
                    activityAnim: n
                }
            }
        }), define("game/commonUI/slot/layouts/landscape", [], function() {
            var e = {
                    x: 1331,
                    y: 407,
                    width: 180,
                    height: 180,
                    enabledTexture: "desktop_spinButtonEnabled",
                    disabledTexture: "desktop_spinButtonDisabled",
                    pressedTexture: "desktop_spinButtonPressed",
                    overTexture: "desktop_spinButtonOver"
                },
                t = {
                    x: 1331,
                    y: 407,
                    width: 180,
                    height: 180,
                    enabledTexture: "desktop_skipButtonEnabled",
                    disabledTexture: "desktop_skipButtonDisabled",
                    pressedTexture: "desktop_skipButtonPressed",
                    overTexture: "desktop_skipButtonOver"
                },
                i = {
                    x: 1331,
                    y: 407,
                    width: 180,
                    height: 180,
                    enabledTexture: "desktop_playButtonEnabled",
                    disabledTexture: "desktop_playButtonDisabled",
                    pressedTexture: "desktop_playButtonPressed",
                    overTexture: "desktop_playButtonOver"
                },
                r = {
                    x: 1331,
                    y: 250,
                    _meter: {
                        y: -75,
                        frame: "desktop_autoSpinCounterBackground"
                    },
                    _startButton: {
                        width: 102,
                        height: 102,
                        enabledTexture: "desktop_autoSpinButtonEnabled",
                        disabledTexture: "desktop_autoSpinButtonDisabled",
                        pressedTexture: "desktop_autoSpinButtonPressed",
                        overTexture: "desktop_autoSpinButtonOver"
                    },
                    _stopButton: {
                        width: 102,
                        height: 102,
                        enabledTexture: "desktop_autoSpinStopButtonEnabled",
                        disabledTexture: "desktop_autoSpinStopButtonDisabled",
                        pressedTexture: "desktop_autoSpinStopButtonPressed",
                        overTexture: "desktop_autoSpinStopButtonOver"
                    }
                },
                n = {
                    x: 1331,
                    y: 407,
                    targetTexture: "desktop_playButtonEnabled"
                },
                o = {
                    frame: "desktop_betControlsBackground",
                    _labelText: {
                        y: 101
                    },
                    _valueText: {
                        y: 47
                    },
                    multiline: !0,
                    pivot: {
                        y: 98
                    },
                    plus: {
                        x: 362,
                        y: 98,
                        enabledTexture: "desktop_plusButtonEnabled",
                        disabledTexture: "desktop_plusButtonDisabled",
                        pressedTexture: "desktop_plusButtonPressed",
                        overTexture: "desktop_plusButtonOver"
                    },
                    minus: {
                        x: -352,
                        y: 98,
                        enabledTexture: "desktop_minusButtonEnabled",
                        disabledTexture: "desktop_minusButtonDisabled",
                        pressedTexture: "desktop_minusButtonPressed",
                        overTexture: "desktop_minusButtonOver"
                    },
                    pips: {
                        x: 0,
                        y: 150
                    },
                    pipActiveFrame: "desktop_betIndicatorActive",
                    pipInactiveFrame: "desktop_betIndicatorActive"
                };
            return {
                baseGame: {
                    footer: {
                        x: 720,
                        y: 710,
                        height: 100,
                        fixedWidth: 1440,
                        frame: "desktop_betControlsBackground",
                        dividerFrame: "desktop_basegameMeterDivider",
                        patternsBet: null,
                        betPerPattern: null,
                        totalBet: {
                            minWidth: 120,
                            _labelText: {
                                y: 0
                            },
                            _labelText: {
                                y: 0
                            },
                            pivot: {
                                y: 10
                            },
                            multiline: !1,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 1
                        },
                        win: {
                            minWidth: 120,
                            _labelText: {
                                y: 0
                            },
                            _labelText: {
                                y: 0
                            },
                            pivot: {
                                y: 10
                            },
                            multiline: !1,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 2
                        },
                        balance: {
                            minWidth: 120,
                            _labelText: {
                                y: 0
                            },
                            _labelText: {
                                y: 0
                            },
                            pivot: {
                                y: 10
                            },
                            multiline: !1,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 3
                        },
                        promoSpins: {
                            minWidth: 120,
                            _labelText: {
                                y: 0
                            },
                            _labelText: {
                                y: 0
                            },
                            pivot: {
                                y: 10
                            },
                            multiline: !1,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 3
                        }
                    },
                    spin: e,
                    skip: t,
                    play: i,
                    autoSpin: r,
                    activityAnim: n,
                    betConfig: {
                        openButton: {
                            x: 114,
                            y: 407,
                            enabledTexture: "landscape_betControlsButtonEnabled",
                            disabledTexture: "landscape_betControlsButtonDisabled",
                            pressedTexture: "landscape_betControlsButtonPressed",
                            overTexture: "landscape_betControlsButtonOver"
                        },
                        closeButton: {
                            x: 1331,
                            y: 407,
                            enabledTexture: "desktop_acceptButtonEnabled",
                            disabledTexture: "desktop_acceptButtonDisabled",
                            pressedTexture: "desktop_acceptButtonPressed",
                            overTexture: "desktop_acceptButtonOver"
                        },
                        controls: {
                            x: 720,
                            y: 408,
                            anchor: {
                                y: .5
                            }
                        },
                        totalBet: o,
                        betPerPattern: o,
                        patternsBet: o,
                        betSummary: o,
                        meterBar: {
                            x: -411,
                            y: -175,
                            frame: "desktop_betControlsBackgroundTop",
                            betPerPattern: {
                                x: 616,
                                y: 30,
                                multiline: !1,
                                pivot: {
                                    y: 12
                                }
                            },
                            patternsBet: {
                                x: 205,
                                y: 30,
                                multiline: !1,
                                pivot: {
                                    y: 12
                                }
                            }
                        }
                    },
                    prompt: {
                        x: 450,
                        y: 330,
                        _text: {
                            x: 10,
                            y: -30
                        },
                        textStyle: {
                            fontSize: 32
                        },
                        enabledTexture: "desktop_messagePrompt"
                    }
                },
                freeSpins: {
                    footer: {
                        x: 720,
                        y: 710,
                        height: 100,
                        fixedWidth: 1440,
                        frame: "desktop_betControlsBackground",
                        dividerFrame: "desktop_basegameMeterDivider",
                        spins: {
                            minWidth: 120,
                            _labelText: {
                                y: 0
                            },
                            _labelText: {
                                y: 0
                            },
                            pivot: {
                                y: 10
                            },
                            multiline: !1,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 1
                        },
                        win: {
                            minWidth: 120,
                            _labelText: {
                                y: 0
                            },
                            _labelText: {
                                y: 0
                            },
                            pivot: {
                                y: 10
                            },
                            multiline: !1,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 2
                        },
                        bonusWin: {
                            minWidth: 120,
                            _labelText: {
                                y: 0
                            },
                            _labelText: {
                                y: 0
                            },
                            pivot: {
                                y: 10
                            },
                            multiline: !1,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 3
                        }
                    },
                    spin: e,
                    skip: t,
                    play: i,
                    activityAnim: n
                }
            }
        }), define("game/commonUI/slot/layouts/portrait", [], function() {
            var e = {
                    x: 405,
                    y: 985,
                    width: 180,
                    height: 180,
                    enabledTexture: "desktop_spinButtonEnabled",
                    disabledTexture: "desktop_spinButtonDisabled",
                    pressedTexture: "desktop_spinButtonPressed",
                    overTexture: "desktop_spinButtonOver"
                },
                t = {
                    x: 405,
                    y: 985,
                    width: 180,
                    height: 180,
                    enabledTexture: "desktop_skipButtonEnabled",
                    disabledTexture: "desktop_skipButtonDisabled",
                    pressedTexture: "desktop_skipButtonPressed",
                    overTexture: "desktop_skipButtonOver"
                },
                i = {
                    x: 405,
                    y: 985,
                    width: 180,
                    height: 180,
                    enabledTexture: "desktop_playButtonEnabled",
                    disabledTexture: "desktop_playButtonDisabled",
                    pressedTexture: "desktop_playButtonPressed",
                    overTexture: "desktop_playButtonOver"
                },
                r = {
                    x: 660,
                    y: 985,
                    _meter: {
                        y: -100,
                        frame: "desktop_autoSpinCounterBackground"
                    },
                    _startButton: {
                        width: 102,
                        height: 102,
                        enabledTexture: "desktop_autoSpinButtonEnabled",
                        disabledTexture: "desktop_autoSpinButtonDisabled",
                        pressedTexture: "desktop_autoSpinButtonPressed",
                        overTexture: "desktop_autoSpinButtonOver"
                    },
                    _stopButton: {
                        width: 102,
                        height: 102,
                        enabledTexture: "desktop_autoSpinStopButtonEnabled",
                        disabledTexture: "desktop_autoSpinStopButtonDisabled",
                        pressedTexture: "desktop_autoSpinStopButtonPressed",
                        overTexture: "desktop_autoSpinStopButtonOver"
                    }
                },
                n = {
                    x: 405,
                    y: 985,
                    targetTexture: "desktop_playButtonEnabled"
                },
                o = {
                    frame: "desktop_betControlsBackground",
                    _labelText: {
                        y: 104
                    },
                    _valueText: {
                        y: 45
                    },
                    pivot: {
                        y: 98
                    },
                    multiline: !0,
                    plus: {
                        x: 318,
                        y: 97,
                        enabledTexture: "desktop_plusButtonEnabled",
                        disabledTexture: "desktop_plusButtonDisabled",
                        pressedTexture: "desktop_plusButtonPressed",
                        overTexture: "desktop_plusButtonOver"
                    },
                    minus: {
                        x: -308,
                        y: 97,
                        enabledTexture: "desktop_minusButtonEnabled",
                        disabledTexture: "desktop_minusButtonDisabled",
                        pressedTexture: "desktop_minusButtonPressed",
                        overTexture: "desktop_minusButtonOver"
                    },
                    pips: {
                        y: 150
                    },
                    pipActiveFrame: "desktop_betIndicatorActive",
                    pipInactiveFrame: "desktop_betIndicatorActive"
                };
            return {
                baseGame: {
                    footer: {
                        x: 405,
                        y: 1200,
                        height: 100,
                        fixedWidth: 810,
                        frame: "desktop_betControlsBackground",
                        dividerFrame: "desktop_basegameMeterDivider",
                        patternsBet: null,
                        betPerPattern: null,
                        totalBet: {
                            minWidth: 120,
                            _labelText: {
                                y: 30
                            },
                            _valueText: {
                                y: -10
                            },
                            pivot: {
                                y: 27
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 1,
                            buttonsVisible: !1,
                            plus: null,
                            minus: null
                        },
                        win: {
                            minWidth: 120,
                            _labelText: {
                                y: 30
                            },
                            _valueText: {
                                y: -10
                            },
                            pivot: {
                                y: 27
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 2
                        },
                        balance: {
                            minWidth: 120,
                            _labelText: {
                                y: 30
                            },
                            _valueText: {
                                y: -10
                            },
                            pivot: {
                                y: 27
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 3
                        },
                        promoSpins: {
                            minWidth: 120,
                            _labelText: {
                                y: 30
                            },
                            _valueText: {
                                y: -10
                            },
                            pivot: {
                                y: 27
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 3
                        }
                    },
                    spin: {
                        x: 405,
                        y: 985,
                        width: 180,
                        height: 180,
                        enabledTexture: "desktop_spinButtonEnabled",
                        disabledTexture: "desktop_spinButtonDisabled",
                        pressedTexture: "desktop_spinButtonPressed",
                        overTexture: "desktop_spinButtonOver"
                    },
                    skip: t,
                    play: i,
                    autoSpin: r,
                    activityAnim: n,
                    betConfig: {
                        openButton: {
                            x: 150,
                            y: 985,
                            enabledTexture: "desktop_betControlsButtonEnabled",
                            disabledTexture: "desktop_betControlsButtonDisabled",
                            pressedTexture: "desktop_betControlsButtonPressed",
                            overTexture: "desktop_betControlsButtonOver"
                        },
                        closeButton: {
                            x: 405,
                            y: 985,
                            enabledTexture: "desktop_acceptButtonEnabled",
                            pressedTexture: "desktop_acceptButtonPressed",
                            overTexture: "desktop_acceptButtonOver"
                        },
                        controls: {
                            x: 405,
                            y: 750,
                            frame: null
                        },
                        totalBet: o,
                        betPerPattern: o,
                        patternsBet: o,
                        betSummary: o,
                        meterBar: {
                            x: -405,
                            y: -175,
                            frame: "desktop_betControlsBackgroundTop",
                            betPerPattern: {
                                x: 608,
                                y: 30,
                                multiline: !1,
                                pivot: {
                                    y: 10
                                }
                            },
                            patternsBet: {
                                x: 202,
                                y: 30,
                                multiline: !1,
                                pivot: {
                                    y: 10
                                }
                            }
                        }
                    },
                    prompt: {
                        x: 405,
                        y: 850,
                        _text: {
                            x: 0,
                            y: -33
                        },
                        textStyle: {
                            fontSize: 32
                        },
                        enabledTexture: "desktop_messagePrompt"
                    }
                },
                freeSpins: {
                    footer: {
                        x: 405,
                        y: 1200,
                        height: 100,
                        fixedWidth: 810,
                        frame: "desktop_betControlsBackground",
                        dividerFrame: "desktop_basegameMeterDivider",
                        patternsBet: null,
                        betPerPattern: null,
                        spins: {
                            minWidth: 120,
                            _labelText: {
                                y: 30
                            },
                            _valueText: {
                                y: -10
                            },
                            pivot: {
                                y: 27
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 1,
                            buttonsVisible: !1,
                            plus: null,
                            minus: null
                        },
                        win: {
                            minWidth: 120,
                            _labelText: {
                                y: 30
                            },
                            _valueText: {
                                y: -10
                            },
                            pivot: {
                                y: 27
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 2
                        },
                        bonusWin: {
                            minWidth: 120,
                            _labelText: {
                                y: 30
                            },
                            _valueText: {
                                y: -10
                            },
                            pivot: {
                                y: 27
                            },
                            multiline: !0,
                            valueStyle: {
                                fontSize: 30
                            },
                            labelStyle: {
                                fontSize: 30
                            },
                            index: 3
                        }
                    },
                    spin: e,
                    skip: t,
                    play: i,
                    activityAnim: n
                }
            }
        }), define("game/commonUI/slot/layout", ["require", "./layouts/desktop", "./layouts/landscape", "./layouts/portrait"], function(e) {
            var t = e("./layouts/desktop"),
                i = e("./layouts/landscape"),
                r = e("./layouts/portrait");
            return {
                MOB: {
                    portrait: r,
                    landscape: i
                },
                TAB: {
                    portrait: r,
                    landscape: i
                },
                INT: {
                    landscape: t,
                    portrait: r
                }
            }
        }),
        function(e, t) {
            "use strict";
            var i = {},
                r = e.document,
                n = e.GreenSockGlobals = e.GreenSockGlobals || e;
            if (!n.TweenLite) {
                var o, s, a, l, u, c = function(e) {
                        var t, i = e.split("."),
                            r = n;
                        for (t = 0; t < i.length; t++) r[i[t]] = r = r[i[t]] || {};
                        return r
                    },
                    h = c("com.greensock"),
                    d = function(e) {
                        var t, i = [],
                            r = e.length;
                        for (t = 0; t !== r; i.push(e[t++]));
                        return i
                    },
                    p = function() {},
                    f = function() {
                        var e = Object.prototype.toString,
                            t = e.call([]);
                        return function(i) {
                            return null != i && (i instanceof Array || "object" == typeof i && !!i.push && e.call(i) === t)
                        }
                    }(),
                    _ = {},
                    m = function(t, r, o, s) {
                        this.sc = _[t] ? _[t].sc : [], _[t] = this, this.gsClass = null, this.func = o;
                        var a = [];
                        this.check = function(l) {
                            for (var u, h, d, p, f = r.length, g = f; --f > -1;)(u = _[r[f]] || new m(r[f], [])).gsClass ? (a[f] = u.gsClass, g--) : l && u.sc.push(this);
                            if (0 === g && o) {
                                if (h = ("com.greensock." + t).split("."), d = h.pop(), p = c(h.join("."))[d] = this.gsClass = o.apply(o, a), s)
                                    if (n[d] = i[d] = p, "undefined" != typeof module && module.exports)
                                        if ("TweenLite" === t) {
                                            module.exports = i.TweenLite = p;
                                            for (f in i) p[f] = i[f]
                                        } else i.TweenLite && (i.TweenLite[d] = p);
                                else "function" == typeof define && define.amd && define((e.GreenSockAMDPath ? e.GreenSockAMDPath + "/" : "") + t.split(".").pop(), [], function() {
                                    return p
                                });
                                for (f = 0; f < this.sc.length; f++) this.sc[f].check()
                            }
                        }, this.check(!0)
                    },
                    g = e._gsDefine = function(e, t, i, r) {
                        return new m(e, t, i, r)
                    },
                    v = h._class = function(e, t, i) {
                        return t = t || function() {}, g(e, [], function() {
                            return t
                        }, i), t
                    };
                g.globals = n;
                var y = [0, 0, 1, 1],
                    b = v("easing.Ease", function(e, t, i, r) {
                        this._func = e, this._type = i || 0, this._power = r || 0, this._params = t ? y.concat(t) : y
                    }, !0),
                    x = b.map = {},
                    T = b.register = function(e, t, i, r) {
                        for (var n, o, s, a, l = t.split(","), u = l.length, c = (i || "easeIn,easeOut,easeInOut").split(","); --u > -1;)
                            for (o = l[u], n = r ? v("easing." + o, null, !0) : h.easing[o] || {}, s = c.length; --s > -1;) a = c[s], x[o + "." + a] = x[a + o] = n[a] = e.getRatio ? e : e[a] || new e
                    };
                for (a = b.prototype, a._calcEnd = !1, a.getRatio = function(e) {
                        if (this._func) return this._params[0] = e, this._func.apply(null, this._params);
                        var t = this._type,
                            i = this._power,
                            r = 1 === t ? 1 - e : 2 === t ? e : e < .5 ? 2 * e : 2 * (1 - e);
                        return 1 === i ? r *= r : 2 === i ? r *= r * r : 3 === i ? r *= r * r * r : 4 === i && (r *= r * r * r * r), 1 === t ? 1 - r : 2 === t ? r : e < .5 ? r / 2 : 1 - r / 2
                    }, o = ["Linear", "Quad", "Cubic", "Quart", "Quint,Strong"], s = o.length; --s > -1;) a = o[s] + ",Power" + s, T(new b(null, null, 1, s), a, "easeOut", !0), T(new b(null, null, 2, s), a, "easeIn" + (0 === s ? ",easeNone" : "")), T(new b(null, null, 3, s), a, "easeInOut");
                x.linear = h.easing.Linear.easeIn, x.swing = h.easing.Quad.easeInOut;
                var E = v("events.EventDispatcher", function(e) {
                    this._listeners = {}, this._eventTarget = e || this
                });
                a = E.prototype, a.addEventListener = function(e, t, i, r, n) {
                    n = n || 0;
                    var o, s, a = this._listeners[e],
                        c = 0;
                    for (this !== l || u || l.wake(), null == a && (this._listeners[e] = a = []), s = a.length; --s > -1;) o = a[s], o.c === t && o.s === i ? a.splice(s, 1) : 0 === c && o.pr < n && (c = s + 1);
                    a.splice(c, 0, {
                        c: t,
                        s: i,
                        up: r,
                        pr: n
                    })
                }, a.removeEventListener = function(e, t) {
                    var i, r = this._listeners[e];
                    if (r)
                        for (i = r.length; --i > -1;)
                            if (r[i].c === t) return void r.splice(i, 1)
                }, a.dispatchEvent = function(e) {
                    var t, i, r, n = this._listeners[e];
                    if (n)
                        for (t = n.length, t > 1 && (n = n.slice(0)), i = this._eventTarget; --t > -1;)(r = n[t]) && (r.up ? r.c.call(r.s || i, {
                            type: e,
                            target: i
                        }) : r.c.call(r.s || i))
                };
                var S = e.requestAnimationFrame,
                    P = e.cancelAnimationFrame,
                    A = Date.now || function() {
                        return (new Date).getTime()
                    },
                    C = A();
                for (o = ["ms", "moz", "webkit", "o"], s = o.length; --s > -1 && !S;) S = e[o[s] + "RequestAnimationFrame"], P = e[o[s] + "CancelAnimationFrame"] || e[o[s] + "CancelRequestAnimationFrame"];
                v("Ticker", function(e, t) {
                    var i, n, o, s, a, c = this,
                        h = A(),
                        d = !(!1 === t || !S) && "auto",
                        f = 500,
                        _ = 33,
                        m = function(e) {
                            var t, r, l = A() - C;
                            l > f && (h += l - _), C += l, c.time = (C - h) / 1e3, t = c.time - a, (!i || t > 0 || !0 === e) && (c.frame++, a += t + (t >= s ? .004 : s - t), r = !0), !0 !== e && (o = n(m)), r && c.dispatchEvent("tick")
                        };
                    E.call(c), c.time = c.frame = 0, c.tick = function() {
                        m(!0)
                    }, c.lagSmoothing = function(e, t) {
                        f = e || 1e10, _ = Math.min(t, f, 0)
                    }, c.sleep = function() {
                        null != o && (d && P ? P(o) : clearTimeout(o), n = p, o = null, c === l && (u = !1))
                    }, c.wake = function(e) {
                        null !== o ? c.sleep() : e ? h += -C + (C = A()) : c.frame > 10 && (C = A() - f + 5), n = 0 === i ? p : d && S ? S : function(e) {
                            return setTimeout(e, 1e3 * (a - c.time) + 1 | 0)
                        }, c === l && (u = !0), m(2)
                    }, c.fps = function(e) {
                        if (!arguments.length) return i;
                        i = e, s = 1 / (i || 60), a = this.time + s, c.wake()
                    }, c.useRAF = function(e) {
                        if (!arguments.length) return d;
                        c.sleep(), d = e, c.fps(i)
                    }, c.fps(e), setTimeout(function() {
                        "auto" === d && c.frame < 5 && "hidden" !== r.visibilityState && c.useRAF(!1)
                    }, 1500)
                }), a = h.Ticker.prototype = new h.events.EventDispatcher, a.constructor = h.Ticker;
                var M = v("core.Animation", function(e, t) {
                    if (this.vars = t = t || {}, this._duration = this._totalDuration = e || 0, this._delay = Number(t.delay) || 0, this._timeScale = 1, this._active = !0 === t.immediateRender, this.data = t.data, this._reversed = !0 === t.reversed, q) {
                        u || l.wake();
                        var i = this.vars.useFrames ? Y : q;
                        i.add(this, i._time), this.vars.paused && this.paused(!0)
                    }
                });
                l = M.ticker = new h.Ticker, a = M.prototype, a._dirty = a._gc = a._initted = a._paused = !1, a._totalTime = a._time = 0, a._rawPrevTime = -1, a._next = a._last = a._onUpdate = a._timeline = a.timeline = null, a._paused = !1;
                var R = function() {
                    u && A() - C > 2e3 && "hidden" !== r.visibilityState && l.wake();
                    var e = setTimeout(R, 2e3);
                    e.unref && e.unref()
                };
                R(), a.play = function(e, t) {
                    return null != e && this.seek(e, t), this.reversed(!1).paused(!1)
                }, a.pause = function(e, t) {
                    return null != e && this.seek(e, t), this.paused(!0)
                }, a.resume = function(e, t) {
                    return null != e && this.seek(e, t), this.paused(!1)
                }, a.seek = function(e, t) {
                    return this.totalTime(Number(e), !1 !== t)
                }, a.restart = function(e, t) {
                    return this.reversed(!1).paused(!1).totalTime(e ? -this._delay : 0, !1 !== t, !0)
                }, a.reverse = function(e, t) {
                    return null != e && this.seek(e || this.totalDuration(), t), this.reversed(!0).paused(!1)
                }, a.render = function(e, t, i) {}, a.invalidate = function() {
                    return this._time = this._totalTime = 0, this._initted = this._gc = !1, this._rawPrevTime = -1, !this._gc && this.timeline || this._enabled(!0), this
                }, a.isActive = function() {
                    var e, t = this._timeline,
                        i = this._startTime;
                    return !t || !this._gc && !this._paused && t.isActive() && (e = t.rawTime(!0)) >= i && e < i + this.totalDuration() / this._timeScale - 1e-7
                }, a._enabled = function(e, t) {
                    return u || l.wake(), this._gc = !e, this._active = this.isActive(), !0 !== t && (e && !this.timeline ? this._timeline.add(this, this._startTime - this._delay) : !e && this.timeline && this._timeline._remove(this, !0)), !1
                }, a._kill = function(e, t) {
                    return this._enabled(!1, !1)
                }, a.kill = function(e, t) {
                    return this._kill(e, t), this
                }, a._uncache = function(e) {
                    for (var t = e ? this : this.timeline; t;) t._dirty = !0, t = t.timeline;
                    return this
                }, a._swapSelfInParams = function(e) {
                    for (var t = e.length, i = e.concat(); --t > -1;) "{self}" === e[t] && (i[t] = this);
                    return i
                }, a._callback = function(e) {
                    var t = this.vars,
                        i = t[e],
                        r = t[e + "Params"],
                        n = t[e + "Scope"] || t.callbackScope || this;
                    switch (r ? r.length : 0) {
                        case 0:
                            i.call(n);
                            break;
                        case 1:
                            i.call(n, r[0]);
                            break;
                        case 2:
                            i.call(n, r[0], r[1]);
                            break;
                        default:
                            i.apply(n, r)
                    }
                }, a.eventCallback = function(e, t, i, r) {
                    if ("on" === (e || "").substr(0, 2)) {
                        var n = this.vars;
                        if (1 === arguments.length) return n[e];
                        null == t ? delete n[e] : (n[e] = t, n[e + "Params"] = f(i) && -1 !== i.join("").indexOf("{self}") ? this._swapSelfInParams(i) : i, n[e + "Scope"] = r), "onUpdate" === e && (this._onUpdate = t)
                    }
                    return this
                }, a.delay = function(e) {
                    return arguments.length ? (this._timeline.smoothChildTiming && this.startTime(this._startTime + e - this._delay), this._delay = e, this) : this._delay
                }, a.duration = function(e) {
                    return arguments.length ? (this._duration = this._totalDuration = e, this._uncache(!0), this._timeline.smoothChildTiming && this._time > 0 && this._time < this._duration && 0 !== e && this.totalTime(this._totalTime * (e / this._duration), !0), this) : (this._dirty = !1, this._duration)
                }, a.totalDuration = function(e) {
                    return this._dirty = !1, arguments.length ? this.duration(e) : this._totalDuration
                }, a.time = function(e, t) {
                    return arguments.length ? (this._dirty && this.totalDuration(), this.totalTime(e > this._duration ? this._duration : e, t)) : this._time
                }, a.totalTime = function(e, t, i) {
                    if (u || l.wake(), !arguments.length) return this._totalTime;
                    if (this._timeline) {
                        if (e < 0 && !i && (e += this.totalDuration()),
                            this._timeline.smoothChildTiming) {
                            this._dirty && this.totalDuration();
                            var r = this._totalDuration,
                                n = this._timeline;
                            if (e > r && !i && (e = r), this._startTime = (this._paused ? this._pauseTime : n._time) - (this._reversed ? r - e : e) / this._timeScale, n._dirty || this._uncache(!1), n._timeline)
                                for (; n._timeline;) n._timeline._time !== (n._startTime + n._totalTime) / n._timeScale && n.totalTime(n._totalTime, !0), n = n._timeline
                        }
                        this._gc && this._enabled(!0, !1), this._totalTime === e && 0 !== this._duration || (L.length && Q(), this.render(e, t, !1), L.length && Q())
                    }
                    return this
                }, a.progress = a.totalProgress = function(e, t) {
                    var i = this.duration();
                    return arguments.length ? this.totalTime(i * e, t) : i ? this._time / i : this.ratio
                }, a.startTime = function(e) {
                    return arguments.length ? (e !== this._startTime && (this._startTime = e, this.timeline && this.timeline._sortChildren && this.timeline.add(this, e - this._delay)), this) : this._startTime
                }, a.endTime = function(e) {
                    return this._startTime + (0 != e ? this.totalDuration() : this.duration()) / this._timeScale
                }, a.timeScale = function(e) {
                    if (!arguments.length) return this._timeScale;
                    if (e = e || 1e-10, this._timeline && this._timeline.smoothChildTiming) {
                        var t = this._pauseTime,
                            i = t || 0 === t ? t : this._timeline.totalTime();
                        this._startTime = i - (i - this._startTime) * this._timeScale / e
                    }
                    return this._timeScale = e, this._uncache(!1)
                }, a.reversed = function(e) {
                    return arguments.length ? (e != this._reversed && (this._reversed = e, this.totalTime(this._timeline && !this._timeline.smoothChildTiming ? this.totalDuration() - this._totalTime : this._totalTime, !0)), this) : this._reversed
                }, a.paused = function(e) {
                    if (!arguments.length) return this._paused;
                    var t, i, r = this._timeline;
                    return e != this._paused && r && (u || e || l.wake(), t = r.rawTime(), i = t - this._pauseTime, !e && r.smoothChildTiming && (this._startTime += i, this._uncache(!1)), this._pauseTime = e ? t : null, this._paused = e, this._active = this.isActive(), !e && 0 !== i && this._initted && this.duration() && (t = r.smoothChildTiming ? this._totalTime : (t - this._startTime) / this._timeScale, this.render(t, t === this._totalTime, !0))), this._gc && !e && this._enabled(!0, !1), this
                };
                var O = v("core.SimpleTimeline", function(e) {
                    M.call(this, 0, e), this.autoRemoveChildren = this.smoothChildTiming = !0
                });
                a = O.prototype = new M, a.constructor = O, a.kill()._gc = !1, a._first = a._last = a._recent = null, a._sortChildren = !1, a.add = a.insert = function(e, t, i, r) {
                    var n, o;
                    if (e._startTime = Number(t || 0) + e._delay, e._paused && this !== e._timeline && (e._pauseTime = e._startTime + (this.rawTime() - e._startTime) / e._timeScale), e.timeline && e.timeline._remove(e, !0), e.timeline = e._timeline = this, e._gc && e._enabled(!0, !0), n = this._last, this._sortChildren)
                        for (o = e._startTime; n && n._startTime > o;) n = n._prev;
                    return n ? (e._next = n._next, n._next = e) : (e._next = this._first, this._first = e), e._next ? e._next._prev = e : this._last = e, e._prev = n, this._recent = e, this._timeline && this._uncache(!0), this
                }, a._remove = function(e, t) {
                    return e.timeline === this && (t || e._enabled(!1, !0), e._prev ? e._prev._next = e._next : this._first === e && (this._first = e._next), e._next ? e._next._prev = e._prev : this._last === e && (this._last = e._prev), e._next = e._prev = e.timeline = null, e === this._recent && (this._recent = this._last), this._timeline && this._uncache(!0)), this
                }, a.render = function(e, t, i) {
                    var r, n = this._first;
                    for (this._totalTime = this._time = this._rawPrevTime = e; n;) r = n._next, (n._active || e >= n._startTime && !n._paused && !n._gc) && (n._reversed ? n.render((n._dirty ? n.totalDuration() : n._totalDuration) - (e - n._startTime) * n._timeScale, t, i) : n.render((e - n._startTime) * n._timeScale, t, i)), n = r
                }, a.rawTime = function() {
                    return u || l.wake(), this._totalTime
                };
                var w = v("TweenLite", function(t, i, r) {
                        if (M.call(this, i, r), this.render = w.prototype.render, null == t) throw "Cannot tween a null target.";
                        this.target = t = "string" != typeof t ? t : w.selector(t) || t;
                        var n, o, s, a = t.jquery || t.length && t !== e && t[0] && (t[0] === e || t[0].nodeType && t[0].style && !t.nodeType),
                            l = this.vars.overwrite;
                        if (this._overwrite = l = null == l ? X[w.defaultOverwrite] : "number" == typeof l ? l >> 0 : X[l], (a || t instanceof Array || t.push && f(t)) && "number" != typeof t[0])
                            for (this._targets = s = d(t), this._propLookup = [], this._siblings = [], n = 0; n < s.length; n++) o = s[n], o ? "string" != typeof o ? o.length && o !== e && o[0] && (o[0] === e || o[0].nodeType && o[0].style && !o.nodeType) ? (s.splice(n--, 1), this._targets = s = s.concat(d(o))) : (this._siblings[n] = Z(o, this, !1), 1 === l && this._siblings[n].length > 1 && $(o, this, null, 1, this._siblings[n])) : "string" == typeof(o = s[n--] = w.selector(o)) && s.splice(n + 1, 1) : s.splice(n--, 1);
                        else this._propLookup = {}, this._siblings = Z(t, this, !1), 1 === l && this._siblings.length > 1 && $(t, this, null, 1, this._siblings);
                        (this.vars.immediateRender || 0 === i && 0 === this._delay && !1 !== this.vars.immediateRender) && (this._time = -1e-10, this.render(Math.min(0, -this._delay)))
                    }, !0),
                    I = function(t) {
                        return t && t.length && t !== e && t[0] && (t[0] === e || t[0].nodeType && t[0].style && !t.nodeType)
                    },
                    D = function(e, t) {
                        var i, r = {};
                        for (i in e) W[i] || i in t && "transform" !== i && "x" !== i && "y" !== i && "width" !== i && "height" !== i && "className" !== i && "border" !== i || !(!z[i] || z[i] && z[i]._autoCSS) || (r[i] = e[i], delete e[i]);
                        e.css = r
                    };
                a = w.prototype = new M, a.constructor = w, a.kill()._gc = !1, a.ratio = 0, a._firstPT = a._targets = a._overwrittenProps = a._startAt = null, a._notifyPluginsOfEnabled = a._lazy = !1, w.version = "1.20.1", w.defaultEase = a._ease = new b(null, null, 1, 1), w.defaultOverwrite = "auto", w.ticker = l, w.autoSleep = 120, w.lagSmoothing = function(e, t) {
                    l.lagSmoothing(e, t)
                }, w.selector = e.$ || e.jQuery || function(t) {
                    var i = e.$ || e.jQuery;
                    return i ? (w.selector = i, i(t)) : void 0 === r ? t : r.querySelectorAll ? r.querySelectorAll(t) : r.getElementById("#" === t.charAt(0) ? t.substr(1) : t)
                };
                var L = [],
                    B = {},
                    F = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,
                    N = /[\+-]=-?[\.\d]/,
                    V = function(e) {
                        for (var t, i = this._firstPT; i;) t = i.blob ? 1 === e && this.end ? this.end : e ? this.join("") : this.start : i.c * e + i.s, i.m ? t = i.m(t, this._target || i.t) : t < 1e-6 && t > -1e-6 && !i.blob && (t = 0), i.f ? i.fp ? i.t[i.p](i.fp, t) : i.t[i.p](t) : i.t[i.p] = t, i = i._next
                    },
                    k = function(e, t, i, r) {
                        var n, o, s, a, l, u, c, h = [],
                            d = 0,
                            p = "",
                            f = 0;
                        for (h.start = e, h.end = t, e = h[0] = e + "", t = h[1] = t + "", i && (i(h), e = h[0], t = h[1]), h.length = 0, n = e.match(F) || [], o = t.match(F) || [], r && (r._next = null, r.blob = 1, h._firstPT = h._applyPT = r), l = o.length, a = 0; a < l; a++) c = o[a], u = t.substr(d, t.indexOf(c, d) - d), p += u || !a ? u : ",", d += u.length, f ? f = (f + 1) % 5 : "rgba(" === u.substr(-5) && (f = 1), c === n[a] || n.length <= a ? p += c : (p && (h.push(p), p = ""), s = parseFloat(n[a]), h.push(s), h._firstPT = {
                            _next: h._firstPT,
                            t: h,
                            p: h.length - 1,
                            s: s,
                            c: ("=" === c.charAt(1) ? parseInt(c.charAt(0) + "1", 10) * parseFloat(c.substr(2)) : parseFloat(c) - s) || 0,
                            f: 0,
                            m: f && f < 4 ? Math.round : 0
                        }), d += c.length;
                        return p += t.substr(d), p && h.push(p), h.setRatio = V, N.test(t) && (h.end = 0), h
                    },
                    U = function(e, t, i, r, n, o, s, a, l) {
                        "function" == typeof r && (r = r(l || 0, e));
                        var u, c = typeof e[t],
                            h = "function" !== c ? "" : t.indexOf("set") || "function" != typeof e["get" + t.substr(3)] ? t : "get" + t.substr(3),
                            d = "get" !== i ? i : h ? s ? e[h](s) : e[h]() : e[t],
                            p = "string" == typeof r && "=" === r.charAt(1),
                            f = {
                                t: e,
                                p: t,
                                s: d,
                                f: "function" === c,
                                pg: 0,
                                n: n || t,
                                m: o ? "function" == typeof o ? o : Math.round : 0,
                                pr: 0,
                                c: p ? parseInt(r.charAt(0) + "1", 10) * parseFloat(r.substr(2)) : parseFloat(r) - d || 0
                            };
                        if (("number" != typeof d || "number" != typeof r && !p) && (s || isNaN(d) || !p && isNaN(r) || "boolean" == typeof d || "boolean" == typeof r ? (f.fp = s, u = k(d, p ? parseFloat(f.s) + f.c : r, a || w.defaultStringFilter, f), f = {
                                t: u,
                                p: "setRatio",
                                s: 0,
                                c: 1,
                                f: 2,
                                pg: 0,
                                n: n || t,
                                pr: 0,
                                m: 0
                            }) : (f.s = parseFloat(d), p || (f.c = parseFloat(r) - f.s || 0))), f.c) return (f._next = this._firstPT) && (f._next._prev = f), this._firstPT = f, f
                    },
                    G = w._internals = {
                        isArray: f,
                        isSelector: I,
                        lazyTweens: L,
                        blobDif: k
                    },
                    z = w._plugins = {},
                    j = G.tweenLookup = {},
                    H = 0,
                    W = G.reservedProps = {
                        ease: 1,
                        delay: 1,
                        overwrite: 1,
                        onComplete: 1,
                        onCompleteParams: 1,
                        onCompleteScope: 1,
                        useFrames: 1,
                        runBackwards: 1,
                        startAt: 1,
                        onUpdate: 1,
                        onUpdateParams: 1,
                        onUpdateScope: 1,
                        onStart: 1,
                        onStartParams: 1,
                        onStartScope: 1,
                        onReverseComplete: 1,
                        onReverseCompleteParams: 1,
                        onReverseCompleteScope: 1,
                        onRepeat: 1,
                        onRepeatParams: 1,
                        onRepeatScope: 1,
                        easeParams: 1,
                        yoyo: 1,
                        immediateRender: 1,
                        repeat: 1,
                        repeatDelay: 1,
                        data: 1,
                        paused: 1,
                        reversed: 1,
                        autoCSS: 1,
                        lazy: 1,
                        onOverwrite: 1,
                        callbackScope: 1,
                        stringFilter: 1,
                        id: 1,
                        yoyoEase: 1
                    },
                    X = {
                        none: 0,
                        all: 1,
                        auto: 2,
                        concurrent: 3,
                        allOnStart: 4,
                        preexisting: 5,
                        true: 1,
                        false: 0
                    },
                    Y = M._rootFramesTimeline = new O,
                    q = M._rootTimeline = new O,
                    K = 30,
                    Q = G.lazyRender = function() {
                        var e, t = L.length;
                        for (B = {}; --t > -1;)(e = L[t]) && !1 !== e._lazy && (e.render(e._lazy[0], e._lazy[1], !0), e._lazy = !1);
                        L.length = 0
                    };
                q._startTime = l.time, Y._startTime = l.frame, q._active = Y._active = !0, setTimeout(Q, 1), M._updateRoot = w.render = function() {
                    var e, t, i;
                    if (L.length && Q(), q.render((l.time - q._startTime) * q._timeScale, !1, !1), Y.render((l.frame - Y._startTime) * Y._timeScale, !1, !1), L.length && Q(), l.frame >= K) {
                        K = l.frame + (parseInt(w.autoSleep, 10) || 120);
                        for (i in j) {
                            for (t = j[i].tweens, e = t.length; --e > -1;) t[e]._gc && t.splice(e, 1);
                            0 === t.length && delete j[i]
                        }
                        if ((!(i = q._first) || i._paused) && w.autoSleep && !Y._first && 1 === l._listeners.tick.length) {
                            for (; i && i._paused;) i = i._next;
                            i || l.sleep()
                        }
                    }
                }, l.addEventListener("tick", M._updateRoot);
                var Z = function(e, t, i) {
                        var r, n, o = e._gsTweenID;
                        if (j[o || (e._gsTweenID = o = "t" + H++)] || (j[o] = {
                                target: e,
                                tweens: []
                            }), t && (r = j[o].tweens, r[n = r.length] = t, i))
                            for (; --n > -1;) r[n] === t && r.splice(n, 1);
                        return j[o].tweens
                    },
                    J = function(e, t, i, r) {
                        var n, o, s = e.vars.onOverwrite;
                        return s && (n = s(e, t, i, r)), s = w.onOverwrite, s && (o = s(e, t, i, r)), !1 !== n && !1 !== o
                    },
                    $ = function(e, t, i, r, n) {
                        var o, s, a, l;
                        if (1 === r || r >= 4) {
                            for (l = n.length, o = 0; o < l; o++)
                                if ((a = n[o]) !== t) a._gc || a._kill(null, e, t) && (s = !0);
                                else if (5 === r) break;
                            return s
                        }
                        var u, c = t._startTime + 1e-10,
                            h = [],
                            d = 0,
                            p = 0 === t._duration;
                        for (o = n.length; --o > -1;)(a = n[o]) === t || a._gc || a._paused || (a._timeline !== t._timeline ? (u = u || ee(t, 0, p), 0 === ee(a, u, p) && (h[d++] = a)) : a._startTime <= c && a._startTime + a.totalDuration() / a._timeScale > c && ((p || !a._initted) && c - a._startTime <= 2e-10 || (h[d++] = a)));
                        for (o = d; --o > -1;)
                            if (a = h[o], 2 === r && a._kill(i, e, t) && (s = !0), 2 !== r || !a._firstPT && a._initted) {
                                if (2 !== r && !J(a, t)) continue;
                                a._enabled(!1, !1) && (s = !0)
                            }
                        return s
                    },
                    ee = function(e, t, i) {
                        for (var r = e._timeline, n = r._timeScale, o = e._startTime; r._timeline;) {
                            if (o += r._startTime, n *= r._timeScale, r._paused) return -100;
                            r = r._timeline
                        }
                        return o /= n, o > t ? o - t : i && o === t || !e._initted && o - t < 2e-10 ? 1e-10 : (o += e.totalDuration() / e._timeScale / n) > t + 1e-10 ? 0 : o - t - 1e-10
                    };
                a._init = function() {
                    var e, t, i, r, n, o, s = this.vars,
                        a = this._overwrittenProps,
                        l = this._duration,
                        u = !!s.immediateRender,
                        c = s.ease;
                    if (s.startAt) {
                        this._startAt && (this._startAt.render(-1, !0), this._startAt.kill()), n = {};
                        for (r in s.startAt) n[r] = s.startAt[r];
                        if (n.overwrite = !1, n.immediateRender = !0, n.lazy = u && !1 !== s.lazy, n.startAt = n.delay = null, n.onUpdate = s.onUpdate, n.onUpdateScope = s.onUpdateScope || s.callbackScope || this, this._startAt = w.to(this.target, 0, n), u)
                            if (this._time > 0) this._startAt = null;
                            else if (0 !== l) return
                    } else if (s.runBackwards && 0 !== l)
                        if (this._startAt) this._startAt.render(-1, !0), this._startAt.kill(), this._startAt = null;
                        else {
                            0 !== this._time && (u = !1), i = {};
                            for (r in s) W[r] && "autoCSS" !== r || (i[r] = s[r]);
                            if (i.overwrite = 0, i.data = "isFromStart", i.lazy = u && !1 !== s.lazy, i.immediateRender = u, this._startAt = w.to(this.target, 0, i), u) {
                                if (0 === this._time) return
                            } else this._startAt._init(), this._startAt._enabled(!1), this.vars.immediateRender && (this._startAt = null)
                        }
                    if (this._ease = c = c ? c instanceof b ? c : "function" == typeof c ? new b(c, s.easeParams) : x[c] || w.defaultEase : w.defaultEase, s.easeParams instanceof Array && c.config && (this._ease = c.config.apply(c, s.easeParams)), this._easeType = this._ease._type, this._easePower = this._ease._power, this._firstPT = null, this._targets)
                        for (o = this._targets.length, e = 0; e < o; e++) this._initProps(this._targets[e], this._propLookup[e] = {}, this._siblings[e], a ? a[e] : null, e) && (t = !0);
                    else t = this._initProps(this.target, this._propLookup, this._siblings, a, 0);
                    if (t && w._onPluginEvent("_onInitAllProps", this), a && (this._firstPT || "function" != typeof this.target && this._enabled(!1, !1)), s.runBackwards)
                        for (i = this._firstPT; i;) i.s += i.c, i.c = -i.c, i = i._next;
                    this._onUpdate = s.onUpdate, this._initted = !0
                }, a._initProps = function(t, i, r, n, o) {
                    var s, a, l, u, c, h;
                    if (null == t) return !1;
                    B[t._gsTweenID] && Q(), this.vars.css || t.style && t !== e && t.nodeType && z.css && !1 !== this.vars.autoCSS && D(this.vars, t);
                    for (s in this.vars)
                        if (h = this.vars[s], W[s]) h && (h instanceof Array || h.push && f(h)) && -1 !== h.join("").indexOf("{self}") && (this.vars[s] = h = this._swapSelfInParams(h, this));
                        else if (z[s] && (u = new z[s])._onInitTween(t, this.vars[s], this, o)) {
                        for (this._firstPT = c = {
                                _next: this._firstPT,
                                t: u,
                                p: "setRatio",
                                s: 0,
                                c: 1,
                                f: 1,
                                n: s,
                                pg: 1,
                                pr: u._priority,
                                m: 0
                            }, a = u._overwriteProps.length; --a > -1;) i[u._overwriteProps[a]] = this._firstPT;
                        (u._priority || u._onInitAllProps) && (l = !0), (u._onDisable || u._onEnable) && (this._notifyPluginsOfEnabled = !0), c._next && (c._next._prev = c)
                    } else i[s] = U.call(this, t, s, "get", h, s, 0, null, this.vars.stringFilter, o);
                    return n && this._kill(n, t) ? this._initProps(t, i, r, n, o) : this._overwrite > 1 && this._firstPT && r.length > 1 && $(t, this, i, this._overwrite, r) ? (this._kill(i, t), this._initProps(t, i, r, n, o)) : (this._firstPT && (!1 !== this.vars.lazy && this._duration || this.vars.lazy && !this._duration) && (B[t._gsTweenID] = !0), l)
                }, a.render = function(e, t, i) {
                    var r, n, o, s, a = this._time,
                        l = this._duration,
                        u = this._rawPrevTime;
                    if (e >= l - 1e-7 && e >= 0) this._totalTime = this._time = l, this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1, this._reversed || (r = !0, n = "onComplete", i = i || this._timeline.autoRemoveChildren), 0 === l && (this._initted || !this.vars.lazy || i) && (this._startTime === this._timeline._duration && (e = 0), (u < 0 || e <= 0 && e >= -1e-7 || 1e-10 === u && "isPause" !== this.data) && u !== e && (i = !0, u > 1e-10 && (n = "onReverseComplete")), this._rawPrevTime = s = !t || e || u === e ? e : 1e-10);
                    else if (e < 1e-7) this._totalTime = this._time = 0, this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0, (0 !== a || 0 === l && u > 0) && (n = "onReverseComplete", r = this._reversed), e < 0 && (this._active = !1, 0 === l && (this._initted || !this.vars.lazy || i) && (u >= 0 && (1e-10 !== u || "isPause" !== this.data) && (i = !0), this._rawPrevTime = s = !t || e || u === e ? e : 1e-10)), (!this._initted || this._startAt && this._startAt.progress()) && (i = !0);
                    else if (this._totalTime = this._time = e, this._easeType) {
                        var c = e / l,
                            h = this._easeType,
                            d = this._easePower;
                        (1 === h || 3 === h && c >= .5) && (c = 1 - c), 3 === h && (c *= 2), 1 === d ? c *= c : 2 === d ? c *= c * c : 3 === d ? c *= c * c * c : 4 === d && (c *= c * c * c * c), this.ratio = 1 === h ? 1 - c : 2 === h ? c : e / l < .5 ? c / 2 : 1 - c / 2
                    } else this.ratio = this._ease.getRatio(e / l);
                    if (this._time !== a || i) {
                        if (!this._initted) {
                            if (this._init(), !this._initted || this._gc) return;
                            if (!i && this._firstPT && (!1 !== this.vars.lazy && this._duration || this.vars.lazy && !this._duration)) return this._time = this._totalTime = a, this._rawPrevTime = u, L.push(this), void(this._lazy = [e, t]);
                            this._time && !r ? this.ratio = this._ease.getRatio(this._time / l) : r && this._ease._calcEnd && (this.ratio = this._ease.getRatio(0 === this._time ? 0 : 1))
                        }
                        for (!1 !== this._lazy && (this._lazy = !1), this._active || !this._paused && this._time !== a && e >= 0 && (this._active = !0), 0 === a && (this._startAt && (e >= 0 ? this._startAt.render(e, t, i) : n || (n = "_dummyGS")), this.vars.onStart && (0 === this._time && 0 !== l || t || this._callback("onStart"))), o = this._firstPT; o;) o.f ? o.t[o.p](o.c * this.ratio + o.s) : o.t[o.p] = o.c * this.ratio + o.s, o = o._next;
                        this._onUpdate && (e < 0 && this._startAt && -1e-4 !== e && this._startAt.render(e, t, i), t || (this._time !== a || r || i) && this._callback("onUpdate")), n && (this._gc && !i || (e < 0 && this._startAt && !this._onUpdate && -1e-4 !== e && this._startAt.render(e, t, i), r && (this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[n] && this._callback(n), 0 === l && 1e-10 === this._rawPrevTime && 1e-10 !== s && (this._rawPrevTime = 0)))
                    }
                }, a._kill = function(e, t, i) {
                    if ("all" === e && (e = null), null == e && (null == t || t === this.target)) return this._lazy = !1, this._enabled(!1, !1);
                    t = "string" != typeof t ? t || this._targets || this.target : w.selector(t) || t;
                    var r, n, o, s, a, l, u, c, h, d = i && this._time && i._startTime === this._startTime && this._timeline === i._timeline;
                    if ((f(t) || I(t)) && "number" != typeof t[0])
                        for (r = t.length; --r > -1;) this._kill(e, t[r], i) && (l = !0);
                    else {
                        if (this._targets) {
                            for (r = this._targets.length; --r > -1;)
                                if (t === this._targets[r]) {
                                    a = this._propLookup[r] || {}, this._overwrittenProps = this._overwrittenProps || [], n = this._overwrittenProps[r] = e ? this._overwrittenProps[r] || {} : "all";
                                    break
                                }
                        } else {
                            if (t !== this.target) return !1;
                            a = this._propLookup, n = this._overwrittenProps = e ? this._overwrittenProps || {} : "all"
                        }
                        if (a) {
                            if (u = e || a, c = e !== n && "all" !== n && e !== a && ("object" != typeof e || !e._tempKill), i && (w.onOverwrite || this.vars.onOverwrite)) {
                                for (o in u) a[o] && (h || (h = []), h.push(o));
                                if ((h || !e) && !J(this, i, t, h)) return !1
                            }
                            for (o in u)(s = a[o]) && (d && (s.f ? s.t[s.p](s.s) : s.t[s.p] = s.s, l = !0), s.pg && s.t._kill(u) && (l = !0), s.pg && 0 !== s.t._overwriteProps.length || (s._prev ? s._prev._next = s._next : s === this._firstPT && (this._firstPT = s._next), s._next && (s._next._prev = s._prev), s._next = s._prev = null), delete a[o]), c && (n[o] = 1);
                            !this._firstPT && this._initted && this._enabled(!1, !1)
                        }
                    }
                    return l
                }, a.invalidate = function() {
                    return this._notifyPluginsOfEnabled && w._onPluginEvent("_onDisable", this), this._firstPT = this._overwrittenProps = this._startAt = this._onUpdate = null, this._notifyPluginsOfEnabled = this._active = this._lazy = !1, this._propLookup = this._targets ? {} : [], M.prototype.invalidate.call(this), this.vars.immediateRender && (this._time = -1e-10, this.render(Math.min(0, -this._delay))), this
                }, a._enabled = function(e, t) {
                    if (u || l.wake(), e && this._gc) {
                        var i, r = this._targets;
                        if (r)
                            for (i = r.length; --i > -1;) this._siblings[i] = Z(r[i], this, !0);
                        else this._siblings = Z(this.target, this, !0)
                    }
                    return M.prototype._enabled.call(this, e, t), !(!this._notifyPluginsOfEnabled || !this._firstPT) && w._onPluginEvent(e ? "_onEnable" : "_onDisable", this)
                }, w.to = function(e, t, i) {
                    return new w(e, t, i)
                }, w.from = function(e, t, i) {
                    return i.runBackwards = !0, i.immediateRender = 0 != i.immediateRender, new w(e, t, i)
                }, w.fromTo = function(e, t, i, r) {
                    return r.startAt = i, r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender, new w(e, t, r)
                }, w.delayedCall = function(e, t, i, r, n) {
                    return new w(t, 0, {
                        delay: e,
                        onComplete: t,
                        onCompleteParams: i,
                        callbackScope: r,
                        onReverseComplete: t,
                        onReverseCompleteParams: i,
                        immediateRender: !1,
                        lazy: !1,
                        useFrames: n,
                        overwrite: 0
                    })
                }, w.set = function(e, t) {
                    return new w(e, 0, t)
                }, w.getTweensOf = function(e, t) {
                    if (null == e) return [];
                    e = "string" != typeof e ? e : w.selector(e) || e;
                    var i, r, n, o;
                    if ((f(e) || I(e)) && "number" != typeof e[0]) {
                        for (i = e.length, r = []; --i > -1;) r = r.concat(w.getTweensOf(e[i], t));
                        for (i = r.length; --i > -1;)
                            for (o = r[i], n = i; --n > -1;) o === r[n] && r.splice(i, 1)
                    } else if (e._gsTweenID)
                        for (r = Z(e).concat(), i = r.length; --i > -1;)(r[i]._gc || t && !r[i].isActive()) && r.splice(i, 1);
                    return r || []
                }, w.killTweensOf = w.killDelayedCallsTo = function(e, t, i) {
                    "object" == typeof t && (i = t, t = !1);
                    for (var r = w.getTweensOf(e, t), n = r.length; --n > -1;) r[n]._kill(i, e)
                };
                var te = v("plugins.TweenPlugin", function(e, t) {
                    this._overwriteProps = (e || "").split(","), this._propName = this._overwriteProps[0], this._priority = t || 0, this._super = te.prototype
                }, !0);
                if (a = te.prototype, te.version = "1.19.0", te.API = 2, a._firstPT = null, a._addTween = U, a.setRatio = V, a._kill = function(e) {
                        var t, i = this._overwriteProps,
                            r = this._firstPT;
                        if (null != e[this._propName]) this._overwriteProps = [];
                        else
                            for (t = i.length; --t > -1;) null != e[i[t]] && i.splice(t, 1);
                        for (; r;) null != e[r.n] && (r._next && (r._next._prev = r._prev), r._prev ? (r._prev._next = r._next, r._prev = null) : this._firstPT === r && (this._firstPT = r._next)), r = r._next;
                        return !1
                    }, a._mod = a._roundProps = function(e) {
                        for (var t, i = this._firstPT; i;) t = e[this._propName] || null != i.n && e[i.n.split(this._propName + "_").join("")], t && "function" == typeof t && (2 === i.f ? i.t._applyPT.m = t : i.m = t), i = i._next
                    }, w._onPluginEvent = function(e, t) {
                        var i, r, n, o, s, a = t._firstPT;
                        if ("_onInitAllProps" === e) {
                            for (; a;) {
                                for (s = a._next, r = n; r && r.pr > a.pr;) r = r._next;
                                (a._prev = r ? r._prev : o) ? a._prev._next = a: n = a, (a._next = r) ? r._prev = a : o = a, a = s
                            }
                            a = t._firstPT = n
                        }
                        for (; a;) a.pg && "function" == typeof a.t[e] && a.t[e]() && (i = !0), a = a._next;
                        return i
                    }, te.activate = function(e) {
                        for (var t = e.length; --t > -1;) e[t].API === te.API && (z[(new e[t])._propName] = e[t]);
                        return !0
                    }, g.plugin = function(e) {
                        if (!(e && e.propName && e.init && e.API)) throw "illegal plugin definition.";
                        var t, i = e.propName,
                            r = e.priority || 0,
                            n = e.overwriteProps,
                            o = {
                                init: "_onInitTween",
                                set: "setRatio",
                                kill: "_kill",
                                round: "_mod",
                                mod: "_mod",
                                initAll: "_onInitAllProps"
                            },
                            s = v("plugins." + i.charAt(0).toUpperCase() + i.substr(1) + "Plugin", function() {
                                te.call(this, i, r), this._overwriteProps = n || []
                            }, !0 === e.global),
                            a = s.prototype = new te(i);
                        a.constructor = s, s.API = e.API;
                        for (t in o) "function" == typeof e[t] && (a[o[t]] = e[t]);
                        return s.version = e.version, te.activate([s]), s
                    }, o = e._gsQueue) {
                    for (s = 0; s < o.length; s++) o[s]();
                    for (a in _) _[a].func || e.console.log("GSAP encountered missing dependency: " + a)
                }
                u = !1
            }
        }("undefined" != typeof module && module.exports && "undefined" != typeof global ? global : this || window), define("com/gsap/TweenLite", function(e) {
            return function() {
                return e.TweenLite
            }
        }(this));
    var e = "undefined" != typeof module && module.exports && "undefined" != typeof global ? global : this || window;
    (e._gsQueue || (e._gsQueue = [])).push(function() {
            "use strict";
            e._gsDefine("TimelineLite", ["core.Animation", "core.SimpleTimeline", "TweenLite"], function(t, i, r) {
                var n = function(e) {
                        i.call(this, e), this._labels = {}, this.autoRemoveChildren = !0 === this.vars.autoRemoveChildren, this.smoothChildTiming = !0 === this.vars.smoothChildTiming, this._sortChildren = !0, this._onUpdate = this.vars.onUpdate;
                        var t, r, n = this.vars;
                        for (r in n) t = n[r], l(t) && -1 !== t.join("").indexOf("{self}") && (n[r] = this._swapSelfInParams(t));
                        l(n.tweens) && this.add(n.tweens, 0, n.align, n.stagger)
                    },
                    o = r._internals,
                    s = n._internals = {},
                    a = o.isSelector,
                    l = o.isArray,
                    u = o.lazyTweens,
                    c = o.lazyRender,
                    h = e._gsDefine.globals,
                    d = function(e) {
                        var t, i = {};
                        for (t in e) i[t] = e[t];
                        return i
                    },
                    p = function(e, t, i) {
                        var r, n, o = e.cycle;
                        for (r in o) n = o[r], e[r] = "function" == typeof n ? n(i, t[i]) : n[i % n.length];
                        delete e.cycle
                    },
                    f = s.pauseCallback = function() {},
                    _ = function(e) {
                        var t, i = [],
                            r = e.length;
                        for (t = 0; t !== r; i.push(e[t++]));
                        return i
                    },
                    m = n.prototype = new i;
                return n.version = "1.20.1", m.constructor = n, m.kill()._gc = m._forcingPlayhead = m._hasPause = !1, m.to = function(e, t, i, n) {
                    var o = i.repeat && h.TweenMax || r;
                    return t ? this.add(new o(e, t, i), n) : this.set(e, i, n)
                }, m.from = function(e, t, i, n) {
                    return this.add((i.repeat && h.TweenMax || r).from(e, t, i), n)
                }, m.fromTo = function(e, t, i, n, o) {
                    var s = n.repeat && h.TweenMax || r;
                    return t ? this.add(s.fromTo(e, t, i, n), o) : this.set(e, n, o)
                }, m.staggerTo = function(e, t, i, o, s, l, u, c) {
                    var h, f, m = new n({
                            onComplete: l,
                            onCompleteParams: u,
                            callbackScope: c,
                            smoothChildTiming: this.smoothChildTiming
                        }),
                        g = i.cycle;
                    for ("string" == typeof e && (e = r.selector(e) || e), e = e || [], a(e) && (e = _(e)), o = o || 0, o < 0 && (e = _(e), e.reverse(), o *= -1), f = 0; f < e.length; f++) h = d(i), h.startAt && (h.startAt = d(h.startAt), h.startAt.cycle && p(h.startAt, e, f)), g && (p(h, e, f), null != h.duration && (t = h.duration, delete h.duration)), m.to(e[f], t, h, f * o);
                    return this.add(m, s)
                }, m.staggerFrom = function(e, t, i, r, n, o, s, a) {
                    return i.immediateRender = 0 != i.immediateRender, i.runBackwards = !0, this.staggerTo(e, t, i, r, n, o, s, a)
                }, m.staggerFromTo = function(e, t, i, r, n, o, s, a, l) {
                    return r.startAt = i, r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender, this.staggerTo(e, t, r, n, o, s, a, l)
                }, m.call = function(e, t, i, n) {
                    return this.add(r.delayedCall(0, e, t, i), n)
                }, m.set = function(e, t, i) {
                    return i = this._parseTimeOrLabel(i, 0, !0), null == t.immediateRender && (t.immediateRender = i === this._time && !this._paused), this.add(new r(e, 0, t), i)
                }, n.exportRoot = function(e, t) {
                    e = e || {}, null == e.smoothChildTiming && (e.smoothChildTiming = !0);
                    var i, o, s = new n(e),
                        a = s._timeline;
                    for (null == t && (t = !0), a._remove(s, !0), s._startTime = 0, s._rawPrevTime = s._time = s._totalTime = a._time, i = a._first; i;) o = i._next, t && i instanceof r && i.target === i.vars.onComplete || s.add(i, i._startTime - i._delay), i = o;
                    return a.add(s, 0), s
                }, m.add = function(e, o, s, a) {
                    var u, c, h, d, p, f;
                    if ("number" != typeof o && (o = this._parseTimeOrLabel(o, 0, !0, e)), !(e instanceof t)) {
                        if (e instanceof Array || e && e.push && l(e)) {
                            for (s = s || "normal", a = a || 0, u = o, c = e.length, h = 0; h < c; h++) l(d = e[h]) && (d = new n({
                                tweens: d
                            })), this.add(d, u), "string" != typeof d && "function" != typeof d && ("sequence" === s ? u = d._startTime + d.totalDuration() / d._timeScale : "start" === s && (d._startTime -= d.delay())), u += a;
                            return this._uncache(!0)
                        }
                        if ("string" == typeof e) return this.addLabel(e, o);
                        if ("function" != typeof e) throw "Cannot add " + e + " into the timeline; it is not a tween, timeline, function, or string.";
                        e = r.delayedCall(0, e)
                    }
                    if (i.prototype.add.call(this, e, o), e._time && e.render((this.rawTime() - e._startTime) * e._timeScale, !1, !1), (this._gc || this._time === this._duration) && !this._paused && this._duration < this.duration())
                        for (p = this, f = p.rawTime() > e._startTime; p._timeline;) f && p._timeline.smoothChildTiming ? p.totalTime(p._totalTime, !0) : p._gc && p._enabled(!0, !1), p = p._timeline;
                    return this
                }, m.remove = function(e) {
                    if (e instanceof t) {
                        this._remove(e, !1);
                        var i = e._timeline = e.vars.useFrames ? t._rootFramesTimeline : t._rootTimeline;
                        return e._startTime = (e._paused ? e._pauseTime : i._time) - (e._reversed ? e.totalDuration() - e._totalTime : e._totalTime) / e._timeScale, this
                    }
                    if (e instanceof Array || e && e.push && l(e)) {
                        for (var r = e.length; --r > -1;) this.remove(e[r]);
                        return this
                    }
                    return "string" == typeof e ? this.removeLabel(e) : this.kill(null, e)
                }, m._remove = function(e, t) {
                    return i.prototype._remove.call(this, e, t), this._last ? this._time > this.duration() && (this._time = this._duration, this._totalTime = this._totalDuration) : this._time = this._totalTime = this._duration = this._totalDuration = 0, this
                }, m.append = function(e, t) {
                    return this.add(e, this._parseTimeOrLabel(null, t, !0, e))
                }, m.insert = m.insertMultiple = function(e, t, i, r) {
                    return this.add(e, t || 0, i, r)
                }, m.appendMultiple = function(e, t, i, r) {
                    return this.add(e, this._parseTimeOrLabel(null, t, !0, e), i, r)
                }, m.addLabel = function(e, t) {
                    return this._labels[e] = this._parseTimeOrLabel(t), this
                }, m.addPause = function(e, t, i, n) {
                    var o = r.delayedCall(0, f, i, n || this);
                    return o.vars.onComplete = o.vars.onReverseComplete = t, o.data = "isPause", this._hasPause = !0, this.add(o, e)
                }, m.removeLabel = function(e) {
                    return delete this._labels[e], this
                }, m.getLabelTime = function(e) {
                    return null != this._labels[e] ? this._labels[e] : -1
                }, m._parseTimeOrLabel = function(e, i, r, n) {
                    var o, s;
                    if (n instanceof t && n.timeline === this) this.remove(n);
                    else if (n && (n instanceof Array || n.push && l(n)))
                        for (s = n.length; --s > -1;) n[s] instanceof t && n[s].timeline === this && this.remove(n[s]);
                    if (o = this.duration() > 99999999999 ? this.recent().endTime(!1) : this._duration, "string" == typeof i) return this._parseTimeOrLabel(i, r && "number" == typeof e && null == this._labels[i] ? e - o : 0, r);
                    if (i = i || 0, "string" != typeof e || !isNaN(e) && null == this._labels[e]) null == e && (e = o);
                    else {
                        if (-1 === (s = e.indexOf("="))) return null == this._labels[e] ? r ? this._labels[e] = o + i : i : this._labels[e] + i;
                        i = parseInt(e.charAt(s - 1) + "1", 10) * Number(e.substr(s + 1)), e = s > 1 ? this._parseTimeOrLabel(e.substr(0, s - 1), 0, r) : o
                    }
                    return Number(e) + i
                }, m.seek = function(e, t) {
                    return this.totalTime("number" == typeof e ? e : this._parseTimeOrLabel(e), !1 !== t)
                }, m.stop = function() {
                    return this.paused(!0)
                }, m.gotoAndPlay = function(e, t) {
                    return this.play(e, t)
                }, m.gotoAndStop = function(e, t) {
                    return this.pause(e, t)
                }, m.render = function(e, t, i) {
                    this._gc && this._enabled(!0, !1);
                    var r, n, o, s, a, l, h, d = this._dirty ? this.totalDuration() : this._totalDuration,
                        p = this._time,
                        f = this._startTime,
                        _ = this._timeScale,
                        m = this._paused;
                    if (e >= d - 1e-7 && e >= 0) this._totalTime = this._time = d, this._reversed || this._hasPausedChild() || (n = !0, s = "onComplete", a = !!this._timeline.autoRemoveChildren, 0 === this._duration && (e <= 0 && e >= -1e-7 || this._rawPrevTime < 0 || 1e-10 === this._rawPrevTime) && this._rawPrevTime !== e && this._first && (a = !0, this._rawPrevTime > 1e-10 && (s = "onReverseComplete"))), this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : 1e-10, e = d + 1e-4;
                    else if (e < 1e-7)
                        if (this._totalTime = this._time = 0, (0 !== p || 0 === this._duration && 1e-10 !== this._rawPrevTime && (this._rawPrevTime > 0 || e < 0 && this._rawPrevTime >= 0)) && (s = "onReverseComplete", n = this._reversed), e < 0) this._active = !1, this._timeline.autoRemoveChildren && this._reversed ? (a = n = !0, s = "onReverseComplete") : this._rawPrevTime >= 0 && this._first && (a = !0), this._rawPrevTime = e;
                        else {
                            if (this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : 1e-10, 0 === e && n)
                                for (r = this._first; r && 0 === r._startTime;) r._duration || (n = !1), r = r._next;
                            e = 0, this._initted || (a = !0)
                        }
                    else {
                        if (this._hasPause && !this._forcingPlayhead && !t) {
                            if (e >= p)
                                for (r = this._first; r && r._startTime <= e && !l;) r._duration || "isPause" !== r.data || r.ratio || 0 === r._startTime && 0 === this._rawPrevTime || (l = r), r = r._next;
                            else
                                for (r = this._last; r && r._startTime >= e && !l;) r._duration || "isPause" === r.data && r._rawPrevTime > 0 && (l = r), r = r._prev;
                            l && (this._time = e = l._startTime, this._totalTime = e + this._cycle * (this._totalDuration + this._repeatDelay))
                        }
                        this._totalTime = this._time = this._rawPrevTime = e
                    }
                    if (this._time !== p && this._first || i || a || l) {
                        if (this._initted || (this._initted = !0), this._active || !this._paused && this._time !== p && e > 0 && (this._active = !0), 0 === p && this.vars.onStart && (0 === this._time && this._duration || t || this._callback("onStart")), (h = this._time) >= p)
                            for (r = this._first; r && (o = r._next, h === this._time && (!this._paused || m));)(r._active || r._startTime <= h && !r._paused && !r._gc) && (l === r && this.pause(), r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, i) : r.render((e - r._startTime) * r._timeScale, t, i)), r = o;
                        else
                            for (r = this._last; r && (o = r._prev, h === this._time && (!this._paused || m));) {
                                if (r._active || r._startTime <= p && !r._paused && !r._gc) {
                                    if (l === r) {
                                        for (l = r._prev; l && l.endTime() > this._time;) l.render(l._reversed ? l.totalDuration() - (e - l._startTime) * l._timeScale : (e - l._startTime) * l._timeScale, t, i), l = l._prev;
                                        l = null, this.pause()
                                    }
                                    r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, i) : r.render((e - r._startTime) * r._timeScale, t, i)
                                }
                                r = o
                            }
                        this._onUpdate && (t || (u.length && c(), this._callback("onUpdate"))), s && (this._gc || f !== this._startTime && _ === this._timeScale || (0 === this._time || d >= this.totalDuration()) && (n && (u.length && c(), this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[s] && this._callback(s)))
                    }
                }, m._hasPausedChild = function() {
                    for (var e = this._first; e;) {
                        if (e._paused || e instanceof n && e._hasPausedChild()) return !0;
                        e = e._next
                    }
                    return !1
                }, m.getChildren = function(e, t, i, n) {
                    n = n || -9999999999;
                    for (var o = [], s = this._first, a = 0; s;) s._startTime < n || (s instanceof r ? !1 !== t && (o[a++] = s) : (!1 !== i && (o[a++] = s), !1 !== e && (o = o.concat(s.getChildren(!0, t, i)), a = o.length))), s = s._next;
                    return o
                }, m.getTweensOf = function(e, t) {
                    var i, n, o = this._gc,
                        s = [],
                        a = 0;
                    for (o && this._enabled(!0, !0), i = r.getTweensOf(e), n = i.length; --n > -1;)(i[n].timeline === this || t && this._contains(i[n])) && (s[a++] = i[n]);
                    return o && this._enabled(!1, !0), s
                }, m.recent = function() {
                    return this._recent
                }, m._contains = function(e) {
                    for (var t = e.timeline; t;) {
                        if (t === this) return !0;
                        t = t.timeline
                    }
                    return !1
                }, m.shiftChildren = function(e, t, i) {
                    i = i || 0;
                    for (var r, n = this._first, o = this._labels; n;) n._startTime >= i && (n._startTime += e), n = n._next;
                    if (t)
                        for (r in o) o[r] >= i && (o[r] += e);
                    return this._uncache(!0)
                }, m._kill = function(e, t) {
                    if (!e && !t) return this._enabled(!1, !1);
                    for (var i = t ? this.getTweensOf(t) : this.getChildren(!0, !0, !1), r = i.length, n = !1; --r > -1;) i[r]._kill(e, t) && (n = !0);
                    return n
                }, m.clear = function(e) {
                    var t = this.getChildren(!1, !0, !0),
                        i = t.length;
                    for (this._time = this._totalTime = 0; --i > -1;) t[i]._enabled(!1, !1);
                    return !1 !== e && (this._labels = {}), this._uncache(!0)
                }, m.invalidate = function() {
                    for (var e = this._first; e;) e.invalidate(), e = e._next;
                    return t.prototype.invalidate.call(this)
                }, m._enabled = function(e, t) {
                    if (e === this._gc)
                        for (var r = this._first; r;) r._enabled(e, !0), r = r._next;
                    return i.prototype._enabled.call(this, e, t)
                }, m.totalTime = function(e, i, r) {
                    this._forcingPlayhead = !0;
                    var n = t.prototype.totalTime.apply(this, arguments);
                    return this._forcingPlayhead = !1, n
                }, m.duration = function(e) {
                    return arguments.length ? (0 !== this.duration() && 0 !== e && this.timeScale(this._duration / e), this) : (this._dirty && this.totalDuration(), this._duration)
                }, m.totalDuration = function(e) {
                    if (!arguments.length) {
                        if (this._dirty) {
                            for (var t, i, r = 0, n = this._last, o = 999999999999; n;) t = n._prev, n._dirty && n.totalDuration(), n._startTime > o && this._sortChildren && !n._paused ? this.add(n, n._startTime - n._delay) : o = n._startTime, n._startTime < 0 && !n._paused && (r -= n._startTime, this._timeline.smoothChildTiming && (this._startTime += n._startTime / this._timeScale), this.shiftChildren(-n._startTime, !1, -9999999999), o = 0), i = n._startTime + n._totalDuration / n._timeScale, i > r && (r = i), n = t;
                            this._duration = this._totalDuration = r, this._dirty = !1
                        }
                        return this._totalDuration
                    }
                    return e && this.totalDuration() ? this.timeScale(this._totalDuration / e) : this
                }, m.paused = function(e) {
                    if (!e)
                        for (var i = this._first, r = this._time; i;) i._startTime === r && "isPause" === i.data && (i._rawPrevTime = 0), i = i._next;
                    return t.prototype.paused.apply(this, arguments)
                }, m.usesFrames = function() {
                    for (var e = this._timeline; e._timeline;) e = e._timeline;
                    return e === t._rootFramesTimeline
                }, m.rawTime = function(e) {
                    return e && (this._paused || this._repeat && this.time() > 0 && this.totalProgress() < 1) ? this._totalTime % (this._duration + this._repeatDelay) : this._paused ? this._totalTime : (this._timeline.rawTime(e) - this._startTime) * this._timeScale
                }, n
            }, !0)
        }), e._gsDefine && e._gsQueue.pop()(),
        function(t) {
            "use strict";
            var i = function() {
                return (e.GreenSockGlobals || e).TimelineLite
            };
            "undefined" != typeof module && module.exports ? (require("./TweenLite.js"), module.exports = i()) : "function" == typeof define && define.amd && define("com/gsap/TimelineLite", ["TweenLite"], i)
        }();
    var e = "undefined" != typeof module && module.exports && "undefined" != typeof global ? global : this || window;
    (e._gsQueue || (e._gsQueue = [])).push(function() {
            "use strict";
            var t, i, r, n = /(\d|\.)+/g,
                o = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,
                s = {
                    aqua: [0, 255, 255],
                    lime: [0, 255, 0],
                    silver: [192, 192, 192],
                    black: [0, 0, 0],
                    maroon: [128, 0, 0],
                    teal: [0, 128, 128],
                    blue: [0, 0, 255],
                    navy: [0, 0, 128],
                    white: [255, 255, 255],
                    fuchsia: [255, 0, 255],
                    olive: [128, 128, 0],
                    yellow: [255, 255, 0],
                    orange: [255, 165, 0],
                    gray: [128, 128, 128],
                    purple: [128, 0, 128],
                    green: [0, 128, 0],
                    red: [255, 0, 0],
                    pink: [255, 192, 203],
                    cyan: [0, 255, 255],
                    transparent: [255, 255, 255, 0]
                },
                a = function(e, t, i) {
                    return e = e < 0 ? e + 1 : e > 1 ? e - 1 : e, 255 * (6 * e < 1 ? t + (i - t) * e * 6 : e < .5 ? i : 3 * e < 2 ? t + (i - t) * (2 / 3 - e) * 6 : t) + .5 | 0
                },
                l = function(e, t) {
                    var i, r, l, u, c, h, d, p, f, _, m, g = "hsl" === t;
                    if (e)
                        if ("number" == typeof e) i = [e >> 16, e >> 8 & 255, 255 & e];
                        else {
                            if ("," === e.charAt(e.length - 1) && (e = e.substr(0, e.length - 1)), s[e]) i = s[e];
                            else if ("#" === e.charAt(0)) 4 === e.length && (r = e.charAt(1), l = e.charAt(2), u = e.charAt(3), e = "#" + r + r + l + l + u + u), e = parseInt(e.substr(1), 16), i = [e >> 16, e >> 8 & 255, 255 & e];
                            else if ("hsl" === e.substr(0, 3))
                                if (i = m = e.match(n), g) {
                                    if (-1 !== e.indexOf("=")) return e.match(o)
                                } else c = Number(i[0]) % 360 / 360, h = Number(i[1]) / 100, d = Number(i[2]) / 100, l = d <= .5 ? d * (h + 1) : d + h - d * h, r = 2 * d - l, i.length > 3 && (i[3] = Number(e[3])), i[0] = a(c + 1 / 3, r, l), i[1] = a(c, r, l), i[2] = a(c - 1 / 3, r, l);
                            else i = e.match(n) || s.transparent;
                            i[0] = Number(i[0]), i[1] = Number(i[1]), i[2] = Number(i[2]), i.length > 3 && (i[3] = Number(i[3]))
                        }
                    else i = s.black;
                    return g && !m && (r = i[0] / 255, l = i[1] / 255, u = i[2] / 255, p = Math.max(r, l, u), f = Math.min(r, l, u), d = (p + f) / 2, p === f ? c = h = 0 : (_ = p - f, h = d > .5 ? _ / (2 - p - f) : _ / (p + f), c = p === r ? (l - u) / _ + (l < u ? 6 : 0) : p === l ? (u - r) / _ + 2 : (r - l) / _ + 4, c *= 60), i[0] = c + .5 | 0, i[1] = 100 * h + .5 | 0, i[2] = 100 * d + .5 | 0), "number" === t ? i[0] << 16 | i[1] << 8 | i[2] : i
                },
                u = function(e, t) {
                    var i, r, n, o = (e + "").match(h) || [],
                        s = 0,
                        a = "";
                    if (!o.length) return e;
                    for (i = 0; i < o.length; i++) r = o[i], n = e.substr(s, e.indexOf(r, s) - s), s += n.length + r.length, r = l(r, t ? "hsl" : "rgb"), 3 === r.length && r.push(1), a += n + (t ? "hsla(" + r[0] + "," + r[1] + "%," + r[2] + "%," + r[3] : "rgba(" + r.join(",")) + ")";
                    return a + e.substr(s)
                },
                c = (e.GreenSockGlobals || e).TweenLite,
                h = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b",
                d = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0],
                p = .212671,
                f = .072169,
                _ = function(e, t) {
                    var i, r, n = [],
                        o = 0,
                        s = 0;
                    for (i = 0; i < 4; i++) {
                        for (r = 0; r < 5; r++) s = 4 === r ? e[o + 4] : 0, n[o + r] = e[o] * t[r] + e[o + 1] * t[r + 5] + e[o + 2] * t[r + 10] + e[o + 3] * t[r + 15] + s;
                        o += 5
                    }
                    return n
                },
                m = function(e, t) {
                    var i = 1 - t,
                        r = i * p,
                        n = .71516 * i,
                        o = i * f;
                    return _([r + t, n, o, 0, 0, r, n + t, o, 0, 0, r, n, o + t, 0, 0, 0, 0, 0, 1, 0], e)
                },
                g = function(e, t, i) {
                    var r = l(t),
                        n = r[0] / 255,
                        o = r[1] / 255,
                        s = r[2] / 255,
                        a = 1 - i;
                    return _([a + i * n * p, i * n * .71516, i * n * f, 0, 0, i * o * p, a + i * o * .71516, i * o * f, 0, 0, i * s * p, i * s * .71516, a + i * s * f, 0, 0, 0, 0, 0, 1, 0], e)
                },
                v = function(e, t) {
                    t *= Math.PI / 180;
                    var i = Math.cos(t),
                        r = Math.sin(t);
                    return _([p + .787329 * i + r * -p, .71516 + -.71516 * i + -.71516 * r, f + i * -f + .927831 * r, 0, 0, p + i * -p + .143 * r, .71516 + .28484 * i + .14 * r, f + i * -f + -.283 * r, 0, 0, p + i * -p + -.787329 * r, .71516 + -.71516 * i + .71516 * r, f + .927831 * i + r * f, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], e)
                },
                y = function(e, t) {
                    return _([t, 0, 0, 0, .5 * (1 - t), 0, t, 0, 0, .5 * (1 - t), 0, 0, t, 0, .5 * (1 - t), 0, 0, 0, 1, 0], e)
                },
                b = function(t, i) {
                    var r, n = e.PIXI.filters[i],
                        o = t.filters || [],
                        s = o.length;
                    if (!n) throw "PixiPlugin error: " + i + " isn't present.";
                    for (; --s > -1;)
                        if (o[s] instanceof n) return o[s];
                    return r = new n, "BlurFilter" === i && (r.blur = 0), o.push(r), t.filters = o, r
                },
                x = function(e, t, i, r) {
                    t._addTween(i, e, i[e], r[e], e), t._overwriteProps.push(e)
                },
                T = function(t, i) {
                    var r = new e.PIXI.filters.ColorMatrixFilter;
                    return r.matrix = i, r.brightness(t, !0), r.matrix
                },
                E = {
                    contrast: 1,
                    saturation: 1,
                    colorizeAmount: 0,
                    colorize: "rgb(255,255,255)",
                    hue: 0,
                    brightness: 1
                },
                S = function(e, t, i) {
                    var r, n, o, s = b(e, "ColorMatrixFilter"),
                        a = e._gsColorMatrixFilter = e._gsColorMatrixFilter || {
                            contrast: 1,
                            saturation: 1,
                            colorizeAmount: 0,
                            colorize: "rgb(255,255,255)",
                            hue: 0,
                            brightness: 1
                        },
                        l = t.combineCMF && !("colorMatrixFilter" in t && !t.colorMatrixFilter);
                    o = s.matrix, t.matrix && t.matrix.length === o.length ? (n = t.matrix, 1 !== a.contrast && x("contrast", i, a, E), a.hue && x("hue", i, a, E), 1 !== a.brightness && x("brightness", i, a, E), a.colorizeAmount && (x("colorize", i, a, E), x("colorizeAmount", i, a, E)), 1 !== a.saturation && x("saturation", i, a, E)) : (n = d.slice(), null != t.contrast ? (n = y(n, Number(t.contrast)), x("contrast", i, a, t)) : 1 !== a.contrast && (l ? n = y(n, a.contrast) : x("contrast", i, a, E)), null != t.hue ? (n = v(n, Number(t.hue)), x("hue", i, a, t)) : a.hue && (l ? n = v(n, a.hue) : x("hue", i, a, E)), null != t.brightness ? (n = T(Number(t.brightness), n), x("brightness", i, a, t)) : 1 !== a.brightness && (l ? n = T(a.brightness, n) : x("brightness", i, a, E)), null != t.colorize ? (t.colorizeAmount = "colorizeAmount" in t ? Number(t.colorizeAmount) : 1, n = g(n, t.colorize, t.colorizeAmount), x("colorize", i, a, t), x("colorizeAmount", i, a, t)) : a.colorizeAmount && (l ? n = g(n, a.colorize, a.colorizeAmount) : (x("colorize", i, a, E), x("colorizeAmount", i, a, E))), null != t.saturation ? (n = m(n, Number(t.saturation)), x("saturation", i, a, t)) : 1 !== a.saturation && (l ? n = m(n, a.saturation) : x("saturation", i, a, E))), r = n.length;
                    for (; --r > -1;) n[r] !== o[r] && i._addTween(o, r, o[r], n[r], "colorMatrixFilter");
                    i._overwriteProps.push("colorMatrixFilter")
                },
                P = function(e, i, r, n, o) {
                    var s = n._firstPT = {
                        _next: n._firstPT,
                        t: e,
                        p: i,
                        proxy: {},
                        f: "function" == typeof e[i]
                    };
                    s.proxy[i] = "rgb(" + l(s.f ? e[i.indexOf("set") || "function" != typeof e["get" + i.substr(3)] ? i : "get" + i.substr(3)]() : e[i]).join(",") + ")", o._addTween(s.proxy, i, "get", "number" == typeof r ? "rgb(" + l(r, !1).join(",") + ")" : r, i, null, null, t)
                },
                A = function(e, t) {
                    var i = t.setRatio,
                        r = function(e) {
                            var n, o = r._firstPT;
                            for (i.call(t, e); o;) n = l(o.proxy[o.p], "number"), o.f ? o.t[o.p](n) : o.t[o.p] = n, o = o._next;
                            r.graphics && (r.graphics.dirty++, r.graphics.clearDirty++)
                        };
                    return t.setRatio = r, r
                },
                C = {
                    tint: 1,
                    lineColor: 1,
                    fillColor: 1
                },
                M = "position,scale,skew,pivot,anchor,tilePosition,tileScale".split(","),
                R = {
                    x: "position",
                    y: "position",
                    tileX: "tilePosition",
                    tileY: "tilePosition"
                },
                O = {
                    colorMatrixFilter: 1,
                    saturation: 1,
                    contrast: 1,
                    hue: 1,
                    colorize: 1,
                    colorizeAmount: 1,
                    brightness: 1,
                    combineCMF: 1
                },
                w = Math.PI / 180,
                I = function(e) {
                    return "string" == typeof e && "=" === e.charAt(1) ? e.substr(0, 2) + parseFloat(e.substr(2)) * w : e * w
                };
            for (i = 0; i < M.length; i++) r = M[i], R[r + "X"] = r, R[r + "Y"] = r;
            for (r in s) h += "|" + r + "\\b";
            h = new RegExp(h + ")", "gi"), t = function(e) {
                var t, i = e[0] + " " + e[1];
                h.lastIndex = 0, h.test(i) && (t = -1 !== i.indexOf("hsl(") || -1 !== i.indexOf("hsla("), e[0] = u(e[0], t), e[1] = u(e[1], t))
            }, c.defaultStringFilter || (c.defaultStringFilter = t);
            var D = e._gsDefine.plugin({
                propName: "pixi",
                priority: 0,
                API: 2,
                global: !0,
                version: "0.1.2",
                init: function(t, i, r, n) {
                    if (!t instanceof e.PIXI.DisplayObject) return !1;
                    var o, s, a, l, u, c, h, d, p, f;
                    for (c in i) {
                        if (o = R[c], a = i[c], "function" == typeof a && (a = a(n || 0, t)), o) s = -1 !== c.charAt(c.length - 1).toLowerCase().indexOf("x") ? "x" : "y", this._addTween(t[o], s, t[o][s], "skew" === o ? I(a) : a, c);
                        else if ("scale" === c || "anchor" === c || "pivot" === c || "tileScale" === c) this._addTween(t[c], "x", t[c].x, a, c + "X"), this._addTween(t[c], "y", t[c].y, a, c + "Y");
                        else if ("rotation" === c) this._addTween(t, c, t.rotation, I(a), c);
                        else if (O[c]) l || (S(t, i.colorMatrixFilter || i, this), l = !0);
                        else if ("blur" === c || "blurX" === c || "blurY" === c || "blurPadding" === c) {
                            if (u = b(t, "BlurFilter"), this._addTween(u, c, u[c], a, c), 0 !== i.blurPadding)
                                for (h = i.blurPadding || 2 * Math.max(u[c], a), p = t.filters.length; --p > -1;) t.filters[p].padding = Math.max(t.filters[p].padding, h)
                        } else if (C[c])
                            if (d || (d = A(0, this)), ("lineColor" === c || "fillColor" === c) && t instanceof e.PIXI.Graphics) {
                                for (f = t.graphicsData, p = f.length; --p > -1;) P(f[p], c, a, d, this);
                                d.graphics = t
                            } else P(t, c, a, d, this);
                        else this._addTween(t, c, t[c], a, c);
                        this._overwriteProps.push(c)
                    }
                    return !0
                }
            });
            D.colorProps = C, D.parseColor = l, D.formatColors = u, D.colorStringFilter = t
        }), e._gsDefine && e._gsQueue.pop()(),
        function(t) {
            "use strict";
            var i = function() {
                return (e.GreenSockGlobals || e).PixiPlugin
            };
            "undefined" != typeof module && module.exports ? (require("../TweenLite.js"), module.exports = i()) : "function" == typeof define && define.amd && define("com/gsap/plugins/PixiPlugin", ["TweenLite"], i)
        }(), define("game/commonUI/UI", ["require", "com/pixijs/pixi", "com/gsap/TimelineLite", "com/gsap/plugins/PixiPlugin"], function(e) {
            function t(e) {
                e.hidden || (e.visible = !1, e.hidden = 1)
            }

            function i(e) {
                2 !== e.hidden && (e.visible = !0, delete e.hidden)
            }

            function r(e, n) {
                Object.keys(n).forEach(function(o) {
                    void 0 !== e[o] && ("object" == typeof n[o] && "object" == typeof e[o] ? null === n[o] && void 0 !== e[o].visible ? t(e[o]) : n[o] ? (1 === e[o].hidden && i(e[o]), r(e[o], n[o])) : e[o] = n[o] : e[o] = n[o])
                })
            }

            function n(e) {
                o.Container.call(this), this.opts = e || {}, this.buttons = []
            }
            var o = e("com/pixijs/pixi");
            e("com/gsap/TimelineLite"), e("com/gsap/plugins/PixiPlugin");
            var s = window.TweenLite;
            return n.prototype = Object.create(o.Container.prototype), n.prototype.addComponent = function(e, t) {
                this[e] = t, t.name = e, this.addChild(t)
            }, n.prototype.addComponents = function(e) {
                for (var t = Object.keys(e), i = 0; i < t.length; i++) this.addComponent(t[i], e[t[i]])
            }, n.prototype.addButtons = function(e) {
                for (var t = Object.keys(e), i = 0; i < t.length; i++) this.buttons.push(t[i]), this.addComponent(t[i], e[t[i]])
            }, n.prototype.setProps = function(e) {
                r(this, e)
            }, n.prototype.focus = function() {
                this.opts.gameLayer instanceof o.Container && (this.focusTween = s.to(this.opts.gameLayer, .2, {
                    pixi: {
                        blur: 10
                    }
                }))
            }, n.prototype.unFocus = function() {
                this.opts.gameLayer instanceof o.Container && (this.focusTween && this.focusTween.pause(), null !== this.opts.gameLayer.filters && s.to(this.opts.gameLayer, .2, {
                    pixi: {
                        blur: 0
                    },
                    onComplete: function() {
                        this.target.filters = null
                    }
                }))
            }, n.prototype.showButton = function(e, t) {
                if (this.buttons.indexOf(e) < 0) throw new Error("Button `" + e + "` not found in UI");
                for (var i = 0; i < this.buttons.length; i++) this.buttons[i] === e ? (this[this.buttons[i]].visible = !0, void 0 !== t && (this[this.buttons[i]].enabled = t)) : this[this.buttons[i]].visible = !1
            }, n
        }), define("game/commonUI/FlexSprite", ["require", "com/pixijs/pixi"], function(e) {
            function t(e) {
                i.mesh.NineSlicePlane.call(this, i.Texture.EMPTY), "string" == typeof e && (this.name = e)
            }
            var i = e("com/pixijs/pixi");
            return t.prototype = Object.create(i.mesh.NineSlicePlane.prototype, {
                frame: {
                    get: function() {
                        return this.texture
                    },
                    set: function(e) {
                        i.utils.TextureCache[e] ? this.texture = i.Texture.fromFrame(e) : this.texture = i.Texture.EMPTY
                    }
                }
            }), t
        }), define("game/commonUI/Footer", ["require", "com/pixijs/pixi", "./FlexSprite"], function(e) {
            function t(e) {
                r.call(this);
                var t = Object.keys(e);
                this._meters = [], this._dividers = [], this.padding = 20, this._fixedWidth = !1, this._dividerFrame = "";
                for (var i = 0; i < t.length; i++) this.addMeter(t[i], e[t[i]])
            }
            var i = e("com/pixijs/pixi"),
                r = e("./FlexSprite");
            return t.prototype = Object.create(r.prototype, {
                fixedWidth: {
                    get: function() {
                        return this._fixedWidth
                    },
                    set: function(e) {
                        this._fixedWidth = e, this.updateLayout()
                    }
                },
                dividerFrame: {
                    get: function() {
                        return this._dividerFrame
                    },
                    set: function(e) {
                        this._dividerFrame = e, this._dividers.forEach(function(t) {
                            t.texture = i.Texture.fromFrame(e)
                        })
                    }
                }
            }), t.prototype.addMeter = function(e, t) {
                if (this._meters.length > this._dividers.length && this._dividers.length < 5) {
                    var r = new i.Sprite(i.Texture.EMPTY);
                    r.anchor.y = .5, this._dividers.push(r), this.addChild(r)
                }
                this[e] = t, this.addChild(t), this._meters.push(t), t.name = e
            }, t.prototype.updateLayout = function() {
                var e = this._meters.filter(function(e) {
                    return e.visible
                }).sort(function(e, t) {
                    return e.index < t.index ? -1 : 1
                });
                if (this._dividers.forEach(function(e) {
                        e.visible = !1
                    }), this._fixedWidth) {
                    for (var t = 0; t < e.length; t++) t < this._dividers.length - 1 && (this._dividers[t].visible = !0, this._dividers[t].x = this._fixedWidth / e.length * (t + 1), this._dividers[t].y = this.height / 2), e[t].x = this._fixedWidth / e.length * (t + .5), e[t].y = this.height / 2, !1 === e[t].multiline && (e[t]._valueText.y = e[t]._labelText.y);
                    return this.width = this._fixedWidth, void(this.pivot.x = this._fixedWidth / 2)
                }
                for (var i = 0, r = 0; r < e.length; r++) {
                    e[r].plus && e[r].minus && (e[r].plus.x = 0, e[r].minus.x = 0);
                    var n = Math.max(e[r].getLocalBounds().width, e[r].minWidth);
                    e[r].plus && e[r].minus && (e[r].minus.x = n / -2 - this.padding - e[r].minus.width / 2, e[r].plus.x = n / 2 + this.padding + e[r].plus.width / 2, n = Math.max(e[r].getLocalBounds().width, e[r].minWidth)), i += this.padding, e[r].x = i + n / 2, e[r].y = this.height / 2, i += n + this.padding, !1 === e[r].multiline && (e[r]._valueText.y = e[r]._labelText.y), r < this._dividers.length - 1 && (this._dividers[r].visible = !0, this._dividers[r].x = i, this._dividers[r].y = this.height / 2)
                }
                this.width = i, this.pivot.x = i / 2
            }, t
        }), define("game/commonUI/FrameSprite", ["require", "com/pixijs/pixi"], function(e) {
            function t(e) {
                i.Sprite.call(this, i.Texture.EMPTY), "string" == typeof e && (this.name = e)
            }
            var i = e("com/pixijs/pixi");
            return t.prototype = Object.create(i.Sprite.prototype, {
                frame: {
                    get: function() {
                        return this.texture
                    },
                    set: function(e) {
                        i.utils.TextureCache[e] ? this.texture = i.Texture.fromFrame(e) : this.texture = i.Texture.EMPTY
                    }
                }
            }), t
        }), define("game/commonUI/Meter", ["require", "com/pixijs/pixi", "./FrameSprite"], function(e) {
            function t(e) {
                r.call(this);
                var t = e || {};
                this._labelText = new i.Text(t.label || " ", {
                    fontFamily: "OswaldLocCurrency-Medium, Arial, sans-serif",
                    fontSize: t.labelSize || 24,
                    fill: t.labelFill || 0,
                    padding: 5
                }), this._valueText = new i.Text(t.value || " ", {
                    fontFamily: "OswaldLocCurrency-Medium, Arial, sans-serif",
                    fontSize: t.valueSize || 24,
                    fill: t.valueFill || 0,
                    padding: 5
                }), this._labelText.name = "label", this._valueText.name = "value", this.minWidth = 0, this.index = t.index || 0, this.addChild(this._labelText, this._valueText), this.multiline = t.multiline || !1
            }
            var i = e("com/pixijs/pixi"),
                r = e("./FrameSprite");
            return t.prototype = Object.create(r.prototype, {
                value: {
                    get: function() {
                        return this._valueText.text
                    },
                    set: function(e) {
                        this._valueText.text = e, this.relayout()
                    }
                },
                label: {
                    get: function() {
                        return this._labelText.text
                    },
                    set: function(e) {
                        this._labelText.text = e, this.relayout()
                    }
                },
                valueStyle: {
                    get: function() {
                        return this._valueText.style
                    },
                    set: function(e) {
                        this._valueText.style = e, this.relayout()
                    }
                },
                labelStyle: {
                    get: function() {
                        return this._labelText.style
                    },
                    set: function(e) {
                        this._labelText.style = e, this.relayout()
                    }
                },
                multiline: {
                    get: function() {
                        return this._multiline
                    },
                    set: function(e) {
                        this._multiline = !!e, this.relayout()
                    }
                }
            }), t.prototype.relayout = function() {
                this._multiline ? (this._labelText.anchor.x = .5, this._labelText.x = 0, this._valueText.anchor.x = .5, this._valueText.x = 0) : (this._labelText.anchor.x = 0, this._labelText.x = (this._labelText.width + 5 + this._valueText.width) / -2, this._valueText.anchor.x = 0, this._valueText.x = this._labelText.width + 5 + this._labelText.x)
            }, t
        }), define("game/commonUI/Button", ["require", "com/pixijs/pixi"], function(e) {
            function t(e) {
                i.Sprite.call(this, i.Texture.EMPTY), e = e || {}, this._textures = {}, this._enabled = !0, this.interactive = !0, this.buttonMode = !0, this.anchor.set(.5), this.enabledTexture = e.enabled || null, this.disabledTexture = e.disabled || null, this.pressedTexture = e.pressed || null, this.overTexture = e.over || null, this.on("pointerdown", this._pointerDown, this), this.on("pointerup", this._pointerUp, this), this.on("pointerupoutside", this._pointerUpOutside, this), this.on("pointerover", this._pointerOver, this), this.on("pointerout", this._pointerOut, this)
            }
            var i = e("com/pixijs/pixi");
            return t.prototype = Object.create(i.Sprite.prototype, {
                enabled: {
                    get: function() {
                        return this._enabled
                    },
                    set: function(e) {
                        this._enabled = !!e, this.interactive = this._enabled, e && null !== this._textures.enabled ? (this.visible = !0, this.texture = this._textures.enabled) : null !== this._textures.disabled ? this.texture = this._textures.disabled : this.visible = e
                    }
                },
                enabledTexture: {
                    get: function() {
                        return this._textures.enabled
                    },
                    set: function(e) {
                        i.utils.TextureCache[e] ? (this._textures.enabled = i.Texture.fromFrame(e), this._textures.enabled.width === this._textures.enabled.height ? this.hitArea = new i.Circle(0, 0, this._textures.enabled.width / 2) : this.hitArea = null) : (this._textures.enabled = i.Texture.EMPTY, this.hitArea = null), this._enabled && (this.texture = this._textures.enabled)
                    }
                },
                disabledTexture: {
                    get: function() {
                        return this._textures.disabled
                    },
                    set: function(e) {
                        this._enabled || this.visible || null !== this._textures.disabled || (this.visible = !0), this._textures.disabled = i.utils.TextureCache[e] ? i.Texture.fromFrame(e) : i.Texture.EMPTY, this._enabled || (this.texture = this._textures.disabled)
                    }
                },
                pressedTexture: {
                    get: function() {
                        return this._textures.pressed
                    },
                    set: function(e) {
                        i.utils.TextureCache[e] ? this._textures.pressed = i.Texture.fromFrame(e) : this._textures.pressed = null
                    }
                },
                overTexture: {
                    get: function() {
                        return this._textures.over
                    },
                    set: function(e) {
                        i.utils.TextureCache[e] ? this._textures.over = i.Texture.fromFrame(e) : this._textures.over = null
                    }
                }
            }), t.prototype._pointerOver = function(e) {
                this._enabled && (e.target.trackedPointers[e.data.identifier].leftDown && null !== this._textures.pressed ? this.texture = this._textures.pressed : null !== this._textures.over && (this.texture = this._textures.over))
            }, t.prototype._pointerOut = function() {
                this._enabled && null !== this._textures.enabled && (this.texture = this._textures.enabled)
            }, t.prototype._pointerDown = function(e) {
                !this._enabled || !this.enableMultitouch && t.singleButtonLock && t.singleButtonLock.worldVisible || "mouse" === e.data.pointerType && 0 !== e.data.button || (null !== this._textures.pressed && (this.texture = this._textures.pressed), this.enableMultitouch || (t.singleButtonLock = this))
            }, t.prototype._pointerUp = function(e) {
                if (!this.enableMultitouch && t.singleButtonLock !== this) return void(t.singleButtonLock = null);
                t.singleButtonLock === this && (t.singleButtonLock = null), this._enabled && (this.texture = this._textures.enabled), "mouse" === e.data.pointerType && 0 !== e.data.button || this.emit("buttonpress", e)
            }, t.prototype._pointerUpOutside = function() {
                t.singleButtonLock = null, this._enabled && null !== this._textures.enabled && (this.texture = this._textures.enabled)
            }, t
        }), define("game/commonUI/BetConfig", ["require", "com/pixijs/pixi", "./Button", "./FrameSprite", "com/gsap/TweenLite"], function(e) {
            function t() {
                i.Container.call(this), this.controls = new n("controls"), this.openButton = new r, this.closeButton = new r, this.openButton.name = "openButton", this.closeButton.name = "closeButton", this.openButton.on("buttonpress", this.open, this), this.closeButton.on("buttonpress", this.close, this), this._enabled = !0, this._controlsVisible = !1, this.addChild(this.controls, this.openButton, this.closeButton), this.closeButton.visible = !1, this.openButton.visible = !0, this.controls.visible = !1
            }
            var i = e("com/pixijs/pixi"),
                r = e("./Button"),
                n = e("./FrameSprite");
            e("com/gsap/TweenLite");
            var o = window.TweenLite;
            return t.prototype = Object.create(i.Container.prototype, {
                enabled: {
                    get: function() {
                        return this._enabled
                    },
                    set: function(e) {
                        this._enabled = !!e, this.openButton.enabled = e;
                        for (var t = 0; t < this.controls.children.length; t++) this.controls.children[t].enabled = e;
                        e || this.close()
                    }
                },
                controlsVisible: {
                    get: function() {
                        return this._controlsVisible
                    },
                    set: function(e) {
                        this._controlsVisible = !!e, e && (this.controls.visible = !0)
                    }
                }
            }), t.prototype.open = function() {
                this.controlsVisible || (this.controls.visible = !0, this.openButton.visible = !1, this.closeButton.visible = !0, o.fromTo(this.controls, .2, {
                    alpha: 0,
                    scaleX: 1.1,
                    scaleY: 1.1
                }, {
                    alpha: 1,
                    scaleX: 1,
                    scaleY: 1
                }))
            }, t.prototype.close = function() {
                this.controlsVisible || (this.closeButton.visible = !1, this.openButton.visible = !0, o.to(this.controls, .2, {
                    alpha: 0,
                    scaleX: .9,
                    scaleY: .9,
                    onComplete: function() {
                        this.target.visible = !1, this.target.alpha = 1, this.target.scale.set(1)
                    }
                }))
            }, t.prototype.addControl = function(e) {
                this[e.name] = e, this.controls.addChild(e)
            }, t
        }), define("game/commonUI/LabelledButton", ["require", "com/pixijs/pixi", "./Button"], function(e) {
            function t(e) {
                r.call(this, e), this._text = new i.Text(" "), this._text.anchor.set(.5), this.addChild(this._text)
            }
            var i = e("com/pixijs/pixi"),
                r = e("./Button");
            return t.prototype = Object.create(r.prototype, {
                text: {
                    get: function() {
                        return this._text.text
                    },
                    set: function(e) {
                        this._text.text = e
                    }
                },
                textStyle: {
                    get: function() {
                        return this._text.style
                    },
                    set: function(e) {
                        this._text.style = e
                    }
                }
            }), t
        }), define("game/commonUI/slot/AutoSpin", ["require", "com/pixijs/pixi", "../Button", "../FrameSprite"], function(e) {
            function t() {
                i.Container.call(this), this._meter = new n, this._meterText = new i.Text(" ", {
                    fontFamily: "OswaldLocCurrency-Medium, Arial, sans-serif",
                    fontSize: 40,
                    fill: 16777215
                }), this._meter.anchor.set(.5), this._meterText.anchor.set(.5), this._meter.addChild(this._meterText), this._meter.name = "counter", this._count = 0, this._active = !1, this._startButton = new r, this._stopButton = new r, this._startButton.name = "startButton", this._stopButton.name = "stopButton", this.addChild(this._startButton, this._stopButton, this._meter)
            }
            var i = e("com/pixijs/pixi"),
                r = e("../Button"),
                n = e("../FrameSprite");
            return t.prototype = Object.create(i.Container.prototype, {
                count: {
                    get: function() {
                        return this._count
                    },
                    set: function(e) {
                        this._count = Math.max(e, 0), this._meterText.text = this._count, this._meter.visible = this._count > 0
                    }
                },
                active: {
                    get: function() {
                        return this._active
                    },
                    set: function(e) {
                        this._active = !!e, this._stopButton.visible = e, this._startButton.visible = !e
                    }
                },
                enabled: {
                    get: function() {
                        return this._startButton.enabled
                    },
                    set: function(e) {
                        this._startButton.enabled = e
                    }
                }
            }), t
        }), define("game/commonUI/super", [], function() {
            function e(t, i, r, n) {
                var o = Object.getOwnPropertyDescriptor(t, i);
                if (void 0 === o) {
                    var s = Object.getPrototypeOf(t);
                    null !== s && e(s, i, r, n)
                } else if ("value" in o && o.writable) o.value = r;
                else {
                    var a = o.set;
                    void 0 !== a && a.call(n, r)
                }
                return r
            }
            return {
                set: e
            }
        }), define("game/commonUI/slot/ActivityAnim", ["require", "com/pixijs/pixi", "../super"], function(e) {
            function t() {
                i.Sprite.call(this, i.Texture.fromFrame("activityBackground")), this._swirl = i.extras.AnimatedSprite.fromFrames(["activityAnim0001", "activityAnim0002", "activityAnim0003", "activityAnim0004", "activityAnim0005", "activityAnim0006", "activityAnim0007", "activityAnim0008", "activityAnim0009", "activityAnim0010", "activityAnim0011", "activityAnim0012", "activityAnim0013", "activityAnim0014", "activityAnim0015", "activityAnim0016", "activityAnim0017", "activityAnim0018", "activityAnim0019", "activityAnim0020", "activityAnim0021", "activityAnim0022", "activityAnim0023", "activityAnim0024", "activityAnim0025", "activityAnim0026", "activityAnim0027", "activityAnim0028", "activityAnim0029", "activityAnim0030", "activityAnim0031", "activityAnim0032", "activityAnim0033", "activityAnim0034", "activityAnim0035", "activityAnim0036", "activityAnim0037", "activityAnim0038", "activityAnim0039", "activityAnim0040"]), this.anchor.set(.5), this._swirl.anchor.set(.5), this._swirl.animationSpeed = .5, this._targetTexture = i.Texture.EMPTY, this._visible = !1, this.visible = !1, this.addChild(this._swirl)
            }
            var i = e("com/pixijs/pixi"),
                r = e("../super");
            return t.prototype = Object.create(i.Sprite.prototype, {
                visible: {
                    get: function() {
                        return this._visible
                    },
                    set: function(e) {
                        this._visible = !!e, r.set(Object.getPrototypeOf(t.prototype), "visible", this._visible, this), this._swirl && (this._visible ? this._swirl.play() : this._swirl.stop())
                    }
                },
                targetTexture: {
                    get: function() {
                        return this._targetTexture
                    },
                    set: function(e) {
                        this._targetTexture = i.Texture.fromFrame(e), this.scale.x = this._targetTexture.width / this.texture.width, this.scale.y = this._targetTexture.height / this.texture.height
                    }
                }
            }), t
        }), define("game/commonUI/slot/color", ["require", "com/pixijs/pixi"], function(e) {
            var t, i = e("com/pixijs/pixi");
            return function() {
                if (void 0 !== t) return t;
                var e = document.createElement("canvas"),
                    r = e.getContext("2d"),
                    n = ["footerTitleColour", "footerValueColour", "betControlsTitleColour", "betControlsValueColour", "autoSpinCounterValueColour", "messagePromptColour"];
                return t = {}, n.forEach(function(e) {
                    var n = i.utils.TextureCache[e];
                    if (n) {
                        var o = n.orig,
                            s = n.baseTexture.resolution;
                        r.clearRect(0, 0, 1, 1), r.drawImage(n.baseTexture.source, o.x * s, o.y * s, o.width * s, o.height * s, 0, 0, 1, 1);
                        var a = r.getImageData(0, 0, 1, 1).data;
                        t[e] = i.utils.rgb2hex([].slice.call(a, 0, 3).map(function(e) {
                            return e / 255
                        }))
                    }
                }), t
            }
        }), define("game/commonUI/slot/logic/autoSpinController", ["require", "skbJet/component/gameMsgBus/GameMsgBus"], function(e) {
            function t(e) {
                r = "false" !== e.PaytableResponse.AutoSpinInfo["@enable"].toLowerCase()
            }
            var i = e("skbJet/component/gameMsgBus/GameMsgBus"),
                r = !0;
            return i.subscribe("platformMsg/ClientService/Game.Init", t),
                function(e) {
                    function t(e) {
                        p.count = e, p.active = !0, i.publish("toPlatform", {
                            channel: "Game",
                            topic: "Game.AutoSpinStart"
                        }), i.publish("UI.AutoSpinStart", {
                            count: e
                        })
                    }

                    function n() {
                        p._startButton.enabled = !0, e.spin.enabled = !0, e.betConfig.enabled = !0
                    }

                    function o() {
                        p._startButton.enabled = !1, e.spin.enabled = !1, e.betConfig.enabled = !1, i.publish("UI.AutoSpinDialogueOpen"), i.publish("toPlatformRequest", {
                            channel: "Game",
                            topic: "Game.AutoSpinOption",
                            data: {},
                            successCallback: function(e) {
                                e && "cancel" !== e.action ? t(e.steps) : (i.publish("UI.AutoSpinDialogueClose"), n())
                            },
                            failCallback: n
                        })
                    }

                    function s() {
                        p._meter.visible = !1, p.count = 0, p.active = !1, i.publish("UI.AutoSpinStop")
                    }

                    function a() {
                        p.count = 0, p.active = !1, p.emit("stop", {
                            type: "autospinstop"
                        }), i.publish("toPlatform", {
                            channel: "Game",
                            topic: "Game.AutoSpinStopped"
                        })
                    }

                    function l() {
                        p.count -= 1, p.count <= 0 && a()
                    }

                    function u(e) {
                        p.count > 0 && p.active, "BaseGame" === e.response.OutcomeDetail.NextStage && (p.enabled = !1, l())
                    }

                    function c(e) {
                        e.response.PromotionalFreeSpin && e.response.PromotionalFreeSpin["@count"] <= 0 && a()
                    }

                    function h() {
                        p.active && a()
                    }

                    function d(t) {
                        "BaseGame" === t.response.OutcomeDetail.Stage && (p.enabled = !0, e.spin.enabled = !0)
                    }
                    var p = e.autoSpin;
                    if (!r) return void Object.defineProperty(p, "visible", {
                        value: !1,
                        writable: !1
                    });
                    p._stopButton.visible = !1, p._meter.visible = !1, p._startButton.on("buttonpress", o), p._stopButton.on("buttonpress", s), i.subscribe("platformMsg/ClientService/Game.StopAutoSpin", a), i.subscribe("onBeforeRequest", u), i.subscribe("onResolveStage", c), i.subscribe("onAbortStage", h), i.subscribe("onResetNextStage", d)
                }
        }), define("game/commonUI/slot/logic/networkActivityController", ["require", "skbJet/component/gameMsgBus/GameMsgBus"], function(e) {
            var t = e("skbJet/component/gameMsgBus/GameMsgBus");
            return function(e) {
                function i() {
                    e.activityAnim.visible = !0, e.spin && (e.spin.visible = !1)
                }

                function r(t) {
                    e.opts.networkActivityStages.indexOf(t.nextStage) > -1 && (clearTimeout(o), e.activityAnim.visible = !1, e.spin && (e.spin.visible = !0))
                }

                function n(t) {
                    e.opts.networkActivityStages.indexOf(t.nextStage) > -1 && (o && r(t), o = setTimeout(i, 3e3))
                }
                var o;
                t.subscribe("onBeforeRequest", n), t.subscribe("onResolveStage", r), t.subscribe("onResetNextStage", r)
            }
        }), define("game/commonUI/ControlledMeter", ["require", "./Button", "./Meter"], function(e) {
            function t(e) {
                r.call(this, e), this.anchor.x = .5, this._value = void 0 !== e.value ? e.value : e.values[0], this._enabled = !0, e.values && (this._values = e.values, this._displayValues = e.displayValues, this.buttonsVisible = !0, this._valueText.text = this.displayValue, this.plus = new i, this.minus = new i, this.plus.name = "plus", this.minus.name = "minus", this.plus.enabled = !1, this.minus.enabled = !1, this.addChild(this.plus, this.minus), e.values.length > 1 && (this.plus.on("buttonpress", this.increment, this), this.minus.on("buttonpress", this.decrement, this))), this.value = this._value
            }
            var i = e("./Button"),
                r = e("./Meter");
            return t.prototype = Object.create(r.prototype, {
                value: {
                    get: function() {
                        return this._value
                    },
                    set: function(e) {
                        if (this._enabled) {
                            if (void 0 === this._values) this.setSimpleValue(e);
                            else {
                                if (!(this._values.indexOf(e) > -1)) throw new Error("Attempting to set value outside of values array");
                                this.setValueFromRange(e)
                            }
                            this.relayout()
                        }
                    }
                },
                displayValue: {
                    get: function() {
                        return void 0 === this._displayValues ? this._value.toString() : this._displayValues[this._values.indexOf(this._value)]
                    }
                },
                increment: {
                    value: function() {
                        if (void 0 === this._values || 0 === this._values.length) throw new Error("An array of values is required in order to increment");
                        var e = this._values.indexOf(this._value) + 1;
                        e < this._values.length && this.emit("change", {
                            name: this.name,
                            value: this._values[e]
                        }), this.emit("increment", {
                            name: this.name
                        })
                    }
                },
                decrement: {
                    value: function() {
                        if (void 0 === this._values || 0 === this._values.length) throw new Error("An array of values is required in order to decrement");
                        var e = this._values.indexOf(this._value) - 1;
                        e >= 0 && this.emit("change", {
                            name: this.name,
                            value: this._values[e]
                        }), this.emit("decrement", {
                            name: this.name
                        })
                    }
                },
                label: {
                    get: function() {
                        return this._labelText.text
                    },
                    set: function(e) {
                        this._labelText.text = e, this.relayout()
                    }
                },
                enabled: {
                    get: function() {
                        return this._enabled
                    },
                    set: function(e) {
                        this._enabled = !!e, this.enableButtons()
                    }
                }
            }), t.prototype.setSimpleValue = function(e) {
                this._value = e, this._valueText.text = e
            }, t.prototype.setValueFromRange = function(e) {
                this._value = e, this._valueText.text = this.displayValue, this._values.length > 1 && this.enableButtons()
            }, t.prototype.enableButtons = function() {
                this._values && (this.plus.enabled = this._enabled && this._value !== this._values[this._values.length - 1], this.minus.enabled = this._enabled && this._value !== this._values[0], this.plus.visible = this.buttonsVisible, this.minus.visible = this.buttonsVisible)
            }, t
        }), define("game/commonUI/BetControl", ["require", "com/pixijs/pixi", "./ControlledMeter"], function(e) {
            function t(e, t) {
                t.labelSize = 30, t.valueSize = 54, r.call(this, t), this.name = e, t.values && t.values.length > 1 && (this._pips = this._values.map(function(e, t) {
                    var r = i.Sprite.fromFrame("desktop_betIndicatorActive");
                    return r.x = r.width * t, r
                }), this.pips = new i.Container, this.pips.addChild.apply(this.pips, this._pips), this.pips.pivot.x = this.pips.width / 2, this.pips.name = "pips", this.addChild(this.pips)), this.value = this._value
            }
            var i = e("com/pixijs/pixi"),
                r = e("./ControlledMeter");
            return t.prototype = Object.create(r.prototype, {
                value: {
                    get: function() {
                        return this._value
                    },
                    set: function(e) {
                        if (this._enabled)
                            if (void 0 === this._values) this.setSimpleValue(e);
                            else {
                                if (!(this._values.indexOf(e) > -1)) throw new Error("Attempting to set value outside of values array");
                                this.setValueFromRange(e), this._pips && this._pips.forEach(function(t, r) {
                                    var n = e === this._values[r] ? "desktop_betIndicatorActive" : "desktop_betIndicatorInactive";
                                    t.texture = i.Texture.fromFrame(n)
                                }, this)
                            }
                    }
                }
            }), t
        }), define("game/commonUI/slot/logic/betController", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "skbJet/component/currencyHelper/currencyHelper", "../../Meter", "../../ControlledMeter", "../../BetControl", "../../FrameSprite", "../betData", "../color"], function(e) {
            function t() {
                var e = b.fromStakeUnits(P.totalBet),
                    t = b.formatBalance(e);
                y.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.Control",
                    data: {
                        name: "stake",
                        event: "change",
                        params: [e, t]
                    }
                })
            }

            function i() {
                y.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.Control",
                    data: {
                        name: "betPerPattern",
                        event: "change",
                        params: [P.betPerPattern, b.formatBalance(b.fromStakeUnits(P.betPerPattern))]
                    }
                }), t()
            }

            function r() {
                y.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.Control",
                    data: {
                        name: "patternsBet",
                        event: "change",
                        params: [P.patternsBet]
                    }
                }), t()
            }

            function n(e) {
                P._betPerPattern = e.value, i()
            }

            function o(e) {
                P._patternsBet = e.value, r()
            }

            function s(e) {
                P._betPerPattern = e.value / P.patternsBet, i()
            }

            function a(e) {
                y.publish("UI.BetUp", {
                    meter: e.name
                })
            }

            function l(e) {
                y.publish("UI.BetDown", {
                    meter: e.name
                })
            }

            function u() {
                return P.patternInfo.length > 1
            }

            function c(e) {
                function i(e) {
                    if ("betPerPattern" === e.option || "patternsBet" === e.option) {
                        var i = parseInt(e.value, 10);
                        "betPerPattern" === e.option && i !== P._betPerPattern ? (P._betPerPattern = i, r.betPerPattern.value = i) : "patternsBet" === e.option && i !== P._patternsBet && (P._patternsBet = i, r.patternsBet.value = i), t()
                    }
                }
                var r = e.betConfig,
                    s = A();
                r.addControl(new E("betPerPattern", {
                    values: P.betInfo.map(function(e) {
                        return parseInt(e, 10)
                    }),
                    displayValues: P.betInfo.map(function(e) {
                        return b.formatBalance(b.fromStakeUnits(e))
                    }),
                    value: parseInt(P.betPerPattern, 10),
                    valueFill: s.betControlsValueColour,
                    labelFill: s.betControlsTitleColour
                })), r.addControl(new E("patternsBet", {
                    values: P.patternInfo.map(function(e) {
                        return parseInt(e, 10)
                    }),
                    value: parseInt(P.patternsBet, 10),
                    valueFill: s.betControlsValueColour,
                    labelFill: s.betControlsTitleColour
                }));
                var c = P.betPerPattern * P.patternsBet,
                    h = b.formatBalance(b.fromStakeUnits(c));
                r.addControl(new E("betSummary", {
                    value: h,
                    valueFill: s.betControlsValueColour,
                    labelFill: s.betControlsTitleColour
                })), u() && e.footer.addMeter("totalBet", new x({
                    value: h,
                    valueFill: s.footerValueColour,
                    labelFill: s.footerTitleColour
                })), r.betPerPattern.on("change", n), r.betPerPattern.on("increment", a), r.betPerPattern.on("decrement", l), r.patternsBet.on("change", o), r.patternsBet.on("increment", a), r.patternsBet.on("decrement", l), y.subscribe("platformMsg/ConsoleService/Game.Control", i)
            }

            function h(e) {
                var t = A();
                e.footer.addMeter("betPerPattern", new T({
                    values: P.betInfo.map(function(e) {
                        return parseInt(e, 10)
                    }),
                    displayValues: P.betInfo.map(function(e) {
                        return b.formatBalance(b.fromStakeUnits(e))
                    }),
                    value: parseInt(P.betPerPattern, 10),
                    valueFill: t.footerValueColour,
                    labelFill: t.footerTitleColour
                })), e.footer.addMeter("patternsBet", new T({
                    values: P.patternInfo.map(function(e) {
                        return parseInt(e, 10)
                    }),
                    value: parseInt(P.patternsBet, 10),
                    valueFill: t.footerValueColour,
                    labelFill: t.footerTitleColour
                })), e.footer.betPerPattern.on("change", n), e.footer.betPerPattern.on("increment", a), e.footer.betPerPattern.on("decrement", l), e.footer.patternsBet.on("change", o), e.footer.patternsBet.on("increment", a), e.footer.patternsBet.on("decrement", l)
            }

            function d(e) {
                function i() {
                    o.meterBar.betPerPattern.value = b.formatBalance(b.fromStakeUnits(P.betPerPattern)), o.meterBar.patternsBet.value = P.patternsBet
                }

                function r() {
                    o.totalBet.value = P.totalBet, e.footer.totalBet.value = P.totalBet
                }

                function n(e) {
                    if ("betPerPattern" === e.option) {
                        var i = parseInt(e.value, 10);
                        i !== P.betPerPattern && (P._betPerPattern = i, o.betPerPattern.value = b.formatBalance(b.fromStakeUnits(P.betPerPattern)), t())
                    }
                }
                var o = e.betConfig,
                    c = A(),
                    h = P.betInfo.map(function(e) {
                        return e * P.patternsBet
                    }),
                    d = P.totalBet;
                o.addControl(new S("meterBar")), o.meterBar.betPerPattern = new x({
                    value: b.formatBalance(b.fromStakeUnits(P.betPerPattern)),
                    valueFill: c.betControlsValueColour,
                    valueSize: 30,
                    labelFill: c.betControlsTitleColour,
                    labelSize: 30
                }), o.meterBar.patternsBet = new x({
                    value: P.patternsBet,
                    valueFill: c.betControlsValueColour,
                    valueSize: 30,
                    labelFill: c.betControlsTitleColour,
                    labelSize: 30
                }), o.meterBar.addChild(o.meterBar.betPerPattern, o.meterBar.patternsBet), o.addControl(new E("totalBet", {
                    values: h,
                    displayValues: h.map(function(e) {
                        return b.formatBalance(b.fromStakeUnits(e))
                    }),
                    value: d,
                    valueFill: c.betControlsValueColour,
                    labelFill: c.betControlsTitleColour
                })), u() || e.footer.addMeter("totalBet", new T({
                    values: h,
                    displayValues: h.map(function(e) {
                        return b.formatBalance(b.fromStakeUnits(e))
                    }),
                    value: d,
                    valueFill: c.footerValueColour,
                    labelFill: c.footerTitleColour
                })), y.subscribe("BetData.PatternsBet", i), y.subscribe("BetData.BetPerPattern", i), y.subscribe("BetData.TotalBet", r), o.totalBet.on("change", s), o.totalBet.on("increment", a), o.totalBet.on("decrement", l), y.subscribe("platformMsg/ConsoleService/Game.Control", n)
            }

            function p(e) {
                var t = A();
                e.footer.addMeter("betPerPattern", new x({
                    value: b.formatBalance(b.fromStakeUnits(P.betPerPattern)),
                    valueFill: t.footerValueColour,
                    labelFill: t.footerTitleColour
                })), e.footer.addMeter("patternsBet", new x({
                    value: P.patternsBet,
                    valueFill: t.footerValueColour,
                    labelFill: t.footerTitleColour
                })), e.footer.totalBet.on("change", s), e.footer.totalBet.on("increment", a), e.footer.totalBet.on("decrement", l)
            }

            function f(e) {
                function t() {
                    var t = b.formatBalance(b.fromStakeUnits(P.totalBet));
                    e.betConfig.betSummary.value = t, e.footer.totalBet.value = P.totalBet, e.betConfig.totalBet.value = P.totalBet, e.footer.win.value = " "
                }

                function i() {
                    e.betConfig.betPerPattern.value = P.betPerPattern, e.footer.betPerPattern.value = b.formatBalance(b.fromStakeUnits(P.betPerPattern))
                }

                function r() {
                    e.betConfig.patternsBet.value = P.patternsBet, e.footer.patternsBet.value = P.patternsBet
                }
                c(e), d(e), u() ? h(e) : p(e), y.subscribe("BetData.TotalBet", t), y.subscribe("BetData.BetPerPattern", i), y.subscribe("BetData.PatternsBet", r)
            }

            function _(e) {
                u() ? c(e) : d(e)
            }

            function m(e) {
                function t() {
                    e.spin.visible = !1, e.prompt.visible = !1, e.prompt.hidden = 2, e.autoSpin.visible = !1, e.footer.win.value = " ", e.focus(), y.publish("UI.BetConfigOpen")
                }

                function i() {
                    e.spin.visible = !0, e.autoSpin.visible = !0, e.unFocus(), y.publish("UI.BetConfigClose")
                }

                function r() {
                    a.open(), t()
                }

                function n() {
                    a.enabled = !1, "INT" === v && (e.footer.betPerPattern.enabled = !1, e.footer.patternsBet.enabled = !1, e.footer.totalBet.enabled = !1), e.prompt.visible = !1, e.prompt.hidden = 2, e.unFocus()
                }

                function o() {
                    e.autoSpin.active || (a.enabled = !0, "INT" === v && (e.footer.betPerPattern.enabled = !0, e.footer.patternsBet.enabled = !0, e.footer.totalBet.enabled = !0))
                }

                function s(t) {
                    "BaseGame" === t.response.OutcomeDetail.NextStage && (a.enabled = !0, e.spin.enabled = !0, "INT" === v && (e.footer.betPerPattern.enabled = !0, e.footer.patternsBet.enabled = !0, e.footer.totalBet.enabled = !0))
                }
                var a = e.betConfig;
                a.openButton.on("buttonpress", t), a.closeButton.on("buttonpress", i), e.prompt.on("buttonpress", r), y.subscribe("onBeforeRequest", n), y.subscribe("onBeginNewGame", o), y.subscribe("onResetNextStage", s)
            }

            function g(e) {
                v = e.serverConfig.channel
            }
            var v, y = e("skbJet/component/gameMsgBus/GameMsgBus"),
                b = e("skbJet/component/currencyHelper/currencyHelper"),
                x = e("../../Meter"),
                T = e("../../ControlledMeter"),
                E = e("../../BetControl"),
                S = e("../../FrameSprite"),
                P = e("../betData"),
                A = e("../color");
            return y.subscribe("platformMsg/Kernel/System.Init", g), {
                initBet: m,
                initDesktopUI: f,
                initTouchUI: _,
                isSplitBet: u
            }
        }), define("game/commonUI/slot/logic/promoSpinsController", ["require", "skbJet/component/gameMsgBus/GameMsgBus"], function(e) {
            function t(e) {
                n = "freespin" === e.serverConfig.paramGame.playMode
            }

            function i(e) {
                n && (o = e.GameLogicResponse.PromotionalFreeSpin["@count"])
            }
            var r = e("skbJet/component/gameMsgBus/GameMsgBus"),
                n = !1,
                o = 0;
            return r.subscribe("platformMsg/Kernel/System.Init", t), r.subscribe("platformMsg/ClientService/Game.Init", i),
                function(e) {
                    function t(t) {
                        e.footer.promoSpins.value = t.response.PromotionalFreeSpin["@count"]
                    }
                    if (!n) return e.footer.promoSpins.visible = !1, void(e.footer.balance.visible = !0);
                    r.subscribe("onResolveStage", t), e.footer.promoSpins.value = o, e.footer.promoSpins.visible = !0, e.footer.balance.visible = !1, e.prompt.visible = !1
                }
        }), define("game/commonUI/slot/baseGameUI", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "../UI", "../Footer", "../Meter", "../Button", "../BetConfig", "../LabelledButton", "./AutoSpin", "./ActivityAnim", "./color", "./logic/autoSpinController", "./logic/networkActivityController", "./logic/betController", "./logic/promoSpinsController"], function(e) {
            function t() {
                if ("INT" === o && b.footer.width > 1600 && b.autoSpin.x <= 1190) {
                    b.footer.x += 20, b.autoSpin.x += 50, b.spin.x += 50, b.skip.x += 50, b.play.x += 50
                }
            }

            function i(e) {
                o = e.serverConfig.channel
            }

            function r() {
                "INT" === o ? b.addComponents({
                    footer: new l({
                        win: new u,
                        balance: new u,
                        promoSpins: new u,
                        buttonBackground: new u
                    }),
                    autoSpin: new p,
                    betConfig: new h,
                    prompt: new d,
                    activityAnim: new f
                }) : b.addComponents({
                    footer: new l({
                        win: new u,
                        balance: new u,
                        promoSpins: new u
                    }),
                    autoSpin: new p,
                    betConfig: new h,
                    prompt: new d,
                    activityAnim: new f
                }), b.addButtons({
                    spin: new c,
                    skip: new c,
                    play: new c
                }), m(b), v.initBet(b), "INT" === o ? v.initDesktopUI(b) : v.initTouchUI(b), y(b), g(b);
                var e = _();
                b.footer.balance.labelStyle.fill = e.footerTitleColour, b.footer.promoSpins.labelStyle.fill = e.footerTitleColour, b.footer.win.labelStyle.fill = e.footerTitleColour, b.footer.totalBet.labelStyle.fill = e.footerTitleColour, b.footer.balance.valueStyle.fill = e.footerValueColour, b.footer.promoSpins.valueStyle.fill = e.footerValueColour, b.footer.win.valueStyle.fill = e.footerValueColour, b.footer.totalBet.valueStyle.fill = e.footerValueColour, b.prompt.textStyle.fill = e.messagePromptColour, b.autoSpin._meterText.fill = e.autoSpinCounterValueColour
            }

            function n(e) {
                b.footer.balance.value = e.balance
            }
            var o, s = e("skbJet/component/gameMsgBus/GameMsgBus"),
                a = e("../UI"),
                l = e("../Footer"),
                u = e("../Meter"),
                c = e("../Button"),
                h = e("../BetConfig"),
                d = e("../LabelledButton"),
                p = e("./AutoSpin"),
                f = e("./ActivityAnim"),
                _ = e("./color"),
                m = e("./logic/autoSpinController"),
                g = e("./logic/networkActivityController"),
                v = e("./logic/betController"),
                y = e("./logic/promoSpinsController"),
                b = new a;
            return b.name = "baseGameUI", b.opts.networkActivityStages = ["BaseGame", "BaseGameTumble"], b.applyOrientation = function(e) {
                b.opts.rotateDesktop && "INT" === o && ("portrait" === e ? (b.betConfig.controls.visible = !1, b.betConfig.controlsVisible = !1, b.betConfig.closeButton.visible = !1, b.betConfig.openButton.visible = !0) : (b.betConfig.controls.visible ? (b.spin.visible = !0, b.autoSpin.visible = !0, b.unFocus()) : b.betConfig.controls.visible = !0, b.betConfig.controlsVisible = !0)), b.footer.updateLayout(), t()
            }, b.setText = function(e) {
                b.prompt.text = e.betPrompt, b.footer.balance.label = e.balance, b.footer.win.label = e.win, b.footer.promoSpins.label = e.promoFreeSpins, b.footer.totalBet.label = e.bet, "INT" === o && (b.footer.patternsBet.label = e.patternsBet, b.footer.betPerPattern.label = e.betPerPattern), (v.isSplitBet() || "INT" === o) && (b.betConfig.betPerPattern.label = e.betPerPattern, b.betConfig.patternsBet.label = e.patternsBet, b.betConfig.betSummary.label = e.totalBet), v.isSplitBet() && "INT" !== o || (b.betConfig.totalBet.label = e.totalBet, b.betConfig.meterBar.betPerPattern.label = e.betPerPattern, b.betConfig.meterBar.patternsBet.label = e.patternsBet), b.footer.updateLayout(), t()
            }, s.subscribe("platformMsg/Kernel/System.Init", i), s.subscribe("platformMsg/ClientService/Game.Init", r), s.subscribe("platformMsg/ClientService/Account.Balances", n), b
        }), define("game/commonUI/slot/freeSpinsUI", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "../UI", "../Footer", "../Meter", "../Button", "./ActivityAnim", "./color", "./logic/networkActivityController"], function(e) {
            function t(e) {
                r = e.serverConfig.channel
            }

            function i() {
                "INT" === r ? d.addComponents({
                    footer: new s({
                        spins: new a,
                        bonusWin: new a,
                        win: new a,
                        buttonBackground: new a
                    }),
                    activityAnim: new u
                }) : d.addComponents({
                    footer: new s({
                        spins: new a,
                        bonusWin: new a,
                        win: new a
                    }),
                    activityAnim: new u
                }), d.addButtons({
                    spin: new l,
                    skip: new l,
                    play: new l
                }), h(d);
                var e = c();
                d.footer.spins.labelStyle.fill = e.footerTitleColour, d.footer.win.labelStyle.fill = e.footerTitleColour, d.footer.bonusWin.labelStyle.fill = e.footerTitleColour, d.footer.spins.valueStyle.fill = e.footerValueColour, d.footer.win.valueStyle.fill = e.footerValueColour, d.footer.bonusWin.valueStyle.fill = e.footerValueColour
            }
            var r, n = e("skbJet/component/gameMsgBus/GameMsgBus"),
                o = e("../UI"),
                s = e("../Footer"),
                a = e("../Meter"),
                l = e("../Button"),
                u = e("./ActivityAnim"),
                c = e("./color"),
                h = e("./logic/networkActivityController"),
                d = new o;
            return d.name = "freeSpinsUI", d.opts.networkActivityStages = ["FreeSpin", "FreeSpinTumble"], d.applyOrientation = function() {
                d.footer.updateLayout()
            }, d.setText = function(e) {
                d.footer.spins.label = e.spins, d.footer.win.label = e.win, d.footer.bonusWin.label = e.bonusWin, d.footer.updateLayout()
            }, n.subscribe("platformMsg/Kernel/System.Init", t), n.subscribe("platformMsg/ClientService/Game.Init", i), d
        }), define("game/commonUI/slot/slotUI", ["require", "com/pixijs/pixi", "skbJet/component/gameMsgBus/GameMsgBus", "./layout", "./baseGameUI", "./freeSpinsUI"], function(e) {
            function t(e) {
                Object.assign(d.opts, e), Object.assign(p.opts, e)
            }

            function i(e) {
                d.setText(e), p.setText(e)
            }

            function r() {
                d.setProps(h[l][a].baseGame), p.setProps(h[l][a].freeSpins)
            }

            function n() {
                var e = window.innerWidth,
                    t = window.innerHeight,
                    i = e > t ? "landscape" : "portrait";
                i !== a && null !== h[l][i] && (a = "INT" !== l || d.opts.rotateDesktop ? i : "landscape", r(i), d.applyOrientation(i), p.applyOrientation(i))
            }

            function o(e) {
                l = e.serverConfig.channel
            }

            function s() {
                n(), null !== h.portrait && null !== h.landscape && window.addEventListener("resize", n)
            }
            var a, l, u = e("com/pixijs/pixi"),
                c = e("skbJet/component/gameMsgBus/GameMsgBus"),
                h = e("./layout"),
                d = e("./baseGameUI"),
                p = e("./freeSpinsUI"),
                f = new u.Container;
            return f.addChild(d, p), f.name = "commonUI", c.subscribe("platformMsg/Kernel/System.Init", o), c.subscribe("platformMsg/ClientService/Game.Init", s), {
                container: f,
                layout: h,
                applyLayout: r,
                baseGame: d,
                freeSpins: p,
                set: t,
                setText: i
            }
        }), define("game/views/core/gameSVC", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "game/data/gameEvents", "game/data/stateEvents", "skbJet/component/currencyHelper/currencyHelper"], function(e) {
            "use strict";
            var t = e("skbJet/component/gameMsgBus/GameMsgBus"),
                i = e("game/data/gameEvents"),
                r = e("game/data/stateEvents"),
                n = e("skbJet/component/currencyHelper/currencyHelper"),
                o = function() {
                    var e = this,
                        s = null,
                        a = null,
                        l = window.location.search.match(/&?assetPack=([^&]+)&?/)[1],
                        u = null;
                    this.isMaxAward = !1, this.awardCap = null, o.prototype.systemInit = function(t) {
                        var i = t.PaytableResponse.AwardCapInfo.CurrencyCap.AwardCap;
                        e.awardCap = n.formatBalance(i)
                    }, o.prototype.stageInit = function(e, t) {}, o.prototype.subscribeToMsgBus = function() {
                        t.subscribe(i.GAME_INIT, this.onGameInit), t.subscribe(i.ON_BEFORE_SHOW_STAGE, this.onBeforeShowStage), t.subscribe(i.ON_START_GAME_INITIAL, this.onStartGameInitial), t.subscribe(i.ON_START_PROGRESS_STAGE, this.onStartProgressStage), t.subscribe(i.ON_START_PROGRESS_NEXT_STAGE, this.onStartProgressNextStage), t.subscribe(i.ON_BEFORE_REQUEST, this.onBeforeRequest), t.subscribe(i.ON_MAKE_REQUEST, this.onMakeRequest), t.subscribe(i.ON_RESOLVE_STAGE, this.onResolveStage), t.subscribe(i.ON_END_GAME, this.onEndGame), t.subscribe(i.ON_BEGIN_NEW_GAME, this.onBeginNewGame), t.subscribe(i.ON_EXIT_STAGE, this.onExitStage), t.subscribe(i.ON_ENTER_NEXT_STAGE, this.onEnterNextStage), t.subscribe(i.ON_IN_PROGRESS_STAGE, this.onInProgressStage), t.subscribe(i.ON_ABORT_NEXT_STAGE, this.onAbortNextStage), t.subscribe(i.ON_RESET_NEXT_STAGE, this.onResetNextStage), t.subscribe(r.STATE_CHANGED, this.onStateChanged), t.subscribe(i.ON_TRASITION_DONE, this.onTransitionDone), t.subscribe(i.ORIENTATION_CHANGED, this.orientationChanged)
                    }, o.prototype.unsubscribeToMsgBus = function() {
                        t.unsubscribe(i.GAME_INIT, this.onGameInit), t.unsubscribe(i.ON_BEFORE_SHOW_STAGE, this.onBeforeShowStage), t.unsubscribe(i.ON_START_GAME_INITIAL, this.onStartGameInitial), t.unsubscribe(i.ON_START_PROGRESS_STAGE, this.onStartProgressStage), t.unsubscribe(i.ON_START_PROGRESS_NEXT_STAGE, this.onStartProgressNextStage), t.unsubscribe(i.ON_BEFORE_REQUEST, this.onBeforeRequest), t.unsubscribe(i.ON_MAKE_REQUEST, this.onMakeRequest), t.unsubscribe(i.ON_RESOLVE_STAGE, this.onResolveStage), t.unsubscribe(i.ON_END_GAME, this.onEndGame), t.unsubscribe(i.ON_BEGIN_NEW_GAME, this.onBeginNewGame), t.unsubscribe(i.ON_EXIT_STAGE, this.onExitStage), t.unsubscribe(i.ON_ENTER_NEXT_STAGE, this.onEnterNextStage), t.unsubscribe(i.ON_IN_PROGRESS_STAGE, this.onInProgressStage), t.unsubscribe(i.ON_ABORT_NEXT_STAGE, this.onAbortNextStage), t.unsubscribe(i.ON_RESET_NEXT_STAGE, this.onResetNextStage), t.unsubscribe(r.STATE_CHANGED, this.onStateChanged), t.unsubscribe(i.ON_TRASITION_DONE, this.onTransitionDone), t.unsubscribe(i.ORIENTATION_CHANGED, this.orientationChanged)
                    }, o.prototype.onGameInit = function(e) {}, o.prototype.onBeforeShowStage = function(e) {}, o.prototype.onStartGameInitial = function(e) {}, o.prototype.onStartProgressStage = function(e) {}, o.prototype.onStartProgressNextStage = function(e) {
                        r.publish(r.FROM_RECOVERY_GAME_IN_PROGRESS_NEXT)
                    }, o.prototype.onBeforeRequest = function(e) {
                        r.publish(r.FROM_BEFORE_REQUEST)
                    }, o.prototype.onMakeRequest = function(e) {
                        r.publish(r.FROM_MAKE_REQUEST)
                    }, o.prototype.onResolveStage = function(e) {
                        r.publish(r.FROM_RESOLVE_STAGE)
                    }, o.prototype.onEndGame = function(e) {
                        r.publish(r.FROM_END_GAME)
                    }, o.prototype.onBeginNewGame = function(e) {
                        r.publish(r.FROM_BEGIN_NEW_GAME)
                    }, o.prototype.onExitStage = function(e) {
                        r.publish(r.FROM_EXIT_STAGE)
                    }, o.prototype.onEnterNextStage = function(e) {
                        r.publish(r.FROM_ENTER_NEXT_STAGE)
                    }, o.prototype.onInProgressStage = function(e) {
                        r.publish(r.FROM_IN_PROGRESS_STAGE)
                    }, o.prototype.onAbortNextStage = function(e) {
                        r.publish(r.FROM_ABORT_NEXT_STAGE)
                    }, o.prototype.onResetNextStage = function(e) {
                        r.publish(r.FROM_RESET_NEXT_STAGE)
                    }, o.prototype.onStateChanged = function(e) {
                        s = e.state, a = e.gameState
                    }, o.prototype.onTransitionDone = function(e) {}, o.prototype.orientationChanged = function(e) {
                        u = e.orientation
                    }, o.prototype.isMobile = function() {
                        return "desktop" !== l
                    }, this.isMaxAwardReached = function(e) {
                        null !== e && void 0 !== e && ("true" === e.response.AwardCapOutcome.AwardCapExceeded ? this.isMaxAward = !0 : this.isMaxAward = !1)
                    }, Object.defineProperty(this, "currentGameEvent", {
                        get: function() {
                            return a
                        }
                    }), Object.defineProperty(this, "currentStateEvent", {
                        get: function() {
                            return s
                        }
                    }), Object.defineProperty(this, "orientation", {
                        get: function() {
                            return u
                        }
                    })
                };
            return o.prototype.constructor = o, o
        }), define("game/components/phoenix/animationLayer", ["com/pixijs/pixi"], function(e) {
            return function(t, i) {
                function r() {
                    var t = new e.extras.AnimatedSprite([e.Texture.EMPTY]);
                    return t.visible = !1, t.zIndex = 1, t
                }

                function n(r, n) {
                    P[r] = [];
                    for (var s = -1; s < t.options.reels[r].symbolCount + 1; s++) {
                        var a = S[r][s + 1],
                            l = n.spriteRefs[s + 1];
                        l ? (Array.isArray(i[l].textures) ? (a.textures = i[l].textures, a.texture = a.textures[0], a.visible = !0, a.gotoAndStop(0), a.loop = !0) : (a.visible = !0, a.textures = [i[l].textures], a.texture = a.textures[0], a.gotoAndStop(0), a.loop = !0), a.position.x = a.position.rx + i[l].xOffset, a.position.y = a.position.ry + i[l].yOffset, a.zIndex = i[l].zOffset) : a.visible = !1, P[r].push(l), s >= 0 && s < t.options.reels[r].symbolCount && (A[r][s].textures = [e.Texture.EMPTY], A[r][s].texture = e.Texture.EMPTY, A[r][s].visible = !1, A[r][s].gotoAndStop(0), A[r][s].loop = !0)
                    }
                    P[r].pop(), P[r].shift(), o(T), o(E)
                }

                function o(e) {
                    e.children.sort(function(e, t) {
                        return e.zIndex - t.zIndex || t.x - e.x || e.y - t.y
                    })
                }

                function s(e, t) {
                    for (var i = [], r = 0; r < t; r++) i = i.concat(e);
                    return i
                }

                function a(t) {
                    return t ? Array.isArray(t) ? t.map(function(t) {
                        return t ? e.utils.TextureCache[t] : e.Texture.EMPTY
                    }) : [e.utils.TextureCache[t]] : [e.Texture.EMPTY]
                }

                function l(e) {
                    return e.every(function(e) {
                        return e.completed
                    })
                }

                function u(e, t, i, r, n, o, s) {
                    var a = {},
                        l = {};
                    return e instanceof Object ? (a = e, l = t) : (a = {
                        location: e,
                        textures: t,
                        animationSpeed: i,
                        layer: r,
                        position: n,
                        playmode: o
                    }, l = s), c(a, l)
                }

                function c(e, t) {
                    k.push({
                        location: e.location,
                        layer: e.layer
                    });
                    var i;
                    return 0 === e.layer ? i = C[R[e.location]] : 1 === e.layer && (i = M[R[e.location]]), i && (e.textures ? (i.visible = !0, i.textures = a(e.playmode && e.playmode.playCount ? s(e.textures, e.playmode.playCount) : e.textures), i.texture = i.textures[0], i.position.x = i.position.rx, i.position.y = i.position.ry, e.position && (e.position.x && (i.position.x += e.position.x), e.position.y && (i.position.y += e.position.y)), i.animationSpeed = e.animationSpeed, i.loop = !0, e.playmode && (!1 === e.playmode.loop || e.playmode.hasOwnProperty("playCount")) && (i.loop = !1), i.gotoAndStop(0), t && (t.onComplete && (i.onComplete = t.onComplete), t.onFrameChange && (i.onFrameChange = t.onFrameChange))) : i.visible = !1), {
                        gotoAndPlay: function(e) {
                            i.gotoAndPlay(e)
                        },
                        gotoAndStop: function(e) {
                            i.gotoAndStop(e)
                        }
                    }
                }

                function h(e, t) {
                    return e.map(function(i) {
                        return i.completed = !1, u(i, {
                            onComplete: function() {
                                i.completed = !0, l(e) && t && t.onComplete && t.onComplete()
                            }
                        })
                    })
                }

                function d(e) {
                    return 0 === e ? T : 1 === e ? E : void 0
                }

                function p(e, t) {
                    return 0 === t ? C[R[e]] : 1 === t ? M[R[e]] : void 0
                }

                function f() {
                    k.forEach(function(e) {
                        var t;
                        0 === e.layer ? t = C[R[e.location]] : 1 === e.layer && (t = M[R[e.location]]), t.gotoAndPlay(0)
                    })
                }

                function _() {
                    k.forEach(function(e) {
                        var t;
                        0 === e.layer ? t = C[R[e.location]] : 1 === e.layer && (t = M[R[e.location]]), t.gotoAndStop(0), t.loop = !0, t.onFrameChange = void 0, t.onComplete = void 0
                    })
                }

                function m(r) {
                    if (_(), !k || 0 !== k.length) {
                        for (var n = 0; n < t.options.reels.length; n++)
                            for (var o = 0; o < t.options.reels[n].symbolCount; o++) {
                                if (!r || 0 === r) {
                                    var s = S[n][o + 1],
                                        a = P[n][o];
                                    a ? (Array.isArray(i[a].textures) ? (s.textures = i[a].textures, s.texture = s.textures[0], s.gotoAndStop(0), s.loop = !0) : (s.textures = [i[a].textures], s.texture = s.textures[0], s.gotoAndStop(0), s.loop = !0), s.onFrameChange = void 0, s.onComplete = void 0, s.visible = !0, s.position.x = s.position.rx + i[a].xOffset, s.position.y = s.position.ry + i[a].yOffset, s.zIndex = i[a].zOffset) : s.visible = !1
                                }
                                0 !== r && (A[n][o].textures = [e.Texture.EMPTY], A[n][o].texture = e.Texture.EMPTY, A[n][o].gotoAndStop(0), A[n][o].loop = !0, A[n][o].onFrameChange = void 0, A[n][o].onComplete = void 0)
                            }
                        k = []
                    }
                }

                function g() {
                    if (_(), !k || 0 !== k.length) {
                        for (var i = 0; i < t.options.reels.length; i++) {
                            for (var r = 0; r < S[i].length; r++) S[i][r].textures = [e.Texture.EMPTY], S[i][r].texture = e.Texture.EMPTY, S[i][r].gotoAndStop(0), S[i][r].loop = !0, S[i][r].onFrameChange = void 0, S[i][r].onComplete = void 0;
                            for (r = 0; r < A[i].length; r++) A[i][r].textures = [e.Texture.EMPTY], A[i][r].texture = e.Texture.EMPTY, A[i][r].gotoAndStop(0), A[i][r].loop = !0, A[i][r].onFrameChange = void 0, A[i][r].onComplete = void 0
                        }
                        k = []
                    }
                }

                function v(e) {
                    x.visible = !0;
                    for (var i = -1; i < t.options.reels[e].symbolCount + 1; i++) {
                        S[e][i + 1].visible = !0, i >= 0 && i < t.options.reels[e].symbolCount && (A[e][i].visible = !0)
                    }
                }

                function y(e) {
                    for (var i = -1; i < t.options.reels[e].symbolCount + 1; i++) {
                        S[e][i + 1].visible = !1, i >= 0 && i < t.options.reels[e].symbolCount && (A[e][i].visible = !1)
                    }
                }

                function b() {
                    return {
                        startAnimating: f,
                        stopAnimating: _,
                        resetAnimations: m,
                        clearAnimations: g,
                        setCellAnimation: u,
                        setCellAnimations: h,
                        getLayerContainer: d,
                        getCellHandle: p,
                        getContainer: function() {
                            return x
                        }
                    }
                }
                var x = new e.Container,
                    T = new e.Container,
                    E = new e.Container;
                x.addChild(T), x.addChild(E);
                var S = [],
                    P = [],
                    A = [],
                    C = [],
                    M = [],
                    R = t.locationsMap.reduce(function(e, t, i) {
                        return e[t] = i, e
                    }, {});
                e.extras.AnimatedSprite || (e.extras.AnimatedSprite = e.extras.MovieClip);
                for (var O = [], w = new e.Graphics, I = !0, D = 0; D < t.options.reels.length; D++) 0 !== t.options.reels[D].y && (I = !1);
                if (t.options.reels.length > 1 && I)
                    for (D = 1; D < t.options.reels.length; D++) t.options.reels[D - 1].symbolCount !== t.options.reels[D].symbolCount && (I = !1);
                var L = !0;
                if (t.options.clip) t.options.clip[0].hasOwnProperty("reels") ? t.options.clip.forEach(function(t) {
                    w = new e.Graphics, w.beginFill(), w.drawRect(t.x, t.y, t.w, t.h), w.endFill(), w.zIndex = 1e3, t.reels.forEach(function(e) {
                        O[e] = w
                    }), x.addChild(w)
                }) : (t.options.clip.forEach(function(e) {
                    w.beginFill(), w.drawRect(e.x, e.y, e.w, e.h), w.endFill()
                }), w.zIndex = 1e3, T.addChild(w), O = [w]);
                else if (I) w.beginFill(), w.drawRect(t.options.pos.x + t.options.reels[0].x, t.options.pos.y + t.options.reels[0].y, (t.symbolSlotWidth + t.symbolSpacingW) * t.options.reels.length - t.symbolSpacingW, (t.symbolSlotHeight + t.symbolSpacingH) * t.options.reels[0].symbolCount - t.symbolSpacingH), w.endFill(), w.zIndex = 1e3, T.addChild(w), O = [w];
                else {
                    for (w.beginFill(), D = 0; D < t.options.reels.length; D++) w.drawRect(t.options.pos.x + t.options.reels[D].x, t.options.pos.y + t.options.reels[D].y, t.symbolSlotWidth + t.symbolSpacingW, (t.symbolSlotHeight + t.symbolSpacingH) * t.options.reels[D].symbolCount);
                    w.endFill(), w.zIndex = 1e3, T.addChild(w), O = [w]
                }
                for (O.length > 1 && (L = !1), L && (T.mask = O[0]), D = 0; D < t.options.reels.length; D++) {
                    for (var B = [], F = [], N = -1; N < t.options.reels[D].symbolCount + 1; N++) {
                        var V = r();
                        V.position.x = t.options.pos.x + t.options.reels[D].x, V.position.y = t.options.pos.y + t.options.reels[D].y + (t.symbolSlotHeight + t.symbolSpacingH) * N, V.position.rx = V.position.x, V.position.ry = V.position.y, L || (V.mask = O[D]), B.push(V), N >= 0 && N < t.options.reels[D].symbolCount && (C.push(V), V = r(), V.position.x = t.options.pos.x + t.options.reels[D].x, V.position.y = t.options.pos.y + t.options.reels[D].y + (t.symbolSlotHeight + t.symbolSpacingH) * N, V.position.rx = V.position.x, V.position.ry = V.position.y, M.push(V), F.push(V))
                    }
                    S.push(B), P.push([]), A.push(F)
                }
                for (D = 0; D < t.options.reels.length; D++) S[D].forEach(function(e) {
                    T.addChild(e)
                });
                for (D = 0; D < t.options.reels.length; D++) A[D].forEach(function(e) {
                    E.addChild(e)
                });
                var k = [];
                return {
                    setViewData: n,
                    show: v,
                    hide: y,
                    startAnimating: f,
                    stopAnimating: _,
                    resetAnimations: m,
                    clearAnimations: g,
                    setCellAnimation: u,
                    setCellAnimations: h,
                    getLayerContainer: d,
                    getCellHandle: p,
                    getContainer: function() {
                        return x
                    },
                    getLimitedAccess: b
                }
            }
        }), define("game/components/phoenix/reelspin", ["com/pixijs/pixi", "game/components/phoenix/animationLayer"], function(e, t) {
            return function(i, r) {
                function n(t) {
                    var i = new e.extras.AnimatedSprite([e.Texture.EMPTY]);
                    return i.zIndex = 1, i.visible = !1, i
                }

                function o(e) {
                    for (var t = r.StripInfo[re], i = -2; i < r.options.reels[e].symbolCount + 2; i++) {
                        var n = B[e][i + 2],
                            o = (q[e] + t[e].length + i) % t[e].length,
                            s = J.populationOutcomeParsed && J.populationOutcomeParsed[e] && J.populationOutcomeParsed[e][o] ? J.populationOutcomeParsed[e][o] : t[e][o];
                        J.symbolsMap && J.symbolsMap[s] && (s = J.symbolsMap[s]), Array.isArray(N[s].textures) ? (n.textures = N[s].textures, n.texture = n.textures[0], n.gotoAndStop(0)) : (n.textures = [N[s].textures], n.texture = n.textures[0], n.gotoAndStop(0)), n.zIndex = N[s].zOffset, n.alpha = N[s].opacity, n.visible = !0, n.position.x = r.options.pos.x + r.options.reels[e].x + N[s].xOffset, n.position.y = r.options.pos.y - Y[e] + N[s].yOffset + r.options.reels[e].y + (Z.symbolSlotHeight + Z.symbolSpacingH) * i
                    }
                }

                function s(e) {
                    for (var t = r.StripInfo[$.reelset], i = -2; i < r.options.reels[e].symbolCount + 2; i++) {
                        var n = F[e][i + 2],
                            o = t[e][(V[e] + t[e].length + i) % t[e].length];
                        $.symbolsMap && $.symbolsMap[o] && (o = $.symbolsMap[o]), Array.isArray(N[o].textures) ? (n.textures = N[o].textures, n.texture = n.textures[0], n.gotoAndStop(0)) : (n.textures = [N[o].textures], n.texture = n.textures[0], n.gotoAndStop(0)), n.zIndex = N[o].zOffset, n.alpha = N[o].opacity, n.visible = !0, n.position.x = r.options.pos.x + r.options.reels[e].x + N[o].xOffset;
                        var s = H[e] + j[e];
                        K[e] > 0 && (s = -s), n.position.y = r.options.pos.y - s + r.options.reels[e].y + N[o].yOffset + (Z.symbolSlotHeight + Z.symbolSpacingH) * i
                    }
                }

                function a(e, t) {
                    for (var i = r.StripInfo[t.reelset], n = {
                            spriteRefs: []
                        }, o = -1; o < r.options.reels[e].symbolCount + 1; o++) {
                        var s = i[e][(L[e] + i[e].length + o) % i[e].length];
                        t.symbolsMap && t.symbolsMap[s] && (s = t.symbolsMap[s]), n.spriteRefs.push(s)
                    }
                    ee.show(e), ee.setViewData(e, n)
                }

                function l() {
                    for (var e = 0; e < r.options.reels.length; e++)
                        for (var t = -2; t < r.options.reels[e].symbolCount + 2; t++) {
                            var i = F[e][t + 2];
                            i.visible = !1
                        }
                }

                function u() {
                    for (var e = 0; e < r.options.reels.length; e++)
                        for (var t = -2; t < r.options.reels[e].symbolCount + 2; t++) {
                            var i = B[e][t + 2];
                            i.visible = !1
                        }
                }

                function c(e) {
                    for (var t = -2; t < r.options.reels[e].symbolCount + 2; t++) B[e][t + 2].visible = !1, F[e][t + 2].visible = !1
                }

                function h(e, t) {
                    if (I[t] === M.SPIN_SPINUP || I[t] === M.SPIN_FINDEND || I[t] === M.SPIN_SPINNING || I[t] === M.SPIN_PRESTOP || I[t] === M.SPIN_PRESTOP_EXTRA ? (X[t] = Math.floor((X[t] + K[t] * e + ie[t]) % ie[t]), q[t] = Math.floor(X[t] / (Z.symbolSlotHeight + Z.symbolSpacingH)), Y[t] = X[t] % (Z.symbolSlotHeight + Z.symbolSpacingH)) : (q[t] = Math.floor(X[t] / (Z.symbolSlotHeight + Z.symbolSpacingH)), Y[t] += K[t] * e), J.populationOutcomeParsed && J.populationOutcomeParsed[t]) {
                        var i = r.StripInfo[re];
                        J.populationOutcomeParsed[t] && (K[t] > 0 ? (q[t] - parseInt(Object.keys(J.populationOutcomeParsed[t])[0]) + i[t].length) % i[t].length : (parseInt(Object.keys(J.populationOutcomeParsed[t])[0]) - q[t] + i[t].length) % i[t].length) > 2 * r.options.reels[t].symbolCount && (J.populationOutcomeParsed[t] = void 0)
                    }
                    return o(t), !0
                }

                function d(e) {
                    return Math.abs(Y[e]) > (Z.symbolSlotHeight + Z.symbolSpacingH) * (Z.options.reels[e].symbolCount + 4)
                }

                function p(e) {
                    return 0 === H[e]
                }

                function f(e) {
                    return 0 === H[e] && ($.stopBounce && $.stopBounce.length && j[e] === $.stopBounce[0] || !($.stopBounce && $.stopBounce.length) && 0 === j[e])
                }

                function _(e, t) {
                    H[t] > 0 ? (H[t] -= Math.abs(K[t] * e), H[t] <= 0 && (j[t] += H[t], H[t] = 0)) : (j[t] -= Math.abs(K[t] * e), $.stopBounce && $.stopBounce.length ? j[t] <= $.stopBounce[0] && (j[t] = $.stopBounce[0], H[t] = 0) : j[t] <= 0 && (j[t] = 0, H[t] = 0)), s(t)
                }

                function m(e, t) {
                    var i = X[t] % (Z.symbolSlotHeight + Z.symbolSpacingH);
                    H[t] = i, j[t] = (Z.symbolSlotHeight + Z.symbolSpacingH) * (Z.options.reels[t].symbolCount + 4), K[t] > 0 && (H[t] = Z.symbolSlotHeight + Z.symbolSpacingH - i, j[t] -= Z.symbolSlotHeight + Z.symbolSpacingH), V[t] = $.stopLocations[t]
                }

                function g(e, t) {
                    D[e] = t
                }

                function v() {
                    D[0], I[0];
                    for (var e = 0; e < r.options.reels.length; e++) I[e] = D[e]
                }

                function y() {
                    b(O)
                }

                function b(e) {
                    e.children.sort(function(e, t) {
                        return e.zIndex - t.zIndex || t.x - e.x || e.y - t.y
                    })
                }

                function x(e) {
                    e = Math.min(e, 100);
                    for (var t = 0; t < r.options.reels.length; t++) switch (B[t].sort(function(e, t) {
                        return e.ry > t.ry
                    }), F[t].sort(function(e, t) {
                        return e.ry > t.ry
                    }), I[t]) {
                        case M.INIT_NEEDED:
                            c(t), I[t] = M.SPIN_REST;
                        case M.SPIN_REST:
                            break;
                        case M.SPIN_INIT:
                            ee.hide(t), k[t] = J.startTimer ? J.startTimer[t] : 0, U[t] = J.startTicks ? J.startTicks[t] : 0, g(t, M.SPIN_WAITSTART);
                        case M.SPIN_WAITSTART:
                            U[t]--, k[t] -= e, Math.max(U[t], k[t]) <= 0 && (g(t, M.SPIN_FAUX_BOUNCE_START), W[t] = 0, se && se(t, "STARTED")), h(0, t);
                            break;
                        case M.SPIN_FAUX_BOUNCE_START:
                            J.startBounce && W[t] < J.startBounce.length ? (Y[t] = K[t] > 0 ? -J.startBounce[W[t]] : J.startBounce[W[t]], W[t] += 1) : (Y[t] = 0, W[t] = 0, g(t, M.SPIN_SPINUP)), o(t);
                            break;
                        case M.SPIN_SPINUP:
                            h(e, t) && (g(t, M.SPIN_SPINNING), (ae += 1) === I.length && (ne && ne.call(), ne = null));
                            break;
                        case M.SPIN_SPINNING:
                            h(e, t), Q && (G[t] = $.stopTimer[t], z[t] = $.stopTicks[t], g(t, M.SPIN_PRESTOP));
                            break;
                        case M.SPIN_PRESTOP:
                            h(e, t), z[t]--, G[t] -= e, Math.max(z[t], G[t]) <= 0 && ($.reelSpeed && $.reelSpeed[t] && (K[t] = $.reelSpeed[t] / 1e3), $.extraStopTimer ? (G[t] = $.extraStopTimer[t], g(t, M.SPIN_PRESTOP_EXTRA)) : g(t, M.SPIN_FINDEND));
                            break;
                        case M.SPIN_PRESTOP_EXTRA:
                            h(e, t), z[t]--, G[t] -= e, Math.max(z[t], G[t]) <= 0 && g(t, M.SPIN_FINDEND);
                            break;
                        case M.SPIN_FINDEND:
                            h(e, t), m(e, t), _(e, t), g(t, M.SPIN_STITCH);
                            break;
                        case M.SPIN_STITCH:
                            h(e, t), _(e, t), d(t) && g(t, M.SPIN_STOPPING);
                            break;
                        case M.SPIN_STOPPING:
                            _(e, t), p(t) && g(t, M.SPIN_STOPEND);
                            break;
                        case M.SPIN_STOPEND:
                            _(e, t), f(t) && (g(t, M.SPIN_FAUX_BOUNCE), j[t] = 0, W[t] = 0, se && se(t, "BOUNCE"));
                            break;
                        case M.SPIN_FAUX_BOUNCE:
                            $.stopBounce && W[t] < $.stopBounce.length ? (H[t] = $.stopBounce[W[t]], W[t] += 1) : (H[t] = 0, W[t] = 0, g(t, M.SPIN_HANDBRAKE)), s(t);
                            break;
                        case M.SPIN_HANDBRAKE:
                            L[t] = V[t], g(t, M.SPIN_REST), a(t, $), c(t), se && se(t, "STOPPED"), ae -= 1, 0 === ae && oe && (J = $, oe.call(), oe = null)
                    }
                    v(), y()
                }

                function T(e, t) {
                    J = e, J.reelset && (re = J.reelset);
                    for (var i = 0; i < r.options.reels.length; i++) Y[i] = 0, L[i] = e.stopLocations[i], X[i] = L[i] * (Z.symbolSlotHeight + Z.symbolSpacingH), g(i, M.SPIN_INIT), K[i] = e.reelSpeed[i] / 1e3;
                    if (J.populationOutcome) {
                        var n = [];
                        for (i = 0; i < r.options.reels.length; i++) {
                            for (var o = {}, s = 0; s < Z.options.reels[i].symbolCount; s++) J.populationOutcome["L0C" + i + "R" + s] && (o[(J.stopLocations[i] + s) % r.StripInfo[re][i].length] = J.populationOutcome["L0C" + i + "R" + s]);
                            n.push(o)
                        }
                        J.populationOutcomeParsed = n
                    } else J.populationOutcomeParsed = void 0;
                    l(), ae = 0, ne = t, Q = !1
                }

                function E(e, t, i) {
                    $ = e, oe = t, se = i, ae = I.length, Q = !0
                }

                function S(e) {
                    if (e.reelSpeed)
                        for (var t = 0; t < r.options.reels.length; t++) $.reelSpeed[t] = e.reelSpeed[t], K[t] = e.reelSpeed[t] / 1e3
                }

                function P(e) {
                    re = e.reelset;
                    for (var t = 0; t < e.stopLocations.length; t++) L[t] = e.stopLocations[t], I[t] = M.SPIN_REST, D[t] = M.SPIN_REST, Y[t] = 0, X[t] = L[t] * (Z.symbolSlotHeight + Z.symbolSpacingH), q[t] = Math.floor(X[t] / (Z.symbolSlotHeight + Z.symbolSpacingH)), a(t, e);
                    l(), u(), y()
                }

                function A(e) {
                    P(J), e && e()
                }

                function C() {
                    return ee.getLimitedAccess()
                }
                var M = {
                        INIT_NEEDED: -1,
                        SPIN_REST: 0,
                        SPIN_INIT: 2,
                        SPIN_WAITSTART: 3,
                        SPIN_FAUX_BOUNCE_START: 4,
                        SPIN_SPINUP: 6,
                        SPIN_SPINNING: 8,
                        SPIN_PRESTOP: 9,
                        SPIN_PRESTOP_EXTRA: 22,
                        SPIN_FINDEND: 10,
                        SPIN_STITCH: 12,
                        SPIN_STOPPING: 14,
                        SPIN_STOPEND: 16,
                        SPIN_FAUX_BOUNCE: 18,
                        SPIN_HANDBRAKE: 99
                    },
                    R = new e.Container,
                    O = new e.Container,
                    w = [],
                    I = [],
                    D = [],
                    L = [],
                    B = [],
                    F = [],
                    N = {},
                    V = [],
                    k = [],
                    U = [],
                    G = [],
                    z = [],
                    j = [],
                    H = [],
                    W = [],
                    X = [],
                    Y = [],
                    q = [],
                    K = [],
                    Q = !1,
                    Z = r,
                    J = {},
                    $ = {};
                e.extras.AnimatedSprite || (e.extras.AnimatedSprite = e.extras.MovieClip);
                var ee, te = [],
                    ie = [],
                    re = "BaseGame";
                ! function() {
                    r.spriteOffsets || (r.spriteOffsets = {}), r.symbolNames.forEach(function(t) {
                        if (Array.isArray(r.spriteMap[t])) {
                            var i = [];
                            r.spriteMap[t].forEach(function(t) {
                                i.push(e.Texture.fromFrame(t))
                            }), N[t] = {
                                textures: i
                            }
                        } else N[t] = {
                            textures: e.Texture.fromFrame(r.spriteMap[t])
                        };
                        r.spriteOffsets[t] || (r.spriteOffsets[t] = {
                            x: 0,
                            y: 0,
                            z: 0,
                            o: 1
                        }), N[t].xOffset = r.spriteOffsets[t].x, N[t].yOffset = r.spriteOffsets[t].y, N[t].zOffset = r.spriteOffsets[t].z || 0, N[t].opacity = r.spriteOffsets[t].o || 1
                    }), ee = t(r, N), r.StripInfo && (re = Object.keys(r.StripInfo)[0], Object.keys(r.StripInfo).forEach(function(e) {
                        null !== r.StripInfo[e][0] && void 0 !== r.StripInfo[e][0] && r.StripInfo[e][0].Stop && r.StripInfo[e].forEach(function(t, i) {
                            var n = [];
                            t.Stop.forEach(function(e, t) {
                                n.push(e["@symbolID"])
                            }), r.StripInfo[e][i] = n
                        })
                    }));
                    for (var i = 0, o = new e.Graphics, s = !0, a = r.options.reels[0].y, l = 0; l < r.options.reels.length; l++) r.options.reels[l].y !== a && (s = !1);
                    if (r.options.reels.length > 1 && s)
                        for (l = 1; l < r.options.reels.length; l++) Z.options.reels[l - 1].symbolCount !== Z.options.reels[l].symbolCount && (s = !1);
                    var u = !0;
                    if (Z.options.clip) Z.options.clip[0].hasOwnProperty("reels") ? Z.options.clip.forEach(function(t) {
                        o = new e.Graphics, o.beginFill(), o.drawRect(t.x, t.y, t.w, t.h), o.endFill(), o.zIndex = 1e3, t.reels.forEach(function(e) {
                            te[e] = o
                        }), R.addChild(o)
                    }) : (Z.options.clip.forEach(function(e) {
                        o.beginFill(), o.drawRect(e.x, e.y, e.w, e.h), o.endFill()
                    }), o.zIndex = 1e3, R.addChild(o), te = [o]);
                    else if (s) o.beginFill(), o.drawRect(r.options.pos.x + r.options.reels[0].x, r.options.pos.y + r.options.reels[0].y, (Z.symbolSlotWidth + Z.symbolSpacingW) * r.options.reels.length - Z.symbolSpacingW, (Z.symbolSlotHeight + Z.symbolSpacingH) * Z.options.reels[0].symbolCount - Z.symbolSpacingH), o.endFill(), o.zIndex = 1e3, R.addChild(o), te = [o];
                    else {
                        for (o.beginFill(), l = 0; l < r.options.reels.length; l++) o.drawRect(r.options.pos.x + r.options.reels[l].x, r.options.pos.y + r.options.reels[l].y, Z.symbolSlotWidth + r.symbolSpacingW, (Z.symbolSlotHeight + r.symbolSpacingH) * Z.options.reels[l].symbolCount);
                        o.endFill(), o.zIndex = 1e3, R.addChild(o), te = [o]
                    }
                    for (te.length > 1 && (u = !1), l = 0; l < r.options.reels.length; l++) {
                        ie.push(r.StripInfo[re][l].length * (Z.symbolSlotHeight + Z.symbolSpacingH)), L.push(0), I.push(M.INIT_NEEDED), D.push(M.INIT_NEEDED);
                        for (var c = [n(l), n(l), n(l), n(l)], h = [n(l), n(l), n(l), n(l)], d = [], p = 0; p < r.options.reels[l].symbolCount; p++) c.push(n(l)), h.push(n(l)), w.push(n(l)), d.push(w[i]), i += 1;
                        B.push(c), F.push(h)
                    }
                    for (l = 0; l < r.options.reels.length; l++) B[l].forEach(function(e) {
                        u || (e.mask = te[l]), O.addChild(e)
                    });
                    for (l = 0; l < r.options.reels.length; l++) F[l].forEach(function(e) {
                        u || (e.mask = te[l]), O.addChild(e)
                    });
                    for (u && (O.mask = te[0]), R.addChild(O), l = 0; l < r.options.reels.length; l++) V.push(0), k.push(0), U.push(0), G.push(0), z.push(0), j.push(0), H.push(0), W.push(0), X.push(0), Y.push(0), q.push(0), K.push(-400);
                    R.addChild(ee.getContainer())
                }();
                var ne, oe, se, ae = 0;
                return {
                    spin: T,
                    resolve: E,
                    setReels: P,
                    cancelSpin: A,
                    getContainer: function() {
                        return R
                    },
                    process: x,
                    updateMotion: S,
                    getWinPresentationLayer: C
                }
            }
        }), define("game/components/reelSetController", ["require", "game/components/phoenix/reelspin", "skbJet/component/gladPixiRenderer/gladPixiRenderer"], function(e) {
            "use strict";
            var t = e("game/components/phoenix/reelspin"),
                i = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                r = function(e, r, n) {
                    function o(e, t) {
                        var i = null;
                        void 0 !== t && null !== t || (t = "CurrentReelSetSelect");
                        var r = [];
                        Array.isArray(e.response.TriggerOutcome) ? r = e.response.TriggerOutcome : r.push(e.response.TriggerOutcome);
                        for (var n = 0; n < r.length; n++)
                            if (r[n]["@name"].indexOf(t) >= 0) {
                                var o = [];
                                Array.isArray(r[n].Trigger) ? o = r[n].Trigger : o.push(r[n].Trigger), i = o[0]["@name"];
                                break
                            }
                        return i
                    }

                    function s() {
                        c.process(m.elapsedMS)
                    }

                    function a(e, t) {
                        for (var i = t.PaytableResponse.StripInfo, r = 0; r < i.length; r++) e.StripInfo[i[r]["@name"]] = i[r].Strip;
                        for (var n = e.options.clip[0].x, o = e.options.clip[0].y, r = 0; r < e.options.reels.length; r++) e.options.reels[r].x = n + e.symbolSlotWidth * r + e.symbolSpacingW * r, e.options.reels[r].y = o
                    }
                    var l = e,
                        u = null,
                        c = null,
                        h = [0, 0, 0, 0, 0],
                        d = [],
                        p = r,
                        f = n,
                        _ = null,
                        m = null,
                        g = !1;
                    this.init = function(e) {
                        a(p, e), d = f.startSpinStrategy.reelSpeed.concat(), c = t(i.getPixiRenderer(), p), l.addChild(c.getContainer()), m = i.getTicker()
                    }, this.setReelSet = function(e, t, i, r) {
                        if (void 0 !== t && null !== t || (t = !0), void 0 !== i && null !== i || (i = 0), void 0 !== r && null !== r || (r = "CurrentReelSetSelect"), t) {
                            var n = e.response;
                            h = [], _ = null;
                            var s = [];
                            Array.isArray(n.PopulationOutcome) ? s = n.PopulationOutcome : s.push(n.PopulationOutcome);
                            for (var a = 0; a < s.length; a++)
                                if (s[a]["@name"] === p.reelName) {
                                    _ = s[a];
                                    break
                                }
                            for (var a = 0; a < _.Entry.length; a++) h.push(parseInt(_.Entry[a]["@stripIndex"]) + i)
                        }
                        null != (u = o(e, r)) && c.setReels({
                            reelset: u,
                            stopLocations: h
                        })
                    }, this.startSpin = function(e) {
                        c.setReels({
                            reelset: u,
                            stopLocations: h,
                            symbolsMap: p.symbolsMap
                        });
                        var t = f.startSpinStrategy;
                        t.reelset = u, t.symbolsMap = p.symbolsMap, t.stopLocations = h, t.reelSpeed = d.concat(), this.resumeSpinTick(), c.spin(t, function() {
                            e()
                        })
                    }, this.pauseSpinTick = function() {
                        g && (g = !1, m.remove(s))
                    }, this.resumeSpinTick = function() {
                        g || (g = !0, m.add(s))
                    }, this.stopSpin = function(e, t, i) {
                        var r = e.response;
                        u = o(e), h = [], _ = null;
                        var s = [];
                        Array.isArray(r.PopulationOutcome) ? s = r.PopulationOutcome : s.push(r.PopulationOutcome);
                        for (var a = 0; a < s.length; a++)
                            if (s[a]["@name"] === p.reelName) {
                                _ = s[a];
                                break
                            }
                        for (var a = 0; a < _.Entry.length; a++) h.push(parseInt(_.Entry[a]["@stripIndex"]));
                        var l = n.stopSpinStrategy;
                        l.reelset = u, l.stopLocations = h, l.symbolsMap = p.symbolsMap, l.reelSpeed = d.concat(), c.resolve(l, function() {
                            i()
                        }, t)
                    }, this.showAllSymbols = function(e) {
                        for (var t = p.locationsMap, i = 0; i < t.length; i++) {
                            c.getWinPresentationLayer().getCellHandle(p.locationsMap[i], 0).visible = e
                        }
                    }, this.showSymbols = function(e, t) {
                        for (var i = 0; i < t.length; i++) {
                            c.getWinPresentationLayer().getCellHandle(t[i], 0).visible = e
                        }
                    }, this.updateSpeed = function(e) {
                        c.updateMotion({
                            reelSpeed: e
                        })
                    }, this.cancelSpin = function(e) {
                        c.cancelSpin(function() {
                            e()
                        })
                    }
                };
            return r.prototype.constructor = r, r
        }), define("game/utils/textUtils", ["require", "com/pixijs/pixi", "game/utils/miscUtils", "skbJet/component/gladPixiRenderer/gladPixiRenderer"], function(e) {
            function t(e, t, i, r, n) {
                void 0 === i && (i = e.style.align), void 0 === r && (r = !1), void 0 === n && (n = e.style.wordWrapWidth);
                if (void 0 === e.originalSettings && (e.originalSettings = {
                        align: e.style.align,
                        fontSize: e.style.fontSize,
                        x: "center" === e.style.align ? e.x + (e.width >> 1) : "right" === e.style.align ? e.x + e.width : e.x,
                        y: e.y,
                        width: e.width,
                        height: e.height
                    }), e.style.align = e.originalSettings.align, e.style.fontSize = e.originalSettings.fontSize, e.x = e.originalSettings.x, e.y = e.originalSettings.y, e.cacheAsBitmap = !1, e.text = t, !1 === r) {
                    for (;
                        (e.width >= n || e.height >= e.originalSettings.height) && e.style.fontSize > 1;) e.style.fontSize--;
                    e.cacheAsBitmap = !0, e.style.fontSize <= 1 && u.log("Something went wrong with text resizing! text:'" + t + "'", "WARNING")
                }
                "center" === e.style.align ? e.x = e.originalSettings.x - (e.width >> 1) : "right" === e.style.align ? e.x = e.originalSettings.x - e.width : e.x = e.originalSettings.x
            }

            function i(e, t, i) {
                for (void 0 === i && (i = !0), e.style.originalSize || (e.style.originalSize = e.style.fontSize, e.style.originalCentre = e.x + (e.width >> 1)), e.style.fontSize = e.style.originalSize; e.width >= t && e.style.fontSize > 1;) e.style.fontSize--;
                i && (e.x = e.style.originalCentre - (e.width >> 1))
            }

            function r(e, t, i, r, n, o, s, a, u, h) {
                void 0 === i && (i = [0, 0]), void 0 === r && (r = 12), void 0 === n && (n = 4213081), void 0 === o && (o = "OswaldLocCurrency-Medium, Arial, sans-serif"), void 0 === h ? h = r : o += ", Arial, sans-serif", void 0 === s && (s = "center"), void 0 === a && (a = 0), void 0 === u && (u = "#000000");
                var d = new l.TextStyle({
                        fontFamily: o,
                        fontSize: r,
                        fontStyle: "normal",
                        fontWeight: 100,
                        fill: n,
                        align: "center",
                        stroke: u,
                        strokeThickness: a,
                        lineJoin: "round",
                        lineHeight: h,
                        align: s,
                        padding: c.gameConfigOption.defaultPadding
                    }),
                    p = new l.Text(t, d);
                return e.addChild(p), p.x = i[0], p.y = i[1], p
            }

            function n() {
                this.strokeThickness = 4, this.strokeColours = ["#a44d0d", "#dcc97e", "white", "#daeeef", "#71b9e3"], this.strokeGradientStops = [0, .5, .55, .6, 1], this.strokeGradientHorizontal = !1, this.dropShadow = !0, this.dropShadowColour = 0, this.dropShadownBlurAmount = 3, this.dropShadowDist = {
                    x: 0,
                    y: 0
                }, this.dropShadowStrength = 5, this.fontFamily = "Oswald, Arial, sans-serif", this.fontSize = 40, this.fontStyle = "normal", this.fontWeight = 100, this.fill = ["#71b9e3", "#daeeef", "white", "#dcc97e", "#a44d0d"], this.fillGradientStops = [0, .5, .55, .6, 1], this.fillGradientHorizontal = !1, this.align = "center", this.lineJoin = "round", this.lineHeight = 20
            }

            function o(e, t, i) {
                var r = new l.Container;
                if (i.dropShadow) {
                    var n = function() {
                        var e = new l.Text(t, {
                                fontFamily: i.fontFamily,
                                fontSize: i.fontSize,
                                fontStyle: i.fontStyle,
                                fontWeight: i.fontWeight,
                                fill: i.dropShadowColour,
                                align: i.align,
                                lineJoin: "round",
                                lineHeight: i.fontSize
                            }),
                            n = new l.filters.BlurFilter;
                        return n.blur = i.dropShadownBlurAmount, e.filters = [n], r.addChild(e), e.x = i.dropShadowDist.x, e.y = i.dropShadowDist.y, e
                    };
                    if (i.dropShadow.strength < 1) {
                        n().alpha = i.dropShadowStrength
                    } else
                        for (var o = Math.floor(i.dropShadowStrength), s = 0; s < o; s++) n()
                }
                var a, u = {
                        fontFamily: i.fontFamily,
                        fontSize: i.fontSize,
                        fontStyle: i.fontStyle,
                        fontWeight: i.fontWeight,
                        fill: i.fill,
                        fillGradientType: i.fillGradientHorizontal ? 1 : 0,
                        align: i.align,
                        lineJoin: "round",
                        lineHeight: i.fontSize
                    },
                    h = new l.Text(t, u),
                    d = !1;
                if (i.strokeThickness > 0)
                    if (!Array.isArray(i.strokeColours) || Array.isArray(i.strokeColours) && 1 === i.strokeColours.length) u.stroke = i.strokeColours, u.strokeThickness = i.strokeThickness, d = !0;
                    else {
                        for (var p = "", s = 0; s < t.length + 2; s++) p += "█";
                        var f = {
                            fontFamily: i.fontFamily,
                            fontSize: i.fontSize + i.strokeThickness,
                            fontStyle: i.fontStyle,
                            fontWeight: i.fontWeight,
                            fill: i.strokeColours,
                            fillGradientType: i.fillGradientHorizontal ? 1 : 0,
                            align: i.align,
                            lineJoin: "round",
                            lineHeight: i.fontSize
                        };
                        a = new l.Text(p, f), r.addChild(a), a.x -= a.width - h.width >> 1, a.y -= i.strokeThickness >> 1, f.fontSize = i.fontSize, f.stroke = 16777215, f.strokeThickness = i.strokeThickness, f.fill = 16777215, f.fillGradientStops = [];
                        var _ = new l.Text(t, f),
                            m = new l.Container;
                        m.cacheAsBitmap = !0, m.addChild(_);
                        var g = c.getPixiRenderer().generateTexture(m);
                        _.visible = !1;
                        var v = new l.Sprite(g);
                        r.addChild(v), v.cacheAsBitmap = !0, v.x -= .5 * i.strokeThickness, v.y -= .5 * i.strokeThickness, a.mask = v
                    }
                return r.addChild(h), d && (h.x -= .5 * i.strokeThickness, h.y -= .5 * i.strokeThickness), e.addChild(r), r.pivot.set(.5 * r.width, .5 * r.height), r
            }

            function s(e, t) {
                var i = e.pixiContainer.$text;
                null !== t && void 0 !== t || (t = !0);
                var r = null;
                e._currentStyle._width && e._currentStyle._width > 0 && (r = e._currentStyle._width);
                var n = null;
                e._currentStyle._height && e._currentStyle._height > 0 && (n = e._currentStyle._height);
                var o = e._currentStyle._font._size;
                this.autoFitPixiText(i, r, n, o, t)
            }

            function a(e, t, i, r, n) {
                null !== n && void 0 !== n || (n = !0);
                var o = e.text;
                e.wordWrapWidth = t, e.style.wordWrap = n, e.style.fontSize = r, e.style.lineHeight = null;
                for (var s = l.TextMetrics.measureText(o, e.style); e.style.fontSize > .1 && (null !== t && s.width > t || null !== i && s.height > i);) e.style.fontSize -= .1, s = l.TextMetrics.measureText(o, e.style);
                if (null !== e.style.align && null !== t) switch (e.style.align) {
                    case "center":
                        var a = t - s.maxLineWidth;
                        e.x = a / 2
                }
            }
            var l = e("com/pixijs/pixi"),
                u = e("game/utils/miscUtils"),
                c = e("skbJet/component/gladPixiRenderer/gladPixiRenderer");
            return {
                textFitWidth: i,
                setResizeAlign: t,
                addBasicText: r,
                styledTextVO: n,
                addStyledText: o,
                autoFit: s,
                autoFitPixiText: a
            }
        }), define("game/components/chaseLight/chaseLightsController", ["require", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/utils/miscUtils", "com/gsap/TweenMax", "com/pixijs/pixi"], function(e) {
            "use strict";
            var t = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                i = e("game/utils/miscUtils"),
                r = e("com/gsap/TweenMax"),
                n = e("com/pixijs/pixi"),
                o = function() {
                    function e(e) {
                        for (var t = window.location.search.match(/&?assetPack=([^&]+)&?/)[1], r = [], o = 0; o < v.spec.sprites.length; o++) {
                            var s;
                            "desktop" !== t ? (s = i.spriteFromTexture("sparkle"), s.anchor = new n.Point(.5, .5), s.scaleX = s.scaleY = .5) : s = i.spriteFromTexture("sparkle", "centre"), s.position.x = v.spec.sprites[o].posX, s.position.y = v.spec.sprites[o].posY, s.alpha = 0, s = e.addChild(s), r.push(s)
                        }
                        return r
                    }

                    function o() {
                        if ((u += t.getTicker().elapsedMS) >= 1e3 / c) {
                            if (u = 0, (h >= v.spec.animations[d].length || h < 0) && (f++, h = m ? v.spec.animations[d].length - 1 : 0, f === p)) {
                                var e = t.getTicker();
                                return y = !1, e.remove(o), _ && s.turnOff(), void(null != g && g())
                            }
                            for (var i = 0; i < v.spec.sprites.length; i++) {
                                var r = parseInt(v.spec.sprites[i].index);
                                l[r].alpha = v.spec.animations[d][h][i]
                            }
                            m ? h-- : h++
                        }
                    }
                    var s = null,
                        a = null,
                        l = null,
                        u = 0,
                        c = 30,
                        h = 0,
                        d = null,
                        p = 0,
                        f = 0,
                        _ = !0,
                        m = !1,
                        g = null,
                        v = null,
                        y = !1;
                    this.init = function(t, i) {
                        s = this, v = t, a = i, l = e(a), a.visible = !1
                    }, this.orientationChange = function(t) {
                        if (this.removeChildren(), v = t, l = e(a), null != v.spec.animations[d] && !y || !_)
                            for (var i = v.spec.animations[d].length - 1, r = 0; r < v.spec.sprites.length; r++) {
                                var n = parseInt(v.spec.sprites[r].index);
                                l[n].alpha = v.spec.animations[d][i][r]
                            }
                    }, this.startAnimation = function(e, i, r, n, l, c) {
                        _ = void 0 === n || null === n || n, m = void 0 !== l && null !== l && l, g = void 0 !== r && null !== r ? r : null;
                        var b = 0;
                        if (void 0 !== c && null !== c ? b = c : l && (b = v.spec.animations[d].length - 1), s.endCurrentAnimation(_), e in v.spec.animations) {
                            p = parseInt(i);
                            var x = t.getTicker();
                            u = 0, f = 0, d = e, h = b, a.visible = !0, y = !0, x.add(o)
                        }
                    }, this.endCurrentAnimation = function(e) {
                        (_ = void 0 === e || null === e || e) && this.turnOff();
                        var i = t.getTicker();
                        y = !1, i.remove(o)
                    }, this.turnOff = function(e) {
                        if (e > 0) r.to(l, e / 1e3, {
                            alpha: 0,
                            onComplete: function() {
                                for (var e = 0; e < v.spec.sprites.length; e++) {
                                    var t = parseInt(v.spec.sprites[e].index);
                                    l[t].alpha = 0, a.visible = !1
                                }
                            }
                        });
                        else
                            for (var t = 0; t < v.spec.sprites.length; t++) {
                                var i = parseInt(v.spec.sprites[t].index);
                                l[i].alpha = 0, a.visible = !1
                            }
                    }, this.removeChildren = function() {
                        null !== a && void 0 !== a && a.removeChildren()
                    }
                };
            return o.prototype.constructor = o, o
        }), define("game/components/chaseLight/chaseLightPlaqueSpec", [], function() {
            return {
                spec: {
                    sprites: [{
                        index: "0",
                        posX: 141.05,
                        posY: 575
                    }, {
                        index: "1",
                        posX: 228.55,
                        posY: 575
                    }, {
                        index: "2",
                        posX: 314.55,
                        posY: 575
                    }, {
                        index: "3",
                        posX: 401.55,
                        posY: 575
                    }, {
                        index: "4",
                        posX: 489.05,
                        posY: 575
                    }, {
                        index: "5",
                        posX: 575.55,
                        posY: 575
                    }, {
                        index: "6",
                        posX: 662.05,
                        posY: 575
                    }, {
                        index: "7",
                        posX: 750.05,
                        posY: 575
                    }, {
                        index: "8",
                        posX: 836.05,
                        posY: 575
                    }, {
                        index: "9",
                        posX: 923.55,
                        posY: 539.5
                    }, {
                        index: "10",
                        posX: 959.55,
                        posY: 469
                    }, {
                        index: "11",
                        posX: 964.05,
                        posY: 383
                    }, {
                        index: "12",
                        posX: 964.05,
                        posY: 297
                    }, {
                        index: "13",
                        posX: 964.05,
                        posY: 208
                    }, {
                        index: "14",
                        posX: 964.05,
                        posY: 120
                    }, {
                        index: "15",
                        posX: 930.05,
                        posY: 49
                    }, {
                        index: "16",
                        posX: 842.05,
                        posY: 13
                    }, {
                        index: "17",
                        posX: 752.05,
                        posY: 13
                    }, {
                        index: "18",
                        posX: 664.05,
                        posY: 13
                    }, {
                        index: "19",
                        posX: 576.05,
                        posY: 13
                    }, {
                        index: "20",
                        posX: 488.05,
                        posY: 13
                    }, {
                        index: "21",
                        posX: 400.05,
                        posY: 13
                    }, {
                        index: "22",
                        posX: 311.05,
                        posY: 13
                    }, {
                        index: "23",
                        posX: 223.05,
                        posY: 13
                    }, {
                        index: "24",
                        posX: 135.05,
                        posY: 13
                    }, {
                        index: "25",
                        posX: 46,
                        posY: 50
                    }, {
                        index: "26",
                        posX: 15,
                        posY: 120
                    }, {
                        index: "27",
                        posX: 15,
                        posY: 207.5
                    }, {
                        index: "28",
                        posX: 15,
                        posY: 296
                    }, {
                        index: "29",
                        posX: 15,
                        posY: 382.5
                    }, {
                        index: "30",
                        posX: 17.5,
                        posY: 469.5
                    }, {
                        index: "31",
                        posX: 52,
                        posY: 539
                    }],
                    animations: {
                        plaqueAnim: [
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, .25, 0, .25, 0, .25, 0, .25, 0, .25, 0, .25, 0, .25, 0, .25, 0, .25, 0, .25, 0, .25, 0, .25, 0, .25, 0, .25, 0, .25, 0, .25],
                            [0, .5, 0, .5, 0, .5, 0, .5, 0, .5, 0, .5, 0, .5, 0, .5, 0, .5, 0, .5, 0, .5, 0, .5, 0, .5, 0, .5, 0, .5, 0, .5],
                            [0, .75, 0, .75, 0, .75, 0, .75, 0, .75, 0, .75, 0, .75, 0, .75, 0, .75, 0, .75, 0, .75, 0, .75, 0, .75, 0, .75, 0, .75, 0, .75],
                            [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1],
                            [.25, .8, .25, .8, .25, .8, .25, .8, .25, .8, .25, .8, .25, .8, .25, .8, .25, .8, .25, .8, .25, .8, .25, .8, .25, .8, .25, .8, .25, .8, .25, .8],
                            [.5, .6, .5, .6, .5, .6, .5, .6, .5, .6, .5, .6, .5, .6, .5, .6, .5, .6, .5, .6, .5, .6, .5, .6, .5, .6, .5, .6, .5, .6, .5, .6],
                            [.75, .4, .75, .4, .75, .4, .75, .4, .75, .4, .75, .4, .75, .4, .75, .4, .75, .4, .75, .4, .75, .4, .75, .4, .75, .4, .75, .4, .75, .4, .75, .4],
                            [1, .2, 1, .2, 1, .2, 1, .2, 1, .2, 1, .2, 1, .2, 1, .2, 1, .2, 1, .2, 1, .2, 1, .2, 1, .2, 1, .2, 1, .2, 1, .2],
                            [.8, 0, .8, 0, .8, 0, .8, 0, .8, 0, .8, 0, .8, 0, .8, 0, .8, 0, .8, 0, .8, 0, .8, 0, .8, 0, .8, 0, .8, 0, .8, 0],
                            [.6, 0, .6, 0, .6, 0, .6, 0, .6, 0, .6, 0, .6, 0, .6, 0, .6, 0, .6, 0, .6, 0, .6, 0, .6, 0, .6, 0, .6, 0, .6, 0],
                            [.4, 0, .4, 0, .4, 0, .4, 0, .4, 0, .4, 0, .4, 0, .4, 0, .4, 0, .4, 0, .4, 0, .4, 0, .4, 0, .4, 0, .4, 0, .4, 0],
                            [.2, 0, .2, 0, .2, 0, .2, 0, .2, 0, .2, 0, .2, 0, .2, 0, .2, 0, .2, 0, .2, 0, .2, 0, .2, 0, .2, 0, .2, 0, .2, 0],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
                        ]
                    }
                }
            }
        }), define("game/components/basicButton", ["require", "com/pixijs/pixi"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = function() {
                    function e() {
                        c && d()
                    }

                    function i() {
                        null !== u.pressed && c && (l.texture = u.pressed, h = u.pressed)
                    }

                    function r() {
                        null !== u.over && c && (l.texture = u.over, h = u.over)
                    }

                    function n() {
                        null !== u.enabled && (c && (l.texture = u.enabled), h = u.enabled)
                    }

                    function o() {
                        null !== u.over && (c && (l.texture = u.over), h = u.over)
                    }

                    function s() {
                        null !== u.enabled && (c && (l.texture = u.enabled), h = u.enabled)
                    }

                    function a(e) {
                        var i = {
                            enabled: null,
                            disabled: null,
                            over: null,
                            pressed: null
                        };
                        return e.disabled && (i.disabled = t.Texture.fromFrame(e.disabled)), e.enabled && (i.enabled = t.Texture.fromFrame(e.enabled)), e.over && (i.over = t.Texture.fromFrame(e.over)), e.pressed && (i.pressed = t.Texture.fromFrame(e.pressed)), i
                    }
                    t.Sprite.call(this, t.Texture.EMPTY);
                    var l = this,
                        u = null,
                        c = !0,
                        h = null,
                        d = null;
                    this.init = function(t, c) {
                        d = c, this.buttonMode = !0, this.interactive = !0, u = a(t), null != u.enabled && (this.texture = u.enabled, h = u.enabled), this.on("pointerdown", i, this), this.on("pointerup", r, this), this.on("pointerupoutside", n, this), this.on("pointerover", o, this), this.on("pointerout", s, this), l.on("click", e), l.on("touchend", e)
                    }, Object.defineProperty(this, "enable", {
                        get: function() {
                            return c
                        },
                        set: function(e) {
                            e !== c && (c = e, c ? null != h && (this.texture = h) : this.texture = u.disabled, this.buttonMode = e)
                        }
                    }), this.reset = function() {
                        null != u.enabled && (this.texture = u.enabled, h = u.enabled), this.enable = !0
                    }
                };
            return i.prototype = Object.create(t.Sprite.prototype), i.prototype.constructor = i, i
        }), define("game/components/plaque/plaqueContent", ["require", "com/pixijs/pixi", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/utils/textUtils", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "game/utils/miscUtils", "com/gsap/TweenMax", "skbJet/component/currencyHelper/currencyHelper", "game/components/createJsAudioPlayer/SoundManager", "game/commonUI/slot/betData"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                r = e("game/utils/textUtils"),
                n = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                o = e("game/utils/miscUtils"),
                s = (e("com/gsap/TweenMax"), e("skbJet/component/currencyHelper/currencyHelper")),
                a = e("game/components/createJsAudioPlayer/SoundManager"),
                l = e("game/commonUI/slot/betData"),
                u = function() {
                    function e(e) {
                        null !== B && void 0 !== B || (B = o.createMovieClip("TextHighlightAnim_", 0, 5, 3, .25), B.scaleX = B.scaleY = 2), e.children.length < 2 && e.addChild(B), B.play()
                    }

                    function u() {
                        null === D && (D = r.addBasicText(w, n.i18n.Plinko.WinPlaqueTxt1, [0, 0], 68, 16777215, "OswaldLocCurrency-Medium, arial, sans-serif", "center", 4, 0), D.anchor = new t.Point(.5, .5)), null === L && (L = r.addBasicText(w, n.i18n.Plinko.WinPlaqueTxt2, [0, 74], 54, 16777215, "OswaldLocCurrency-Medium, arial, sans-serif", "center", 3, 0), L.anchor = new t.Point(.5, .5)), F = i.lib._pkPlaqueWinAmount
                    }

                    function c() {
                        i.lib._pkRevealPlaqueTopLabel.setText(n.i18n.Plinko.RevealPlaqueTopLabel), r.autoFit(i.lib._pkRevealPlaqueTopLabel), i.lib._pkRevealPlaqueRevealLabel.setText(n.i18n.Plinko.RevealPlaqueRevealLabel), r.autoFit(i.lib._pkRevealPlaqueRevealLabel), i.lib._pkRevealPlaqueBottomLabel.setText(n.i18n.Plinko.RevealPlaqueBottomLabel), r.autoFit(i.lib._pkRevealPlaqueBottomLabel)
                    }

                    function h() {
                        i.lib._pbPlaqueTutorialLabel_1.setText(n.i18n.PunchABunch.TutorialPlaqueTxt_1), r.autoFit(i.lib._pbPlaqueTutorialLabel_1), i.lib._pbPlaqueSimpleLabel_1.setText(n.i18n.PunchABunch.SimplePlaqueTxt_1), r.autoFit(i.lib._pbPlaqueSimpleLabel_1), i.lib._pbPlaqueSimpleLabel_2.setText(n.i18n.PunchABunch.SimplePlaqueTxt_2), r.autoFit(i.lib._pbPlaqueSimpleLabel_2), null !== i.lib._pbPlaqueSimpleLabelPort_2 && void 0 !== i.lib._pbPlaqueSimpleLabelPort_2 && (i.lib._pbPlaqueSimpleLabelPort_2.setText(n.i18n.PunchABunch.SimplePlaquePortTxt_2), r.autoFit(i.lib._pbPlaqueSimpleLabelPort_2))
                    }

                    function d() {
                        i.lib._chPlaqueSimpleLabel_1.setText(n.i18n.CliffHanger.Play), r.autoFit(i.lib._chPlaqueSimpleLabel_1)
                    }

                    function p() {
                        D = r.addBasicText(ie, n.i18n.CliffHanger.Congratulations, [0, 0], 68, 16777215, "OswaldLocCurrency-Medium, arial, sans-serif", "center", 4, 0), D.anchor = new t.Point(.5, .5), L = r.addBasicText(ie, n.i18n.CliffHanger.Won, [0, 74], 54, 16777215, "OswaldLocCurrency-Medium, arial, sans-serif", "center", 3, 0), L.anchor = new t.Point(.5, .5)
                    }

                    function f() {
                        i.lib._bwPlaqueTopLabel.setText(n.i18n.BonusWheel.Congratulation), r.autoFit(i.lib._bwPlaqueTopLabel), i.lib._bwPlaqueMultiplierLabel.setText(n.i18n.BonusWheel.Multiplier), r.autoFit(i.lib._bwPlaqueMultiplierLabel), i.lib._bwPlaqueTotalBetLabel.setText(n.i18n.BonusWheel.TotalBet), r.autoFit(i.lib._bwPlaqueTotalBetLabel), me = i.lib._bwPlaqueTotalBetValue, me.setText("NNNN.NN"), r.autoFit(me)
                    }

                    function _() {
                        i.lib._maLabel.setText(n.i18n.Game.maxAwardCap), r.autoFit(i.lib._maLabel)
                    }

                    function m() {
                        i.lib._maLabel3.setText(n.i18n.Game.bonusComplete), r.autoFit(i.lib._maLabel3)
                    }

                    function g(e) {
                        O.visible = e, w.visible = e, I.visible = e
                    }

                    function v(e) {
                        N.visible = e, V.visible = e, k.visible = e, U.visible = e, G.visible = e
                    }

                    function y(e) {
                        j.visible = e, H.visible = e, W.visible = e, X.visible = e, Y.visible = e
                    }

                    function b(e) {
                        q.visible = e, K.visible = e, Q.visible = e, Z.visible = e
                    }

                    function x(e) {
                        J.visible = e, $.visible = e, ee.visible = e
                    }

                    function T(e) {
                        te.visible = e, ie.visible = e, re.visible = e, ne.visible = e, oe.visible = e, se.visible = e
                    }

                    function E(e) {
                        ae.visible = e, le.visible = e, ue.visible = e, ce.visible = e, he.visible = e, de.visible = e, pe.visible = e, fe.visible = e, _e.visible = e
                    }

                    function S(e) {
                        ge.visible = e, ve.visible = e, ye.visible = e
                    }

                    function P(e) {
                        be.visible = e
                    }

                    function A() {
                        Se = C(Ee), null !== Se ? Te = !1 !== Se.firstTimePunchABunch : (Se = {}, Te = !0)
                    }

                    function C(e) {
                        var t = null,
                            i = new RegExp("(?:^|; )" + encodeURIComponent(e) + "=([^;]*)").exec(document.cookie);
                        if (null != i && null != i[1]) try {
                            t = JSON.parse(i[1])
                        } catch (e) {
                            t = i ? i[1] : null
                        }
                        return t
                    }

                    function M(e, t) {
                        var i = new Date;
                        i.setTime(i.getTime() + 63072e7);
                        var r = "; expires=" + i.toUTCString();
                        document.cookie = e + "=" + JSON.stringify(t) + r + "; path=/"
                    }
                    var R = this,
                        O = i.lib._pkWinContent.pixiContainer,
                        w = i.lib._pkPlaqueTxtContainer.pixiContainer,
                        I = i.lib._pkWinAmountbkg.pixiContainer,
                        D = null,
                        L = null,
                        B = null,
                        F = null,
                        N = i.lib._pkRevealContent.pixiContainer,
                        V = i.lib._pkRevealPlaqueChip.pixiContainer,
                        k = i.lib._pkRevealPlaqueTopLabel.pixiContainer,
                        U = i.lib._pkRevealPlaqueRevealLabel.pixiContainer,
                        G = i.lib._pkRevealPlaqueBottomLabel.pixiContainer,
                        z = i.lib._pkRevealPlaqueTxtHighlight.pixiContainer,
                        j = i.lib._pbSimpleContent.pixiContainer,
                        H = i.lib._pbPlaqueSimpleLabel_1.pixiContainer,
                        W = i.lib._pbPlaqueSimpleLogo.pixiContainer,
                        X = i.lib._pbPlaqueSimpleLabel_2.pixiContainer,
                        Y = i.lib._pbPlaqueSimpleLabelPort_2.pixiContainer,
                        q = i.lib._pbTutorialContent.pixiContainer,
                        K = i.lib._pbPlaqueTutorialLogo.pixiContainer,
                        Q = i.lib._pbPlaqueTutorialLabel_1.pixiContainer,
                        Z = i.lib._pbPlaqueTutorialBtn.pixiContainer,
                        J = i.lib._chIntroContent.pixiContainer,
                        $ = i.lib._chPlaqueSimpleLabel_1.pixiContainer,
                        ee = i.lib._chPlaqueSimpleLogo.pixiContainer,
                        te = i.lib._chOutroContent.pixiContainer,
                        ie = i.lib._chPlaqueTxtContainer.pixiContainer,
                        re = i.lib._chPlaqueTxtContainer2.pixiContainer,
                        ne = i.lib._chWinAmountbkg.pixiContainer,
                        oe = i.lib._chPlaqueWinAmount.pixiContainer,
                        se = i.lib._chPlaqueSimpleLogo2.pixiContainer,
                        ae = i.lib._bwAwardContent.pixiContainer,
                        le = i.lib._bwPlaqueTopLabel.pixiContainer,
                        ue = i.lib._bwPlaqueMultiplierLabel.pixiContainer,
                        ce = i.lib._bwPlaqueValueImgContainer.pixiContainer,
                        he = i.lib._bwPlaqueTotalBetLabel.pixiContainer,
                        de = i.lib._bwPlaqueTotalBetValue.pixiContainer,
                        pe = i.lib._bwPlaqueLine.pixiContainer,
                        fe = i.lib._bwPlaqueTxtAnim.pixiContainer,
                        _e = i.lib._bwPlaqueTotalValue.pixiContainer,
                        me = null,
                        ge = i.lib._maContent.pixiContainer,
                        ve = i.lib._maLabel.pixiContainer,
                        ye = i.lib._maLabel2.pixiContainer,
                        be = i.lib._maLabel3.pixiContainer,
                        xe = "onBonus1End",
                        Te = !0,
                        Ee = "igt_tpir",
                        Se = null,
                        Pe = null,
                        Ae = null;
                    this.orientationChanged = function(e) {
                        if (Ae = e.orientation, "pkWin" === Pe || "chOutro" === Pe) {
                            var t = .8 * i.lib._genericPlaqueBackGround.pixiContainer.width;
                            0 !== i.lib._genericPlaqueBackGround.pixiContainer.rotation && (t = .75 * i.lib._genericPlaqueBackGround.pixiContainer.height), r.textFitWidth(D, t, !1), r.textFitWidth(L, t, !1)
                        }
                        "chOutro" === Pe && (B.scaleX = B.scaleY = "portrait" === Ae ? 1.5 : 2), "pbIntro" === Pe ? (null != i.lib._pbPlaqueTutorialLabel_1 && r.autoFit(i.lib._pbPlaqueTutorialLabel_1), null != i.lib._pbPlaqueSimpleLabel_1 && r.autoFit(i.lib._pbPlaqueSimpleLabel_1), null != i.lib._pbPlaqueSimpleLabel_2 && r.autoFit(i.lib._pbPlaqueSimpleLabel_2), null != i.lib._pbPlaqueSimpleLabelPort_2 && r.autoFit(i.lib._pbPlaqueSimpleLabelPort_2)) : "bwAward" === Pe ? (null != i.lib._bwPlaqueTopLabel && r.autoFit(i.lib._bwPlaqueTopLabel), null != i.lib._bwPlaqueMultiplierLabel && r.autoFit(i.lib._bwPlaqueMultiplierLabel), null != i.lib._bwPlaqueTotalBetLabel && r.autoFit(i.lib._bwPlaqueTotalBetLabel), null != i.lib._bwPlaqueTotalValue && r.autoFit(i.lib._bwPlaqueTotalValue), me && r.autoFit(me)) : "pkReveal" === Pe ? (null != i.lib._pkRevealPlaqueTopLabel && r.autoFit(i.lib._pkRevealPlaqueTopLabel), null != i.lib._pkRevealPlaqueRevealLabel && r.autoFit(i.lib._pkRevealPlaqueRevealLabel), null != i.lib._pkRevealPlaqueBottomLabel && r.autoFit(i.lib._pkRevealPlaqueBottomLabel)) : "chIntro" === Pe && null != i.lib._chPlaqueSimpleLabel_1 && r.autoFit(i.lib._chPlaqueSimpleLabel_1)
                    }, this.handleCurrentPlaque = function(n, C, M, O, w) {
                        if (Pe = n, null !== w && void 0 !== w || (w = !1), "pkWin" === Pe) {
                            u(), g(!0);
                            var D = s.formatBalance(s.fromStakeUnits(C));
                            F.setText(D), r.autoFit(F), e(I), xe = "onBonus1End", a().execute(xe)
                        } else if ("pkReveal" === Pe) e(z), c(), v(!0);
                        else if ("pbIntro" === Pe) A(), h(), O.enable = !0, i.lib._pbPlaqueTutorialBtn.pixiContainer.addChild(O), Te ? b(!0) : y(!0);
                        else if ("chIntro" === Pe) d(), x(!0);
                        else if ("chOutro" === Pe) p(), T(!0), e(ne);
                        else if ("bwAward" === Pe) {
                            f(), E(!0), i.lib._bwPlaqueValueImgContainer.pixiContainer.removeChildren();
                            var L = o.spriteFromTexture("bonusWheelWin_" + C.text.toLowerCase());
                            L.anchor = new t.Point(.5, .5), i.lib._bwPlaqueValueImgContainer.pixiContainer.addChild(L);
                            var B = s.formatBalance(s.fromStakeUnits(l.totalBet));
                            me.setText(B), r.autoFit(me);
                            var D = s.formatBalance(s.fromStakeUnits(C.totalPay));
                            i.lib._bwPlaqueTotalValue.setText(D), r.autoFit(i.lib._bwPlaqueTotalValue), e(fe)
                        } else "maxAward" === Pe ? (w ? (O.enable = !0, i.lib._maBtn.pixiContainer.visible = !0, i.lib._maBtn.pixiContainer.addChild(O)) : i.lib._maBtn.pixiContainer.visible = !1, S(!0), _()) : "maxAwardBonus" === Pe && (O.enable = !0, w ? (i.lib._maBtn.pixiContainer.visible = !0, i.lib._maBtn.pixiContainer.addChild(O)) : i.lib._maBtn.pixiContainer.visible = !1, S(!0), P(!0), _(), m());
                        if (null !== Ae && void 0 !== Ae) {
                            var N = {
                                orientation: Ae
                            };
                            R.orientationChanged(N)
                        }
                    }, this.handleShowDone = function(e) {
                        !Te && e && e(), Se.firstTimePunchABunch = !1, M(Ee, Se)
                    }, this.handleHideDone = function() {
                        null !== B && void 0 !== B && B.stop()
                    }, this.hideBaseContainers = function() {
                        g(!1), v(!1), y(!1), b(!1), x(!1), T(!1), E(!1), S(!1), P(!1)
                    }
                };
            return u.prototype.constructor = u, u
        }), define("game/components/plaque/genericPlaque", ["require", "com/pixijs/pixi", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/utils/textUtils", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "game/utils/miscUtils", "com/gsap/TweenMax", "game/components/chaseLight/chaseLightsController", "game/components/chaseLight/chaseLightPlaqueSpec", "game/components/basicButton", "game/commonUI/slot/betData", "game/components/plaque/plaqueContent"], function(e) {
            "use strict";
            var t = (e("com/pixijs/pixi"), e("skbJet/component/gladPixiRenderer/gladPixiRenderer")),
                i = (e("game/utils/textUtils"), e("skbJet/component/pixiResourceLoader/pixiResourceLoader"), e("game/utils/miscUtils")),
                r = e("com/gsap/TweenMax"),
                n = e("game/components/chaseLight/chaseLightsController"),
                o = e("game/components/chaseLight/chaseLightPlaqueSpec"),
                s = e("game/components/basicButton"),
                a = (e("game/commonUI/slot/betData"), e("game/components/plaque/plaqueContent")),
                l = function() {
                    function e() {
                        b.children.length < 2 ? (w = i.createMovieClip("plaqueModel_anim_", 0, 14, 3, .5, !1, !0), b.addChild(w)) : w = b.children[1]
                    }

                    function l() {
                        O = new n, O.init(o, T)
                    }

                    function u() {
                        A = new s, A.init({
                            enabled: "accept_button_static",
                            disabled: "accept_button_inactive",
                            over: "accept_button_over",
                            pressed: "accept_button_pressed"
                        }, _), A.x = 55, A.y = 50
                    }

                    function c() {
                        y.on("click", h, v), y.on("touchend", h, v)
                    }

                    function h() {
                        null !== R && R()
                    }

                    function d() {
                        D === I ? L.handleShowDone(C) : C && C()
                    }

                    function p(e) {
                        O.endCurrentAnimation(!0), y.visible = !1, w.stop(), y.y = g, L.handleHideDone(), e && e()
                    }

                    function f(e) {
                        y.visible = e, b.visible = e, T.visible = e, x.visible = e, L.hideBaseContainers()
                    }

                    function _() {
                        A.enable = !1, C && C(), C = null
                    }
                    var m, g, v = this,
                        y = t.lib._genericPlaque.pixiContainer,
                        b = t.lib._genericPlaqueGirlAnim.pixiContainer,
                        x = t.lib._genericPlaqueBackGround.pixiContainer,
                        T = t.lib._genericPlaqueLightsContainer.pixiContainer,
                        E = null,
                        S = null,
                        P = null,
                        A = null,
                        C = null,
                        M = null,
                        R = null,
                        O = null,
                        w = null,
                        I = "pbIntro",
                        D = null,
                        L = null;
                    this.systemInit = function() {
                        m = y.x, g = y.y, y.visible = !1, L = new a, e(), l(), c(), u()
                    }, this.showPlaque = function(e, t, i, n, o, s) {
                        null !== o && void 0 !== o || (o = 3e3), D = e, f(!0), L.handleCurrentPlaque(D, n, x, A, s), y.visible = !0, O.startAnimation("plaqueAnim", 0), w.loop = !0, w.play(), C = i, t ? (y.y = -y.height, E = r.to(y, .25, {
                            y: .8 * g,
                            ease: window.Linear.easeNone,
                            onComplete: function() {
                                E = r.to(y, .25, {
                                    y: g,
                                    ease: window.Back.easeOut.config(7),
                                    onComplete: function() {
                                        o > 0 ? S = setTimeout(function() {
                                            clearTimeout(S), E = null, S = null, d()
                                        }, o) : (E = null, S && (clearTimeout(S), S = null))
                                    }
                                })
                            }
                        })) : (y.y = g, C && C())
                    }, this.hidePlaque = function(e, t) {
                        M = t, y.y = g, e ? (y.visible = !0, P = r.to(y, .25, {
                            y: .8 * g,
                            ease: window.Back.easeIn.config(7),
                            onComplete: function() {
                                P = r.to(y, .25, {
                                    y: -y.height,
                                    ease: window.Linear.easeNone,
                                    onComplete: function() {
                                        P = null, p(t)
                                    }
                                })
                            }
                        })) : (O.endCurrentAnimation(!0), y.visible = !1, w.stop(), t && t())
                    }, Object.defineProperty(this, "onClick", {
                        set: function(e) {
                            null !== e && void 0 !== e ? (y.interactive = !0, y.buttonMode = !0, R = e) : (y.interactive = !1, y.buttonMode = !1, R = null)
                        }
                    }), this.orientationChanged = function(e) {
                        null !== E && (S && (clearTimeout(S), S = null), E.kill(), E = null, d()), null !== P && (P.kill(), P = null, p(M)), m = y.x, g = y.y, L.orientationChanged(e)
                    }
                };
            return l.prototype.constructor = l, l
        }), define("game/configs/spinSettingsConfig", [], function() {
            return {
                startSpinStrategy: {
                    startBounce: [1, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 56, 24],
                    startTicks: [0, 8, 16, 22, 30],
                    startTimer: [0, 0, 0, 0, 0, 0],
                    reelSpeed: [-3100, -3100, -3100, -3100, -3100],
                    stopLocations: null,
                    reelset: null
                },
                stopSpinStrategy: {
                    stopTicks: [0, 8, 16, 22, 30],
                    stopTimer: [0, 0, 0, 0, 0],
                    stopBounce: [-8, -6, -3, -2, 0],
                    reelSpeed: [-3100, -3100, -3100, -3100, -3100],
                    reelset: null,
                    stopLocations: null
                }
            }
        }), define("game/components/winSequence/symbolAnims", ["require", "com/pixijs/pixi", "com/gsap/TweenMax", "game/utils/miscUtils", "game/configs/baseReelConfig"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = e("com/gsap/TweenMax"),
                r = e("game/utils/miscUtils"),
                n = e("game/configs/baseReelConfig"),
                o = function() {
                    function e() {
                        var e = s.parent.id;
                        e.charAt(2) < 4 && "b" !== e.charAt(0) ? o.gotoAndStop(1) : o.gotoAndStop(0), s.play()
                    }
                    t.Container.call(this);
                    var o, s, a, l = null;
                    this.id = null, this.init = function(e) {
                        o = this, a = e, this.id = a
                    }, this.playDarken = function(e) {
                        if (o.removeChildren(), s = r.spriteFromTexture(n.spriteMap[a], "topLeft"), s.x = (n.symbolSlotWidth - s.width) / 2, s.y = (n.symbolSlotHeight - s.height) / 2, o.addChild(s), e > 0) {
                            var t = {
                                r: 255,
                                g: 255,
                                b: 255,
                                a: 1
                            };
                            i.to(t, e / 1e3, {
                                r: 128,
                                g: 128,
                                b: 128,
                                a: .5,
                                onUpdate: function() {
                                    s.tint = (t.r << 16) + (t.g << 8) + t.b, s.alpha = t.a
                                }
                            })
                        } else {
                            var t = {
                                r: 128,
                                g: 128,
                                b: 128,
                                a: .5
                            };
                            s.tint = (t.r << 16) + (t.g << 8) + t.b, s.alpha = t.a
                        }
                    }, this.playPreShow = function(e) {
                        o.removeChildren();
                        var t = 14;
                        "b01" === a && (t = 29), s = r.createMovieClip(a.toUpperCase() + "_anim_intro_", 0, t, 3, .5), s.x = (n.symbolSlotWidth - s.width) / 2, s.y = (n.symbolSlotHeight - s.height) / 2, s.loop = !1, o.addChild(s), e > 0 ? l = setTimeout(function() {
                            s.play()
                        }, e) : s.play()
                    }, this.playWinLoop = function() {
                        clearTimeout(l), o.removeChildren();
                        var t = .26;
                        "w01" === a && (t = .33), s = r.createMovieClip(a.toUpperCase() + "_anim_loop_", 0, 11, 3, t), s.x = (n.symbolSlotWidth - s.width) / 2, s.y = (n.symbolSlotHeight - s.height) / 2, s.loop = !1, s.onComplete = e, o.addChild(s), s.play()
                    }, this.playLand = function(e) {
                        o.removeChildren();
                        s = r.createMovieClip(a.toUpperCase() + "_anim_trigger_", 0, 9, 3, .5), s.x = (n.symbolSlotWidth - s.width) / 2, s.y = (n.symbolSlotHeight - s.height) / 2, s.loop = !0, o.addChild(s);
                        var t = 0;
                        s.onLoop = function() {
                            ++t >= 2 && (null !== s && void 0 !== s && "function" == typeof s.stop && s.stop(), o.setStatic(), e && e())
                        }, s.play()
                    }, this.setStatic = function() {
                        clearTimeout(l), o.removeChildren(), s = r.spriteFromTexture(a.toUpperCase() + "_Static"), s.x = (n.symbolSlotWidth - s.width) / 2, s.y = (n.symbolSlotHeight - s.height) / 2, o.addChild(s)
                    }, this.stop = function() {
                        null !== s && void 0 !== s && "function" == typeof s.stop && s.stop()
                    }, this.gotoAndStop = function(e) {
                        null !== s && void 0 !== s && "function" == typeof s.gotoAndStop && s.gotoAndStop(e)
                    }, this.stopAtLastFrame = function() {
                        var e = "014";
                        "b01" === a && (e = "029"), null !== s && void 0 !== s && "function" == typeof s.gotoAndStop && s.gotoAndStop(e)
                    }, this.preShowLastFrame = function() {
                        clearTimeout(l), o.removeChildren();
                        var e = "014";
                        "b01" === a && (e = "029"), s = r.spriteFromTexture(a.toUpperCase() + "_anim_intro_" + e), s.x = (n.symbolSlotWidth - s.width) / 2, s.y = (n.symbolSlotHeight - s.height) / 2, o.addChild(s)
                    }, this.clear = function() {
                        this.stop(), s = null, o.removeChildren(), l = null
                    }
                };
            return o.prototype = Object.create(t.Container.prototype), o.prototype.constructor = o, o
        }), define("game/components/winSequence/winBox", ["require", "com/pixijs/pixi", "game/utils/miscUtils"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = e("game/utils/miscUtils"),
                r = function() {
                    t.Container.call(this);
                    var e, r, n, o = 0,
                        s = null;
                    this.init = function() {
                        e = this, r = i.createMovieClip("WinBox_anim_", 0, 9, 3, .5), r.x = 0, r.y = 0, r.loop = !0, r.visible = !1, this.addChild(r), s = i.createMovieClip("TextHighlightAnim_", 0, 5, 3, .25), s.visible = !1, this.addChild(s), n = new t.extras.BitmapText("9", {
                            font: "80px Font4-export",
                            align: "center"
                        }), o = n.width, n.visible = !1, this.addChild(n)
                    }, this.showWin = function(e) {
                        n.text = e, n.visible = !0, s.visible = !0, e.length * o > r.width + 300 ? (n.width = r.width + 300, n.scaleY = n.scaleX) : n.scaleY = n.scaleX = 1, n.position.x = r.width / 2 - n.width / 2, n.position.y = r.height / 2 - n.height / 2, s.position.x = r.width / 2 - s.width / 2, s.position.y = r.height / 2 - s.height / 2
                    }, this.play = function(e, t) {
                        null !== e && void 0 !== e || (e = !0), null != r && e && (r.visible = !0, t && r.play()), null != s && s.visible && t && s.play()
                    }, this.stop = function() {
                        null != r && (r.visible = !1, r.stop()), null != n && (n.visible = !1), null != s && (s.visible = !1, s.stop())
                    }, this.clear = function() {
                        this.stop(), r = null, e.removeChildren()
                    }
                };
            return r.prototype = Object.create(t.Container.prototype), r.prototype.constructor = r, r
        }), define("game/components/winSequence/winSequence", ["require", "game/utils/miscUtils", "game/components/winSequence/symbolAnims", "game/components/winSequence/winBox", "skbJet/component/currencyHelper/currencyHelper", "game/components/createJsAudioPlayer/SoundManager", "game/configs/spinSettingsConfig", "game/commonUI/slot/betData"], function(e) {
            "use strict";
            var t = e("game/utils/miscUtils"),
                i = e("game/components/winSequence/symbolAnims"),
                r = e("game/components/winSequence/winBox"),
                n = e("skbJet/component/currencyHelper/currencyHelper"),
                o = e("game/components/createJsAudioPlayer/SoundManager"),
                s = e("game/configs/spinSettingsConfig"),
                a = e("game/commonUI/slot/betData"),
                l = function(e, l, u, c, h) {
                    function d() {
                        var e = 0;
                        for (var t in b) {
                            var i = b[t];
                            i.isWin ? (E = 0, i.anim.playPreShow(O || !R ? 100 * i.reelIndex : 0), !O && R || e !== i.reelIndex || (e++, T = setTimeout(function() {
                                o().execute("onPreshow" + (e + 1)), e++
                            }, 100 * i.reelIndex))) : i.anim.playDarken(300)
                        }
                        e = 0
                    }
                    var p, f = e,
                        _ = l,
                        m = u,
                        g = this,
                        v = c,
                        y = null,
                        b = null,
                        x = null,
                        T = null,
                        E = 0,
                        S = 0,
                        P = null,
                        A = null,
                        C = null,
                        M = null,
                        R = h || !1,
                        O = !1;
                    this.totalPayout = 0, this.multiplier = 0, this.bonusCount = 0, this.gameTotal = 0, this.init = function() {
                        P = m.symbolSlotWidth, A = m.symbolSlotHeight, C = m.symbolSpacingW, M = m.symbolSpacingH
                    }, this.setData = function(e) {
                        y = null;
                        var n = {};
                        this.bonusCount = 0, this.multiplier = 0;
                        var o;
                        if (Array.isArray(e.response.PopulationOutcome)) {
                            for (var l in e.response.PopulationOutcome)
                                if (e.response.PopulationOutcome[l]["@name"] === _ + ".Reels") {
                                    o = e.response.PopulationOutcome[l].Entry;
                                    break
                                }
                        } else o = e.response.PopulationOutcome.Entry;
                        if (null !== e.response.HighlightOutcome && void 0 !== e.response.HighlightOutcome) {
                            var u = [],
                                c = t.getElementFromName(e.response.HighlightOutcome, _ + ".Lines");
                            null !== c.Highlight && void 0 !== c.Highlight && (u = Array.isArray(c.Highlight) ? c.Highlight : [c.Highlight]);
                            var h = t.getElementFromName(e.response.HighlightOutcome, _ + ".Scatter");
                            if (null !== h && null !== h.Highlight && void 0 !== h.Highlight && (u = Array.isArray(h.Highlight) ? u.concat(h.Highlight) : u = u.concat([h.Highlight])), u.length > 0) {
                                var d = t.getElementFromName(e.response.PrizeOutcome, "Game.Total");
                                this.gameTotal = parseInt(d["@totalPay"]), d = t.getElementFromName(e.response.PrizeOutcome, _ + ".Lines"), this.totalPayout = parseInt(d["@totalPay"]), O = a.totalBet < (null !== h && null !== h.Highlight && void 0 !== h.Highlight ? this.gameTotal : this.totalPayout);
                                var p = [];
                                d.Prize && (p = Array.isArray(d.Prize) ? d.Prize : [d.Prize]);
                                for (var x = {}, T = 0; T < p.length; T++) x[p[T]["@name"]] = {
                                    pay: p[T]["@pay"],
                                    totalPay: p[T]["@totalPay"],
                                    betMultiplier: p[T]["@betMultiplier"],
                                    multiplier: p[T]["@multiplier"]
                                };
                                y = [];
                                for (var E = 0; E < u.length; E++) {
                                    for (var S = null != x[u[E]["@name"]] ? x[u[E]["@name"]].totalPay : 0, R = {
                                            lineName: u[E]["@name"],
                                            prizeValue: S,
                                            cellIDs: [],
                                            winCells: {}
                                        }, w = u[E].Cell, I = 0; I < w.length; I++) {
                                        var D = w[I]["@name"];
                                        R.cellIDs.push(D), n[D] = D;
                                        var L = D.charAt(3),
                                            B = D.charAt(5),
                                            F = o[L].Cell[B]["#text"];
                                        R.winCells[D] = F
                                    }
                                    y.push(R)
                                }
                                y.sort(function(e, t) {
                                    return t.prizeValue - e.prizeValue
                                })
                            }
                            for (var N in b) {
                                var V = b[N];
                                V.winBox.clear(), V.anim.clear()
                            }
                            v.removeChildren(), b = {};
                            for (var k = 0, U = 0; U < o.length; U++)
                                for (var G = o[U], I = 0; I < G.Cell.length; I++) {
                                    var D = G.Cell[I]["@name"],
                                        F = G.Cell[I]["#text"],
                                        z = null != n[D],
                                        j = F,
                                        H = m.options.clip[0].x + P * U + C * U,
                                        W = m.options.clip[0].y + A * I + M * I,
                                        X = new i;
                                    X.init(j), f.handleSymbolAnim(X), X.x = H, X.y = W;
                                    var Y = new r;
                                    Y.init(), Y.x = H, Y.y = W, v.addChild(Y), "b01" === j.toLowerCase() && (0 === U ? k = 1 : 2 === U ? k > 0 && (k = 2) : 4 === U && k > 1 && (k = 3)), b[G.Cell[I]["@name"]] = {
                                        reelIndex: U,
                                        cellIndex: I,
                                        cellName: G.Cell[I]["@name"],
                                        symbolId: j,
                                        isWin: z,
                                        anim: X,
                                        winBox: Y,
                                        bonusCount: k
                                    }
                                }
                            s.stopSpinStrategy.stopTimer = k >= 2 ? [0, 700, 1400, 2100, 4100] : k >= 1 ? [0, 700, 1400, 1700, 2e3] : [0, 0, 0, 0, 0], this.bonusCount = k
                        } else s.stopSpinStrategy.stopTimer = [0, 0, 0, 0, 0];
                        g.setMultiplier(e, "PunchABunchMultiplier")
                    }, this.setMultiplier = function(e, i) {
                        if (null !== e.response.MultiplierOutcome && void 0 !== e.response.MultiplierOutcome) {
                            var r = t.getElementFromName(e.response.MultiplierOutcome, i);
                            null !== r && void 0 !== r && null !== r.Multiplier && void 0 !== r.Multiplier && (this.multiplier = parseInt(r.Multiplier["#text"]))
                        }
                    }, this.startWin = function() {
                        S = 0, null != y ? (f.onWinStart(), d(), O || !R ? x = setTimeout(function() {
                            g.stopPreshow()
                        }, 800) : g.stopPreshow()) : x = setTimeout(function() {
                            f.onWinSequenceDone(!1)
                        }, 100)
                    }, this.darkenAllSymbols = function() {
                        for (var e in b) {
                            b[e].anim.playDarken(0)
                        }
                    }, this.stopPreshow = function() {
                        x && (clearTimeout(x), x = null), T && (clearTimeout(T), T = null);
                        for (var e in b) {
                            b[e].anim.stopAtLastFrame()
                        }
                        if (O || !R)
                            for (var t = 0; t < y.length; t++)
                                for (var i = 0; i < y[t].cellIDs.length; i++) b[y[t].cellIDs[i]].anim.playWinLoop();
                        f.onWinPreShowDone()
                    }, this.prepareWinLines = function() {
                        E = 0;
                        for (var e in b) {
                            b[e].anim.gotoAndStop(0)
                        }
                        if (!O && R)
                            for (var t = 0; t < y.length; t++)
                                for (var i = 0; i < y[t].cellIDs.length; i++) "w01" === y[t].winCells[y[t].cellIDs[i]] && (b[y[t].cellIDs[i]].anim.playWinLoop(), b[y[t].cellIDs[i]].anim.gotoAndStop(0))
                    }, this.playWinLines = function() {
                        for (var e = 0; e < y[E].cellIDs.length; e++) {
                            !O && R || b[y[E].cellIDs[e]].anim.playWinLoop();
                            if (y[E].cellIDs[e].indexOf("C2") >= 0) {
                                var t = n.formatBalance(n.fromStakeUnits(y[E].prizeValue)),
                                    i = b[y[E].cellIDs[e]].winBox;
                                v.children.length > 0 && v.setChildIndex(i, v.children.length - 1), "Scatter" === y[E].lineName && (t = n.formatBalance(n.fromStakeUnits(this.gameTotal - this.totalPayout))), i.showWin(t)
                            }
                            b[y[E].cellIDs[e]].winBox.play("b01" !== b[y[E].cellIDs[e]].symbolId, O || !R)
                        }
                        var r = 1200;
                        "scatter" === y[E].lineName.toLowerCase() && (r = 1600), p = y.length > 1 ? setTimeout(function() {
                            for (var e = 0; e < y[E].cellIDs.length; e++) !O && R || b[y[E].cellIDs[e]].anim.gotoAndStop(0), b[y[E].cellIDs[e]].winBox.stop(0);
                            E++, E >= y.length ? (E = 0, S++, f.onWinCyleDone(S)) : g.playWinLines()
                        }, r) : setTimeout(function() {
                            ++E >= y.length && (E = 0, S++, f.onWinCyleDone(S))
                        }, r)
                    }, this.handleWinSound = function() {
                        for (var e in y[0].winCells) {
                            switch (y[0].winCells[e]) {
                                case "w01":
                                    o().execute("onSymbolW01Win");
                                    break;
                                case "s01":
                                    o().execute("onSymbolS01Win");
                                    break;
                                case "s02":
                                    o().execute("onSymbolS02Win");
                                    break;
                                case "s03":
                                    o().execute("onSymbolS03Win");
                                    break;
                                default:
                                    o().execute("onSymbolMinorWin")
                            }
                            break
                        }
                    }, this.clear = function() {
                        g.gameTotal = 0, g.totalPayout = 0, g.stopWinSeq();
                        for (var e in b) {
                            var t = b[e];
                            t.winBox.clear(), t.anim.clear()
                        }
                        v.removeChildren()
                    }, this.stopWinSeq = function() {
                        clearTimeout(p), p = null
                    }, Object.defineProperty(this, "cellData", {
                        get: function() {
                            return b
                        }
                    }), Object.defineProperty(this, "winLineData", {
                        get: function() {
                            return y
                        }
                    })
                };
            return l.prototype.constructor = l, l
        }), define("game/utils/graphicUtils", ["require", "com/gsap/TweenMax"], function(e) {
            function t(e, t, i, r, n) {
                null !== r && void 0 !== r || (r = .3), null !== n && void 0 !== n || (n = f), p.to(e, r, {
                    x: t.x,
                    y: t.y,
                    ease: n,
                    onComplete: function() {
                        null !== i && void 0 !== i && i()
                    }
                })
            }

            function i(e, t, i, r, n) {
                null !== r && void 0 !== r || (r = .3), null !== n && void 0 !== n || (n = f), p.to(e, r, {
                    scaleX: t,
                    scaleY: t,
                    ease: n,
                    onComplete: function() {
                        null !== i && void 0 !== i && i()
                    }
                })
            }

            function r(e, t, i, r) {
                null !== r && void 0 !== r || (r = .3), null !== t && void 0 !== t || (t = !0), e.alpha = t ? 0 : 1, p.to(e, r, {
                    alpha: 1 ^ e.alpha,
                    onComplete: function() {
                        clearTimeout(this), null !== i && void 0 !== i && i()
                    }
                })
            }

            function n(e, t) {
                null !== t && void 0 !== t || (t = .3), p.to(e, t, {
                    alpha: 1 ^ e.alpha,
                    onComplete: function() {
                        p.to(e, t, {
                            alpha: 1 ^ e.alpha
                        })
                    }
                })
            }

            function o(e, t) {
                e.position.x = t.width / 2 - e.width / 2, e.position.y = t.height / 2 - e.height / 2
            }

            function s(e, t) {
                var i, r = t.x + t.width / 2;
                i = e.x;
                var n = i + e.width / 2;
                if (r > n) {
                    var o = r - n;
                    i += o
                } else if (r < n) {
                    var o = n - r;
                    i -= o
                }
                e.x = i
            }

            function a(e, t) {
                var i, r = t.y + t.height / 2;
                i = e.y;
                var n = i + e.height / 2;
                if (r > n) {
                    var o = r - n;
                    i += o
                } else if (r < n) {
                    var o = n - r;
                    i -= o
                }
                e.y = i
            }

            function l(e, t) {
                var i, r, n = e.x + e.width / 2,
                    o = e.y + e.height / 2;
                i = t.x, r = t.y;
                var s = i + t.width / 2,
                    a = r + t.height / 2;
                if (n > s) {
                    var l = n - s;
                    i += l
                } else if (n < s) {
                    var l = s - n;
                    i -= l
                }
                if (o > a) {
                    var u = o - a;
                    r += u
                } else if (o < a) {
                    var u = a - o;
                    r -= u
                }
                return {
                    x: i,
                    y: r
                }
            }

            function u(e) {
                e.pivot.x = e.width, e.scale.x = -e.scale.x, e.x += e.width
            }

            function c(e) {
                e.pivot.y = e.height, e.scale.y = -e.scale.y, e.y += e.height
            }

            function h(e) {
                e.pivot.x = e.width / 2, e.pivot.y = e.height / 2, e.x += e.width / 2, e.y += e.height / 2
            }

            function d(e, t) {
                t.y = e.y + e.height
            }
            var p = e("com/gsap/TweenMax"),
                f = window.Back.easeOut.config(2);
            return {
                tweenXYContainer: t,
                tweenScaleContainer: i,
                fadeContainer: r,
                pulseContainer: n,
                centerObject: o,
                centerX: s,
                centerY: a,
                setPositions: l,
                flipX: u,
                flipY: c,
                centerPivot: h,
                anchorBottom: d
            }
        }), define("game/components/winSequence/bigWinController", ["require", "game/utils/textUtils", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/utils/miscUtils", "game/utils/graphicUtils"], function(e) {
            "use strict";
            var t = e("game/utils/textUtils"),
                i = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                r = e("game/utils/miscUtils"),
                n = e("game/utils/graphicUtils"),
                o = function() {
                    function e() {
                        if (p = r.spriteFromTexture("bigWin_gradient"), p.width = _.width, p.height = _.height, m.addChild(p), h.length <= 0) {
                            for (var e = 0; e < 4; e++) d = r.createMovieClip("bigWin_particles_", 0, 14, 3, .5), n.centerObject(d, _), d.x -= d.width / 2, d.y -= d.height / 2, h.push(d);
                            n.flipX(h[1]), n.flipY(h[2]), n.flipX(h[3]), n.flipY(h[3])
                        }
                        for (var e = 0; e < h.length; e++) h[e].gotoAndStop(0), _.addChild(h[e]);
                        f = r.spriteFromTexture("sparkle"), f.scaleX = f.scaleY = 7, n.centerObject(f, _), f.pivot.x = 50, f.pivot.y = 50, f.x += 350, f.y += 350, _.addChild(f)
                    }

                    function o() {
                        c.text = v.bigWinTiers[l].text, c.position.x = u / 2 - c.width / 2
                    }
                    var s = this,
                        a = null,
                        l = null,
                        u = null,
                        c = null,
                        h = [],
                        d = null,
                        p = null,
                        f = null,
                        _ = null,
                        m = null,
                        g = null,
                        v = null;
                    this.currentOrientation = null, this.init = function(e, t) {
                        a = e, u = a.width, v = t, _ = i.lib._bigWinContainer.pixiContainer, m = i.lib._bigWinBGContainer.pixiContainer
                    }, this.setupBigWin = function(t, i) {
                        l = i, s.setBigWinText(t, l), c.visible = !0, a.addChild(c), e(), _.alpha = 1, _.scaleX = _.scaleY = .5, m.alpha = 1, n.tweenScaleContainer(_, 1, null, .2)
                    }, this.setBigWinText = function(e, i) {
                        c = t.addBasicText(a, v.bigWinTiers[e].text, [0, 0], 50 * (i + 1), [16776960, 16750336], "OswaldLocCurrency-Bold", "center", 6, 0), c.scaleX = c.scaleY = c.scaleY / (i + 1), c.style.dropShadow = !0, c.style.fill = ["#fffff6", "#ff9d00", "#ff9d00"], c.style.fillGradientStops = [.1, .7, .8], c.style.fillGradientType = 0, c.style.dropShadow = !0, c.style.dropShadowBlur = 5, c.style.dropShadowColor = "#9d0000", c.style.dropShadowAlpha = .7, c.style.dropShadowDistance = 0, c.position.x = u / 2 - c.width / 2, c.visible = !1, s.checkMaxScale(e)
                    }, this.playBigWinAnim = function() {
                        var e = 0;
                        g = setInterval(function() {
                            e++, r.rotateDegrees(f, e)
                        }, 20);
                        for (var t = 0; t < h.length; t++) h[t].gotoAndPlay(0)
                    }, this.fadeOutBigWin = function() {
                        o(), setTimeout(function() {
                            n.fadeContainer(_, !1), n.fadeContainer(m, !1)
                        }, 500)
                    }, this.handleBigWinStep = function(e) {
                        var t = v.bigWinTiers[e].scale;
                        null !== this.currentOrientation && void 0 !== this.currentOrientation && "portrait" === this.currentOrientation && s.checkMaxScale(e), c.text = v.bigWinTiers[e].text, c.position.x = u / 2 - c.width / 2, n.tweenScaleContainer(a, t), n.tweenScaleContainer(_, 3 * _.scaleX / 2, function() {
                            n.tweenScaleContainer(_, 2 * _.scaleX / 3, null, .2, window.Linear.easeNone)
                        }, .2, window.Linear.easeNone)
                    }, this.checkMaxScale = function(e) {
                        for (var t = 10, r = 0; r < v.bigWinTiers.length; r++) {
                            var n = v.bigWinTiers[r];
                            c.text = n.text;
                            var o = i.lib._chaseLightContainer.pixiContainer.width;
                            n.scale = (o - 150) / c.width, n.scale < t && (t = n.scale)
                        }
                        for (var r = 0; r < v.bigWinTiers.length; r++) {
                            var n = v.bigWinTiers[r];
                            c.text = n.text;
                            var s = v.bigWinTiers.length - 1,
                                a = t / 20;
                            n.scale = t - a * (s - r)
                        }
                        c.text = v.bigWinTiers[e].text
                    }, this.cleanUp = function() {
                        if (null !== c) {
                            clearInterval(g), g = null, _.removeChild(f), m.removeChild(p);
                            for (var e = 0; e < h.length; e++) h[e].gotoAndStop(0), _.removeChild(h[e]);
                            a.removeChild(c), c = null, this.maxScale = null
                        }
                    }
                };
            return o.prototype.constructor = o, o
        }), define("game/components/winSequence/rollUpController", ["require", "com/pixijs/pixi", "skbJet/component/currencyHelper/currencyHelper", "game/commonUI/slot/betData", "com/gsap/TweenMax", "game/components/createJsAudioPlayer/SoundManager", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "game/components/winSequence/bigWinController", "game/utils/miscUtils", "game/utils/graphicUtils"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = e("skbJet/component/currencyHelper/currencyHelper"),
                r = e("game/commonUI/slot/betData"),
                n = e("com/gsap/TweenMax"),
                o = e("game/components/createJsAudioPlayer/SoundManager"),
                s = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                a = e("game/components/winSequence/bigWinController"),
                l = e("game/utils/miscUtils"),
                u = e("game/utils/graphicUtils"),
                c = function(e) {
                    function c() {
                        "" !== T.customRollupName ? "onBonus2Rollup" === T.customRollupName && T.isBigWin ? (T.customRollupName = j = "onBonus2BigWin", o().execute(j + "Start")) : (o().execute(T.customRollupName + "Start"), T.isBigWin && (j = "onBigWin")) : T.isBigWin ? (j = "onBigWin", o().execute(j + "Start")) : T.isMidWin ? (j = "onRollup", 0 === W ? o().execute(j + "2Start") : o().execute(j + (W + 1) + "Start")) : (j = "onRollup", o().execute(j + (Z + 1) + "Start"))
                    }

                    function h() {
                        R = 0, G = l.createMovieClip("TextHighlightAnim_", 0, 5, 3, .25), C.addChild(G), E = new t.extras.BitmapText("9", {
                            font: "80px Font4-export",
                            align: "topLeft"
                        }), M = E.width, C.addChild(E), T.isBigWin ? re.setupBigWin(Z, W) : re.setBigWinText(Z, W), u.centerObject(G, C), u.centerObject(E, C), B = !0
                    }

                    function d() {
                        C.alpha = 1, null != G && G.visible && G.play(), $ = z.bigWinTiers[0].scale, p()
                    }

                    function p() {
                        T.isBigWin ? (C.scaleX = C.scaleY = $ / 4, u.tweenScaleContainer(C, $, y), re.playBigWinAnim()) : T.isMidWin ? (C.scaleX = C.scaleY = $ / 4, u.tweenScaleContainer(C, $, y)) : C.scaleX = C.scaleY = $
                    }

                    function f() {
                        var e = 1;
                        if (null != oe) var t = Date.now() - oe,
                            e = t / K;
                        if (oe = Date.now(), Q >= P) _();
                        else if (U && Q >= P / A) U = !1, g();
                        else {
                            J += K, Y < X.length ? Q += X[Y] * e : Q += X[q] * e;
                            try {
                                if (isNaN(Q)) throw clearInterval(te), te = null, Q = 0, "current Actual Value is NAN"
                            } catch (e) {}
                            T.isBigWin && Y < H.length && (Y >= z.bigWinTiers.length - 1 || Q >= r.totalBet * z.bigWinTiers[Y + 1].threshold) ? (J = 0, Y < H.length - 1 && (q = Y, Y++, Z++, o().execute(j + "Tier" + (Z + 1)), T.isBigWin && re.handleBigWinStep(Z))) : T.isMidWin && (Y >= z.rollupTiers.length - 1 || Q >= r.totalBet * z.rollupTiers[Y + 1].threshold) && (J = 0, Y < H.length - 1 && (q = Y, Y++, Z++)), Q >= P ? _() : (U && Q >= P / A && (Q = P / A), S = Math.round(Q), x())
                        }
                    }

                    function _() {
                        S = Math.round(P), x(), $ = z.bigWinTiers[W].scale, T.isBigWin && re.fadeOutBigWin(), m(), C.scaleX = C.scaleY = $, v(), clearInterval(te), te = null, ie = setTimeout(function() {
                            u.fadeContainer(C, !1, b)
                        }, 500)
                    }

                    function m() {
                        "" !== T.customRollupName ? o().execute(T.customRollupName + "End") : T.isBigWin ? o().execute(j + "End") : T.isMidWin && (0 === W ? o().execute(j + "2End") : o().execute(j + (W + 1) + "End"))
                    }

                    function g() {
                        T.pauseRollup(), m(), N()
                    }

                    function v() {
                        oe = null, S = 0, Q = 0, clearInterval(te), te = null, X.length = 0, Y = 0, q = 0, Z = 0, W = 0, T.customRollupName = "", j = ""
                    }

                    function y() {
                        V = !0, k && _()
                    }

                    function b() {
                        clearTimeout(ie), ie = null, F(), T.cleanUp()
                    }

                    function x() {
                        null != E && (E.text = i.formatBalance(i.fromStakeUnits(S)), R !== E.text.length && (0 === R ? D = 1 : D -= .1, E.width = O, E.scaleX > D && (E.scaleX = D), E.scaleY = E.scaleX, E.position.x = O / 2 - E.width / 2, R = E.text.length))
                    }
                    var T, E = null,
                        S = 0,
                        P = 0,
                        A = 1,
                        C = null,
                        M = 0,
                        R = 0,
                        O = 0,
                        w = 0,
                        I = 1,
                        D = 1,
                        L = null,
                        B = !1,
                        F = null,
                        N = null,
                        V = !1,
                        k = !1,
                        U = !1,
                        G = null,
                        z = {
                            rollUpStepCount: 20,
                            midWinThreshold: 2,
                            bigWinMin: 1e3,
                            bigWinThreshold: 15,
                            bigWinTiers: [{
                                threshold: 15,
                                text: s.i18n.BigWin.bigWin,
                                speed: 1,
                                scale: 2,
                                time: [3e3]
                            }, {
                                threshold: 30,
                                text: s.i18n.BigWin.hugeWin,
                                speed: 1,
                                scale: 2.25,
                                time: [2400, 3600]
                            }, {
                                threshold: 60,
                                text: s.i18n.BigWin.epicWin,
                                speed: 1,
                                scale: 2.5,
                                time: [3e3, 3600, 5400]
                            }, {
                                threshold: 120,
                                text: s.i18n.BigWin.massiveWin,
                                speed: 1,
                                scale: 2.75,
                                time: [2e3, 4e3, 6e3, 8e3]
                            }, {
                                threshold: 300,
                                text: s.i18n.BigWin.colossalWin,
                                speed: 1,
                                scale: 3,
                                time: [2400, 3600, 5400, 7800, 10800]
                            }],
                            rollupTiers: [{
                                threshold: 2,
                                time: [1e3]
                            }, {
                                threshold: 4,
                                time: [2e3]
                            }, {
                                threshold: 6,
                                time: [3e3]
                            }]
                        },
                        j = "",
                        H = [],
                        W = 0,
                        X = [],
                        Y = 0,
                        q = 0,
                        K = 5,
                        Q = 0,
                        Z = 0,
                        J = 0,
                        $ = 0,
                        ee = null,
                        te = null,
                        ie = null,
                        re = null,
                        ne = e || !1;
                    this.isBigWin = !1, this.isMidWin = !1, this.customRollupName = "", this.init = function(e, t, i, r) {
                        T = this, C = e, F = t, N = i, O = C.width, w = C.height, null !== r && void 0 !== r && (z = r), re = new a, re.init(C, z)
                    }, this.rollUp = function(e, t) {
                        if (this.cleanUp(), r.totalBet < e || !ne) {
                            if (T.isBigWin = e >= r.totalBet * z.bigWinThreshold && e > z.bigWinMin, T.isMidWin = e >= r.totalBet * z.midWinThreshold && !T.isBigWin, U = null !== t && void 0 !== t && t > 1, A = U ? t : 1, T.isBigWin)
                                for (var i = 0; i < z.bigWinTiers.length; i++) e >= r.totalBet * z.bigWinTiers[i].threshold && (H = z.bigWinTiers[i].time, W = i);
                            else if (T.isMidWin)
                                for (var i = 0; i < z.rollupTiers.length; i++) e >= r.totalBet * z.rollupTiers[i].threshold && (H = z.rollupTiers[i].time, W = i);
                            else H = z.rollupTiers[0].time;
                            if (V = !1, k = !1, R = 0, P = e, S = parseInt(r.betPerPattern), I = (P - S) / z.rollUpStepCount, B = !1, h(), x(), T.isBigWin)
                                for (var n = 0, i = 0; i < H.length; i++) {
                                    var s, a = H[i] / K;
                                    i >= H.length - 1 ? s = (P - n) / a : (s = (r.totalBet * z.bigWinTiers[i + 1].threshold - n) / a, n = r.totalBet * z.bigWinTiers[i + 1].threshold), X.push(s)
                                } else if (T.isMidWin)
                                    for (var n = 0, i = 0; i < H.length; i++) {
                                        var s, a = H[i] / K;
                                        i >= H.length - 1 ? s = (P - n) / a : (s = (r.totalBet * z.rollupTiers[i + 1].threshold - n) / a, n = r.totalBet * z.rollupTiers[i + 1].threshold), X.push(s)
                                    } else X.push(P / 2);
                            c(), te = setInterval(function() {
                                f()
                            }, K), d()
                        } else o().execute("onRollupLow"), F()
                    }, this.handleRollupTier = function(e) {
                        T.isBigWin = e >= r.totalBet * z.bigWinThreshold && e > z.bigWinMin, T.isMidWin = e >= r.totalBet && !T.isBigWin
                    }, this.skip = function(e) {
                        null !== ie && void 0 !== ie && (clearTimeout(ie), ie = null), n.killTweensOf(C), V = !0, k = !0, B || h(), _()
                    };
                    var oe = null;
                    this.continueRollup = function() {
                        c(), T.resumeRollup()
                    }, this.pauseRollup = function() {
                        clearInterval(te), te = null
                    }, this.resumeRollup = function() {
                        te = setInterval(function() {
                            f()
                        }, K)
                    }, this.cleanUp = function() {
                        B = !1, V = !1, k = !1, null !== L && (clearTimeout(L), L = null), null !== E && (C.removeChild(E), E = null), null !== G && (C.removeChild(G), G = null), T.isBigWin && re.cleanUp(), C.scaleX = C.scaleY = 1
                    }, this.orientationChanged = function(e) {
                        ee = e.orientation, re.currentOrientation = ee, null !== G && void 0 !== G && null !== E && void 0 !== E && (re.checkMaxScale(Z), u.centerObject(G, C), u.centerObject(E, C), C.scaleX = C.scaleY = z.bigWinTiers[Z].scale)
                    }
                };
            return c.prototype.constructor = c, c
        }), define("game/views/controls/autoplayController", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "game/data/stateEvents", "game/data/gameEvents", "game/commonUI/slot/slotUI"], function(e) {
            "use strict";
            var t = e("skbJet/component/gameMsgBus/GameMsgBus"),
                i = e("game/data/stateEvents"),
                r = e("game/data/gameEvents"),
                n = e("game/commonUI/slot/slotUI"),
                o = null,
                s = function() {
                    function e(e) {
                        "FreeSpin.exitStage" === e.state ? (n.baseGame.autoSpin.active = !1, n.baseGame.autoSpin.count = 0) : "BaseGame.beginNewGame" === e.state && (n.baseGame.autoSpin.active || (n.baseGame.autoSpin.enabled = !0))
                    }
                    this.getSpinsRemaining = function() {
                        return n.baseGame.autoSpin.count
                    }, this.subscribe = function() {
                        t.subscribe(i.STATE_CHANGED, e), t.subscribe("UI.AutoSpinStart", this.doNextSpin)
                    }, this.unsubscribe = function() {
                        t.unsubscribe(i.STATE_CHANGED, e), t.unsubscribe("UI.AutoSpinStart", this.doNextSpin)
                    }, this.doNextSpin = function() {
                        o = setTimeout(function() {
                            clearTimeout(o), o = null, n.baseGame.autoSpin.active ? i.publish(i.START_BASE_SPIN) : r.publish(r.AUTOPLAY_STOPPED_DURING_DELAY)
                        }, 500)
                    }, this.clearTimer = function() {
                        null !== o && void 0 !== o && (clearTimeout(o), o = null)
                    }, this.disableAutoSpin = function() {
                        n.baseGame.autoSpin.active = !1, n.baseGame.autoSpin.count = 0
                    }
                };
            return s.prototype.constructor = s, s
        }), define("game/views/controls/uiController", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "game/commonUI/slot/slotUI", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "skbJet/component/currencyHelper/currencyHelper"], function(e) {
            "use strict";
            var t = e("skbJet/component/gameMsgBus/GameMsgBus"),
                i = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                r = e("game/commonUI/slot/slotUI"),
                n = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                o = e("skbJet/component/currencyHelper/currencyHelper"),
                s = function(e, a, l) {
                    this.stage = l, this.msgBus = t, this.buttonPressedEvent = "buttonpress", this.delegate = e;
                    var u = null;
                    s.prototype.init = function() {
                        u = i.i18n.UI, r.setText(u), n.lib._ui.pixiContainer.addChild(r.container), r.set({
                            gameLayer: n.lib._gameLayer.pixiContainer
                        }), this.showStage = !1, this.enableButtonControls(!1)
                    }, s.prototype.initControls = function(e) {
                        this.showStage = !0, this.enableSpinControls(!0)
                    }, s.prototype.initGameControls = function() {}, s.prototype.subscribeToMsgBus = function() {}, s.prototype.unsubscribeToMsgBus = function() {}, s.prototype.addEvents = function() {
                        var e = this.delegate.onSpinPressed.bind(this);
                        this.stage.spin.on("buttonpress", function() {
                            e()
                        });
                        var t = this.delegate.onSkipPressed.bind(this);
                        this.stage.skip.on("buttonpress", function() {
                            t()
                        })
                    }, s.prototype.removeEvents = function() {
                        this.enableButtonControls(!1), this.stage.spin.off(this.buttonPressedEvent), this.stage.skip.off(this.buttonPressedEvent), this.stage.play.off(this.buttonPressedEvent)
                    }, s.prototype.onEndGame_handler = function(e) {
                        this.stage.footer.win.value = "", e > 0 && this.updateMeter(this.stage.footer.win, e)
                    }, s.prototype.updateMeter = function(e, t) {
                        e.value = o.formatBalance(o.fromStakeUnits(t))
                    }, this.enableSpinControls = function(e) {
                        this.enableSpinButton = e, this.showSpinButton = e
                    }, this.enableSkipControls = function(e) {
                        this.enableSkipButton = e, this.showSkipButton = e
                    }, this.enablePlayControls = function(e) {
                        this.enablePlayButton = e, this.showPlayButton = e
                    }, this.enableButtonControls = function(e) {
                        this.enableSpinControls(e), this.enableSkipControls(e), this.enablePlayControls(e)
                    }, Object.defineProperty(this, "enableSpinButton", {
                        get: function() {
                            return this.stage.spin.enabled
                        },
                        set: function(e) {
                            this.stage.spin.enabled = e
                        }
                    }), Object.defineProperty(this, "showSpinButton", {
                        get: function() {
                            return this.stage.spin.visible
                        },
                        set: function(e) {
                            this.stage.spin.visible = e
                        }
                    }), Object.defineProperty(this, "enableSkipButton", {
                        get: function() {
                            return this.stage.skip.enabled
                        },
                        set: function(e) {
                            this.stage.skip.enabled = e
                        }
                    }), Object.defineProperty(this, "showSkipButton", {
                        get: function() {
                            return this.stage.skip.visible
                        },
                        set: function(e) {
                            this.stage.skip.visible = e
                        }
                    }), Object.defineProperty(this, "enablePlayButton", {
                        get: function() {
                            return this.stage.play.enabled
                        },
                        set: function(e) {
                            this.stage.play.enabled = e
                        }
                    }), Object.defineProperty(this, "showPlayButton", {
                        get: function() {
                            return this.stage.play.visible
                        },
                        set: function(e) {
                            this.stage.play.visible = e
                        }
                    }), Object.defineProperty(this, "showStage", {
                        get: function() {
                            return this.stage.visible
                        },
                        set: function(e) {
                            this.stage.visible = e
                        }
                    })
                };
            return s.prototype.constructor = s, s
        }), define("game/views/controls/baseGameUIController", ["require", "com/gsap/TweenMax", "game/views/controls/autoplayController", "game/views/controls/uiController", "game/core/PlatformManager", "game/data/stateEvents", "game/commonUI/slot/betData", "game/components/createJsAudioPlayer/SoundManager", "com/gsap/plugins/PixiPlugin"], function(e) {
            "use strict";
            var t = e("com/gsap/TweenMax"),
                i = e("game/views/controls/autoplayController"),
                r = e("game/views/controls/uiController"),
                n = e("game/core/PlatformManager"),
                o = e("game/data/stateEvents"),
                s = e("game/commonUI/slot/betData"),
                a = e("game/components/createJsAudioPlayer/SoundManager");
            e("com/gsap/plugins/PixiPlugin");
            var l = function(e, l, u) {
                function c() {
                    null !== E && void 0 !== E || (E = new i)
                }

                function h(e) {
                    for (var t = 0; t < e.children.length; t++) null != e.children[t].plus && (x.plus = e.children[t].plus), null != e.children[t].minus && (x.minus = e.children[t].minus);
                    x.available = !0, x.plus.on(b.buttonPressedEvent, function() {
                        S.onBetChanged("plus"), s.betPerPattern === parseInt(s.betInfo[s.betInfo.length - 1]) ? a().execute("onUiBetMax") : a().execute("onUiBetUp")
                    }), x.minus.on(b.buttonPressedEvent, function() {
                        S.onBetChanged("minus"), a().execute("onUiBetDown")
                    })
                }

                function d(e) {}

                function p(e) {}

                function f(e) {}

                function _() {
                    n().enableGameInfo(!1), S.clearWinPresentation()
                }

                function m(e) {
                    T = !0, a().execute("onUiAutoPlaySelect"), v()
                }

                function g() {
                    n().enableGameInfo(!0), a().execute("onUiAutoPlayClose")
                }

                function v() {
                    null !== b.stage.footer.betPerPattern && void 0 !== b.stage.footer.betPerPattern ? b.enableBetControls(b.enableSpinButton) : b.enableMenuControls(b.enableSpinButton), b.enableControls(b.enableSpinButton), b.enableSpinButton && E.clearTimer()
                }

                function y() {
                    return b.isAutoSpinActive && E.getSpinsRemaining() > 0
                }
                r.call(this, e, l, u);
                var b = this,
                    x = {
                        available: !1
                    },
                    T = !1,
                    E = null,
                    S = e;
                this.initControls = function(e) {
                    this.showStage = !0, this.enableSpinControls(!0), this.initGameControls(e);
                    var t = this.stage.footer,
                        i = this.stage.betConfig;
                    if (t.children.length > 0) {
                        h(t);
                        var r = i.controls.children[4] ? 4 : 1;
                        i.controls.children[r].children[2].on(b.buttonPressedEvent, function() {
                            S.onBetChanged("plus"), s.betPerPattern === parseInt(s.betInfo[s.betInfo.length - 1]) ? a().execute("onUiBetMax") : a().execute("onUiBetUp")
                        }), i.controls.children[r].children[3].on(b.buttonPressedEvent, function() {
                            S.onBetChanged("minus"), a().execute("onUiBetDown")
                        })
                    }
                    i.openButton.on(b.buttonPressedEvent, function() {
                        a().execute("onUiOptionsOpen"), S.onBetOpen(!0)
                    }), i.closeButton.on(b.buttonPressedEvent, function() {
                        a().execute("onUiOptionsClose"), S.onBetOpen(!1)
                    })
                }, this.initGameControls = function(e) {
                    r.prototype.initGameControls(e), c(), this.addEvents()
                }, this.addEvents = function() {
                    r.prototype.addEvents.bind(b)(), b.stage.spin.on(b.buttonPressedEvent, function() {
                        b.enableSpinButton = !1, a().execute("onUiSpin"), o.publish(o.START_BASE_SPIN), b.stage.autoSpin.enabled = !1, b.stage.betConfig.enabled = !1
                    }), b.stage.skip.visible = !1, b.stage.skip.on(b.buttonPressedEvent, function() {
                        b.enableSkipButton = !1
                    }), b.stage.play.visible = !1, b.stage.play.on(b.buttonPressedEvent, function() {}), E.subscribe(), b.stage.autoSpin._startButton.on(b.buttonPressedEvent, function() {
                        a().execute("onUiAutoPlayOpen")
                    })
                }, this.removeEvents = function() {
                    r.prototype.removeEvents.bind(b)(), b.stage.spin.off(this.buttonPressedEvent), b.stage.skip.off(this.buttonPressedEvent), b.stage.play.off(this.buttonPressedEvent), E.unsubscribe(), b.stage.autoSpin._startButton.off(b.buttonPressedEvent, function() {
                        a().execute("onUiAutoPlayOpen")
                    })
                }, this.subscribeToMsgBus = function() {
                    this.msgBus.subscribe("UI.BetConfigOpen", d), this.msgBus.subscribe("UI.BetUp", p), this.msgBus.subscribe("UI.BetDown", f), this.msgBus.subscribe("UI.AutoSpinDialogueOpen", _), this.msgBus.subscribe("UI.AutoSpinStart", m), this.msgBus.subscribe("UI.AutoSpinDialogueClose", g), this.msgBus.subscribe("UI.AutoSpinStop", v)
                }, this.unsubscribeToMsgBus = function() {
                    this.msgBus.unsubscribe("UI.BetConfigOpen", d), this.msgBus.unsubscribe("UI.BetUp", p), this.msgBus.unsubscribe("UI.BetDown", f), this.msgBus.unsubscribe("UI.AutoSpinDialogueOpen", _), this.msgBus.unsubscribe("UI.AutoSpinStart", m), this.msgBus.unsubscribe("UI.AutoSpinDialogueClose", g), this.msgBus.unsubscribe("UI.AutoSpinStop", v), this.removeEvents()
                }, this.startSpin = function() {
                    a().execute("onBaseGameSpinStart"), this.enableControls(!1), y() && E.clearTimer()
                }, this.onBeginNewGame_handler = function() {
                    y() ? (this.enableControls(!1), this.enableSpinButton = !0) : (this.enableControls(!0), this.startSpinButtonTimeout())
                }, this.startSpinButtonTimeout = function() {
                    this.stage.spin.visible && this.stage.spin.enabled && (t.killTweensOf(this.checkSpinButtonAvailableToStartMusicTimeout), t.delayedCall(5, this.checkSpinButtonAvailableToStartMusicTimeout))
                }, this.checkSpinButtonAvailableToStartMusicTimeout = function() {
                    b.stage.spin.visible && b.stage.spin.enabled && a().execute("onBaseMusicLoopFadeOut")
                }, this.startNextAutoSpin = function() {
                    E.doNextSpin()
                }, this.enableControls = function(e) {
                    this.enableSpinButton = e, this.enableAutoSpinButton = e, n().enableControls(e)
                }, this.enableBetControls = function(e) {
                    var t = b.stage.footer;
                    t.betPerPattern.enabled = e, t.patternsBet.enabled = e, t.totalBet.enabled = e
                }, this.enableMenuControls = function(e) {
                    this.stage.betConfig.enabled = e
                }, Object.defineProperty(this, "enableAutoSpinButton", {
                    get: function() {
                        return this.stage.autoSpin.enabled
                    },
                    set: function(e) {
                        this.stage.autoSpin.enabled = e
                    }
                }), Object.defineProperty(this, "showAutoSpinButton", {
                    get: function() {
                        return this.stage.autoSpin.visible
                    },
                    set: function(e) {
                        this.stage.autoSpin.visible = e
                    }
                }), Object.defineProperty(this, "isAutoSpinActive", {
                    get: function() {
                        return this.stage.autoSpin.active
                    },
                    set: function(e) {
                        e || E.disableAutoSpin(), this.stage.autoSpin.active = e
                    }
                })
            };
            return l.prototype = Object.create(r.prototype), l.prototype.constructor = l, l
        }), define("game/views/core/slotGameSVC", ["require", "com/pixijs/pixi", "game/views/core/gameSVC", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/data/stateEvents", "com/gsap/TweenMax", "game/components/reelSetController", "game/components/plaque/genericPlaque", "game/configs/spinSettingsConfig", "game/components/winSequence/winSequence", "game/components/winSequence/rollUpController", "game/views/controls/baseGameUIController", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = e("game/views/core/gameSVC"),
                r = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                n = e("game/data/stateEvents"),
                o = e("com/gsap/TweenMax"),
                s = e("game/components/reelSetController"),
                a = e("game/components/plaque/genericPlaque"),
                l = e("game/configs/spinSettingsConfig"),
                u = e("game/components/winSequence/winSequence"),
                c = e("game/components/winSequence/rollUpController"),
                h = e("game/views/controls/baseGameUIController"),
                d = e("game/components/createJsAudioPlayer/SoundManager"),
                p = function() {
                    function e() {
                        n.publish(n.FROM_ABORT_NEXT_STAGE)
                    }
                    i.call(this);
                    var f = this;
                    this.stageName = null, this.stage = null, this.nextStage = null, this.currentStage = null, this.uiView = null, this.gameContainer = null, this.reelSetController = null, this.winSequence = null, this.reelsContainer = null, this.rollUpController = null, this.winlineContainer = null, this.winBoxContainer = null, this.bonusLayer = null, this.preshowComplete = !1, this.rollupComplete = !1, this.firstCycleComplete = !1, this.winCycleComplete = !1, this.isWin = !1, this.containers = {}, this.reelsConfig = null, this.isExitStage = !1, this.blackTint = null;
                    var _ = null;
                    p.prototype.systemInit = function(e, t) {
                            i.prototype.systemInit(e), this.setContainers(), this.initControllers(e, t), this.initBlackTint(), _ = new a, _.systemInit()
                        }, p.prototype.setContainers = function() {
                            for (var e in f.containers) {
                                switch (e) {
                                    case "gameContainer":
                                        f.gameContainer = f.containers[e];
                                        break;
                                    case "reelsContainer":
                                        f.reelsContainer = f.containers[e];
                                        break;
                                    case "winlineContainer":
                                        f.winlineContainer = f.containers[e];
                                        break;
                                    case "winBoxContainer":
                                        f.winBoxContainer = f.containers[e];
                                        break;
                                    case "bonusLayer":
                                        f.bonusLayer = f.containers[e]
                                }
                                f.containers[e].visible = !1
                            }
                        }, p.prototype.initBlackTint = function() {
                            if (f.blackTint = r.lib._blackTintContainer.pixiContainer, 0 === f.blackTint.children.length) {
                                var e = new t.Graphics;
                                e.beginFill(0), e.drawRect(0, 0, 10, 10), f.blackTint.addChild(e)
                            }
                            var i = r.getPixiRenderer();
                            f.blackTint.width = i.view.width, f.blackTint.height = i.view.height, f.blackTint.alpha = 0, f.blackTint.visible = !1
                        }, p.prototype.initControllers = function(e, t) {
                            f.setUIView(), f.setReelsController(e), f.setWinSequence(t), f.setRollupController(t)
                        }, p.prototype.setUIView = function() {
                            f.uiView = new h(f, f.stageName, f.stage), f.uiView.init()
                        }, p.prototype.setReelsController = function(e) {
                            f.reelSetController = new s(f.reelsContainer, f.reelsConfig, l), f.reelSetController.init(e)
                        }, p.prototype.setWinSequence = function(e) {
                            f.winSequence = new u(f, f.stageName, f.reelsConfig, f.winBoxContainer, e), f.winSequence.init()
                        }, p.prototype.setRollupController = function(e) {
                            f.rollUpController = new c(e), f.rollUpController.init(r.lib._rollupContainer.pixiContainer, f.onRollUpDone, f.onRollupSegmentDone)
                        }, p.prototype.stageInit = function(e, t, r) {
                            i.prototype.stageInit(e, t), null !== r && void 0 !== r || (r = !0), f = t, null != f.winlineContainer && (f.winlineContainer.visible = !0), null != f.winBoxContainer && (f.winBoxContainer.visible = !0), f.nextStage = e.response.OutcomeDetail.NextStage, f.currentStage = e.response.OutcomeDetail.Stage, r && f.reelSetController.setReelSet(e), f.uiView.initControls(e)
                        }, p.prototype.subscribeToMsgBus = function(e) {
                            i.prototype.subscribeToMsgBus.bind(this)(), f.uiView.subscribeToMsgBus()
                        }, p.prototype.unsubscribeToMsgBus = function(e) {
                            i.prototype.unsubscribeToMsgBus.bind(this)(), f.uiView.unsubscribeToMsgBus()
                        }, p.prototype.onGameInit = function(e) {
                            i.prototype.onGameInit(e)
                        }, p.prototype.onBeforeRequest = function(e) {
                            f.clearWinPresentation(), f.uiView.startSpin(), f.reelSetController.startSpin(function() {
                                n.publish(n.FROM_BEFORE_REQUEST)
                            })
                        }, p.prototype.clearContainers = function() {
                            null != f.bonusLayer && f.bonusLayer.removeChildren(), null != f.winlineContainer && f.winlineContainer.removeChildren()
                        }, p.prototype.clearWinPresentation = function() {
                            f.resetFlags(), f.winSequence.clear(), f.stage.footer.win.value = "", f.clearContainers(), null != f.winlineContainer && f.winlineContainer.removeChildren(), f.stopRollup(), f.reelSetController.showAllSymbols(!0)
                        }, p.prototype.onResolveStage = function(e) {
                            f.nextStage = e.response.OutcomeDetail.NextStage, f.currentStage = e.response.OutcomeDetail.Stage, f.currentStage !== f.nextStage ? f.isExitStage = !0 : f.isExitStage = !1, f.isMaxAwardReached(e)
                        }, p.prototype.onWinSequenceDone = function(e) {
                            f.isWin = e, f.uiView.enableSkipControls(!1)
                        }, p.prototype.onExitStage = function(e) {
                            f.winSequence.clear(), f.uiView.removeEvents(), f.unsubscribeToMsgBus()
                        }, p.prototype.onAbortNextStage = function(t) {
                            f.reelSetController.cancelSpin(e);
                            f.uiView.onEndGame_handler("")
                        }, p.prototype.onResetNextStage = function(e) {
                            f.uiView.onBeginNewGame_handler()
                        }, p.prototype.onTransitionDone = function(e) {
                            i.prototype.onTransitionDone(e), n.publish(n.FROM_EXIT_STAGE)
                        }, p.prototype.reelStateUpdate = function(e, t) {
                            "BOUNCE" === t ? f.onReelLandBounce(e) : "STOPPED" === t && f.onReelLandStopped(e)
                        }, p.prototype.onReelLandBounce = function(e) {}, p.prototype.onReelLandStopped = function(e) {}, p.prototype.onSpinDone = function() {
                            f.winSequence.startWin(), f.reelSetController.pauseSpinTick()
                        }, this.hide = function(e, t) {
                            var i = !0;
                            t && (i = t), i ? (f.blackTint.alpha = 0, f.blackTint.visible = !0, f.gameContainer.visible = !0, o.to(f.blackTint, 1, {
                                alpha: 1,
                                onComplete: function() {
                                    f.gameContainer.visible = !1, e && e()
                                }
                            })) : (f.gameContainer.visible = !1, f.blackTint.alpha = 1, f.blackTint.visible = !0)
                        },
                        this.show = function(e, t) {
                            f.blackTint.alpha = 1, f.blackTint.visible = !0, f.gameContainer.visible = !0;
                            var i = !0;
                            t && (i = t), i ? o.to(f.blackTint, 1, {
                                alpha: 0,
                                onComplete: function() {
                                    f.blackTint.visible = !1, e && e()
                                }
                            }) : (f.blackTint.alpha = 0, f.blackTint.visible = !1)
                        }, this.showMaxAwardPlaque = function(e, t) {
                            var i = "maxAward";
                            null !== e && void 0 !== e && !0 === e && (i = "maxAwardBonus"), f.uiView.enableControls(!1), f.uiView.enableSkipControls(!0), r.lib._maLabel2.setText(f.awardCap), d().execute("onAwardCap"), _.showPlaque(i, !0, function() {
                                null !== t && void 0 !== t && t()
                            }, null, 0, !1)
                        }, this.hideMaxAwardPlaque = function() {
                            _.hidePlaque(!0, function() {})
                        }, this.handleSymbolAnim = function(e) {
                            null != f.bonusLayer && "b01" === e.id.toLowerCase() ? f.bonusLayer.addChild(e) : null != f.winlineContainer && f.winlineContainer.addChild(e)
                        }, this.onWinStart = function() {
                            f.reelSetController.showAllSymbols(!1), f.uiView.enableSkipControls(!0)
                        }, this.onWinPreShowDone = function() {
                            f.preshowComplete = !0, f.playRollUp()
                        }, this.onWinRollUpDone = function() {
                            f.winSequence.prepareWinLines(), f.winSequence.playWinLines(), f.winSequence.handleWinSound()
                        }, p.prototype.onWinCyleDone = function(e) {
                            e > 0 && (f.firstCycleComplete = !0)
                        }, p.prototype.playRollUp = function() {
                            f.rollUpController.rollUp(f.winSequence.totalPayout, f.winSequence.multiplier)
                        }, this.skipRollup = function() {
                            f.rollUpController.skip(f.winSequence.totalPayout)
                        }, p.prototype.stopRollup = function() {
                            null != f.rollUpController && f.rollUpController.cleanUp()
                        }, p.prototype.onRollUpDone = function() {
                            f.rollupComplete = !0, f.onWinRollUpDone(), f.onWinSequenceDone(!0)
                        }, p.prototype.onRollupSegmentDone = function() {}, p.prototype.onSpinPressed = function() {
                            f.currentStateEvent === n.FROM_ABORT_NEXT_STAGE && n.publish(n.FROM_RESET_NEXT_STAGE)
                        }, p.prototype.onSkipPressed = function() {
                            f.isMaxAward ? (f.uiView.enableControls(!0), f.uiView.enableSkipControls(!1), f.hideMaxAwardPlaque()) : f.preshowComplete ? f.rollupComplete || (f.uiView.enableSkipControls(!1), f.skipRollup()) : (f.uiView.enableSkipControls(!1), f.winSequence.stopPreshow(), f.skipRollup())
                        }, p.prototype.resetFlags = function() {
                            f.preshowComplete = !1, f.rollupComplete = !1, f.winCycleComplete = !1, f.firstCycleComplete = !1, f.winSequence.totalPayout = 0, f.isMaxAward = !1, f.isWin = !1
                        }, p.prototype.orientationChanged = function(e) {
                            i.prototype.orientationChanged(e), f.rollUpController.orientationChanged(e);
                            var t = r.getPixiRenderer();
                            f.blackTint.width = t.view.width, f.blackTint.height = t.view.height
                        }
                };
            return p.prototype = Object.create(i.prototype), p.prototype.constructor = p, p
        }), define("game/components/doorAnim", ["require", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "com/pixijs/pixi", "game/utils/miscUtils", "com/gsap/TweenMax"], function(e) {
            "use strict";
            var t = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                i = e("com/pixijs/pixi"),
                r = e("game/utils/miscUtils"),
                n = e("com/gsap/TweenMax"),
                o = function() {
                    function e(e) {
                        var t = d.close - d.open,
                            i = d.open + t * e;
                        l.x = i;
                        var t = p.close - p.open,
                            i = p.open + t * e;
                        u.x = i;
                        var r = Math.floor(15 * e);
                        e < .99 ? (c.gotoAndStop(r), h.gotoAndStop(r)) : (c.visible = !1, h.visible = !1)
                    }

                    function o() {
                        var e = new i.Container,
                            t = r.spriteFromTexture("DoorLeft_static_000");
                        e.addChild(t);
                        var n = r.spriteFromTexture("DoorRight_static_000");
                        n.x = t.x + t.width, e.addChild(n);
                        var o = r.spriteFromTexture("DoorLeft_static_000");
                        return o.x = n.x + n.width, e.addChild(o), c = r.createMovieClip("LeftDoorTransition_anim_", 0, 14, 3, 1), c.gotoAndStop(0), c.x = o.x + o.width - 1, e.addChild(c), e
                    }

                    function s() {
                        var e = new i.Container;
                        h = r.createMovieClip("RightDoorTransition_anim_", 0, 14, 3, 1), h.x = 1 - h.width, h.gotoAndStop(0), e.addChild(h);
                        var t = r.spriteFromTexture("DoorRight_static_000");
                        t.x = 0, e.addChild(t);
                        var n = r.spriteFromTexture("DoorLeft_static_000");
                        n.x = t.x + t.width, e.addChild(n);
                        var o = r.spriteFromTexture("DoorRight_static_000");
                        return o.x = n.x + n.width, e.addChild(o), e
                    }
                    var a = null,
                        l = null,
                        u = null,
                        c = null,
                        h = null,
                        d = null,
                        p = null;
                    this.init = function() {
                        a = t.lib._bgDoorsContainer.pixiContainer, u = s(), a.addChild(u), l = o(), a.addChild(l);
                        d = {
                            open: -644,
                            close: t.getSize().width / 2 - 774
                        }, p = {
                            open: t.getSize().width - 130,
                            close: t.getSize().width / 2
                        }, this.openDoors(!1, null)
                    }, this.openDoors = function(t, i) {
                        if (t) {
                            c.visible = !0, h.visible = !0;
                            var r = {
                                value: 1
                            };
                            n.to(r, .5, {
                                value: 0,
                                ease: window.Linear.easeNone,
                                onUpdate: function() {
                                    e(r.value)
                                },
                                onComplete: function() {
                                    null != i && i()
                                }
                            })
                        } else l.x = d.open, u.x = p.open, c.gotoAndStop(0), c.visible = !0, h.gotoAndStop(0), c.visible = !0, null != i && i()
                    }, this.closeDoors = function(t, i) {
                        if (t) {
                            var r = {
                                value: 0
                            };
                            n.to(r, .5, {
                                value: 1,
                                ease: window.Linear.easeNone,
                                onUpdate: function() {
                                    e(r.value)
                                },
                                onComplete: function() {
                                    c.visible = !1, h.visible = !1, null != i && i()
                                }
                            })
                        } else l.x = d.close, u.x = p.close, c.gotoAndStop(14), c.visible = !1, h.gotoAndStop(14), h.visible = !1, null != i && i()
                    }
                };
            return o.prototype.constructor = o, o
        }), define("game/components/multiplierAnim", ["require", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/utils/miscUtils", "com/gsap/TweenMax", "game/utils/textUtils", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "game/utils/graphicUtils"], function(e) {
            "use strict";
            var t = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                i = e("game/utils/miscUtils"),
                r = e("com/gsap/TweenMax"),
                n = e("game/utils/textUtils"),
                o = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                s = e("game/utils/graphicUtils"),
                a = function(e) {
                    function a() {
                        P = i.spriteFromTexture("cliffHanger_multiplierPlaque"), P.visible = !1, A = i.spriteFromTexture("cliffHanger_multiplierPlaqueGlow"), A.visible = !1, C = i.createMovieClip("multiplierParticles_", 0, 14, 3, .37), C.visible = !1, M = i.createMovieClip("multiplierParticlesExplode_", 0, 14, 3, .37), M.visible = !1, R = i.createMovieClip("multiplierParticlesExplode_", 0, 14, 3, .37), R.visible = !1
                    }

                    function l() {
                        null !== W && void 0 !== W ? (P.width = 231, P.height = 336, "landscape" === W ? c() : u(), h()) : d()
                    }

                    function u() {
                        P.x = 80, P.y = 820, C.scaleX = -2, C.scaleY = -2, C.x = S.width / 2, C.y = S.height, i.rotateDegrees(C, -45), C.x += 400, C.y -= 200
                    }

                    function c() {
                        P.x = 2.3, P.y = 21.2, C.scaleX = -2, C.scaleY = 2, C.x = S.width / 2, C.y = 0, i.rotateDegrees(C, 0)
                    }

                    function h() {
                        U = 20, G = 0, z = -7, j = 30, D = n.addBasicText(P, "X", [0, 0], 75, [16777215], "OswaldLocCurrency-Bold", "center", 3, 0), I = n.addBasicText(P, o.i18n.CliffHanger.SpinRemaining, [0, 0], 30, [16777215], "OswaldLocCurrency-Bold", "center", 3, 0, 30), O = n.addBasicText(P, "X", [0, 0], 75, [16777215], "OswaldLocCurrency-Bold", "center", 3, 0), w = n.addBasicText(S, o.i18n.PunchABunch.multiplier, [0, 0], 30, [16777215], "OswaldLocCurrency-Bold", "center", 3, 0)
                    }

                    function d() {
                        P.x += 22, P.y = S.height - P.height - 81.85, U = 15, G = 37, z = 10, j = 15, C.scaleX = -2, C.scaleY = -2, C.x = S.width / 2, C.y = S.height, D = n.addBasicText(P, "X", [0, 0], 65, [16777215], "OswaldLocCurrency-Bold", "center", 3, 0), I = n.addBasicText(P, o.i18n.CliffHanger.SpinRemaining, [0, 0], 25, [16777215], "OswaldLocCurrency-Bold", "center", 3, 0, 30), O = n.addBasicText(P, "X", [0, 0], 65, [16777215], "OswaldLocCurrency-Bold", "center", 3, 0), w = n.addBasicText(S, o.i18n.PunchABunch.multiplier, [0, 0], 25, [16777215], "OswaldLocCurrency-Bold", "center", 3, 0)
                    }

                    function p() {
                        O = n.addBasicText(S, "10x", [0, 0], 65, [16777215], "OswaldLocCurrency-Bold", "center", 3, 0), O.visible = !1, w = n.addBasicText(S, o.i18n.PunchABunch.multiplier, [0, 0], 25, [16777215], "OswaldLocCurrency-Bold", "center", 3, 0), w.visible = !1
                    }

                    function f() {
                        S.addChild(P), S.addChild(A), S.addChild(O), S.addChild(w), S.addChild(C), S.addChild(M), S.addChild(R)
                    }

                    function _() {
                        P.x += F, P.y = S.height - P.height - N
                    }

                    function m(e) {
                        var t = s.setPositions(P, e);
                        e.x = t.x, e.y = t.y
                    }

                    function g() {
                        v(), y()
                    }

                    function v() {
                        var e = s.setPositions(P, A);
                        A.x = e.x, A.y = e.y;
                        var t = 15;
                        e = s.setPositions(P, O), O.x = e.x, O.y = e.y - t, t = 30, e = s.setPositions(P, w), w.x = e.x, w.y = e.y + t
                    }

                    function y() {
                        C.scaleX = 2, C.scaleY = 2, M.scaleX = 2, M.scaleY = 2, R.scaleX = 2, R.scaleY = 2;
                        var e = s.setPositions(P, C);
                        C.x = e.x, C.y = e.y, V = C.x += P.width, k = C.y -= P.height, s.centerObject(M, S), M.x -= M.width / 2, M.y += 80, R.x = M.x, R.y = M.y, s.flipX(R), R.x = M.x
                    }

                    function b() {
                        clearTimeout(H), M.visible = !0, R.visible = !0, M.loop = !1, M.onComplete = T.explodeAnimComplete, M.play(), R.loop = !1, R.play()
                    }

                    function x() {
                        C.x = V, C.y = k, C.gotoAndStop(0)
                    }
                    var T = this,
                        E = e,
                        S = null,
                        P = null,
                        A = null,
                        C = null,
                        M = null,
                        R = null,
                        O = null,
                        w = null,
                        I = null,
                        D = null,
                        L = null,
                        B = null,
                        F = 40,
                        N = 60,
                        V = null,
                        k = null,
                        U = null,
                        G = null,
                        z = null,
                        j = null,
                        H = null,
                        W = null;
                    this.init = function(e) {
                        S = null !== e && void 0 !== e ? e : t.lib._multiplierAnimContainer.pixiContainer, a(), p(), f(), _(), g()
                    }, this.setPlaque = function() {
                        S.removeChild(P), S.removeChild(O), S.removeChild(w), S.removeChild(D), S.removeChild(I), P = i.spriteFromTexture("cliffHanger_spinsAwardedPlaque"), P.visible = !0, S.addChildAt(P, 0), l(), O.visible = !0, w.visible = !0, S.addChild(D), S.addChild(I), S.addChild(O), m(I), m(D), m(O), m(w), D.y = P.y + U, s.anchorBottom(D, I), s.anchorBottom(I, O), s.anchorBottom(O, w), O.y += G, w.y += z, s.centerPivot(I), s.centerPivot(D), s.centerPivot(O)
                    }, this.setMultiplier = function(e) {
                        O.text = e + "x", B = e
                    }, this.adjustMultiplier = function() {
                        m(O), s.anchorBottom(I, O), s.centerPivot(O), O.y -= j
                    }, this.setSpinsText = function(e) {
                        D.text = e, I.text = o.i18n.CliffHanger.SpinsRemaining, e <= 1 && (D.text = "1", I.text = o.i18n.CliffHanger.SpinRemaining), m(D), m(I), D.y = P.y + U, s.anchorBottom(D, I), s.centerPivot(D), s.centerPivot(I), L = e
                    }, this.scaleMultiplier = function() {
                        s.tweenScaleContainer(O, 1.1, function() {
                            s.tweenScaleContainer(O, 1, function() {
                                s.tweenScaleContainer(O, 1.1, function() {
                                    s.tweenScaleContainer(O, 1, function() {})
                                })
                            })
                        })
                    }, this.scaleSpins = function() {
                        s.tweenScaleContainer(D, 1.1, function() {
                            s.tweenScaleContainer(D, 1, function() {})
                        }), s.tweenScaleContainer(I, 1.1, function() {
                            s.tweenScaleContainer(I, 1, function() {})
                        })
                    }, this.playIntro = function(e) {
                        T.setMultiplier(e);
                        var t = s.setPositions(P, O);
                        O.x = t.x, P.scaleX = P.scaleY = .1, P.visible = !0, P.alpha = 1, O.visible = !0, O.alpha = 0, w.visible = !0, w.alpha = 0, s.tweenScaleContainer(P, 1), setTimeout(function() {
                            s.fadeContainer(O, !0), s.fadeContainer(w, !0)
                        }, 200)
                    }, this.playAnim = function() {
                        A.visible = !0, C.visible = !0, s.fadeContainer(A, !0, function() {
                            s.fadeContainer(A, !1), C.loop = !1, C.onComplete = T.animComplete, C.play(), H = setTimeout(function() {
                                b()
                            }, 500)
                        })
                    }, this.playLoopExplode = function() {
                        C.visible = !0, C.loop = !1, C.onComplete = T.animLoopComplete, C.play()
                    }, this.playGlowAnim = function() {
                        A.visible = !0, s.fadeContainer(A, !0, function() {
                            s.fadeContainer(A, !1)
                        })
                    }, this.stopAnim = function() {
                        x(), A.visible = !1, C.visible = !1, r.killTweensOf(P), r.killTweensOf(O), r.killTweensOf(w)
                    }, this.showContainers = function() {
                        P.visible = !0, O.visible = !0, w.visible = !0
                    }, this.hideContainers = function() {
                        A.visible = !1, C.visible = !1, P.visible = !1, O.visible = !1, w.visible = !1
                    }, this.hidePlaqueContainers = function() {
                        D.visible = !1, I.visible = !1
                    }, this.animComplete = function() {
                        T.stopAnim(), null != E && E.multiplierAnimComplete()
                    }, this.animLoopComplete = function() {
                        C.gotoAndStop(0), null != E && E.multiplierAnimComplete()
                    }, this.explodeAnimComplete = function() {
                        M.gotoAndStop(0), R.gotoAndStop(0), M.visible = !1, R.visible = !1
                    }, this.fadeOut = function() {
                        s.fadeContainer(P, !1), s.fadeContainer(O, !1), s.fadeContainer(w, !1)
                    }, this.orientationChanged = function(e) {
                        W = e.orientation, T.setPlaque(), T.setMultiplier(B), T.adjustMultiplier(), T.setSpinsText(L)
                    }
                };
            return a.prototype.constructor = a, a
        }), define("game/components/winSequence/bonusChaseLightController", ["require"], function(e) {
            "use strict";
            var t = function() {
                function e() {
                    i.startAnimation("bonus_landAnticipation_three", 0, null, !1, !1)
                }
                var t = null,
                    i = null,
                    r = -1;
                this.init = function(e) {
                    t = this, i = e
                }, this.update = function(t) {
                    switch (t) {
                        case 1:
                            r = 1, i.startAnimation("bonus_land_one", 1, null, !1, !1);
                            break;
                        case 2:
                            r = 2, i.startAnimation("bonus_land_two", 1, e, !1, !1)
                    }
                }, this.reverse = function() {
                    switch (r) {
                        case 0:
                            r = -1, i.turnOff();
                            break;
                        case 1:
                            r = 0, i.startAnimation("bonus_land_one", 1, t.reverse, !1, !0, 10);
                            break;
                        case 2:
                        case 3:
                            r = 1, i.startAnimation("bonus_land_two", 1, t.reverse, !1, !0)
                    }
                }
            };
            return t.prototype.constructor = t, t
        }), define("game/views/help/confirmCheck", ["require", "com/pixijs/pixi"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = function() {
                    function e() {
                        o = !o, i.texture = o ? n : r
                    }
                    t.Sprite.call(this, t.Texture.EMPTY);
                    var i = this,
                        r = null,
                        n = null,
                        o = null;
                    this.init = function(s) {
                        o = s, n = t.Texture.fromFrame("tutorial_check"), r = t.Texture.fromFrame("tutorial_checkBox"), i.texture = o ? n : r, i.on("click", e), i.on("touchend", e)
                    }, this.IsChecked = function() {
                        return o
                    }
                };
            return i.prototype = Object.create(t.Sprite.prototype), i.prototype.constructor = i, i
        }), define("game/views/help/helpView", ["require", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "skbJet/component/gameMsgBus/GameMsgBus", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "com/gsap/TweenMax", "game/utils/miscUtils", "game/utils/textUtils", "game/data/gameEvents", "game/components/basicButton", "game/views/help/confirmCheck", "game/components/chaseLight/chaseLightsController", "game/components/chaseLight/chaseLightManager"], function(e) {
            "use strict";
            var t = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                i = e("skbJet/component/gameMsgBus/GameMsgBus"),
                r = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                n = e("com/gsap/TweenMax"),
                o = e("game/utils/miscUtils"),
                s = e("game/utils/textUtils"),
                a = e("game/data/gameEvents"),
                l = e("game/components/basicButton"),
                u = e("game/views/help/confirmCheck"),
                c = e("game/components/chaseLight/chaseLightsController"),
                h = e("game/components/chaseLight/chaseLightManager"),
                d = function() {
                    function e() {
                        f(), p()
                    }

                    function d() {
                        b || (v.alpha = 0, v.x = 80, v.y = -500, n.to(v, .5, {
                            alpha: 1,
                            y: -30
                        }), v.visible = !0), E = new c, E.init(h().GetSpec("PlaqueSpec"), r.lib._tutorialChaseLightContainer.pixiContainer), E.startAnimation("plaqueAnim", 0), g(), r.lib._tutorialPunchABunchImage.pixiContainer.removeChildren(), r.lib._tutorialPunchABunchImage.pixiContainer.addChild(S), r.lib._tutorialPlinkoImage.pixiContainer.removeChildren(), r.lib._tutorialPlinkoImage.pixiContainer.addChild(P), r.lib._tutorialCliffHangersImage.pixiContainer.removeChildren(), r.lib._tutorialCliffHangersImage.pixiContainer.addChild(A), S.gotoAndPlay(0)
                    }

                    function p() {
                        x = new u, x.init(!1), x.x = 0, x.y = 0, x.interactive = !0, x.visible = !0, r.lib._tutorialConfirmCheck.pixiContainer.addChild(x)
                    }

                    function f() {
                        y = new l, y.init({
                            enabled: "accept_button_static",
                            disabled: "accept_button_inactive",
                            over: "accept_button_over",
                            pressed: "accept_button_pressed"
                        }, _), y.x = 55, y.y = 50, y.visible = !0, r.lib._tutorialBtn.pixiContainer.addChild(y)
                    }

                    function _() {
                        n.to(v, .5, {
                            alpha: 0,
                            y: -100,
                            onComplete: function() {
                                y.enable = !1, v.visible = !1, x.IsChecked() && (b = !0, m("Tutorial", "Off")), E.endCurrentAnimation(!0), S.stop(), P.stop(), A.stop(), T()
                            }
                        })
                    }

                    function m(e, t) {
                        var r = {};
                        r[e] = t, i.publish(a.PLATFORM_TO_PLATFORM, {
                            channel: "Game",
                            topic: "Game.GameInfo",
                            data: {
                                Preference: r
                            }
                        })
                    }

                    function g() {
                        S = o.createMovieClip("punchABunch_tutorial_", 0, 29, 3, .5), S.loop = !1, S.anchor.x = .5, S.anchor.y = .5, S.interactive = !1, S.onComplete = function() {
                            setTimeout(function() {
                                P.gotoAndPlay(0)
                            }, 250)
                        }, P = o.createMovieClip("plinko_tutorial_", 0, 29, 3, .5), P.loop = !1, P.anchor.x = .5, P.anchor.y = .5, P.interactive = !1, P.onComplete = function() {
                            setTimeout(function() {
                                A.gotoAndPlay(0)
                            }, 250)
                        }, A = o.createMovieClip("cliffHangers_tutorial_", 0, 29, 3, .5), A.loop = !1, A.anchor.x = .5, A.anchor.y = .5, A.interactive = !1, A.onComplete = function() {
                            setTimeout(function() {
                                S.gotoAndPlay(0)
                            }, 250)
                        }
                    }
                    var v = null,
                        y = null,
                        b = !1,
                        x = null,
                        T = null,
                        E = null,
                        S = null,
                        P = null,
                        A = null;
                    this.init = function(n, o) {
                        v = r.lib._tutorialPlaque.pixiContainer, b = o, r.lib._tutorialPunchABunchLabelTitle.setText(t.i18n.Tutorial.PunchABunchTitle), s.autoFit(r.lib._tutorialPunchABunchLabelTitle, !0), r.lib._tutorialPlinkoLabelTitle.setText(t.i18n.Tutorial.PlinkoTitle), s.autoFit(r.lib._tutorialPlinkoLabelTitle, !0), r.lib._tutorialCliffHangersLabelTitle.setText(t.i18n.Tutorial.CliffHangersTitle), s.autoFit(r.lib._tutorialCliffHangersLabelTitle, !0), r.lib._tutorialPunchABunchLabelInfo.setText(t.i18n.Tutorial.PunchABunchInfo), s.autoFit(r.lib._tutorialPunchABunchLabelInfo, !0), r.lib._tutorialPlinkoLabelInfo.setText(t.i18n.Tutorial.PlinkoInfo), s.autoFit(r.lib._tutorialPlinkoLabelInfo, !0), r.lib._tutorialCliffHangersLabelInfo.setText(t.i18n.Tutorial.CliffHangersInfo), s.autoFit(r.lib._tutorialCliffHangersLabelInfo, !0), r.lib._tutorialConfirmInfo.setText(t.i18n.Tutorial.NoShow), s.autoFit(r.lib._tutorialConfirmInfo, !0), T = n, v.visible = !1, i.subscribe(a.GAME_INIT, e), i.subscribe(a.ON_START_GAME_INITIAL, d)
                    }, this.getIsDisabled = function() {
                        return b
                    }, this.getIsShowing = function() {
                        return v.visible
                    }, this.orientationChanged = function(e) {
                        s.autoFit(r.lib._tutorialPunchABunchLabelTitle, !0), s.autoFit(r.lib._tutorialPlinkoLabelTitle, !0), s.autoFit(r.lib._tutorialCliffHangersLabelTitle, !0), s.autoFit(r.lib._tutorialPunchABunchLabelInfo, !0), s.autoFit(r.lib._tutorialPlinkoLabelInfo, !0), s.autoFit(r.lib._tutorialCliffHangersLabelInfo, !0), s.autoFit(r.lib._tutorialConfirmInfo, !0)
                    }
                };
            return d.prototype.constructor = d, d
        }), define("game/views/baseGameSVC", ["require", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/data/gameEvents", "game/data/setupData", "game/data/stateEvents", "game/components/createJsAudioPlayer/SoundManager", "game/components/winSequence/anticipationAnim", "game/commonUI/slot/slotUI", "game/views/core/slotGameSVC", "game/components/doorAnim", "game/components/multiplierAnim", "game/configs/baseReelConfig", "game/components/winSequence/bonusChaseLightController", "game/views/help/helpView", "game/utils/graphicUtils"], function(e) {
            "use strict";
            var t = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                i = e("game/data/gameEvents"),
                r = e("game/data/setupData"),
                n = e("game/data/stateEvents"),
                o = e("game/components/createJsAudioPlayer/SoundManager"),
                s = e("game/components/winSequence/anticipationAnim"),
                a = e("game/commonUI/slot/slotUI"),
                l = e("game/views/core/slotGameSVC"),
                u = e("game/components/doorAnim"),
                c = e("game/components/multiplierAnim"),
                h = e("game/configs/baseReelConfig"),
                d = e("game/components/winSequence/bonusChaseLightController"),
                p = e("game/views/help/helpView"),
                f = e("game/utils/graphicUtils"),
                _ = function() {
                    function e() {
                        E.reelSetController.showAllSymbols(!1), E.winSequence.darkenAllSymbols()
                    }

                    function _() {
                        E.currentStage === E.stageName && E.nextStage !== r.BONUS_WHEEL && (N.getIsDisabled() ? (M.startAnimation("init", 1, null, !0), b()) : (null !== E.uiView.stage.footer.betPerPattern && void 0 !== E.uiView.stage.footer.betPerPattern ? E.uiView.enableBetControls(!1) : E.uiView.stage.visible = !1, E.uiView.enableControls(!1)))
                    }

                    function m() {
                        E.uiView.enableControls(!0), null !== E.uiView.stage.footer.betPerPattern && void 0 !== E.uiView.stage.footer.betPerPattern ? E.uiView.enableBetControls(!0) : E.uiView.stage.visible = !0, M.startAnimation("init", 1, null, !0), o().execute("onIntroStart"), b()
                    }

                    function g() {
                        return (E.nextStage === r.PUNCH_A_BUNCH_ACCEPT_REJECT || E.nextStage === r.PUNCH_A_BUNCH) && E.currentStage === r.BASE_GAME
                    }

                    function v() {
                        return (E.currentStage === r.PUNCH_A_BUNCH_ACCEPT_REJECT || E.currentStage === r.PUNCH_A_BUNCH) && E.nextStage === r.BASE_GAME
                    }

                    function y() {
                        return E.currentStage !== r.BASE_GAME && E.nextStage === r.BASE_GAME
                    }

                    function b(e) {
                        null !== e && void 0 !== e || (e = 5e3), null === V && (V = setTimeout(function() {
                            M.startAnimation("idle", 1, function() {
                                clearTimeout(V), V = null, b(2e3 * Math.random() + 4e3)
                            }, !0, !1)
                        }, e))
                    }

                    function x() {
                        null !== V && (M.endCurrentAnimation(!0), clearTimeout(V), V = null)
                    }

                    function T(e) {
                        f.fadeContainer(E.uiView.stage, e, function() {
                            E.uiView.stage.visible = e
                        }, .5)
                    }
                    l.call(this);
                    var E = this,
                        S = !1,
                        P = null,
                        A = null,
                        C = null,
                        M = null,
                        R = null,
                        O = null,
                        w = null,
                        I = null,
                        D = !1;
                    this.stageName = "BaseGame", this.stage = a.baseGame;
                    var L = !1,
                        B = null,
                        F = null,
                        N = null;
                    this.containers = {
                        gameContainer: t.lib._bgViewContainer.pixiContainer,
                        reelsContainer: t.lib._bgReelsContainer.pixiContainer,
                        winlineContainer: t.lib._bgWinlines.pixiContainer,
                        winBoxContainer: t.lib._bgWinBoxes.pixiContainer,
                        bonusLayer: t.lib._bgBonusLayer.pixiContainer
                    }, this.reelsConfig = h, this.systemInit = function(e, i, r) {
                        l.prototype.systemInit(e, r), L = "InProgress" === e.GameLogicResponse.OutcomeDetail.GameStatus, M = i, R = t.lib._punchABunchContainer.pixiContainer, O = t.lib._pabInfoLayer.pixiContainer, w = t.lib._arPlaqueContainer.pixiContainer, C = new d, C.init(M), R.visible = O.visible = w.visible = !1, B = new u, B.init(), F = new c(E), F.init();
                        var n = !1;
                        e.GameLogicResponse.Preference && e.GameLogicResponse.Preference.Tutorial && (n = "off" === e.GameLogicResponse.Preference.Tutorial.toLowerCase()), N = new p, N.init(m, n), A = t.lib._bgReelAnticipationLayer.pixiContainer, D = !1
                    }, this.stageInit = function(i, n) {
                        l.prototype.stageInit(i, this, !1), this.containers.bonusLayer.visible = !0, S || (S = !0, _()), this.nextStage === this.stageName ? (this.reelsContainer.visible = t.lib._bgDividers.pixiContainer.visible = !0, R.visible = O.visible = w.visible = !1, this.subscribeToMsgBus(), null !== i.orientation && void 0 !== i.orientation && E.rollUpController.orientationChanged(i), v() ? (I = i, E.reelSetController.resumeSpinTick(), E.winSequence.setData(I), E.uiView.enableControls(!1), T(!0), t.lib._bgLogo.pixiContainer.visible = !0) : this.currentStage !== r.BASE_GAME ? (I = i, E.winSequence.setData(I), E.uiView.enableControls(!1), T(!0), t.lib._bgLogo.pixiContainer.visible = !0, E.reelSetController.setReelSet(i, !0, 0, "BaseGame.ReelSetSelect")) : E.reelSetController.setReelSet(i, "BonusWheel" !== this.currentStage, -1)) : g() ? (this.uiView.removeEvents(), T(!1), this.reelsContainer.visible = t.lib._bgDividers.pixiContainer.visible = !1, R.visible = O.visible = !0, L && (L = !1, E.reelSetController.setReelSet(i), E.reelSetController.startSpin(function() {
                            E.reelSetController.pauseSpinTick()
                        }))) : this.nextStage === r.PUNCH_A_BUNCH_ACCEPT_REJECT || this.nextStage === r.PUNCH_A_BUNCH ? (this.uiView.removeEvents(), T(!1), t.lib._bgDividers.pixiContainer.visible = !1, E.reelSetController.setReelSet(i), E.reelSetController.startSpin(function() {
                            E.reelSetController.pauseSpinTick()
                        })) : this.nextStage === r.BONUS_WHEEL && (this.reelsContainer.visible = t.lib._bgDividers.pixiContainer.visible = !0, R.visible = O.visible = w.visible = !1, E.reelSetController.setReelSet(i), E.uiView.enableControls(!1), T(!1), E.winSequence.setData(i), e()), n || (E.gameContainer.visible = !0)
                    }, this.onBeforeRequest = function(e) {
                        x(), M.startAnimation("spin", 1, null, !0), l.prototype.onBeforeRequest(e)
                    }, this.onResolveStage = function(e) {
                        l.prototype.onResolveStage(e), I = e, E.winSequence.setData(I), g() ? n.publish(n.FROM_RESOLVE_STAGE, {
                            isFreeSpinsEntry: !1,
                            nextStage: I.response.OutcomeDetail.nextStage
                        }) : E.reelSetController.stopSpin(I, E.reelStateUpdate, E.onSpinDone)
                    }, this.onEndGame = function(e) {
                        E.uiView.onEndGame_handler(E.winSequence.gameTotal), n.publish(n.FROM_END_GAME)
                    }, this.onBeginNewGame = function(e) {
                        l.prototype.onBeginNewGame(e), E.isMaxAward ? (E.uiView.onBeginNewGame_handler(), E.uiView.enableControls(!1)) : y() ? E.uiView.onBeginNewGame_handler() : (E.uiView.onBeginNewGame_handler(), E.isWin || E.uiView.startNextAutoSpin()), b()
                    }, this.onWinSequenceDone = function(e) {
                        l.prototype.onWinSequenceDone(e), E.isWin || E.isExitStage && (E.uiView.isAutoSpinActive = !1), v() || y() ? (E.uiView.onEndGame_handler(E.winSequence.gameTotal), n.publish(n.FROM_ENTER_NEXT_STAGE)) : this.currentStage !== r.BASE_GAME ? n.publish(n.FROM_BEGIN_NEW_GAME) : n.publish(n.FROM_RESOLVE_STAGE, {
                            isFreeSpinsEntry: !1,
                            nextStage: I.response.OutcomeDetail.nextStage
                        })
                    }, this.onReelLandBounce = function(e) {
                        l.prototype.onReelLandBounce(e), o().execute("onReel" + (e + 1) + "Land");
                        for (var t in this.winSequence.cellData) {
                            var i = this.winSequence.cellData[t];
                            i.reelIndex === e && "b01" === i.symbolId.toLowerCase() && (0 === e && i.bonusCount > 0 || 2 === e && i.bonusCount > 1 || 4 === e && i.bonusCount > 2) && (i.anim.playPreShow(0), o().execute("onSymbolB01Land" + i.bonusCount), !0)
                        }
                        this.winSequence.bonusCount >= 2 && 3 === e ? setTimeout(function() {
                            E.reelSetController.updateSpeed([-3100, -3100, -3100, -3100, -5100]), P = new s, A.addChild(P), P.play()
                        }, 150) : 4 === e && null != P && P.playOutro(function() {
                            A.removeChild(P), P.stop(), P = null
                        })
                    }, this.onReelLandStopped = function(e) {
                        l.prototype.onReelLandStopped(e);
                        var t = !1;
                        for (var i in this.winSequence.cellData) {
                            var r = this.winSequence.cellData[i];
                            r.reelIndex === e && "b01" === r.symbolId.toLowerCase() && (0 === e && r.bonusCount > 0 || 2 === e && r.bonusCount > 1 || 4 === e && r.bonusCount > 2) && (C.update(r.bonusCount), t = !0, E.reelSetController.showSymbols(!1, [r.cellName]))
                        }
                        2 !== e && 4 !== e || t || C.reverse()
                    }, this.onSpinDone = function() {
                        if (x(), E.isMaxAward) E.showMaxAwardPlaque(!1, E.onSkipPressed), n.publish(n.FROM_RESOLVE_STAGE), v() && (F.stopAnim(), F.hideContainers()), E.uiView.isAutoSpinActive = !1;
                        else if (E.nextStage !== r.BONUS_WHEEL) l.prototype.onSpinDone();
                        else {
                            E.reelSetController.pauseSpinTick();
                            for (var e in E.winSequence.cellData) {
                                var t = E.winSequence.cellData[e];
                                if (2 === t.reelIndex && "b01" === t.symbolId.toLowerCase()) {
                                    setTimeout(function() {
                                        M.endCurrentAnimation(!0), M.startAnimation("bonus_trigger", 1, null, !1, !1), setTimeout(function() {
                                            t.anim.playLand(), E.onWinSequenceDone(!1)
                                        }, 100)
                                    }, 1200);
                                    break
                                }
                            }
                        }
                    }, this.playRollUp = function() {
                        v() ? (E.rollUpController.handleRollupTier(E.winSequence.totalPayout), E.rollUpController.isBigWin ? (E.rollUpController.customRollupName = "onFeature1BigWinRollup1", E.rollUpController.rollUp(E.winSequence.totalPayout, E.winSequence.multiplier)) : (E.rollUpController.customRollupName = "onFeature1Rollup1", E.rollUpController.rollUp(E.winSequence.totalPayout, E.winSequence.multiplier))) : y ? E.rollUpController.rollUp(E.winSequence.gameTotal, E.winSequence.multiplier) : E.rollUpController.rollUp(E.winSequence.totalPayout, E.winSequence.multiplier)
                    }, this.onRollupSegmentDone = function() {
                        l.prototype.onRollupSegmentDone(), F.playAnim(), setTimeout(function() {
                            o().execute("onFeature1Multiplier")
                        }, 1e3)
                    }, this.multiplierAnimComplete = function() {
                        F.fadeOut(), E.rollUpController.isBigWin ? E.rollUpController.customRollupName = "onFeature1BigWinRollup2" : E.rollUpController.customRollupName = "onFeature1Rollup2", E.rollUpController.continueRollup()
                    }, this.onRollUpDone = function() {
                        l.prototype.onRollUpDone(), v() && (o().execute("onFeature1End"), E.rollUpController.isBigWin && D && (o().execute("onFeature1BigWinRollupSkipEnd"), D = !1))
                    }, this.onWinCyleDone = function(e) {
                        l.prototype.onWinCyleDone(e), E.firstCycleComplete && E.uiView.isAutoSpinActive ? (l.prototype.clearWinPresentation(), E.uiView.startNextAutoSpin()) : E.winSequence.winLineData.length > 1 && E.winSequence.playWinLines()
                    }, this.onSkipPressed = function() {
                        l.prototype.onSkipPressed(), v() && (F.stopAnim(), F.hideContainers(), D = !0), E.isMaxAward && (E.isMaxAward = !1)
                    }, this.onExitStage = function(e) {
                        e.response.OutcomeDetail.Stage === r.BASE_GAME && (E.unsubscribeToMsgBus(), E.uiView.removeEvents(), E.uiView.isAutoSpinActive = !1, i.publish(i.ON_STAGE_CHANGE, I))
                    }, this.onEnterNextStage = function(e) {
                        E.isMaxAwardReached(e), v() ? (F.playIntro(E.winSequence.multiplier), E.reelSetController.stopSpin(I, E.reelStateUpdate, E.onSpinDone)) : y() && (E.isMaxAward ? (E.showMaxAwardPlaque(!1, E.onSkipPressed), E.uiView.onEndGame_handler(E.winSequence.gameTotal), n.publish(n.FROM_ENTER_NEXT_STAGE)) : E.winSequence.startWin())
                    }, this.onAbortNextStage = function(e) {
                        l.prototype.onAbortNextStage(e), E.uiView.isAutoSpinActive = !1
                    }, this.switchStage = function(i) {
                        this.reelsContainer.visible = t.lib._bgDividers.pixiContainer.visible = i === r.BASE_GAME || i === r.BONUS_WHEEL, R.visible = O.visible = i === r.PUNCH_A_BUNCH, T(!1), i === r.PUNCH_A_BUNCH ? this.reelSetController.pauseSpinTick() : i === r.BONUS_WHEEL && setTimeout(function() {
                            e()
                        }, 1200)
                    }, this.openDoors = function(e) {
                        B.openDoors(!0, e)
                    }, this.closeDoors = function(e) {
                        B.closeDoors(!0, e)
                    }, this.onBetChanged = function(e) {
                        E.isMaxAward && (E.uiView.enableControls(!0), E.uiView.enableSkipControls(!1), this.hideMaxAwardPlaque(), E.isMaxAward = !1), this.winSequence.clear(), this.reelSetController.showAllSymbols(!0)
                    }, this.onBetOpen = function(e) {
                        E.isMaxAward ? (E.uiView.enableSkipControls(!1), this.hideMaxAwardPlaque(), E.isMaxAward = !1) : e || E.uiView.enableControls(!0), this.winSequence.clear(), this.reelSetController.showAllSymbols(!0)
                    };
                    var V = null;
                    this.orientationChanged = function(e) {
                        l.prototype.orientationChanged(e), N.orientationChanged(e)
                    }
                };
            return _.prototype = Object.create(l.prototype), _.prototype.constructor = _, _
        }), define("game/views/controls/freeSpinUIController", ["require", "game/views/controls/uiController", "game/core/PlatformManager", "game/data/stateEvents", "com/gsap/plugins/PixiPlugin"], function(e) {
            "use strict";
            var t = e("game/views/controls/uiController"),
                i = e("game/core/PlatformManager"),
                r = e("game/data/stateEvents");
            e("com/gsap/plugins/PixiPlugin");
            var n = function(e, n, o) {
                t.call(this, e, n, o);
                var s = this;
                this.initControls = function(e) {
                    this.showStage = !0, this.enableSpinControls(!0), this.initGameControls(e)
                }, this.initGameControls = function(e) {
                    t.prototype.initGameControls(e), this.addEvents()
                }, this.addEvents = function() {
                    t.prototype.addEvents.bind(s)(), s.stage.spin.on(s.buttonPressedEvent, function() {
                        s.enableSpinButton = !1, r.publish(r.START_BASE_SPIN)
                    }), s.stage.skip.visible = !1, s.stage.skip.on(s.buttonPressedEvent, function() {
                        s.enableSkipButton = !1
                    }), s.stage.play.visible = !1, s.stage.play.on(s.buttonPressedEvent, function() {})
                }, this.removeEvents = function() {
                    t.prototype.removeEvents.bind(s)(), s.stage.spin.off(this.buttonPressedEvent), s.stage.skip.off(this.buttonPressedEvent), s.stage.play.off(this.buttonPressedEvent)
                }, this.startSpin = function() {
                    this.enableControls(!1)
                }, this.onBeginNewGame_handler = function() {
                    this.enableControls(!0)
                }, this.enableControls = function(e) {
                    this.enableSpinButton = e, i().enableControls(!1), i().enableGameInfo(!1)
                }
            };
            return n.prototype = Object.create(t.prototype), n.prototype.constructor = n, n
        }), define("game/components/cliffHanger/cliffHangerController", ["require", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/utils/miscUtils", "game/utils/graphicUtils", "game/utils/textUtils", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "com/pixijs/pixi", "game/components/createJsAudioPlayer/SoundManager", "com/gsap/TweenMax"], function(e) {
            "use strict";
            var t = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                i = e("game/utils/miscUtils"),
                r = e("game/utils/graphicUtils"),
                n = e("game/utils/textUtils"),
                o = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                s = e("com/pixijs/pixi"),
                a = e("game/components/createJsAudioPlayer/SoundManager"),
                l = e("com/gsap/TweenMax"),
                u = function(e) {
                    function u() {
                        var e = A.position.x - A.pivot.x,
                            t = A.position.y - A.pivot.y;
                        N = i.spriteFromTexture("cliffHanger_guyStatic"), k = i.spriteFromTexture("cliffHanger_arrow"), V = i.spriteFromTexture("cliffHanger_guyStatic");
                        var n = r.setPositions(A, N);
                        N.position.x = e - N.width / 2 + X, N.position.y = t + A.height - N.height - q + K, C.addChild(N), V.position.x = N.position.x, V.position.y = N.position.y, D.addChild(V), n = r.setPositions(N, k), k.position.x = n.x + 5, k.position.y = n.y + 55, h(), H = A.width / j, W = (A.height - q - Z[0].height) / j;
                        for (var o in Z) Z[o].x = e + H * o * 5 - Z[o].width / 2, Z[o].y = k.position.y - W * o * 5 + Z[o].height, r.centerPivot(Z[o]);
                        H += Y, W += Y, M.addChild(k), U = i.spriteFromTexture("cliffHanger_set_logo"), R.addChild(U), c()
                    }

                    function c() {
                        null !== ce && void 0 !== ce ? "portrait" === ce ? (U.width = 692.3, U.height = 132, U.position.x = 60, he = 135.5, U.position.y = 0, U.position.y -= U.height) : (U.width = 495.4, U.height = 89.8, U.position.x = 862.4, he = 513.3, U.position.y = 0, U.position.y -= U.height) : (r.centerObject(U, R), he = 0, U.position.y = he, U.position.y -= U.height)
                    }

                    function h() {
                        for (var e = 1, e = 1; e <= 25; e += 5) {
                            var t = n.addBasicText(M, e + "x", [0, 0], 65, [16777215], "OswaldLocCurrency-Bold", "center", 3, 0);
                            t.alpha = .5, Z.push(t), e <= 1 && (e = 0)
                        }
                        $ = i.createMovieClip("TextHighlightAnim_", 0, 5, 3, .25), $.scaleX = $.scaleY = 2, ee.addChild($), r.centerObject($, ee), $.y -= Q, $.visible = !1, J = n.addBasicText(ee, "+1 " + ae, [0, 0], 100, [16777215], "OswaldLocCurrency-Bold", "center", 2, 16774656), J.style.dropShadow = !0, J.style.fill = ["#fff447", "#cf0000"], J.style.fillGradientStops = [.1, .7], J.style.fillGradientType = 0, J.style.dropShadow = !0, J.style.dropShadowBlur = 5, J.style.dropShadowColor = "#674900", J.style.dropShadowAlpha = .5, J.style.dropShadowDistance = 0, n.autoFitPixiText(J, 600, 200, 100, !1), r.centerObject(J, ee), r.centerPivot(J), J.x = J.x - 40, J.y -= Q, J.visible = !1, te.setText(le), n.autoFit(te, !1), te.pixiContainer.visible = !1, ie = n.addBasicText(k, "1x", [0, 0], 65, [16777215], "OswaldLocCurrency-Bold", "center", 3, 16773137), ie.style.fill = ["#EC5D1F"], ie.style.dropShadow = !0, ie.style.dropShadowBlur = 5, ie.style.dropShadowColor = "#000000", ie.style.dropShadowAlpha = .9, ie.style.dropShadowDistance = 0, r.centerObject(ie, k), r.centerPivot(ie), ie.y += 50, oe = i.createMovieClip("TextHighlightAnim_", 0, 5, 3, .25), oe.x = (re._currentStyle._width - oe.width) / 2, oe.y = (re._currentStyle._height - oe.height) / 2 - 10, re.pixiContainer.addChild(oe), ne = n.addBasicText(re.pixiContainer, ue, [0, 0], 35, [16711716], "OswaldLocCurrency-Bold", "center", 6, 0), ne.style.letterSpacing = 2, n.autoFitPixiText(ne, re._currentStyle._width, re._currentStyle._height, 35, !1)
                    }

                    function d() {
                        r.centerObject($, M), $.y -= Q, J.scaleX = J.scaleY = 1, f(J), r.centerObject(J, M), r.centerPivot(J), J.x = J.x - 40, J.y -= Q, n.autoFit(te, !1), r.centerObject(ie, k), r.centerPivot(ie), ie.y += 50, n.autoFitPixiText(ne, re._currentStyle._width, re._currentStyle._height, 35, !1), oe.x = (re._currentStyle._width - oe.width) / 2, oe.y = (re._currentStyle._height - oe.height) / 2 - 10
                    }

                    function p() {
                        r.centerObject($, M), $.y -= Q, J.scaleX = J.scaleY = 1, f(J),
                            r.centerObject(J, M), r.centerPivot(J), J.x = J.x - 40, J.y -= Q, n.autoFit(te, !1), r.centerObject(ie, k), r.centerPivot(ie), ie.y += 50, n.autoFitPixiText(ne, re._currentStyle._width, re._currentStyle._height, 35, !1), oe.x = (re._currentStyle._width - oe.width) / 2, oe.y = (re._currentStyle._height - oe.height) / 2 - 10
                    }

                    function f(e) {
                        e.pivot.x = 0, e.pivot.y = 0
                    }

                    function _() {
                        w.cacheAsBitmap = !1, D.cacheAsBitmap = !1, I.cacheAsBitmap = !1, L.cacheAsBitmap = !1;
                        var e = new s.filters.BlurFilter;
                        e.blur = 4, w.filters = [e];
                        var t = new s.filters.BlurFilter;
                        t.blur = 2, D.filters = [t], I.filters = [t], L.filters = [t], w.cacheAsBitmap = !0, D.cacheAsBitmap = !0, I.cacheAsBitmap = !0, null !== L && void 0 !== L && (null !== B && void 0 !== B || (B = i.spriteFromTexture("cliffHanger_background_BlurOverlay"), B.scaleY = -1, B.y += B.height, F = i.spriteFromTexture("cliffHanger_background_BlurOverlay"), L.addChild(B), L.addChild(F), F.position.y = 250 + 2 * (L.position.y - F.height)), null !== ce && void 0 !== ce && (F.position.y = "portrait" === ce ? 150 + 2 * (L.position.y - F.height) : 250 + 2 * (L.position.y - F.height)), L.cacheAsBitmap = !0)
                    }

                    function m() {
                        z++
                    }

                    function g() {
                        var e = {
                                x: N.position.x,
                                y: N.position.y
                            },
                            t = {
                                x: e.x + H,
                                y: e.y - W
                            };
                        r.tweenXYContainer(N, t, function() {
                            a().execute("onBonus2MultiplierIncrease"), z < j && z < x.targetStep ? (y(z), m(), a().execute("onBonus2Anticipation"), g(), oe.play()) : v()
                        }, 1, window.Linear.easeNone), x.moveMarker()
                    }

                    function v() {
                        de = !1, z >= j && a().execute("onBonus2MultiplierMax"), a().execute("onBonus2MultiplierReached"), y(x.targetStep), b(), setTimeout(function() {
                            T.setMultiplier(x.targetStep)
                        }, 500), setTimeout(function() {
                            a().execute("onBonus2Reveal"), T.movementComplete()
                        }, 2e3), oe.stop()
                    }

                    function y(e) {
                        for (var t in Z) Z[t].alpha = .5, Z[t].style.fill = ["#ffffff"], Z[t].style.dropShadow = !1, Z[t].style.stroke = 0;
                        if (z % 5 == 0) {
                            ie.visible = !1;
                            var i = z / 5;
                            Z[i].alpha = 1, Z[i].style.fill = ["#EC5D1F"], Z[i].style.dropShadow = !0, Z[i].style.dropShadowBlur = 5, Z[i].style.dropShadowColor = "#000000", Z[i].style.dropShadowAlpha = .9, Z[i].style.dropShadowDistance = 0, Z[i].style.stroke = 16773137
                        } else ie.visible = !0, ie.text = e + "x"
                    }

                    function b() {
                        if (z % 5 == 0) {
                            var e = z / 5;
                            r.tweenScaleContainer(Z[e], 1.5, function() {
                                r.tweenScaleContainer(Z[e], 1, function() {})
                            })
                        } else r.tweenScaleContainer(ie, 1.5, function() {
                            r.tweenScaleContainer(ie, 1, function() {})
                        })
                    }
                    var x = this,
                        T = e,
                        E = null,
                        S = null,
                        P = null,
                        A = null,
                        C = null,
                        M = null,
                        R = null,
                        O = null,
                        w = null,
                        I = null,
                        D = null,
                        L = null,
                        B = null,
                        F = null,
                        N = null,
                        V = null,
                        k = null,
                        U = null,
                        G = {
                            x: 0,
                            y: 0
                        },
                        z = 1;
                    this.targetStep = 1;
                    var j = 25,
                        H = null,
                        W = null,
                        X = 5,
                        Y = 1,
                        q = 35.25,
                        K = 18,
                        Q = 152.8,
                        Z = [],
                        J = null,
                        $ = null,
                        ee = null,
                        te = null,
                        ie = null,
                        re = null,
                        ne = null,
                        oe = null,
                        se = o.i18n.CliffHanger.Spin,
                        ae = o.i18n.CliffHanger.Spins,
                        le = o.i18n.CliffHanger.LastSpin,
                        ue = o.i18n.CliffHanger.SpinsMessage,
                        ce = null,
                        he = null,
                        de = !1;
                    this.init = function() {
                        if (E = t.lib._cliffHangerContainer.pixiContainer, S = t.lib._cliffHangerBGContainer.pixiContainer, C = t.lib._cliffHangerMarkerContainer.pixiContainer, P = t.lib._chMountainContainer.pixiContainer, A = t.lib._chLadderContainer.pixiContainer, M = t.lib._cliffHangerMultiplierContainer.pixiContainer, ee = t.lib._multiplierAnimContainer.pixiContainer, R = t.lib._cliffHangerFGContainer.pixiContainer, te = t.lib._chFinalSpinText, te.pixiContainer.visible = !1, O = t.lib._cliffHangerBlurContainer.pixiContainer, w = t.lib._cliffHangerBlurBGContainer.pixiContainer, D = t.lib._cliffHangerBlurMarkerContainer.pixiContainer, I = t.lib._chBlurMountainContainer.pixiContainer, re = t.lib._chSpinsMessageContainer, re.pixiContainer.visible = !1, re.pixiContainer.alpha = 0, null !== t.lib._cliffHangerBlurMultiplierContainer && void 0 !== t.lib._cliffHangerBlurMultiplierContainer && (null === L || void 0 === L)) {
                            L = t.lib._cliffHangerBlurMultiplierContainer.pixiContainer;
                            var e = null;
                            e = L.height > L.width ? L.height : L.width, i.makeRect(L, [e, e], "#000000", 0, .5)
                        }
                        u(), _(), G.x = N.position.x, G.y = N.position.y
                    }, this.blurStage = function() {
                        D.cacheAsBitmap = !1;
                        var e = r.setPositions(N, V);
                        V.position.x = e.x, V.position.y = e.y, D.cacheAsBitmap = !0, r.fadeContainer(O, !0, function() {}, 1), r.fadeContainer(E, !1, function() {}, 1), re.pixiContainer.alpha = 1, re.pixiContainer.visible = !0, r.fadeContainer(re.pixiContainer, !1, function() {
                            re.pixiContainer.visible = !1
                        }, 1), setTimeout(function() {
                            r.tweenXYContainer(U, {
                                x: U.position.x,
                                y: -U.height
                            })
                        }, 1e3)
                    }, this.resetBlur = function() {
                        r.fadeContainer(O, !1, function() {}, 1), r.fadeContainer(E, !0, function() {}, 1), re.pixiContainer.alpha = 0, re.pixiContainer.visible = !0, r.fadeContainer(re.pixiContainer, !0, function() {}, 1), setTimeout(function() {
                            r.tweenXYContainer(U, {
                                x: U.position.x,
                                y: he
                            })
                        }, 2e3), a().execute("onBonus2MusicLayerStart")
                    }, this.handleMoveClimber = function() {
                        de = !0, setTimeout(function() {
                            m(), g()
                        }, 500)
                    }, this.moveMarker = function() {
                        var e = {
                                x: k.position.x,
                                y: k.position.y
                            },
                            t = {
                                x: e.x + H,
                                y: e.y - W
                            };
                        r.tweenXYContainer(k, t, function() {}, 1, window.Linear.easeNone)
                    }, this.setSpins = function(e) {
                        x.blurStage(), setTimeout(function() {
                            e <= 1 ? T.spinsShown() : (J.text = 2 === e ? "+" + (e - 1) + " " + se : "+" + (e - 1) + " " + ae, n.autoFitPixiText(J, 600, 200, 100, !1), J.visible = !0, J.alpha = 1, J.scaleX = J.scaleY = 1, f(J), r.centerObject(J, M), r.centerPivot(J), J.x = J.x - 40, J.y -= Q, $.visible = !0, $.alpha = 1, $.play(), a().execute("onBonus2ExtraSpin"), r.tweenScaleContainer(J, 1.5, function() {
                                setTimeout(function() {
                                    T.playLoopExplode(), T.spinsShown(), setTimeout(function() {
                                        r.fadeContainer(J, !1), r.fadeContainer($, !1, function() {
                                            $.stop()
                                        })
                                    }, 500 * e)
                                }, 1500)
                            }, .2, window.Linear.easeNone))
                        }, 1e3)
                    }, this.setLastSpin = function() {
                        x.blurStage(), setTimeout(function() {
                            $.visible = !0, $.alpha = 1, $.y += Q, $.play(), te.pixiContainer.visible = !0, te.pixiContainer.alpha = 1, te.pixiContainer.scaleX = te.pixiContainer.scaleY = 1, r.tweenScaleContainer(te.pixiContainer, 1.5, function() {
                                setTimeout(function() {
                                    T.spinsShown(), r.fadeContainer(te.pixiContainer, !1, function() {
                                        te.pixiContainer.visible = !1
                                    }), r.fadeContainer($, !1, function() {
                                        $.stop(), $.y -= Q
                                    })
                                }, 2e3)
                            }, .2, window.Linear.easeNone), a().execute("onBonus2VoLastOne")
                        }, 1e3)
                    }, this.incrementComplete = function() {}, this.resetStage = function() {
                        ee.removeChild(J);
                        for (var e in Z) M.removeChild(Z[e]);
                        M.removeChild(k), C.removeChild(N), R.removeChild(U), re.pixiContainer.removeChildren(), L.cacheAsBitmap = !1, L.removeChild(B), L.removeChild(F), L.removeChildAt(1), B = null, D.cacheAsBitmap = !1, D.removeChildren(), z = 1, x.targetStep = 0
                    }, this.handleRefresh = function() {
                        z = x.targetStep, ie.text = z + "x";
                        for (var e = null, t = null, i = 1; i < x.targetStep; i++) e = {
                            x: N.position.x,
                            y: N.position.y
                        }, t = {
                            x: e.x + H,
                            y: e.y - W
                        }, N.position.x = t.x, N.position.y = t.y, e = {
                            x: k.position.x,
                            y: k.position.y
                        }, t = {
                            x: e.x + H,
                            y: e.y - W
                        }, k.position.x = t.x, k.position.y = t.y;
                        D.cacheAsBitmap = !1;
                        var n = r.setPositions(N, V);
                        V.position.x = n.x, V.position.y = n.y, D.cacheAsBitmap = !0
                    }, this.orientationChanged = function(e) {
                        if (ce = e.orientation, de) {
                            l.killTweensOf(N), l.killTweensOf(k), l.killTweensOf(U), l.killTweensOf(ie), l.killTweensOf(J), l.killTweensOf(te.pixiContainer);
                            for (var t in Z) l.killTweensOf(Z[t]);
                            v()
                        }
                        c(), null !== ce && void 0 !== ce && ("portrait" === ce ? (Y = .5, N.scaleX = N.scaleY = V.scaleX = V.scaleY = 1, p(), K = 18) : (Y = 1, N.scaleX = N.scaleY = V.scaleX = V.scaleY = .8, d(), K = -10)), _();
                        var i = A.position.x - A.pivot.x,
                            n = A.position.y - A.pivot.y,
                            o = r.setPositions(A, N);
                        N.position.x = i - N.width / 2 + X, N.position.y = n + A.height - N.height - q + K, V.position.x = N.position.x, V.position.y = N.position.y, o = r.setPositions(N, k), k.position.x = o.x + 5, k.position.y = o.y + 55, H = A.width / j, W = (A.height - q - Z[0].height) / j;
                        for (var t in Z) Z[t].x = i + H * t * 5 - Z[t].width / 2, Z[t].y = k.position.y - W * t * 5 + Z[t].height, r.centerPivot(Z[t]);
                        H += Y, W += Y, x.handleRefresh()
                    }
                };
            return u.prototype.constructor = u, u
        }), define("game/configs/fsReelConfig", [], function() {
            var e = [200, 55],
                t = [194, 194],
                i = [10, 25];
            return {
                reelName: "CliffHangersFreeSpin.Reels",
                symbolSlotWidth: t[0],
                symbolSlotHeight: t[1],
                symbolSpacingW: i[0],
                symbolSpacingH: i[1],
                options: {
                    clip: [{
                        x: e[0],
                        y: e[1],
                        w: 5 * t[0] + 4 * i[0],
                        h: 3 * t[1] + 2 * i[1] - 1
                    }],
                    pos: {
                        x: 0,
                        y: 0
                    },
                    reels: [{
                        symbolCount: 3
                    }, {
                        symbolCount: 3
                    }, {
                        symbolCount: 3
                    }, {
                        symbolCount: 3
                    }, {
                        symbolCount: 3
                    }]
                },
                symbolsMap: {
                    s01: "s01",
                    s02: "s02",
                    s03: "s03",
                    s04: "s04",
                    s05: "s05",
                    s06: "s06",
                    s07: "s07",
                    s08: "s08",
                    s09: "s09",
                    b01: "b01",
                    w04: "w01"
                },
                symbolNames: ["s01", "s02", "s03", "s04", "s05", "s06", "s07", "s08", "b01", "w01"],
                spriteMap: {
                    s01: "S01_Static",
                    s02: "S02_Static",
                    s03: "S03_Static",
                    s04: "S04_Static",
                    s05: "S05_Static",
                    s06: "S06_Static",
                    s07: "S07_Static",
                    s08: "S08_Static",
                    b01: "B01_Static",
                    w01: "W01_Static"
                },
                spriteOffsets: {},
                StripInfo: {},
                locationsMap: ["L0C0R0", "L0C0R1", "L0C0R2", "L0C1R0", "L0C1R1", "L0C1R2", "L0C2R0", "L0C2R1", "L0C2R2", "L0C3R0", "L0C3R1", "L0C3R2", "L0C4R0", "L0C4R1", "L0C4R2"]
            }
        }), define("game/views/freeSpinSVC", ["require", "com/pixijs/pixi", "game/data/gameEvents", "game/data/setupData", "game/data/stateEvents", "com/gsap/TweenMax", "game/commonUI/slot/slotUI", "game/views/core/slotGameSVC", "game/views/controls/freeSpinUIController", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/components/cliffHanger/cliffHangerController", "game/configs/fsReelConfig", "game/components/multiplierAnim", "game/utils/graphicUtils", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            "use strict";
            var t = (e("com/pixijs/pixi"), e("game/data/gameEvents")),
                i = e("game/data/setupData"),
                r = e("game/data/stateEvents"),
                n = (e("com/gsap/TweenMax"), e("game/commonUI/slot/slotUI")),
                o = e("game/views/core/slotGameSVC"),
                s = e("game/views/controls/freeSpinUIController"),
                a = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                l = e("game/components/cliffHanger/cliffHangerController"),
                u = e("game/configs/fsReelConfig"),
                c = e("game/components/multiplierAnim"),
                h = e("game/utils/graphicUtils"),
                d = e("game/components/createJsAudioPlayer/SoundManager"),
                p = function() {
                    function e(e) {
                        var t = e.response.FreeSpinOutcome;
                        M = parseInt(t.Count), R = parseInt(t.TotalAwarded), O = parseInt(t.Awarded)
                    }

                    function p() {
                        T.stage.footer.spins.value = R
                    }

                    function f(e) {
                        var t = null,
                            i = null,
                            r = e.response.PrizeOutcome;
                        for (var n in r) "Game.Total" === r[n]["@name"] && (t = r[n]), "BaseGame.Lines" === r[n]["@name"] && (i = r[n]);
                        var o = 0;
                        o = T.isMaxAward ? t["@totalPay"] : t["@totalPay"] - i["@totalPay"], T.uiView.updateMeter(T.stage.footer.bonusWin, o), a.lib._chPlaqueWinAmount.setText(T.stage.footer.bonusWin.value)
                    }

                    function _(e) {
                        T.winSequence.setMultiplier(e, "CliffHangersFreeSpin.NextSpinMultiplier");
                        var t = T.winSequence.multiplier;
                        if (A.targetStep !== t && t > 1) {
                            T.winSequence.setMultiplier(e, "CliffHangersFreeSpin.CurrentMultiplier");
                            var i = T.winSequence.multiplier;
                            t > i ? (A.resetBlur(), h.fadeContainer(T.reelsContainer, !1, function() {
                                T.reelSetController.startSpin(function() {})
                            }, 1), h.fadeContainer(I, !1, function() {}, 1), null !== a.lib._fsTopMask && void 0 !== a.lib._fsTopMask && (h.fadeContainer(D, !1, function() {}, 1), h.fadeContainer(L, !1, function() {}, 1)), setTimeout(function() {
                                A.targetStep = t, A.handleMoveClimber()
                            }, 2e3)) : T.reelSetController.startSpin(function() {
                                r.publish(r.FROM_BEFORE_REQUEST)
                            })
                        } else m()
                    }

                    function m() {
                        T.reelSetController.startSpin(function() {
                            r.publish(r.FROM_BEFORE_REQUEST)
                        })
                    }

                    function g(e) {
                        setTimeout(function() {
                            R = M + e, p(), e++, e <= O ? g(e) : v()
                        }, 500)
                    }

                    function v() {
                        A.incrementComplete(), h.fadeContainer(T.reelsContainer, !0, function() {
                            T.currentStage === T.stageName && (d().execute("onBonus2MusicLayerEnd"), T.reelSetController.stopSpin(E, T.reelStateUpdate, T.onSpinDone))
                        }, 1), h.fadeContainer(I, !0, function() {}, 1), null !== a.lib._fsTopMask && void 0 !== a.lib._fsTopMask && (h.fadeContainer(D, !0, function() {}, 1), h.fadeContainer(L, !0, function() {}, 1))
                    }

                    function y() {
                        o.prototype.onExitStage(E), T.stage.footer.win.value = "", T.isMaxAward ? T.isMaxAward = !1 : d().execute("onBonus2End"), t.publish(t.ON_STAGE_CHANGE, E)
                    }

                    function b(e) {
                        h.fadeContainer(T.uiView.stage, e, function() {
                            T.uiView.stage.visible = e
                        }, .5)
                    }

                    function x() {
                        clearTimeout(w), w = null
                    }
                    o.call(this);
                    var T = this,
                        E = null,
                        S = !1;
                    this.stageName = "CliffHangersFreeSpin", this.stage = n.freeSpins;
                    var P = !1,
                        A = null,
                        C = null,
                        M = null,
                        R = null,
                        O = null,
                        w = null,
                        I = a.lib._fsDividers.pixiContainer,
                        D = null,
                        L = null;
                    this.containers = {
                        gameContainer: a.lib._fsViewContainer.pixiContainer,
                        reelsContainer: a.lib._fsReelsContainer.pixiContainer,
                        winlineContainer: a.lib._fsWinlines.pixiContainer,
                        winBoxContainer: a.lib._fsWinBoxes.pixiContainer,
                        bonusLayer: a.lib._bgBonusLayer.pixiContainer
                    }, this.reelsConfig = u, this.systemInit = function(e, t) {
                        o.prototype.systemInit(e, t), P = "InProgress" === e.GameLogicResponse.OutcomeDetail.GameStatus, a.lib._fsViewContainer.pixiContainer.visible = !1, null !== a.lib._fsTopMask && void 0 !== a.lib._fsTopMask && (D = a.lib._fsTopMask.pixiContainer, L = a.lib._fsBottomMask.pixiContainer)
                    }, this.setUIView = function() {
                        T.uiView = new s(T, T.stageName, T.stage), T.uiView.init()
                    }, this.stageInit = function(t, i) {
                        o.prototype.stageInit(t, this);
                        var r = i || !1;
                        if (r && T.reelSetController.setReelSet(t, "BonusWheel" === this.currentStage, -1), this.nextStage === this.stageName) {
                            b(!0), T.uiView.enableControls(!1), T.uiView.showSpinButton = !1, this.reelsContainer.visible = !0, I.visible = !0, null !== a.lib._fsTopMask && void 0 !== a.lib._fsTopMask && (D.visible = !0, L.visible = !0), this.subscribeToMsgBus(), A = new l(this), A.init(), e(t), p(), f(t), C = new c(this), C.init(), C.setPlaque(), C.showContainers(), C.setMultiplier(1), C.adjustMultiplier(), C.setSpinsText(R - M);
                            var n = Number(window.innerWidth),
                                s = Number(window.innerHeight),
                                u = {
                                    orientation: "landscape"
                                };
                            if (this.isMobile() && n > s ? (C.orientationChanged(u), A.orientationChanged(u)) : this.isMobile() && n < s && (u = {
                                    orientation: "portrait"
                                }, C.orientationChanged(u), A.orientationChanged(u)), null !== t.orientation && void 0 !== t.orientation && T.rollUpController.orientationChanged(t), d().execute("onBonus2Start"), M > 1) {
                                S = !0, C.setSpinsText(O), T.winSequence.setMultiplier(t, "CliffHangersFreeSpin.NextSpinMultiplier");
                                var h = T.winSequence.multiplier;
                                A.targetStep = h, A.handleRefresh(), C.setMultiplier(h), C.adjustMultiplier()
                            }
                        }
                        r || (d().execute("onBonus2Refresh"), T.gameContainer.visible = !0)
                    }, this.onBeforeRequest = function(t) {
                        x(), T.resetFlags(), T.winSequence.clear(), T.stage.footer.win.value = "", T.uiView.showSpinButton = !0, M++, S ? C.setSpinsText(R - M + 1) : C.setSpinsText(R - M), p(), e(t), f(t), T.clearContainers(), null != T.winlineContainer && T.winlineContainer.removeChildren(), T.stopRollup(), T.uiView.startSpin(), _(t)
                    }, this.setMultiplier = function(e) {
                        C.setMultiplier(e), C.adjustMultiplier(), C.scaleMultiplier()
                    }, this.movementComplete = function() {
                        r.publish(r.FROM_BEFORE_REQUEST)
                    }, this.onResolveStage = function(e) {
                        o.prototype.onResolveStage(e), E = e, T.winSequence.setData(E), T.winSequence.setMultiplier(e, "CliffHangersFreeSpin.CurrentMultiplier"), S ? (S = !1, T.currentStage === T.stageName && (d().execute("onBonus2MusicLayerEnd"), T.reelSetController.stopSpin(E, T.reelStateUpdate, T.onSpinDone))) : T.winSequence.multiplier >= 25 ? A.setLastSpin() : T.winSequence.multiplier > 1 && O > 0 ? A.setSpins(O) : T.currentStage === T.stageName && (d().execute("onBonus2MusicLayerEnd"), T.reelSetController.stopSpin(E, T.reelStateUpdate, T.onSpinDone))
                    }, this.onSpinDone = function() {
                        T.isMaxAward ? (f(E), T.showMaxAwardPlaque(!0, T.onSkipPressed)) : (T.winSequence.startWin(), T.reelSetController.pauseSpinTick())
                    }, this.onReelLandBounce = function(e) {
                        o.prototype.onReelLandBounce(e), d().execute("onReel" + (e + 1) + "Land")
                    }, this.playLoopExplode = function() {
                        C.playLoopExplode()
                    }, this.spinsShown = function() {
                        setTimeout(function() {
                            C.setSpinsText(O), C.scaleSpins()
                        }, 500), g(1)
                    }, this.multiplierAnimComplete = function() {}, this.onInProgressStage = function(e) {
                        f(e), T.isWin || (w = setTimeout(function() {
                            r.publish(r.FROM_IN_PROGRESS_STAGE)
                        }, 1e3)), T.currentStage === T.stageName && (T.uiView.onEndGame_handler(T.winSequence.totalPayout), T.uiView.onBeginNewGame_handler())
                    }, this.onExitStage = function(e) {
                        f(e), T.isMaxAward ? T.uiView.onEndGame_handler(T.winSequence.gameTotal) : T.uiView.onEndGame_handler(T.winSequence.totalPayout), T.isWin || (w = setTimeout(function() {
                            y()
                        }, 1e3))
                    }, this.onWinCyleDone = function(e) {
                        o.prototype.onWinCyleDone(e), T.firstCycleComplete && (T.resetFlags(), T.winSequence.clear(), T.stage.footer.win.value = "", T.reelSetController.showAllSymbols(!0), w = setTimeout(function() {
                            T.isExitStage ? y() : r.publish(r.FROM_IN_PROGRESS_STAGE)
                        }, 1e3))
                    }, this.playRollUp = function() {
                        T.rollUpController.customRollupName = "onBonus2Rollup", T.rollUpController.rollUp(T.winSequence.totalPayout)
                    }, this.onWinSequenceDone = function(e) {
                        o.prototype.onWinSequenceDone(e), T.currentStage === T.stageName && r.publish(r.FROM_RESOLVE_STAGE, {
                            isFreeSpinsEntry: !1,
                            nextStage: E.response.OutcomeDetail.nextStage
                        })
                    }, this.onSpinPressed = function() {
                        o.prototype.onSpinPressed(), x()
                    }, this.autoSpinReady = function() {}, this.switchStage = function(e) {
                        x(), C.hideContainers(), C.hidePlaqueContainers(), A.resetStage(), b(!1), this.reelsContainer.visible = e === i.FREE_SPINS, I.visible = e === i.FREE_SPINS, null !== a.lib._fsTopMask && void 0 !== a.lib._fsTopMask && (D.visible = e === i.FREE_SPINS, L.visible = e === i.FREE_SPINS)
                    }, this.openDoors = function(e) {
                        e()
                    }, this.closeDoors = function(e) {
                        e()
                    }, this.darken = function(e) {}, this.orientationChanged = function(e) {
                        o.prototype.orientationChanged(e), null !== C && void 0 !== C && C.orientationChanged(e), null !== A && void 0 !== A && A.orientationChanged(e)
                    }, this.onSkipPressed = function() {
                        o.prototype.onSkipPressed(), T.isMaxAward && (T.uiView.enableControls(!1), r.publish(r.FROM_RESOLVE_STAGE))
                    }
                };
            return p.prototype = Object.create(o.prototype), p.prototype.constructor = p, p
        }), define("game/components/punchABunchButton", ["require", "com/pixijs/pixi", "game/utils/miscUtils", "game/components/basicButton", "game/utils/textUtils", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            var t = e("com/pixijs/pixi"),
                i = e("game/utils/miscUtils"),
                r = e("game/components/basicButton"),
                n = (e("game/utils/textUtils"), e("game/components/createJsAudioPlayer/SoundManager")),
                o = Object.freeze({
                    Button: 1,
                    PoofOpen: 2,
                    LoopAnim: 3,
                    Inactive: 4
                }),
                s = function() {
                    function e() {
                        g = new r, g.init({
                            enabled: "punchABunch_setPiece_pickStatic",
                            disabled: "punchABunch_setPiece_pickStatic",
                            over: "punchABunch_setPiece_pickOverlay",
                            pressed: "punchABunch_setPiece_pickStatic"
                        }, s), g.enable = T, g.anchor.x = .5, g.anchor.y = .5
                    }

                    function s() {
                        b(S)
                    }

                    function a() {
                        p = i.createMovieClip("punchABunch_pickAnimLoop_", 0, 9, 3, .5, !1, !1, !1), p.anchor.x = .5, p.anchor.y = .5, p.interactive = !1, p.buttonMode = !1, p.onLoop = function() {
                            x && x()
                        }
                    }

                    function l() {
                        f = new t.Container, _ = i.spriteFromTexture("punchABunch_pickAnim_029", "centre"), _.anchor.x = .5, _.anchor.y = .5, f.addChild(_);
                        var e = new t.TextStyle({
                            fontFamily: "OswaldLocCurrency-Medium",
                            fontSize: 48,
                            fontStyle: "normal",
                            fill: 16777215,
                            align: "center",
                            stroke: 0,
                            strokeThickness: 5
                        });
                        m = new t.Text(E, e), m.x = -m.width / 2, m.y = -m.height / 2, f.addChild(m), f.interactive = !1, f.buttonMode = !1
                    }

                    function u() {
                        v = new t.Container;
                        var e = i.spriteFromTexture("punchABunch_setPiece_pickInactive", "centre");
                        e.anchor.x = .5, e.anchor.y = .5, e.x = -1, e.y = .5, v.addChild(e), v.interactive = !1, v.buttonMode = !1
                    }

                    function c() {
                        y = i.createMovieClip("punchABunch_pickAnim_", 0, 29, 3, .5), y.loop = !1, y.anchor.x = .5, y.anchor.y = .5, y.interactive = !1, y.buttonMode = !1
                    }
                    t.Container.call(this);
                    var h = null,
                        d = null,
                        p = null,
                        f = null,
                        _ = null,
                        m = null,
                        g = null,
                        v = null,
                        y = null,
                        b = null,
                        x = null,
                        T = !0,
                        E = "",
                        S = null;
                    this.init = function(t, i) {
                        d = this, S = t, b = i, e(), a(), l(), u(), c(), this.setState(o.Button)
                    }, this.setState = function(e) {
                        if (e !== h) switch (h = e, p.stop(), this.removeChildren(), e) {
                            case o.Button:
                                g.enable = T, this.addChild(g);
                                break;
                            case o.LoopAnim:
                                this.addChild(p), p.gotoAndPlay(0);
                                break;
                            case o.PoofOpen:
                                f.addChild(m), this.addChild(f);
                                break;
                            case o.Inactive:
                                v.addChild(m), this.addChild(v)
                        }
                    }, this.setDisplayValue = function(e) {
                        (e = e.toLowerCase()) !== E && (E = e, null != m && (m.setText(E), m.x = -m.width / 2, m.y = -m.height / 2))
                    }, this.getDisplayValue = function() {
                        return E
                    }, this.setEnable = function(e) {
                        T !== e && (T = e, g.enable = T)
                    }, this.onLoopDone = function(e) {
                        x = e
                    }, this.playOpen = function(e) {
                        y.onComplete = function() {
                            d.setState(2), y.onComplete = null, f.addChild(m), e && e()
                        }, setTimeout(function() {
                            "20x" === E && n().execute("onFeature1SelectMaxPick"), y.addChild(m)
                        }, 300), this.removeChildren(), this.addChild(y), y.gotoAndPlay(0)
                    }, this.reset = function() {
                        d.setState(1), g.reset()
                    }
                };
            return s.prototype = Object.create(t.Container.prototype), s.prototype.constructor = s, s
        }), define("game/components/punchABunchValueDot", ["require", "com/pixijs/pixi", "game/utils/miscUtils", "game/utils/textUtils"], function(e) {
            var t = e("com/pixijs/pixi"),
                i = e("game/utils/miscUtils"),
                r = e("game/utils/textUtils"),
                n = function() {
                    function e() {
                        var e = [0, 0];
                        l = r.addBasicText(n, s, e, 18, 16768768, "OswaldLocCurrency-Medium", "center", 2, 0), l.anchor.set(.5, .5), l.x = -1
                    }
                    t.Container.call(this);
                    var n = null,
                        o = null,
                        s = "",
                        a = null,
                        l = null;
                    this.init = function() {
                        n = this, o = new t.Container, this.addChild(o), e()
                    }, this.ShowUnpicked = function() {
                        o.removeChildren();
                        var e = i.spriteFromTexture("punchABunch_valueStatic", "centre");
                        o.addChild(e), l.style.fill = 16768768
                    }, this.ShowPicked = function() {
                        o.removeChildren();
                        var e = i.spriteFromTexture("punchABunch_valueInactive", "centre");
                        o.addChild(e), l.style.fill = 13421772
                    }, this.ShowHighlighted = function() {
                        o.removeChildren();
                        var e = i.spriteFromTexture("punchABunch_valueOverlay", "centre");
                        o.addChild(e), l.style.fill = 16768768
                    }, this.getMultiplierValue = function() {
                        return l ? l.text : null
                    }, this.SetMultiplierValue = function(e) {
                        s = e.toLowerCase(), l && (l.text = s)
                    }, this.SetCellName = function(e) {
                        a = e
                    }, this.GetCellName = function() {
                        return a
                    }
                };
            return n.prototype = Object.create(t.Container.prototype), n.prototype.constructor = n, n
        }), define("game/views/punchABunchSVC", ["require", "com/pixijs/pixi", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/data/gameEvents", "game/commonUI/slot/betData", "game/data/stateEvents", "game/utils/textUtils", "com/gsap/TweenMax", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "game/data/setupData", "game/core/PlatformManager", "game/views/core/gameSVC", "game/components/createJsAudioPlayer/SoundManager", "game/components/punchABunchButton", "game/components/punchABunchValueDot", "skbJet/componentManchester/rgsModel/rgsModel"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                r = e("game/data/gameEvents"),
                n = e("game/commonUI/slot/betData"),
                o = e("game/data/stateEvents"),
                s = e("game/utils/textUtils"),
                a = e("com/gsap/TweenMax"),
                l = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                u = e("game/data/setupData"),
                c = e("game/core/PlatformManager"),
                h = e("game/views/core/gameSVC"),
                d = e("game/components/createJsAudioPlayer/SoundManager"),
                p = e("game/components/punchABunchButton"),
                f = e("game/components/punchABunchValueDot"),
                _ = e("skbJet/componentManchester/rgsModel/rgsModel"),
                m = function() {
                    function e(e) {
                        e ? (Y = parseFloat(U.width), q = parseFloat(U.height), K = parseFloat(G.width), Q = parseFloat(G.height)) : (Y = parseFloat(U.height), q = parseFloat(U.width), K = parseFloat(G.width), Q = parseFloat(G.height))
                    }

                    function m() {
                        for (var e in D) D[e].reset()
                    }

                    function g(e) {
                        e = void 0 !== e && e;
                        var t = "PunchABunchAcceptReject" === w.resolveData.response.OutcomeDetail.NextStage,
                            i = "",
                            r = 1;
                        if (w.resolveData && w.resolveData.response && w.resolveData.response.LadderOutcome) {
                            var n = w.resolveData.response.LadderOutcome;
                            Array.isArray(n) || (n = [n]);
                            for (var o = 0; o < n.length; o++)
                                if ("PunchABunch.TurnCount" === n[o]["@name"]) {
                                    r = parseInt(n[o].Ladder["#text"]) + (e && t ? 0 : 1);
                                    break
                                }
                        }
                        r < 4 ? (i = l.i18n.PunchABunch.Offer, i = i.replace("[count]", r)) : i = l.i18n.PunchABunch.FinalOffer, j.setText(i), s.autoFit(j)
                    }

                    function v() {
                        H.alpha = 1, H.scaleX = H.scaleY = 1, a.to(H, .3, {
                            scaleX: .2,
                            scaleY: .2,
                            alpha: 0,
                            ease: window.Back.easeIn.config(1.7),
                            onComplete: function() {
                                H.visible = !1
                            }
                        })
                    }

                    function y(e) {
                        V.visible = !0;
                        var t = i.lib._padInfoLeft.pixiContainer,
                            r = i.lib._padInfoRight.pixiContainer;
                        r.alpha = t.alpha = 0, a.to(t, .2, {
                            alpha: 1,
                            ease: window.Linear.easeNone
                        }), a.to(r, .2, {
                            alpha: 1,
                            ease: window.Linear.easeNone
                        }), t.scaleX = t.scaleY = .5, a.to(t, .3, {
                            scaleX: 1,
                            scaleY: 1,
                            ease: window.Back.easeOut.config(3)
                        }), r.scaleX = r.scaleY = .5, a.to(r, .3, {
                            scaleX: 1,
                            scaleY: 1,
                            ease: window.Back.easeOut.config(3),
                            onComplete: function() {
                                e && e()
                            }
                        })
                    }

                    function b(e) {
                        V.visible = !0;
                        var t = i.lib._padInfoLeft.pixiContainer,
                            r = i.lib._padInfoRight.pixiContainer;
                        t.scaleX = t.scaleY = 1, a.to(t, .3, {
                            scaleX: .5,
                            scaleY: .5,
                            ease: window.Back.easeIn.config(3)
                        }), r.scaleX = r.scaleY = 1, a.to(r, .3, {
                            scaleX: .5,
                            scaleY: .5,
                            ease: window.Back.easeIn.config(3),
                            onComplete: function() {
                                V.visible = !1, e && e()
                            }
                        }), setTimeout(function() {
                            r.alpha = t.alpha = 1, a.to(t, .2, {
                                alpha: 0,
                                ease: window.Linear.easeNone
                            }), a.to(r, .2, {
                                alpha: 0,
                                ease: window.Linear.easeNone
                            })
                        }, 100)
                    }

                    function x(e) {
                        ne && (ne = !1, w.setPickButtonsEnable(!1), I.playDataPayload = {
                            ActionInput: {
                                Action: "play"
                            },
                            PatternSliderInput: {
                                BetPerPattern: n.betPerPattern,
                                PatternsBet: n.patternsBet
                            },
                            PickerInput: {
                                Pick: {
                                    "@name": e
                                }
                            }
                        }, w.setEnable(!1, !0), J = D[e], J.setState(3), i.lib._arPickerContainer.pixiContainer.addChild(J), d().execute("onFeature1Select"), o.publish(o.FROM_BEFORE_REQUEST))
                    }

                    function T() {
                        if (null === D) {
                            D = {};
                            for (var e = 0; e < 11; e++) {
                                var t = new p,
                                    i = "L0C" + e + "R0";
                                t.init(i, x), t = k.addChild(t), D[i] = t
                            }
                        } else
                            for (var e = 0; e < 11; e++) {
                                var i = "L0C" + e + "R0";
                                D[i].setDisplayValue("")
                            }
                    }

                    function E() {
                        for (var e = q / Z.length, t = Y / Z[0], i = 0, r = 0, n = 0; n < Object.keys(D).length; n++) {
                            var o = t / 2 * (i % 2 + 1) + r * t,
                                s = e / 2 + i * e;
                            D["L0C" + n + "R0"].x = o, D["L0C" + n + "R0"].y = s, r++, r >= Z[i] && (r = 0, i++)
                        }
                    }

                    function S() {
                        if (null === B) {
                            B = [];
                            for (var e = 0; e < 11; e++) {
                                var t = te[0][e],
                                    i = t.split(","),
                                    r = i[3];
                                r = r.toLowerCase();
                                var n = new f;
                                n.init(), n.ShowUnpicked(), n.SetCellName("L0C" + e + "R0"), n = L.addChild(n), n.interactive = !1, n.visible = !0, B.push(n), n.SetMultiplierValue(r)
                            }
                        }
                    }

                    function P() {
                        for (var e = Q / 2, t = K / 6, i = 0, r = 0, n = 0; n < B.length; n++) {
                            var o = t / 2 * (i % 2 + 1) + r * t,
                                s = e / 2 + i * e;
                            B[n].x = o, B[n].y = s, K > 430 ? (B[n].scaleX = 1.5, B[n].scaleY = 1.5) : (B[n].scaleX = 1, B[n].scaleY = 1), r++, 6 === r && (r = 0, i++)
                        }
                    }

                    function A(e) {
                        var t = {},
                            i = [];
                        if (null === e.response.PickerOutcome || void 0 === e.response.PickerOutcome) return t;
                        Array.isArray(e.response.PickerOutcome) ? i = e.response.PickerOutcome : i.push(e.response.PickerOutcome);
                        for (var r = 0; r < i.length; r++) "PunchABunch" === i[r]["@name"] && (i[r].Layer && i[r].Layer.Pick && !Array.isArray(i[r].Layer.Pick) ? i[0] = i[r].Layer.Pick : i[r].Layer && i[r].Layer.Pick && (i = i[r].Layer.Pick));
                        if (null !== i)
                            for (var n = 0; n < i.length; n++) {
                                var o = i[n]["@name"];
                                if (i[n] && i[n].Feature)
                                    for (var s = 0; s < i[n].Feature.length; s++) {
                                        var a = i[n].Feature[s]["@type"];
                                        if ("trigger" === a) {
                                            var l = i[n].Feature[s]["@value"];
                                            l = l.toLowerCase(), t[l] = o
                                        }
                                    }
                            }
                        return t
                    }

                    function C(e) {
                        var t = A(e),
                            i = null,
                            r = null;
                        if (e.response.PickerInput) {
                            var i = e.response.PickerInput.Pick["@name"];
                            J = D[i];
                            for (var n in t)
                                if (i === t[n]) {
                                    r = n;
                                    break
                                }
                        } else J = null;
                        for (var o = 0; o < B.length; o++) {
                            B[o].ShowPicked();
                            var s = B[o].getMultiplierValue();
                            B[o].getMultiplierValue() === r ? B[o].ShowHighlighted() : s in t ? B[o].ShowPicked() : B[o].ShowUnpicked()
                        }
                        var a = {};
                        for (var n in t) a[t[n]] = n;
                        for (var l in D) a[l] ? (D[l].setDisplayValue(a[l]), l !== i && D[l].setState(4)) : D[l].setState(1)
                    }

                    function M(e) {
                        var t = {},
                            i = null;
                        if (Array.isArray(e.response.TriggerOutcome))
                            for (var r = 0; r < e.response.TriggerOutcome.length; r++)
                                if ("RevealedPicks" === e.response.TriggerOutcome[r]["@name"]) {
                                    i = e.response.TriggerOutcome[r];
                                    for (var n = 0; n < i.Trigger.length; n++) {
                                        var o = i.Trigger[n]["@name"],
                                            s = o.split(",")[3];
                                        t["L0C" + n + "R0"] = s
                                    }
                                    break
                                }
                        return t
                    }

                    function R(t) {
                        "landscape" === t ? (Z = [4, 3, 4], e(!0), i.lib._bgLogo.pixiContainer.visible = !0) : (Z = [2, 1, 2, 1, 2, 1, 2], e(!1), i.lib._bgLogo.pixiContainer.visible = !1), null !== i.lib._pabBottomFrameTxt && s.autoFit(i.lib._pabBottomFrameTxt), null !== z && s.autoFit(z), null !== j && s.autoFit(j), E(), P()
                    }
                    var O = Object.freeze({
                        ACCEPT: 0,
                        REJECT: 1,
                        NOSUGGESTION: 2
                    });
                    h.call(this), this.resolveData = null;
                    var w = this,
                        I = null,
                        D = null,
                        L = null,
                        B = null,
                        F = null,
                        N = null,
                        V = null,
                        k = null,
                        U = {
                            height: 0,
                            width: 0
                        },
                        G = {
                            height: 0,
                            width: 0
                        },
                        z = null,
                        j = null,
                        H = null,
                        W = null,
                        X = null,
                        Y = -1,
                        q = -1,
                        K = -1,
                        Q = -1,
                        Z = null,
                        J = null,
                        $ = null,
                        ee = null,
                        te = null,
                        ie = null,
                        re = !0,
                        ne = !1;
                    this.systemInit = function(r, n) {
                        h.prototype.systemInit(r), I = c(), F = i.lib._punchABunchContainer.pixiContainer, k = i.lib._pabPickerContainer.pixiContainer, L = i.lib._pabValueDotsContainer.pixiContainer, N = i.lib._pabPickerGrayOverlay.pixiContainer, V = i.lib._pabInfoLayer.pixiContainer, ie = n, H = i.lib._arLastPlaque.pixiContainer, X = s.addBasicText(H, l.i18n.PunchABunch.arLastPlaqueText, [220.5, 70], 40, 16777215, "OswaldLocCurrency-Medium", "center", 4, 0), X.anchor = new t.Point(.5, .5), s.textFitWidth(X, 350, !1), H.visible = !1, W = new p, W.init(null, null), W.x = 228, W.y = 158, W.setState(2), H.addChild(W), z = i.lib._padInfoRightTxt, z.setText(l.i18n.PunchABunch.ChoseASpot), s.autoFit(z), j = i.lib._padInfoLeftTxt, i.lib._pabBottomFrameTxt.setText(l.i18n.PunchABunch.Values), s.autoFit(i.lib._pabBottomFrameTxt), V.visible = !1, F.visible = !1, Z = [4, 3, 4], $ = !1, U.height = k.height, U.width = k.width, G.height = L.height, G.width = L.width, e(!0), te = _.paytable.StripInfo("PunchABunch.StripInfo")
                    }, this.stageInit = function(e, t, i) {
                        var r = t || !1;
                        h.prototype.stageInit(e), w.resolveData = e, F.visible = !0, V.visible = !r, w.resolveData.response.OutcomeDetail.NextStage === u.PUNCH_A_BUNCH && this.subscribeToMsgBus(), r || ie.startAnimation("punchABunch_trigger", 1, null, !1, !1, 34), T(), E(), S(), P(), this.setEnable(w.resolveData.response.OutcomeDetail.NextStage === u.PUNCH_A_BUNCH && !r, !1), r || !re && w.resolveData.response.OutcomeDetail.Stage !== u.BASE_GAME ? g(!1) : (d().execute("onFeature1Refresh"), g(!0)), C(w.resolveData), null !== i && void 0 !== i && R(i), re = !1, ne = !1
                    }, this.setEnable = function(e, t, i) {
                        e !== ee && (ee = e, ee ? t ? (N.visible = !0, N.alpha = 1, a.to(N, .3, {
                            alpha: 0,
                            ease: window.Linear.easeNone,
                            onComplete: function() {
                                N.visible = !1, i && i()
                            }
                        })) : (N.visible = !1, i && i()) : (this.setPickButtonsEnable(!1), t ? (N.visible = !0, N.alpha = 0, a.to(N, .3, {
                            alpha: 1,
                            ease: window.Linear.easeNone,
                            onComplete: function() {
                                i && i()
                            }
                        })) : (N.alpha = 1, N.visible = !0, i && i())))
                    }, this.setPickButtonsEnable = function(e) {
                        for (var t in D) D[t].setEnable(e)
                    };
                    var oe = !1;
                    this.subscribeToMsgBus = function() {
                        if (!oe) {
                            h.prototype.subscribeToMsgBus.bind(this)(), oe = !0
                        }
                    }, this.unsubscribeToMsgBus = function() {
                        h.prototype.unsubscribeToMsgBus.bind(this)(), oe = !1
                    }, this.onBeforeRequest = function() {
                        w.setPickButtonsEnable(!0), ne = !0
                    }, this.onResolveStage = function(e) {
                        w.resolveData = e, $ = !0;
                        var t = (e.response.OutcomeDetail.Stage, e.response.OutcomeDetail.NextStage),
                            i = e.response.PickerInput.Pick["@name"],
                            r = A(w.resolveData);
                        for (var n in r)
                            if (r[n] === i) {
                                J.setDisplayValue(n);
                                break
                            }
                        J.onLoopDone(function() {
                            if (J.onLoopDone(null), J && t === u.BASE_GAME && e.response.PickerInput) {
                                "desktop" === window.location.search.match(/&?assetPack=([^&]+)&?/)[1] && (H.x = J.x + 369, H.y = J.y + 132), H.alpha = .3, H.scaleX = H.scaleY = .2, H.visible = !1, W.setDisplayValue(J.getDisplayValue()), J.playOpen(function() {
                                    H.visible = !0, C(w.resolveData), a.to(H, .3, {
                                        scaleX: 1,
                                        scaleY: 1,
                                        alpha: 1,
                                        ease: window.Back.easeOut.config(1.7)
                                    }), setTimeout(function() {
                                        o.publish(o.FROM_RESOLVE_STAGE)
                                    }, 2e3), d().execute("onFeature1Prompt")
                                })
                            } else setTimeout(function() {
                                d().execute("onFeature1Prompt"), w.getOptimalStrategy(w.resolveData) === O.ACCEPT && d().execute("onFeature1SelectGoodPick"), C(w.resolveData)
                            }, 800), o.publish(o.FROM_RESOLVE_STAGE)
                        })
                    }, this.getCurrentPickButton = function() {
                        return J
                    }, this.onAbortNextStage = function(e) {
                        k.addChild(J), J.reset(), w.setPickButtonsEnable(!1), h.prototype.onAbortNextStage(e)
                    }, this.onResetNextStage = function(e) {
                        w.setEnable(!0, !0), w.setPickButtonsEnable(!0), h.prototype.onResetNextStage(e)
                    }, this.onExitStage = function(e) {
                        e.response.OutcomeDetail.Stage === u.PUNCH_A_BUNCH && (w.unsubscribeToMsgBus(), r.publish(r.ON_STAGE_CHANGE, w.resolveData))
                    }, this.onTransitionDone = function() {
                        g(), h.prototype.onTransitionDone(), o.publish(o.FROM_EXIT_STAGE)
                    }, this.playIntro = function(e) {
                        m(), F.visible = !0, F.scaleX = F.scaleY = .8, setTimeout(function() {
                            a.to(F, .3, {
                                scaleX: 1,
                                scaleY: 1,
                                onComplete: function() {
                                    w.setEnable(!0, !0), y(e)
                                }
                            })
                        }, 300)
                    }, this.playOutro = function(e) {
                        ie.turnOff(500), b(function() {
                            J && (k.addChild(J), J = null), F.visible = !0, F.scaleX = F.scaleY = 1, a.to(F, .3, {
                                scaleX: .95,
                                scaleY: .95
                            }), setTimeout(function() {
                                e && e()
                            }, 100)
                        })
                    }, this.revealAllValues = function(e, t) {
                        w.resolveData = e, v();
                        var r = M(w.resolveData);
                        for (var n in r) D[n] && (D[n].setDisplayValue(r[n]), D[n] !== J ? (D[n].setState(4), i.lib._arPickerContainer.pixiContainer.addChild(J)) : D[n].setState(2));
                        setTimeout(function() {
                            t && t()
                        }, 1500)
                    }, this.playChaseLight = function(e) {
                        ie.startAnimation("punchABunch_trigger", 1, e, !1)
                    }, this.orientationChanged = function(e) {
                        h.prototype.orientationChanged(e), R(e.orientation)
                    }, this.getOptimalStrategy = function(e) {
                        var t = e.response.TriggerOutcome;
                        Array.isArray || (t = [t]);
                        for (var i = null, r = 0; r < t.length; r++) "PunchABunch.OptimalStrategy" === t[r]["@name"] && (i = t[r]);
                        var n = i.Trigger,
                            o = n["@name"],
                            s = null;
                        return "OptimalAccept" === o ? s = O.ACCEPT : "OptimalReject" === o ? s = O.REJECT : "NoSuggestion" === o && (s = O.NOSUGGESTION), s
                    }, this.getCurrentMultiplier = function(e) {
                        var t = "1X",
                            i = e.response.PickerInput.Pick["@name"],
                            r = e.response.PickerOutcome.Layer.Pick;
                        Array.isArray(r) || (r = [r]);
                        for (var n = 0; n < r.length; n++)
                            if (r[n]["@name"] === i) {
                                var o = r[n].Feature;
                                Array.isArray(o) || (o = [o]);
                                for (var s = 0; s < o.length; s++) "trigger" === o[s]["@type"] && (t = o[s]["@value"])
                            }
                        return t
                    }
                };
            return m.prototype = Object.create(h.prototype), m.prototype.constructor = m, m
        });
    var e = "undefined" != typeof module && module.exports && "undefined" != typeof global ? global : this || window;
    (e._gsQueue || (e._gsQueue = [])).push(function() {
            "use strict";
            e._gsDefine("TimelineMax", ["TimelineLite", "TweenLite", "easing.Ease"], function(t, i, r) {
                var n = function(e) {
                        t.call(this, e), this._repeat = this.vars.repeat || 0, this._repeatDelay = this.vars.repeatDelay || 0, this._cycle = 0, this._yoyo = !0 === this.vars.yoyo, this._dirty = !0
                    },
                    o = i._internals,
                    s = o.lazyTweens,
                    a = o.lazyRender,
                    l = e._gsDefine.globals,
                    u = new r(null, null, 1, 0),
                    c = n.prototype = new t;
                return c.constructor = n, c.kill()._gc = !1, n.version = "1.20.1", c.invalidate = function() {
                    return this._yoyo = !0 === this.vars.yoyo, this._repeat = this.vars.repeat || 0, this._repeatDelay = this.vars.repeatDelay || 0, this._uncache(!0), t.prototype.invalidate.call(this)
                }, c.addCallback = function(e, t, r, n) {
                    return this.add(i.delayedCall(0, e, r, n), t)
                }, c.removeCallback = function(e, t) {
                    if (e)
                        if (null == t) this._kill(null, e);
                        else
                            for (var i = this.getTweensOf(e, !1), r = i.length, n = this._parseTimeOrLabel(t); --r > -1;) i[r]._startTime === n && i[r]._enabled(!1, !1);
                    return this
                }, c.removePause = function(e) {
                    return this.removeCallback(t._internals.pauseCallback, e)
                }, c.tweenTo = function(e, t) {
                    t = t || {};
                    var r, n, o, s = {
                            ease: u,
                            useFrames: this.usesFrames(),
                            immediateRender: !1
                        },
                        a = t.repeat && l.TweenMax || i;
                    for (n in t) s[n] = t[n];
                    return s.time = this._parseTimeOrLabel(e), r = Math.abs(Number(s.time) - this._time) / this._timeScale || .001, o = new a(this, r, s), s.onStart = function() {
                        o.target.paused(!0), o.vars.time !== o.target.time() && r === o.duration() && o.duration(Math.abs(o.vars.time - o.target.time()) / o.target._timeScale), t.onStart && t.onStart.apply(t.onStartScope || t.callbackScope || o, t.onStartParams || [])
                    }, o
                }, c.tweenFromTo = function(e, t, i) {
                    i = i || {}, e = this._parseTimeOrLabel(e), i.startAt = {
                        onComplete: this.seek,
                        onCompleteParams: [e],
                        callbackScope: this
                    }, i.immediateRender = !1 !== i.immediateRender;
                    var r = this.tweenTo(t, i);
                    return r.duration(Math.abs(r.vars.time - e) / this._timeScale || .001)
                }, c.render = function(e, t, i) {
                    this._gc && this._enabled(!0, !1);
                    var r, n, o, l, u, c, h, d, p = this._dirty ? this.totalDuration() : this._totalDuration,
                        f = this._duration,
                        _ = this._time,
                        m = this._totalTime,
                        g = this._startTime,
                        v = this._timeScale,
                        y = this._rawPrevTime,
                        b = this._paused,
                        x = this._cycle;
                    if (e >= p - 1e-7 && e >= 0) this._locked || (this._totalTime = p, this._cycle = this._repeat), this._reversed || this._hasPausedChild() || (n = !0, l = "onComplete", u = !!this._timeline.autoRemoveChildren, 0 === this._duration && (e <= 0 && e >= -1e-7 || y < 0 || 1e-10 === y) && y !== e && this._first && (u = !0, y > 1e-10 && (l = "onReverseComplete"))), this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : 1e-10, this._yoyo && 0 != (1 & this._cycle) ? this._time = e = 0 : (this._time = f, e = f + 1e-4);
                    else if (e < 1e-7)
                        if (this._locked || (this._totalTime = this._cycle = 0), this._time = 0, (0 !== _ || 0 === f && 1e-10 !== y && (y > 0 || e < 0 && y >= 0) && !this._locked) && (l = "onReverseComplete", n = this._reversed), e < 0) this._active = !1, this._timeline.autoRemoveChildren && this._reversed ? (u = n = !0, l = "onReverseComplete") : y >= 0 && this._first && (u = !0), this._rawPrevTime = e;
                        else {
                            if (this._rawPrevTime = f || !t || e || this._rawPrevTime === e ? e : 1e-10, 0 === e && n)
                                for (r = this._first; r && 0 === r._startTime;) r._duration || (n = !1), r = r._next;
                            e = 0, this._initted || (u = !0)
                        }
                    else if (0 === f && y < 0 && (u = !0), this._time = this._rawPrevTime = e, this._locked || (this._totalTime = e, 0 !== this._repeat && (c = f + this._repeatDelay, this._cycle = this._totalTime / c >> 0, 0 !== this._cycle && this._cycle === this._totalTime / c && m <= e && this._cycle--, this._time = this._totalTime - this._cycle * c, this._yoyo && 0 != (1 & this._cycle) && (this._time = f - this._time), this._time > f ? (this._time = f, e = f + 1e-4) : this._time < 0 ? this._time = e = 0 : e = this._time)), this._hasPause && !this._forcingPlayhead && !t) {
                        if ((e = this._time) >= _ || this._repeat && x !== this._cycle)
                            for (r = this._first; r && r._startTime <= e && !h;) r._duration || "isPause" !== r.data || r.ratio || 0 === r._startTime && 0 === this._rawPrevTime || (h = r), r = r._next;
                        else
                            for (r = this._last; r && r._startTime >= e && !h;) r._duration || "isPause" === r.data && r._rawPrevTime > 0 && (h = r), r = r._prev;
                        h && h._startTime < f && (this._time = e = h._startTime, this._totalTime = e + this._cycle * (this._totalDuration + this._repeatDelay))
                    }
                    if (this._cycle !== x && !this._locked) {
                        var T = this._yoyo && 0 != (1 & x),
                            E = T === (this._yoyo && 0 != (1 & this._cycle)),
                            S = this._totalTime,
                            P = this._cycle,
                            A = this._rawPrevTime,
                            C = this._time;
                        if (this._totalTime = x * f, this._cycle < x ? T = !T : this._totalTime += f, this._time = _, this._rawPrevTime = 0 === f ? y - 1e-4 : y, this._cycle = x, this._locked = !0, _ = T ? 0 : f, this.render(_, t, 0 === f), t || this._gc || this.vars.onRepeat && (this._cycle = P, this._locked = !1, this._callback("onRepeat")), _ !== this._time) return;
                        if (E && (this._cycle = x, this._locked = !0, _ = T ? f + 1e-4 : -1e-4, this.render(_, !0, !1)), this._locked = !1, this._paused && !b) return;
                        this._time = C, this._totalTime = S, this._cycle = P, this._rawPrevTime = A
                    }
                    if (!(this._time !== _ && this._first || i || u || h)) return void(m !== this._totalTime && this._onUpdate && (t || this._callback("onUpdate")));
                    if (this._initted || (this._initted = !0), this._active || !this._paused && this._totalTime !== m && e > 0 && (this._active = !0), 0 === m && this.vars.onStart && (0 === this._totalTime && this._totalDuration || t || this._callback("onStart")), (d = this._time) >= _)
                        for (r = this._first; r && (o = r._next, d === this._time && (!this._paused || b));)(r._active || r._startTime <= this._time && !r._paused && !r._gc) && (h === r && this.pause(), r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, i) : r.render((e - r._startTime) * r._timeScale, t, i)), r = o;
                    else
                        for (r = this._last; r && (o = r._prev, d === this._time && (!this._paused || b));) {
                            if (r._active || r._startTime <= _ && !r._paused && !r._gc) {
                                if (h === r) {
                                    for (h = r._prev; h && h.endTime() > this._time;) h.render(h._reversed ? h.totalDuration() - (e - h._startTime) * h._timeScale : (e - h._startTime) * h._timeScale, t, i), h = h._prev;
                                    h = null, this.pause()
                                }
                                r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, i) : r.render((e - r._startTime) * r._timeScale, t, i)
                            }
                            r = o
                        }
                    this._onUpdate && (t || (s.length && a(), this._callback("onUpdate"))), l && (this._locked || this._gc || g !== this._startTime && v === this._timeScale || (0 === this._time || p >= this.totalDuration()) && (n && (s.length && a(), this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[l] && this._callback(l)))
                }, c.getActive = function(e, t, i) {
                    null == e && (e = !0), null == t && (t = !0), null == i && (i = !1);
                    var r, n, o = [],
                        s = this.getChildren(e, t, i),
                        a = 0,
                        l = s.length;
                    for (r = 0; r < l; r++) n = s[r], n.isActive() && (o[a++] = n);
                    return o
                }, c.getLabelAfter = function(e) {
                    e || 0 !== e && (e = this._time);
                    var t, i = this.getLabelsArray(),
                        r = i.length;
                    for (t = 0; t < r; t++)
                        if (i[t].time > e) return i[t].name;
                    return null
                }, c.getLabelBefore = function(e) {
                    null == e && (e = this._time);
                    for (var t = this.getLabelsArray(), i = t.length; --i > -1;)
                        if (t[i].time < e) return t[i].name;
                    return null
                }, c.getLabelsArray = function() {
                    var e, t = [],
                        i = 0;
                    for (e in this._labels) t[i++] = {
                        time: this._labels[e],
                        name: e
                    };
                    return t.sort(function(e, t) {
                        return e.time - t.time
                    }), t
                }, c.invalidate = function() {
                    return this._locked = !1, t.prototype.invalidate.call(this)
                }, c.progress = function(e, t) {
                    return arguments.length ? this.totalTime(this.duration() * (this._yoyo && 0 != (1 & this._cycle) ? 1 - e : e) + this._cycle * (this._duration + this._repeatDelay), t) : this._time / this.duration() || 0
                }, c.totalProgress = function(e, t) {
                    return arguments.length ? this.totalTime(this.totalDuration() * e, t) : this._totalTime / this.totalDuration() || 0
                }, c.totalDuration = function(e) {
                    return arguments.length ? -1 !== this._repeat && e ? this.timeScale(this.totalDuration() / e) : this : (this._dirty && (t.prototype.totalDuration.call(this), this._totalDuration = -1 === this._repeat ? 999999999999 : this._duration * (this._repeat + 1) + this._repeatDelay * this._repeat), this._totalDuration)
                }, c.time = function(e, t) {
                    return arguments.length ? (this._dirty && this.totalDuration(), e > this._duration && (e = this._duration), this._yoyo && 0 != (1 & this._cycle) ? e = this._duration - e + this._cycle * (this._duration + this._repeatDelay) : 0 !== this._repeat && (e += this._cycle * (this._duration + this._repeatDelay)), this.totalTime(e, t)) : this._time
                }, c.repeat = function(e) {
                    return arguments.length ? (this._repeat = e, this._uncache(!0)) : this._repeat
                }, c.repeatDelay = function(e) {
                    return arguments.length ? (this._repeatDelay = e, this._uncache(!0)) : this._repeatDelay
                }, c.yoyo = function(e) {
                    return arguments.length ? (this._yoyo = e, this) : this._yoyo
                }, c.currentLabel = function(e) {
                    return arguments.length ? this.seek(e, !0) : this.getLabelBefore(this._time + 1e-8)
                }, n
            }, !0), e._gsDefine("TimelineLite", ["core.Animation", "core.SimpleTimeline", "TweenLite"], function(t, i, r) {
                var n = function(e) {
                        i.call(this, e), this._labels = {}, this.autoRemoveChildren = !0 === this.vars.autoRemoveChildren, this.smoothChildTiming = !0 === this.vars.smoothChildTiming, this._sortChildren = !0, this._onUpdate = this.vars.onUpdate;
                        var t, r, n = this.vars;
                        for (r in n) t = n[r], l(t) && -1 !== t.join("").indexOf("{self}") && (n[r] = this._swapSelfInParams(t));
                        l(n.tweens) && this.add(n.tweens, 0, n.align, n.stagger)
                    },
                    o = r._internals,
                    s = n._internals = {},
                    a = o.isSelector,
                    l = o.isArray,
                    u = o.lazyTweens,
                    c = o.lazyRender,
                    h = e._gsDefine.globals,
                    d = function(e) {
                        var t, i = {};
                        for (t in e) i[t] = e[t];
                        return i
                    },
                    p = function(e, t, i) {
                        var r, n, o = e.cycle;
                        for (r in o) n = o[r], e[r] = "function" == typeof n ? n(i, t[i]) : n[i % n.length];
                        delete e.cycle
                    },
                    f = s.pauseCallback = function() {},
                    _ = function(e) {
                        var t, i = [],
                            r = e.length;
                        for (t = 0; t !== r; i.push(e[t++]));
                        return i
                    },
                    m = n.prototype = new i;
                return n.version = "1.20.1", m.constructor = n, m.kill()._gc = m._forcingPlayhead = m._hasPause = !1, m.to = function(e, t, i, n) {
                    var o = i.repeat && h.TweenMax || r;
                    return t ? this.add(new o(e, t, i), n) : this.set(e, i, n)
                }, m.from = function(e, t, i, n) {
                    return this.add((i.repeat && h.TweenMax || r).from(e, t, i), n)
                }, m.fromTo = function(e, t, i, n, o) {
                    var s = n.repeat && h.TweenMax || r;
                    return t ? this.add(s.fromTo(e, t, i, n), o) : this.set(e, n, o)
                }, m.staggerTo = function(e, t, i, o, s, l, u, c) {
                    var h, f, m = new n({
                            onComplete: l,
                            onCompleteParams: u,
                            callbackScope: c,
                            smoothChildTiming: this.smoothChildTiming
                        }),
                        g = i.cycle;
                    for ("string" == typeof e && (e = r.selector(e) || e), e = e || [], a(e) && (e = _(e)), o = o || 0, o < 0 && (e = _(e), e.reverse(), o *= -1), f = 0; f < e.length; f++) h = d(i), h.startAt && (h.startAt = d(h.startAt), h.startAt.cycle && p(h.startAt, e, f)), g && (p(h, e, f), null != h.duration && (t = h.duration, delete h.duration)), m.to(e[f], t, h, f * o);
                    return this.add(m, s)
                }, m.staggerFrom = function(e, t, i, r, n, o, s, a) {
                    return i.immediateRender = 0 != i.immediateRender, i.runBackwards = !0, this.staggerTo(e, t, i, r, n, o, s, a)
                }, m.staggerFromTo = function(e, t, i, r, n, o, s, a, l) {
                    return r.startAt = i, r.immediateRender = 0 != r.immediateRender && 0 != i.immediateRender, this.staggerTo(e, t, r, n, o, s, a, l)
                }, m.call = function(e, t, i, n) {
                    return this.add(r.delayedCall(0, e, t, i), n)
                }, m.set = function(e, t, i) {
                    return i = this._parseTimeOrLabel(i, 0, !0), null == t.immediateRender && (t.immediateRender = i === this._time && !this._paused), this.add(new r(e, 0, t), i)
                }, n.exportRoot = function(e, t) {
                    e = e || {}, null == e.smoothChildTiming && (e.smoothChildTiming = !0);
                    var i, o, s = new n(e),
                        a = s._timeline;
                    for (null == t && (t = !0), a._remove(s, !0), s._startTime = 0, s._rawPrevTime = s._time = s._totalTime = a._time, i = a._first; i;) o = i._next, t && i instanceof r && i.target === i.vars.onComplete || s.add(i, i._startTime - i._delay), i = o;
                    return a.add(s, 0), s
                }, m.add = function(e, o, s, a) {
                    var u, c, h, d, p, f;
                    if ("number" != typeof o && (o = this._parseTimeOrLabel(o, 0, !0, e)), !(e instanceof t)) {
                        if (e instanceof Array || e && e.push && l(e)) {
                            for (s = s || "normal", a = a || 0, u = o, c = e.length, h = 0; h < c; h++) l(d = e[h]) && (d = new n({
                                tweens: d
                            })), this.add(d, u), "string" != typeof d && "function" != typeof d && ("sequence" === s ? u = d._startTime + d.totalDuration() / d._timeScale : "start" === s && (d._startTime -= d.delay())), u += a;
                            return this._uncache(!0)
                        }
                        if ("string" == typeof e) return this.addLabel(e, o);
                        if ("function" != typeof e) throw "Cannot add " + e + " into the timeline; it is not a tween, timeline, function, or string.";
                        e = r.delayedCall(0, e)
                    }
                    if (i.prototype.add.call(this, e, o), e._time && e.render((this.rawTime() - e._startTime) * e._timeScale, !1, !1), (this._gc || this._time === this._duration) && !this._paused && this._duration < this.duration())
                        for (p = this, f = p.rawTime() > e._startTime; p._timeline;) f && p._timeline.smoothChildTiming ? p.totalTime(p._totalTime, !0) : p._gc && p._enabled(!0, !1), p = p._timeline;
                    return this
                }, m.remove = function(e) {
                    if (e instanceof t) {
                        this._remove(e, !1);
                        var i = e._timeline = e.vars.useFrames ? t._rootFramesTimeline : t._rootTimeline;
                        return e._startTime = (e._paused ? e._pauseTime : i._time) - (e._reversed ? e.totalDuration() - e._totalTime : e._totalTime) / e._timeScale, this
                    }
                    if (e instanceof Array || e && e.push && l(e)) {
                        for (var r = e.length; --r > -1;) this.remove(e[r]);
                        return this
                    }
                    return "string" == typeof e ? this.removeLabel(e) : this.kill(null, e)
                }, m._remove = function(e, t) {
                    return i.prototype._remove.call(this, e, t), this._last ? this._time > this.duration() && (this._time = this._duration, this._totalTime = this._totalDuration) : this._time = this._totalTime = this._duration = this._totalDuration = 0, this
                }, m.append = function(e, t) {
                    return this.add(e, this._parseTimeOrLabel(null, t, !0, e))
                }, m.insert = m.insertMultiple = function(e, t, i, r) {
                    return this.add(e, t || 0, i, r)
                }, m.appendMultiple = function(e, t, i, r) {
                    return this.add(e, this._parseTimeOrLabel(null, t, !0, e), i, r)
                }, m.addLabel = function(e, t) {
                    return this._labels[e] = this._parseTimeOrLabel(t), this
                }, m.addPause = function(e, t, i, n) {
                    var o = r.delayedCall(0, f, i, n || this);
                    return o.vars.onComplete = o.vars.onReverseComplete = t, o.data = "isPause", this._hasPause = !0, this.add(o, e)
                }, m.removeLabel = function(e) {
                    return delete this._labels[e], this
                }, m.getLabelTime = function(e) {
                    return null != this._labels[e] ? this._labels[e] : -1
                }, m._parseTimeOrLabel = function(e, i, r, n) {
                    var o, s;
                    if (n instanceof t && n.timeline === this) this.remove(n);
                    else if (n && (n instanceof Array || n.push && l(n)))
                        for (s = n.length; --s > -1;) n[s] instanceof t && n[s].timeline === this && this.remove(n[s]);
                    if (o = this.duration() > 99999999999 ? this.recent().endTime(!1) : this._duration, "string" == typeof i) return this._parseTimeOrLabel(i, r && "number" == typeof e && null == this._labels[i] ? e - o : 0, r);
                    if (i = i || 0, "string" != typeof e || !isNaN(e) && null == this._labels[e]) null == e && (e = o);
                    else {
                        if (-1 === (s = e.indexOf("="))) return null == this._labels[e] ? r ? this._labels[e] = o + i : i : this._labels[e] + i;
                        i = parseInt(e.charAt(s - 1) + "1", 10) * Number(e.substr(s + 1)), e = s > 1 ? this._parseTimeOrLabel(e.substr(0, s - 1), 0, r) : o
                    }
                    return Number(e) + i
                }, m.seek = function(e, t) {
                    return this.totalTime("number" == typeof e ? e : this._parseTimeOrLabel(e), !1 !== t)
                }, m.stop = function() {
                    return this.paused(!0)
                }, m.gotoAndPlay = function(e, t) {
                    return this.play(e, t)
                }, m.gotoAndStop = function(e, t) {
                    return this.pause(e, t)
                }, m.render = function(e, t, i) {
                    this._gc && this._enabled(!0, !1);
                    var r, n, o, s, a, l, h, d = this._dirty ? this.totalDuration() : this._totalDuration,
                        p = this._time,
                        f = this._startTime,
                        _ = this._timeScale,
                        m = this._paused;
                    if (e >= d - 1e-7 && e >= 0) this._totalTime = this._time = d, this._reversed || this._hasPausedChild() || (n = !0, s = "onComplete", a = !!this._timeline.autoRemoveChildren, 0 === this._duration && (e <= 0 && e >= -1e-7 || this._rawPrevTime < 0 || 1e-10 === this._rawPrevTime) && this._rawPrevTime !== e && this._first && (a = !0, this._rawPrevTime > 1e-10 && (s = "onReverseComplete"))), this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : 1e-10, e = d + 1e-4;
                    else if (e < 1e-7)
                        if (this._totalTime = this._time = 0, (0 !== p || 0 === this._duration && 1e-10 !== this._rawPrevTime && (this._rawPrevTime > 0 || e < 0 && this._rawPrevTime >= 0)) && (s = "onReverseComplete", n = this._reversed), e < 0) this._active = !1, this._timeline.autoRemoveChildren && this._reversed ? (a = n = !0, s = "onReverseComplete") : this._rawPrevTime >= 0 && this._first && (a = !0), this._rawPrevTime = e;
                        else {
                            if (this._rawPrevTime = this._duration || !t || e || this._rawPrevTime === e ? e : 1e-10, 0 === e && n)
                                for (r = this._first; r && 0 === r._startTime;) r._duration || (n = !1), r = r._next;
                            e = 0, this._initted || (a = !0)
                        }
                    else {
                        if (this._hasPause && !this._forcingPlayhead && !t) {
                            if (e >= p)
                                for (r = this._first; r && r._startTime <= e && !l;) r._duration || "isPause" !== r.data || r.ratio || 0 === r._startTime && 0 === this._rawPrevTime || (l = r), r = r._next;
                            else
                                for (r = this._last; r && r._startTime >= e && !l;) r._duration || "isPause" === r.data && r._rawPrevTime > 0 && (l = r), r = r._prev;
                            l && (this._time = e = l._startTime, this._totalTime = e + this._cycle * (this._totalDuration + this._repeatDelay))
                        }
                        this._totalTime = this._time = this._rawPrevTime = e
                    }
                    if (this._time !== p && this._first || i || a || l) {
                        if (this._initted || (this._initted = !0), this._active || !this._paused && this._time !== p && e > 0 && (this._active = !0), 0 === p && this.vars.onStart && (0 === this._time && this._duration || t || this._callback("onStart")), (h = this._time) >= p)
                            for (r = this._first; r && (o = r._next, h === this._time && (!this._paused || m));)(r._active || r._startTime <= h && !r._paused && !r._gc) && (l === r && this.pause(), r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, i) : r.render((e - r._startTime) * r._timeScale, t, i)), r = o;
                        else
                            for (r = this._last; r && (o = r._prev, h === this._time && (!this._paused || m));) {
                                if (r._active || r._startTime <= p && !r._paused && !r._gc) {
                                    if (l === r) {
                                        for (l = r._prev; l && l.endTime() > this._time;) l.render(l._reversed ? l.totalDuration() - (e - l._startTime) * l._timeScale : (e - l._startTime) * l._timeScale, t, i), l = l._prev;
                                        l = null, this.pause()
                                    }
                                    r._reversed ? r.render((r._dirty ? r.totalDuration() : r._totalDuration) - (e - r._startTime) * r._timeScale, t, i) : r.render((e - r._startTime) * r._timeScale, t, i)
                                }
                                r = o
                            }
                        this._onUpdate && (t || (u.length && c(), this._callback("onUpdate"))), s && (this._gc || f !== this._startTime && _ === this._timeScale || (0 === this._time || d >= this.totalDuration()) && (n && (u.length && c(), this._timeline.autoRemoveChildren && this._enabled(!1, !1), this._active = !1), !t && this.vars[s] && this._callback(s)))
                    }
                }, m._hasPausedChild = function() {
                    for (var e = this._first; e;) {
                        if (e._paused || e instanceof n && e._hasPausedChild()) return !0;
                        e = e._next
                    }
                    return !1
                }, m.getChildren = function(e, t, i, n) {
                    n = n || -9999999999;
                    for (var o = [], s = this._first, a = 0; s;) s._startTime < n || (s instanceof r ? !1 !== t && (o[a++] = s) : (!1 !== i && (o[a++] = s), !1 !== e && (o = o.concat(s.getChildren(!0, t, i)), a = o.length))), s = s._next;
                    return o
                }, m.getTweensOf = function(e, t) {
                    var i, n, o = this._gc,
                        s = [],
                        a = 0;
                    for (o && this._enabled(!0, !0), i = r.getTweensOf(e), n = i.length; --n > -1;)(i[n].timeline === this || t && this._contains(i[n])) && (s[a++] = i[n]);
                    return o && this._enabled(!1, !0), s
                }, m.recent = function() {
                    return this._recent
                }, m._contains = function(e) {
                    for (var t = e.timeline; t;) {
                        if (t === this) return !0;
                        t = t.timeline
                    }
                    return !1
                }, m.shiftChildren = function(e, t, i) {
                    i = i || 0;
                    for (var r, n = this._first, o = this._labels; n;) n._startTime >= i && (n._startTime += e), n = n._next;
                    if (t)
                        for (r in o) o[r] >= i && (o[r] += e);
                    return this._uncache(!0)
                }, m._kill = function(e, t) {
                    if (!e && !t) return this._enabled(!1, !1);
                    for (var i = t ? this.getTweensOf(t) : this.getChildren(!0, !0, !1), r = i.length, n = !1; --r > -1;) i[r]._kill(e, t) && (n = !0);
                    return n
                }, m.clear = function(e) {
                    var t = this.getChildren(!1, !0, !0),
                        i = t.length;
                    for (this._time = this._totalTime = 0; --i > -1;) t[i]._enabled(!1, !1);
                    return !1 !== e && (this._labels = {}), this._uncache(!0)
                }, m.invalidate = function() {
                    for (var e = this._first; e;) e.invalidate(), e = e._next;
                    return t.prototype.invalidate.call(this)
                }, m._enabled = function(e, t) {
                    if (e === this._gc)
                        for (var r = this._first; r;) r._enabled(e, !0), r = r._next;
                    return i.prototype._enabled.call(this, e, t)
                }, m.totalTime = function(e, i, r) {
                    this._forcingPlayhead = !0;
                    var n = t.prototype.totalTime.apply(this, arguments);
                    return this._forcingPlayhead = !1, n
                }, m.duration = function(e) {
                    return arguments.length ? (0 !== this.duration() && 0 !== e && this.timeScale(this._duration / e), this) : (this._dirty && this.totalDuration(), this._duration)
                }, m.totalDuration = function(e) {
                    if (!arguments.length) {
                        if (this._dirty) {
                            for (var t, i, r = 0, n = this._last, o = 999999999999; n;) t = n._prev, n._dirty && n.totalDuration(), n._startTime > o && this._sortChildren && !n._paused ? this.add(n, n._startTime - n._delay) : o = n._startTime, n._startTime < 0 && !n._paused && (r -= n._startTime, this._timeline.smoothChildTiming && (this._startTime += n._startTime / this._timeScale), this.shiftChildren(-n._startTime, !1, -9999999999), o = 0), i = n._startTime + n._totalDuration / n._timeScale, i > r && (r = i), n = t;
                            this._duration = this._totalDuration = r, this._dirty = !1
                        }
                        return this._totalDuration
                    }
                    return e && this.totalDuration() ? this.timeScale(this._totalDuration / e) : this
                }, m.paused = function(e) {
                    if (!e)
                        for (var i = this._first, r = this._time; i;) i._startTime === r && "isPause" === i.data && (i._rawPrevTime = 0), i = i._next;
                    return t.prototype.paused.apply(this, arguments)
                }, m.usesFrames = function() {
                    for (var e = this._timeline; e._timeline;) e = e._timeline;
                    return e === t._rootFramesTimeline
                }, m.rawTime = function(e) {
                    return e && (this._paused || this._repeat && this.time() > 0 && this.totalProgress() < 1) ? this._totalTime % (this._duration + this._repeatDelay) : this._paused ? this._totalTime : (this._timeline.rawTime(e) - this._startTime) * this._timeScale
                }, n
            }, !0)
        }), e._gsDefine && e._gsQueue.pop()(),
        function(t) {
            "use strict";
            var i = function() {
                return (e.GreenSockGlobals || e).TimelineMax
            };
            "undefined" != typeof module && module.exports ? (require("./TweenLite.js"), module.exports = i()) : "function" == typeof define && define.amd && define("com/gsap/TimelineMax", ["TweenLite"], i)
        }(), define("game/views/PABAcceptRejectSVC", ["require", "com/pixijs/pixi", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/data/gameEvents", "game/commonUI/slot/betData", "game/data/stateEvents", "game/utils/miscUtils", "game/utils/textUtils", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "com/gsap/TweenMax", "com/gsap/TimelineMax", "game/data/setupData", "game/components/basicButton", "game/components/punchABunchButton", "game/views/core/gameSVC", "game/core/PlatformManager", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                r = e("game/data/gameEvents"),
                n = e("game/commonUI/slot/betData"),
                o = e("game/data/stateEvents"),
                s = e("game/utils/miscUtils"),
                a = e("game/utils/textUtils"),
                l = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                u = e("com/gsap/TweenMax"),
                c = e("com/gsap/TimelineMax"),
                h = e("game/data/setupData"),
                d = e("game/components/basicButton"),
                p = e("game/components/punchABunchButton"),
                f = e("game/views/core/gameSVC"),
                _ = e("game/core/PlatformManager"),
                m = e("game/components/createJsAudioPlayer/SoundManager"),
                g = function() {
                    function e() {
                        if (w) {
                            var e = l.i18n.PunchABunch.arPlaqueTextTop;
                            e = e.replace("[value]", w.getDisplayValue()), I.setText(e), a.textFitWidth(I, 280, !1)
                        }
                    }

                    function g() {
                        m().execute("onFeature1PromptAccept"), F.visible = !1, y("accept")
                    }

                    function v() {
                        m().execute("onFeature1PromptReject"), F.visible = !1, y("reject")
                    }

                    function y(e) {
                        b(!1), "reject" === e && w.setState(4), P.playDataPayload = {
                            ActionInput: {
                                Action: e
                            },
                            PatternSliderInput: {
                                BetPerPattern: n.betPerPattern,
                                PatternsBet: n.patternsBet
                            }
                        }, m().execute("onFeature1Prompt"), o.publish(o.FROM_BEFORE_REQUEST)
                    }

                    function b(e) {
                        e !== B && (B = e, R.enable = B, O.enable = B)
                    }
                    var x = Object.freeze({
                            ACCEPT: 0,
                            REJECT: 1,
                            NOSUGGESTION: 2
                        }),
                        T = Object.freeze({
                            TotalTweenTime: .65,
                            AlphaFadeDelay: .4
                        });
                    f.call(this);
                    var E = this,
                        S = null,
                        P = null,
                        A = null,
                        C = null,
                        M = null,
                        R = null,
                        O = null,
                        w = null,
                        I = null,
                        D = null,
                        L = null,
                        B = !0,
                        F = null,
                        N = null;
                    this.systemInit = function(e, r) {
                        f.prototype.systemInit(e), L = r, P = _(), A = i.lib._arPlaqueContainer.pixiContainer, C = i.lib._arPlaque.pixiContainer;
                        var n = i.lib._arAcceptBtn.pixiContainer;
                        R = new d, R.init({
                            enabled: "accept_button_static",
                            disabled: "accept_button_inactive",
                            over: "accept_button_over",
                            pressed: "accept_button_pressed"
                        }, g), R.x = n.x - n.width / 2, R.y = n.y - n.height / 2, C.removeChild(n), C.addChild(R);
                        var o = i.lib._arRejectBtn.pixiContainer;
                        O = new d, O.init({
                            enabled: "reject_button_static",
                            disabled: "reject_button_inactive",
                            over: "reject_button_over",
                            pressed: "reject_button_pressed"
                        }, v), O.x = o.x - o.width / 2, O.y = o.y - o.height / 2, C.removeChild(o), C.addChild(O), F = s.spriteFromTexture("punchABunch_buttonGlow", "centre"), F.visible = !1, F.x = R.x + R.width / 2, F.y = R.y + R.height / 2, C.addChild(F), M = new p, M.init(null, null), M.x = 228, M.y = 138, M.setState(2), C.addChild(M), I = a.addBasicText(i.lib._arPlaque.pixiContainer, "", [230.5, 59], 26, 16777215, "OswaldLocCurrency-Medium", "center", 4, 0), I.anchor = new t.Point(.5, .5), D = a.addBasicText(i.lib._arPlaque.pixiContainer, "", [230.5, 215.5], 26, 16777215, "OswaldLocCurrency-Medium", "left", 4, 0), D.anchor = new t.Point(.5, .5), D.setText(l.i18n.PunchABunch.arPlaqueTextBottom), a.textFitWidth(D, 350, !1), A.visible = !1
                    }, this.stageInit = function(t, i, r) {
                        f.prototype.stageInit(t), S = t, w = i, t.response.OutcomeDetail.NextStage === h.PUNCH_A_BUNCH_ACCEPT_REJECT ? (this.subscribeToMsgBus(), this.playIntro(t, null, !1, w), r === x.ACCEPT || r === x.REJECT ? (r === x.ACCEPT ? (F.x = R.x + R.width / 2 + R.width / 93.33, F.y = R.y + R.height / 2) : r === x.REJECT && (F.x = O.x + O.width / 2 + O.width / 93.33, F.y = O.y + O.height / 2), F.visible = !0, F.scaleX = F.scaleY = .75, F.alpha = 1, u.killTweensOf(F), N && N.kill(), u.to(F, T.TotalTweenTime, {
                            scaleX: 1.25,
                            scaleY: 1.25,
                            repeat: -1
                        }), N = new c({
                            repeat: -1
                        }), N.to(F, T.AlphaFadeDelay, {
                            alpha: 1
                        }).to(F, T.TotalTweenTime - T.AlphaFadeDelay, {
                            alpha: 0
                        }).to(F, 0, {
                            alpha: 1
                        })) : r === x.NOSUGGESTION && (F.visible = !1, F.alpha = 0)) : (e(), A.visible = !1)
                    };
                    var V = !1;
                    this.subscribeToMsgBus = function() {
                        if (!V) {
                            f.prototype.subscribeToMsgBus.bind(this)(), V = !0
                        }
                    }, this.unsubscribeToMsgBus = function() {
                        f.prototype.unsubscribeToMsgBus.bind(this)(), V = !1
                    }, this.onBeforeRequest = function() {
                        b(!0)
                    }, this.onResolveStage = function(e) {
                        S = e, o.publish(o.FROM_RESOLVE_STAGE)
                    }, this.onAbortNextStage = function(e) {
                        f.prototype.onAbortNextStage(e)
                    }, this.onResetNextStage = function(e) {
                        O.reset(), R.reset(), F.visible = !0, f.prototype.onResetNextStage(e), o.publish(o.FROM_RESET_NEXT_STAGE)
                    }, this.onExitStage = function(e) {
                        e.response.OutcomeDetail.Stage === h.PUNCH_A_BUNCH_ACCEPT_REJECT && (E.unsubscribeToMsgBus(), r.publish(r.ON_STAGE_CHANGE, S))
                    }, this.onTransitionDone = function() {
                        f.prototype.onTransitionDone(), o.publish(o.FROM_EXIT_STAGE)
                    }, this.playIntro = function(t, r, n, o) {
                        w = o, i.lib._arPickerContainer.pixiContainer.addChild(w), "desktop" === window.location.search.match(/&?assetPack=([^&]+)&?/)[1] && (A.x = w.x + 149, A.y = w.y + 22), M.setDisplayValue(w.getDisplayValue()), e(), b(!1), n ? (C.visible = !1, A.visible = !0, w.playOpen(function() {
                            C.alpha = .3, C.scaleX = C.scaleY = .2, C.visible = !0, u.to(C, .3, {
                                scaleX: 1,
                                scaleY: 1,
                                alpha: 1,
                                ease: window.Back.easeOut.config(1.7),
                                onComplete: function() {
                                    r && r()
                                }
                            })
                        })) : (w.setState(2), C.alpha = 1, C.scaleX = C.scaleY = 1, A.visible = !0, r && r())
                    }, this.playOutro = function(e) {
                        A.visible = !0, C.alpha = 1, C.scaleX = C.scaleY = 1, u.to(C, .3, {
                            scaleX: .2,
                            scaleY: .2,
                            alpha: 0,
                            ease: window.Back.easeIn.config(1.7),
                            onComplete: function() {
                                w && i.lib._pabPickerContainer.pixiContainer.addChild(w), A.visible = !1, e && e()
                            }
                        })
                    }, this.orientationChanged = function(e) {
                        L.orientationChanged(e)
                    }
                };
            return g.prototype = Object.create(f.prototype), g.prototype.constructor = g, g
        }),
        function(e, t) {
            var i = [],
                r = e.CANNON || this.CANNON,
                n = e.OIMO || this.OIMO,
                o = e.earcut || this.earcut;
            if ("object" == typeof exports && "object" == typeof module) {
                try {
                    r = r || require("cannon")
                } catch (e) {}
                try {
                    n = n || require("oimo")
                } catch (e) {}
                try {
                    o = o || require("earcut")
                } catch (e) {}
                module.exports = t(r, n, o)
            } else if ("function" == typeof define && define.amd) require.specified && require.specified("cannon") && i.push("cannon"), require.specified && require.specified("oimo") && i.push("oimo"), require.specified && require.specified("earcut") && i.push("earcut"), define("babylonjs", i, t);
            else if ("object" == typeof exports) {
                try {
                    r = r || require("cannon")
                } catch (e) {}
                try {
                    n = n || require("oimo")
                } catch (e) {}
                try {
                    o = o || require("earcut")
                } catch (e) {}
                exports.babylonjs = t(r, n, o)
            } else e.BABYLON = t(r, n, o)
        }(this, function(e, t, i) {
            e = e || this.CANNON, t = t || this.OIMO, i = i || this.earcut;
            var r, n, o, s, a, l, u, c, h, d, p, f, _, m, g, v, y = this && this.__decorate || function(e, t, i, r) {
                    var n, o = arguments.length,
                        s = o < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r;
                    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, i, r);
                    else
                        for (var a = e.length - 1; 0 <= a; a--)(n = e[a]) && (s = (o < 3 ? n(s) : 3 < o ? n(t, i, s) : n(t, i)) || s);
                    return 3 < o && s && Object.defineProperty(t, i, s), s
                },
                b = this && this.__extends || (r = Object.setPrototypeOf || {
                        __proto__: []
                    }
                    instanceof Array && function(e, t) {
                        e.__proto__ = t
                    } || function(e, t) {
                        for (var i in t) t.hasOwnProperty(i) && (e[i] = t[i])
                    },
                    function(e, t) {
                        function i() {
                            this.constructor = e
                        }
                        r(e, t), e.prototype = null === t ? Object.create(t) : (i.prototype = t.prototype, new i)
                    });
            ! function(e) {
                var t = function() {
                    function e() {
                        this._defines = {}, this._currentRank = 32, this._maxRank = -1
                    }
                    return e.prototype.unBindMesh = function() {
                        this._mesh = null
                    }, e.prototype.addFallback = function(e, t) {
                        this._defines[e] || (e < this._currentRank && (this._currentRank = e), e > this._maxRank && (this._maxRank = e), this._defines[e] = new Array), this._defines[e].push(t)
                    }, e.prototype.addCPUSkinningFallback = function(e, t) {
                        this._mesh = t, e < this._currentRank && (this._currentRank = e), e > this._maxRank && (this._maxRank = e)
                    }, Object.defineProperty(e.prototype, "isMoreFallbacks", {
                        get: function() {
                            return this._currentRank <= this._maxRank
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.reduce = function(e, t) {
                        if (this._mesh && this._mesh.computeBonesUsingShaders && 0 < this._mesh.numBoneInfluencers && this._mesh.material) {
                            this._mesh.computeBonesUsingShaders = !1, e = e.replace("#define NUM_BONE_INFLUENCERS " + this._mesh.numBoneInfluencers, "#define NUM_BONE_INFLUENCERS 0"), t._bonesComputationForcedToCPU = !0;
                            for (var i = this._mesh.getScene(), r = 0; r < i.meshes.length; r++) {
                                var n = i.meshes[r];
                                if (n.material && n.computeBonesUsingShaders && 0 !== n.numBoneInfluencers)
                                    if (n.material.getEffect() === t) n.computeBonesUsingShaders = !1;
                                    else if (n.subMeshes)
                                    for (var o = 0, s = n.subMeshes; o < s.length; o++)
                                        if (s[o].effect === t) {
                                            n.computeBonesUsingShaders = !1;
                                            break
                                        }
                            }
                        } else {
                            var a = this._defines[this._currentRank];
                            if (a)
                                for (r = 0; r < a.length; r++) e = e.replace("#define " + a[r], "");
                            this._currentRank++
                        }
                        return e
                    }, e
                }();
                e.EffectFallbacks = t;
                var i = function() {};
                e.EffectCreationOptions = i;
                var r = function() {
                    function t(i, r, n, o, s, a, l, u, c, h) {
                        void 0 === o && (o = null), void 0 === a && (a = null), void 0 === l && (l = null), void 0 === u && (u = null), void 0 === c && (c = null);
                        var d, p, f = this;
                        if (this.uniqueId = 0, this.onCompileObservable = new e.Observable, this.onErrorObservable = new e.Observable, this._bonesComputationForcedToCPU = !1, this._uniformBuffersNames = {}, this._isReady = !1, this._compilationError = "", this.name = i, r.attributes) {
                            var _ = r;
                            if (this._engine = n, this._attributesNames = _.attributes, this._uniformsNames = _.uniformsNames.concat(_.samplers), this._samplers = _.samplers.slice(), this.defines = _.defines, this.onError = _.onError, this.onCompiled = _.onCompiled, this._fallbacks = _.fallbacks, this._indexParameters = _.indexParameters, this._transformFeedbackVaryings = _.transformFeedbackVaryings, _.uniformBuffersNames)
                                for (var m = 0; m < _.uniformBuffersNames.length; m++) this._uniformBuffersNames[_.uniformBuffersNames[m]] = m
                        } else this._engine = s, this.defines = a, this._uniformsNames = n.concat(o), this._samplers = o ? o.slice() : [], this._attributesNames = r, this.onError = c, this.onCompiled = u, this._indexParameters = h, this._fallbacks = l;
                        this.uniqueId = t._uniqueIdSeed++, i.vertexElement ? (d = document.getElementById(i.vertexElement)) || (d = i.vertexElement) : d = i.vertex || i, i.fragmentElement ? (p = document.getElementById(i.fragmentElement)) || (p = i.fragmentElement) : p = i.fragment || i, this._loadVertexShader(d, function(e) {
                            f._processIncludes(e, function(e) {
                                f._processShaderConversion(e, !1, function(e) {
                                    f._loadFragmentShader(p, function(t) {
                                        f._processIncludes(t, function(t) {
                                            f._processShaderConversion(t, !0, function(t) {
                                                if (i) {
                                                    var r = i.vertexElement || i.vertex || i,
                                                        n = i.fragmentElement || i.fragment || i;
                                                    f._vertexSourceCode = "#define SHADER_NAME vertex:" + r + "\n" + e, f._fragmentSourceCode = "#define SHADER_NAME fragment:" + n + "\n" + t
                                                } else f._vertexSourceCode = e, f._fragmentSourceCode = t;
                                                f._prepareEffect()
                                            })
                                        })
                                    })
                                })
                            })
                        })
                    }
                    return Object.defineProperty(t.prototype, "onBindObservable", {
                        get: function() {
                            return this._onBindObservable || (this._onBindObservable = new e.Observable), this._onBindObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "key", {
                        get: function() {
                            return this._key
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.isReady = function() {
                        return this._isReady
                    }, t.prototype.getEngine = function() {
                        return this._engine
                    }, t.prototype.getProgram = function() {
                        return this._program
                    }, t.prototype.getAttributesNames = function() {
                        return this._attributesNames
                    }, t.prototype.getAttributeLocation = function(e) {
                        return this._attributes[e]
                    }, t.prototype.getAttributeLocationByName = function(e) {
                        var t = this._attributesNames.indexOf(e);
                        return this._attributes[t]
                    }, t.prototype.getAttributesCount = function() {
                        return this._attributes.length
                    }, t.prototype.getUniformIndex = function(e) {
                        return this._uniformsNames.indexOf(e)
                    }, t.prototype.getUniform = function(e) {
                        return this._uniforms[this._uniformsNames.indexOf(e)]
                    }, t.prototype.getSamplers = function() {
                        return this._samplers
                    }, t.prototype.getCompilationError = function() {
                        return this._compilationError
                    }, t.prototype.executeWhenCompiled = function(e) {
                        this.isReady() ? e(this) : this.onCompileObservable.add(function(t) {
                            e(t)
                        })
                    }, t.prototype._loadVertexShader = function(i, r) {
                        var n;
                        if (e.Tools.IsWindowObjectExist() && i instanceof HTMLElement) return void r(e.Tools.GetDOMTextContent(i));
                        "base64:" !== i.substr(0, 7) ? t.ShadersStore[i + "VertexShader"] ? r(t.ShadersStore[i + "VertexShader"]) : (n = "." === i[0] || "/" === i[0] || -1 < i.indexOf("http") ? i : e.Engine.ShadersRepository + i, this._engine._loadFile(n + ".vertex.fx", r)) : r(window.atob(i.substr(7)))
                    }, t.prototype._loadFragmentShader = function(i, r) {
                        var n;
                        if (e.Tools.IsWindowObjectExist() && i instanceof HTMLElement) return void r(e.Tools.GetDOMTextContent(i));
                        "base64:" !== i.substr(0, 7) ? t.ShadersStore[i + "PixelShader"] ? r(t.ShadersStore[i + "PixelShader"]) : t.ShadersStore[i + "FragmentShader"] ? r(t.ShadersStore[i + "FragmentShader"]) : (n = "." === i[0] || "/" === i[0] || -1 < i.indexOf("http") ? i : e.Engine.ShadersRepository + i, this._engine._loadFile(n + ".fragment.fx", r)) : r(window.atob(i.substr(7)))
                    }, t.prototype._dumpShadersSource = function(t, i, r) {
                        var n = (1 < this._engine.webGLVersion ? "#version 300 es\n#define WEBGL2 \n" : "") + (r ? r + "\n" : "");
                        i = n + i;
                        var o = 2,
                            s = /\n/gm,
                            a = "\n1\t" + (t = n + t).replace(s, function() {
                                return "\n" + o++ + "\t"
                            });
                        o = 2;
                        var l = "\n1\t" + i.replace(s, function() {
                            return "\n" + o++ + "\t"
                        });
                        this.name.vertexElement ? (e.Tools.Error("Vertex shader: " + this.name.vertexElement + a), e.Tools.Error("Fragment shader: " + this.name.fragmentElement + l)) : this.name.vertex ? (e.Tools.Error("Vertex shader: " + this.name.vertex + a), e.Tools.Error("Fragment shader: " + this.name.fragment + l)) : (e.Tools.Error("Vertex shader: " + this.name + a), e.Tools.Error("Fragment shader: " + this.name + l))
                    }, t.prototype._processShaderConversion = function(e, t, i) {
                        var r = this._processPrecision(e);
                        if (1 != this._engine.webGLVersion)
                            if (-1 === r.indexOf("#version 3")) {
                                var n = -1 !== r.search(/#extension.+GL_EXT_draw_buffers.+require/),
                                    o = r.replace(/#extension.+(GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g, "");
                                o = (o = (o = o.replace(/varying(?![\n\r])\s/g, t ? "in " : "out ")).replace(/attribute[ \t]/g, "in ")).replace(/[ \t]attribute/g, " in"), t && (o = (o = (o = (o = (o = (o = (o = (o = o.replace(/texture2DLodEXT\s*\(/g, "textureLod(")).replace(/textureCubeLodEXT\s*\(/g, "textureLod(")).replace(/texture2D\s*\(/g, "texture(")).replace(/textureCube\s*\(/g, "texture(")).replace(/gl_FragDepthEXT/g, "gl_FragDepth")).replace(/gl_FragColor/g, "glFragColor")).replace(/gl_FragData/g, "glFragData")).replace(/void\s+?main\s*\(/g, (n ? "" : "out vec4 glFragColor;\n") + "void main(")), i(o)
                            } else i(r.replace("#version 300 es", ""));
                        else i(r)
                    }, t.prototype._processIncludes = function(i, r) {
                        for (var n = this, o = /#include<(.+)>(\((.*)\))*(\[(.*)\])*/g, s = o.exec(i), a = new String(i); null != s;) {
                            var l = s[1];
                            if (-1 !== l.indexOf("__decl__") && (l = l.replace(/__decl__/, ""), this._engine.supportsUniformBuffers && (l = (l = l.replace(/Vertex/, "Ubo")).replace(/Fragment/, "Ubo")), l += "Declaration"), !t.IncludesShadersStore[l]) {
                                var u = e.Engine.ShadersRepository + "ShadersInclude/" + l + ".fx";
                                return void this._engine._loadFile(u, function(e) {
                                    t.IncludesShadersStore[l] = e, n._processIncludes(a, r)
                                })
                            }
                            var c = t.IncludesShadersStore[l];
                            if (s[2])
                                for (var h = s[3].split(","), d = 0; d < h.length; d += 2) {
                                    var p = new RegExp(h[d], "g"),
                                        f = h[d + 1];
                                    c = c.replace(p, f)
                                }
                            if (s[4]) {
                                var _ = s[5];
                                if (-1 !== _.indexOf("..")) {
                                    var m = _.split(".."),
                                        g = parseInt(m[0]),
                                        v = parseInt(m[1]),
                                        y = c.slice(0);
                                    c = "", isNaN(v) && (v = this._indexParameters[m[1]]);
                                    for (var b = g; b < v; b++) this._engine.supportsUniformBuffers || (y = y.replace(/light\{X\}.(\w*)/g, function(e, t) {
                                        return t + "{X}"
                                    })), c += y.replace(/\{X\}/g, b.toString()) + "\n"
                                } else this._engine.supportsUniformBuffers || (c = c.replace(/light\{X\}.(\w*)/g, function(e, t) {
                                    return t + "{X}"
                                })), c = c.replace(/\{X\}/g, _)
                            }
                            a = a.replace(s[0], c), s = o.exec(i)
                        }
                        r(a)
                    }, t.prototype._processPrecision = function(e) {
                        return -1 === e.indexOf("precision highp float") ? e = this._engine.getCaps().highPrecisionShaderSupported ? "precision highp float;\n" + e : "precision mediump float;\n" + e : this._engine.getCaps().highPrecisionShaderSupported || (e = e.replace("precision highp float", "precision mediump float")), e
                    }, t.prototype._rebuildProgram = function(t, i, r, n) {
                        var o = this;
                        this._isReady = !1, this._vertexSourceCodeOverride = t, this._fragmentSourceCodeOverride = i, this.onError = function(e, t) {
                            n && n(t)
                        }, this.onCompiled = function() {
                            for (var t = o.getEngine().scenes, i = 0; i < t.length; i++) t[i].markAllMaterialsAsDirty(e.Material.TextureDirtyFlag);
                            r && r(o._program)
                        }, this._fallbacks = null, this._prepareEffect()
                    }, t.prototype.getSpecificUniformLocations = function(e) {
                        return this._engine.getUniforms(this._program, e)
                    }, t.prototype._prepareEffect = function() {
                        var t = this._attributesNames,
                            i = this.defines,
                            r = this._fallbacks;
                        this._valueCache = {};
                        var n = this._program;
                        try {
                            var o, s = this._engine;
                            if (this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? this._program = s.createRawShaderProgram(this._vertexSourceCodeOverride, this._fragmentSourceCodeOverride, void 0, this._transformFeedbackVaryings) : this._program = s.createShaderProgram(this._vertexSourceCode, this._fragmentSourceCode, i, void 0, this._transformFeedbackVaryings), this._program.__SPECTOR_rebuildProgram = this._rebuildProgram.bind(this), s.supportsUniformBuffers)
                                for (var a in this._uniformBuffersNames) this.bindUniformBlock(a, this._uniformBuffersNames[a]);
                            for (this._uniforms = s.getUniforms(this._program, this._uniformsNames), this._attributes = s.getAttributes(this._program, t), o = 0; o < this._samplers.length; o++) null == this.getUniform(this._samplers[o]) && (this._samplers.splice(o, 1), o--);
                            s.bindSamplers(this), this._compilationError = "", this._isReady = !0, this.onCompiled && this.onCompiled(this), this.onCompileObservable.notifyObservers(this), this.onCompileObservable.clear(), this._fallbacks && this._fallbacks.unBindMesh(), n && this.getEngine()._deleteProgram(n)
                        } catch (i) {
                            this._compilationError = i.message, e.Tools.Error("Unable to compile effect:"), e.Tools.Error("Uniforms: " + this._uniformsNames.map(function(e) {
                                return " " + e
                            })), e.Tools.Error("Attributes: " + t.map(function(e) {
                                return " " + e
                            })), e.Tools.Error("Error: " + this._compilationError), n && (this._program = n, this._isReady = !0, this.onError && this.onError(this, this._compilationError), this.onErrorObservable.notifyObservers(this)), r && r.isMoreFallbacks ? (e.Tools.Error("Trying next fallback."), this.defines = r.reduce(this.defines, this), this._prepareEffect()) : (this.onError && this.onError(this, this._compilationError), this.onErrorObservable.notifyObservers(this), this.onErrorObservable.clear(), this._fallbacks && this._fallbacks.unBindMesh())
                        }
                    }, Object.defineProperty(t.prototype, "isSupported", {
                        get: function() {
                            return "" === this._compilationError
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._bindTexture = function(e, t) {
                        this._engine._bindTexture(this._samplers.indexOf(e), t)
                    }, t.prototype.setTexture = function(e, t) {
                        this._engine.setTexture(this._samplers.indexOf(e), this.getUniform(e), t)
                    }, t.prototype.setDepthStencilTexture = function(e, t) {
                        this._engine.setDepthStencilTexture(this._samplers.indexOf(e), this.getUniform(e), t)
                    }, t.prototype.setTextureArray = function(e, t) {
                        if (-1 === this._samplers.indexOf(e + "Ex"))
                            for (var i = this._samplers.indexOf(e), r = 1; r < t.length; r++) this._samplers.splice(i + r, 0, e + "Ex");
                        this._engine.setTextureArray(this._samplers.indexOf(e), this.getUniform(e), t)
                    }, t.prototype.setTextureFromPostProcess = function(e, t) {
                        this._engine.setTextureFromPostProcess(this._samplers.indexOf(e), t)
                    }, t.prototype.setTextureFromPostProcessOutput = function(e, t) {
                        this._engine.setTextureFromPostProcessOutput(this._samplers.indexOf(e), t)
                    }, t.prototype._cacheMatrix = function(e, t) {
                        var i = this._valueCache[e],
                            r = t.updateFlag;
                        return (void 0 === i || i !== r) && (this._valueCache[e] = r, !0)
                    }, t.prototype._cacheFloat2 = function(e, t, i) {
                        var r = this._valueCache[e];
                        if (!r) return r = [t, i], this._valueCache[e] = r, !0;
                        var n = !1;
                        return r[0] !== t && (r[0] = t, n = !0), r[1] !== i && (r[1] = i, n = !0), n
                    }, t.prototype._cacheFloat3 = function(e, t, i, r) {
                        var n = this._valueCache[e];
                        if (!n) return n = [t, i, r], this._valueCache[e] = n, !0;
                        var o = !1;
                        return n[0] !== t && (n[0] = t, o = !0), n[1] !== i && (n[1] = i, o = !0), n[2] !== r && (n[2] = r, o = !0), o
                    }, t.prototype._cacheFloat4 = function(e, t, i, r, n) {
                        var o = this._valueCache[e];
                        if (!o) return o = [t, i, r, n], this._valueCache[e] = o, !0;
                        var s = !1;
                        return o[0] !== t && (o[0] = t, s = !0), o[1] !== i && (o[1] = i, s = !0), o[2] !== r && (o[2] = r, s = !0), o[3] !== n && (o[3] = n, s = !0), s
                    }, t.prototype.bindUniformBuffer = function(e, i) {
                        var r = this._uniformBuffersNames[i];
                        void 0 !== r && t._baseCache[r] !== e && (t._baseCache[r] = e, this._engine.bindUniformBufferBase(e, r))
                    }, t.prototype.bindUniformBlock = function(e, t) {
                        this._engine.bindUniformBlock(this._program, e, t)
                    }, t.prototype.setInt = function(e, t) {
                        var i = this._valueCache[e];
                        return void 0 !== i && i === t || (this._valueCache[e] = t, this._engine.setInt(this.getUniform(e), t)), this
                    }, t.prototype.setIntArray = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setIntArray(this.getUniform(e), t), this
                    }, t.prototype.setIntArray2 = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setIntArray2(this.getUniform(e), t), this
                    }, t.prototype.setIntArray3 = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setIntArray3(this.getUniform(e), t), this
                    }, t.prototype.setIntArray4 = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setIntArray4(this.getUniform(e), t), this
                    }, t.prototype.setFloatArray = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setFloatArray(this.getUniform(e), t), this
                    }, t.prototype.setFloatArray2 = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setFloatArray2(this.getUniform(e), t), this
                    }, t.prototype.setFloatArray3 = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setFloatArray3(this.getUniform(e), t), this
                    }, t.prototype.setFloatArray4 = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setFloatArray4(this.getUniform(e), t), this
                    }, t.prototype.setArray = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setArray(this.getUniform(e), t), this
                    }, t.prototype.setArray2 = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setArray2(this.getUniform(e), t), this
                    }, t.prototype.setArray3 = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setArray3(this.getUniform(e), t), this
                    }, t.prototype.setArray4 = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setArray4(this.getUniform(e), t), this
                    }, t.prototype.setMatrices = function(e, t) {
                        return t && (this._valueCache[e] = null, this._engine.setMatrices(this.getUniform(e), t)), this
                    }, t.prototype.setMatrix = function(e, t) {
                        return this._cacheMatrix(e, t) && this._engine.setMatrix(this.getUniform(e), t), this
                    }, t.prototype.setMatrix3x3 = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setMatrix3x3(this.getUniform(e), t), this
                    }, t.prototype.setMatrix2x2 = function(e, t) {
                        return this._valueCache[e] = null, this._engine.setMatrix2x2(this.getUniform(e), t), this
                    }, t.prototype.setFloat = function(e, t) {
                        var i = this._valueCache[e];
                        return void 0 !== i && i === t || (this._valueCache[e] = t, this._engine.setFloat(this.getUniform(e), t)), this
                    }, t.prototype.setBool = function(e, t) {
                        var i = this._valueCache[e];
                        return void 0 !== i && i === t || (this._valueCache[e] = t, this._engine.setBool(this.getUniform(e), t ? 1 : 0)), this
                    }, t.prototype.setVector2 = function(e, t) {
                        return this._cacheFloat2(e, t.x, t.y) && this._engine.setFloat2(this.getUniform(e), t.x, t.y), this
                    }, t.prototype.setFloat2 = function(e, t, i) {
                        return this._cacheFloat2(e, t, i) && this._engine.setFloat2(this.getUniform(e), t, i), this
                    }, t.prototype.setVector3 = function(e, t) {
                        return this._cacheFloat3(e, t.x, t.y, t.z) && this._engine.setFloat3(this.getUniform(e), t.x, t.y, t.z), this
                    }, t.prototype.setFloat3 = function(e, t, i, r) {
                        return this._cacheFloat3(e, t, i, r) && this._engine.setFloat3(this.getUniform(e), t, i, r), this
                    }, t.prototype.setVector4 = function(e, t) {
                        return this._cacheFloat4(e, t.x, t.y, t.z, t.w) && this._engine.setFloat4(this.getUniform(e), t.x, t.y, t.z, t.w), this
                    }, t.prototype.setFloat4 = function(e, t, i, r, n) {
                        return this._cacheFloat4(e, t, i, r, n) && this._engine.setFloat4(this.getUniform(e), t, i, r, n), this
                    }, t.prototype.setColor3 = function(e, t) {
                        return this._cacheFloat3(e, t.r, t.g, t.b) && this._engine.setColor3(this.getUniform(e), t), this
                    }, t.prototype.setColor4 = function(e, t, i) {
                        return this._cacheFloat4(e, t.r, t.g, t.b, i) && this._engine.setColor4(this.getUniform(e), t, i), this
                    }, t.prototype.setDirectColor4 = function(e, t) {
                        return this._cacheFloat4(e, t.r, t.g, t.b, t.a) && this._engine.setDirectColor4(this.getUniform(e), t), this
                    }, t.RegisterShader = function(e, i, r) {
                        i && (t.ShadersStore[e + "PixelShader"] = i), r && (t.ShadersStore[e + "VertexShader"] = r)
                    }, t.ResetCache = function() {
                        t._baseCache = {}
                    }, t._uniqueIdSeed = 0, t._baseCache = {}, t.ShadersStore = {}, t.IncludesShadersStore = {}, t
                }();
                e.Effect = r
            }($a || ($a = {})),
            function(e) {
                var t = function() {
                    function e() {}
                    return e.KEYDOWN = 1, e.KEYUP = 2, e
                }();
                e.KeyboardEventTypes = t;
                var i = function(e, t) {
                        this.type = e, this.event = t
                    },
                    r = function(e) {
                        function t(t, i) {
                            var r = e.call(this, t, i) || this;
                            return r.type = t, r.event = i, r.skipOnPointerObservable = !1, r
                        }
                        return b(t, e), t
                    }(e.KeyboardInfo = i);
                e.KeyboardInfoPre = r
            }($a || ($a = {})),
            function(e) {
                var t = function() {
                    function e() {}
                    return e.POINTERDOWN = 1, e.POINTERUP = 2, e.POINTERMOVE = 4, e.POINTERWHEEL = 8, e.POINTERPICK = 16, e.POINTERTAP = 32, e.POINTERDOUBLETAP = 64, e
                }();
                e.PointerEventTypes = t;
                var i = function(e, t) {
                        this.type = e, this.event = t
                    },
                    r = function(t) {
                        function i(i, r, n, o) {
                            var s = t.call(this, i, r) || this;
                            return s.ray = null, s.skipOnPointerObservable = !1, s.localPosition = new e.Vector2(n, o), s
                        }
                        return b(i, t), i
                    }(e.PointerInfoBase = i);
                e.PointerInfoPre = r;
                var n = function(e) {
                    function t(t, i, r) {
                        var n = e.call(this, t, i) || this;
                        return n.pickInfo = r, n
                    }
                    return b(t, e), t
                }(i);
                e.PointerInfo = n
            }($a || ($a = {})),
            function(e) {
                e.ToGammaSpace = 1 / 2.2, e.ToLinearSpace = 2.2, e.Epsilon = .001;
                var t = function() {
                    function t(e, t, i) {
                        void 0 === e && (e = 0), void 0 === t && (t = 0), void 0 === i && (i = 0), this.r = e, this.g = t, this.b = i
                    }
                    return t.prototype.toString = function() {
                        return "{R: " + this.r + " G:" + this.g + " B:" + this.b + "}"
                    }, t.prototype.getClassName = function() {
                        return "Color3"
                    }, t.prototype.getHashCode = function() {
                        var e = this.r || 0;
                        return e = 397 * (e = 397 * e ^ (this.g || 0)) ^ (this.b || 0)
                    }, t.prototype.toArray = function(e, t) {
                        return void 0 === t && (t = 0), e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, this
                    }, t.prototype.toColor4 = function(e) {
                        return void 0 === e && (e = 1), new i(this.r, this.g, this.b, e)
                    }, t.prototype.asArray = function() {
                        var e = new Array;
                        return this.toArray(e, 0), e
                    }, t.prototype.toLuminance = function() {
                        return .3 * this.r + .59 * this.g + .11 * this.b
                    }, t.prototype.multiply = function(e) {
                        return new t(this.r * e.r, this.g * e.g, this.b * e.b)
                    }, t.prototype.multiplyToRef = function(e, t) {
                        return t.r = this.r * e.r, t.g = this.g * e.g, t.b = this.b * e.b, this
                    }, t.prototype.equals = function(e) {
                        return e && this.r === e.r && this.g === e.g && this.b === e.b
                    }, t.prototype.equalsFloats = function(e, t, i) {
                        return this.r === e && this.g === t && this.b === i
                    }, t.prototype.scale = function(e) {
                        return new t(this.r * e, this.g * e, this.b * e)
                    }, t.prototype.scaleToRef = function(e, t) {
                        return t.r = this.r * e, t.g = this.g * e, t.b = this.b * e, this
                    }, t.prototype.scaleAndAddToRef = function(e, t) {
                        return t.r += this.r * e, t.g += this.g * e, t.b += this.b * e, this
                    }, t.prototype.clampToRef = function(t, i, r) {
                        return void 0 === t && (t = 0), void 0 === i && (i = 1), r.r = e.Scalar.Clamp(this.r, t, i), r.g = e.Scalar.Clamp(this.g, t, i), r.b = e.Scalar.Clamp(this.b, t, i), this
                    }, t.prototype.add = function(e) {
                        return new t(this.r + e.r, this.g + e.g, this.b + e.b)
                    }, t.prototype.addToRef = function(e, t) {
                        return t.r = this.r + e.r, t.g = this.g + e.g, t.b = this.b + e.b, this
                    }, t.prototype.subtract = function(e) {
                        return new t(this.r - e.r, this.g - e.g, this.b - e.b)
                    }, t.prototype.subtractToRef = function(e, t) {
                        return t.r = this.r - e.r, t.g = this.g - e.g, t.b = this.b - e.b, this
                    }, t.prototype.clone = function() {
                        return new t(this.r, this.g, this.b)
                    }, t.prototype.copyFrom = function(e) {
                        return this.r = e.r, this.g = e.g, this.b = e.b, this
                    }, t.prototype.copyFromFloats = function(e, t, i) {
                        return this.r = e, this.g = t, this.b = i, this
                    }, t.prototype.set = function(e, t, i) {
                        return this.copyFromFloats(e, t, i)
                    }, t.prototype.toHexString = function() {
                        var t = 255 * this.r | 0,
                            i = 255 * this.g | 0,
                            r = 255 * this.b | 0;
                        return "#" + e.Scalar.ToHex(t) + e.Scalar.ToHex(i) + e.Scalar.ToHex(r)
                    }, t.prototype.toLinearSpace = function() {
                        var e = new t;
                        return this.toLinearSpaceToRef(e), e
                    }, t.prototype.toLinearSpaceToRef = function(t) {
                        return t.r = Math.pow(this.r, e.ToLinearSpace), t.g = Math.pow(this.g, e.ToLinearSpace), t.b = Math.pow(this.b, e.ToLinearSpace), this
                    }, t.prototype.toGammaSpace = function() {
                        var e = new t;
                        return this.toGammaSpaceToRef(e), e
                    }, t.prototype.toGammaSpaceToRef = function(t) {
                        return t.r = Math.pow(this.r, e.ToGammaSpace), t.g = Math.pow(this.g, e.ToGammaSpace), t.b = Math.pow(this.b, e.ToGammaSpace), this
                    }, t.FromHexString = function(e) {
                        if ("#" !== e.substring(0, 1) || 7 !== e.length) return new t(0, 0, 0);
                        var i = parseInt(e.substring(1, 3), 16),
                            r = parseInt(e.substring(3, 5), 16),
                            n = parseInt(e.substring(5, 7), 16);
                        return t.FromInts(i, r, n)
                    }, t.FromArray = function(e, i) {
                        return void 0 === i && (i = 0), new t(e[i], e[i + 1], e[i + 2])
                    }, t.FromInts = function(e, i, r) {
                        return new t(e / 255, i / 255, r / 255)
                    }, t.Lerp = function(e, i, r) {
                        var n = new t(0, 0, 0);
                        return t.LerpToRef(e, i, r, n), n
                    }, t.LerpToRef = function(e, t, i, r) {
                        r.r = e.r + (t.r - e.r) * i, r.g = e.g + (t.g - e.g) * i, r.b = e.b + (t.b - e.b) * i
                    }, t.Red = function() {
                        return new t(1, 0, 0)
                    }, t.Green = function() {
                        return new t(0, 1, 0)
                    }, t.Blue = function() {
                        return new t(0, 0, 1)
                    }, t.Black = function() {
                        return new t(0, 0, 0)
                    }, t.White = function() {
                        return new t(1, 1, 1)
                    }, t.Purple = function() {
                        return new t(.5, 0, .5)
                    }, t.Magenta = function() {
                        return new t(1, 0, 1)
                    }, t.Yellow = function() {
                        return new t(1, 1, 0)
                    }, t.Gray = function() {
                        return new t(.5, .5, .5)
                    }, t.Teal = function() {
                        return new t(0, 1, 1)
                    }, t.Random = function() {
                        return new t(Math.random(), Math.random(), Math.random())
                    }, t
                }();
                e.Color3 = t;
                var i = function() {
                    function t(e, t, i, r) {
                        void 0 === e && (e = 0), void 0 === t && (t = 0), void 0 === i && (i = 0), void 0 === r && (r = 1), this.r = e, this.g = t, this.b = i, this.a = r
                    }
                    return t.prototype.addInPlace = function(e) {
                        return this.r += e.r, this.g += e.g, this.b += e.b, this.a += e.a, this
                    }, t.prototype.asArray = function() {
                        var e = new Array;
                        return this.toArray(e, 0), e
                    }, t.prototype.toArray = function(e, t) {
                        return void 0 === t && (t = 0), e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, e[t + 3] = this.a, this
                    }, t.prototype.add = function(e) {
                        return new t(this.r + e.r, this.g + e.g, this.b + e.b, this.a + e.a)
                    }, t.prototype.subtract = function(e) {
                        return new t(this.r - e.r, this.g - e.g, this.b - e.b, this.a - e.a)
                    }, t.prototype.subtractToRef = function(e, t) {
                        return t.r = this.r - e.r, t.g = this.g - e.g, t.b = this.b - e.b, t.a = this.a - e.a, this
                    }, t.prototype.scale = function(e) {
                        return new t(this.r * e, this.g * e, this.b * e, this.a * e)
                    }, t.prototype.scaleToRef = function(e, t) {
                        return t.r = this.r * e, t.g = this.g * e, t.b = this.b * e, t.a = this.a * e, this
                    }, t.prototype.scaleAndAddToRef = function(e, t) {
                        return t.r += this.r * e, t.g += this.g * e, t.b += this.b * e, t.a += this.a * e, this
                    }, t.prototype.clampToRef = function(t, i, r) {
                        return void 0 === t && (t = 0), void 0 === i && (i = 1), r.r = e.Scalar.Clamp(this.r, t, i), r.g = e.Scalar.Clamp(this.g, t, i), r.b = e.Scalar.Clamp(this.b, t, i), r.a = e.Scalar.Clamp(this.a, t, i), this
                    }, t.prototype.multiply = function(e) {
                        return new t(this.r * e.r, this.g * e.g, this.b * e.b, this.a * e.a)
                    }, t.prototype.multiplyToRef = function(e, t) {
                        return t.r = this.r * e.r, t.g = this.g * e.g, t.b = this.b * e.b, t.a = this.a * e.a, t
                    }, t.prototype.toString = function() {
                        return "{R: " + this.r + " G:" + this.g + " B:" + this.b + " A:" + this.a + "}"
                    }, t.prototype.getClassName = function() {
                        return "Color4"
                    }, t.prototype.getHashCode = function() {
                        var e = this.r || 0;
                        return e = 397 * (e = 397 * (e = 397 * e ^ (this.g || 0)) ^ (this.b || 0)) ^ (this.a || 0)
                    }, t.prototype.clone = function() {
                        return new t(this.r, this.g, this.b, this.a)
                    }, t.prototype.copyFrom = function(e) {
                        return this.r = e.r, this.g = e.g, this.b = e.b, this.a = e.a, this
                    }, t.prototype.copyFromFloats = function(e, t, i, r) {
                        return this.r = e, this.g = t, this.b = i, this.a = r, this
                    }, t.prototype.set = function(e, t, i, r) {
                        return this.copyFromFloats(e, t, i, r)
                    }, t.prototype.toHexString = function() {
                        var t = 255 * this.r | 0,
                            i = 255 * this.g | 0,
                            r = 255 * this.b | 0,
                            n = 255 * this.a | 0;
                        return "#" + e.Scalar.ToHex(t) + e.Scalar.ToHex(i) + e.Scalar.ToHex(r) + e.Scalar.ToHex(n)
                    }, t.prototype.toLinearSpace = function() {
                        var e = new t;
                        return this.toLinearSpaceToRef(e), e
                    }, t.prototype.toLinearSpaceToRef = function(t) {
                        return t.r = Math.pow(this.r, e.ToLinearSpace), t.g = Math.pow(this.g, e.ToLinearSpace), t.b = Math.pow(this.b, e.ToLinearSpace), t.a = this.a, this
                    }, t.prototype.toGammaSpace = function() {
                        var e = new t;
                        return this.toGammaSpaceToRef(e), e
                    }, t.prototype.toGammaSpaceToRef = function(t) {
                        return t.r = Math.pow(this.r, e.ToGammaSpace), t.g = Math.pow(this.g, e.ToGammaSpace), t.b = Math.pow(this.b, e.ToGammaSpace), t.a = this.a, this
                    }, t.FromHexString = function(e) {
                        if ("#" !== e.substring(0, 1) || 9 !== e.length) return new t(0, 0, 0, 0);
                        var i = parseInt(e.substring(1, 3), 16),
                            r = parseInt(e.substring(3, 5), 16),
                            n = parseInt(e.substring(5, 7), 16),
                            o = parseInt(e.substring(7, 9), 16);
                        return t.FromInts(i, r, n, o)
                    }, t.Lerp = function(e, i, r) {
                        var n = new t(0, 0, 0, 0);
                        return t.LerpToRef(e, i, r, n), n
                    }, t.LerpToRef = function(e, t, i, r) {
                        r.r = e.r + (t.r - e.r) * i, r.g = e.g + (t.g - e.g) * i, r.b = e.b + (t.b - e.b) * i, r.a = e.a + (t.a - e.a) * i
                    }, t.FromColor3 = function(e, i) {
                        return void 0 === i && (i = 1), new t(e.r, e.g, e.b, i)
                    }, t.FromArray = function(e, i) {
                        return void 0 === i && (i = 0), new t(e[i], e[i + 1], e[i + 2], e[i + 3])
                    }, t.FromInts = function(e, i, r, n) {
                        return new t(e / 255, i / 255, r / 255, n / 255)
                    }, t.CheckColors4 = function(e, t) {
                        if (e.length === 3 * t) {
                            for (var i = [], r = 0; r < e.length; r += 3) {
                                var n = r / 3 * 4;
                                i[n] = e[r], i[n + 1] = e[r + 1], i[n + 2] = e[r + 2], i[n + 3] = 1
                            }
                            return i
                        }
                        return e
                    }, t
                }();
                e.Color4 = i;
                var r = function() {
                    function t(e, t) {
                        void 0 === e && (e = 0), void 0 === t && (t = 0), this.x = e, this.y = t
                    }
                    return t.prototype.toString = function() {
                        return "{X: " + this.x + " Y:" + this.y + "}"
                    }, t.prototype.getClassName = function() {
                        return "Vector2"
                    }, t.prototype.getHashCode = function() {
                        var e = this.x || 0;
                        return e = 397 * e ^ (this.y || 0)
                    }, t.prototype.toArray = function(e, t) {
                        return void 0 === t && (t = 0), e[t] = this.x, e[t + 1] = this.y, this
                    }, t.prototype.asArray = function() {
                        var e = new Array;
                        return this.toArray(e, 0), e
                    }, t.prototype.copyFrom = function(e) {
                        return this.x = e.x, this.y = e.y, this
                    }, t.prototype.copyFromFloats = function(e, t) {
                        return this.x = e, this.y = t, this
                    }, t.prototype.set = function(e, t) {
                        return this.copyFromFloats(e, t)
                    }, t.prototype.add = function(e) {
                        return new t(this.x + e.x, this.y + e.y)
                    }, t.prototype.addToRef = function(e, t) {
                        return t.x = this.x + e.x, t.y = this.y + e.y, this
                    }, t.prototype.addInPlace = function(e) {
                        return this.x += e.x, this.y += e.y, this
                    }, t.prototype.addVector3 = function(e) {
                        return new t(this.x + e.x, this.y + e.y)
                    }, t.prototype.subtract = function(e) {
                        return new t(this.x - e.x, this.y - e.y)
                    }, t.prototype.subtractToRef = function(e, t) {
                        return t.x = this.x - e.x, t.y = this.y - e.y, this
                    }, t.prototype.subtractInPlace = function(e) {
                        return this.x -= e.x, this.y -= e.y, this
                    }, t.prototype.multiplyInPlace = function(e) {
                        return this.x *= e.x, this.y *= e.y, this
                    }, t.prototype.multiply = function(e) {
                        return new t(this.x * e.x, this.y * e.y)
                    }, t.prototype.multiplyToRef = function(e, t) {
                        return t.x = this.x * e.x, t.y = this.y * e.y, this
                    }, t.prototype.multiplyByFloats = function(e, i) {
                        return new t(this.x * e, this.y * i)
                    }, t.prototype.divide = function(e) {
                        return new t(this.x / e.x, this.y / e.y)
                    }, t.prototype.divideToRef = function(e, t) {
                        return t.x = this.x / e.x, t.y = this.y / e.y, this
                    }, t.prototype.divideInPlace = function(e) {
                        return this.divideToRef(e, this)
                    }, t.prototype.negate = function() {
                        return new t(-this.x, -this.y)
                    }, t.prototype.scaleInPlace = function(e) {
                        return this.x *= e, this.y *= e, this
                    }, t.prototype.scale = function(e) {
                        var i = new t(0, 0);
                        return this.scaleToRef(e, i), i
                    }, t.prototype.scaleToRef = function(e, t) {
                        return t.x = this.x * e, t.y = this.y * e, this
                    }, t.prototype.scaleAndAddToRef = function(e, t) {
                        return t.x += this.x * e, t.y += this.y * e, this
                    }, t.prototype.equals = function(e) {
                        return e && this.x === e.x && this.y === e.y
                    }, t.prototype.equalsWithEpsilon = function(t, i) {
                        return void 0 === i && (i = e.Epsilon), t && e.Scalar.WithinEpsilon(this.x, t.x, i) && e.Scalar.WithinEpsilon(this.y, t.y, i)
                    }, t.prototype.floor = function() {
                        return new t(Math.floor(this.x), Math.floor(this.y))
                    }, t.prototype.fract = function() {
                        return new t(this.x - Math.floor(this.x), this.y - Math.floor(this.y))
                    }, t.prototype.length = function() {
                        return Math.sqrt(this.x * this.x + this.y * this.y)
                    }, t.prototype.lengthSquared = function() {
                        return this.x * this.x + this.y * this.y
                    }, t.prototype.normalize = function() {
                        var e = this.length();
                        if (0 === e) return this;
                        var t = 1 / e;
                        return this.x *= t, this.y *= t, this
                    }, t.prototype.clone = function() {
                        return new t(this.x, this.y)
                    }, t.Zero = function() {
                        return new t(0, 0)
                    }, t.One = function() {
                        return new t(1, 1)
                    }, t.FromArray = function(e, i) {
                        return void 0 === i && (i = 0), new t(e[i], e[i + 1])
                    }, t.FromArrayToRef = function(e, t, i) {
                        i.x = e[t], i.y = e[t + 1]
                    }, t.CatmullRom = function(e, i, r, n, o) {
                        var s = o * o,
                            a = o * s;
                        return new t(.5 * (2 * i.x + (-e.x + r.x) * o + (2 * e.x - 5 * i.x + 4 * r.x - n.x) * s + (-e.x + 3 * i.x - 3 * r.x + n.x) * a), .5 * (2 * i.y + (-e.y + r.y) * o + (2 * e.y - 5 * i.y + 4 * r.y - n.y) * s + (-e.y + 3 * i.y - 3 * r.y + n.y) * a))
                    }, t.Clamp = function(e, i, r) {
                        var n = e.x;
                        n = (n = n > r.x ? r.x : n) < i.x ? i.x : n;
                        var o = e.y;
                        return new t(n, o = (o = o > r.y ? r.y : o) < i.y ? i.y : o)
                    }, t.Hermite = function(e, i, r, n, o) {
                        var s = o * o,
                            a = o * s,
                            l = 2 * a - 3 * s + 1,
                            u = -2 * a + 3 * s,
                            c = a - 2 * s + o,
                            h = a - s;
                        return new t(e.x * l + r.x * u + i.x * c + n.x * h, e.y * l + r.y * u + i.y * c + n.y * h)
                    }, t.Lerp = function(e, i, r) {
                        return new t(e.x + (i.x - e.x) * r, e.y + (i.y - e.y) * r)
                    }, t.Dot = function(e, t) {
                        return e.x * t.x + e.y * t.y
                    }, t.Normalize = function(e) {
                        var t = e.clone();
                        return t.normalize(), t
                    }, t.Minimize = function(e, i) {
                        return new t(e.x < i.x ? e.x : i.x, e.y < i.y ? e.y : i.y)
                    }, t.Maximize = function(e, i) {
                        return new t(e.x > i.x ? e.x : i.x, e.y > i.y ? e.y : i.y)
                    }, t.Transform = function(e, i) {
                        var r = t.Zero();
                        return t.TransformToRef(e, i, r), r
                    }, t.TransformToRef = function(e, t, i) {
                        var r = e.x * t.m[0] + e.y * t.m[4] + t.m[12],
                            n = e.x * t.m[1] + e.y * t.m[5] + t.m[13];
                        i.x = r, i.y = n
                    }, t.PointInTriangle = function(e, t, i, r) {
                        var n = .5 * (-i.y * r.x + t.y * (-i.x + r.x) + t.x * (i.y - r.y) + i.x * r.y),
                            o = n < 0 ? -1 : 1,
                            s = (t.y * r.x - t.x * r.y + (r.y - t.y) * e.x + (t.x - r.x) * e.y) * o,
                            a = (t.x * i.y - t.y * i.x + (t.y - i.y) * e.x + (i.x - t.x) * e.y) * o;
                        return 0 < s && 0 < a && s + a < 2 * n * o
                    }, t.Distance = function(e, i) {
                        return Math.sqrt(t.DistanceSquared(e, i))
                    }, t.DistanceSquared = function(e, t) {
                        var i = e.x - t.x,
                            r = e.y - t.y;
                        return i * i + r * r
                    }, t.Center = function(e, t) {
                        var i = e.add(t);
                        return i.scaleInPlace(.5), i
                    }, t.DistanceOfPointFromSegment = function(e, i, r) {
                        var n = t.DistanceSquared(i, r);
                        if (0 === n) return t.Distance(e, i);
                        var o = r.subtract(i),
                            s = Math.max(0, Math.min(1, t.Dot(e.subtract(i), o) / n)),
                            a = i.add(o.multiplyByFloats(s, s));
                        return t.Distance(e, a)
                    }, t
                }();
                e.Vector2 = r;
                var n = function() {
                    function t(e, t, i) {
                        void 0 === e && (e = 0), void 0 === t && (t = 0), void 0 === i && (i = 0), this.x = e, this.y = t, this.z = i
                    }
                    return t.prototype.toString = function() {
                        return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + "}"
                    }, t.prototype.getClassName = function() {
                        return "Vector3"
                    }, t.prototype.getHashCode = function() {
                        var e = this.x || 0;
                        return e = 397 * (e = 397 * e ^ (this.y || 0)) ^ (this.z || 0)
                    }, t.prototype.asArray = function() {
                        var e = [];
                        return this.toArray(e, 0), e
                    }, t.prototype.toArray = function(e, t) {
                        return void 0 === t && (t = 0), e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, this
                    }, t.prototype.toQuaternion = function() {
                        return e.Quaternion.RotationYawPitchRoll(this.x, this.y, this.z)
                    }, t.prototype.addInPlace = function(e) {
                        return this.x += e.x, this.y += e.y, this.z += e.z, this
                    }, t.prototype.add = function(e) {
                        return new t(this.x + e.x, this.y + e.y, this.z + e.z)
                    }, t.prototype.addToRef = function(e, t) {
                        return t.x = this.x + e.x, t.y = this.y + e.y, t.z = this.z + e.z, this
                    }, t.prototype.subtractInPlace = function(e) {
                        return this.x -= e.x, this.y -= e.y, this.z -= e.z, this
                    }, t.prototype.subtract = function(e) {
                        return new t(this.x - e.x, this.y - e.y, this.z - e.z)
                    }, t.prototype.subtractToRef = function(e, t) {
                        return t.x = this.x - e.x, t.y = this.y - e.y, t.z = this.z - e.z, this
                    }, t.prototype.subtractFromFloats = function(e, i, r) {
                        return new t(this.x - e, this.y - i, this.z - r)
                    }, t.prototype.subtractFromFloatsToRef = function(e, t, i, r) {
                        return r.x = this.x - e, r.y = this.y - t, r.z = this.z - i, this
                    }, t.prototype.negate = function() {
                        return new t(-this.x, -this.y, -this.z)
                    }, t.prototype.scaleInPlace = function(e) {
                        return this.x *= e, this.y *= e, this.z *= e, this
                    }, t.prototype.scale = function(e) {
                        return new t(this.x * e, this.y * e, this.z * e)
                    }, t.prototype.scaleToRef = function(e, t) {
                        return t.x = this.x * e, t.y = this.y * e, t.z = this.z * e, this
                    }, t.prototype.scaleAndAddToRef = function(e, t) {
                        return t.x += this.x * e, t.y += this.y * e, t.z += this.z * e, this
                    }, t.prototype.equals = function(e) {
                        return e && this.x === e.x && this.y === e.y && this.z === e.z
                    }, t.prototype.equalsWithEpsilon = function(t, i) {
                        return void 0 === i && (i = e.Epsilon), t && e.Scalar.WithinEpsilon(this.x, t.x, i) && e.Scalar.WithinEpsilon(this.y, t.y, i) && e.Scalar.WithinEpsilon(this.z, t.z, i)
                    }, t.prototype.equalsToFloats = function(e, t, i) {
                        return this.x === e && this.y === t && this.z === i
                    }, t.prototype.multiplyInPlace = function(e) {
                        return this.x *= e.x, this.y *= e.y, this.z *= e.z, this
                    }, t.prototype.multiply = function(e) {
                        return new t(this.x * e.x, this.y * e.y, this.z * e.z)
                    }, t.prototype.multiplyToRef = function(e, t) {
                        return t.x = this.x * e.x, t.y = this.y * e.y, t.z = this.z * e.z, this
                    }, t.prototype.multiplyByFloats = function(e, i, r) {
                        return new t(this.x * e, this.y * i, this.z * r)
                    }, t.prototype.divide = function(e) {
                        return new t(this.x / e.x, this.y / e.y, this.z / e.z)
                    }, t.prototype.divideToRef = function(e, t) {
                        return t.x = this.x / e.x, t.y = this.y / e.y, t.z = this.z / e.z, this
                    }, t.prototype.divideInPlace = function(e) {
                        return this.divideToRef(e, this)
                    }, t.prototype.minimizeInPlace = function(e) {
                        return this.minimizeInPlaceFromFloats(e.x, e.y, e.z)
                    }, t.prototype.maximizeInPlace = function(e) {
                        return this.maximizeInPlaceFromFloats(e.x, e.y, e.z)
                    }, t.prototype.minimizeInPlaceFromFloats = function(e, t, i) {
                        return e < this.x && (this.x = e), t < this.y && (this.y = t), i < this.z && (this.z = i), this
                    }, t.prototype.maximizeInPlaceFromFloats = function(e, t, i) {
                        return e > this.x && (this.x = e), t > this.y && (this.y = t), i > this.z && (this.z = i), this
                    }, Object.defineProperty(t.prototype, "isNonUniform", {
                        get: function() {
                            var e = Math.abs(this.x),
                                t = Math.abs(this.y);
                            if (e !== t) return !0;
                            var i = Math.abs(this.z);
                            return e !== i || t !== i
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.floor = function() {
                        return new t(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z))
                    }, t.prototype.fract = function() {
                        return new t(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z))
                    }, t.prototype.length = function() {
                        return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
                    }, t.prototype.lengthSquared = function() {
                        return this.x * this.x + this.y * this.y + this.z * this.z
                    }, t.prototype.normalize = function() {
                        var e = this.length();
                        if (0 === e || 1 === e) return this;
                        var t = 1 / e;
                        return this.x *= t, this.y *= t, this.z *= t, this
                    }, t.prototype.normalizeToNew = function() {
                        var e = new t(0, 0, 0);
                        return this.normalizeToRef(e), e
                    }, t.prototype.normalizeToRef = function(e) {
                        var t = this.length();
                        if (0 === t || 1 === t) return e.set(this.x, this.y, this.z), e;
                        var i = 1 / t;
                        return this.scaleToRef(i, e), e
                    }, t.prototype.clone = function() {
                        return new t(this.x, this.y, this.z)
                    }, t.prototype.copyFrom = function(e) {
                        return this.x = e.x, this.y = e.y, this.z = e.z, this
                    }, t.prototype.copyFromFloats = function(e, t, i) {
                        return this.x = e, this.y = t, this.z = i, this
                    }, t.prototype.set = function(e, t, i) {
                        return this.copyFromFloats(e, t, i)
                    }, t.GetClipFactor = function(e, i, r, n) {
                        var o = t.Dot(e, r) - n;
                        return o / (o - (t.Dot(i, r) - n))
                    }, t.GetAngleBetweenVectors = function(e, i, r) {
                        var n = P.Vector3[1].copyFrom(e).normalize(),
                            o = P.Vector3[2].copyFrom(i).normalize(),
                            s = t.Dot(n, o),
                            a = P.Vector3[3];
                        return t.CrossToRef(n, o, a), 0 < t.Dot(a, r) ? Math.acos(s) : -Math.acos(s)
                    }, t.FromArray = function(e, i) {
                        return i || (i = 0), new t(e[i], e[i + 1], e[i + 2])
                    }, t.FromFloatArray = function(e, i) {
                        return t.FromArray(e, i)
                    }, t.FromArrayToRef = function(e, t, i) {
                        i.x = e[t], i.y = e[t + 1], i.z = e[t + 2]
                    }, t.FromFloatArrayToRef = function(e, i, r) {
                        return t.FromArrayToRef(e, i, r)
                    }, t.FromFloatsToRef = function(e, t, i, r) {
                        r.x = e, r.y = t, r.z = i
                    }, t.Zero = function() {
                        return new t(0, 0, 0)
                    }, t.One = function() {
                        return new t(1, 1, 1)
                    }, t.Up = function() {
                        return new t(0, 1, 0)
                    }, t.Down = function() {
                        return new t(0, -1, 0)
                    }, t.Forward = function() {
                        return new t(0, 0, 1)
                    }, t.Backward = function() {
                        return new t(0, 0, -1)
                    }, t.Right = function() {
                        return new t(1, 0, 0)
                    }, t.Left = function() {
                        return new t(-1, 0, 0)
                    }, t.TransformCoordinates = function(e, i) {
                        var r = t.Zero();
                        return t.TransformCoordinatesToRef(e, i, r), r
                    }, t.TransformCoordinatesToRef = function(e, t, i) {
                        var r = e.x * t.m[0] + e.y * t.m[4] + e.z * t.m[8] + t.m[12],
                            n = e.x * t.m[1] + e.y * t.m[5] + e.z * t.m[9] + t.m[13],
                            o = e.x * t.m[2] + e.y * t.m[6] + e.z * t.m[10] + t.m[14],
                            s = e.x * t.m[3] + e.y * t.m[7] + e.z * t.m[11] + t.m[15];
                        i.x = r / s, i.y = n / s, i.z = o / s
                    }, t.TransformCoordinatesFromFloatsToRef = function(e, t, i, r, n) {
                        var o = e * r.m[0] + t * r.m[4] + i * r.m[8] + r.m[12],
                            s = e * r.m[1] + t * r.m[5] + i * r.m[9] + r.m[13],
                            a = e * r.m[2] + t * r.m[6] + i * r.m[10] + r.m[14],
                            l = e * r.m[3] + t * r.m[7] + i * r.m[11] + r.m[15];
                        n.x = o / l, n.y = s / l, n.z = a / l
                    }, t.TransformNormal = function(e, i) {
                        var r = t.Zero();
                        return t.TransformNormalToRef(e, i, r), r
                    }, t.TransformNormalToRef = function(e, t, i) {
                        var r = e.x * t.m[0] + e.y * t.m[4] + e.z * t.m[8],
                            n = e.x * t.m[1] + e.y * t.m[5] + e.z * t.m[9],
                            o = e.x * t.m[2] + e.y * t.m[6] + e.z * t.m[10];
                        i.x = r, i.y = n, i.z = o
                    }, t.TransformNormalFromFloatsToRef = function(e, t, i, r, n) {
                        n.x = e * r.m[0] + t * r.m[4] + i * r.m[8], n.y = e * r.m[1] + t * r.m[5] + i * r.m[9], n.z = e * r.m[2] + t * r.m[6] + i * r.m[10]
                    }, t.CatmullRom = function(e, i, r, n, o) {
                        var s = o * o,
                            a = o * s;
                        return new t(.5 * (2 * i.x + (-e.x + r.x) * o + (2 * e.x - 5 * i.x + 4 * r.x - n.x) * s + (-e.x + 3 * i.x - 3 * r.x + n.x) * a), .5 * (2 * i.y + (-e.y + r.y) * o + (2 * e.y - 5 * i.y + 4 * r.y - n.y) * s + (-e.y + 3 * i.y - 3 * r.y + n.y) * a), .5 * (2 * i.z + (-e.z + r.z) * o + (2 * e.z - 5 * i.z + 4 * r.z - n.z) * s + (-e.z + 3 * i.z - 3 * r.z + n.z) * a))
                    }, t.Clamp = function(e, i, r) {
                        var n = e.x;
                        n = (n = n > r.x ? r.x : n) < i.x ? i.x : n;
                        var o = e.y;
                        o = (o = o > r.y ? r.y : o) < i.y ? i.y : o;
                        var s = e.z;
                        return new t(n, o, s = (s = s > r.z ? r.z : s) < i.z ? i.z : s)
                    }, t.Hermite = function(e, i, r, n, o) {
                        var s = o * o,
                            a = o * s,
                            l = 2 * a - 3 * s + 1,
                            u = -2 * a + 3 * s,
                            c = a - 2 * s + o,
                            h = a - s;
                        return new t(e.x * l + r.x * u + i.x * c + n.x * h, e.y * l + r.y * u + i.y * c + n.y * h, e.z * l + r.z * u + i.z * c + n.z * h)
                    }, t.Lerp = function(e, i, r) {
                        var n = new t(0, 0, 0);
                        return t.LerpToRef(e, i, r, n), n
                    }, t.LerpToRef = function(e, t, i, r) {
                        r.x = e.x + (t.x - e.x) * i, r.y = e.y + (t.y - e.y) * i, r.z = e.z + (t.z - e.z) * i
                    }, t.Dot = function(e, t) {
                        return e.x * t.x + e.y * t.y + e.z * t.z
                    }, t.Cross = function(e, i) {
                        var r = t.Zero();
                        return t.CrossToRef(e, i, r), r
                    }, t.CrossToRef = function(e, t, i) {
                        P.Vector3[0].x = e.y * t.z - e.z * t.y, P.Vector3[0].y = e.z * t.x - e.x * t.z, P.Vector3[0].z = e.x * t.y - e.y * t.x, i.copyFrom(P.Vector3[0])
                    }, t.Normalize = function(e) {
                        var i = t.Zero();
                        return t.NormalizeToRef(e, i), i
                    }, t.NormalizeToRef = function(e, t) {
                        t.copyFrom(e), t.normalize()
                    }, t.Project = function(e, i, r, n) {
                        var o = n.width,
                            s = n.height,
                            a = n.x,
                            u = n.y,
                            c = t._viewportMatrixCache ? t._viewportMatrixCache : t._viewportMatrixCache = new l;
                        l.FromValuesToRef(o / 2, 0, 0, 0, 0, -s / 2, 0, 0, 0, 0, .5, 0, a + o / 2, s / 2 + u, .5, 1, c);
                        var h = P.Matrix[0];
                        return i.multiplyToRef(r, h), h.multiplyToRef(c, h), t.TransformCoordinates(e, h)
                    }, t.UnprojectFromTransform = function(i, r, n, o, s) {
                        var a = P.Matrix[0];
                        o.multiplyToRef(s, a), a.invert(), i.x = i.x / r * 2 - 1, i.y = -(i.y / n * 2 - 1);
                        var l = t.TransformCoordinates(i, a),
                            u = i.x * a.m[3] + i.y * a.m[7] + i.z * a.m[11] + a.m[15];
                        return e.Scalar.WithinEpsilon(u, 1) && (l = l.scale(1 / u)), l
                    }, t.Unproject = function(e, i, r, n, o, s) {
                        var a = t.Zero();
                        return t.UnprojectToRef(e, i, r, n, o, s, a), a
                    }, t.UnprojectToRef = function(e, i, r, n, o, s, a) {
                        t.UnprojectFloatsToRef(e.x, e.y, e.z, i, r, n, o, s, a)
                    }, t.UnprojectFloatsToRef = function(i, r, n, o, s, a, l, u, c) {
                        var h = P.Matrix[0];
                        a.multiplyToRef(l, h), h.multiplyToRef(u, h), h.invert();
                        var d = P.Vector3[0];
                        d.x = i / o * 2 - 1, d.y = -(r / s * 2 - 1), d.z = 2 * n - 1, t.TransformCoordinatesToRef(d, h, c);
                        var p = d.x * h.m[3] + d.y * h.m[7] + d.z * h.m[11] + h.m[15];
                        e.Scalar.WithinEpsilon(p, 1) && c.scaleInPlace(1 / p)
                    }, t.Minimize = function(e, t) {
                        var i = e.clone();
                        return i.minimizeInPlace(t), i
                    }, t.Maximize = function(e, t) {
                        var i = e.clone();
                        return i.maximizeInPlace(t), i
                    }, t.Distance = function(e, i) {
                        return Math.sqrt(t.DistanceSquared(e, i))
                    }, t.DistanceSquared = function(e, t) {
                        var i = e.x - t.x,
                            r = e.y - t.y,
                            n = e.z - t.z;
                        return i * i + r * r + n * n
                    }, t.Center = function(e, t) {
                        var i = e.add(t);
                        return i.scaleInPlace(.5), i
                    }, t.RotationFromAxis = function(e, i, r) {
                        var n = t.Zero();
                        return t.RotationFromAxisToRef(e, i, r, n), n
                    }, t.RotationFromAxisToRef = function(e, t, i, r) {
                        var n = P.Quaternion[0];
                        a.RotationQuaternionFromAxisToRef(e, t, i, n), n.toEulerAnglesToRef(r)
                    }, t
                }();
                e.Vector3 = n;
                var o = function() {
                    function t(e, t, i, r) {
                        this.x = e, this.y = t, this.z = i, this.w = r
                    }
                    return t.prototype.toString = function() {
                        return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + " W:" + this.w + "}"
                    }, t.prototype.getClassName = function() {
                        return "Vector4"
                    }, t.prototype.getHashCode = function() {
                        var e = this.x || 0;
                        return e = 397 * (e = 397 * (e = 397 * e ^ (this.y || 0)) ^ (this.z || 0)) ^ (this.w || 0)
                    }, t.prototype.asArray = function() {
                        var e = new Array;
                        return this.toArray(e, 0), e
                    }, t.prototype.toArray = function(e, t) {
                        return void 0 === t && (t = 0), e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e[t + 3] = this.w, this
                    }, t.prototype.addInPlace = function(e) {
                        return this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this
                    }, t.prototype.add = function(e) {
                        return new t(this.x + e.x, this.y + e.y, this.z + e.z, this.w + e.w)
                    }, t.prototype.addToRef = function(e, t) {
                        return t.x = this.x + e.x, t.y = this.y + e.y, t.z = this.z + e.z, t.w = this.w + e.w, this
                    }, t.prototype.subtractInPlace = function(e) {
                        return this.x -= e.x, this.y -= e.y, this.z -= e.z, this.w -= e.w, this
                    }, t.prototype.subtract = function(e) {
                        return new t(this.x - e.x, this.y - e.y, this.z - e.z, this.w - e.w)
                    }, t.prototype.subtractToRef = function(e, t) {
                        return t.x = this.x - e.x, t.y = this.y - e.y, t.z = this.z - e.z, t.w = this.w - e.w, this
                    }, t.prototype.subtractFromFloats = function(e, i, r, n) {
                        return new t(this.x - e, this.y - i, this.z - r, this.w - n)
                    }, t.prototype.subtractFromFloatsToRef = function(e, t, i, r, n) {
                        return n.x = this.x - e, n.y = this.y - t, n.z = this.z - i, n.w = this.w - r, this
                    }, t.prototype.negate = function() {
                        return new t(-this.x, -this.y, -this.z, -this.w)
                    }, t.prototype.scaleInPlace = function(e) {
                        return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this
                    }, t.prototype.scale = function(e) {
                        return new t(this.x * e, this.y * e, this.z * e, this.w * e)
                    }, t.prototype.scaleToRef = function(e, t) {
                        return t.x = this.x * e, t.y = this.y * e, t.z = this.z * e, t.w = this.w * e, this
                    }, t.prototype.scaleAndAddToRef = function(e, t) {
                        return t.x += this.x * e, t.y += this.y * e, t.z += this.z * e, t.w += this.w * e, this
                    }, t.prototype.equals = function(e) {
                        return e && this.x === e.x && this.y === e.y && this.z === e.z && this.w === e.w
                    }, t.prototype.equalsWithEpsilon = function(t, i) {
                        return void 0 === i && (i = e.Epsilon), t && e.Scalar.WithinEpsilon(this.x, t.x, i) && e.Scalar.WithinEpsilon(this.y, t.y, i) && e.Scalar.WithinEpsilon(this.z, t.z, i) && e.Scalar.WithinEpsilon(this.w, t.w, i)
                    }, t.prototype.equalsToFloats = function(e, t, i, r) {
                        return this.x === e && this.y === t && this.z === i && this.w === r
                    }, t.prototype.multiplyInPlace = function(e) {
                        return this.x *= e.x, this.y *= e.y, this.z *= e.z, this.w *= e.w, this
                    }, t.prototype.multiply = function(e) {
                        return new t(this.x * e.x, this.y * e.y, this.z * e.z, this.w * e.w)
                    }, t.prototype.multiplyToRef = function(e, t) {
                        return t.x = this.x * e.x, t.y = this.y * e.y, t.z = this.z * e.z, t.w = this.w * e.w, this
                    }, t.prototype.multiplyByFloats = function(e, i, r, n) {
                        return new t(this.x * e, this.y * i, this.z * r, this.w * n)
                    }, t.prototype.divide = function(e) {
                        return new t(this.x / e.x, this.y / e.y, this.z / e.z, this.w / e.w)
                    }, t.prototype.divideToRef = function(e, t) {
                        return t.x = this.x / e.x, t.y = this.y / e.y, t.z = this.z / e.z, t.w = this.w / e.w, this
                    }, t.prototype.divideInPlace = function(e) {
                        return this.divideToRef(e, this)
                    }, t.prototype.minimizeInPlace = function(e) {
                        return e.x < this.x && (this.x = e.x), e.y < this.y && (this.y = e.y), e.z < this.z && (this.z = e.z), e.w < this.w && (this.w = e.w), this
                    }, t.prototype.maximizeInPlace = function(e) {
                        return e.x > this.x && (this.x = e.x), e.y > this.y && (this.y = e.y), e.z > this.z && (this.z = e.z), e.w > this.w && (this.w = e.w), this
                    }, t.prototype.floor = function() {
                        return new t(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w))
                    }, t.prototype.fract = function() {
                        return new t(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z), this.w - Math.floor(this.w))
                    }, t.prototype.length = function() {
                        return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
                    }, t.prototype.lengthSquared = function() {
                        return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
                    }, t.prototype.normalize = function() {
                        var e = this.length();
                        if (0 === e) return this;
                        var t = 1 / e;
                        return this.x *= t, this.y *= t, this.z *= t, this.w *= t, this
                    }, t.prototype.toVector3 = function() {
                        return new n(this.x, this.y, this.z)
                    }, t.prototype.clone = function() {
                        return new t(this.x, this.y, this.z, this.w)
                    }, t.prototype.copyFrom = function(e) {
                        return this.x = e.x, this.y = e.y, this.z = e.z, this.w = e.w, this
                    }, t.prototype.copyFromFloats = function(e, t, i, r) {
                        return this.x = e, this.y = t, this.z = i, this.w = r, this
                    }, t.prototype.set = function(e, t, i, r) {
                        return this.copyFromFloats(e, t, i, r)
                    }, t.FromArray = function(e, i) {
                        return i || (i = 0), new t(e[i], e[i + 1], e[i + 2], e[i + 3])
                    }, t.FromArrayToRef = function(e, t, i) {
                        i.x = e[t], i.y = e[t + 1], i.z = e[t + 2], i.w = e[t + 3]
                    }, t.FromFloatArrayToRef = function(e, i, r) {
                        t.FromArrayToRef(e, i, r)
                    }, t.FromFloatsToRef = function(e, t, i, r, n) {
                        n.x = e, n.y = t, n.z = i, n.w = r
                    }, t.Zero = function() {
                        return new t(0, 0, 0, 0)
                    }, t.One = function() {
                        return new t(1, 1, 1, 1)
                    }, t.Normalize = function(e) {
                        var i = t.Zero();
                        return t.NormalizeToRef(e, i), i
                    }, t.NormalizeToRef = function(e, t) {
                        t.copyFrom(e), t.normalize()
                    }, t.Minimize = function(e, t) {
                        var i = e.clone();
                        return i.minimizeInPlace(t), i
                    }, t.Maximize = function(e, t) {
                        var i = e.clone();
                        return i.maximizeInPlace(t), i
                    }, t.Distance = function(e, i) {
                        return Math.sqrt(t.DistanceSquared(e, i))
                    }, t.DistanceSquared = function(e, t) {
                        var i = e.x - t.x,
                            r = e.y - t.y,
                            n = e.z - t.z,
                            o = e.w - t.w;
                        return i * i + r * r + n * n + o * o
                    }, t.Center = function(e, t) {
                        var i = e.add(t);
                        return i.scaleInPlace(.5), i
                    }, t.TransformNormal = function(e, i) {
                        var r = t.Zero();
                        return t.TransformNormalToRef(e, i, r), r
                    }, t.TransformNormalToRef = function(e, t, i) {
                        var r = e.x * t.m[0] + e.y * t.m[4] + e.z * t.m[8],
                            n = e.x * t.m[1] + e.y * t.m[5] + e.z * t.m[9],
                            o = e.x * t.m[2] + e.y * t.m[6] + e.z * t.m[10];
                        i.x = r, i.y = n, i.z = o, i.w = e.w
                    }, t.TransformNormalFromFloatsToRef = function(e, t, i, r, n, o) {
                        o.x = e * n.m[0] + t * n.m[4] + i * n.m[8], o.y = e * n.m[1] + t * n.m[5] + i * n.m[9], o.z = e * n.m[2] + t * n.m[6] + i * n.m[10], o.w = r
                    }, t
                }();
                e.Vector4 = o;
                var s = function() {
                    function e(e, t) {
                        this.width = e, this.height = t
                    }
                    return e.prototype.toString = function() {
                        return "{W: " + this.width + ", H: " + this.height + "}"
                    }, e.prototype.getClassName = function() {
                        return "Size"
                    }, e.prototype.getHashCode = function() {
                        var e = this.width || 0;
                        return e = 397 * e ^ (this.height || 0)
                    }, e.prototype.copyFrom = function(e) {
                        this.width = e.width, this.height = e.height
                    }, e.prototype.copyFromFloats = function(e, t) {
                        return this.width = e, this.height = t, this
                    }, e.prototype.set = function(e, t) {
                        return this.copyFromFloats(e, t)
                    }, e.prototype.multiplyByFloats = function(t, i) {
                        return new e(this.width * t, this.height * i)
                    }, e.prototype.clone = function() {
                        return new e(this.width, this.height)
                    }, e.prototype.equals = function(e) {
                        return !!e && this.width === e.width && this.height === e.height
                    }, Object.defineProperty(e.prototype, "surface", {
                        get: function() {
                            return this.width * this.height
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.Zero = function() {
                        return new e(0, 0)
                    }, e.prototype.add = function(t) {
                        return new e(this.width + t.width, this.height + t.height)
                    }, e.prototype.subtract = function(t) {
                        return new e(this.width - t.width, this.height - t.height)
                    }, e.Lerp = function(t, i, r) {
                        return new e(t.width + (i.width - t.width) * r, t.height + (i.height - t.height) * r)
                    }, e
                }();
                e.Size = s;
                var a = function() {
                    function e(e, t, i, r) {
                        void 0 === e && (e = 0), void 0 === t && (t = 0), void 0 === i && (i = 0), void 0 === r && (r = 1), this.x = e, this.y = t, this.z = i, this.w = r
                    }
                    return e.prototype.toString = function() {
                        return "{X: " + this.x + " Y:" + this.y + " Z:" + this.z + " W:" + this.w + "}"
                    }, e.prototype.getClassName = function() {
                        return "Quaternion"
                    }, e.prototype.getHashCode = function() {
                        var e = this.x || 0;
                        return e = 397 * (e = 397 * (e = 397 * e ^ (this.y || 0)) ^ (this.z || 0)) ^ (this.w || 0)
                    }, e.prototype.asArray = function() {
                        return [this.x, this.y, this.z, this.w]
                    }, e.prototype.equals = function(e) {
                        return e && this.x === e.x && this.y === e.y && this.z === e.z && this.w === e.w
                    }, e.prototype.clone = function() {
                        return new e(this.x, this.y, this.z, this.w)
                    }, e.prototype.copyFrom = function(e) {
                        return this.x = e.x, this.y = e.y, this.z = e.z, this.w = e.w, this
                    }, e.prototype.copyFromFloats = function(e, t, i, r) {
                        return this.x = e, this.y = t, this.z = i, this.w = r, this
                    }, e.prototype.set = function(e, t, i, r) {
                        return this.copyFromFloats(e, t, i, r)
                    }, e.prototype.add = function(t) {
                        return new e(this.x + t.x, this.y + t.y, this.z + t.z, this.w + t.w)
                    }, e.prototype.addInPlace = function(e) {
                        return this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this
                    }, e.prototype.subtract = function(t) {
                        return new e(this.x - t.x, this.y - t.y, this.z - t.z, this.w - t.w)
                    }, e.prototype.scale = function(t) {
                        return new e(this.x * t, this.y * t, this.z * t, this.w * t)
                    }, e.prototype.scaleToRef = function(e, t) {
                        return t.x = this.x * e, t.y = this.y * e, t.z = this.z * e, t.w = this.w * e, this
                    }, e.prototype.scaleInPlace = function(e) {
                        return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this
                    }, e.prototype.scaleAndAddToRef = function(e, t) {
                        return t.x += this.x * e, t.y += this.y * e, t.z += this.z * e, t.w += this.w * e, this
                    }, e.prototype.multiply = function(t) {
                        var i = new e(0, 0, 0, 1);
                        return this.multiplyToRef(t, i), i
                    }, e.prototype.multiplyToRef = function(e, t) {
                        var i = this.x * e.w + this.y * e.z - this.z * e.y + this.w * e.x,
                            r = -this.x * e.z + this.y * e.w + this.z * e.x + this.w * e.y,
                            n = this.x * e.y - this.y * e.x + this.z * e.w + this.w * e.z,
                            o = -this.x * e.x - this.y * e.y - this.z * e.z + this.w * e.w;
                        return t.copyFromFloats(i, r, n, o), this
                    }, e.prototype.multiplyInPlace = function(e) {
                        return this.multiplyToRef(e, this), this
                    }, e.prototype.conjugateToRef = function(e) {
                        return e.copyFromFloats(-this.x, -this.y, -this.z, this.w), this
                    }, e.prototype.conjugateInPlace = function() {
                        return this.x *= -1, this.y *= -1, this.z *= -1, this
                    }, e.prototype.conjugate = function() {
                        return new e(-this.x, -this.y, -this.z, this.w)
                    }, e.prototype.length = function() {
                        return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
                    }, e.prototype.normalize = function() {
                        var e = 1 / this.length();
                        return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this
                    }, e.prototype.toEulerAngles = function(e) {
                        void 0 === e && (e = "YZX");
                        var t = n.Zero();
                        return this.toEulerAnglesToRef(t, e), t
                    }, e.prototype.toEulerAnglesToRef = function(e, t) {
                        void 0 === t && (t = "YZX");
                        var i = this.z,
                            r = this.x,
                            n = this.y,
                            o = this.w,
                            s = o * o,
                            a = i * i,
                            l = r * r,
                            u = n * n,
                            c = n * i - r * o;
                        return c < -.4999999 ? (e.y = 2 * Math.atan2(n, o), e.x = Math.PI / 2, e.z = 0) : .4999999 < c ? (e.y = 2 * Math.atan2(n, o), e.x = -Math.PI / 2, e.z = 0) : (e.z = Math.atan2(2 * (r * n + i * o), -a - l + u + s), e.x = Math.asin(-2 * (i * n - r * o)), e.y = Math.atan2(2 * (i * r + n * o), a - l - u + s)), this
                    }, e.prototype.toRotationMatrix = function(e) {
                        var t = this.x * this.x,
                            i = this.y * this.y,
                            r = this.z * this.z,
                            n = this.x * this.y,
                            o = this.z * this.w,
                            s = this.z * this.x,
                            a = this.y * this.w,
                            l = this.y * this.z,
                            u = this.x * this.w;
                        return e.m[0] = 1 - 2 * (i + r), e.m[1] = 2 * (n + o), e.m[2] = 2 * (s - a), e.m[3] = 0, e.m[4] = 2 * (n - o), e.m[5] = 1 - 2 * (r + t), e.m[6] = 2 * (l + u), e.m[7] = 0, e.m[8] = 2 * (s + a), e.m[9] = 2 * (l - u), e.m[10] = 1 - 2 * (i + t), e.m[11] = 0, e.m[12] = 0, e.m[13] = 0, e.m[14] = 0, e.m[15] = 1, e._markAsUpdated(), this
                    }, e.prototype.fromRotationMatrix = function(t) {
                        return e.FromRotationMatrixToRef(t, this), this
                    }, e.FromRotationMatrix = function(t) {
                        var i = new e;
                        return e.FromRotationMatrixToRef(t, i), i
                    }, e.FromRotationMatrixToRef = function(e, t) {
                        var i, r = e.m,
                            n = r[0],
                            o = r[4],
                            s = r[8],
                            a = r[1],
                            l = r[5],
                            u = r[9],
                            c = r[2],
                            h = r[6],
                            d = r[10],
                            p = n + l + d;
                        0 < p ? (i = .5 / Math.sqrt(p + 1), t.w = .25 / i, t.x = (h - u) * i, t.y = (s - c) * i, t.z = (a - o) * i) : l < n && d < n ? (i = 2 * Math.sqrt(1 + n - l - d), t.w = (h - u) / i, t.x = .25 * i, t.y = (o + a) / i, t.z = (s + c) / i) : d < l ? (i = 2 * Math.sqrt(1 + l - n - d), t.w = (s - c) / i, t.x = (o + a) / i, t.y = .25 * i, t.z = (u + h) / i) : (i = 2 * Math.sqrt(1 + d - n - l), t.w = (a - o) / i, t.x = (s + c) / i, t.y = (u + h) / i, t.z = .25 * i)
                    }, e.Dot = function(e, t) {
                        return e.x * t.x + e.y * t.y + e.z * t.z + e.w * t.w
                    }, e.AreClose = function(t, i) {
                        return 0 <= e.Dot(t, i)
                    }, e.Zero = function() {
                        return new e(0, 0, 0, 0)
                    }, e.Inverse = function(t) {
                        return new e(-t.x, -t.y, -t.z, t.w)
                    }, e.Identity = function() {
                        return new e(0, 0, 0, 1)
                    }, e.IsIdentity = function(e) {
                        return e && 0 === e.x && 0 === e.y && 0 === e.z && 1 === e.w
                    }, e.RotationAxis = function(t, i) {
                        return e.RotationAxisToRef(t, i, new e)
                    }, e.RotationAxisToRef = function(e, t, i) {
                        var r = Math.sin(t / 2);
                        return e.normalize(), i.w = Math.cos(t / 2), i.x = e.x * r, i.y = e.y * r, i.z = e.z * r, i
                    }, e.FromArray = function(t, i) {
                        return i || (i = 0), new e(t[i], t[i + 1], t[i + 2], t[i + 3])
                    }, e.RotationYawPitchRoll = function(t, i, r) {
                        var n = new e;
                        return e.RotationYawPitchRollToRef(t, i, r, n), n
                    }, e.RotationYawPitchRollToRef = function(e, t, i, r) {
                        var n = .5 * i,
                            o = .5 * t,
                            s = .5 * e,
                            a = Math.sin(n),
                            l = Math.cos(n),
                            u = Math.sin(o),
                            c = Math.cos(o),
                            h = Math.sin(s),
                            d = Math.cos(s);
                        r.x = d * u * l + h * c * a, r.y = h * c * l - d * u * a, r.z = d * c * a - h * u * l, r.w = d * c * l + h * u * a
                    }, e.RotationAlphaBetaGamma = function(t, i, r) {
                        var n = new e;
                        return e.RotationAlphaBetaGammaToRef(t, i, r, n), n
                    }, e.RotationAlphaBetaGammaToRef = function(e, t, i, r) {
                        var n = .5 * (i + e),
                            o = .5 * (i - e),
                            s = .5 * t;
                        r.x = Math.cos(o) * Math.sin(s), r.y = Math.sin(o) * Math.sin(s), r.z = Math.sin(n) * Math.cos(s), r.w = Math.cos(n) * Math.cos(s)
                    }, e.RotationQuaternionFromAxis = function(t, i, r) {
                        var n = new e(0, 0, 0, 0);
                        return e.RotationQuaternionFromAxisToRef(t, i, r, n), n
                    }, e.RotationQuaternionFromAxisToRef = function(t, i, r, n) {
                        var o = P.Matrix[0];
                        l.FromXYZAxesToRef(t.normalize(), i.normalize(), r.normalize(), o), e.FromRotationMatrixToRef(o, n)
                    }, e.Slerp = function(t, i, r) {
                        var n = e.Identity();
                        return e.SlerpToRef(t, i, r, n), n
                    }, e.SlerpToRef = function(e, t, i, r) {
                        var n, o, s = e.x * t.x + e.y * t.y + e.z * t.z + e.w * t.w,
                            a = !1;
                        if (s < 0 && (a = !0, s = -s), .999999 < s) o = 1 - i, n = a ? -i : i;
                        else {
                            var l = Math.acos(s),
                                u = 1 / Math.sin(l);
                            o = Math.sin((1 - i) * l) * u, n = a ? -Math.sin(i * l) * u : Math.sin(i * l) * u
                        }
                        r.x = o * e.x + n * t.x, r.y = o * e.y + n * t.y, r.z = o * e.z + n * t.z, r.w = o * e.w + n * t.w
                    }, e.Hermite = function(t, i, r, n, o) {
                        var s = o * o,
                            a = o * s,
                            l = 2 * a - 3 * s + 1,
                            u = -2 * a + 3 * s,
                            c = a - 2 * s + o,
                            h = a - s;
                        return new e(t.x * l + r.x * u + i.x * c + n.x * h, t.y * l + r.y * u + i.y * c + n.y * h, t.z * l + r.z * u + i.z * c + n.z * h, t.w * l + r.w * u + i.w * c + n.w * h)
                    }, e
                }();
                e.Quaternion = a;
                var l = function() {
                    function e() {
                        this._isIdentity = !1, this._isIdentityDirty = !0, this.m = new Float32Array(16), this._markAsUpdated()
                    }
                    return e.prototype._markAsUpdated = function() {
                        this.updateFlag = e._updateFlagSeed++, this._isIdentityDirty = !0
                    }, e.prototype.isIdentity = function(e) {
                        return void 0 === e && (e = !1), this._isIdentityDirty && (this._isIdentityDirty = !1, 1 !== this.m[0] || 1 !== this.m[5] || 1 !== this.m[15] ? this._isIdentity = !1 : 0 !== this.m[1] || 0 !== this.m[2] || 0 !== this.m[3] || 0 !== this.m[4] || 0 !== this.m[6] || 0 !== this.m[7] || 0 !== this.m[8] || 0 !== this.m[9] || 0 !== this.m[11] || 0 !== this.m[12] || 0 !== this.m[13] || 0 !== this.m[14] ? this._isIdentity = !1 : this._isIdentity = !0, e || 1 === this.m[10] || (this._isIdentity = !1)), this._isIdentity
                    }, e.prototype.determinant = function() {
                        var e = this.m[10] * this.m[15] - this.m[11] * this.m[14],
                            t = this.m[9] * this.m[15] - this.m[11] * this.m[13],
                            i = this.m[9] * this.m[14] - this.m[10] * this.m[13],
                            r = this.m[8] * this.m[15] - this.m[11] * this.m[12],
                            n = this.m[8] * this.m[14] - this.m[10] * this.m[12],
                            o = this.m[8] * this.m[13] - this.m[9] * this.m[12];
                        return this.m[0] * (this.m[5] * e - this.m[6] * t + this.m[7] * i) - this.m[1] * (this.m[4] * e - this.m[6] * r + this.m[7] * n) + this.m[2] * (this.m[4] * t - this.m[5] * r + this.m[7] * o) - this.m[3] * (this.m[4] * i - this.m[5] * n + this.m[6] * o)
                    }, e.prototype.toArray = function() {
                        return this.m
                    }, e.prototype.asArray = function() {
                        return this.toArray()
                    }, e.prototype.invert = function() {
                        return this.invertToRef(this), this
                    }, e.prototype.reset = function() {
                        for (var e = 0; e < 16; e++) this.m[e] = 0;
                        return this._markAsUpdated(), this
                    }, e.prototype.add = function(t) {
                        var i = new e;
                        return this.addToRef(t, i), i
                    }, e.prototype.addToRef = function(e, t) {
                        for (var i = 0; i < 16; i++) t.m[i] = this.m[i] + e.m[i];
                        return t._markAsUpdated(), this
                    }, e.prototype.addToSelf = function(e) {
                        for (var t = 0; t < 16; t++) this.m[t] += e.m[t];
                        return this._markAsUpdated(), this
                    }, e.prototype.invertToRef = function(e) {
                        var t = this.m[0],
                            i = this.m[1],
                            r = this.m[2],
                            n = this.m[3],
                            o = this.m[4],
                            s = this.m[5],
                            a = this.m[6],
                            l = this.m[7],
                            u = this.m[8],
                            c = this.m[9],
                            h = this.m[10],
                            d = this.m[11],
                            p = this.m[12],
                            f = this.m[13],
                            _ = this.m[14],
                            m = this.m[15],
                            g = h * m - d * _,
                            v = c * m - d * f,
                            y = c * _ - h * f,
                            b = u * m - d * p,
                            x = u * _ - h * p,
                            T = u * f - c * p,
                            E = s * g - a * v + l * y,
                            S = -(o * g - a * b + l * x),
                            P = o * v - s * b + l * T,
                            A = -(o * y - s * x + a * T),
                            C = 1 / (t * E + i * S + r * P + n * A),
                            M = a * m - l * _,
                            R = s * m - l * f,
                            O = s * _ - a * f,
                            w = o * m - l * p,
                            I = o * _ - a * p,
                            D = o * f - s * p,
                            L = a * d - l * h,
                            B = s * d - l * c,
                            F = s * h - a * c,
                            N = o * d - l * u,
                            V = o * h - a * u,
                            k = o * c - s * u;
                        return e.m[0] = E * C, e.m[4] = S * C, e.m[8] = P * C, e.m[12] = A * C, e.m[1] = -(i * g - r * v + n * y) * C, e.m[5] = (t * g - r * b + n * x) * C, e.m[9] = -(t * v - i * b + n * T) * C, e.m[13] = (t * y - i * x + r * T) * C, e.m[2] = (i * M - r * R + n * O) * C, e.m[6] = -(t * M - r * w + n * I) * C, e.m[10] = (t * R - i * w + n * D) * C, e.m[14] = -(t * O - i * I + r * D) * C, e.m[3] = -(i * L - r * B + n * F) * C, e.m[7] = (t * L - r * N + n * V) * C, e.m[11] = -(t * B - i * N + n * k) * C, e.m[15] = (t * F - i * V + r * k) * C, e._markAsUpdated(), this
                    }, e.prototype.setTranslationFromFloats = function(e, t, i) {
                        return this.m[12] = e, this.m[13] = t, this.m[14] = i, this._markAsUpdated(), this
                    }, e.prototype.setTranslation = function(e) {
                        return this.m[12] = e.x, this.m[13] = e.y, this.m[14] = e.z, this._markAsUpdated(), this
                    }, e.prototype.getTranslation = function() {
                        return new n(this.m[12], this.m[13], this.m[14])
                    }, e.prototype.getTranslationToRef = function(e) {
                        return e.x = this.m[12], e.y = this.m[13], e.z = this.m[14], this
                    }, e.prototype.removeRotationAndScaling = function() {
                        return this.setRowFromFloats(0, 1, 0, 0, 0), this.setRowFromFloats(1, 0, 1, 0, 0), this.setRowFromFloats(2, 0, 0, 1, 0), this
                    }, e.prototype.multiply = function(t) {
                        var i = new e;
                        return this.multiplyToRef(t, i), i
                    }, e.prototype.copyFrom = function(e) {
                        for (var t = 0; t < 16; t++) this.m[t] = e.m[t];
                        return this._markAsUpdated(), this
                    }, e.prototype.copyToArray = function(e, t) {
                        void 0 === t && (t = 0);
                        for (var i = 0; i < 16; i++) e[t + i] = this.m[i];
                        return this
                    }, e.prototype.multiplyToRef = function(e, t) {
                        return this.multiplyToArray(e, t.m, 0), t._markAsUpdated(), this
                    }, e.prototype.multiplyToArray = function(e, t, i) {
                        var r = this.m[0],
                            n = this.m[1],
                            o = this.m[2],
                            s = this.m[3],
                            a = this.m[4],
                            l = this.m[5],
                            u = this.m[6],
                            c = this.m[7],
                            h = this.m[8],
                            d = this.m[9],
                            p = this.m[10],
                            f = this.m[11],
                            _ = this.m[12],
                            m = this.m[13],
                            g = this.m[14],
                            v = this.m[15],
                            y = e.m[0],
                            b = e.m[1],
                            x = e.m[2],
                            T = e.m[3],
                            E = e.m[4],
                            S = e.m[5],
                            P = e.m[6],
                            A = e.m[7],
                            C = e.m[8],
                            M = e.m[9],
                            R = e.m[10],
                            O = e.m[11],
                            w = e.m[12],
                            I = e.m[13],
                            D = e.m[14],
                            L = e.m[15];
                        return t[i] = r * y + n * E + o * C + s * w, t[i + 1] = r * b + n * S + o * M + s * I, t[i + 2] = r * x + n * P + o * R + s * D, t[i + 3] = r * T + n * A + o * O + s * L, t[i + 4] = a * y + l * E + u * C + c * w, t[i + 5] = a * b + l * S + u * M + c * I, t[i + 6] = a * x + l * P + u * R + c * D, t[i + 7] = a * T + l * A + u * O + c * L, t[i + 8] = h * y + d * E + p * C + f * w, t[i + 9] = h * b + d * S + p * M + f * I, t[i + 10] = h * x + d * P + p * R + f * D, t[i + 11] = h * T + d * A + p * O + f * L, t[i + 12] = _ * y + m * E + g * C + v * w, t[i + 13] = _ * b + m * S + g * M + v * I, t[i + 14] = _ * x + m * P + g * R + v * D, t[i + 15] = _ * T + m * A + g * O + v * L, this
                    }, e.prototype.equals = function(e) {
                        return e && this.m[0] === e.m[0] && this.m[1] === e.m[1] && this.m[2] === e.m[2] && this.m[3] === e.m[3] && this.m[4] === e.m[4] && this.m[5] === e.m[5] && this.m[6] === e.m[6] && this.m[7] === e.m[7] && this.m[8] === e.m[8] && this.m[9] === e.m[9] && this.m[10] === e.m[10] && this.m[11] === e.m[11] && this.m[12] === e.m[12] && this.m[13] === e.m[13] && this.m[14] === e.m[14] && this.m[15] === e.m[15]
                    }, e.prototype.clone = function() {
                        return e.FromValues(this.m[0], this.m[1], this.m[2], this.m[3], this.m[4], this.m[5], this.m[6], this.m[7], this.m[8], this.m[9], this.m[10], this.m[11], this.m[12], this.m[13], this.m[14], this.m[15])
                    }, e.prototype.getClassName = function() {
                        return "Matrix"
                    }, e.prototype.getHashCode = function() {
                        for (var e = this.m[0] || 0, t = 1; t < 16; t++) e = 397 * e ^ (this.m[t] || 0);
                        return e
                    }, e.prototype.decompose = function(t, i, r) {
                        return r && (r.x = this.m[12], r.y = this.m[13], r.z = this.m[14]), (t = t || P.Vector3[0]).x = Math.sqrt(this.m[0] * this.m[0] + this.m[1] * this.m[1] + this.m[2] * this.m[2]), t.y = Math.sqrt(this.m[4] * this.m[4] + this.m[5] * this.m[5] + this.m[6] * this.m[6]), t.z = Math.sqrt(this.m[8] * this.m[8] + this.m[9] * this.m[9] + this.m[10] * this.m[10]), this.determinant() <= 0 && (t.y *= -1), 0 === t.x || 0 === t.y || 0 === t.z ? (i && (i.x = 0, i.y = 0, i.z = 0, i.w = 1), !1) : (i && (e.FromValuesToRef(this.m[0] / t.x, this.m[1] / t.x, this.m[2] / t.x, 0, this.m[4] / t.y, this.m[5] / t.y, this.m[6] / t.y, 0, this.m[8] / t.z, this.m[9] / t.z, this.m[10] / t.z, 0, 0, 0, 0, 1, P.Matrix[0]), a.FromRotationMatrixToRef(P.Matrix[0], i)), !0)
                    }, e.prototype.getRow = function(e) {
                        if (e < 0 || 3 < e) return null;
                        var t = 4 * e;
                        return new o(this.m[t + 0], this.m[t + 1], this.m[t + 2], this.m[t + 3])
                    }, e.prototype.setRow = function(e, t) {
                        if (e < 0 || 3 < e) return this;
                        var i = 4 * e;
                        return this.m[i + 0] = t.x, this.m[i + 1] = t.y, this.m[i + 2] = t.z, this.m[i + 3] = t.w, this._markAsUpdated(), this
                    }, e.prototype.transpose = function() {
                        return e.Transpose(this)
                    }, e.prototype.transposeToRef = function(t) {
                        return e.TransposeToRef(this, t), this
                    }, e.prototype.setRowFromFloats = function(e, t, i, r, n) {
                        if (e < 0 || 3 < e) return this;
                        var o = 4 * e;
                        return this.m[o + 0] = t, this.m[o + 1] = i, this.m[o + 2] = r, this.m[o + 3] = n, this._markAsUpdated(), this
                    }, e.prototype.scale = function(t) {
                        var i = new e;
                        return this.scaleToRef(t, i), i
                    }, e.prototype.scaleToRef = function(e, t) {
                        for (var i = 0; i < 16; i++) t.m[i] = this.m[i] * e;
                        return t._markAsUpdated(), this
                    }, e.prototype.scaleAndAddToRef = function(e, t) {
                        for (var i = 0; i < 16; i++) t.m[i] += this.m[i] * e;
                        return t._markAsUpdated(), this
                    }, e.prototype.toNormalMatrix = function(t) {
                        this.invertToRef(t), t.transpose();
                        var i = t.m;
                        e.FromValuesToRef(i[0], i[1], i[2], 0, i[4], i[5], i[6], 0, i[8], i[9], i[10], 0, 0, 0, 0, 1, t)
                    }, e.prototype.getRotationMatrix = function() {
                        var t = e.Identity();
                        return this.getRotationMatrixToRef(t), t
                    }, e.prototype.getRotationMatrixToRef = function(t) {
                        var i = this.m,
                            r = Math.sqrt(i[0] * i[0] + i[1] * i[1] + i[2] * i[2]),
                            n = Math.sqrt(i[4] * i[4] + i[5] * i[5] + i[6] * i[6]),
                            o = Math.sqrt(i[8] * i[8] + i[9] * i[9] + i[10] * i[10]);
                        return this.determinant() <= 0 && (n *= -1), 0 === r || 0 === n || 0 === o ? e.IdentityToRef(t) : e.FromValuesToRef(i[0] / r, i[1] / r, i[2] / r, 0, i[4] / n, i[5] / n, i[6] / n, 0, i[8] / o, i[9] / o, i[10] / o, 0, 0, 0, 0, 1, t), this
                    }, e.FromArray = function(t, i) {
                        var r = new e;
                        return i || (i = 0), e.FromArrayToRef(t, i, r), r
                    }, e.FromArrayToRef = function(e, t, i) {
                        for (var r = 0; r < 16; r++) i.m[r] = e[r + t];
                        i._markAsUpdated()
                    }, e.FromFloat32ArrayToRefScaled = function(e, t, i, r) {
                        for (var n = 0; n < 16; n++) r.m[n] = e[n + t] * i;
                        r._markAsUpdated()
                    }, e.FromValuesToRef = function(e, t, i, r, n, o, s, a, l, u, c, h, d, p, f, _, m) {
                        m.m[0] = e, m.m[1] = t, m.m[2] = i, m.m[3] = r, m.m[4] = n, m.m[5] = o, m.m[6] = s, m.m[7] = a, m.m[8] = l, m.m[9] = u, m.m[10] = c, m.m[11] = h, m.m[12] = d, m.m[13] = p, m.m[14] = f, m.m[15] = _, m._markAsUpdated()
                    }, Object.defineProperty(e, "IdentityReadOnly", {
                        get: function() {
                            return e._identityReadOnly
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.FromValues = function(t, i, r, n, o, s, a, l, u, c, h, d, p, f, _, m) {
                        var g = new e;
                        return g.m[0] = t, g.m[1] = i, g.m[2] = r, g.m[3] = n, g.m[4] = o, g.m[5] = s, g.m[6] = a, g.m[7] = l, g.m[8] = u, g.m[9] = c, g.m[10] = h, g.m[11] = d, g.m[12] = p, g.m[13] = f, g.m[14] = _, g.m[15] = m, g
                    }, e.Compose = function(t, i, r) {
                        var n = e.Identity();
                        return e.ComposeToRef(t, i, r, n), n
                    }, e.ComposeToRef = function(t, i, r, n) {
                        e.FromValuesToRef(t.x, 0, 0, 0, 0, t.y, 0, 0, 0, 0, t.z, 0, 0, 0, 0, 1, P.Matrix[1]), i.toRotationMatrix(P.Matrix[0]), P.Matrix[1].multiplyToRef(P.Matrix[0], n), n.setTranslation(r)
                    }, e.Identity = function() {
                        return e.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
                    }, e.IdentityToRef = function(t) {
                        e.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, t)
                    }, e.Zero = function() {
                        return e.FromValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                    }, e.RotationX = function(t) {
                        var i = new e;
                        return e.RotationXToRef(t, i), i
                    }, e.Invert = function(t) {
                        var i = new e;
                        return t.invertToRef(i), i
                    }, e.RotationXToRef = function(e, t) {
                        var i = Math.sin(e),
                            r = Math.cos(e);
                        t.m[0] = 1, t.m[15] = 1, t.m[5] = r, t.m[10] = r, t.m[9] = -i, t.m[6] = i, t.m[1] = 0, t.m[2] = 0, t.m[3] = 0, t.m[4] = 0, t.m[7] = 0, t.m[8] = 0, t.m[11] = 0, t.m[12] = 0, t.m[13] = 0, t.m[14] = 0, t._markAsUpdated()
                    }, e.RotationY = function(t) {
                        var i = new e;
                        return e.RotationYToRef(t, i), i
                    }, e.RotationYToRef = function(e, t) {
                        var i = Math.sin(e),
                            r = Math.cos(e);
                        t.m[5] = 1, t.m[15] = 1, t.m[0] = r, t.m[2] = -i, t.m[8] = i, t.m[10] = r, t.m[1] = 0, t.m[3] = 0, t.m[4] = 0, t.m[6] = 0, t.m[7] = 0, t.m[9] = 0, t.m[11] = 0, t.m[12] = 0, t.m[13] = 0, t.m[14] = 0, t._markAsUpdated()
                    }, e.RotationZ = function(t) {
                        var i = new e;
                        return e.RotationZToRef(t, i), i
                    }, e.RotationZToRef = function(e, t) {
                        var i = Math.sin(e),
                            r = Math.cos(e);
                        t.m[10] = 1, t.m[15] = 1, t.m[0] = r, t.m[1] = i, t.m[4] = -i, t.m[5] = r, t.m[2] = 0, t.m[3] = 0, t.m[6] = 0, t.m[7] = 0, t.m[8] = 0, t.m[9] = 0, t.m[11] = 0, t.m[12] = 0, t.m[13] = 0, t.m[14] = 0, t._markAsUpdated()
                    }, e.RotationAxis = function(t, i) {
                        var r = e.Zero();
                        return e.RotationAxisToRef(t, i, r), r
                    }, e.RotationAxisToRef = function(e, t, i) {
                        var r = Math.sin(-t),
                            n = Math.cos(-t),
                            o = 1 - n;
                        e.normalize(), i.m[0] = e.x * e.x * o + n, i.m[1] = e.x * e.y * o - e.z * r, i.m[2] = e.x * e.z * o + e.y * r, i.m[3] = 0, i.m[4] = e.y * e.x * o + e.z * r, i.m[5] = e.y * e.y * o + n, i.m[6] = e.y * e.z * o - e.x * r, i.m[7] = 0, i.m[8] = e.z * e.x * o - e.y * r, i.m[9] = e.z * e.y * o + e.x * r, i.m[10] = e.z * e.z * o + n, i.m[11] = 0, i.m[15] = 1, i._markAsUpdated()
                    }, e.RotationYawPitchRoll = function(t, i, r) {
                        var n = new e;
                        return e.RotationYawPitchRollToRef(t, i, r, n), n
                    }, e.RotationYawPitchRollToRef = function(e, t, i, r) {
                        a.RotationYawPitchRollToRef(e, t, i, this._tempQuaternion), this._tempQuaternion.toRotationMatrix(r)
                    }, e.Scaling = function(t, i, r) {
                        var n = e.Zero();
                        return e.ScalingToRef(t, i, r, n), n
                    }, e.ScalingToRef = function(e, t, i, r) {
                        r.m[0] = e, r.m[1] = 0, r.m[2] = 0, r.m[3] = 0, r.m[4] = 0, r.m[5] = t, r.m[6] = 0, r.m[7] = 0, r.m[8] = 0, r.m[9] = 0, r.m[10] = i, r.m[11] = 0, r.m[12] = 0, r.m[13] = 0, r.m[14] = 0, r.m[15] = 1, r._markAsUpdated()
                    }, e.Translation = function(t, i, r) {
                        var n = e.Identity();
                        return e.TranslationToRef(t, i, r, n), n
                    }, e.TranslationToRef = function(t, i, r, n) {
                        e.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t, i, r, 1, n)
                    }, e.Lerp = function(t, i, r) {
                        var n = e.Zero();
                        return e.LerpToRef(t, i, r, n), n
                    }, e.LerpToRef = function(e, t, i, r) {
                        for (var n = 0; n < 16; n++) r.m[n] = e.m[n] * (1 - i) + t.m[n] * i;
                        r._markAsUpdated()
                    }, e.DecomposeLerp = function(t, i, r) {
                        var n = e.Zero();
                        return e.DecomposeLerpToRef(t, i, r, n), n
                    }, e.DecomposeLerpToRef = function(t, i, r, o) {
                        var s = P.Vector3[0],
                            l = P.Quaternion[0],
                            u = P.Vector3[1];
                        t.decompose(s, l, u);
                        var c = P.Vector3[2],
                            h = P.Quaternion[1],
                            d = P.Vector3[3];
                        i.decompose(c, h, d);
                        var p = P.Vector3[4];
                        n.LerpToRef(s, c, r, p);
                        var f = P.Quaternion[2];
                        a.SlerpToRef(l, h, r, f);
                        var _ = P.Vector3[5];
                        n.LerpToRef(u, d, r, _), e.ComposeToRef(p, f, _, o)
                    }, e.LookAtLH = function(t, i, r) {
                        var n = e.Zero();
                        return e.LookAtLHToRef(t, i, r, n), n
                    }, e.LookAtLHToRef = function(t, i, r, o) {
                        i.subtractToRef(t, this._zAxis), this._zAxis.normalize(), n.CrossToRef(r, this._zAxis, this._xAxis), 0 === this._xAxis.lengthSquared() ? this._xAxis.x = 1 : this._xAxis.normalize(), n.CrossToRef(this._zAxis, this._xAxis, this._yAxis), this._yAxis.normalize();
                        var s = -n.Dot(this._xAxis, t),
                            a = -n.Dot(this._yAxis, t),
                            l = -n.Dot(this._zAxis, t);
                        return e.FromValuesToRef(this._xAxis.x, this._yAxis.x, this._zAxis.x, 0, this._xAxis.y, this._yAxis.y, this._zAxis.y, 0, this._xAxis.z, this._yAxis.z, this._zAxis.z, 0, s, a, l, 1, o)
                    }, e.LookAtRH = function(t, i, r) {
                        var n = e.Zero();
                        return e.LookAtRHToRef(t, i, r, n), n
                    }, e.LookAtRHToRef = function(t, i, r, o) {
                        t.subtractToRef(i, this._zAxis), this._zAxis.normalize(), n.CrossToRef(r, this._zAxis, this._xAxis), 0 === this._xAxis.lengthSquared() ? this._xAxis.x = 1 : this._xAxis.normalize(), n.CrossToRef(this._zAxis, this._xAxis, this._yAxis), this._yAxis.normalize();
                        var s = -n.Dot(this._xAxis, t),
                            a = -n.Dot(this._yAxis, t),
                            l = -n.Dot(this._zAxis, t);
                        return e.FromValuesToRef(this._xAxis.x, this._yAxis.x, this._zAxis.x, 0, this._xAxis.y, this._yAxis.y, this._zAxis.y, 0, this._xAxis.z, this._yAxis.z, this._zAxis.z, 0, s, a, l, 1, o)
                    }, e.OrthoLH = function(t, i, r, n) {
                        var o = e.Zero();
                        return e.OrthoLHToRef(t, i, r, n, o), o
                    }, e.OrthoLHToRef = function(t, i, r, n, o) {
                        e.FromValuesToRef(2 / t, 0, 0, 0, 0, 2 / i, 0, 0, 0, 0, 2 / (n - r), 0, 0, 0, -(n + r) / (n - r), 1, o)
                    }, e.OrthoOffCenterLH = function(t, i, r, n, o, s) {
                        var a = e.Zero();
                        return e.OrthoOffCenterLHToRef(t, i, r, n, o, s, a), a
                    }, e.OrthoOffCenterLHToRef = function(t, i, r, n, o, s, a) {
                        e.FromValuesToRef(2 / (i - t), 0, 0, 0, 0, 2 / (n - r), 0, 0, 0, 0, 2 / (s - o), 0, (t + i) / (t - i), (n + r) / (r - n), -(s + o) / (s - o), 1, a)
                    }, e.OrthoOffCenterRH = function(t, i, r, n, o, s) {
                        var a = e.Zero();
                        return e.OrthoOffCenterRHToRef(t, i, r, n, o, s, a), a
                    }, e.OrthoOffCenterRHToRef = function(t, i, r, n, o, s, a) {
                        e.OrthoOffCenterLHToRef(t, i, r, n, o, s, a), a.m[10] *= -1
                    }, e.PerspectiveLH = function(t, i, r, n) {
                        var o = e.Zero();
                        return e.FromValuesToRef(2 * r / t, 0, 0, 0, 0, 2 * r / i, 0, 0, 0, 0, (n + r) / (n - r), 1, 0, 0, -2 * n * r / (n - r), 0, o), o
                    }, e.PerspectiveFovLH = function(t, i, r, n) {
                        var o = e.Zero();
                        return e.PerspectiveFovLHToRef(t, i, r, n, o), o
                    }, e.PerspectiveFovLHToRef = function(t, i, r, n, o, s) {
                        void 0 === s && (s = !0);
                        var a = r,
                            l = n,
                            u = 1 / Math.tan(.5 * t);
                        e.FromValuesToRef(s ? u / i : u, 0, 0, 0, 0, s ? u : u * i, 0, 0, 0, 0, (l + a) / (l - a), 1, 0, 0, -2 * l * a / (l - a), 0, o)
                    }, e.PerspectiveFovRH = function(t, i, r, n) {
                        var o = e.Zero();
                        return e.PerspectiveFovRHToRef(t, i, r, n, o), o
                    }, e.PerspectiveFovRHToRef = function(t, i, r, n, o, s) {
                        void 0 === s && (s = !0);
                        var a = r,
                            l = n,
                            u = 1 / Math.tan(.5 * t);
                        e.FromValuesToRef(s ? u / i : u, 0, 0, 0, 0, s ? u : u * i, 0, 0, 0, 0, -(l + a) / (l - a), -1, 0, 0, -2 * l * a / (l - a), 0, o)
                    }, e.PerspectiveFovWebVRToRef = function(e, t, i, r, n) {
                        void 0 === n && (n = !1);
                        var o = n ? -1 : 1,
                            s = Math.tan(e.upDegrees * Math.PI / 180),
                            a = Math.tan(e.downDegrees * Math.PI / 180),
                            l = Math.tan(e.leftDegrees * Math.PI / 180),
                            u = Math.tan(e.rightDegrees * Math.PI / 180),
                            c = 2 / (l + u),
                            h = 2 / (s + a);
                        r.m[0] = c, r.m[1] = r.m[2] = r.m[3] = r.m[4] = 0, r.m[5] = h, r.m[6] = r.m[7] = 0, r.m[8] = (l - u) * c * .5, r.m[9] = -(s - a) * h * .5, r.m[10] = -i / (t - i), r.m[11] = 1 * o, r.m[12] = r.m[13] = r.m[15] = 0, r.m[14] = -2 * i * t / (i - t), r._markAsUpdated()
                    }, e.GetFinalMatrix = function(t, i, r, n, o, s) {
                        var a = t.width,
                            l = t.height,
                            u = t.x,
                            c = t.y,
                            h = e.FromValues(a / 2, 0, 0, 0, 0, -l / 2, 0, 0, 0, 0, s - o, 0, u + a / 2, l / 2 + c, o, 1);
                        return i.multiply(r).multiply(n).multiply(h)
                    }, e.GetAsMatrix2x2 = function(e) {
                        return new Float32Array([e.m[0], e.m[1], e.m[4], e.m[5]])
                    }, e.GetAsMatrix3x3 = function(e) {
                        return new Float32Array([e.m[0], e.m[1], e.m[2], e.m[4], e.m[5], e.m[6], e.m[8], e.m[9], e.m[10]])
                    }, e.Transpose = function(t) {
                        var i = new e;
                        return e.TransposeToRef(t, i), i
                    }, e.TransposeToRef = function(e, t) {
                        t.m[0] = e.m[0], t.m[1] = e.m[4], t.m[2] = e.m[8], t.m[3] = e.m[12], t.m[4] = e.m[1], t.m[5] = e.m[5], t.m[6] = e.m[9], t.m[7] = e.m[13], t.m[8] = e.m[2], t.m[9] = e.m[6], t.m[10] = e.m[10], t.m[11] = e.m[14], t.m[12] = e.m[3], t.m[13] = e.m[7], t.m[14] = e.m[11], t.m[15] = e.m[15]
                    }, e.Reflection = function(t) {
                        var i = new e;
                        return e.ReflectionToRef(t, i), i
                    }, e.ReflectionToRef = function(e, t) {
                        e.normalize();
                        var i = e.normal.x,
                            r = e.normal.y,
                            n = e.normal.z,
                            o = -2 * i,
                            s = -2 * r,
                            a = -2 * n;
                        t.m[0] = o * i + 1, t.m[1] = s * i, t.m[2] = a * i, t.m[3] = 0, t.m[4] = o * r, t.m[5] = s * r + 1, t.m[6] = a * r, t.m[7] = 0, t.m[8] = o * n, t.m[9] = s * n, t.m[10] = a * n + 1, t.m[11] = 0, t.m[12] = o * e.d, t.m[13] = s * e.d, t.m[14] = a * e.d, t.m[15] = 1, t._markAsUpdated()
                    }, e.FromXYZAxesToRef = function(e, t, i, r) {
                        r.m[0] = e.x, r.m[1] = e.y, r.m[2] = e.z, r.m[3] = 0, r.m[4] = t.x, r.m[5] = t.y, r.m[6] = t.z, r.m[7] = 0, r.m[8] = i.x, r.m[9] = i.y, r.m[10] = i.z, r.m[11] = 0, r.m[12] = 0, r.m[13] = 0, r.m[14] = 0, r.m[15] = 1, r._markAsUpdated()
                    }, e.FromQuaternionToRef = function(e, t) {
                        var i = e.x * e.x,
                            r = e.y * e.y,
                            n = e.z * e.z,
                            o = e.x * e.y,
                            s = e.z * e.w,
                            a = e.z * e.x,
                            l = e.y * e.w,
                            u = e.y * e.z,
                            c = e.x * e.w;
                        t.m[0] = 1 - 2 * (r + n), t.m[1] = 2 * (o + s), t.m[2] = 2 * (a - l), t.m[3] = 0, t.m[4] = 2 * (o - s), t.m[5] = 1 - 2 * (n + i), t.m[6] = 2 * (u + c), t.m[7] = 0, t.m[8] = 2 * (a + l), t.m[9] = 2 * (u - c), t.m[10] = 1 - 2 * (r + i), t.m[11] = 0, t.m[12] = 0, t.m[13] = 0, t.m[14] = 0, t.m[15] = 1, t._markAsUpdated()
                    }, e._tempQuaternion = new a, e._xAxis = n.Zero(), e._yAxis = n.Zero(), e._zAxis = n.Zero(), e._updateFlagSeed = 0, e._identityReadOnly = e.Identity(), e
                }();
                e.Matrix = l;
                var u = function() {
                    function e(e, t, i, r) {
                        this.normal = new n(e, t, i), this.d = r
                    }
                    return e.prototype.asArray = function() {
                        return [this.normal.x, this.normal.y, this.normal.z, this.d]
                    }, e.prototype.clone = function() {
                        return new e(this.normal.x, this.normal.y, this.normal.z, this.d)
                    }, e.prototype.getClassName = function() {
                        return "Plane"
                    }, e.prototype.getHashCode = function() {
                        var e = this.normal.getHashCode();
                        return e = 397 * e ^ (this.d || 0)
                    }, e.prototype.normalize = function() {
                        var e = Math.sqrt(this.normal.x * this.normal.x + this.normal.y * this.normal.y + this.normal.z * this.normal.z),
                            t = 0;
                        return 0 !== e && (t = 1 / e), this.normal.x *= t, this.normal.y *= t, this.normal.z *= t, this.d *= t, this
                    }, e.prototype.transform = function(t) {
                        var i = l.Transpose(t),
                            r = this.normal.x,
                            n = this.normal.y,
                            o = this.normal.z,
                            s = this.d;
                        return new e(r * i.m[0] + n * i.m[1] + o * i.m[2] + s * i.m[3], r * i.m[4] + n * i.m[5] + o * i.m[6] + s * i.m[7], r * i.m[8] + n * i.m[9] + o * i.m[10] + s * i.m[11], r * i.m[12] + n * i.m[13] + o * i.m[14] + s * i.m[15])
                    }, e.prototype.dotCoordinate = function(e) {
                        return this.normal.x * e.x + this.normal.y * e.y + this.normal.z * e.z + this.d
                    }, e.prototype.copyFromPoints = function(e, t, i) {
                        var r, n = t.x - e.x,
                            o = t.y - e.y,
                            s = t.z - e.z,
                            a = i.x - e.x,
                            l = i.y - e.y,
                            u = i.z - e.z,
                            c = o * u - s * l,
                            h = s * a - n * u,
                            d = n * l - o * a,
                            p = Math.sqrt(c * c + h * h + d * d);
                        return r = 0 !== p ? 1 / p : 0, this.normal.x = c * r, this.normal.y = h * r, this.normal.z = d * r, this.d = -(this.normal.x * e.x + this.normal.y * e.y + this.normal.z * e.z), this
                    }, e.prototype.isFrontFacingTo = function(e, t) {
                        return n.Dot(this.normal, e) <= t
                    }, e.prototype.signedDistanceTo = function(e) {
                        return n.Dot(e, this.normal) + this.d
                    }, e.FromArray = function(t) {
                        return new e(t[0], t[1], t[2], t[3])
                    }, e.FromPoints = function(t, i, r) {
                        var n = new e(0, 0, 0, 0);
                        return n.copyFromPoints(t, i, r), n
                    }, e.FromPositionAndNormal = function(t, i) {
                        var r = new e(0, 0, 0, 0);
                        return i.normalize(), r.normal = i, r.d = -(i.x * t.x + i.y * t.y + i.z * t.z), r
                    }, e.SignedDistanceToPlaneFromPositionAndNormal = function(e, t, i) {
                        var r = -(t.x * e.x + t.y * e.y + t.z * e.z);
                        return n.Dot(i, t) + r
                    }, e
                }();
                e.Plane = u;
                var c = function() {
                    function e(e, t, i, r) {
                        this.x = e, this.y = t, this.width = i, this.height = r
                    }
                    return e.prototype.toGlobal = function(t, i) {
                        if (t.getRenderWidth) {
                            var r = t;
                            return this.toGlobal(r.getRenderWidth(), r.getRenderHeight())
                        }
                        var n = t;
                        return new e(this.x * n, this.y * i, this.width * n, this.height * i)
                    }, e.prototype.clone = function() {
                        return new e(this.x, this.y, this.width, this.height)
                    }, e
                }();
                e.Viewport = c;
                var h, d = function() {
                    function e() {}
                    return e.GetPlanes = function(t) {
                        for (var i = [], r = 0; r < 6; r++) i.push(new u(0, 0, 0, 0));
                        return e.GetPlanesToRef(t, i), i
                    }, e.GetNearPlaneToRef = function(e, t) {
                        t.normal.x = e.m[3] + e.m[2], t.normal.y = e.m[7] + e.m[6], t.normal.z = e.m[11] + e.m[10], t.d = e.m[15] + e.m[14], t.normalize()
                    }, e.GetFarPlaneToRef = function(e, t) {
                        t.normal.x = e.m[3] - e.m[2], t.normal.y = e.m[7] - e.m[6], t.normal.z = e.m[11] - e.m[10], t.d = e.m[15] - e.m[14], t.normalize()
                    }, e.GetLeftPlaneToRef = function(e, t) {
                        t.normal.x = e.m[3] + e.m[0], t.normal.y = e.m[7] + e.m[4], t.normal.z = e.m[11] + e.m[8], t.d = e.m[15] + e.m[12], t.normalize()
                    }, e.GetRightPlaneToRef = function(e, t) {
                        t.normal.x = e.m[3] - e.m[0], t.normal.y = e.m[7] - e.m[4], t.normal.z = e.m[11] - e.m[8], t.d = e.m[15] - e.m[12], t.normalize()
                    }, e.GetTopPlaneToRef = function(e, t) {
                        t.normal.x = e.m[3] - e.m[1], t.normal.y = e.m[7] - e.m[5], t.normal.z = e.m[11] - e.m[9], t.d = e.m[15] - e.m[13], t.normalize()
                    }, e.GetBottomPlaneToRef = function(e, t) {
                        t.normal.x = e.m[3] + e.m[1], t.normal.y = e.m[7] + e.m[5], t.normal.z = e.m[11] + e.m[9], t.d = e.m[15] + e.m[13], t.normalize()
                    }, e.GetPlanesToRef = function(t, i) {
                        e.GetNearPlaneToRef(t, i[0]), e.GetFarPlaneToRef(t, i[1]), e.GetLeftPlaneToRef(t, i[2]), e.GetRightPlaneToRef(t, i[3]), e.GetTopPlaneToRef(t, i[4]), e.GetBottomPlaneToRef(t, i[5])
                    }, e
                }();
                e.Frustum = d, (h = e.Space || (e.Space = {}))[h.LOCAL = 0] = "LOCAL", h[h.WORLD = 1] = "WORLD", h[h.BONE = 2] = "BONE";
                var p = function() {
                    function e() {}
                    return e.X = new n(1, 0, 0), e.Y = new n(0, 1, 0), e.Z = new n(0, 0, 1), e
                }();
                e.Axis = p;
                var f, _, m = function() {
                    function e() {}
                    return e.Interpolate = function(e, t, i, r, n) {
                        for (var o = 1 - 3 * r + 3 * t, s = 3 * r - 6 * t, a = 3 * t, l = e, u = 0; u < 5; u++) {
                            var c = l * l;
                            l -= 1 / (3 * o * c + 2 * s * l + a) * (o * (c * l) + s * c + a * l - e), l = Math.min(1, Math.max(0, l))
                        }
                        return 3 * Math.pow(1 - l, 2) * l * i + 3 * (1 - l) * Math.pow(l, 2) * n + Math.pow(l, 3)
                    }, e
                }();
                e.BezierCurve = m, (_ = f = e.Orientation || (e.Orientation = {}))[_.CW = 0] = "CW", _[_.CCW = 1] = "CCW";
                var g = function() {
                    function e(e) {
                        this._radians = e, this._radians < 0 && (this._radians += 2 * Math.PI)
                    }
                    return e.prototype.degrees = function() {
                        return 180 * this._radians / Math.PI
                    }, e.prototype.radians = function() {
                        return this._radians
                    }, e.BetweenTwoPoints = function(t, i) {
                        var r = i.subtract(t);
                        return new e(Math.atan2(r.y, r.x))
                    }, e.FromRadians = function(t) {
                        return new e(t)
                    }, e.FromDegrees = function(t) {
                        return new e(t * Math.PI / 180)
                    }, e
                }();
                e.Angle = g;
                var v = function(e, t, i) {
                    this.startPoint = e, this.midPoint = t, this.endPoint = i;
                    var n = Math.pow(t.x, 2) + Math.pow(t.y, 2),
                        o = (Math.pow(e.x, 2) + Math.pow(e.y, 2) - n) / 2,
                        s = (n - Math.pow(i.x, 2) - Math.pow(i.y, 2)) / 2,
                        a = (e.x - t.x) * (t.y - i.y) - (t.x - i.x) * (e.y - t.y);
                    this.centerPoint = new r((o * (t.y - i.y) - s * (e.y - t.y)) / a, ((e.x - t.x) * s - (t.x - i.x) * o) / a), this.radius = this.centerPoint.subtract(this.startPoint).length(), this.startAngle = g.BetweenTwoPoints(this.centerPoint, this.startPoint);
                    var l = this.startAngle.degrees(),
                        u = g.BetweenTwoPoints(this.centerPoint, this.midPoint).degrees(),
                        c = g.BetweenTwoPoints(this.centerPoint, this.endPoint).degrees();
                    180 < u - l && (u -= 360), u - l < -180 && (u += 360), 180 < c - u && (c -= 360), c - u < -180 && (c += 360), this.orientation = u - l < 0 ? f.CW : f.CCW, this.angle = g.FromDegrees(this.orientation === f.CW ? l - c : c - l)
                };
                e.Arc2 = v;
                var y = function() {
                    function e(e, t) {
                        this._points = new Array, this._length = 0, this.closed = !1, this._points.push(new r(e, t))
                    }
                    return e.prototype.addLineTo = function(e, t) {
                        if (this.closed) return this;
                        var i = new r(e, t),
                            n = this._points[this._points.length - 1];
                        return this._points.push(i), this._length += i.subtract(n).length(), this
                    }, e.prototype.addArcTo = function(e, t, i, n, o) {
                        if (void 0 === o && (o = 36), this.closed) return this;
                        var s = this._points[this._points.length - 1],
                            a = new r(e, t),
                            l = new r(i, n),
                            u = new v(s, a, l),
                            c = u.angle.radians() / o;
                        u.orientation === f.CW && (c *= -1);
                        for (var h = u.startAngle.radians() + c, d = 0; d < o; d++) {
                            var p = Math.cos(h) * u.radius + u.centerPoint.x,
                                _ = Math.sin(h) * u.radius + u.centerPoint.y;
                            this.addLineTo(p, _), h += c
                        }
                        return this
                    }, e.prototype.close = function() {
                        return this.closed = !0, this
                    }, e.prototype.length = function() {
                        var e = this._length;
                        if (!this.closed) {
                            var t = this._points[this._points.length - 1];
                            e += this._points[0].subtract(t).length()
                        }
                        return e
                    }, e.prototype.getPoints = function() {
                        return this._points
                    }, e.prototype.getPointAtLengthPosition = function(e) {
                        if (e < 0 || 1 < e) return r.Zero();
                        for (var t = e * this.length(), i = 0, n = 0; n < this._points.length; n++) {
                            var o = (n + 1) % this._points.length,
                                s = this._points[n],
                                a = this._points[o].subtract(s),
                                l = a.length() + i;
                            if (i <= t && t <= l) {
                                var u = a.normalize(),
                                    c = t - i;
                                return new r(s.x + u.x * c, s.y + u.y * c)
                            }
                            i = l
                        }
                        return r.Zero()
                    }, e.StartingAt = function(t, i) {
                        return new e(t, i)
                    }, e
                }();
                e.Path2 = y;
                var b = function() {
                    function t(e, t, i) {
                        void 0 === t && (t = null), this.path = e, this._curve = new Array, this._distances = new Array, this._tangents = new Array, this._normals = new Array, this._binormals = new Array;
                        for (var r = 0; r < e.length; r++) this._curve[r] = e[r].clone();
                        this._raw = i || !1, this._compute(t)
                    }
                    return t.prototype.getCurve = function() {
                        return this._curve
                    }, t.prototype.getTangents = function() {
                        return this._tangents
                    }, t.prototype.getNormals = function() {
                        return this._normals
                    }, t.prototype.getBinormals = function() {
                        return this._binormals
                    }, t.prototype.getDistances = function() {
                        return this._distances
                    }, t.prototype.update = function(e, t) {
                        void 0 === t && (t = null);
                        for (var i = 0; i < e.length; i++) this._curve[i].x = e[i].x, this._curve[i].y = e[i].y, this._curve[i].z = e[i].z;
                        return this._compute(t), this
                    }, t.prototype._compute = function(e) {
                        var t = this._curve.length;
                        this._tangents[0] = this._getFirstNonNullVector(0), this._raw || this._tangents[0].normalize(), this._tangents[t - 1] = this._curve[t - 1].subtract(this._curve[t - 2]), this._raw || this._tangents[t - 1].normalize();
                        var i, r, o, s, a = this._tangents[0],
                            l = this._normalVector(this._curve[0], a, e);
                        this._normals[0] = l, this._raw || this._normals[0].normalize(), this._binormals[0] = n.Cross(a, this._normals[0]), this._raw || this._binormals[0].normalize(), this._distances[0] = 0;
                        for (var u = 1; u < t; u++) i = this._getLastNonNullVector(u), u < t - 1 && (r = this._getFirstNonNullVector(u), this._tangents[u] = i.add(r), this._tangents[u].normalize()), this._distances[u] = this._distances[u - 1] + i.length(), o = this._tangents[u], s = this._binormals[u - 1], this._normals[u] = n.Cross(s, o), this._raw || this._normals[u].normalize(), this._binormals[u] = n.Cross(o, this._normals[u]), this._raw || this._binormals[u].normalize()
                    }, t.prototype._getFirstNonNullVector = function(e) {
                        for (var t = 1, i = this._curve[e + t].subtract(this._curve[e]); 0 === i.length() && e + t + 1 < this._curve.length;) t++, i = this._curve[e + t].subtract(this._curve[e]);
                        return i
                    }, t.prototype._getLastNonNullVector = function(e) {
                        for (var t = 1, i = this._curve[e].subtract(this._curve[e - t]); 0 === i.length() && t + 1 < e;) t++, i = this._curve[e].subtract(this._curve[e - t]);
                        return i
                    }, t.prototype._normalVector = function(t, i, r) {
                        var o, s, a = i.length();
                        return 0 === a && (a = 1), null == r ? (s = e.Scalar.WithinEpsilon(Math.abs(i.y) / a, 1, e.Epsilon) ? e.Scalar.WithinEpsilon(Math.abs(i.x) / a, 1, e.Epsilon) ? e.Scalar.WithinEpsilon(Math.abs(i.z) / a, 1, e.Epsilon) ? n.Zero() : new n(0, 0, 1) : new n(1, 0, 0) : new n(0, -1, 0), o = n.Cross(i, s)) : (o = n.Cross(i, r), n.CrossToRef(o, i, o)), o.normalize(), o
                    }, t
                }();
                e.Path3D = b;
                var x = function() {
                    function e(e) {
                        this._length = 0, this._points = e, this._length = this._computeLength(e)
                    }
                    return e.CreateQuadraticBezier = function(t, i, r, o) {
                        o = 2 < o ? o : 3;
                        for (var s = new Array, a = function(e, t, i, r) {
                                return (1 - e) * (1 - e) * t + 2 * e * (1 - e) * i + e * e * r
                            }, l = 0; l <= o; l++) s.push(new n(a(l / o, t.x, i.x, r.x), a(l / o, t.y, i.y, r.y), a(l / o, t.z, i.z, r.z)));
                        return new e(s)
                    }, e.CreateCubicBezier = function(t, i, r, o, s) {
                        s = 3 < s ? s : 4;
                        for (var a = new Array, l = function(e, t, i, r, n) {
                                return (1 - e) * (1 - e) * (1 - e) * t + 3 * e * (1 - e) * (1 - e) * i + 3 * e * e * (1 - e) * r + e * e * e * n
                            }, u = 0; u <= s; u++) a.push(new n(l(u / s, t.x, i.x, r.x, o.x), l(u / s, t.y, i.y, r.y, o.y), l(u / s, t.z, i.z, r.z, o.z)));
                        return new e(a)
                    }, e.CreateHermiteSpline = function(t, i, r, o, s) {
                        for (var a = new Array, l = 1 / s, u = 0; u <= s; u++) a.push(n.Hermite(t, i, r, o, u * l));
                        return new e(a)
                    }, e.CreateCatmullRomSpline = function(t, i, r) {
                        var o = new Array,
                            s = 1 / i,
                            a = 0;
                        if (r) {
                            for (var l = t.length, u = 0; u < l; u++)
                                for (var c = a = 0; c < i; c++) o.push(n.CatmullRom(t[u % l], t[(u + 1) % l], t[(u + 2) % l], t[(u + 3) % l], a)), a += s;
                            o.push(o[0])
                        } else {
                            var h = new Array;
                            for (h.push(t[0].clone()), Array.prototype.push.apply(h, t), h.push(t[t.length - 1].clone()), u = 0; u < h.length - 3; u++)
                                for (c = a = 0; c < i; c++) o.push(n.CatmullRom(h[u], h[u + 1], h[u + 2], h[u + 3], a)), a += s;
                            u--, o.push(n.CatmullRom(h[u], h[u + 1], h[u + 2], h[u + 3], a))
                        }
                        return new e(o)
                    }, e.prototype.getPoints = function() {
                        return this._points
                    }, e.prototype.length = function() {
                        return this._length
                    }, e.prototype.continue = function(t) {
                        for (var i = this._points[this._points.length - 1], r = this._points.slice(), n = t.getPoints(), o = 1; o < n.length; o++) r.push(n[o].subtract(n[0]).add(i));
                        return new e(r)
                    }, e.prototype._computeLength = function(e) {
                        for (var t = 0, i = 1; i < e.length; i++) t += e[i].subtract(e[i - 1]).length();
                        return t
                    }, e
                }();
                e.Curve3 = x;
                var T = function() {
                    function e(e, t) {
                        void 0 === e && (e = n.Zero()), void 0 === t && (t = n.Up()), this.position = e, this.normal = t
                    }
                    return e.prototype.clone = function() {
                        return new e(this.position.clone(), this.normal.clone())
                    }, e
                }();
                e.PositionNormalVertex = T;
                var E = function() {
                    function e(e, t, i) {
                        void 0 === e && (e = n.Zero()), void 0 === t && (t = n.Up()), void 0 === i && (i = r.Zero()), this.position = e, this.normal = t, this.uv = i
                    }
                    return e.prototype.clone = function() {
                        return new e(this.position.clone(), this.normal.clone(), this.uv.clone())
                    }, e
                }();
                e.PositionNormalTextureVertex = E;
                var S = function() {
                    function e() {}
                    return e.Color3 = [t.Black(), t.Black(), t.Black()], e.Color4 = [new i(0, 0, 0, 0), new i(0, 0, 0, 0)], e.Vector2 = [r.Zero(), r.Zero(), r.Zero()], e.Vector3 = [n.Zero(), n.Zero(), n.Zero(), n.Zero(), n.Zero(), n.Zero(), n.Zero(), n.Zero(), n.Zero()], e.Vector4 = [o.Zero(), o.Zero(), o.Zero()], e.Quaternion = [a.Zero(), a.Zero()], e.Matrix = [l.Zero(), l.Zero(), l.Zero(), l.Zero(), l.Zero(), l.Zero(), l.Zero(), l.Zero()], e
                }();
                e.Tmp = S;
                var P = function() {
                    function e() {}
                    return e.Vector3 = [n.Zero(), n.Zero(), n.Zero(), n.Zero(), n.Zero(), n.Zero()], e.Matrix = [l.Zero(), l.Zero()], e.Quaternion = [a.Zero(), a.Zero(), a.Zero()], e
                }()
            }($a || ($a = {})), n = $a || ($a = {}), o = function() {
                    function e() {}
                    return e.WithinEpsilon = function(e, t, i) {
                        void 0 === i && (i = 1.401298e-45);
                        var r = e - t;
                        return -i <= r && r <= i
                    }, e.ToHex = function(e) {
                        var t = e.toString(16);
                        return e <= 15 ? ("0" + t).toUpperCase() : t.toUpperCase()
                    }, e.Sign = function(e) {
                        return 0 == (e = +e) || isNaN(e) ? e : 0 < e ? 1 : -1
                    }, e.Clamp = function(e, t, i) {
                        return void 0 === t && (t = 0), void 0 === i && (i = 1), Math.min(i, Math.max(t, e))
                    }, e.Log2 = function(e) {
                        return Math.log(e) * Math.LOG2E
                    }, e.Repeat = function(e, t) {
                        return e - Math.floor(e / t) * t
                    }, e.Normalize = function(e, t, i) {
                        return (e - t) / (i - t)
                    }, e.Denormalize = function(e, t, i) {
                        return e * (i - t) + t
                    }, e.DeltaAngle = function(t, i) {
                        var r = e.Repeat(i - t, 360);
                        return 180 < r && (r -= 360), r
                    }, e.PingPong = function(t, i) {
                        var r = e.Repeat(t, 2 * i);
                        return i - Math.abs(r - i)
                    }, e.SmoothStep = function(t, i, r) {
                        var n = e.Clamp(r);
                        return i * (n = -2 * n * n * n + 3 * n * n) + t * (1 - n)
                    }, e.MoveTowards = function(t, i, r) {
                        return Math.abs(i - t) <= r ? i : t + e.Sign(i - t) * r
                    }, e.MoveTowardsAngle = function(t, i, r) {
                        var n = e.DeltaAngle(t, i);
                        return -r < n && n < r ? i : e.MoveTowards(t, i = t + n, r)
                    }, e.Lerp = function(e, t, i) {
                        return e + (t - e) * i
                    }, e.LerpAngle = function(t, i, r) {
                        var n = e.Repeat(i - t, 360);
                        return 180 < n && (n -= 360), t + n * e.Clamp(r)
                    }, e.InverseLerp = function(t, i, r) {
                        return t != i ? e.Clamp((r - t) / (i - t)) : 0
                    }, e.Hermite = function(e, t, i, r, n) {
                        var o = n * n,
                            s = n * o;
                        return e * (2 * s - 3 * o + 1) + i * (-2 * s + 3 * o) + t * (s - 2 * o + n) + r * (s - o)
                    }, e.RandomRange = function(e, t) {
                        return e === t ? e : Math.random() * (t - e) + e
                    }, e.RangeToPercent = function(e, t, i) {
                        return (e - t) / (i - t)
                    }, e.PercentToRange = function(e, t, i) {
                        return (i - t) * e + t
                    }, e.NormalizeRadians = function(t) {
                        return t -= e.TwoPi * Math.floor((t + Math.PI) / e.TwoPi)
                    }, e.TwoPi = 2 * Math.PI, e
                }(), n.Scalar = o,
                function(e) {
                    function t(e) {
                        var t = e.getClassName();
                        if (n[t]) return n[t];
                        n[t] = {};
                        for (var i = n[t], o = e, s = t; s;) {
                            var a = r[s];
                            for (var l in a) i[l] = a[l];
                            var u = void 0,
                                c = !1;
                            do {
                                if (!(u = Object.getPrototypeOf(o)).getClassName) {
                                    c = !0;
                                    break
                                }
                                if (u.getClassName() !== s) break;
                                o = u
                            } while (u);
                            if (c) break;
                            s = u.getClassName(), o = u
                        }
                        return i
                    }

                    function i(e, t) {
                        return function(i, n) {
                            var o, s = (o = i.getClassName(), r[o] || (r[o] = {}), r[o]);
                            s[n] || (s[n] = {
                                type: e,
                                sourceName: t
                            })
                        }
                    }
                    var r = {},
                        n = {},
                        o = function(i, r, n) {
                            var o = i();
                            e.Tags && e.Tags.AddTagsTo(o, r.tags);
                            var s = t(o);
                            for (var a in s) {
                                var l = s[a],
                                    u = r[a],
                                    c = l.type;
                                if (null != u) switch (c) {
                                    case 0:
                                    case 6:
                                    case 11:
                                        o[a] = u;
                                        break;
                                    case 1:
                                        o[a] = n || u.isRenderTarget ? u : u.clone();
                                        break;
                                    case 2:
                                    case 3:
                                    case 4:
                                    case 5:
                                    case 7:
                                    case 10:
                                        o[a] = n ? u : u.clone()
                                }
                            }
                            return o
                        };
                    e.expandToProperty = function(e, t) {
                        return void 0 === t && (t = null), i = e, void 0 === (r = t) && (r = null),
                            function(e, t) {
                                var n = r || "_" + t;
                                Object.defineProperty(e, t, {
                                    get: function() {
                                        return this[n]
                                    },
                                    set: function(t) {
                                        this[n] !== t && (this[n] = t, e[i].apply(this))
                                    },
                                    enumerable: !0,
                                    configurable: !0
                                })
                            };
                        var i, r
                    }, e.serialize = function(e) {
                        return i(0, e)
                    }, e.serializeAsTexture = function(e) {
                        return i(1, e)
                    }, e.serializeAsColor3 = function(e) {
                        return i(2, e)
                    }, e.serializeAsFresnelParameters = function(e) {
                        return i(3, e)
                    }, e.serializeAsVector2 = function(e) {
                        return i(4, e)
                    }, e.serializeAsVector3 = function(e) {
                        return i(5, e)
                    }, e.serializeAsMeshReference = function(e) {
                        return i(6, e)
                    }, e.serializeAsColorCurves = function(e) {
                        return i(7, e)
                    }, e.serializeAsColor4 = function(e) {
                        return i(8, e)
                    }, e.serializeAsImageProcessingConfiguration = function(e) {
                        return i(9, e)
                    }, e.serializeAsQuaternion = function(e) {
                        return i(10, e)
                    }, e.serializeAsCameraReference = function(e) {
                        return i(11, e)
                    };
                    var s = function() {
                        function i() {}
                        return i.Serialize = function(i, r) {
                            r || (r = {}), e.Tags && (r.tags = e.Tags.GetTags(i));
                            var n = t(i);
                            for (var o in n) {
                                var s = n[o],
                                    a = s.sourceName || o,
                                    l = s.type,
                                    u = i[o];
                                if (null != u) switch (l) {
                                    case 0:
                                        r[a] = u;
                                        break;
                                    case 1:
                                        r[a] = u.serialize();
                                        break;
                                    case 2:
                                        r[a] = u.asArray();
                                        break;
                                    case 3:
                                        r[a] = u.serialize();
                                        break;
                                    case 4:
                                    case 5:
                                        r[a] = u.asArray();
                                        break;
                                    case 6:
                                        r[a] = u.id;
                                        break;
                                    case 7:
                                        r[a] = u.serialize();
                                        break;
                                    case 8:
                                        r[a] = u.asArray();
                                        break;
                                    case 9:
                                        r[a] = u.serialize();
                                        break;
                                    case 10:
                                        r[a] = u.asArray();
                                        break;
                                    case 11:
                                        r[a] = u.id
                                }
                            }
                            return r
                        }, i.Parse = function(i, r, n, o) {
                            void 0 === o && (o = null);
                            var s = i();
                            o || (o = ""), e.Tags && e.Tags.AddTagsTo(s, r.tags);
                            var a = t(s);
                            for (var l in a) {
                                var u = a[l],
                                    c = r[u.sourceName || l],
                                    h = u.type;
                                if (null != c) {
                                    var d = s;
                                    switch (h) {
                                        case 0:
                                            d[l] = c;
                                            break;
                                        case 1:
                                            n && (d[l] = e.Texture.Parse(c, n, o));
                                            break;
                                        case 2:
                                            d[l] = e.Color3.FromArray(c);
                                            break;
                                        case 3:
                                            d[l] = e.FresnelParameters.Parse(c);
                                            break;
                                        case 4:
                                            d[l] = e.Vector2.FromArray(c);
                                            break;
                                        case 5:
                                            d[l] = e.Vector3.FromArray(c);
                                            break;
                                        case 6:
                                            n && (d[l] = n.getLastMeshByID(c));
                                            break;
                                        case 7:
                                            d[l] = e.ColorCurves.Parse(c);
                                            break;
                                        case 8:
                                            d[l] = e.Color4.FromArray(c);
                                            break;
                                        case 9:
                                            d[l] = e.ImageProcessingConfiguration.Parse(c);
                                            break;
                                        case 10:
                                            d[l] = e.Quaternion.FromArray(c);
                                            break;
                                        case 11:
                                            n && (d[l] = n.getCameraByID(c))
                                    }
                                }
                            }
                            return s
                        }, i.Clone = function(e, t) {
                            return o(e, t, !1)
                        }, i.Instanciate = function(e, t) {
                            return o(e, t, !0)
                        }, i
                    }();
                    e.SerializationHelper = s
                }($a || ($a = {})), s = $a || ($a = {}), a = function() {
                    function e() {
                        var e = this;
                        this.promise = new Promise(function(t, i) {
                            e._resolve = t, e._reject = i
                        })
                    }
                    return Object.defineProperty(e.prototype, "resolve", {
                        get: function() {
                            return this._resolve
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "reject", {
                        get: function() {
                            return this._reject
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e
                }(), s.Deferred = a,
                function(e) {
                    var t = function() {
                        function e(e, t, i, r) {
                            void 0 === t && (t = !1), this.initalize(e, t, i, r)
                        }
                        return e.prototype.initalize = function(e, t, i, r) {
                            return void 0 === t && (t = !1), this.mask = e, this.skipNextObservers = t, this.target = i, this.currentTarget = r, this
                        }, e
                    }();
                    e.EventState = t;
                    var i = function(e, t, i) {
                        void 0 === i && (i = null), this.callback = e, this.mask = t, this.scope = i, this._willBeUnregistered = !1, this.unregisterOnNextCall = !1
                    };
                    e.Observer = i;
                    var r = function() {
                        function e() {}
                        return e.prototype.dispose = function() {
                            if (this._observers && this._observables)
                                for (var e = 0; e < this._observers.length; e++) this._observables[e].remove(this._observers[e]);
                            this._observers = null, this._observables = null
                        }, e.Watch = function(t, i, r, n) {
                            void 0 === r && (r = -1), void 0 === n && (n = null);
                            var o = new e;
                            o._observers = new Array;
                            for (var s = 0, a = o._observables = t; s < a.length; s++) {
                                var l = a[s].add(i, r, !1, n);
                                l && o._observers.push(l)
                            }
                            return o
                        }, e
                    }();
                    e.MultiObserver = r;
                    var n = function() {
                        function r(e) {
                            this._observers = new Array, this._eventState = new t(0), e && (this._onObserverAdded = e)
                        }
                        return r.prototype.add = function(e, t, r, n, o) {
                            if (void 0 === t && (t = -1), void 0 === r && (r = !1), void 0 === n && (n = null), void 0 === o && (o = !1), !e) return null;
                            var s = new i(e, t, n);
                            return s.unregisterOnNextCall = o, r ? this._observers.unshift(s) : this._observers.push(s), this._onObserverAdded && this._onObserverAdded(s), s
                        }, r.prototype.addOnce = function(e) {
                            return this.add(e, void 0, void 0, void 0, !0)
                        }, r.prototype.remove = function(e) {
                            return !!e && -1 !== this._observers.indexOf(e) && (this._deferUnregister(e), !0)
                        }, r.prototype.removeCallback = function(e, t) {
                            for (var i = 0; i < this._observers.length; i++)
                                if (this._observers[i].callback === e && (!t || t === this._observers[i].scope)) return this._deferUnregister(this._observers[i]), !0;
                            return !1
                        }, r.prototype._deferUnregister = function(t) {
                            var i = this;
                            t.unregisterOnNextCall = !1, t._willBeUnregistered = !0, e.Tools.SetImmediate(function() {
                                i._remove(t)
                            })
                        }, r.prototype._remove = function(e) {
                            if (!e) return !1;
                            var t = this._observers.indexOf(e);
                            return -1 !== t && (this._observers.splice(t, 1), !0)
                        }, r.prototype.notifyObservers = function(e, t, i, r) {
                            if (void 0 === t && (t = -1), !this._observers.length) return !0;
                            var n = this._eventState;
                            n.mask = t, n.target = i, n.currentTarget = r, n.skipNextObservers = !1, n.lastReturnValue = e;
                            for (var o = 0, s = this._observers; o < s.length; o++) {
                                var a = s[o];
                                if (!a._willBeUnregistered && (a.mask & t && (a.scope ? n.lastReturnValue = a.callback.apply(a.scope, [e, n]) : n.lastReturnValue = a.callback(e, n), a.unregisterOnNextCall && this._deferUnregister(a)), n.skipNextObservers)) return !1
                            }
                            return !0
                        }, r.prototype.notifyObserversWithPromise = function(e, t, i, r) {
                            var n = this;
                            void 0 === t && (t = -1);
                            var o = Promise.resolve(e);
                            if (!this._observers.length) return o;
                            var s = this._eventState;
                            return s.mask = t, s.target = i, s.currentTarget = r, s.skipNextObservers = !1, this._observers.forEach(function(i) {
                                s.skipNextObservers || i._willBeUnregistered || i.mask & t && (o = i.scope ? o.then(function(t) {
                                    return s.lastReturnValue = t, i.callback.apply(i.scope, [e, s])
                                }) : o.then(function(t) {
                                    return s.lastReturnValue = t, i.callback(e, s)
                                }), i.unregisterOnNextCall && n._deferUnregister(i))
                            }), o.then(function() {
                                return e
                            })
                        }, r.prototype.notifyObserver = function(e, t, i) {
                            void 0 === i && (i = -1);
                            var r = this._eventState;
                            r.mask = i, r.skipNextObservers = !1, e.callback(t, r)
                        }, r.prototype.hasObservers = function() {
                            return 0 < this._observers.length
                        }, r.prototype.clear = function() {
                            this._observers = new Array, this._onObserverAdded = null
                        }, r.prototype.clone = function() {
                            var e = new r;
                            return e._observers = this._observers.slice(0), e
                        }, r.prototype.hasSpecificMask = function(e) {
                            void 0 === e && (e = -1);
                            for (var t = 0, i = this._observers; t < i.length; t++) {
                                var r = i[t];
                                if (r.mask & e || r.mask === e) return !0
                            }
                            return !1
                        }, r
                    }();
                    e.Observable = n
                }($a || ($a = {})), l = $a || ($a = {}), u = function() {
                    function e(t) {
                        this.length = 0, this.data = new Array(t), this._id = e._GlobalId++
                    }
                    return e.prototype.push = function(e) {
                        this.data[this.length++] = e, this.length > this.data.length && (this.data.length *= 2)
                    }, e.prototype.forEach = function(e) {
                        for (var t = 0; t < this.length; t++) e(this.data[t])
                    }, e.prototype.sort = function(e) {
                        this.data.sort(e)
                    }, e.prototype.reset = function() {
                        this.length = 0
                    }, e.prototype.dispose = function() {
                        this.reset(), this.data && (this.data.length = 0, this.data = [])
                    }, e.prototype.concat = function(e) {
                        if (0 !== e.length) {
                            this.length + e.length > this.data.length && (this.data.length = 2 * (this.length + e.length));
                            for (var t = 0; t < e.length; t++) this.data[this.length++] = (e.data || e)[t]
                        }
                    }, e.prototype.indexOf = function(e) {
                        var t = this.data.indexOf(e);
                        return t >= this.length ? -1 : t
                    }, e.prototype.contains = function(e) {
                        return -1 !== this.indexOf(e)
                    }, e._GlobalId = 0, e
                }(), c = function(e) {
                    function t() {
                        var t = null !== e && e.apply(this, arguments) || this;
                        return t._duplicateId = 0, t
                    }
                    return b(t, e), t.prototype.push = function(t) {
                        e.prototype.push.call(this, t), t.__smartArrayFlags || (t.__smartArrayFlags = {}), t.__smartArrayFlags[this._id] = this._duplicateId
                    }, t.prototype.pushNoDuplicate = function(e) {
                        return !(e.__smartArrayFlags && e.__smartArrayFlags[this._id] === this._duplicateId || (this.push(e), 0))
                    }, t.prototype.reset = function() {
                        e.prototype.reset.call(this), this._duplicateId++
                    }, t.prototype.concatWithNoDuplicate = function(e) {
                        if (0 !== e.length) {
                            this.length + e.length > this.data.length && (this.data.length = 2 * (this.length + e.length));
                            for (var t = 0; t < e.length; t++) {
                                var i = (e.data || e)[t];
                                this.pushNoDuplicate(i)
                            }
                        }
                    }, t
                }(l.SmartArray = u), l.SmartArrayNoDuplicate = c,
                function(e) {
                    var t = function() {
                        function t() {}
                        return t.prototype.getColorToRef = function(t) {
                            this.color2 ? e.Color4.LerpToRef(this.color1, this.color2, Math.random(), t) : t.copyFrom(this.color1)
                        }, t
                    }();
                    e.ColorGradient = t;
                    var i = function() {};
                    e.Color3Gradient = i;
                    var r = function() {
                        function t() {}
                        return t.prototype.getFactor = function() {
                            return void 0 === this.factor2 ? this.factor1 : e.Scalar.Lerp(this.factor1, this.factor2, Math.random())
                        }, t
                    }();
                    e.FactorGradient = r;
                    var n = function(e) {
                        function t(i, r) {
                            var n = e.call(this, i) || this;
                            return n.request = r, n.name = "LoadFileError", t._setPrototypeOf(n, t.prototype), n
                        }
                        return b(t, e), t._setPrototypeOf = Object.setPrototypeOf || function(e, t) {
                            return e.__proto__ = t, e
                        }, t
                    }(Error);
                    e.LoadFileError = n;
                    var o, s = function() {
                        function e() {}
                        return e.ExponentialBackoff = function(e, t) {
                            return void 0 === e && (e = 3), void 0 === t && (t = 500),
                                function(i, r, n) {
                                    return 0 !== r.status || e <= n || -1 !== i.indexOf("file:") ? -1 : Math.pow(2, n) * t
                                }
                        }, e
                    }();
                    e.RetryStrategy = s;
                    var a = function(t, i) {
                            return t ? t instanceof e.Mesh ? null : t instanceof e.SubMesh ? t.clone(i) : t.clone ? t.clone() : null : null
                        },
                        l = function() {
                            function t() {}
                            return t.FetchToRef = function(e, t, i, r, n, o) {
                                var s = 4 * ((Math.abs(e) * i % i | 0) + (Math.abs(t) * r % r | 0) * i);
                                o.r = n[s] / 255, o.g = n[s + 1] / 255, o.b = n[s + 2] / 255, o.a = n[s + 3] / 255
                            }, t.Mix = function(e, t, i) {
                                return e * (1 - i) + t * i
                            }, t.Instantiate = function(e) {
                                if (t.RegisteredExternalClasses && t.RegisteredExternalClasses[e]) return t.RegisteredExternalClasses[e];
                                for (var i = e.split("."), r = window || this, n = 0, o = i.length; n < o; n++) r = r[i[n]];
                                return "function" != typeof r ? null : r
                            }, t.Slice = function(e, t, i) {
                                return e.slice ? e.slice(t, i) : Array.prototype.slice.call(e, t, i)
                            }, t.SetImmediate = function(e) {
                                t.IsWindowObjectExist() && window.setImmediate ? window.setImmediate(e) : setTimeout(e, 1)
                            }, t.IsExponentOfTwo = function(e) {
                                for (var t = 1;
                                    (t *= 2) < e;);
                                return t === e
                            }, t.FloatRound = function(e) {
                                return Math.fround ? Math.fround(e) : t._tmpFloatArray[0] = e
                            }, t.CeilingPOT = function(e) {
                                return e--, e |= e >> 1, e |= e >> 2, e |= e >> 4, e |= e >> 8, e |= e >> 16, ++e
                            }, t.FloorPOT = function(e) {
                                return e |= e >> 1, e |= e >> 2, e |= e >> 4, e |= e >> 8, (e |= e >> 16) - (e >> 1)
                            }, t.NearestPOT = function(e) {
                                var i = t.CeilingPOT(e),
                                    r = t.FloorPOT(e);
                                return e - r < i - e ? r : i
                            }, t.GetExponentOfTwo = function(i, r, n) {
                                var o;
                                switch (void 0 === n && (n = e.Engine.SCALEMODE_NEAREST), n) {
                                    case e.Engine.SCALEMODE_FLOOR:
                                        o = t.FloorPOT(i);
                                        break;
                                    case e.Engine.SCALEMODE_NEAREST:
                                        o = t.NearestPOT(i);
                                        break;
                                    case e.Engine.SCALEMODE_CEILING:
                                    default:
                                        o = t.CeilingPOT(i)
                                }
                                return Math.min(o, r)
                            }, t.GetFilename = function(e) {
                                var t = e.lastIndexOf("/");
                                return t < 0 ? e : e.substring(t + 1)
                            }, t.GetFolderPath = function(e, t) {
                                void 0 === t && (t = !1);
                                var i = e.lastIndexOf("/");
                                return i < 0 ? t ? e : "" : e.substring(0, i + 1)
                            }, t.GetDOMTextContent = function(e) {
                                for (var t = "", i = e.firstChild; i;) 3 === i.nodeType && (t += i.textContent), i = i.nextSibling;
                                return t
                            }, t.ToDegrees = function(e) {
                                return 180 * e / Math.PI
                            }, t.ToRadians = function(e) {
                                return e * Math.PI / 180
                            }, t.EncodeArrayBufferTobase64 = function(e) {
                                for (var t, i, r, n, o, s, a, l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", u = "", c = 0, h = new Uint8Array(e); c < h.length;) n = (t = h[c++]) >> 2, o = (3 & t) << 4 | (i = c < h.length ? h[c++] : Number.NaN) >> 4, s = (15 & i) << 2 | (r = c < h.length ? h[c++] : Number.NaN) >> 6, a = 63 & r, isNaN(i) ? s = a = 64 : isNaN(r) && (a = 64), u += l.charAt(n) + l.charAt(o) + l.charAt(s) + l.charAt(a);
                                return "data:image/png;base64," + u
                            }, t.ExtractMinAndMaxIndexed = function(t, i, r, n, o) {
                                void 0 === o && (o = null);
                                for (var s = new e.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), a = new e.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE), l = r; l < r + n; l++) {
                                    var u = 3 * i[l],
                                        c = t[u],
                                        h = t[u + 1],
                                        d = t[u + 2];
                                    s.minimizeInPlaceFromFloats(c, h, d), a.maximizeInPlaceFromFloats(c, h, d)
                                }
                                return o && (s.x -= s.x * o.x + o.y, s.y -= s.y * o.x + o.y, s.z -= s.z * o.x + o.y, a.x += a.x * o.x + o.y, a.y += a.y * o.x + o.y, a.z += a.z * o.x + o.y), {
                                    minimum: s,
                                    maximum: a
                                }
                            }, t.ExtractMinAndMax = function(t, i, r, n, o) {
                                void 0 === n && (n = null);
                                var s = new e.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE),
                                    a = new e.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
                                o || (o = 3);
                                for (var l = i, u = i * o; l < i + r; l++, u += o) {
                                    var c = t[u],
                                        h = t[u + 1],
                                        d = t[u + 2];
                                    s.minimizeInPlaceFromFloats(c, h, d), a.maximizeInPlaceFromFloats(c, h, d)
                                }
                                return n && (s.x -= s.x * n.x + n.y, s.y -= s.y * n.x + n.y, s.z -= s.z * n.x + n.y, a.x += a.x * n.x + n.y, a.y += a.y * n.x + n.y, a.z += a.z * n.x + n.y), {
                                    minimum: s,
                                    maximum: a
                                }
                            }, t.MakeArray = function(e, t) {
                                return !0 === t || void 0 !== e && null != e ? Array.isArray(e) ? e : [e] : null
                            }, t.GetPointerPrefix = function() {
                                var e = "pointer";
                                return !t.IsWindowObjectExist() || window.PointerEvent || navigator.pointerEnabled || (e = "mouse"), e
                            }, t.QueueNewFrame = function(e, i) {
                                return t.IsWindowObjectExist() ? (i || (i = window), i.requestAnimationFrame ? i.requestAnimationFrame(e) : i.msRequestAnimationFrame ? i.msRequestAnimationFrame(e) : i.webkitRequestAnimationFrame ? i.webkitRequestAnimationFrame(e) : i.mozRequestAnimationFrame ? i.mozRequestAnimationFrame(e) : i.oRequestAnimationFrame ? i.oRequestAnimationFrame(e) : window.setTimeout(e, 16)) : setTimeout(e, 16)
                            }, t.RequestFullscreen = function(e) {
                                var t = e.requestFullscreen || e.msRequestFullscreen || e.webkitRequestFullscreen || e.mozRequestFullScreen;
                                t && t.call(e)
                            }, t.ExitFullscreen = function() {
                                document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitCancelFullScreen ? document.webkitCancelFullScreen() : document.msCancelFullScreen && document.msCancelFullScreen()
                            }, t.SetCorsBehavior = function(e, i) {
                                if ((!e || 0 !== e.indexOf("data:")) && t.CorsBehavior)
                                    if ("string" == typeof t.CorsBehavior || t.CorsBehavior instanceof String) i.crossOrigin = t.CorsBehavior;
                                    else {
                                        var r = t.CorsBehavior(e);
                                        r && (i.crossOrigin = r)
                                    }
                            }, t.CleanUrl = function(e) {
                                return e = e.replace(/#/gm, "%23")
                            }, t.LoadImage = function(i, r, n, o) {
                                var s, a = !1;
                                i instanceof ArrayBuffer ? (s = URL.createObjectURL(new Blob([i])), a = !0) : i instanceof Blob ? (s = URL.createObjectURL(i), a = !0) : (s = t.CleanUrl(i), s = t.PreprocessUrl(i));
                                var l = new Image;
                                t.SetCorsBehavior(s, l);
                                var u = function() {
                                        a && l.src && URL.revokeObjectURL(l.src), l.removeEventListener("load", u), l.removeEventListener("error", c), r(l)
                                    },
                                    c = function(e) {
                                        a && l.src && URL.revokeObjectURL(l.src), l.removeEventListener("load", u), l.removeEventListener("error", c), t.Error("Error while trying to load image: " + i), n && n("Error while trying to load image: " + i, e)
                                    };
                                l.addEventListener("load", u), l.addEventListener("error", c);
                                var h = function() {
                                    l.src = s
                                };
                                if ("data:" !== s.substr(0, 5) && o && o.enableTexturesOffline && e.Database.IsUASupportingBlobStorage) o.openAsync(function() {
                                    o && o.loadImageFromDB(s, l)
                                }, h);
                                else {
                                    if (-1 !== s.indexOf("file:")) {
                                        var d = decodeURIComponent(s.substring(5).toLowerCase());
                                        if (e.FilesInput.FilesToLoad[d]) {
                                            try {
                                                var p;
                                                try {
                                                    p = URL.createObjectURL(e.FilesInput.FilesToLoad[d])
                                                } catch (r) {
                                                    p = URL.createObjectURL(e.FilesInput.FilesToLoad[d])
                                                }
                                                l.src = p, a = !0
                                            } catch (r) {
                                                l.src = ""
                                            }
                                            return l
                                        }
                                    }
                                    h()
                                }
                                return l
                            }, t.LoadFile = function(i, r, o, s, a, l) {
                                if (i = t.CleanUrl(i), -1 !== (i = t.PreprocessUrl(i)).indexOf("file:")) {
                                    var u = decodeURIComponent(i.substring(5).toLowerCase());
                                    if (e.FilesInput.FilesToLoad[u]) return t.ReadFile(e.FilesInput.FilesToLoad[u], r, o, a)
                                }
                                var c = t.BaseUrl + i,
                                    h = !1,
                                    d = {
                                        onCompleteObservable: new e.Observable,
                                        abort: function() {
                                            return h = !0
                                        }
                                    },
                                    p = function() {
                                        var e = new XMLHttpRequest,
                                            i = null;
                                        d.abort = function() {
                                            h = !0, e.readyState !== (XMLHttpRequest.DONE || 4) && e.abort(), null !== i && (clearTimeout(i), i = null)
                                        };
                                        var s = function(u) {
                                            e.open("GET", c, !0), a && (e.responseType = "arraybuffer"), o && e.addEventListener("progress", o);
                                            var p = function() {
                                                e.removeEventListener("loadend", p), d.onCompleteObservable.notifyObservers(d), d.onCompleteObservable.clear()
                                            };
                                            e.addEventListener("loadend", p);
                                            var f = function() {
                                                if (!h && e.readyState === (XMLHttpRequest.DONE || 4)) {
                                                    if (e.removeEventListener("readystatechange", f), 200 <= e.status && e.status < 300 || 0 === e.status && (!t.IsWindowObjectExist() || t.IsFileURL())) return void r(a ? e.response : e.responseText, e.responseURL);
                                                    var o = t.DefaultRetryStrategy;
                                                    if (o) {
                                                        var d = o(c, e, u);
                                                        if (-1 !== d) return e.removeEventListener("loadend", p), e = new XMLHttpRequest, void(i = setTimeout(function() {
                                                            return s(u + 1)
                                                        }, d))
                                                    }
                                                    var _ = new n("Error status: " + e.status + " " + e.statusText + " - Unable to load " + c, e);
                                                    if (!l) throw _;
                                                    l(e, _)
                                                }
                                            };
                                            e.addEventListener("readystatechange", f), e.send()
                                        };
                                        s(0)
                                    };
                                if (s && s.enableSceneOffline) {
                                    var f = function(e) {
                                        e && 400 < e.status ? l && l(e) : h || p()
                                    };
                                    s.openAsync(function() {
                                        h || s && s.loadFileFromDB(i, function(e) {
                                            h || r(e), d.onCompleteObservable.notifyObservers(d)
                                        }, o ? function(e) {
                                            h || o(e)
                                        } : void 0, f, a)
                                    }, f)
                                } else p();
                                return d
                            }, t.LoadScript = function(e, i, r) {
                                if (t.IsWindowObjectExist()) {
                                    var n = document.getElementsByTagName("head")[0],
                                        o = document.createElement("script");
                                    o.type = "text/javascript", o.src = e, o.onload = function() {
                                        i && i()
                                    }, o.onerror = function(t) {
                                        r && r("Unable to load script '" + e + "'", t)
                                    }, n.appendChild(o)
                                }
                            }, t.ReadFileAsDataURL = function(t, i, r) {
                                var n = new FileReader,
                                    o = {
                                        onCompleteObservable: new e.Observable,
                                        abort: function() {
                                            return n.abort()
                                        }
                                    };
                                return n.onloadend = function(e) {
                                    o.onCompleteObservable.notifyObservers(o)
                                }, n.onload = function(e) {
                                    i(e.target.result)
                                }, n.onprogress = r, n.readAsDataURL(t), o
                            }, t.ReadFile = function(i, r, n, o) {
                                var s = new FileReader,
                                    a = {
                                        onCompleteObservable: new e.Observable,
                                        abort: function() {
                                            return s.abort()
                                        }
                                    };
                                return s.onloadend = function(e) {
                                    return a.onCompleteObservable.notifyObservers(a)
                                }, s.onerror = function(e) {
                                    t.Log("Error while reading file: " + i.name), r(JSON.stringify({
                                        autoClear: !0,
                                        clearColor: [1, 0, 0],
                                        ambientColor: [0, 0, 0],
                                        gravity: [0, -9.807, 0],
                                        meshes: [],
                                        cameras: [],
                                        lights: []
                                    }))
                                }, s.onload = function(e) {
                                    r(e.target.result)
                                }, n && (s.onprogress = n), o ? s.readAsArrayBuffer(i) : s.readAsText(i), a
                            }, t.FileAsURL = function(e) {
                                var t = new Blob([e]);
                                return (window.URL || window.webkitURL).createObjectURL(t)
                            }, t.Format = function(e, t) {
                                return void 0 === t && (t = 2), e.toFixed(t)
                            }, t.CheckExtends = function(e, t, i) {
                                e.x < t.x && (t.x = e.x), e.y < t.y && (t.y = e.y), e.z < t.z && (t.z = e.z), e.x > i.x && (i.x = e.x), e.y > i.y && (i.y = e.y), e.z > i.z && (i.z = e.z)
                            }, t.DeepCopy = function(e, t, i, r) {
                                for (var n in e)
                                    if (("_" !== n[0] || r && -1 !== r.indexOf(n)) && (!i || -1 === i.indexOf(n))) {
                                        var o = e[n],
                                            s = typeof o;
                                        if ("function" !== s) try {
                                            if ("object" === s)
                                                if (o instanceof Array) {
                                                    if (t[n] = [], 0 < o.length)
                                                        if ("object" == typeof o[0])
                                                            for (var l = 0; l < o.length; l++) {
                                                                var u = a(o[l], t); - 1 === t[n].indexOf(u) && t[n].push(u)
                                                            } else t[n] = o.slice(0)
                                                } else t[n] = a(o, t);
                                            else t[n] = o
                                        } catch (e) {}
                                    }
                            }, t.IsEmpty = function(e) {
                                for (var t in e)
                                    if (e.hasOwnProperty(t)) return !1;
                                return !0
                            }, t.RegisterTopRootEvents = function(e) {
                                for (var t = 0; t < e.length; t++) {
                                    var i = e[t];
                                    window.addEventListener(i.name, i.handler, !1);
                                    try {
                                        window.parent && window.parent.addEventListener(i.name, i.handler, !1)
                                    } catch (e) {}
                                }
                            }, t.UnregisterTopRootEvents = function(e) {
                                for (var t = 0; t < e.length; t++) {
                                    var i = e[t];
                                    window.removeEventListener(i.name, i.handler);
                                    try {
                                        window.parent && window.parent.removeEventListener(i.name, i.handler)
                                    } catch (e) {}
                                }
                            }, t.DumpFramebuffer = function(e, i, r, n, s, a) {
                                void 0 === s && (s = "image/png");
                                for (var l = 4 * e, u = i / 2, c = r.readPixels(0, 0, e, i), h = 0; h < u; h++)
                                    for (var d = 0; d < l; d++) {
                                        var p = d + h * l,
                                            f = d + (i - h - 1) * l,
                                            _ = c[p];
                                        c[p] = c[f], c[f] = _
                                    }
                                o || (o = document.createElement("canvas")), o.width = e, o.height = i;
                                var m = o.getContext("2d");
                                if (m) {
                                    var g = m.createImageData(e, i);
                                    g.data.set(c), m.putImageData(g, 0, 0), t.EncodeScreenshotCanvasData(n, s, a)
                                }
                            }, t.ToBlob = function(e, t, i) {
                                void 0 === i && (i = "image/png"), e.toBlob || (e.toBlob = function(e, t, i) {
                                    var r = this;
                                    setTimeout(function() {
                                        for (var n = atob(r.toDataURL(t, i).split(",")[1]), o = n.length, s = new Uint8Array(o), a = 0; a < o; a++) s[a] = n.charCodeAt(a);
                                        e(new Blob([s]))
                                    })
                                }), e.toBlob(function(e) {
                                    t(e)
                                }, i)
                            }, t.EncodeScreenshotCanvasData = function(e, i, r) {
                                void 0 === i && (i = "image/png"), e ? e(o.toDataURL(i)) : this.ToBlob(o, function(e) {
                                    if ("download" in document.createElement("a")) {
                                        if (!r) {
                                            var i = new Date,
                                                n = (i.getFullYear() + "-" + (i.getMonth() + 1)).slice(2) + "-" + i.getDate() + "_" + i.getHours() + "-" + ("0" + i.getMinutes()).slice(-2);
                                            r = "screenshot_" + n + ".png"
                                        }
                                        t.Download(e, r)
                                    } else {
                                        var o = URL.createObjectURL(e),
                                            s = window.open("");
                                        if (!s) return;
                                        var a = s.document.createElement("img");
                                        a.onload = function() {
                                            URL.revokeObjectURL(o)
                                        }, a.src = o, s.document.body.appendChild(a)
                                    }
                                }, i)
                            }, t.Download = function(e, t) {
                                if (navigator && navigator.msSaveBlob) navigator.msSaveBlob(e, t);
                                else {
                                    var i = window.URL.createObjectURL(e),
                                        r = document.createElement("a");
                                    document.body.appendChild(r), r.style.display = "none", r.href = i, r.download = t, r.addEventListener("click", function() {
                                        r.parentElement && r.parentElement.removeChild(r)
                                    }), r.click(), window.URL.revokeObjectURL(i)
                                }
                            }, t.CreateScreenshot = function(e, i, r, n, s) {
                                var a, l;
                                if (void 0 === s && (s = "image/png"), r.precision) a = Math.round(e.getRenderWidth() * r.precision), l = Math.round(a / e.getAspectRatio(i));
                                else if (r.width && r.height) a = r.width, l = r.height;
                                else if (r.width && !r.height) a = r.width, l = Math.round(a / e.getAspectRatio(i));
                                else if (r.height && !r.width) l = r.height, a = Math.round(l * e.getAspectRatio(i));
                                else {
                                    if (isNaN(r)) return void t.Error("Invalid 'size' parameter !");
                                    a = l = r
                                }
                                o || (o = document.createElement("canvas")), o.width = a, o.height = l;
                                var u = o.getContext("2d"),
                                    c = e.getRenderWidth() / e.getRenderHeight(),
                                    h = a,
                                    d = h / c;
                                l < d && (h = (d = l) * c);
                                var p = Math.max(0, a - h) / 2,
                                    f = Math.max(0, l - d) / 2,
                                    _ = e.getRenderingCanvas();
                                u && _ && u.drawImage(_, p, f, h, d), t.EncodeScreenshotCanvasData(n, s)
                            }, t.CreateScreenshotUsingRenderTarget = function(i, r, n, o, s, a, l, u) {
                                var c, h;
                                if (void 0 === s && (s = "image/png"), void 0 === a && (a = 1), void 0 === l && (l = !1), n.precision) c = Math.round(i.getRenderWidth() * n.precision), h = Math.round(c / i.getAspectRatio(r)), n = {
                                    width: c,
                                    height: h
                                };
                                else if (n.width && n.height) c = n.width, h = n.height;
                                else if (n.width && !n.height) c = n.width, h = Math.round(c / i.getAspectRatio(r)), n = {
                                    width: c,
                                    height: h
                                };
                                else if (n.height && !n.width) h = n.height, n = {
                                    width: c = Math.round(h * i.getAspectRatio(r)),
                                    height: h
                                };
                                else {
                                    if (isNaN(n)) return void t.Error("Invalid 'size' parameter !");
                                    c = h = n
                                }
                                var d = r.getScene(),
                                    p = null;
                                d.activeCamera !== r && (p = d.activeCamera, d.activeCamera = r);
                                var f = new e.RenderTargetTexture("screenShot", n, d, !1, !1, e.Engine.TEXTURETYPE_UNSIGNED_INT, !1, e.Texture.NEAREST_SAMPLINGMODE);
                                f.renderList = null, f.samples = a, l && f.addPostProcess(new e.FxaaPostProcess("antialiasing", 1, d.activeCamera)), f.onAfterRenderObservable.add(function() {
                                    t.DumpFramebuffer(c, h, i, o, s, u)
                                }), d.incrementRenderId(), d.resetCachedMaterial(), f.render(!0), f.dispose(), p && (d.activeCamera = p), r.getProjectionMatrix(!0)
                            }, t.ValidateXHRData = function(t, i) {
                                void 0 === i && (i = 7);
                                try {
                                    if (1 & i) {
                                        if (t.responseText && 0 < t.responseText.length) return !0;
                                        if (1 === i) return !1
                                    }
                                    if (2 & i) {
                                        var r = e.TGATools.GetTGAHeader(t.response);
                                        if (r.width && r.height && 0 < r.width && 0 < r.height) return !0;
                                        if (2 === i) return !1
                                    }
                                    if (4 & i) {
                                        var n = new Uint8Array(t.response, 0, 3);
                                        return 68 === n[0] && 68 === n[1] && 83 === n[2]
                                    }
                                } catch (t) {}
                                return !1
                            }, t.RandomId = function() {
                                return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
                                    var t = 16 * Math.random() | 0;
                                    return ("x" === e ? t : 3 & t | 8).toString(16)
                                })
                            }, t.IsBase64 = function(e) {
                                return !(e.length < 5) && "data:" === e.substr(0, 5)
                            }, t.DecodeBase64 = function(e) {
                                for (var t = atob(e.split(",")[1]), i = t.length, r = new Uint8Array(new ArrayBuffer(i)), n = 0; n < i; n++) r[n] = t.charCodeAt(n);
                                return r.buffer
                            }, t._AddLogEntry = function(e) {
                                t._LogCache = e + t._LogCache, t.OnNewCacheEntry && t.OnNewCacheEntry(e)
                            }, t._FormatMessage = function(e) {
                                var t = function(e) {
                                        return e < 10 ? "0" + e : "" + e
                                    },
                                    i = new Date;
                                return "[" + t(i.getHours()) + ":" + t(i.getMinutes()) + ":" + t(i.getSeconds()) + "]: " + e
                            }, t._LogDisabled = function(e) {}, t._LogEnabled = function(e) {
                                var i = t._FormatMessage(e);
                                t._AddLogEntry("<div style='color:white'>" + i + "</div><br>")
                            }, t._WarnDisabled = function(e) {}, t._WarnEnabled = function(e) {
                                var i = t._FormatMessage(e);
                                t._AddLogEntry("<div style='color:orange'>" + i + "</div><br>")
                            }, t._ErrorDisabled = function(e) {}, t._ErrorEnabled = function(e) {
                                t.errorsCount++;
                                var i = t._FormatMessage(e);
                                t._AddLogEntry("<div style='color:red'>" + i + "</div><br>")
                            }, Object.defineProperty(t, "LogCache", {
                                get: function() {
                                    return t._LogCache
                                },
                                enumerable: !0,
                                configurable: !0
                            }), t.ClearLogCache = function() {
                                t._LogCache = "", t.errorsCount = 0
                            }, Object.defineProperty(t, "LogLevels", {
                                set: function(e) {
                                    t.Log = (e & t.MessageLogLevel) === t.MessageLogLevel ? t._LogEnabled : t._LogDisabled, t.Warn = (e & t.WarningLogLevel) === t.WarningLogLevel ? t._WarnEnabled : t._WarnDisabled, t.Error = (e & t.ErrorLogLevel) === t.ErrorLogLevel ? t._ErrorEnabled : t._ErrorDisabled
                                },
                                enumerable: !0,
                                configurable: !0
                            }), t.IsFileURL = function() {
                                return "file:" === location.protocol
                            }, t.IsWindowObjectExist = function() {
                                return "undefined" != typeof window
                            }, Object.defineProperty(t, "PerformanceLogLevel", {
                                set: function(e) {
                                    return (e & t.PerformanceUserMarkLogLevel) === t.PerformanceUserMarkLogLevel ? (t.StartPerformanceCounter = t._StartUserMark, void(t.EndPerformanceCounter = t._EndUserMark)) : (e & t.PerformanceConsoleLogLevel) === t.PerformanceConsoleLogLevel ? (t.StartPerformanceCounter = t._StartPerformanceConsole, void(t.EndPerformanceCounter = t._EndPerformanceConsole)) : (t.StartPerformanceCounter = t._StartPerformanceCounterDisabled, void(t.EndPerformanceCounter = t._EndPerformanceCounterDisabled))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), t._StartPerformanceCounterDisabled = function(e, t) {}, t._EndPerformanceCounterDisabled = function(e, t) {}, t._StartUserMark = function(e, i) {
                                if (void 0 === i && (i = !0), !t._performance) {
                                    if (!t.IsWindowObjectExist()) return;
                                    t._performance = window.performance
                                }
                                i && t._performance.mark && t._performance.mark(e + "-Begin")
                            }, t._EndUserMark = function(e, i) {
                                void 0 === i && (i = !0), i && t._performance.mark && (t._performance.mark(e + "-End"), t._performance.measure(e, e + "-Begin", e + "-End"))
                            }, t._StartPerformanceConsole = function(e, i) {
                                void 0 === i && (i = !0), i && (t._StartUserMark(e, i), console.time)
                            }, t._EndPerformanceConsole = function(e, i) {
                                void 0 === i && (i = !0), i && (t._EndUserMark(e, i), console.time)
                            }, Object.defineProperty(t, "Now", {
                                get: function() {
                                    return t.IsWindowObjectExist() && window.performance && window.performance.now ? window.performance.now() : Date.now()
                                },
                                enumerable: !0,
                                configurable: !0
                            }), t.GetClassName = function(e, t) {
                                void 0 === t && (t = !1);
                                var i = null;
                                return !t && e.getClassName ? i = e.getClassName() : (e instanceof Object && (i = (t ? e : Object.getPrototypeOf(e)).constructor.__bjsclassName__), i || (i = typeof e)), i
                            }, t.First = function(e, t) {
                                for (var i = 0, r = e; i < r.length; i++) {
                                    var n = r[i];
                                    if (t(n)) return n
                                }
                                return null
                            }, t.getFullClassName = function(e, t) {
                                void 0 === t && (t = !1);
                                var i = null,
                                    r = null;
                                if (!t && e.getClassName) i = e.getClassName();
                                else {
                                    if (e instanceof Object) {
                                        var n = t ? e : Object.getPrototypeOf(e);
                                        i = n.constructor.__bjsclassName__, r = n.constructor.__bjsmoduleName__
                                    }
                                    i || (i = typeof e)
                                }
                                return i ? (null != r ? r + "." : "") + i : null
                            }, t.DelayAsync = function(e) {
                                return new Promise(function(t) {
                                    setTimeout(function() {
                                        t()
                                    }, e)
                                })
                            }, t.GetCurrentGradient = function(e, t, i) {
                                for (var r = 0; r < t.length - 1; r++) {
                                    var n = t[r],
                                        o = t[r + 1];
                                    if (e >= n.gradient && e <= o.gradient) return void i(n, o, (e - n.gradient) / (o.gradient - n.gradient))
                                }
                                var s = t.length - 1;
                                i(t[s], t[s], 1)
                            }, t.BaseUrl = "", t.DefaultRetryStrategy = s.ExponentialBackoff(), t.CorsBehavior = "anonymous", t.UseFallbackTexture = !0, t.RegisteredExternalClasses = {}, t.fallbackTexture = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z", t._tmpFloatArray = new Float32Array(1), t.PreprocessUrl = function(e) {
                                return e
                            }, t.NoneLogLevel = 0, t.MessageLogLevel = 1, t.WarningLogLevel = 2, t.ErrorLogLevel = 4, t.AllLogLevel = 7, t._LogCache = "", t.errorsCount = 0, t.Log = t._LogEnabled, t.Warn = t._WarnEnabled, t.Error = t._ErrorEnabled, t.PerformanceNoneLogLevel = 0, t.PerformanceUserMarkLogLevel = 1, t.PerformanceConsoleLogLevel = 2, t.StartPerformanceCounter = t._StartPerformanceCounterDisabled, t.EndPerformanceCounter = t._EndPerformanceCounterDisabled, t
                        }();
                    e.Tools = l;
                    var u = function() {
                        function e() {
                            this._startMonitoringTime = 0, this._min = 0, this._max = 0, this._average = 0, this._lastSecAverage = 0, this._current = 0, this._totalValueCount = 0, this._totalAccumulated = 0, this._lastSecAccumulated = 0, this._lastSecTime = 0, this._lastSecValueCount = 0
                        }
                        return Object.defineProperty(e.prototype, "min", {
                            get: function() {
                                return this._min
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(e.prototype, "max", {
                            get: function() {
                                return this._max
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(e.prototype, "average", {
                            get: function() {
                                return this._average
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(e.prototype, "lastSecAverage", {
                            get: function() {
                                return this._lastSecAverage
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(e.prototype, "current", {
                            get: function() {
                                return this._current
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(e.prototype, "total", {
                            get: function() {
                                return this._totalAccumulated
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(e.prototype, "count", {
                            get: function() {
                                return this._totalValueCount
                            },
                            enumerable: !0,
                            configurable: !0
                        }), e.prototype.fetchNewFrame = function() {
                            this._totalValueCount++, this._current = 0, this._lastSecValueCount++
                        }, e.prototype.addCount = function(t, i) {
                            e.Enabled && (this._current += t, i && this._fetchResult())
                        }, e.prototype.beginMonitoring = function() {
                            e.Enabled && (this._startMonitoringTime = l.Now)
                        }, e.prototype.endMonitoring = function(t) {
                            if (void 0 === t && (t = !0), e.Enabled) {
                                t && this.fetchNewFrame();
                                var i = l.Now;
                                this._current = i - this._startMonitoringTime, t && this._fetchResult()
                            }
                        }, e.prototype._fetchResult = function() {
                            this._totalAccumulated += this._current, this._lastSecAccumulated += this._current, this._min = Math.min(this._min, this._current), this._max = Math.max(this._max, this._current), this._average = this._totalAccumulated / this._totalValueCount;
                            var e = l.Now;
                            1e3 < e - this._lastSecTime && (this._lastSecAverage = this._lastSecAccumulated / this._lastSecValueCount, this._lastSecTime = e, this._lastSecAccumulated = 0, this._lastSecValueCount = 0)
                        }, e.Enabled = !0, e
                    }();
                    e.PerfCounter = u, e.className = function(e, t) {
                        return function(i) {
                            i.__bjsclassName__ = e, i.__bjsmoduleName__ = null != t ? t : null
                        }
                    };
                    var c = function() {
                        function e(e, t, i, r) {
                            void 0 === r && (r = 0), this.iterations = e, this.index = r - 1, this._done = !1, this._fn = t, this._successCallback = i
                        }
                        return e.prototype.executeNext = function() {
                            this._done || (this.index + 1 < this.iterations ? (++this.index, this._fn(this)) : this.breakLoop())
                        }, e.prototype.breakLoop = function() {
                            this._done = !0, this._successCallback()
                        }, e.Run = function(t, i, r, n) {
                            void 0 === n && (n = 0);
                            var o = new e(t, i, r, n);
                            return o.executeNext(), o
                        }, e.SyncAsyncForLoop = function(t, i, r, n, o, s) {
                            return void 0 === s && (s = 0), e.Run(Math.ceil(t / i), function(e) {
                                o && o() ? e.breakLoop() : setTimeout(function() {
                                    for (var n = 0; n < i; ++n) {
                                        var s = e.index * i + n;
                                        if (t <= s) break;
                                        if (r(s), o && o()) {
                                            e.breakLoop();
                                            break
                                        }
                                    }
                                    e.executeNext()
                                }, s)
                            }, n)
                        }, e
                    }();
                    e.AsyncLoop = c
                }($a || ($a = {})),
                function(e) {
                    var t, i;
                    (i = t || (t = {}))[i.Pending = 0] = "Pending", i[i.Fulfilled = 1] = "Fulfilled", i[i.Rejected = 2] = "Rejected";
                    var r = function() {
                            this.count = 0, this.target = 0, this.results = []
                        },
                        n = function() {
                            function i(e) {
                                var i = this;
                                if (this._state = t.Pending, this._children = new Array, this._rejectWasConsumed = !1, e) try {
                                    e(function(e) {
                                        i._resolve(e)
                                    }, function(e) {
                                        i._reject(e)
                                    })
                                } catch (e) {
                                    this._reject(e)
                                }
                            }
                            return Object.defineProperty(i.prototype, "_result", {
                                get: function() {
                                    return this._resultValue
                                },
                                set: function(e) {
                                    this._resultValue = e, this._parent && void 0 === this._parent._result && (this._parent._result = e)
                                },
                                enumerable: !0,
                                configurable: !0
                            }), i.prototype.catch = function(e) {
                                return this.then(void 0, e)
                            }, i.prototype.then = function(r, n) {
                                var o = this,
                                    s = new i;
                                return s._onFulfilled = r, s._onRejected = n, this._children.push(s), (s._parent = this)._state !== t.Pending && e.Tools.SetImmediate(function() {
                                    if (o._state === t.Fulfilled || o._rejectWasConsumed) {
                                        var e = s._resolve(o._result);
                                        if (null != e)
                                            if (void 0 !== e._state) {
                                                var i = e;
                                                s._children.push(i), i._parent = s, s = i
                                            } else s._result = e
                                    } else s._reject(o._reason)
                                }), s
                            }, i.prototype._moveChildren = function(e) {
                                var i, r = this;
                                if ((i = this._children).push.apply(i, e.splice(0, e.length)), this._children.forEach(function(e) {
                                        e._parent = r
                                    }), this._state === t.Fulfilled)
                                    for (var n = 0, o = this._children; n < o.length; n++) o[n]._resolve(this._result);
                                else if (this._state === t.Rejected)
                                    for (var s = 0, a = this._children; s < a.length; s++) a[s]._reject(this._reason)
                            }, i.prototype._resolve = function(e) {
                                try {
                                    this._state = t.Fulfilled;
                                    var i = null;
                                    if (this._onFulfilled && (i = this._onFulfilled(e)), null != i)
                                        if (void 0 !== i._state) {
                                            var r = i;
                                            r._parent = this, r._moveChildren(this._children), e = r._result
                                        } else e = i;
                                    this._result = e;
                                    for (var n = 0, o = this._children; n < o.length; n++) o[n]._resolve(e);
                                    this._children.length = 0, delete this._onFulfilled, delete this._onRejected
                                } catch (e) {
                                    this._reject(e, !0)
                                }
                            }, i.prototype._reject = function(e, i) {
                                if (void 0 === i && (i = !1), this._state = t.Rejected, this._reason = e, this._onRejected && !i) try {
                                    this._onRejected(e), this._rejectWasConsumed = !0
                                } catch (i) {
                                    e = i
                                }
                                for (var r = 0, n = this._children; r < n.length; r++) {
                                    var o = n[r];
                                    this._rejectWasConsumed ? o._resolve(null) : o._reject(e)
                                }
                                this._children.length = 0, delete this._onFulfilled, delete this._onRejected
                            }, i.resolve = function(e) {
                                var t = new i;
                                return t._resolve(e), t
                            }, i._RegisterForFulfillment = function(e, i, r) {
                                e.then(function(e) {
                                    return i.results[r] = e, i.count++, i.count === i.target && i.rootPromise._resolve(i.results), null
                                }, function(e) {
                                    i.rootPromise._state !== t.Rejected && i.rootPromise._reject(e)
                                })
                            }, i.all = function(e) {
                                var t = new i,
                                    n = new r;
                                if (n.target = e.length, n.rootPromise = t, e.length)
                                    for (var o = 0; o < e.length; o++) i._RegisterForFulfillment(e[o], n, o);
                                else t._resolve([]);
                                return t
                            }, i.race = function(e) {
                                var t = new i;
                                if (e.length)
                                    for (var r = 0, n = e; r < n.length; r++) n[r].then(function(e) {
                                        return t && (t._resolve(e), t = null), null
                                    }, function(e) {
                                        t && (t._reject(e), t = null)
                                    });
                                return t
                            }, i
                        }(),
                        o = function() {
                            function e() {}
                            return e.Apply = function(e) {
                                void 0 === e && (e = !1), (e || "undefined" == typeof Promise) && (window.Promise = n)
                            }, e
                        }();
                    e.PromisePolyfill = o
                }($a || ($a = {})), h = $a || ($a = {}), d = function() {
                    function e(e) {
                        this._pendingActions = new Array, this._workerInfos = e.map(function(e) {
                            return {
                                worker: e,
                                active: !1
                            }
                        })
                    }
                    return e.prototype.dispose = function() {
                        for (var e = 0, t = this._workerInfos; e < t.length; e++) t[e].worker.terminate();
                        delete this._workerInfos, delete this._pendingActions
                    }, e.prototype.push = function(e) {
                        for (var t = 0, i = this._workerInfos; t < i.length; t++) {
                            var r = i[t];
                            if (!r.active) return void this._execute(r, e)
                        }
                        this._pendingActions.push(e)
                    }, e.prototype._execute = function(e, t) {
                        var i = this;
                        e.active = !0, t(e.worker, function() {
                            e.active = !1;
                            var t = i._pendingActions.shift();
                            t && i._execute(e, t)
                        })
                    }, e
                }(), h.WorkerPool = d, p = $a || ($a = {}), f = function() {
                    function e() {
                        this._isAlphaBlendDirty = !1, this._isBlendFunctionParametersDirty = !1, this._isBlendEquationParametersDirty = !1, this._isBlendConstantsDirty = !1, this._alphaBlend = !1, this._blendFunctionParameters = new Array(4), this._blendEquationParameters = new Array(2), this._blendConstants = new Array(4), this.reset()
                    }
                    return Object.defineProperty(e.prototype, "isDirty", {
                        get: function() {
                            return this._isAlphaBlendDirty || this._isBlendFunctionParametersDirty
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "alphaBlend", {
                        get: function() {
                            return this._alphaBlend
                        },
                        set: function(e) {
                            this._alphaBlend !== e && (this._alphaBlend = e, this._isAlphaBlendDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.setAlphaBlendConstants = function(e, t, i, r) {
                        this._blendConstants[0] === e && this._blendConstants[1] === t && this._blendConstants[2] === i && this._blendConstants[3] === r || (this._blendConstants[0] = e, this._blendConstants[1] = t, this._blendConstants[2] = i, this._blendConstants[3] = r, this._isBlendConstantsDirty = !0)
                    }, e.prototype.setAlphaBlendFunctionParameters = function(e, t, i, r) {
                        this._blendFunctionParameters[0] === e && this._blendFunctionParameters[1] === t && this._blendFunctionParameters[2] === i && this._blendFunctionParameters[3] === r || (this._blendFunctionParameters[0] = e, this._blendFunctionParameters[1] = t, this._blendFunctionParameters[2] = i, this._blendFunctionParameters[3] = r, this._isBlendFunctionParametersDirty = !0)
                    }, e.prototype.setAlphaEquationParameters = function(e, t) {
                        this._blendEquationParameters[0] === e && this._blendEquationParameters[1] === t || (this._blendEquationParameters[0] = e, this._blendEquationParameters[1] = t, this._isBlendEquationParametersDirty = !0)
                    }, e.prototype.reset = function() {
                        this._alphaBlend = !1, this._blendFunctionParameters[0] = null, this._blendFunctionParameters[1] = null, this._blendFunctionParameters[2] = null, this._blendFunctionParameters[3] = null, this._blendEquationParameters[0] = null, this._blendEquationParameters[1] = null, this._blendConstants[0] = null, this._blendConstants[1] = null, this._blendConstants[2] = null, this._blendConstants[3] = null, this._isAlphaBlendDirty = !0, this._isBlendFunctionParametersDirty = !1, this._isBlendEquationParametersDirty = !1, this._isBlendConstantsDirty = !1
                    }, e.prototype.apply = function(e) {
                        this.isDirty && (this._isAlphaBlendDirty && (this._alphaBlend ? e.enable(e.BLEND) : e.disable(e.BLEND), this._isAlphaBlendDirty = !1), this._isBlendFunctionParametersDirty && (e.blendFuncSeparate(this._blendFunctionParameters[0], this._blendFunctionParameters[1], this._blendFunctionParameters[2], this._blendFunctionParameters[3]), this._isBlendFunctionParametersDirty = !1), this._isBlendEquationParametersDirty && (e.blendEquationSeparate(this._blendEquationParameters[0], this._blendEquationParameters[1]), this._isBlendEquationParametersDirty = !1), this._isBlendConstantsDirty && (e.blendColor(this._blendConstants[0], this._blendConstants[1], this._blendConstants[2], this._blendConstants[3]), this._isBlendConstantsDirty = !1))
                    }, e
                }(), p._AlphaState = f, _ = $a || ($a = {}), m = function() {
                    function e() {
                        this._isDepthTestDirty = !1, this._isDepthMaskDirty = !1, this._isDepthFuncDirty = !1, this._isCullFaceDirty = !1, this._isCullDirty = !1, this._isZOffsetDirty = !1, this._isFrontFaceDirty = !1, this.reset()
                    }
                    return Object.defineProperty(e.prototype, "isDirty", {
                        get: function() {
                            return this._isDepthFuncDirty || this._isDepthTestDirty || this._isDepthMaskDirty || this._isCullFaceDirty || this._isCullDirty || this._isZOffsetDirty || this._isFrontFaceDirty
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "zOffset", {
                        get: function() {
                            return this._zOffset
                        },
                        set: function(e) {
                            this._zOffset !== e && (this._zOffset = e, this._isZOffsetDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "cullFace", {
                        get: function() {
                            return this._cullFace
                        },
                        set: function(e) {
                            this._cullFace !== e && (this._cullFace = e, this._isCullFaceDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "cull", {
                        get: function() {
                            return this._cull
                        },
                        set: function(e) {
                            this._cull !== e && (this._cull = e, this._isCullDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "depthFunc", {
                        get: function() {
                            return this._depthFunc
                        },
                        set: function(e) {
                            this._depthFunc !== e && (this._depthFunc = e, this._isDepthFuncDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "depthMask", {
                        get: function() {
                            return this._depthMask
                        },
                        set: function(e) {
                            this._depthMask !== e && (this._depthMask = e, this._isDepthMaskDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "depthTest", {
                        get: function() {
                            return this._depthTest
                        },
                        set: function(e) {
                            this._depthTest !== e && (this._depthTest = e, this._isDepthTestDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "frontFace", {
                        get: function() {
                            return this._frontFace
                        },
                        set: function(e) {
                            this._frontFace !== e && (this._frontFace = e, this._isFrontFaceDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.reset = function() {
                        this._depthMask = !0, this._depthTest = !0, this._depthFunc = null, this._cullFace = null, this._cull = null, this._zOffset = 0, this._frontFace = null, this._isDepthTestDirty = !0, this._isDepthMaskDirty = !0, this._isDepthFuncDirty = !1, this._isCullFaceDirty = !1, this._isCullDirty = !1, this._isZOffsetDirty = !1, this._isFrontFaceDirty = !1
                    }, e.prototype.apply = function(e) {
                        this.isDirty && (this._isCullDirty && (this.cull ? e.enable(e.CULL_FACE) : e.disable(e.CULL_FACE), this._isCullDirty = !1), this._isCullFaceDirty && (e.cullFace(this.cullFace), this._isCullFaceDirty = !1), this._isDepthMaskDirty && (e.depthMask(this.depthMask), this._isDepthMaskDirty = !1), this._isDepthTestDirty && (this.depthTest ? e.enable(e.DEPTH_TEST) : e.disable(e.DEPTH_TEST), this._isDepthTestDirty = !1), this._isDepthFuncDirty && (e.depthFunc(this.depthFunc), this._isDepthFuncDirty = !1), this._isZOffsetDirty && (this.zOffset ? (e.enable(e.POLYGON_OFFSET_FILL), e.polygonOffset(this.zOffset, 0)) : e.disable(e.POLYGON_OFFSET_FILL), this._isZOffsetDirty = !1), this._isFrontFaceDirty && (e.frontFace(this.frontFace), this._isFrontFaceDirty = !1))
                    }, e
                }(), _._DepthCullingState = m, g = $a || ($a = {}), v = function() {
                    function e() {
                        this._isStencilTestDirty = !1, this._isStencilMaskDirty = !1, this._isStencilFuncDirty = !1, this._isStencilOpDirty = !1, this.reset()
                    }
                    return Object.defineProperty(e.prototype, "isDirty", {
                        get: function() {
                            return this._isStencilTestDirty || this._isStencilMaskDirty || this._isStencilFuncDirty || this._isStencilOpDirty
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "stencilFunc", {
                        get: function() {
                            return this._stencilFunc
                        },
                        set: function(e) {
                            this._stencilFunc !== e && (this._stencilFunc = e, this._isStencilFuncDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "stencilFuncRef", {
                        get: function() {
                            return this._stencilFuncRef
                        },
                        set: function(e) {
                            this._stencilFuncRef !== e && (this._stencilFuncRef = e, this._isStencilFuncDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "stencilFuncMask", {
                        get: function() {
                            return this._stencilFuncMask
                        },
                        set: function(e) {
                            this._stencilFuncMask !== e && (this._stencilFuncMask = e, this._isStencilFuncDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "stencilOpStencilFail", {
                        get: function() {
                            return this._stencilOpStencilFail
                        },
                        set: function(e) {
                            this._stencilOpStencilFail !== e && (this._stencilOpStencilFail = e, this._isStencilOpDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "stencilOpDepthFail", {
                        get: function() {
                            return this._stencilOpDepthFail
                        },
                        set: function(e) {
                            this._stencilOpDepthFail !== e && (this._stencilOpDepthFail = e, this._isStencilOpDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "stencilOpStencilDepthPass", {
                        get: function() {
                            return this._stencilOpStencilDepthPass
                        },
                        set: function(e) {
                            this._stencilOpStencilDepthPass !== e && (this._stencilOpStencilDepthPass = e, this._isStencilOpDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "stencilMask", {
                        get: function() {
                            return this._stencilMask
                        },
                        set: function(e) {
                            this._stencilMask !== e && (this._stencilMask = e, this._isStencilMaskDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "stencilTest", {
                        get: function() {
                            return this._stencilTest
                        },
                        set: function(e) {
                            this._stencilTest !== e && (this._stencilTest = e, this._isStencilTestDirty = !0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.reset = function() {
                        this._stencilTest = !1, this._stencilMask = 255, this._stencilFunc = g.Engine.ALWAYS, this._stencilFuncRef = 1, this._stencilFuncMask = 255, this._stencilOpStencilFail = g.Engine.KEEP, this._stencilOpDepthFail = g.Engine.KEEP, this._stencilOpStencilDepthPass = g.Engine.REPLACE, this._isStencilTestDirty = !0, this._isStencilMaskDirty = !0, this._isStencilFuncDirty = !0, this._isStencilOpDirty = !0
                    }, e.prototype.apply = function(e) {
                        this.isDirty && (this._isStencilTestDirty && (this.stencilTest ? e.enable(e.STENCIL_TEST) : e.disable(e.STENCIL_TEST), this._isStencilTestDirty = !1), this._isStencilMaskDirty && (e.stencilMask(this.stencilMask), this._isStencilMaskDirty = !1), this._isStencilFuncDirty && (e.stencilFunc(this.stencilFunc, this.stencilFuncRef, this.stencilFuncMask), this._isStencilFuncDirty = !1), this._isStencilOpDirty && (e.stencilOp(this.stencilOpStencilFail, this.stencilOpDepthFail, this.stencilOpStencilDepthPass), this._isStencilOpDirty = !1))
                    }, e
                }(), g._StencilState = v;
            var x, T, E, S, P, A, C, M, R, O, w, I, D, L, B, F, N, V, k, U, G, z, j, H, W, X, Y, q, K, Q, Z, J, $, ee, te, ie, re, ne, oe, se, ae = this && this.__assign || function() {
                return (ae = Object.assign || function(e) {
                    for (var t, i = 1, r = arguments.length; i < r; i++)
                        for (var n in t = arguments[i]) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
                    return e
                }).apply(this, arguments)
            };
            ! function(e) {
                var t = function() {},
                    i = function() {};
                e.InstancingAttributeInfo = i;
                var r = function() {};
                e.RenderTargetCreationOptions = r;
                var n = function() {};
                e.DepthTextureCreationOptions = n;
                var o = function() {};
                e.EngineCapabilities = o;
                var s = function() {
                    function i(r, n, o, s) {
                        void 0 === s && (s = !1);
                        var a = this;
                        this.forcePOTTextures = !1, this.isFullscreen = !1, this.isPointerLock = !1, this.cullBackFaces = !0, this.renderEvenInBackground = !0, this.preventCacheWipeBetweenFrames = !1, this.enableOfflineSupport = !1, this.disableManifestCheck = !1, this.scenes = new Array, this.postProcesses = new Array, this.validateShaderPrograms = !1, this.onResizeObservable = new e.Observable, this.onCanvasBlurObservable = new e.Observable, this.onCanvasFocusObservable = new e.Observable, this.onCanvasPointerOutObservable = new e.Observable, this.onBeforeTextureInitObservable = new e.Observable, this._vrDisplay = void 0, this._vrSupported = !1, this._vrExclusivePointerMode = !1, this.disableUniformBuffers = !1, this._uniformBuffers = new Array, this.onBeginFrameObservable = new e.Observable, this.onEndFrameObservable = new e.Observable, this.onBeforeShaderCompilationObservable = new e.Observable, this.onAfterShaderCompilationObservable = new e.Observable, this._windowIsBackground = !1, this._webGLVersion = 1, this._badOS = !1, this._badDesktopOS = !1, this.disableTextureBindingOptimization = !1, this.onVRDisplayChangedObservable = new e.Observable, this.onVRRequestPresentComplete = new e.Observable, this.onVRRequestPresentStart = new e.Observable, this._colorWrite = !0, this._drawCalls = new e.PerfCounter, this._textureCollisions = new e.PerfCounter, this._renderingQueueLaunched = !1, this._activeRenderLoops = new Array, this._deterministicLockstep = !1, this._lockstepMaxSteps = 4, this.onContextLostObservable = new e.Observable, this.onContextRestoredObservable = new e.Observable, this._contextWasLost = !1, this._doNotHandleContextLost = !1, this._performanceMonitor = new e.PerformanceMonitor, this._fps = 60, this._deltaTime = 0, this.disablePerformanceMonitorInBackground = !1, this._depthCullingState = new e._DepthCullingState, this._stencilState = new e._StencilState, this._alphaState = new e._AlphaState, this._alphaMode = i.ALPHA_DISABLE, this._internalTexturesCache = new Array, this._activeChannel = 0, this._currentTextureChannel = -1, this._boundTexturesCache = {}, this._compiledEffects = {}, this._vertexAttribArraysEnabled = [], this._uintIndicesCurrentlySet = !1, this._currentBoundBuffer = new Array, this._currentFramebuffer = null, this._currentBufferPointers = new Array, this._currentInstanceLocations = new Array, this._currentInstanceBuffers = new Array, this._firstBoundInternalTextureTracker = new e.DummyInternalTextureTracker, this._lastBoundInternalTextureTracker = new e.DummyInternalTextureTracker, this._vaoRecordInProgress = !1, this._mustWipeVertexAttributes = !1, this._nextFreeTextureSlots = new Array, this._maxSimultaneousTextures = 0, this._activeRequests = new Array, this._texturesSupported = new Array, this.premultipliedAlpha = !0, this._viewportCached = new e.Vector4(0, 0, 0, 0), this._onVRFullScreenTriggered = function() {
                            if (a._vrDisplay && a._vrDisplay.isPresenting) {
                                a._oldSize = new e.Size(a.getRenderWidth(), a.getRenderHeight()), a._oldHardwareScaleFactor = a.getHardwareScalingLevel();
                                var t = a._vrDisplay.getEyeParameters("left");
                                a.setHardwareScalingLevel(1), a.setSize(2 * t.renderWidth, t.renderHeight)
                            } else a.setHardwareScalingLevel(a._oldHardwareScaleFactor), a.setSize(a._oldSize.width, a._oldSize.height)
                        }, this._unpackFlipYCached = null, this.enableUnpackFlipYCached = !0, this._boundUniforms = {}, e.PromisePolyfill.Apply();
                        var l = null;
                        if (i.Instances.push(this), r) {
                            if (o = o || {}, r.getContext) {
                                if (l = r, this._renderingCanvas = l, null != n && (o.antialias = n), void 0 === o.deterministicLockstep && (o.deterministicLockstep = !1), void 0 === o.lockstepMaxSteps && (o.lockstepMaxSteps = 4), void 0 === o.preserveDrawingBuffer && (o.preserveDrawingBuffer = !1), void 0 === o.audioEngine && (o.audioEngine = !0), void 0 === o.stencil && (o.stencil = !0), !1 === o.premultipliedAlpha && (this.premultipliedAlpha = !1), this._deterministicLockstep = o.deterministicLockstep, this._lockstepMaxSteps = o.lockstepMaxSteps, this._doNotHandleContextLost = !!o.doNotHandleContextLost, navigator && navigator.userAgent)
                                    for (var u = navigator.userAgent, c = 0, h = i.ExceptionList; c < h.length; c++) {
                                        var d = h[c],
                                            p = d.key,
                                            f = d.targets;
                                        if (-1 < u.indexOf(p)) {
                                            if (d.capture && d.captureConstraint) {
                                                var _ = d.capture,
                                                    m = d.captureConstraint,
                                                    g = new RegExp(_).exec(u);
                                                if (g && 0 < g.length && m <= parseInt(g[g.length - 1])) continue
                                            }
                                            for (var v = 0, y = f; v < y.length; v++) switch (y[v]) {
                                                case "uniformBuffer":
                                                    this.disableUniformBuffers = !0;
                                                    break;
                                                case "textureBindingOptimization":
                                                    this.disableTextureBindingOptimization = !0
                                            }
                                        }
                                    }
                                if (!o.disableWebGL2Support) try {
                                    this._gl = l.getContext("webgl2", o) || l.getContext("experimental-webgl2", o), this._gl && (this._webGLVersion = 2, this._gl.deleteQuery || (this._webGLVersion = 1))
                                } catch (r) {}
                                if (!this._gl) {
                                    if (!l) throw new Error("The provided canvas is null or undefined.");
                                    try {
                                        this._gl = l.getContext("webgl", o) || l.getContext("experimental-webgl", o)
                                    } catch (r) {
                                        throw new Error("WebGL not supported")
                                    }
                                }
                                if (!this._gl) throw new Error("WebGL not supported");
                                this._onCanvasFocus = function() {
                                    a.onCanvasFocusObservable.notifyObservers(a)
                                }, this._onCanvasBlur = function() {
                                    a.onCanvasBlurObservable.notifyObservers(a)
                                }, l.addEventListener("focus", this._onCanvasFocus), l.addEventListener("blur", this._onCanvasBlur), this._onBlur = function() {
                                    a.disablePerformanceMonitorInBackground && a._performanceMonitor.disable(), a._windowIsBackground = !0
                                }, this._onFocus = function() {
                                    a.disablePerformanceMonitorInBackground && a._performanceMonitor.enable(), a._windowIsBackground = !1
                                }, this._onCanvasPointerOut = function(e) {
                                    a.onCanvasPointerOutObservable.notifyObservers(e)
                                }, window.addEventListener("blur", this._onBlur), window.addEventListener("focus", this._onFocus), l.addEventListener("pointerout", this._onCanvasPointerOut), this._doNotHandleContextLost || (this._onContextLost = function(t) {
                                    t.preventDefault(), a._contextWasLost = !0, e.Tools.Warn("WebGL context lost."), a.onContextLostObservable.notifyObservers(a)
                                }, this._onContextRestored = function(t) {
                                    setTimeout(function() {
                                        a._initGLContext(), a._rebuildEffects(), a._rebuildInternalTextures(), a._rebuildBuffers(), a.wipeCaches(!0), e.Tools.Warn("WebGL context successfully restored."), a.onContextRestoredObservable.notifyObservers(a), a._contextWasLost = !1
                                    }, 0)
                                }, l.addEventListener("webglcontextlost", this._onContextLost, !1), l.addEventListener("webglcontextrestored", this._onContextRestored, !1))
                            } else {
                                this._gl = r, this._renderingCanvas = this._gl.canvas, this._gl.renderbufferStorageMultisample && (this._webGLVersion = 2);
                                var b = this._gl.getContextAttributes();
                                b && (o.stencil = b.stencil)
                            }
                            var x = o.limitDeviceRatio || window.devicePixelRatio || 1;
                            this._hardwareScalingLevel = s ? 1 / Math.min(x, window.devicePixelRatio || 1) : 1, this.resize(), this._isStencilEnable = !!o.stencil, this._initGLContext(), l && (this._onFullscreenChange = function() {
                                void 0 !== document.fullscreen ? a.isFullscreen = document.fullscreen : void 0 !== document.mozFullScreen ? a.isFullscreen = document.mozFullScreen : void 0 !== document.webkitIsFullScreen ? a.isFullscreen = document.webkitIsFullScreen : void 0 !== document.msIsFullScreen && (a.isFullscreen = document.msIsFullScreen), a.isFullscreen && a._pointerLockRequested && l && (l.requestPointerLock = l.requestPointerLock || l.msRequestPointerLock || l.mozRequestPointerLock || l.webkitRequestPointerLock, l.requestPointerLock && l.requestPointerLock())
                            }, document.addEventListener("fullscreenchange", this._onFullscreenChange, !1), document.addEventListener("mozfullscreenchange", this._onFullscreenChange, !1), document.addEventListener("webkitfullscreenchange", this._onFullscreenChange, !1), document.addEventListener("msfullscreenchange", this._onFullscreenChange, !1), this._onPointerLockChange = function() {
                                a.isPointerLock = document.mozPointerLockElement === l || document.webkitPointerLockElement === l || document.msPointerLockElement === l || document.pointerLockElement === l
                            }, document.addEventListener("pointerlockchange", this._onPointerLockChange, !1), document.addEventListener("mspointerlockchange", this._onPointerLockChange, !1), document.addEventListener("mozpointerlockchange", this._onPointerLockChange, !1), document.addEventListener("webkitpointerlockchange", this._onPointerLockChange, !1), this._onVRDisplayPointerRestricted = function() {
                                l && l.requestPointerLock()
                            }, this._onVRDisplayPointerUnrestricted = function() {
                                document.exitPointerLock()
                            }, window.addEventListener("vrdisplaypointerrestricted", this._onVRDisplayPointerRestricted, !1), window.addEventListener("vrdisplaypointerunrestricted", this._onVRDisplayPointerUnrestricted, !1)), !i.audioEngine && o.audioEngine && i.AudioEngineFactory && (i.audioEngine = i.AudioEngineFactory(this.getRenderingCanvas()));
                            for (var T = 0; T < this._caps.maxVertexAttribs; T++) this._currentBufferPointers[T] = new t;
                            this._linkTrackers(this._firstBoundInternalTextureTracker, this._lastBoundInternalTextureTracker), o.autoEnableWebVR && this.initWebVR(), this._badOS = /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent), this._badDesktopOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), this.enableOfflineSupport = void 0 !== e.Database
                        }
                    }
                    return Object.defineProperty(i, "LastCreatedEngine", {
                        get: function() {
                            return 0 === i.Instances.length ? null : i.Instances[i.Instances.length - 1]
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i, "LastCreatedScene", {
                        get: function() {
                            var e = i.LastCreatedEngine;
                            return e ? 0 === e.scenes.length ? null : e.scenes[e.scenes.length - 1] : null
                        },
                        enumerable: !0,
                        configurable: !0
                    }), i.MarkAllMaterialsAsDirty = function(e, t) {
                        for (var r = 0; r < i.Instances.length; r++)
                            for (var n = i.Instances[r], o = 0; o < n.scenes.length; o++) n.scenes[o].markAllMaterialsAsDirty(e, t)
                    }, Object.defineProperty(i, "Version", {
                        get: function() {
                            return "3.3.0"
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "isInVRExclusivePointerMode", {
                        get: function() {
                            return this._vrExclusivePointerMode
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "supportsUniformBuffers", {
                        get: function() {
                            return 1 < this.webGLVersion && !this.disableUniformBuffers
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "needPOTTextures", {
                        get: function() {
                            return this._webGLVersion < 2 || this.forcePOTTextures
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "doNotHandleContextLost", {
                        get: function() {
                            return this._doNotHandleContextLost
                        },
                        set: function(e) {
                            this._doNotHandleContextLost = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "performanceMonitor", {
                        get: function() {
                            return this._performanceMonitor
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "texturesSupported", {
                        get: function() {
                            return this._texturesSupported
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "textureFormatInUse", {
                        get: function() {
                            return this._textureFormatInUse
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "currentViewport", {
                        get: function() {
                            return this._cachedViewport
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "emptyTexture", {
                        get: function() {
                            return this._emptyTexture || (this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, i.TEXTUREFORMAT_RGBA, !1, !1, i.TEXTURE_NEAREST_SAMPLINGMODE)), this._emptyTexture
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "emptyTexture3D", {
                        get: function() {
                            return this._emptyTexture3D || (this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, i.TEXTUREFORMAT_RGBA, !1, !1, i.TEXTURE_NEAREST_SAMPLINGMODE)), this._emptyTexture3D
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "emptyCubeTexture", {
                        get: function() {
                            if (!this._emptyCubeTexture) {
                                var e = new Uint8Array(4),
                                    t = [e, e, e, e, e, e];
                                this._emptyCubeTexture = this.createRawCubeTexture(t, 1, i.TEXTUREFORMAT_RGBA, i.TEXTURETYPE_UNSIGNED_INT, !1, !1, i.TEXTURE_NEAREST_SAMPLINGMODE)
                            }
                            return this._emptyCubeTexture
                        },
                        enumerable: !0,
                        configurable: !0
                    }), i.prototype._rebuildInternalTextures = function() {
                        for (var e = 0, t = this._internalTexturesCache.slice(); e < t.length; e++) t[e]._rebuild()
                    }, i.prototype._rebuildEffects = function() {
                        for (var t in this._compiledEffects) this._compiledEffects[t]._prepareEffect();
                        e.Effect.ResetCache()
                    }, i.prototype._rebuildBuffers = function() {
                        for (var e = 0, t = this.scenes; e < t.length; e++) {
                            var i = t[e];
                            i.resetCachedMaterial(), i._rebuildGeometries(), i._rebuildTextures()
                        }
                        for (var r = 0, n = this._uniformBuffers; r < n.length; r++) n[r]._rebuild()
                    }, i.prototype._initGLContext = function() {
                        this._caps = new o, this._caps.maxTexturesImageUnits = this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS), this._caps.maxCombinedTexturesImageUnits = this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS), this._caps.maxVertexTextureImageUnits = this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS), this._caps.maxTextureSize = this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE), this._caps.maxCubemapTextureSize = this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE), this._caps.maxRenderTextureSize = this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE), this._caps.maxVertexAttribs = this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS), this._caps.maxVaryingVectors = this._gl.getParameter(this._gl.MAX_VARYING_VECTORS), this._caps.maxFragmentUniformVectors = this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS), this._caps.maxVertexUniformVectors = this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS), this._glVersion = this._gl.getParameter(this._gl.VERSION);
                        var e = this._gl.getExtension("WEBGL_debug_renderer_info");
                        if (null != e && (this._glRenderer = this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL), this._glVendor = this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)), this._glVendor || (this._glVendor = "Unknown vendor"), this._glRenderer || (this._glRenderer = "Unknown renderer"), this._gl.HALF_FLOAT_OES = 36193, 34842 !== this._gl.RGBA16F && (this._gl.RGBA16F = 34842), 34836 !== this._gl.RGBA32F && (this._gl.RGBA32F = 34836), 35056 !== this._gl.DEPTH24_STENCIL8 && (this._gl.DEPTH24_STENCIL8 = 35056), this._caps.standardDerivatives = 1 < this._webGLVersion || null !== this._gl.getExtension("OES_standard_derivatives"), this._caps.astc = this._gl.getExtension("WEBGL_compressed_texture_astc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"), this._caps.s3tc = this._gl.getExtension("WEBGL_compressed_texture_s3tc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"), this._caps.pvrtc = this._gl.getExtension("WEBGL_compressed_texture_pvrtc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"), this._caps.etc1 = this._gl.getExtension("WEBGL_compressed_texture_etc1") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"), this._caps.etc2 = this._gl.getExtension("WEBGL_compressed_texture_etc") || this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc") || this._gl.getExtension("WEBGL_compressed_texture_es3_0"), this._caps.textureAnisotropicFilterExtension = this._gl.getExtension("EXT_texture_filter_anisotropic") || this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic") || this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"), this._caps.maxAnisotropy = this._caps.textureAnisotropicFilterExtension ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0, this._caps.uintIndices = 1 < this._webGLVersion || null !== this._gl.getExtension("OES_element_index_uint"), this._caps.fragmentDepthSupported = 1 < this._webGLVersion || null !== this._gl.getExtension("EXT_frag_depth"), this._caps.highPrecisionShaderSupported = !0, this._caps.timerQuery = this._gl.getExtension("EXT_disjoint_timer_query_webgl2") || this._gl.getExtension("EXT_disjoint_timer_query"), this._caps.timerQuery && (1 === this._webGLVersion && (this._gl.getQuery = this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)), this._caps.canUseTimestampForTimerQuery = 0 < this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT, this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)), this._caps.colorBufferFloat = 1 < this._webGLVersion && this._gl.getExtension("EXT_color_buffer_float"), this._caps.textureFloat = !!(1 < this._webGLVersion || this._gl.getExtension("OES_texture_float")), this._caps.textureFloatLinearFiltering = !(!this._caps.textureFloat || !this._gl.getExtension("OES_texture_float_linear")), this._caps.textureFloatRender = !(!this._caps.textureFloat || !this._canRenderToFloatFramebuffer()), this._caps.textureHalfFloat = !!(1 < this._webGLVersion || this._gl.getExtension("OES_texture_half_float")), this._caps.textureHalfFloatLinearFiltering = !!(1 < this._webGLVersion || this._caps.textureHalfFloat && this._gl.getExtension("OES_texture_half_float_linear")), 1 < this._webGLVersion && (this._gl.HALF_FLOAT_OES = 5131), this._caps.textureHalfFloatRender = this._caps.textureHalfFloat && this._canRenderToHalfFloatFramebuffer(), this._caps.textureLOD = !!(1 < this._webGLVersion || this._gl.getExtension("EXT_shader_texture_lod")), 1 < this._webGLVersion) this._caps.drawBuffersExtension = !0;
                        else {
                            var t = this._gl.getExtension("WEBGL_draw_buffers");
                            if (null !== t) {
                                this._caps.drawBuffersExtension = !0, this._gl.drawBuffers = t.drawBuffersWEBGL.bind(t), this._gl.DRAW_FRAMEBUFFER = this._gl.FRAMEBUFFER;
                                for (var i = 0; i < 16; i++) this._gl["COLOR_ATTACHMENT" + i + "_WEBGL"] = t["COLOR_ATTACHMENT" + i + "_WEBGL"]
                            } else this._caps.drawBuffersExtension = !1
                        }
                        if (1 < this._webGLVersion) this._caps.depthTextureExtension = !0;
                        else {
                            var r = this._gl.getExtension("WEBGL_depth_texture");
                            null != r && (this._caps.depthTextureExtension = !0, this._gl.UNSIGNED_INT_24_8 = r.UNSIGNED_INT_24_8_WEBGL)
                        }
                        if (1 < this._webGLVersion) this._caps.vertexArrayObject = !0;
                        else {
                            var n = this._gl.getExtension("OES_vertex_array_object");
                            null != n ? (this._caps.vertexArrayObject = !0, this._gl.createVertexArray = n.createVertexArrayOES.bind(n), this._gl.bindVertexArray = n.bindVertexArrayOES.bind(n), this._gl.deleteVertexArray = n.deleteVertexArrayOES.bind(n)) : this._caps.vertexArrayObject = !1
                        }
                        if (1 < this._webGLVersion) this._caps.instancedArrays = !0;
                        else {
                            var s = this._gl.getExtension("ANGLE_instanced_arrays");
                            null != s ? (this._caps.instancedArrays = !0, this._gl.drawArraysInstanced = s.drawArraysInstancedANGLE.bind(s), this._gl.drawElementsInstanced = s.drawElementsInstancedANGLE.bind(s), this._gl.vertexAttribDivisor = s.vertexAttribDivisorANGLE.bind(s)) : this._caps.instancedArrays = !1
                        }
                        if (this._caps.astc && this.texturesSupported.push("-astc.ktx"), this._caps.s3tc && this.texturesSupported.push("-dxt.ktx"), this._caps.pvrtc && this.texturesSupported.push("-pvrtc.ktx"), this._caps.etc2 && this.texturesSupported.push("-etc2.ktx"), this._caps.etc1 && this.texturesSupported.push("-etc1.ktx"), this._gl.getShaderPrecisionFormat) {
                            var a = this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER, this._gl.HIGH_FLOAT);
                            a && (this._caps.highPrecisionShaderSupported = 0 !== a.precision)
                        }
                        this.setDepthBuffer(!0), this.setDepthFunctionToLessOrEqual(), this.setDepthWrite(!0), this._maxSimultaneousTextures = this._caps.maxCombinedTexturesImageUnits;
                        for (var l = 0; l < this._maxSimultaneousTextures; l++) this._nextFreeTextureSlots.push(l)
                    }, Object.defineProperty(i.prototype, "webGLVersion", {
                        get: function() {
                            return this._webGLVersion
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "isStencilEnable", {
                        get: function() {
                            return this._isStencilEnable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), i.prototype._prepareWorkingCanvas = function() {
                        if (!this._workingCanvas) {
                            this._workingCanvas = document.createElement("canvas");
                            var e = this._workingCanvas.getContext("2d");
                            e && (this._workingContext = e)
                        }
                    }, i.prototype.resetTextureCache = function() {
                        for (var e in this._boundTexturesCache)
                            if (this._boundTexturesCache.hasOwnProperty(e)) {
                                var t = this._boundTexturesCache[e];
                                t && this._removeDesignatedSlot(t), this._boundTexturesCache[e] = null
                            }
                        if (!this.disableTextureBindingOptimization) {
                            this._nextFreeTextureSlots = [];
                            for (var i = 0; i < this._maxSimultaneousTextures; i++) this._nextFreeTextureSlots.push(i)
                        }
                        this._currentTextureChannel = -1
                    }, i.prototype.isDeterministicLockStep = function() {
                        return this._deterministicLockstep
                    }, i.prototype.getLockstepMaxSteps = function() {
                        return this._lockstepMaxSteps
                    }, i.prototype.getGlInfo = function() {
                        return {
                            vendor: this._glVendor,
                            renderer: this._glRenderer,
                            version: this._glVersion
                        }
                    }, i.prototype.getAspectRatio = function(e, t) {
                        void 0 === t && (t = !1);
                        var i = e.viewport;
                        return this.getRenderWidth(t) * i.width / (this.getRenderHeight(t) * i.height)
                    }, i.prototype.getScreenAspectRatio = function() {
                        return this.getRenderWidth(!0) / this.getRenderHeight(!0)
                    }, i.prototype.getRenderWidth = function(e) {
                        return void 0 === e && (e = !1), !e && this._currentRenderTarget ? this._currentRenderTarget.width : this._gl.drawingBufferWidth
                    }, i.prototype.getRenderHeight = function(e) {
                        return void 0 === e && (e = !1), !e && this._currentRenderTarget ? this._currentRenderTarget.height : this._gl.drawingBufferHeight
                    }, i.prototype.getRenderingCanvas = function() {
                        return this._renderingCanvas
                    }, i.prototype.getRenderingCanvasClientRect = function() {
                        return this._renderingCanvas ? this._renderingCanvas.getBoundingClientRect() : null
                    }, i.prototype.setHardwareScalingLevel = function(e) {
                        this._hardwareScalingLevel = e, this.resize()
                    }, i.prototype.getHardwareScalingLevel = function() {
                        return this._hardwareScalingLevel
                    }, i.prototype.getLoadedTexturesCache = function() {
                        return this._internalTexturesCache
                    }, i.prototype.getCaps = function() {
                        return this._caps
                    }, Object.defineProperty(i.prototype, "drawCalls", {
                        get: function() {
                            return e.Tools.Warn("drawCalls is deprecated. Please use SceneInstrumentation class"), 0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "drawCallsPerfCounter", {
                        get: function() {
                            return e.Tools.Warn("drawCallsPerfCounter is deprecated. Please use SceneInstrumentation class"), null
                        },
                        enumerable: !0,
                        configurable: !0
                    }), i.prototype.getDepthFunction = function() {
                        return this._depthCullingState.depthFunc
                    }, i.prototype.setDepthFunction = function(e) {
                        this._depthCullingState.depthFunc = e
                    }, i.prototype.setDepthFunctionToGreater = function() {
                        this._depthCullingState.depthFunc = this._gl.GREATER
                    }, i.prototype.setDepthFunctionToGreaterOrEqual = function() {
                        this._depthCullingState.depthFunc = this._gl.GEQUAL
                    }, i.prototype.setDepthFunctionToLess = function() {
                        this._depthCullingState.depthFunc = this._gl.LESS
                    }, i.prototype.setDepthFunctionToLessOrEqual = function() {
                        this._depthCullingState.depthFunc = this._gl.LEQUAL
                    }, i.prototype.getStencilBuffer = function() {
                        return this._stencilState.stencilTest
                    }, i.prototype.setStencilBuffer = function(e) {
                        this._stencilState.stencilTest = e
                    }, i.prototype.getStencilMask = function() {
                        return this._stencilState.stencilMask
                    }, i.prototype.setStencilMask = function(e) {
                        this._stencilState.stencilMask = e
                    }, i.prototype.getStencilFunction = function() {
                        return this._stencilState.stencilFunc
                    }, i.prototype.getStencilFunctionReference = function() {
                        return this._stencilState.stencilFuncRef
                    }, i.prototype.getStencilFunctionMask = function() {
                        return this._stencilState.stencilFuncMask
                    }, i.prototype.setStencilFunction = function(e) {
                        this._stencilState.stencilFunc = e
                    }, i.prototype.setStencilFunctionReference = function(e) {
                        this._stencilState.stencilFuncRef = e
                    }, i.prototype.setStencilFunctionMask = function(e) {
                        this._stencilState.stencilFuncMask = e
                    }, i.prototype.getStencilOperationFail = function() {
                        return this._stencilState.stencilOpStencilFail
                    }, i.prototype.getStencilOperationDepthFail = function() {
                        return this._stencilState.stencilOpDepthFail
                    }, i.prototype.getStencilOperationPass = function() {
                        return this._stencilState.stencilOpStencilDepthPass
                    }, i.prototype.setStencilOperationFail = function(e) {
                        this._stencilState.stencilOpStencilFail = e
                    }, i.prototype.setStencilOperationDepthFail = function(e) {
                        this._stencilState.stencilOpDepthFail = e
                    }, i.prototype.setStencilOperationPass = function(e) {
                        this._stencilState.stencilOpStencilDepthPass = e
                    }, i.prototype.setDitheringState = function(e) {
                        e ? this._gl.enable(this._gl.DITHER) : this._gl.disable(this._gl.DITHER)
                    }, i.prototype.setRasterizerState = function(e) {
                        e ? this._gl.disable(this._gl.RASTERIZER_DISCARD) : this._gl.enable(this._gl.RASTERIZER_DISCARD)
                    }, i.prototype.stopRenderLoop = function(e) {
                        if (e) {
                            var t = this._activeRenderLoops.indexOf(e);
                            0 <= t && this._activeRenderLoops.splice(t, 1)
                        } else this._activeRenderLoops = []
                    }, i.prototype._renderLoop = function() {
                        if (!this._contextWasLost) {
                            var t = !0;
                            if (!this.renderEvenInBackground && this._windowIsBackground && (t = !1), t) {
                                this.beginFrame();
                                for (var i = 0; i < this._activeRenderLoops.length; i++)(0, this._activeRenderLoops[i])();
                                this.endFrame()
                            }
                        }
                        if (0 < this._activeRenderLoops.length) {
                            var r = null;
                            this._vrDisplay && this._vrDisplay.isPresenting && (r = this._vrDisplay), this._frameHandler = e.Tools.QueueNewFrame(this._bindedRenderFunction, r)
                        } else this._renderingQueueLaunched = !1
                    }, i.prototype.runRenderLoop = function(t) {
                        -1 === this._activeRenderLoops.indexOf(t) && (this._activeRenderLoops.push(t), this._renderingQueueLaunched || (this._renderingQueueLaunched = !0, this._bindedRenderFunction = this._renderLoop.bind(this), this._frameHandler = e.Tools.QueueNewFrame(this._bindedRenderFunction)))
                    }, i.prototype.switchFullscreen = function(t) {
                        this.isFullscreen ? e.Tools.ExitFullscreen() : (this._pointerLockRequested = t, this._renderingCanvas && e.Tools.RequestFullscreen(this._renderingCanvas))
                    }, i.prototype.clear = function(e, t, i, r) {
                        void 0 === r && (r = !1), this.applyStates();
                        var n = 0;
                        t && e && (this._gl.clearColor(e.r, e.g, e.b, void 0 !== e.a ? e.a : 1), n |= this._gl.COLOR_BUFFER_BIT), i && (this._gl.clearDepth(1), n |= this._gl.DEPTH_BUFFER_BIT), r && (this._gl.clearStencil(0), n |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(n)
                    }, i.prototype.scissorClear = function(e, t, i, r, n) {
                        var o = this._gl,
                            s = o.getParameter(o.SCISSOR_TEST),
                            a = o.getParameter(o.SCISSOR_BOX);
                        o.enable(o.SCISSOR_TEST), o.scissor(e, t, i, r), this.clear(n, !0, !0, !0), o.scissor(a[0], a[1], a[2], a[3]), !0 === s ? o.enable(o.SCISSOR_TEST) : o.disable(o.SCISSOR_TEST)
                    }, i.prototype._viewport = function(e, t, i, r) {
                        e === this._viewportCached.x && t === this._viewportCached.y && i === this._viewportCached.z && r === this._viewportCached.w || (this._viewportCached.x = e, this._viewportCached.y = t, this._viewportCached.z = i, this._viewportCached.w = r, this._gl.viewport(e, t, i, r))
                    }, i.prototype.setViewport = function(e, t, i) {
                        var r = t || this.getRenderWidth(),
                            n = i || this.getRenderHeight(),
                            o = e.x || 0,
                            s = e.y || 0;
                        this._cachedViewport = e, this._viewport(o * r, s * n, r * e.width, n * e.height)
                    }, i.prototype.setDirectViewport = function(e, t, i, r) {
                        var n = this._cachedViewport;
                        return this._cachedViewport = null, this._viewport(e, t, i, r), n
                    }, i.prototype.beginFrame = function() {
                        this.onBeginFrameObservable.notifyObservers(this), this._measureFps()
                    }, i.prototype.endFrame = function() {
                        this._badOS && this.flushFramebuffer(), this._vrDisplay && this._vrDisplay.isPresenting && this._vrDisplay.submitFrame(), this.onEndFrameObservable.notifyObservers(this)
                    }, i.prototype.resize = function() {
                        if (!this._vrDisplay || !this._vrDisplay.isPresenting) {
                            var e = this._renderingCanvas ? this._renderingCanvas.clientWidth : window.innerWidth,
                                t = this._renderingCanvas ? this._renderingCanvas.clientHeight : window.innerHeight;
                            this.setSize(e / this._hardwareScalingLevel, t / this._hardwareScalingLevel)
                        }
                    }, i.prototype.setSize = function(e, t) {
                        if (this._renderingCanvas && (this._renderingCanvas.width !== e || this._renderingCanvas.height !== t)) {
                            this._renderingCanvas.width = e, this._renderingCanvas.height = t;
                            for (var i = 0; i < this.scenes.length; i++)
                                for (var r = this.scenes[i], n = 0; n < r.cameras.length; n++) r.cameras[n]._currentRenderId = 0;
                            this.onResizeObservable.hasObservers && this.onResizeObservable.notifyObservers(this)
                        }
                    }, i.prototype.isVRDevicePresent = function() {
                        return !!this._vrDisplay
                    }, i.prototype.getVRDevice = function() {
                        return this._vrDisplay
                    }, i.prototype.initWebVR = function() {
                        return this.initWebVRAsync(), this.onVRDisplayChangedObservable
                    }, i.prototype.initWebVRAsync = function() {
                        var t = this,
                            i = function() {
                                var e = {
                                    vrDisplay: t._vrDisplay,
                                    vrSupported: t._vrSupported
                                };
                                t.onVRDisplayChangedObservable.notifyObservers(e), t._webVRInitPromise = new Promise(function(t) {
                                    t(e)
                                })
                            };
                        return this._onVrDisplayConnect || (this._onVrDisplayConnect = function(e) {
                            t._vrDisplay = e.display, i()
                        }, this._onVrDisplayDisconnect = function() {
                            t._vrDisplay.cancelAnimationFrame(t._frameHandler), t._vrDisplay = void 0, t._frameHandler = e.Tools.QueueNewFrame(t._bindedRenderFunction), i()
                        }, this._onVrDisplayPresentChange = function() {
                            t._vrExclusivePointerMode = t._vrDisplay && t._vrDisplay.isPresenting
                        }, window.addEventListener("vrdisplayconnect", this._onVrDisplayConnect), window.addEventListener("vrdisplaydisconnect", this._onVrDisplayDisconnect), window.addEventListener("vrdisplaypresentchange", this._onVrDisplayPresentChange)), this._webVRInitPromise = this._webVRInitPromise || this._getVRDisplaysAsync(), this._webVRInitPromise.then(i), this._webVRInitPromise
                    }, i.prototype.enableVR = function() {
                        var e = this;
                        this._vrDisplay && !this._vrDisplay.isPresenting && (this.onVRRequestPresentStart.notifyObservers(this), this._vrDisplay.requestPresent([{
                            source: this.getRenderingCanvas()
                        }]).then(function() {
                            e.onVRRequestPresentComplete.notifyObservers(!0), e._onVRFullScreenTriggered()
                        }).catch(function() {
                            e.onVRRequestPresentComplete.notifyObservers(!1)
                        }))
                    }, i.prototype.disableVR = function() {
                        this._vrDisplay && this._vrDisplay.isPresenting && this._vrDisplay.exitPresent().then(this._onVRFullScreenTriggered).catch(this._onVRFullScreenTriggered)
                    }, i.prototype._getVRDisplaysAsync = function() {
                        var e = this;
                        return new Promise(function(t, i) {
                            navigator.getVRDisplays ? navigator.getVRDisplays().then(function(i) {
                                e._vrSupported = !0, e._vrDisplay = i[0], t({
                                    vrDisplay: e._vrDisplay,
                                    vrSupported: e._vrSupported
                                })
                            }) : (e._vrDisplay = void 0, e._vrSupported = !1, t({
                                vrDisplay: e._vrDisplay,
                                vrSupported: e._vrSupported
                            }))
                        })
                    }, i.prototype.bindFramebuffer = function(e, t, i, r, n, o, s) {
                        void 0 === s && (s = 0), this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = e, this.bindUnboundFramebuffer(e._MSAAFramebuffer ? e._MSAAFramebuffer : e._framebuffer);
                        var a = this._gl;
                        e.isCube && (void 0 === t && (t = 0), a.framebufferTexture2D(a.FRAMEBUFFER, a.COLOR_ATTACHMENT0, a.TEXTURE_CUBE_MAP_POSITIVE_X + t, e._webGLTexture, s), o && (o._generateStencilBuffer ? a.framebufferTexture2D(a.FRAMEBUFFER, a.DEPTH_STENCIL_ATTACHMENT, a.TEXTURE_CUBE_MAP_POSITIVE_X + t, o._webGLTexture, s) : a.framebufferTexture2D(a.FRAMEBUFFER, a.DEPTH_ATTACHMENT, a.TEXTURE_CUBE_MAP_POSITIVE_X + t, o._webGLTexture, s))), this._cachedViewport && !n ? this.setViewport(this._cachedViewport, i, r) : (i || (i = e.width, s && (i /= Math.pow(2, s))), r || (r = e.height, s && (r /= Math.pow(2, s))), this._viewport(0, 0, i, r)), this.wipeCaches()
                    }, i.prototype.bindUnboundFramebuffer = function(e) {
                        this._currentFramebuffer !== e && (this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, e), this._currentFramebuffer = e)
                    }, i.prototype.unBindFramebuffer = function(e, t, i) {
                        void 0 === t && (t = !1), this._currentRenderTarget = null;
                        var r = this._gl;
                        e._MSAAFramebuffer && (r.bindFramebuffer(r.READ_FRAMEBUFFER, e._MSAAFramebuffer), r.bindFramebuffer(r.DRAW_FRAMEBUFFER, e._framebuffer), r.blitFramebuffer(0, 0, e.width, e.height, 0, 0, e.width, e.height, r.COLOR_BUFFER_BIT, r.NEAREST)), !e.generateMipMaps || t || e.isCube || (this._bindTextureDirectly(r.TEXTURE_2D, e, !0), r.generateMipmap(r.TEXTURE_2D), this._bindTextureDirectly(r.TEXTURE_2D, null)), i && (e._MSAAFramebuffer && this.bindUnboundFramebuffer(e._framebuffer), i()), this.bindUnboundFramebuffer(null)
                    }, i.prototype.unBindMultiColorAttachmentFramebuffer = function(e, t, i) {
                        void 0 === t && (t = !1), this._currentRenderTarget = null;
                        var r = this._gl;
                        if (e[0]._MSAAFramebuffer) {
                            r.bindFramebuffer(r.READ_FRAMEBUFFER, e[0]._MSAAFramebuffer), r.bindFramebuffer(r.DRAW_FRAMEBUFFER, e[0]._framebuffer);
                            var n = e[0]._attachments;
                            n || (n = new Array(e.length), e[0]._attachments = n);
                            for (var o = 0; o < e.length; o++) {
                                for (var s = e[o], a = 0; a < n.length; a++) n[a] = r.NONE;
                                n[o] = r[1 < this.webGLVersion ? "COLOR_ATTACHMENT" + o : "COLOR_ATTACHMENT" + o + "_WEBGL"], r.readBuffer(n[o]), r.drawBuffers(n), r.blitFramebuffer(0, 0, s.width, s.height, 0, 0, s.width, s.height, r.COLOR_BUFFER_BIT, r.NEAREST)
                            }
                            for (o = 0; o < n.length; o++) n[o] = r[1 < this.webGLVersion ? "COLOR_ATTACHMENT" + o : "COLOR_ATTACHMENT" + o + "_WEBGL"];
                            r.drawBuffers(n)
                        }
                        for (o = 0; o < e.length; o++) !(s = e[o]).generateMipMaps || t || s.isCube || (this._bindTextureDirectly(r.TEXTURE_2D, s), r.generateMipmap(r.TEXTURE_2D), this._bindTextureDirectly(r.TEXTURE_2D, null));
                        i && (e[0]._MSAAFramebuffer && this.bindUnboundFramebuffer(e[0]._framebuffer), i()), this.bindUnboundFramebuffer(null)
                    }, i.prototype.generateMipMapsForCubemap = function(e) {
                        if (e.generateMipMaps) {
                            var t = this._gl;
                            this._bindTextureDirectly(t.TEXTURE_CUBE_MAP, e, !0), t.generateMipmap(t.TEXTURE_CUBE_MAP), this._bindTextureDirectly(t.TEXTURE_CUBE_MAP, null)
                        }
                    }, i.prototype.flushFramebuffer = function() {
                        this._gl.flush()
                    }, i.prototype.restoreDefaultFramebuffer = function() {
                        this._currentRenderTarget ? this.unBindFramebuffer(this._currentRenderTarget) : this.bindUnboundFramebuffer(null), this._cachedViewport && this.setViewport(this._cachedViewport), this.wipeCaches()
                    }, i.prototype.createUniformBuffer = function(e) {
                        var t = this._gl.createBuffer();
                        if (!t) throw new Error("Unable to create uniform buffer");
                        return this.bindUniformBuffer(t), e instanceof Float32Array ? this._gl.bufferData(this._gl.UNIFORM_BUFFER, e, this._gl.STATIC_DRAW) : this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(e), this._gl.STATIC_DRAW), this.bindUniformBuffer(null), t.references = 1, t
                    }, i.prototype.createDynamicUniformBuffer = function(e) {
                        var t = this._gl.createBuffer();
                        if (!t) throw new Error("Unable to create dynamic uniform buffer");
                        return this.bindUniformBuffer(t), e instanceof Float32Array ? this._gl.bufferData(this._gl.UNIFORM_BUFFER, e, this._gl.DYNAMIC_DRAW) : this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(e), this._gl.DYNAMIC_DRAW), this.bindUniformBuffer(null), t.references = 1, t
                    }, i.prototype.updateUniformBuffer = function(e, t, i, r) {
                        this.bindUniformBuffer(e), void 0 === i && (i = 0), void 0 === r ? t instanceof Float32Array ? this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, i, t) : this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, i, new Float32Array(t)) : t instanceof Float32Array ? this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, t.subarray(i, i + r)) : this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, new Float32Array(t).subarray(i, i + r)), this.bindUniformBuffer(null)
                    }, i.prototype._resetVertexBufferBinding = function() {
                        this.bindArrayBuffer(null), this._cachedVertexBuffers = null
                    }, i.prototype.createVertexBuffer = function(e) {
                        var t = this._gl.createBuffer();
                        if (!t) throw new Error("Unable to create vertex buffer");
                        return this.bindArrayBuffer(t), e instanceof Array ? this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(e), this._gl.STATIC_DRAW) : this._gl.bufferData(this._gl.ARRAY_BUFFER, e, this._gl.STATIC_DRAW), this._resetVertexBufferBinding(), t.references = 1, t
                    }, i.prototype.createDynamicVertexBuffer = function(e) {
                        var t = this._gl.createBuffer();
                        if (!t) throw new Error("Unable to create dynamic vertex buffer");
                        return this.bindArrayBuffer(t), e instanceof Array ? this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(e), this._gl.DYNAMIC_DRAW) : this._gl.bufferData(this._gl.ARRAY_BUFFER, e, this._gl.DYNAMIC_DRAW), this._resetVertexBufferBinding(), t.references = 1, t
                    }, i.prototype.updateDynamicIndexBuffer = function(e, t, i) {
                        var r;
                        void 0 === i && (i = 0), this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER] = null, this.bindIndexBuffer(e), r = t instanceof Uint16Array || t instanceof Uint32Array ? t : e.is32Bits ? new Uint32Array(t) : new Uint16Array(t), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, r, this._gl.DYNAMIC_DRAW), this._resetIndexBufferBinding()
                    }, i.prototype.updateDynamicVertexBuffer = function(e, t, i, r) {
                        this.bindArrayBuffer(e), void 0 === i && (i = 0), void 0 === r ? t instanceof Array ? this._gl.bufferSubData(this._gl.ARRAY_BUFFER, i, new Float32Array(t)) : this._gl.bufferSubData(this._gl.ARRAY_BUFFER, i, t) : t instanceof Array ? this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, new Float32Array(t).subarray(i, i + r)) : (t = t instanceof ArrayBuffer ? new Uint8Array(t, i, r) : new Uint8Array(t.buffer, t.byteOffset + i, r), this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, t)), this._resetVertexBufferBinding()
                    }, i.prototype._resetIndexBufferBinding = function() {
                        this.bindIndexBuffer(null), this._cachedIndexBuffer = null
                    }, i.prototype.createIndexBuffer = function(e, t) {
                        var i, r = this._gl.createBuffer();
                        if (!r) throw new Error("Unable to create index buffer");
                        this.bindIndexBuffer(r);
                        var n = !1;
                        if (e instanceof Uint16Array) i = e;
                        else if (this._caps.uintIndices)
                            if (e instanceof Uint32Array) i = e, n = !0;
                            else {
                                for (var o = 0; o < e.length; o++)
                                    if (65535 < e[o]) {
                                        n = !0;
                                        break
                                    }
                                i = n ? new Uint32Array(e) : new Uint16Array(e)
                            }
                        else i = new Uint16Array(e);
                        return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, i, t ? this._gl.DYNAMIC_DRAW : this._gl.STATIC_DRAW), this._resetIndexBufferBinding(), r.references = 1, r.is32Bits = n, r
                    }, i.prototype.bindArrayBuffer = function(e) {
                        this._vaoRecordInProgress || this._unbindVertexArrayObject(), this.bindBuffer(e, this._gl.ARRAY_BUFFER)
                    }, i.prototype.bindUniformBuffer = function(e) {
                        this._gl.bindBuffer(this._gl.UNIFORM_BUFFER, e)
                    }, i.prototype.bindUniformBufferBase = function(e, t) {
                        this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER, t, e)
                    }, i.prototype.bindUniformBlock = function(e, t, i) {
                        var r = this._gl.getUniformBlockIndex(e, t);
                        this._gl.uniformBlockBinding(e, r, i)
                    }, i.prototype.bindIndexBuffer = function(e) {
                        this._vaoRecordInProgress || this._unbindVertexArrayObject(), this.bindBuffer(e, this._gl.ELEMENT_ARRAY_BUFFER)
                    }, i.prototype.bindBuffer = function(e, t) {
                        (this._vaoRecordInProgress || this._currentBoundBuffer[t] !== e) && (this._gl.bindBuffer(t, e), this._currentBoundBuffer[t] = e)
                    }, i.prototype.updateArrayBuffer = function(e) {
                        this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, e)
                    }, i.prototype._vertexAttribPointer = function(e, t, i, r, n, o, s) {
                        var a = this._currentBufferPointers[t],
                            l = !1;
                        a.active ? (a.buffer !== e && (a.buffer = e, l = !0), a.size !== i && (a.size = i, l = !0), a.type !== r && (a.type = r, l = !0), a.normalized !== n && (a.normalized = n, l = !0), a.stride !== o && (a.stride = o, l = !0), a.offset !== s && (a.offset = s, l = !0)) : (l = !0, a.active = !0, a.index = t, a.size = i, a.type = r, a.normalized = n, a.stride = o, a.offset = s, a.buffer = e), (l || this._vaoRecordInProgress) && (this.bindArrayBuffer(e), this._gl.vertexAttribPointer(t, i, r, n, o, s))
                    }, i.prototype._bindIndexBufferWithCache = function(e) {
                        null != e && this._cachedIndexBuffer !== e && (this._cachedIndexBuffer = e, this.bindIndexBuffer(e), this._uintIndicesCurrentlySet = e.is32Bits)
                    }, i.prototype._bindVertexBuffersAttributes = function(e, t) {
                        var i = t.getAttributesNames();
                        this._vaoRecordInProgress || this._unbindVertexArrayObject(), this.unbindAllAttributes();
                        for (var r = 0; r < i.length; r++) {
                            var n = t.getAttributeLocation(r);
                            if (0 <= n) {
                                var o = e[i[r]];
                                if (!o) continue;
                                this._gl.enableVertexAttribArray(n), this._vaoRecordInProgress || (this._vertexAttribArraysEnabled[n] = !0);
                                var s = o.getBuffer();
                                s && (this._vertexAttribPointer(s, n, o.getSize(), o.type, o.normalized, o.byteStride, o.byteOffset), o.getIsInstanced() && (this._gl.vertexAttribDivisor(n, o.getInstanceDivisor()), this._vaoRecordInProgress || (this._currentInstanceLocations.push(n), this._currentInstanceBuffers.push(s))))
                            }
                        }
                    }, i.prototype.recordVertexArrayObject = function(e, t, i) {
                        var r = this._gl.createVertexArray();
                        return this._vaoRecordInProgress = !0, this._gl.bindVertexArray(r), this._mustWipeVertexAttributes = !0, this._bindVertexBuffersAttributes(e, i), this.bindIndexBuffer(t), this._vaoRecordInProgress = !1, this._gl.bindVertexArray(null), r
                    }, i.prototype.bindVertexArrayObject = function(e, t) {
                        this._cachedVertexArrayObject !== e && (this._cachedVertexArrayObject = e, this._gl.bindVertexArray(e), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._uintIndicesCurrentlySet = null != t && t.is32Bits, this._mustWipeVertexAttributes = !0)
                    }, i.prototype.bindBuffersDirectly = function(e, t, i, r, n) {
                        if (this._cachedVertexBuffers !== e || this._cachedEffectForVertexBuffers !== n) {
                            this._cachedVertexBuffers = e;
                            var o = (this._cachedEffectForVertexBuffers = n).getAttributesCount();
                            this._unbindVertexArrayObject(), this.unbindAllAttributes();
                            for (var s = 0, a = 0; a < o; a++)
                                if (a < i.length) {
                                    var l = n.getAttributeLocation(a);
                                    0 <= l && (this._gl.enableVertexAttribArray(l), this._vertexAttribArraysEnabled[l] = !0, this._vertexAttribPointer(e, l, i[a], this._gl.FLOAT, !1, r, s)), s += 4 * i[a]
                                }
                        }
                        this._bindIndexBufferWithCache(t)
                    }, i.prototype._unbindVertexArrayObject = function() {
                        this._cachedVertexArrayObject && (this._cachedVertexArrayObject = null, this._gl.bindVertexArray(null))
                    }, i.prototype.bindBuffers = function(e, t, i) {
                        this._cachedVertexBuffers === e && this._cachedEffectForVertexBuffers === i || (this._cachedVertexBuffers = e, this._cachedEffectForVertexBuffers = i, this._bindVertexBuffersAttributes(e, i)), this._bindIndexBufferWithCache(t)
                    }, i.prototype.unbindInstanceAttributes = function() {
                        for (var e, t = 0, i = this._currentInstanceLocations.length; t < i; t++) {
                            var r = this._currentInstanceBuffers[t];
                            e != r && r.references && (e = r, this.bindArrayBuffer(r));
                            var n = this._currentInstanceLocations[t];
                            this._gl.vertexAttribDivisor(n, 0)
                        }
                        this._currentInstanceBuffers.length = 0, this._currentInstanceLocations.length = 0
                    }, i.prototype.releaseVertexArrayObject = function(e) {
                        this._gl.deleteVertexArray(e)
                    }, i.prototype._releaseBuffer = function(e) {
                        return 0 === --e.references && (this._gl.deleteBuffer(e), !0)
                    }, i.prototype.createInstancesBuffer = function(e) {
                        var t = this._gl.createBuffer();
                        if (!t) throw new Error("Unable to create instance buffer");
                        return t.capacity = e, this.bindArrayBuffer(t), this._gl.bufferData(this._gl.ARRAY_BUFFER, e, this._gl.DYNAMIC_DRAW), t
                    }, i.prototype.deleteInstancesBuffer = function(e) {
                        this._gl.deleteBuffer(e)
                    }, i.prototype.updateAndBindInstancesBuffer = function(e, t, i) {
                        if (this.bindArrayBuffer(e), t && this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, t), void 0 !== i[0].index) {
                            for (var r = 0, n = 0; n < i.length; n++) r += 4 * (o = i[n]).attributeSize;
                            for (n = 0; n < i.length; n++) {
                                var o = i[n];
                                this._vertexAttribArraysEnabled[o.index] || (this._gl.enableVertexAttribArray(o.index), this._vertexAttribArraysEnabled[o.index] = !0), this._vertexAttribPointer(e, o.index, o.attributeSize, o.attribyteType || this._gl.FLOAT, o.normalized || !1, r, o.offset), this._gl.vertexAttribDivisor(o.index, 1), this._currentInstanceLocations.push(o.index), this._currentInstanceBuffers.push(e)
                            }
                        } else
                            for (var s = 0; s < 4; s++) {
                                var a = i[s];
                                this._vertexAttribArraysEnabled[a] || (this._gl.enableVertexAttribArray(a), this._vertexAttribArraysEnabled[a] = !0), this._vertexAttribPointer(e, a, 4, this._gl.FLOAT, !1, 64, 16 * s), this._gl.vertexAttribDivisor(a, 1), this._currentInstanceLocations.push(a), this._currentInstanceBuffers.push(e)
                            }
                    }, i.prototype.applyStates = function() {
                        this._depthCullingState.apply(this._gl), this._stencilState.apply(this._gl), this._alphaState.apply(this._gl)
                    }, i.prototype.draw = function(t, i, r, n) {
                        this.drawElementsType(t ? e.Material.TriangleFillMode : e.Material.WireFrameFillMode, i, r, n)
                    }, i.prototype.drawPointClouds = function(t, i, r) {
                        this.drawArraysType(e.Material.PointFillMode, t, i, r)
                    }, i.prototype.drawUnIndexed = function(t, i, r, n) {
                        this.drawArraysType(t ? e.Material.TriangleFillMode : e.Material.WireFrameFillMode, i, r, n)
                    }, i.prototype.drawElementsType = function(e, t, i, r) {
                        this.applyStates(), this._drawCalls.addCount(1, !1);
                        var n = this._drawMode(e),
                            o = this._uintIndicesCurrentlySet ? this._gl.UNSIGNED_INT : this._gl.UNSIGNED_SHORT,
                            s = this._uintIndicesCurrentlySet ? 4 : 2;
                        r ? this._gl.drawElementsInstanced(n, i, o, t * s, r) : this._gl.drawElements(n, i, o, t * s)
                    }, i.prototype.drawArraysType = function(e, t, i, r) {
                        this.applyStates(), this._drawCalls.addCount(1, !1);
                        var n = this._drawMode(e);
                        r ? this._gl.drawArraysInstanced(n, t, i, r) : this._gl.drawArrays(n, t, i)
                    }, i.prototype._drawMode = function(t) {
                        switch (t) {
                            case e.Material.TriangleFillMode:
                                return this._gl.TRIANGLES;
                            case e.Material.PointFillMode:
                                return this._gl.POINTS;
                            case e.Material.WireFrameFillMode:
                                return this._gl.LINES;
                            case e.Material.PointListDrawMode:
                                return this._gl.POINTS;
                            case e.Material.LineListDrawMode:
                                return this._gl.LINES;
                            case e.Material.LineLoopDrawMode:
                                return this._gl.LINE_LOOP;
                            case e.Material.LineStripDrawMode:
                                return this._gl.LINE_STRIP;
                            case e.Material.TriangleStripDrawMode:
                                return this._gl.TRIANGLE_STRIP;
                            case e.Material.TriangleFanDrawMode:
                                return this._gl.TRIANGLE_FAN;
                            default:
                                return this._gl.TRIANGLES
                        }
                    }, i.prototype._releaseEffect = function(e) {
                        this._compiledEffects[e._key] && (delete this._compiledEffects[e._key], this._deleteProgram(e.getProgram()))
                    }, i.prototype._deleteProgram = function(e) {
                        e && (e.__SPECTOR_rebuildProgram = null, e.transformFeedback && (this.deleteTransformFeedback(e.transformFeedback), e.transformFeedback = null), this._gl.deleteProgram(e))
                    }, i.prototype.createEffect = function(t, i, r, n, o, s, a, l, u) {
                        var c = (t.vertexElement || t.vertex || t) + "+" + (t.fragmentElement || t.fragment || t) + "@" + (o || i.defines);
                        if (this._compiledEffects[c]) {
                            var h = this._compiledEffects[c];
                            return a && h.isReady() && a(h), h
                        }
                        var d = new e.Effect(t, i, r, n, this, o, s, a, l, u);
                        return d._key = c, this._compiledEffects[c] = d
                    }, i.prototype._compileShader = function(e, t, i, r) {
                        return this._compileRawShader(r + (i ? i + "\n" : "") + e, t)
                    }, i.prototype._compileRawShader = function(e, t) {
                        var i = this._gl,
                            r = i.createShader("vertex" === t ? i.VERTEX_SHADER : i.FRAGMENT_SHADER);
                        if (!r) throw new Error("Something went wrong while compile the shader.");
                        if (i.shaderSource(r, e), i.compileShader(r), !i.getShaderParameter(r, i.COMPILE_STATUS)) {
                            var n = i.getShaderInfoLog(r);
                            if (n) throw new Error(n)
                        }
                        return r
                    }, i.prototype.createRawShaderProgram = function(e, t, i, r) {
                        void 0 === r && (r = null), i = i || this._gl;
                        var n = this._compileRawShader(e, "vertex"),
                            o = this._compileRawShader(t, "fragment");
                        return this._createShaderProgram(n, o, i, r)
                    }, i.prototype.createShaderProgram = function(e, t, i, r, n) {
                        void 0 === n && (n = null), r = r || this._gl, this.onBeforeShaderCompilationObservable.notifyObservers(this);
                        var o = 1 < this._webGLVersion ? "#version 300 es\n#define WEBGL2 \n" : "",
                            s = this._compileShader(e, "vertex", i, o),
                            a = this._compileShader(t, "fragment", i, o),
                            l = this._createShaderProgram(s, a, r, n);
                        return this.onAfterShaderCompilationObservable.notifyObservers(this), l
                    }, i.prototype._createShaderProgram = function(e, t, i, r) {
                        void 0 === r && (r = null);
                        var n, o = i.createProgram();
                        if (!o) throw new Error("Unable to create program");
                        if (i.attachShader(o, e), i.attachShader(o, t), 1 < this.webGLVersion && r) {
                            var s = this.createTransformFeedback();
                            this.bindTransformFeedback(s), this.setTranformFeedbackVaryings(o, r), o.transformFeedback = s
                        }
                        if (i.linkProgram(o), 1 < this.webGLVersion && r && this.bindTransformFeedback(null), !i.getProgramParameter(o, i.LINK_STATUS) && (n = i.getProgramInfoLog(o))) throw new Error(n);
                        if (this.validateShaderPrograms && (i.validateProgram(o), !i.getProgramParameter(o, i.VALIDATE_STATUS) && (n = i.getProgramInfoLog(o)))) throw new Error(n);
                        return i.deleteShader(e), i.deleteShader(t), o
                    }, i.prototype.getUniforms = function(e, t) {
                        for (var i = new Array, r = 0; r < t.length; r++) i.push(this._gl.getUniformLocation(e, t[r]));
                        return i
                    }, i.prototype.getAttributes = function(e, t) {
                        for (var i = [], r = 0; r < t.length; r++) try {
                            i.push(this._gl.getAttribLocation(e, t[r]))
                        } catch (e) {
                            i.push(-1)
                        }
                        return i
                    }, i.prototype.enableEffect = function(e) {
                        e && e !== this._currentEffect && (this.bindSamplers(e), (this._currentEffect = e).onBind && e.onBind(e), e._onBindObservable && e._onBindObservable.notifyObservers(e))
                    }, i.prototype.setIntArray = function(e, t) {
                        e && this._gl.uniform1iv(e, t)
                    }, i.prototype.setIntArray2 = function(e, t) {
                        e && t.length % 2 == 0 && this._gl.uniform2iv(e, t)
                    }, i.prototype.setIntArray3 = function(e, t) {
                        e && t.length % 3 == 0 && this._gl.uniform3iv(e, t)
                    }, i.prototype.setIntArray4 = function(e, t) {
                        e && t.length % 4 == 0 && this._gl.uniform4iv(e, t)
                    }, i.prototype.setFloatArray = function(e, t) {
                        e && this._gl.uniform1fv(e, t)
                    }, i.prototype.setFloatArray2 = function(e, t) {
                        e && t.length % 2 == 0 && this._gl.uniform2fv(e, t)
                    }, i.prototype.setFloatArray3 = function(e, t) {
                        e && t.length % 3 == 0 && this._gl.uniform3fv(e, t)
                    }, i.prototype.setFloatArray4 = function(e, t) {
                        e && t.length % 4 == 0 && this._gl.uniform4fv(e, t)
                    }, i.prototype.setArray = function(e, t) {
                        e && this._gl.uniform1fv(e, t)
                    }, i.prototype.setArray2 = function(e, t) {
                        e && t.length % 2 == 0 && this._gl.uniform2fv(e, t)
                    }, i.prototype.setArray3 = function(e, t) {
                        e && t.length % 3 == 0 && this._gl.uniform3fv(e, t)
                    }, i.prototype.setArray4 = function(e, t) {
                        e && t.length % 4 == 0 && this._gl.uniform4fv(e, t)
                    }, i.prototype.setMatrices = function(e, t) {
                        e && this._gl.uniformMatrix4fv(e, !1, t)
                    }, i.prototype.setMatrix = function(e, t) {
                        e && this._gl.uniformMatrix4fv(e, !1, t.toArray())
                    }, i.prototype.setMatrix3x3 = function(e, t) {
                        e && this._gl.uniformMatrix3fv(e, !1, t)
                    }, i.prototype.setMatrix2x2 = function(e, t) {
                        e && this._gl.uniformMatrix2fv(e, !1, t)
                    }, i.prototype.setInt = function(e, t) {
                        e && this._gl.uniform1i(e, t)
                    }, i.prototype.setFloat = function(e, t) {
                        e && this._gl.uniform1f(e, t)
                    }, i.prototype.setFloat2 = function(e, t, i) {
                        e && this._gl.uniform2f(e, t, i)
                    }, i.prototype.setFloat3 = function(e, t, i, r) {
                        e && this._gl.uniform3f(e, t, i, r)
                    }, i.prototype.setBool = function(e, t) {
                        e && this._gl.uniform1i(e, t)
                    }, i.prototype.setFloat4 = function(e, t, i, r, n) {
                        e && this._gl.uniform4f(e, t, i, r, n)
                    }, i.prototype.setColor3 = function(e, t) {
                        e && this._gl.uniform3f(e, t.r, t.g, t.b)
                    }, i.prototype.setColor4 = function(e, t, i) {
                        e && this._gl.uniform4f(e, t.r, t.g, t.b, i)
                    }, i.prototype.setDirectColor4 = function(e, t) {
                        e && this._gl.uniform4f(e, t.r, t.g, t.b, t.a)
                    }, i.prototype.setState = function(e, t, i, r) {
                        void 0 === t && (t = 0), void 0 === r && (r = !1), (this._depthCullingState.cull !== e || i) && (this._depthCullingState.cull = e);
                        var n = this.cullBackFaces ? this._gl.BACK : this._gl.FRONT;
                        (this._depthCullingState.cullFace !== n || i) && (this._depthCullingState.cullFace = n), this.setZOffset(t);
                        var o = r ? this._gl.CW : this._gl.CCW;
                        (this._depthCullingState.frontFace !== o || i) && (this._depthCullingState.frontFace = o)
                    }, i.prototype.setZOffset = function(e) {
                        this._depthCullingState.zOffset = e
                    }, i.prototype.getZOffset = function() {
                        return this._depthCullingState.zOffset
                    }, i.prototype.setDepthBuffer = function(e) {
                        this._depthCullingState.depthTest = e
                    }, i.prototype.getDepthWrite = function() {
                        return this._depthCullingState.depthMask
                    }, i.prototype.setDepthWrite = function(e) {
                        this._depthCullingState.depthMask = e
                    }, i.prototype.setColorWrite = function(e) {
                        this._gl.colorMask(e, e, e, e), this._colorWrite = e
                    }, i.prototype.getColorWrite = function() {
                        return this._colorWrite
                    }, i.prototype.setAlphaConstants = function(e, t, i, r) {
                        this._alphaState.setAlphaBlendConstants(e, t, i, r)
                    }, i.prototype.setAlphaMode = function(e, t) {
                        if (void 0 === t && (t = !1), this._alphaMode !== e) {
                            switch (e) {
                                case i.ALPHA_DISABLE:
                                    this._alphaState.alphaBlend = !1;
                                    break;
                                case i.ALPHA_PREMULTIPLIED:
                                    this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;
                                    break;
                                case i.ALPHA_PREMULTIPLIED_PORTERDUFF:
                                    this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;
                                    break;
                                case i.ALPHA_COMBINE:
                                    this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;
                                    break;
                                case i.ALPHA_ONEONE:
                                    this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0;
                                    break;
                                case i.ALPHA_ADD:
                                    this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0;
                                    break;
                                case i.ALPHA_SUBTRACT:
                                    this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;
                                    break;
                                case i.ALPHA_MULTIPLY:
                                    this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;
                                    break;
                                case i.ALPHA_MAXIMIZED:
                                    this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;
                                    break;
                                case i.ALPHA_INTERPOLATE:
                                    this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA), this._alphaState.alphaBlend = !0;
                                    break;
                                case i.ALPHA_SCREENMODE:
                                    this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0
                            }
                            t || this.setDepthWrite(e === i.ALPHA_DISABLE), this._alphaMode = e
                        }
                    }, i.prototype.getAlphaMode = function() {
                        return this._alphaMode
                    }, i.prototype.clearInternalTexturesCache = function() {
                        this._internalTexturesCache = []
                    }, i.prototype.wipeCaches = function(e) {
                        this.preventCacheWipeBetweenFrames && !e || (this._currentEffect = null, this._viewportCached.x = 0, this._viewportCached.y = 0, this._viewportCached.z = 0, this._viewportCached.w = 0, e && (this.resetTextureCache(), this._currentProgram = null, this._stencilState.reset(), this._depthCullingState.reset(), this.setDepthFunctionToLessOrEqual(), this._alphaState.reset(), this._unpackFlipYCached = null), this._resetVertexBufferBinding(), this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null, this._unbindVertexArrayObject(), this.bindIndexBuffer(null))
                    }, i.prototype.setTextureFormatToUse = function(e) {
                        for (var t = 0, i = this.texturesSupported.length; t < i; t++)
                            for (var r = 0, n = e.length; r < n; r++)
                                if (this._texturesSupported[t] === e[r].toLowerCase()) return this._textureFormatInUse = this._texturesSupported[t];
                        return this._textureFormatInUse = null
                    }, i.prototype._getSamplingParameters = function(e, t) {
                        var r = this._gl,
                            n = r.NEAREST,
                            o = r.NEAREST;
                        switch (e) {
                            case i.TEXTURE_BILINEAR_SAMPLINGMODE:
                                n = r.LINEAR, o = t ? r.LINEAR_MIPMAP_NEAREST : r.LINEAR;
                                break;
                            case i.TEXTURE_TRILINEAR_SAMPLINGMODE:
                                n = r.LINEAR, o = t ? r.LINEAR_MIPMAP_LINEAR : r.LINEAR;
                                break;
                            case i.TEXTURE_NEAREST_SAMPLINGMODE:
                                n = r.NEAREST, o = t ? r.NEAREST_MIPMAP_LINEAR : r.NEAREST;
                                break;
                            case i.TEXTURE_NEAREST_NEAREST_MIPNEAREST:
                                n = r.NEAREST, o = t ? r.NEAREST_MIPMAP_NEAREST : r.NEAREST;
                                break;
                            case i.TEXTURE_NEAREST_LINEAR_MIPNEAREST:
                                n = r.NEAREST, o = t ? r.LINEAR_MIPMAP_NEAREST : r.LINEAR;
                                break;
                            case i.TEXTURE_NEAREST_LINEAR_MIPLINEAR:
                                n = r.NEAREST, o = t ? r.LINEAR_MIPMAP_LINEAR : r.LINEAR;
                                break;
                            case i.TEXTURE_NEAREST_LINEAR:
                                n = r.NEAREST, o = r.LINEAR;
                                break;
                            case i.TEXTURE_NEAREST_NEAREST:
                                n = r.NEAREST, o = r.NEAREST;
                                break;
                            case i.TEXTURE_LINEAR_NEAREST_MIPNEAREST:
                                n = r.LINEAR, o = t ? r.NEAREST_MIPMAP_NEAREST : r.NEAREST;
                                break;
                            case i.TEXTURE_LINEAR_NEAREST_MIPLINEAR:
                                n = r.LINEAR, o = t ? r.NEAREST_MIPMAP_LINEAR : r.NEAREST;
                                break;
                            case i.TEXTURE_LINEAR_LINEAR:
                                n = r.LINEAR, o = r.LINEAR;
                                break;
                            case i.TEXTURE_LINEAR_NEAREST:
                                n = r.LINEAR, o = r.NEAREST
                        }
                        return {
                            min: o,
                            mag: n
                        }
                    }, i.prototype._partialLoadImg = function(t, i, r, n, o, s) {
                        var a;
                        void 0 === s && (s = null), a = e.Tools.LoadImage(t, function() {
                            r[i] = a, r._internalCount++, n && n._removePendingData(a), 6 === r._internalCount && o(r)
                        }, function(e, t) {
                            n && n._removePendingData(a), s && s(e, t)
                        }, n ? n.database : null), n && n._addPendingData(a)
                    }, i.prototype._cascadeLoadImgs = function(e, t, i, r, n) {
                        void 0 === n && (n = null);
                        for (var o = [], s = o._internalCount = 0; s < 6; s++) this._partialLoadImg(r[s], s, o, t, i, n)
                    }, i.prototype._createTexture = function() {
                        var e = this._gl.createTexture();
                        if (!e) throw new Error("Unable to create texture");
                        return e
                    }, i.prototype.createTexture = function(t, r, n, o, s, a, l, u, c, h, d) {
                        var p = this;
                        void 0 === s && (s = i.TEXTURE_TRILINEAR_SAMPLINGMODE), void 0 === a && (a = null), void 0 === l && (l = null), void 0 === u && (u = null), void 0 === c && (c = null), void 0 === h && (h = null), void 0 === d && (d = null);
                        for (var f = String(t), _ = "data:" === f.substr(0, 5), m = "blob:" === f.substr(0, 5), g = _ && -1 !== f.indexOf(";base64,"), v = c || new e.InternalTexture(this, e.InternalTexture.DATASOURCE_URL), y = f.lastIndexOf("."), b = d || (-1 < y ? f.substring(y).toLowerCase() : ""), x = null, T = 0, E = i._TextureLoaders; T < E.length; T++) {
                            var S = E[T];
                            if (S.canLoad(b, this._textureFormatInUse, c, g, !!u)) {
                                x = S;
                                break
                            }
                        }
                        x && (f = x.transformUrl(f, this._textureFormatInUse)), o && o._addPendingData(v), v.url = f, v.generateMipMaps = !r, v.samplingMode = s, v.invertY = n, this._doNotHandleContextLost || (v._buffer = u);
                        var P = null;
                        a && !c && (P = v.onLoadedObservable.add(a)), c || this._internalTexturesCache.push(v);
                        var A = function(i, a) {
                            o && o._removePendingData(v);
                            var c = !1;
                            x && x.getFallbackTextureUrl(f, p._textureFormatInUse) && (c = !0, p.createTexture(t, r, n, o, s, null, l, u, v)), c || (P && v.onLoadedObservable.remove(P), e.Tools.UseFallbackTexture && p.createTexture(e.Tools.fallbackTexture, r, n, o, s, null, l, u, v)), l && l(i || "Unknown error", a)
                        };
                        if (x) {
                            var C = function(e) {
                                x.loadData(e, v, function(e, t, i, r, a) {
                                    p._prepareWebGLTexture(v, o, e, t, n, !i, r, function() {
                                        return a(), !1
                                    }, s)
                                })
                            };
                            u ? C(u) : this._loadFile(f, C, void 0, o ? o.database : void 0, !0, function(e, t) {
                                A("Unable to load " + (e && e.responseURL, t))
                            })
                        } else {
                            var M = function(t) {
                                m && !p._doNotHandleContextLost && (v._buffer = t), p._prepareWebGLTexture(v, o, t.width, t.height, n, r, !1, function(i, r, n) {
                                    var s = p._gl,
                                        a = t.width === i && t.height === r,
                                        l = h ? p._getInternalFormat(h) : ".jpg" === b ? s.RGB : s.RGBA;
                                    if (a) return s.texImage2D(s.TEXTURE_2D, 0, l, l, s.UNSIGNED_BYTE, t), !1;
                                    var u = p._caps.maxTextureSize;
                                    if (t.width > u || t.height > u) return p._prepareWorkingCanvas(), p._workingCanvas && p._workingContext && (p._workingCanvas.width = i, p._workingCanvas.height = r, p._workingContext.drawImage(t, 0, 0, t.width, t.height, 0, 0, i, r), s.texImage2D(s.TEXTURE_2D, 0, l, l, s.UNSIGNED_BYTE, p._workingCanvas), v.width = i, v.height = r), !1;
                                    var c = new e.InternalTexture(p, e.InternalTexture.DATASOURCE_TEMP);
                                    return p._bindTextureDirectly(s.TEXTURE_2D, c, !0), s.texImage2D(s.TEXTURE_2D, 0, l, l, s.UNSIGNED_BYTE, t), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, s.LINEAR), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, s.LINEAR), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, s.CLAMP_TO_EDGE), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, s.CLAMP_TO_EDGE), p._rescaleTexture(c, v, o, l, function() {
                                        p._releaseTexture(c), p._bindTextureDirectly(s.TEXTURE_2D, v, !0), n()
                                    }), !0
                                }, s)
                            };
                            !_ || g ? u instanceof HTMLImageElement ? M(u) : e.Tools.LoadImage(f, M, A, o ? o.database : null) : "string" == typeof u || u instanceof ArrayBuffer || u instanceof Blob ? e.Tools.LoadImage(u, M, A, o ? o.database : null) : M(u)
                        }
                        return v
                    }, i.prototype._rescaleTexture = function(t, r, n, o, s) {
                        var a = this,
                            l = this.createRenderTargetTexture({
                                width: r.width,
                                height: r.height
                            }, {
                                generateMipMaps: !1,
                                type: i.TEXTURETYPE_UNSIGNED_INT,
                                samplingMode: i.TEXTURE_BILINEAR_SAMPLINGMODE,
                                generateDepthBuffer: !1,
                                generateStencilBuffer: !1
                            });
                        this._rescalePostProcess || (this._rescalePostProcess = new e.PassPostProcess("rescale", 1, null, i.TEXTURE_BILINEAR_SAMPLINGMODE, this, !1, i.TEXTURETYPE_UNSIGNED_INT)), this._rescalePostProcess.getEffect().executeWhenCompiled(function() {
                            a._rescalePostProcess.onApply = function(e) {
                                e._bindTexture("textureSampler", t)
                            };
                            var e = n;
                            e || (e = a.scenes[a.scenes.length - 1]), e.postProcessManager.directRender([a._rescalePostProcess], l, !0), a._bindTextureDirectly(a._gl.TEXTURE_2D, r, !0), a._gl.copyTexImage2D(a._gl.TEXTURE_2D, 0, o, 0, 0, r.width, r.height, 0), a.unBindFramebuffer(l), a._releaseTexture(l), s && s()
                        })
                    }, i.prototype.updateRawTexture = function(e, t, r, n, o, s) {
                        if (void 0 === o && (o = null), void 0 === s && (s = i.TEXTURETYPE_UNSIGNED_INT), e) {
                            var a = this._getRGBABufferInternalSizedFormat(s, r),
                                l = this._getInternalFormat(r),
                                u = this._getWebGLTextureType(s);
                            this._bindTextureDirectly(this._gl.TEXTURE_2D, e, !0), this._unpackFlipY(void 0 === n || !!n), this._doNotHandleContextLost || (e._bufferView = t, e.format = r, e.type = s, e.invertY = n, e._compression = o), e.width % 4 != 0 && this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1), o && t ? this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this.getCaps().s3tc[o], e.width, e.height, 0, t) : this._gl.texImage2D(this._gl.TEXTURE_2D, 0, a, e.width, e.height, 0, l, u, t), e.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null), e.isReady = !0
                        }
                    }, i.prototype.createRawTexture = function(t, r, n, o, s, a, l, u, c) {
                        void 0 === u && (u = null), void 0 === c && (c = i.TEXTURETYPE_UNSIGNED_INT);
                        var h = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_RAW);
                        h.baseWidth = r, h.baseHeight = n, h.width = r, h.height = n, h.format = o, h.generateMipMaps = s, h.samplingMode = l, h.invertY = a, h._compression = u, h.type = c, this._doNotHandleContextLost || (h._bufferView = t), this.updateRawTexture(h, t, o, a, u, c), this._bindTextureDirectly(this._gl.TEXTURE_2D, h, !0);
                        var d = this._getSamplingParameters(l, s);
                        return this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, d.mag), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, d.min), s && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._internalTexturesCache.push(h), h
                    }, i.prototype._unpackFlipY = function(e) {
                        this._unpackFlipYCached !== e && (this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, e ? 1 : 0), this.enableUnpackFlipYCached && (this._unpackFlipYCached = e))
                    }, i.prototype._getUnpackAlignement = function() {
                        return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)
                    }, i.prototype.createDynamicTexture = function(t, i, r, n) {
                        var o = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_DYNAMIC);
                        return o.baseWidth = t, o.baseHeight = i, r && (t = this.needPOTTextures ? e.Tools.GetExponentOfTwo(t, this._caps.maxTextureSize) : t, i = this.needPOTTextures ? e.Tools.GetExponentOfTwo(i, this._caps.maxTextureSize) : i), o.width = t, o.height = i, o.isReady = !1, o.generateMipMaps = r, o.samplingMode = n, this.updateTextureSamplingMode(n, o), this._internalTexturesCache.push(o), o
                    }, i.prototype.updateTextureSamplingMode = function(e, t) {
                        var i = this._getSamplingParameters(e, t.generateMipMaps);
                        t.isCube ? (this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_MAG_FILTER, i.mag, t), this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_MIN_FILTER, i.min), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null)) : t.is3D ? (this._setTextureParameterInteger(this._gl.TEXTURE_3D, this._gl.TEXTURE_MAG_FILTER, i.mag, t), this._setTextureParameterInteger(this._gl.TEXTURE_3D, this._gl.TEXTURE_MIN_FILTER, i.min), this._bindTextureDirectly(this._gl.TEXTURE_3D, null)) : (this._setTextureParameterInteger(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, i.mag, t), this._setTextureParameterInteger(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, i.min), this._bindTextureDirectly(this._gl.TEXTURE_2D, null)), t.samplingMode = e
                    }, i.prototype.updateDynamicTexture = function(e, t, i, r, n) {
                        if (void 0 === r && (r = !1), e) {
                            this._bindTextureDirectly(this._gl.TEXTURE_2D, e, !0), this._unpackFlipY(i), r && this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);
                            var o = n ? this._getInternalFormat(n) : this._gl.RGBA;
                            this._gl.texImage2D(this._gl.TEXTURE_2D, 0, o, o, this._gl.UNSIGNED_BYTE, t), e.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null), r && this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0), e.isReady = !0
                        }
                    }, i.prototype.updateVideoTexture = function(e, t, i) {
                        if (e && !e._isDisabled) {
                            var r = this._bindTextureDirectly(this._gl.TEXTURE_2D, e, !0);
                            this._unpackFlipY(!i);
                            try {
                                if (void 0 === this._videoTextureSupported && (this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, t), 0 !== this._gl.getError() ? this._videoTextureSupported = !1 : this._videoTextureSupported = !0), this._videoTextureSupported) this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, t);
                                else {
                                    if (!e._workingCanvas) {
                                        e._workingCanvas = document.createElement("canvas");
                                        var n = e._workingCanvas.getContext("2d");
                                        if (!n) throw new Error("Unable to get 2d context");
                                        e._workingContext = n, e._workingCanvas.width = e.width, e._workingCanvas.height = e.height
                                    }
                                    e._workingContext.drawImage(t, 0, 0, t.videoWidth, t.videoHeight, 0, 0, e.width, e.height), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, e._workingCanvas)
                                }
                                e.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), r || this._bindTextureDirectly(this._gl.TEXTURE_2D, null), e.isReady = !0
                            } catch (t) {
                                e._isDisabled = !0
                            }
                        }
                    }, i.prototype.updateTextureComparisonFunction = function(t, r) {
                        if (1 !== this.webGLVersion) {
                            var n = this._gl;
                            t.isCube ? (this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, t, !0), 0 === r ? (n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_COMPARE_FUNC, i.LEQUAL), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_COMPARE_MODE, n.NONE)) : (n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_COMPARE_FUNC, r), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_COMPARE_MODE, n.COMPARE_REF_TO_TEXTURE)), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null)) : (this._bindTextureDirectly(this._gl.TEXTURE_2D, t, !0), 0 === r ? (n.texParameteri(n.TEXTURE_2D, n.TEXTURE_COMPARE_FUNC, i.LEQUAL), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_COMPARE_MODE, n.NONE)) : (n.texParameteri(n.TEXTURE_2D, n.TEXTURE_COMPARE_FUNC, r), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_COMPARE_MODE, n.COMPARE_REF_TO_TEXTURE)), this._bindTextureDirectly(this._gl.TEXTURE_2D, null)), t._comparisonFunction = r
                        } else e.Tools.Error("WebGL 1 does not support texture comparison.")
                    }, i.prototype._setupDepthStencilTexture = function(e, t, r, n, o) {
                        var s = t.width || t,
                            a = t.height || t;
                        e.baseWidth = s, e.baseHeight = a, e.width = s, e.height = a, e.isReady = !0, e.samples = 1, e.generateMipMaps = !1, e._generateDepthBuffer = !0, e._generateStencilBuffer = r, e.samplingMode = n ? i.TEXTURE_BILINEAR_SAMPLINGMODE : i.TEXTURE_NEAREST_SAMPLINGMODE, e.type = i.TEXTURETYPE_UNSIGNED_INT, e._comparisonFunction = o;
                        var l = this._gl,
                            u = e.isCube ? l.TEXTURE_CUBE_MAP : l.TEXTURE_2D,
                            c = this._getSamplingParameters(e.samplingMode, !1);
                        l.texParameteri(u, l.TEXTURE_MAG_FILTER, c.mag), l.texParameteri(u, l.TEXTURE_MIN_FILTER, c.min), l.texParameteri(u, l.TEXTURE_WRAP_S, l.CLAMP_TO_EDGE), l.texParameteri(u, l.TEXTURE_WRAP_T, l.CLAMP_TO_EDGE), 0 === o ? (l.texParameteri(u, l.TEXTURE_COMPARE_FUNC, i.LEQUAL), l.texParameteri(u, l.TEXTURE_COMPARE_MODE, l.NONE)) : (l.texParameteri(u, l.TEXTURE_COMPARE_FUNC, o), l.texParameteri(u, l.TEXTURE_COMPARE_MODE, l.COMPARE_REF_TO_TEXTURE))
                    }, i.prototype.createDepthStencilTexture = function(e, t) {
                        if (t.isCube) {
                            var i = e.width || e;
                            return this._createDepthStencilCubeTexture(i, t)
                        }
                        return this._createDepthStencilTexture(e, t)
                    }, i.prototype._createDepthStencilTexture = function(t, i) {
                        var r = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_DEPTHTEXTURE);
                        if (!this._caps.depthTextureExtension) return e.Tools.Error("Depth texture is not supported by your browser or hardware."), r;
                        var n = ae({
                                bilinearFiltering: !1,
                                comparisonFunction: 0,
                                generateStencil: !1
                            }, i),
                            o = this._gl;
                        return this._bindTextureDirectly(o.TEXTURE_2D, r, !0), this._setupDepthStencilTexture(r, t, n.generateStencil, n.bilinearFiltering, n.comparisonFunction), 1 < this.webGLVersion ? n.generateStencil ? o.texImage2D(o.TEXTURE_2D, 0, o.DEPTH24_STENCIL8, r.width, r.height, 0, o.DEPTH_STENCIL, o.UNSIGNED_INT_24_8, null) : o.texImage2D(o.TEXTURE_2D, 0, o.DEPTH_COMPONENT24, r.width, r.height, 0, o.DEPTH_COMPONENT, o.UNSIGNED_INT, null) : n.generateStencil ? o.texImage2D(o.TEXTURE_2D, 0, o.DEPTH_STENCIL, r.width, r.height, 0, o.DEPTH_STENCIL, o.UNSIGNED_INT_24_8, null) : o.texImage2D(o.TEXTURE_2D, 0, o.DEPTH_COMPONENT, r.width, r.height, 0, o.DEPTH_COMPONENT, o.UNSIGNED_INT, null), this._bindTextureDirectly(o.TEXTURE_2D, null), r
                    }, i.prototype._createDepthStencilCubeTexture = function(t, i) {
                        var r = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_UNKNOWN);
                        if (r.isCube = !0, 1 === this.webGLVersion) return e.Tools.Error("Depth cube texture is not supported by WebGL 1."), r;
                        var n = ae({
                                bilinearFiltering: !1,
                                comparisonFunction: 0,
                                generateStencil: !1
                            }, i),
                            o = this._gl;
                        this._bindTextureDirectly(o.TEXTURE_CUBE_MAP, r, !0), this._setupDepthStencilTexture(r, t, n.generateStencil, n.bilinearFiltering, n.comparisonFunction);
                        for (var s = 0; s < 6; s++) n.generateStencil ? o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X + s, 0, o.DEPTH24_STENCIL8, t, t, 0, o.DEPTH_STENCIL, o.UNSIGNED_INT_24_8, null) : o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X + s, 0, o.DEPTH_COMPONENT24, t, t, 0, o.DEPTH_COMPONENT, o.UNSIGNED_INT, null);
                        return this._bindTextureDirectly(o.TEXTURE_CUBE_MAP, null), r
                    }, i.prototype.setFrameBufferDepthStencilTexture = function(e) {
                        var t = e.getInternalTexture();
                        if (t && t._framebuffer && e.depthStencilTexture) {
                            var i = this._gl,
                                r = e.depthStencilTexture;
                            this.bindUnboundFramebuffer(t._framebuffer), r.isCube ? r._generateStencilBuffer ? i.framebufferTexture2D(i.FRAMEBUFFER, i.DEPTH_STENCIL_ATTACHMENT, i.TEXTURE_CUBE_MAP_POSITIVE_X, r._webGLTexture, 0) : i.framebufferTexture2D(i.FRAMEBUFFER, i.DEPTH_ATTACHMENT, i.TEXTURE_CUBE_MAP_POSITIVE_X, r._webGLTexture, 0) : r._generateStencilBuffer ? i.framebufferTexture2D(i.FRAMEBUFFER, i.DEPTH_STENCIL_ATTACHMENT, i.TEXTURE_2D, r._webGLTexture, 0) : i.framebufferTexture2D(i.FRAMEBUFFER, i.DEPTH_ATTACHMENT, i.TEXTURE_2D, r._webGLTexture, 0), this.bindUnboundFramebuffer(null)
                        }
                    }, i.prototype.createRenderTargetTexture = function(t, n) {
                        var o = new r;
                        void 0 !== n && "object" == typeof n ? (o.generateMipMaps = n.generateMipMaps, o.generateDepthBuffer = void 0 === n.generateDepthBuffer || n.generateDepthBuffer, o.generateStencilBuffer = o.generateDepthBuffer && n.generateStencilBuffer, o.type = void 0 === n.type ? i.TEXTURETYPE_UNSIGNED_INT : n.type, o.samplingMode = void 0 === n.samplingMode ? i.TEXTURE_TRILINEAR_SAMPLINGMODE : n.samplingMode, o.format = void 0 === n.format ? i.TEXTUREFORMAT_RGBA : n.format) : (o.generateMipMaps = n, o.generateDepthBuffer = !0, o.generateStencilBuffer = !1, o.type = i.TEXTURETYPE_UNSIGNED_INT, o.samplingMode = i.TEXTURE_TRILINEAR_SAMPLINGMODE, o.format = i.TEXTUREFORMAT_RGBA), (o.type !== i.TEXTURETYPE_FLOAT || this._caps.textureFloatLinearFiltering) && (o.type !== i.TEXTURETYPE_HALF_FLOAT || this._caps.textureHalfFloatLinearFiltering) || (o.samplingMode = i.TEXTURE_NEAREST_SAMPLINGMODE);
                        var s = this._gl,
                            a = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_RENDERTARGET);
                        this._bindTextureDirectly(s.TEXTURE_2D, a, !0);
                        var l = t.width || t,
                            u = t.height || t,
                            c = this._getSamplingParameters(o.samplingMode, !!o.generateMipMaps);
                        o.type !== i.TEXTURETYPE_FLOAT || this._caps.textureFloat || (o.type = i.TEXTURETYPE_UNSIGNED_INT, e.Tools.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type")), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, c.mag), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, c.min), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, s.CLAMP_TO_EDGE), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, s.CLAMP_TO_EDGE), s.texImage2D(s.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(o.type, o.format), l, u, 0, this._getInternalFormat(o.format), this._getWebGLTextureType(o.type), null);
                        var h = this._currentFramebuffer,
                            d = s.createFramebuffer();
                        return this.bindUnboundFramebuffer(d), s.framebufferTexture2D(s.FRAMEBUFFER, s.COLOR_ATTACHMENT0, s.TEXTURE_2D, a._webGLTexture, 0), a._depthStencilBuffer = this._setupFramebufferDepthAttachments(!!o.generateStencilBuffer, o.generateDepthBuffer, l, u), o.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(s.TEXTURE_2D, null), s.bindRenderbuffer(s.RENDERBUFFER, null), this.bindUnboundFramebuffer(h), a._framebuffer = d,
                            a.baseWidth = l, a.baseHeight = u, a.width = l, a.height = u, a.isReady = !0, a.samples = 1, a.generateMipMaps = !!o.generateMipMaps, a.samplingMode = o.samplingMode, a.type = o.type, a.format = o.format, a._generateDepthBuffer = o.generateDepthBuffer, a._generateStencilBuffer = !!o.generateStencilBuffer, this._internalTexturesCache.push(a), a
                    }, i.prototype.createMultipleRenderTarget = function(t, r) {
                        var n = !1,
                            o = !0,
                            s = !1,
                            a = !1,
                            l = 1,
                            u = i.TEXTURETYPE_UNSIGNED_INT,
                            c = i.TEXTURE_TRILINEAR_SAMPLINGMODE,
                            h = new Array,
                            d = new Array;
                        void 0 !== r && (n = void 0 !== r.generateMipMaps && r.generateMipMaps, o = void 0 === r.generateDepthBuffer || r.generateDepthBuffer, s = void 0 !== r.generateStencilBuffer && r.generateStencilBuffer, a = void 0 !== r.generateDepthTexture && r.generateDepthTexture, l = r.textureCount || 1, r.types && (h = r.types), r.samplingModes && (d = r.samplingModes));
                        var p = this._gl,
                            f = p.createFramebuffer();
                        this.bindUnboundFramebuffer(f);
                        for (var _ = t.width || t, m = t.height || t, g = [], v = [], y = this._setupFramebufferDepthAttachments(s, o, _, m), b = 0; b < l; b++) {
                            var x = d[b] || c,
                                T = h[b] || u;
                            (T !== i.TEXTURETYPE_FLOAT || this._caps.textureFloatLinearFiltering) && (T !== i.TEXTURETYPE_HALF_FLOAT || this._caps.textureHalfFloatLinearFiltering) || (x = i.TEXTURE_NEAREST_SAMPLINGMODE);
                            var E = this._getSamplingParameters(x, n);
                            T !== i.TEXTURETYPE_FLOAT || this._caps.textureFloat || (T = i.TEXTURETYPE_UNSIGNED_INT, e.Tools.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"));
                            var S = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_MULTIRENDERTARGET),
                                P = p[1 < this.webGLVersion ? "COLOR_ATTACHMENT" + b : "COLOR_ATTACHMENT" + b + "_WEBGL"];
                            g.push(S), v.push(P), p.activeTexture(p["TEXTURE" + b]), p.bindTexture(p.TEXTURE_2D, S._webGLTexture), p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, E.mag), p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, E.min), p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE), p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE), p.texImage2D(p.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(T), _, m, 0, p.RGBA, this._getWebGLTextureType(T), null), p.framebufferTexture2D(p.DRAW_FRAMEBUFFER, P, p.TEXTURE_2D, S._webGLTexture, 0), n && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(p.TEXTURE_2D, null), S._framebuffer = f, S._depthStencilBuffer = y, S.baseWidth = _, S.baseHeight = m, S.width = _, S.height = m, S.isReady = !0, S.samples = 1, S.generateMipMaps = n, S.samplingMode = x, S.type = T, S._generateDepthBuffer = o, S._generateStencilBuffer = s, S._attachments = v, this._internalTexturesCache.push(S)
                        }
                        if (a && this._caps.depthTextureExtension) {
                            var A = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_MULTIRENDERTARGET);
                            p.activeTexture(p.TEXTURE0), p.bindTexture(p.TEXTURE_2D, A._webGLTexture), p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST), p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST), p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE), p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE), p.texImage2D(p.TEXTURE_2D, 0, this.webGLVersion < 2 ? p.DEPTH_COMPONENT : p.DEPTH_COMPONENT16, _, m, 0, p.DEPTH_COMPONENT, p.UNSIGNED_SHORT, null), p.framebufferTexture2D(p.FRAMEBUFFER, p.DEPTH_ATTACHMENT, p.TEXTURE_2D, A._webGLTexture, 0), A._framebuffer = f, A.baseWidth = _, A.baseHeight = m, A.width = _, A.height = m, A.isReady = !0, A.samples = 1, A.generateMipMaps = n, A.samplingMode = p.NEAREST, A._generateDepthBuffer = o, A._generateStencilBuffer = s, g.push(A), this._internalTexturesCache.push(A)
                        }
                        return p.drawBuffers(v), p.bindRenderbuffer(p.RENDERBUFFER, null), this.bindUnboundFramebuffer(null), this.resetTextureCache(), g
                    }, i.prototype._setupFramebufferDepthAttachments = function(e, t, i, r, n) {
                        void 0 === n && (n = 1);
                        var o = null,
                            s = this._gl;
                        return e ? (o = s.createRenderbuffer(), s.bindRenderbuffer(s.RENDERBUFFER, o), 1 < n ? s.renderbufferStorageMultisample(s.RENDERBUFFER, n, s.DEPTH24_STENCIL8, i, r) : s.renderbufferStorage(s.RENDERBUFFER, s.DEPTH_STENCIL, i, r), s.framebufferRenderbuffer(s.FRAMEBUFFER, s.DEPTH_STENCIL_ATTACHMENT, s.RENDERBUFFER, o)) : t && (o = s.createRenderbuffer(), s.bindRenderbuffer(s.RENDERBUFFER, o), 1 < n ? s.renderbufferStorageMultisample(s.RENDERBUFFER, n, s.DEPTH_COMPONENT16, i, r) : s.renderbufferStorage(s.RENDERBUFFER, s.DEPTH_COMPONENT16, i, r), s.framebufferRenderbuffer(s.FRAMEBUFFER, s.DEPTH_ATTACHMENT, s.RENDERBUFFER, o)), o
                    }, i.prototype.updateRenderTargetTextureSampleCount = function(e, t) {
                        if (this.webGLVersion < 2 || !e) return 1;
                        if (e.samples === t) return t;
                        var i = this._gl;
                        if (t = Math.min(t, i.getParameter(i.MAX_SAMPLES)), e._depthStencilBuffer && (i.deleteRenderbuffer(e._depthStencilBuffer), e._depthStencilBuffer = null), e._MSAAFramebuffer && (i.deleteFramebuffer(e._MSAAFramebuffer), e._MSAAFramebuffer = null), e._MSAARenderBuffer && (i.deleteRenderbuffer(e._MSAARenderBuffer), e._MSAARenderBuffer = null), 1 < t) {
                            var r = i.createFramebuffer();
                            if (!r) throw new Error("Unable to create multi sampled framebuffer");
                            e._MSAAFramebuffer = r, this.bindUnboundFramebuffer(e._MSAAFramebuffer);
                            var n = i.createRenderbuffer();
                            if (!n) throw new Error("Unable to create multi sampled framebuffer");
                            i.bindRenderbuffer(i.RENDERBUFFER, n), i.renderbufferStorageMultisample(i.RENDERBUFFER, t, this._getRGBAMultiSampleBufferFormat(e.type), e.width, e.height), i.framebufferRenderbuffer(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.RENDERBUFFER, n), e._MSAARenderBuffer = n
                        } else this.bindUnboundFramebuffer(e._framebuffer);
                        return e.samples = t, e._depthStencilBuffer = this._setupFramebufferDepthAttachments(e._generateStencilBuffer, e._generateDepthBuffer, e.width, e.height, t), i.bindRenderbuffer(i.RENDERBUFFER, null), this.bindUnboundFramebuffer(null), t
                    }, i.prototype.updateMultipleRenderTargetTextureSampleCount = function(e, t) {
                        if (this.webGLVersion < 2 || !e || 0 == e.length) return 1;
                        if (e[0].samples === t) return t;
                        var i = this._gl;
                        t = Math.min(t, i.getParameter(i.MAX_SAMPLES)), e[0]._depthStencilBuffer && (i.deleteRenderbuffer(e[0]._depthStencilBuffer), e[0]._depthStencilBuffer = null), e[0]._MSAAFramebuffer && (i.deleteFramebuffer(e[0]._MSAAFramebuffer), e[0]._MSAAFramebuffer = null);
                        for (var r = 0; r < e.length; r++) e[r]._MSAARenderBuffer && (i.deleteRenderbuffer(e[r]._MSAARenderBuffer), e[r]._MSAARenderBuffer = null);
                        if (1 < t) {
                            var n = i.createFramebuffer();
                            if (!n) throw new Error("Unable to create multi sampled framebuffer");
                            this.bindUnboundFramebuffer(n);
                            var o = this._setupFramebufferDepthAttachments(e[0]._generateStencilBuffer, e[0]._generateDepthBuffer, e[0].width, e[0].height, t),
                                s = [];
                            for (r = 0; r < e.length; r++) {
                                var a = e[r],
                                    l = i[1 < this.webGLVersion ? "COLOR_ATTACHMENT" + r : "COLOR_ATTACHMENT" + r + "_WEBGL"],
                                    u = i.createRenderbuffer();
                                if (!u) throw new Error("Unable to create multi sampled framebuffer");
                                i.bindRenderbuffer(i.RENDERBUFFER, u), i.renderbufferStorageMultisample(i.RENDERBUFFER, t, this._getRGBAMultiSampleBufferFormat(a.type), a.width, a.height), i.framebufferRenderbuffer(i.FRAMEBUFFER, l, i.RENDERBUFFER, u), a._MSAAFramebuffer = n, a._MSAARenderBuffer = u, a.samples = t, a._depthStencilBuffer = o, i.bindRenderbuffer(i.RENDERBUFFER, null), s.push(l)
                            }
                            i.drawBuffers(s)
                        } else this.bindUnboundFramebuffer(e[0]._framebuffer);
                        return this.bindUnboundFramebuffer(null), t
                    }, i.prototype._uploadCompressedDataToTextureDirectly = function(e, t, i, r, n, o, s) {
                        void 0 === o && (o = 0), void 0 === s && (s = 0);
                        var a = this._gl,
                            l = a.TEXTURE_2D;
                        e.isCube && (l = a.TEXTURE_CUBE_MAP_POSITIVE_X + o), this._gl.compressedTexImage2D(l, s, t, i, r, 0, n)
                    }, i.prototype._uploadDataToTextureDirectly = function(t, i, r, n) {
                        void 0 === r && (r = 0), void 0 === n && (n = 0);
                        var o = this._gl,
                            s = this._getWebGLTextureType(t.type),
                            a = this._getInternalFormat(t.format),
                            l = this._getRGBABufferInternalSizedFormat(t.type, a);
                        this._unpackFlipY(t.invertY);
                        var u = o.TEXTURE_2D;
                        t.isCube && (u = o.TEXTURE_CUBE_MAP_POSITIVE_X + r);
                        var c = Math.round(e.Scalar.Log2(t.width)),
                            h = Math.round(e.Scalar.Log2(t.height)),
                            d = Math.pow(2, Math.max(c - n, 0)),
                            p = Math.pow(2, Math.max(h - n, 0));
                        o.texImage2D(u, n, l, d, p, 0, a, s, i)
                    }, i.prototype._uploadArrayBufferViewToTexture = function(e, t, i, r) {
                        void 0 === i && (i = 0), void 0 === r && (r = 0);
                        var n = this._gl,
                            o = e.isCube ? n.TEXTURE_CUBE_MAP : n.TEXTURE_2D;
                        this._bindTextureDirectly(o, e, !0), this._uploadDataToTextureDirectly(e, t, i, r), this._bindTextureDirectly(o, null, !0)
                    }, i.prototype._uploadImageToTexture = function(e, t, i, r) {
                        void 0 === i && (i = 0), void 0 === r && (r = 0);
                        var n = this._gl,
                            o = this._getWebGLTextureType(e.type),
                            s = this._getInternalFormat(e.format),
                            a = this._getRGBABufferInternalSizedFormat(e.type, s),
                            l = e.isCube ? n.TEXTURE_CUBE_MAP : n.TEXTURE_2D;
                        this._bindTextureDirectly(l, e, !0), this._unpackFlipY(e.invertY);
                        var u = n.TEXTURE_2D;
                        e.isCube && (u = n.TEXTURE_CUBE_MAP_POSITIVE_X + i), n.texImage2D(u, r, a, s, o, t), this._bindTextureDirectly(l, null, !0)
                    }, i.prototype.createRenderTargetCubeTexture = function(t, r) {
                        var n = ae({
                            generateMipMaps: !0,
                            generateDepthBuffer: !0,
                            generateStencilBuffer: !1,
                            type: i.TEXTURETYPE_UNSIGNED_INT,
                            samplingMode: i.TEXTURE_TRILINEAR_SAMPLINGMODE,
                            format: i.TEXTUREFORMAT_RGBA
                        }, r);
                        n.generateStencilBuffer = n.generateDepthBuffer && n.generateStencilBuffer, (n.type !== i.TEXTURETYPE_FLOAT || this._caps.textureFloatLinearFiltering) && (n.type !== i.TEXTURETYPE_HALF_FLOAT || this._caps.textureHalfFloatLinearFiltering) || (n.samplingMode = i.TEXTURE_NEAREST_SAMPLINGMODE);
                        var o = this._gl,
                            s = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_RENDERTARGET);
                        this._bindTextureDirectly(o.TEXTURE_CUBE_MAP, s, !0);
                        var a = this._getSamplingParameters(n.samplingMode, n.generateMipMaps);
                        n.type !== i.TEXTURETYPE_FLOAT || this._caps.textureFloat || (n.type = i.TEXTURETYPE_UNSIGNED_INT, e.Tools.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")), o.texParameteri(o.TEXTURE_CUBE_MAP, o.TEXTURE_MAG_FILTER, a.mag), o.texParameteri(o.TEXTURE_CUBE_MAP, o.TEXTURE_MIN_FILTER, a.min), o.texParameteri(o.TEXTURE_CUBE_MAP, o.TEXTURE_WRAP_S, o.CLAMP_TO_EDGE), o.texParameteri(o.TEXTURE_CUBE_MAP, o.TEXTURE_WRAP_T, o.CLAMP_TO_EDGE);
                        for (var l = 0; l < 6; l++) o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, this._getRGBABufferInternalSizedFormat(n.type, n.format), t, t, 0, this._getInternalFormat(n.format), this._getWebGLTextureType(n.type), null);
                        var u = o.createFramebuffer();
                        return this.bindUnboundFramebuffer(u), s._depthStencilBuffer = this._setupFramebufferDepthAttachments(n.generateStencilBuffer, n.generateDepthBuffer, t, t), n.generateMipMaps && o.generateMipmap(o.TEXTURE_CUBE_MAP), this._bindTextureDirectly(o.TEXTURE_CUBE_MAP, null), o.bindRenderbuffer(o.RENDERBUFFER, null), this.bindUnboundFramebuffer(null), s._framebuffer = u, s.width = t, s.height = t, s.isReady = !0, s.isCube = !0, s.samples = 1, s.generateMipMaps = n.generateMipMaps, s.samplingMode = n.samplingMode, s.type = n.type, s.format = n.format, s._generateDepthBuffer = n.generateDepthBuffer, s._generateStencilBuffer = n.generateStencilBuffer, this._internalTexturesCache.push(s), s
                    }, i.prototype.createPrefilteredCubeTexture = function(t, i, r, n, o, s, a, l, u) {
                        var c = this;
                        return void 0 === o && (o = null), void 0 === s && (s = null), void 0 === l && (l = null), void 0 === u && (u = !0), this.createCubeTexture(t, i, null, !1, function(t) {
                            if (t) {
                                var s = t.texture;
                                if (u ? t.info.sphericalPolynomial && (s._sphericalPolynomial = t.info.sphericalPolynomial) : s._sphericalPolynomial = new e.SphericalPolynomial, s._dataSource = e.InternalTexture.DATASOURCE_CUBEPREFILTERED, c._caps.textureLOD) o && o(s);
                                else {
                                    var a = c._gl,
                                        l = t.width;
                                    if (l) {
                                        for (var h = [], d = 0; d < 3; d++) {
                                            var p = 1 - d / 2,
                                                f = n,
                                                _ = e.Scalar.Log2(l) * r + n,
                                                m = f + (_ - f) * p,
                                                g = Math.round(Math.min(Math.max(m, 0), _)),
                                                v = new e.InternalTexture(c, e.InternalTexture.DATASOURCE_TEMP);
                                            if (v.type = s.type, v.format = s.format, v.width = Math.pow(2, Math.max(e.Scalar.Log2(l) - g, 0)), v.height = v.width, v.isCube = !0, c._bindTextureDirectly(a.TEXTURE_CUBE_MAP, v, !0), a.texParameteri(a.TEXTURE_CUBE_MAP, a.TEXTURE_MAG_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_CUBE_MAP, a.TEXTURE_MIN_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_CUBE_MAP, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(a.TEXTURE_CUBE_MAP, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE), t.isDDS) {
                                                var y = t.info,
                                                    b = t.data;
                                                c._unpackFlipY(y.isCompressed), e.DDSTools.UploadDDSLevels(c, v, b, y, !0, 6, g)
                                            } else e.Tools.Warn("DDS is the only prefiltered cube map supported so far.");
                                            c._bindTextureDirectly(a.TEXTURE_CUBE_MAP, null);
                                            var x = new e.BaseTexture(i);
                                            x.isCube = !0, (x._texture = v).isReady = !0, h.push(x)
                                        }
                                        s._lodTextureHigh = h[2], s._lodTextureMid = h[1], s._lodTextureLow = h[0], o && o(s)
                                    }
                                }
                            } else o && o(null)
                        }, s, a, l, u, r, n)
                    }, i.prototype.createCubeTexture = function(t, r, n, o, s, a, l, u, c, h, d, p) {
                        var f = this;
                        void 0 === s && (s = null), void 0 === a && (a = null), void 0 === u && (u = null), void 0 === c && (c = !1), void 0 === h && (h = 0), void 0 === d && (d = 0), void 0 === p && (p = null);
                        var _ = this._gl,
                            m = p || new e.InternalTexture(this, e.InternalTexture.DATASOURCE_CUBE);
                        m.isCube = !0, m.url = t, m.generateMipMaps = !o, m._lodGenerationScale = h, m._lodGenerationOffset = d, this._doNotHandleContextLost || (m._extension = u, m._files = n);
                        for (var g = t.lastIndexOf("."), v = u || (-1 < g ? t.substring(g).toLowerCase() : ""), y = null, b = 0, x = i._TextureLoaders; b < x.length; b++) {
                            var T = x[b];
                            if (T.canLoad(v, this._textureFormatInUse, p, !1, !1)) {
                                y = T;
                                break
                            }
                        }
                        if (y) {
                            t = y.transformUrl(t, this._textureFormatInUse);
                            var E = function(e) {
                                f._bindTextureDirectly(_.TEXTURE_CUBE_MAP, m, !0), y.loadCubeData(e, m, c, s, a)
                            };
                            n && 6 === n.length ? y.supportCascades ? this._cascadeLoadFiles(r, E, n, a) : a && a("Textures type does not support cascades.") : this._loadFile(t, E, void 0, void 0, !0, function(e, i) {
                                if (y) {
                                    var u = y.getFallbackTextureUrl(t, f._textureFormatInUse);
                                    u && f.createCubeTexture(u, r, n, o, s, a, l, v, c, h, d, m)
                                }
                                a && e && a(e.status + " " + e.statusText, i)
                            })
                        } else {
                            if (!n) throw new Error("Cannot load cubemap because files were not defined");
                            this._cascadeLoadImgs(t, r, function(t) {
                                var i = f.needPOTTextures ? e.Tools.GetExponentOfTwo(t[0].width, f._caps.maxCubemapTextureSize) : t[0].width,
                                    r = i;
                                if (f._prepareWorkingCanvas(), f._workingCanvas && f._workingContext) {
                                    f._workingCanvas.width = i, f._workingCanvas.height = r;
                                    var n = [_.TEXTURE_CUBE_MAP_POSITIVE_X, _.TEXTURE_CUBE_MAP_POSITIVE_Y, _.TEXTURE_CUBE_MAP_POSITIVE_Z, _.TEXTURE_CUBE_MAP_NEGATIVE_X, _.TEXTURE_CUBE_MAP_NEGATIVE_Y, _.TEXTURE_CUBE_MAP_NEGATIVE_Z];
                                    f._bindTextureDirectly(_.TEXTURE_CUBE_MAP, m, !0), f._unpackFlipY(!1);
                                    for (var a = l ? f._getInternalFormat(l) : f._gl.RGBA, u = 0; u < n.length; u++) f._workingContext.drawImage(t[u], 0, 0, t[u].width, t[u].height, 0, 0, i, r), _.texImage2D(n[u], 0, a, a, _.UNSIGNED_BYTE, f._workingCanvas);
                                    o || _.generateMipmap(_.TEXTURE_CUBE_MAP), f._setCubeMapTextureParams(!o), m.width = i, m.height = r, m.isReady = !0, l && (m.format = l), m.onLoadedObservable.notifyObservers(m), m.onLoadedObservable.clear(), s && s()
                                }
                            }, n, a)
                        }
                        return this._internalTexturesCache.push(m), m
                    }, i.prototype._setCubeMapTextureParams = function(e) {
                        var t = this._gl;
                        t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_MAG_FILTER, t.LINEAR), t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_MIN_FILTER, e ? t.LINEAR_MIPMAP_LINEAR : t.LINEAR), t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE), this._bindTextureDirectly(t.TEXTURE_CUBE_MAP, null)
                    }, i.prototype.updateRawCubeTexture = function(t, i, r, n, o, s, a) {
                        void 0 === s && (s = null), void 0 === a && (a = 0), t._bufferViewArray = i, t.format = r, t.type = n, t.invertY = o, t._compression = s;
                        var l = this._gl,
                            u = this._getWebGLTextureType(n),
                            c = this._getInternalFormat(r),
                            h = this._getRGBABufferInternalSizedFormat(n),
                            d = !1;
                        c === l.RGB && (c = l.RGBA, d = !0), this._bindTextureDirectly(l.TEXTURE_CUBE_MAP, t, !0), this._unpackFlipY(void 0 === o || !!o), t.width % 4 != 0 && l.pixelStorei(l.UNPACK_ALIGNMENT, 1);
                        for (var p = 0; p < 6; p++) {
                            var f = i[p];
                            s ? l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X + p, a, this.getCaps().s3tc[s], t.width, t.height, 0, f) : (d && (f = this._convertRGBtoRGBATextureData(f, t.width, t.height, n)), l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X + p, a, h, t.width, t.height, 0, c, u, f))
                        }(!this.needPOTTextures || e.Tools.IsExponentOfTwo(t.width) && e.Tools.IsExponentOfTwo(t.height)) && t.generateMipMaps && 0 === a && this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), t.isReady = !0
                    }, i.prototype.createRawCubeTexture = function(t, r, n, o, s, a, l, u) {
                        void 0 === u && (u = null);
                        var c = this._gl,
                            h = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_CUBERAW);
                        h.isCube = !0, h.format = n, h.type = o, this._doNotHandleContextLost || (h._bufferViewArray = t);
                        var d = this._getWebGLTextureType(o),
                            p = this._getInternalFormat(n);
                        p === c.RGB && (p = c.RGBA), d !== c.FLOAT || this._caps.textureFloatLinearFiltering ? d !== this._gl.HALF_FLOAT_OES || this._caps.textureHalfFloatLinearFiltering ? d !== c.FLOAT || this._caps.textureFloatRender ? d !== c.HALF_FLOAT || this._caps.colorBufferFloat || (s = !1, e.Tools.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")) : (s = !1, e.Tools.Warn("Render to float textures is not supported. Mipmap generation forced to false.")) : (s = !1, l = i.TEXTURE_NEAREST_SAMPLINGMODE, e.Tools.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")) : (s = !1, l = i.TEXTURE_NEAREST_SAMPLINGMODE, e.Tools.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."));
                        var f = r,
                            _ = f;
                        h.width = f, h.height = _, !this.needPOTTextures || e.Tools.IsExponentOfTwo(h.width) && e.Tools.IsExponentOfTwo(h.height) || (s = !1), t && this.updateRawCubeTexture(h, t, n, o, a, u), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, h, !0), t && s && this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);
                        var m = this._getSamplingParameters(l, s);
                        return c.texParameteri(c.TEXTURE_CUBE_MAP, c.TEXTURE_MAG_FILTER, m.mag), c.texParameteri(c.TEXTURE_CUBE_MAP, c.TEXTURE_MIN_FILTER, m.min), c.texParameteri(c.TEXTURE_CUBE_MAP, c.TEXTURE_WRAP_S, c.CLAMP_TO_EDGE), c.texParameteri(c.TEXTURE_CUBE_MAP, c.TEXTURE_WRAP_T, c.CLAMP_TO_EDGE), this._bindTextureDirectly(c.TEXTURE_CUBE_MAP, null), h.generateMipMaps = s, h
                    }, i.prototype.createRawCubeTextureFromUrl = function(e, t, r, n, o, s, a, l, u, c, h, d) {
                        var p = this;
                        void 0 === u && (u = null), void 0 === c && (c = null), void 0 === h && (h = i.TEXTURE_TRILINEAR_SAMPLINGMODE), void 0 === d && (d = !1);
                        var f = this._gl,
                            _ = this.createRawCubeTexture(null, r, n, o, !s, d, h);
                        return t._addPendingData(_), _.url = e, this._internalTexturesCache.push(_), this._loadFile(e, function(e) {
                            ! function(e) {
                                var i = _.width,
                                    r = a(e);
                                if (r) {
                                    if (l) {
                                        var s = p._getWebGLTextureType(o),
                                            c = p._getInternalFormat(n),
                                            h = p._getRGBABufferInternalSizedFormat(o),
                                            m = !1;
                                        c === f.RGB && (c = f.RGBA, m = !0), p._bindTextureDirectly(f.TEXTURE_CUBE_MAP, _, !0), p._unpackFlipY(!1);
                                        for (var g = l(r), v = 0; v < g.length; v++)
                                            for (var y = i >> v, b = 0; b < 6; b++) {
                                                var x = g[v][b];
                                                m && (x = p._convertRGBtoRGBATextureData(x, y, y, o)), f.texImage2D(b, v, h, y, y, 0, c, s, x)
                                            }
                                        p._bindTextureDirectly(f.TEXTURE_CUBE_MAP, null)
                                    } else p.updateRawCubeTexture(_, r, n, o, d);
                                    _.isReady = !0, t._removePendingData(_), u && u()
                                }
                            }(e)
                        }, void 0, t.database, !0, function(e, i) {
                            t._removePendingData(_), c && e && c(e.status + " " + e.statusText, i)
                        }), _
                    }, i.prototype.updateRawTexture3D = function(e, t, r, n, o, s) {
                        void 0 === o && (o = null), void 0 === s && (s = i.TEXTURETYPE_UNSIGNED_INT);
                        var a = this._getWebGLTextureType(s),
                            l = this._getInternalFormat(r),
                            u = this._getRGBABufferInternalSizedFormat(s, r);
                        this._bindTextureDirectly(this._gl.TEXTURE_3D, e, !0), this._unpackFlipY(void 0 === n || !!n), this._doNotHandleContextLost || (e._bufferView = t, e.format = r, e.invertY = n, e._compression = o), e.width % 4 != 0 && this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1), o && t ? this._gl.compressedTexImage3D(this._gl.TEXTURE_3D, 0, this.getCaps().s3tc[o], e.width, e.height, e.depth, 0, t) : this._gl.texImage3D(this._gl.TEXTURE_3D, 0, u, e.width, e.height, e.depth, 0, l, a, t), e.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_3D), this._bindTextureDirectly(this._gl.TEXTURE_3D, null), e.isReady = !0
                    }, i.prototype.createRawTexture3D = function(t, r, n, o, s, a, l, u, c, h) {
                        void 0 === c && (c = null), void 0 === h && (h = i.TEXTURETYPE_UNSIGNED_INT);
                        var d = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_RAW3D);
                        d.baseWidth = r, d.baseHeight = n, d.baseDepth = o, d.width = r, d.height = n, d.depth = o, d.format = s, d.type = h, d.generateMipMaps = a, d.samplingMode = u, d.is3D = !0, this._doNotHandleContextLost || (d._bufferView = t), this.updateRawTexture3D(d, t, s, l, c, h), this._bindTextureDirectly(this._gl.TEXTURE_3D, d, !0);
                        var p = this._getSamplingParameters(u, a);
                        return this._gl.texParameteri(this._gl.TEXTURE_3D, this._gl.TEXTURE_MAG_FILTER, p.mag), this._gl.texParameteri(this._gl.TEXTURE_3D, this._gl.TEXTURE_MIN_FILTER, p.min), a && this._gl.generateMipmap(this._gl.TEXTURE_3D), this._bindTextureDirectly(this._gl.TEXTURE_3D, null), this._internalTexturesCache.push(d), d
                    }, i.prototype._prepareWebGLTextureContinuation = function(e, t, i, r, n) {
                        var o = this._gl;
                        if (o) {
                            var s = this._getSamplingParameters(n, !i);
                            o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, s.mag), o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, s.min), i || r || o.generateMipmap(o.TEXTURE_2D), this._bindTextureDirectly(o.TEXTURE_2D, null), t && t._removePendingData(e), e.onLoadedObservable.notifyObservers(e), e.onLoadedObservable.clear()
                        }
                    }, i.prototype._prepareWebGLTexture = function(t, r, n, o, s, a, l, u, c) {
                        var h = this;
                        void 0 === c && (c = i.TEXTURE_TRILINEAR_SAMPLINGMODE);
                        var d = this.getCaps().maxTextureSize,
                            p = Math.min(d, this.needPOTTextures ? e.Tools.GetExponentOfTwo(n, d) : n),
                            f = Math.min(d, this.needPOTTextures ? e.Tools.GetExponentOfTwo(o, d) : o),
                            _ = this._gl;
                        _ && (t._webGLTexture ? (this._bindTextureDirectly(_.TEXTURE_2D, t, !0), this._unpackFlipY(void 0 === s || !!s), t.baseWidth = n, t.baseHeight = o, t.width = p, t.height = f, t.isReady = !0, u(p, f, function() {
                            h._prepareWebGLTextureContinuation(t, r, a, l, c)
                        }) || this._prepareWebGLTextureContinuation(t, r, a, l, c)) : r && r._removePendingData(t))
                    }, i.prototype._convertRGBtoRGBATextureData = function(e, t, r, n) {
                        var o;
                        o = n === i.TEXTURETYPE_FLOAT ? new Float32Array(t * r * 4) : new Uint32Array(t * r * 4);
                        for (var s = 0; s < t; s++)
                            for (var a = 0; a < r; a++) {
                                var l = 3 * (a * t + s),
                                    u = 4 * (a * t + s);
                                o[u + 0] = e[l + 0], o[u + 1] = e[l + 1], o[u + 2] = e[l + 2], o[u + 3] = 1
                            }
                        return o
                    }, i.prototype._releaseFramebufferObjects = function(e) {
                        var t = this._gl;
                        e._framebuffer && (t.deleteFramebuffer(e._framebuffer), e._framebuffer = null), e._depthStencilBuffer && (t.deleteRenderbuffer(e._depthStencilBuffer), e._depthStencilBuffer = null), e._MSAAFramebuffer && (t.deleteFramebuffer(e._MSAAFramebuffer), e._MSAAFramebuffer = null), e._MSAARenderBuffer && (t.deleteRenderbuffer(e._MSAARenderBuffer), e._MSAARenderBuffer = null)
                    }, i.prototype._releaseTexture = function(e) {
                        var t = this._gl;
                        this._releaseFramebufferObjects(e), t.deleteTexture(e._webGLTexture), this.unbindAllTextures();
                        var i = this._internalTexturesCache.indexOf(e); - 1 !== i && this._internalTexturesCache.splice(i, 1), e._lodTextureHigh && e._lodTextureHigh.dispose(), e._lodTextureMid && e._lodTextureMid.dispose(), e._lodTextureLow && e._lodTextureLow.dispose(), this.scenes.forEach(function(t) {
                            t.postProcesses.forEach(function(t) {
                                t._outputTexture == e && (t._outputTexture = null)
                            }), t.cameras.forEach(function(t) {
                                t._postProcesses.forEach(function(t) {
                                    t && t._outputTexture == e && (t._outputTexture = null)
                                })
                            })
                        })
                    }, i.prototype.setProgram = function(e) {
                        this._currentProgram !== e && (this._gl.useProgram(e), this._currentProgram = e)
                    }, i.prototype.bindSamplers = function(e) {
                        this.setProgram(e.getProgram());
                        for (var t = e.getSamplers(), i = 0; i < t.length; i++) {
                            var r = e.getUniform(t[i]);
                            r && (this._boundUniforms[i] = r)
                        }
                        this._currentEffect = null
                    }, i.prototype._moveBoundTextureOnTop = function(e) {
                        this.disableTextureBindingOptimization || this._lastBoundInternalTextureTracker.previous === e || (this._linkTrackers(e.previous, e.next), this._linkTrackers(this._lastBoundInternalTextureTracker.previous, e), this._linkTrackers(e, this._lastBoundInternalTextureTracker))
                    }, i.prototype._getCorrectTextureChannel = function(e, t) {
                        if (!t) return -1;
                        if (t._initialSlot = e, this.disableTextureBindingOptimization) e !== t._designatedSlot && this._textureCollisions.addCount(1, !1);
                        else if (e !== t._designatedSlot) return -1 < t._designatedSlot ? t._designatedSlot : this._nextFreeTextureSlots.length ? this._nextFreeTextureSlots[0] : (this._textureCollisions.addCount(1, !1), this._removeDesignatedSlot(this._firstBoundInternalTextureTracker.next));
                        return e
                    }, i.prototype._linkTrackers = function(e, t) {
                        (e.next = t).previous = e
                    }, i.prototype._removeDesignatedSlot = function(e) {
                        var t = e._designatedSlot;
                        return -1 === t ? -1 : (e._designatedSlot = -1, this.disableTextureBindingOptimization ? -1 : (this._linkTrackers(e.previous, e.next), this._boundTexturesCache[t] = null, this._nextFreeTextureSlots.push(t), t))
                    }, i.prototype._activateCurrentTexture = function() {
                        this._currentTextureChannel !== this._activeChannel && (this._gl.activeTexture(this._gl.TEXTURE0 + this._activeChannel), this._currentTextureChannel = this._activeChannel)
                    }, i.prototype._bindTextureDirectly = function(e, t, i, r) {
                        void 0 === i && (i = !1), void 0 === r && (r = !1);
                        var n = !1;
                        i && t && -1 < t._designatedSlot && (this._activeChannel = t._designatedSlot);
                        var o = this._boundTexturesCache[this._activeChannel],
                            s = t && -1 < t._initialSlot;
                        if (o !== t || r) {
                            if (o && this._removeDesignatedSlot(o), this._activateCurrentTexture(), this._gl.bindTexture(e, t ? t._webGLTexture : null), this._boundTexturesCache[this._activeChannel] = t) {
                                if (!this.disableTextureBindingOptimization) {
                                    var a = this._nextFreeTextureSlots.indexOf(this._activeChannel); - 1 < a && this._nextFreeTextureSlots.splice(a, 1), this._linkTrackers(this._lastBoundInternalTextureTracker.previous, t), this._linkTrackers(t, this._lastBoundInternalTextureTracker)
                                }
                                t._designatedSlot = this._activeChannel
                            }
                        } else i && (n = !0, this._activateCurrentTexture());
                        return s && !i && this._bindSamplerUniformToChannel(t._initialSlot, this._activeChannel), n
                    }, i.prototype._bindTexture = function(e, t) {
                        e < 0 || (t && (e = this._getCorrectTextureChannel(e, t)), this._activeChannel = e, this._bindTextureDirectly(this._gl.TEXTURE_2D, t))
                    }, i.prototype.setTextureFromPostProcess = function(e, t) {
                        this._bindTexture(e, t ? t._textures.data[t._currentRenderTextureInd] : null)
                    }, i.prototype.setTextureFromPostProcessOutput = function(e, t) {
                        this._bindTexture(e, t ? t._outputTexture : null)
                    }, i.prototype.unbindAllTextures = function() {
                        for (var e = 0; e < this._maxSimultaneousTextures; e++) this._activeChannel = e, this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), 1 < this.webGLVersion && this._bindTextureDirectly(this._gl.TEXTURE_3D, null)
                    }, i.prototype.setTexture = function(e, t, i) {
                        e < 0 || (t && (this._boundUniforms[e] = t), this._setTexture(e, i))
                    }, i.prototype.setDepthStencilTexture = function(e, t, i) {
                        e < 0 || (t && (this._boundUniforms[e] = t), i && i.depthStencilTexture ? this._setTexture(e, i, !1, !0) : this._setTexture(e, null))
                    }, i.prototype._bindSamplerUniformToChannel = function(e, t) {
                        var i = this._boundUniforms[e];
                        i._currentState !== t && (this._gl.uniform1i(i, t), i._currentState = t)
                    }, i.prototype._getTextureWrapMode = function(e) {
                        switch (e) {
                            case i.TEXTURE_WRAP_ADDRESSMODE:
                                return this._gl.REPEAT;
                            case i.TEXTURE_CLAMP_ADDRESSMODE:
                                return this._gl.CLAMP_TO_EDGE;
                            case i.TEXTURE_MIRROR_ADDRESSMODE:
                                return this._gl.MIRRORED_REPEAT
                        }
                        return this._gl.REPEAT
                    }, i.prototype._setTexture = function(e, t, r, n) {
                        if (void 0 === r && (r = !1), void 0 === n && (n = !1), !t) return null != this._boundTexturesCache[e] && (this._activeChannel = e, this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), 1 < this.webGLVersion && this._bindTextureDirectly(this._gl.TEXTURE_3D, null)), !1;
                        if (t.video) this._activeChannel = e, t.update();
                        else if (t.delayLoadState === i.DELAYLOADSTATE_NOTLOADED) return t.delayLoad(), !1;
                        var o;
                        o = n ? t.depthStencilTexture : t.isReady() ? t.getInternalTexture() : t.isCube ? this.emptyCubeTexture : t.is3D ? this.emptyTexture3D : this.emptyTexture, r || (e = this._getCorrectTextureChannel(e, o));
                        var s = !0;
                        if (this._boundTexturesCache[e] === o && (this._moveBoundTextureOnTop(o), r || this._bindSamplerUniformToChannel(o._initialSlot, e), s = !1), this._activeChannel = e, o && o.is3D) s && this._bindTextureDirectly(this._gl.TEXTURE_3D, o, r), o && o._cachedWrapU !== t.wrapU && (o._cachedWrapU = t.wrapU, this._setTextureParameterInteger(this._gl.TEXTURE_3D, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(t.wrapU), o)), o && o._cachedWrapV !== t.wrapV && (o._cachedWrapV = t.wrapV, this._setTextureParameterInteger(this._gl.TEXTURE_3D, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(t.wrapV), o)), o && o._cachedWrapR !== t.wrapR && (o._cachedWrapR = t.wrapR, this._setTextureParameterInteger(this._gl.TEXTURE_3D, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(t.wrapR), o)), this._setAnisotropicLevel(this._gl.TEXTURE_3D, t);
                        else if (o && o.isCube) {
                            if (s && this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, o, r), o._cachedCoordinatesMode !== t.coordinatesMode) {
                                o._cachedCoordinatesMode = t.coordinatesMode;
                                var a = t.coordinatesMode !== i.TEXTURE_CUBIC_MODE && t.coordinatesMode !== i.TEXTURE_SKYBOX_MODE ? this._gl.REPEAT : this._gl.CLAMP_TO_EDGE;
                                this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_S, a, o), this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP, this._gl.TEXTURE_WRAP_T, a)
                            }
                            this._setAnisotropicLevel(this._gl.TEXTURE_CUBE_MAP, t)
                        } else s && this._bindTextureDirectly(this._gl.TEXTURE_2D, o, r), o && o._cachedWrapU !== t.wrapU && (o._cachedWrapU = t.wrapU, this._setTextureParameterInteger(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(t.wrapU), o)), o && o._cachedWrapV !== t.wrapV && (o._cachedWrapV = t.wrapV, this._setTextureParameterInteger(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(t.wrapV), o)), this._setAnisotropicLevel(this._gl.TEXTURE_2D, t);
                        return !0
                    }, i.prototype.setTextureArray = function(e, t, i) {
                        if (!(e < 0) && t) {
                            this._textureUnits && this._textureUnits.length === i.length || (this._textureUnits = new Int32Array(i.length));
                            for (var r = 0; r < i.length; r++) this._textureUnits[r] = this._getCorrectTextureChannel(e + r, i[r].getInternalTexture());
                            this._gl.uniform1iv(t, this._textureUnits);
                            for (var n = 0; n < i.length; n++) this._setTexture(this._textureUnits[n], i[n], !0)
                        }
                    }, i.prototype._setAnisotropicLevel = function(e, t) {
                        var r = t.getInternalTexture();
                        if (r) {
                            var n = this._caps.textureAnisotropicFilterExtension,
                                o = t.anisotropicFilteringLevel;
                            r.samplingMode !== i.TEXTURE_LINEAR_LINEAR_MIPNEAREST && r.samplingMode !== i.TEXTURE_LINEAR_LINEAR_MIPLINEAR && r.samplingMode !== i.TEXTURE_LINEAR_LINEAR && (o = 1), n && r._cachedAnisotropicFilteringLevel !== o && (this._setTextureParameterFloat(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(o, this._caps.maxAnisotropy), r), r._cachedAnisotropicFilteringLevel = o)
                        }
                    }, i.prototype._setTextureParameterFloat = function(e, t, i, r) {
                        this._bindTextureDirectly(e, r, !0, !0), this._gl.texParameterf(e, t, i)
                    }, i.prototype._setTextureParameterInteger = function(e, t, i, r) {
                        r && this._bindTextureDirectly(e, r, !0, !0), this._gl.texParameteri(e, t, i)
                    }, i.prototype.readPixels = function(e, t, i, r) {
                        var n = new Uint8Array(r * i * 4);
                        return this._gl.readPixels(e, t, i, r, this._gl.RGBA, this._gl.UNSIGNED_BYTE, n), n
                    }, i.prototype.addExternalData = function(t, i) {
                        return this._externalData || (this._externalData = new e.StringDictionary), this._externalData.add(t, i)
                    }, i.prototype.getExternalData = function(t) {
                        return this._externalData || (this._externalData = new e.StringDictionary), this._externalData.get(t)
                    }, i.prototype.getOrAddExternalDataWithFactory = function(t, i) {
                        return this._externalData || (this._externalData = new e.StringDictionary), this._externalData.getOrAddWithFactory(t, i)
                    }, i.prototype.removeExternalData = function(t) {
                        return this._externalData || (this._externalData = new e.StringDictionary), this._externalData.remove(t)
                    }, i.prototype.unbindAllAttributes = function() {
                        if (this._mustWipeVertexAttributes) {
                            this._mustWipeVertexAttributes = !1;
                            for (var e = 0; e < this._caps.maxVertexAttribs; e++) this._gl.disableVertexAttribArray(e), this._vertexAttribArraysEnabled[e] = !1, this._currentBufferPointers[e].active = !1
                        } else {
                            e = 0;
                            for (var t = this._vertexAttribArraysEnabled.length; e < t; e++) e >= this._caps.maxVertexAttribs || !this._vertexAttribArraysEnabled[e] || (this._gl.disableVertexAttribArray(e), this._vertexAttribArraysEnabled[e] = !1, this._currentBufferPointers[e].active = !1)
                        }
                    }, i.prototype.releaseEffects = function() {
                        for (var e in this._compiledEffects) this._deleteProgram(this._compiledEffects[e]._program);
                        this._compiledEffects = {}
                    }, i.prototype.dispose = function() {
                        for (this.hideLoadingUI(), this.stopRenderLoop(); this.postProcesses.length;) this.postProcesses[0].dispose();
                        for (this._emptyTexture && (this._releaseTexture(this._emptyTexture), this._emptyTexture = null), this._emptyCubeTexture && (this._releaseTexture(this._emptyCubeTexture), this._emptyCubeTexture = null), this._rescalePostProcess && this._rescalePostProcess.dispose(); this.scenes.length;) this.scenes[0].dispose();
                        1 === i.Instances.length && i.audioEngine && i.audioEngine.dispose(), this.releaseEffects(), this.unbindAllAttributes(), this._boundUniforms = [], this._dummyFramebuffer && this._gl.deleteFramebuffer(this._dummyFramebuffer), this.disableVR(), e.Tools.IsWindowObjectExist() && (window.removeEventListener("blur", this._onBlur), window.removeEventListener("focus", this._onFocus), window.removeEventListener("vrdisplaypointerrestricted", this._onVRDisplayPointerRestricted), window.removeEventListener("vrdisplaypointerunrestricted", this._onVRDisplayPointerUnrestricted),
                            this._renderingCanvas && (this._renderingCanvas.removeEventListener("focus", this._onCanvasFocus), this._renderingCanvas.removeEventListener("blur", this._onCanvasBlur), this._renderingCanvas.removeEventListener("pointerout", this._onCanvasPointerOut), this._doNotHandleContextLost || (this._renderingCanvas.removeEventListener("webglcontextlost", this._onContextLost), this._renderingCanvas.removeEventListener("webglcontextrestored", this._onContextRestored))), document.removeEventListener("fullscreenchange", this._onFullscreenChange), document.removeEventListener("mozfullscreenchange", this._onFullscreenChange), document.removeEventListener("webkitfullscreenchange", this._onFullscreenChange), document.removeEventListener("msfullscreenchange", this._onFullscreenChange), document.removeEventListener("pointerlockchange", this._onPointerLockChange), document.removeEventListener("mspointerlockchange", this._onPointerLockChange), document.removeEventListener("mozpointerlockchange", this._onPointerLockChange), document.removeEventListener("webkitpointerlockchange", this._onPointerLockChange), this._onVrDisplayConnect && (window.removeEventListener("vrdisplayconnect", this._onVrDisplayConnect), this._onVrDisplayDisconnect && window.removeEventListener("vrdisplaydisconnect", this._onVrDisplayDisconnect), this._onVrDisplayPresentChange && window.removeEventListener("vrdisplaypresentchange", this._onVrDisplayPresentChange), this._onVrDisplayConnect = null, this._onVrDisplayDisconnect = null));
                        var t = i.Instances.indexOf(this);
                        0 <= t && i.Instances.splice(t, 1), this._workingCanvas = null, this._workingContext = null, this._currentBufferPointers = [], this._renderingCanvas = null, this._currentProgram = null, this._bindedRenderFunction = null, this.onResizeObservable.clear(), this.onCanvasBlurObservable.clear(), this.onCanvasFocusObservable.clear(), this.onCanvasPointerOutObservable.clear(), this.onBeginFrameObservable.clear(), this.onEndFrameObservable.clear(), e.Effect.ResetCache();
                        for (var r = 0, n = this._activeRequests; r < n.length; r++) n[r].abort()
                    }, i.prototype.displayLoadingUI = function() {
                        if (e.Tools.IsWindowObjectExist()) {
                            var t = this.loadingScreen;
                            t && t.displayLoadingUI()
                        }
                    }, i.prototype.hideLoadingUI = function() {
                        if (e.Tools.IsWindowObjectExist()) {
                            var t = this.loadingScreen;
                            t && t.hideLoadingUI()
                        }
                    }, Object.defineProperty(i.prototype, "loadingScreen", {
                        get: function() {
                            return !this._loadingScreen && e.DefaultLoadingScreen && this._renderingCanvas && (this._loadingScreen = new e.DefaultLoadingScreen(this._renderingCanvas)), this._loadingScreen
                        },
                        set: function(e) {
                            this._loadingScreen = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "loadingUIText", {
                        set: function(e) {
                            this.loadingScreen.loadingUIText = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(i.prototype, "loadingUIBackgroundColor", {
                        set: function(e) {
                            this.loadingScreen.loadingUIBackgroundColor = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), i.prototype.attachContextLostEvent = function(e) {
                        this._renderingCanvas && this._renderingCanvas.addEventListener("webglcontextlost", e, !1)
                    }, i.prototype.attachContextRestoredEvent = function(e) {
                        this._renderingCanvas && this._renderingCanvas.addEventListener("webglcontextrestored", e, !1)
                    }, i.prototype.getVertexShaderSource = function(e) {
                        var t = this._gl.getAttachedShaders(e);
                        return t ? this._gl.getShaderSource(t[0]) : null
                    }, i.prototype.getFragmentShaderSource = function(e) {
                        var t = this._gl.getAttachedShaders(e);
                        return t ? this._gl.getShaderSource(t[1]) : null
                    }, i.prototype.getError = function() {
                        return this._gl.getError()
                    }, i.prototype.getFps = function() {
                        return this._fps
                    }, i.prototype.getDeltaTime = function() {
                        return this._deltaTime
                    }, i.prototype._measureFps = function() {
                        this._performanceMonitor.sampleFrame(), this._fps = this._performanceMonitor.averageFPS, this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0
                    }, i.prototype._readTexturePixels = function(e, t, i, r, n, o) {
                        void 0 === r && (r = -1), void 0 === n && (n = 0), void 0 === o && (o = null);
                        var s = this._gl;
                        if (!this._dummyFramebuffer) {
                            var a = s.createFramebuffer();
                            if (!a) throw new Error("Unable to create dummy framebuffer");
                            this._dummyFramebuffer = a
                        }
                        s.bindFramebuffer(s.FRAMEBUFFER, this._dummyFramebuffer), -1 < r ? s.framebufferTexture2D(s.FRAMEBUFFER, s.COLOR_ATTACHMENT0, s.TEXTURE_CUBE_MAP_POSITIVE_X + r, e._webGLTexture, n) : s.framebufferTexture2D(s.FRAMEBUFFER, s.COLOR_ATTACHMENT0, s.TEXTURE_2D, e._webGLTexture, n);
                        var l = void 0 !== e.type ? this._getWebGLTextureType(e.type) : s.UNSIGNED_BYTE;
                        switch (l) {
                            case s.UNSIGNED_BYTE:
                                o || (o = new Uint8Array(4 * t * i)), l = s.UNSIGNED_BYTE;
                                break;
                            default:
                                o || (o = new Float32Array(4 * t * i)), l = s.FLOAT
                        }
                        return s.readPixels(0, 0, t, i, s.RGBA, l, o), s.bindFramebuffer(s.FRAMEBUFFER, this._currentFramebuffer), o
                    }, i.prototype._canRenderToFloatFramebuffer = function() {
                        return 1 < this._webGLVersion ? this._caps.colorBufferFloat : this._canRenderToFramebuffer(i.TEXTURETYPE_FLOAT)
                    }, i.prototype._canRenderToHalfFloatFramebuffer = function() {
                        return 1 < this._webGLVersion ? this._caps.colorBufferFloat : this._canRenderToFramebuffer(i.TEXTURETYPE_HALF_FLOAT)
                    }, i.prototype._canRenderToFramebuffer = function(e) {
                        for (var t = this._gl; t.getError() !== t.NO_ERROR;);
                        var i = !0,
                            r = t.createTexture();
                        t.bindTexture(t.TEXTURE_2D, r), t.texImage2D(t.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(e), 1, 1, 0, t.RGBA, this._getWebGLTextureType(e), null), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.NEAREST), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.NEAREST);
                        var n = t.createFramebuffer();
                        t.bindFramebuffer(t.FRAMEBUFFER, n), t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, r, 0);
                        var o = t.checkFramebufferStatus(t.FRAMEBUFFER);
                        if ((i = (i = i && o === t.FRAMEBUFFER_COMPLETE) && t.getError() === t.NO_ERROR) && (t.clear(t.COLOR_BUFFER_BIT), i = i && t.getError() === t.NO_ERROR), i) {
                            t.bindFramebuffer(t.FRAMEBUFFER, null);
                            var s = t.RGBA,
                                a = t.UNSIGNED_BYTE,
                                l = new Uint8Array(4);
                            t.readPixels(0, 0, 1, 1, s, a, l), i = i && t.getError() === t.NO_ERROR
                        }
                        for (t.deleteTexture(r), t.deleteFramebuffer(n), t.bindFramebuffer(t.FRAMEBUFFER, null); !i && t.getError() !== t.NO_ERROR;);
                        return i
                    }, i.prototype._getWebGLTextureType = function(e) {
                        if (1 === this._webGLVersion) {
                            switch (e) {
                                case i.TEXTURETYPE_FLOAT:
                                    return this._gl.FLOAT;
                                case i.TEXTURETYPE_HALF_FLOAT:
                                    return this._gl.HALF_FLOAT_OES;
                                case i.TEXTURETYPE_UNSIGNED_BYTE:
                                    return this._gl.UNSIGNED_BYTE
                            }
                            return this._gl.UNSIGNED_BYTE
                        }
                        switch (e) {
                            case i.TEXTURETYPE_BYTE:
                                return this._gl.BYTE;
                            case i.TEXTURETYPE_UNSIGNED_BYTE:
                                return this._gl.UNSIGNED_BYTE;
                            case i.TEXTURETYPE_SHORT:
                                return this._gl.SHORT;
                            case i.TEXTURETYPE_UNSIGNED_SHORT:
                                return this._gl.UNSIGNED_SHORT;
                            case i.TEXTURETYPE_INT:
                                return this._gl.INT;
                            case i.TEXTURETYPE_UNSIGNED_INTEGER:
                                return this._gl.UNSIGNED_INT;
                            case i.TEXTURETYPE_FLOAT:
                                return this._gl.FLOAT;
                            case i.TEXTURETYPE_HALF_FLOAT:
                                return this._gl.HALF_FLOAT;
                            case i.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:
                                return this._gl.UNSIGNED_SHORT_4_4_4_4;
                            case i.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:
                                return this._gl.UNSIGNED_SHORT_5_5_5_1;
                            case i.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:
                                return this._gl.UNSIGNED_SHORT_5_6_5;
                            case i.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:
                                return this._gl.UNSIGNED_INT_2_10_10_10_REV;
                            case i.TEXTURETYPE_UNSIGNED_INT_24_8:
                                return this._gl.UNSIGNED_INT_24_8;
                            case i.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:
                                return this._gl.UNSIGNED_INT_10F_11F_11F_REV;
                            case i.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:
                                return this._gl.UNSIGNED_INT_5_9_9_9_REV;
                            case i.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV:
                                return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV
                        }
                        return this._gl.UNSIGNED_BYTE
                    }, i.prototype._getInternalFormat = function(e) {
                        var t = this._gl.RGBA;
                        switch (e) {
                            case i.TEXTUREFORMAT_ALPHA:
                                t = this._gl.ALPHA;
                                break;
                            case i.TEXTUREFORMAT_LUMINANCE:
                                t = this._gl.LUMINANCE;
                                break;
                            case i.TEXTUREFORMAT_LUMINANCE_ALPHA:
                                t = this._gl.LUMINANCE_ALPHA;
                                break;
                            case i.TEXTUREFORMAT_RED:
                                t = this._gl.RED;
                                break;
                            case i.TEXTUREFORMAT_RG:
                                t = this._gl.RG;
                                break;
                            case i.TEXTUREFORMAT_RGB:
                                t = this._gl.RGB;
                                break;
                            case i.TEXTUREFORMAT_RGBA:
                                t = this._gl.RGBA
                        }
                        if (1 < this._webGLVersion) switch (e) {
                            case i.TEXTUREFORMAT_RED_INTEGER:
                                t = this._gl.RED_INTEGER;
                                break;
                            case i.TEXTUREFORMAT_RG_INTEGER:
                                t = this._gl.RG_INTEGER;
                                break;
                            case i.TEXTUREFORMAT_RGB_INTEGER:
                                t = this._gl.RGB_INTEGER;
                                break;
                            case i.TEXTUREFORMAT_RGBA_INTEGER:
                                t = this._gl.RGBA_INTEGER
                        }
                        return t
                    }, i.prototype._getRGBABufferInternalSizedFormat = function(e, t) {
                        if (1 === this._webGLVersion) {
                            if (void 0 !== t) switch (t) {
                                case i.TEXTUREFORMAT_ALPHA:
                                    return this._gl.ALPHA;
                                case i.TEXTUREFORMAT_LUMINANCE:
                                    return this._gl.LUMINANCE;
                                case i.TEXTUREFORMAT_LUMINANCE_ALPHA:
                                    return this._gl.LUMINANCE_ALPHA
                            }
                            return this._gl.RGBA
                        }
                        switch (e) {
                            case i.TEXTURETYPE_BYTE:
                                switch (t) {
                                    case i.TEXTUREFORMAT_RED:
                                        return this._gl.R8_SNORM;
                                    case i.TEXTUREFORMAT_RG:
                                        return this._gl.RG8_SNORM;
                                    case i.TEXTUREFORMAT_RGB:
                                        return this._gl.RGB8_SNORM;
                                    case i.TEXTUREFORMAT_RED_INTEGER:
                                        return this._gl.R8I;
                                    case i.TEXTUREFORMAT_RG_INTEGER:
                                        return this._gl.RG8I;
                                    case i.TEXTUREFORMAT_RGB_INTEGER:
                                        return this._gl.RGB8I;
                                    case i.TEXTUREFORMAT_RGBA_INTEGER:
                                        return this._gl.RGBA8I;
                                    default:
                                        return this._gl.RGBA8_SNORM
                                }
                            case i.TEXTURETYPE_UNSIGNED_BYTE:
                                switch (t) {
                                    case i.TEXTUREFORMAT_RED:
                                        return this._gl.R8;
                                    case i.TEXTUREFORMAT_RG:
                                        return this._gl.RG8;
                                    case i.TEXTUREFORMAT_RGB:
                                        return this._gl.RGB8;
                                    case i.TEXTUREFORMAT_RGBA:
                                        return this._gl.RGBA8;
                                    case i.TEXTUREFORMAT_RED_INTEGER:
                                        return this._gl.R8UI;
                                    case i.TEXTUREFORMAT_RG_INTEGER:
                                        return this._gl.RG8UI;
                                    case i.TEXTUREFORMAT_RGB_INTEGER:
                                        return this._gl.RGB8UI;
                                    case i.TEXTUREFORMAT_RGBA_INTEGER:
                                        return this._gl.RGBA8UI;
                                    default:
                                        return this._gl.RGBA8
                                }
                            case i.TEXTURETYPE_SHORT:
                                switch (t) {
                                    case i.TEXTUREFORMAT_RED_INTEGER:
                                        return this._gl.R16I;
                                    case i.TEXTUREFORMAT_RG_INTEGER:
                                        return this._gl.RG16I;
                                    case i.TEXTUREFORMAT_RGB_INTEGER:
                                        return this._gl.RGB16I;
                                    case i.TEXTUREFORMAT_RGBA_INTEGER:
                                    default:
                                        return this._gl.RGBA16I
                                }
                            case i.TEXTURETYPE_UNSIGNED_SHORT:
                                switch (t) {
                                    case i.TEXTUREFORMAT_RED_INTEGER:
                                        return this._gl.R16UI;
                                    case i.TEXTUREFORMAT_RG_INTEGER:
                                        return this._gl.RG16UI;
                                    case i.TEXTUREFORMAT_RGB_INTEGER:
                                        return this._gl.RGB16UI;
                                    case i.TEXTUREFORMAT_RGBA_INTEGER:
                                    default:
                                        return this._gl.RGBA16UI
                                }
                            case i.TEXTURETYPE_INT:
                                switch (t) {
                                    case i.TEXTUREFORMAT_RED_INTEGER:
                                        return this._gl.R32I;
                                    case i.TEXTUREFORMAT_RG_INTEGER:
                                        return this._gl.RG32I;
                                    case i.TEXTUREFORMAT_RGB_INTEGER:
                                        return this._gl.RGB32I;
                                    case i.TEXTUREFORMAT_RGBA_INTEGER:
                                    default:
                                        return this._gl.RGBA32I
                                }
                            case i.TEXTURETYPE_UNSIGNED_INTEGER:
                                switch (t) {
                                    case i.TEXTUREFORMAT_RED_INTEGER:
                                        return this._gl.R32UI;
                                    case i.TEXTUREFORMAT_RG_INTEGER:
                                        return this._gl.RG32UI;
                                    case i.TEXTUREFORMAT_RGB_INTEGER:
                                        return this._gl.RGB32UI;
                                    case i.TEXTUREFORMAT_RGBA_INTEGER:
                                    default:
                                        return this._gl.RGBA32UI
                                }
                            case i.TEXTURETYPE_FLOAT:
                                switch (t) {
                                    case i.TEXTUREFORMAT_RED:
                                        return this._gl.R32F;
                                    case i.TEXTUREFORMAT_RG:
                                        return this._gl.RG32F;
                                    case i.TEXTUREFORMAT_RGB:
                                        return this._gl.RGB32F;
                                    case i.TEXTUREFORMAT_RGBA:
                                    default:
                                        return this._gl.RGBA32F
                                }
                            case i.TEXTURETYPE_HALF_FLOAT:
                                switch (t) {
                                    case i.TEXTUREFORMAT_RED:
                                        return this._gl.R16F;
                                    case i.TEXTUREFORMAT_RG:
                                        return this._gl.RG16F;
                                    case i.TEXTUREFORMAT_RGB:
                                        return this._gl.RGB16F;
                                    case i.TEXTUREFORMAT_RGBA:
                                    default:
                                        return this._gl.RGBA16F
                                }
                            case i.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:
                                return this._gl.RGB565;
                            case i.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:
                                return this._gl.R11F_G11F_B10F;
                            case i.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:
                                return this._gl.RGB9_E5;
                            case i.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:
                                return this._gl.RGBA4;
                            case i.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:
                                return this._gl.RGB5_A1;
                            case i.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:
                                switch (t) {
                                    case i.TEXTUREFORMAT_RGBA:
                                        return this._gl.RGB10_A2;
                                    case i.TEXTUREFORMAT_RGBA_INTEGER:
                                        return this._gl.RGB10_A2UI;
                                    default:
                                        return this._gl.RGB10_A2
                                }
                        }
                        return this._gl.RGBA8
                    }, i.prototype._getRGBAMultiSampleBufferFormat = function(e) {
                        return e === i.TEXTURETYPE_FLOAT ? this._gl.RGBA32F : e === i.TEXTURETYPE_HALF_FLOAT ? this._gl.RGBA16F : this._gl.RGBA8
                    }, i.prototype._loadFile = function(t, i, r, n, o, s) {
                        var a = this,
                            l = e.Tools.LoadFile(t, i, r, n, o, s);
                        return this._activeRequests.push(l), l.onCompleteObservable.add(function(e) {
                            a._activeRequests.splice(a._activeRequests.indexOf(e), 1)
                        }), l
                    }, i.prototype._loadFileAsync = function(e, t, i) {
                        var r = this;
                        return new Promise(function(n, o) {
                            r._loadFile(e, function(e) {
                                n(e)
                            }, void 0, t, i, function(e, t) {
                                o(t)
                            })
                        })
                    }, i.prototype._partialLoadFile = function(e, t, i, r, n, o) {
                        void 0 === o && (o = null), this._loadFile(e, function(e) {
                            i[t] = e, 6 === ++i._internalCount && n(i)
                        }, void 0, void 0, !0, function(e, t) {
                            o && e && o(e.status + " " + e.statusText, t)
                        })
                    }, i.prototype._cascadeLoadFiles = function(e, t, i, r) {
                        void 0 === r && (r = null);
                        for (var n = [], o = n._internalCount = 0; o < 6; o++) this._partialLoadFile(i[o], o, n, e, t, r)
                    }, i.isSupported = function() {
                        try {
                            var e = document.createElement("canvas");
                            return null != (e.getContext("webgl") || e.getContext("experimental-webgl")) && !!window.WebGLRenderingContext
                        } catch (e) {
                            return !1
                        }
                    }, i.ExceptionList = [{
                        key: "Chrome/63.0",
                        capture: "63\\.0\\.3239\\.(\\d+)",
                        captureConstraint: 108,
                        targets: ["uniformBuffer"]
                    }, {
                        key: "Firefox/58",
                        capture: null,
                        captureConstraint: null,
                        targets: ["uniformBuffer"]
                    }, {
                        key: "Firefox/59",
                        capture: null,
                        captureConstraint: null,
                        targets: ["uniformBuffer"]
                    }, {
                        key: "Macintosh",
                        capture: null,
                        captureConstraint: null,
                        targets: ["textureBindingOptimization"]
                    }, {
                        key: "iPhone",
                        capture: null,
                        captureConstraint: null,
                        targets: ["textureBindingOptimization"]
                    }, {
                        key: "iPad",
                        capture: null,
                        captureConstraint: null,
                        targets: ["textureBindingOptimization"]
                    }], i.Instances = new Array, i._TextureLoaders = [], i.ALPHA_DISABLE = 0, i.ALPHA_ADD = 1, i.ALPHA_COMBINE = 2, i.ALPHA_SUBTRACT = 3, i.ALPHA_MULTIPLY = 4, i.ALPHA_MAXIMIZED = 5, i.ALPHA_ONEONE = 6, i.ALPHA_PREMULTIPLIED = 7, i.ALPHA_PREMULTIPLIED_PORTERDUFF = 8, i.ALPHA_INTERPOLATE = 9, i.ALPHA_SCREENMODE = 10, i.DELAYLOADSTATE_NONE = 0, i.DELAYLOADSTATE_LOADED = 1, i.DELAYLOADSTATE_LOADING = 2, i.DELAYLOADSTATE_NOTLOADED = 4, i.NEVER = 512, i.ALWAYS = 519, i.LESS = 513, i.EQUAL = 514, i.LEQUAL = 515, i.GREATER = 516, i.GEQUAL = 518, i.NOTEQUAL = 517, i.KEEP = 7680, i.REPLACE = 7681, i.INCR = 7682, i.DECR = 7683, i.INVERT = 5386, i.INCR_WRAP = 34055, i.DECR_WRAP = 34056, i.TEXTURE_CLAMP_ADDRESSMODE = 0, i.TEXTURE_WRAP_ADDRESSMODE = 1, i.TEXTURE_MIRROR_ADDRESSMODE = 2, i.TEXTUREFORMAT_ALPHA = 0, i.TEXTUREFORMAT_LUMINANCE = 1, i.TEXTUREFORMAT_LUMINANCE_ALPHA = 2, i.TEXTUREFORMAT_RGB = 4, i.TEXTUREFORMAT_RGBA = 5, i.TEXTUREFORMAT_RED = 6, i.TEXTUREFORMAT_R = 6, i.TEXTUREFORMAT_RG = 7, i.TEXTUREFORMAT_RED_INTEGER = 8, i.TEXTUREFORMAT_R_INTEGER = 8, i.TEXTUREFORMAT_RG_INTEGER = 9, i.TEXTUREFORMAT_RGB_INTEGER = 10, i.TEXTUREFORMAT_RGBA_INTEGER = 11, i.TEXTURETYPE_UNSIGNED_BYTE = 0, i.TEXTURETYPE_UNSIGNED_INT = 0, i.TEXTURETYPE_FLOAT = 1, i.TEXTURETYPE_HALF_FLOAT = 2, i.TEXTURETYPE_BYTE = 3, i.TEXTURETYPE_SHORT = 4, i.TEXTURETYPE_UNSIGNED_SHORT = 5, i.TEXTURETYPE_INT = 6, i.TEXTURETYPE_UNSIGNED_INTEGER = 7, i.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8, i.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9, i.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10, i.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11, i.TEXTURETYPE_UNSIGNED_INT_24_8 = 12, i.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13, i.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14, i.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15, i.TEXTURE_NEAREST_SAMPLINGMODE = 1, i.TEXTURE_BILINEAR_SAMPLINGMODE = 2, i.TEXTURE_TRILINEAR_SAMPLINGMODE = 3, i.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 1, i.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 2, i.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3, i.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4, i.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5, i.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6, i.TEXTURE_NEAREST_LINEAR = 7, i.TEXTURE_NEAREST_NEAREST = 8, i.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9, i.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10, i.TEXTURE_LINEAR_LINEAR = 11, i.TEXTURE_LINEAR_NEAREST = 12, i.TEXTURE_EXPLICIT_MODE = 0, i.TEXTURE_SPHERICAL_MODE = 1, i.TEXTURE_PLANAR_MODE = 2, i.TEXTURE_CUBIC_MODE = 3, i.TEXTURE_PROJECTION_MODE = 4, i.TEXTURE_SKYBOX_MODE = 5, i.TEXTURE_INVCUBIC_MODE = 6, i.TEXTURE_EQUIRECTANGULAR_MODE = 7, i.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8, i.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9, i.SCALEMODE_FLOOR = 1, i.SCALEMODE_NEAREST = 2, i.SCALEMODE_CEILING = 3, i.CollisionsEpsilon = .001, i.CodeRepository = "src/", i.ShadersRepository = "src/Shaders/", i
                }();
                e.Engine = s
            }($a || ($a = {})), x = $a || ($a = {}), T = function() {
                    function e(e, t) {
                        void 0 === t && (t = null), this.state = "", this.metadata = null, this.doNotSerialize = !1, this._isDisposed = !1, this.animations = new Array, this._ranges = {}, this._isEnabled = !0, this._isParentEnabled = !0, this._isReady = !0, this._currentRenderId = -1, this._parentRenderId = -1, this._childRenderId = -1, this._worldMatrix = x.Matrix.Identity(), this._worldMatrixDeterminant = 0, this._sceneRootNodesIndex = -1, this._animationPropertiesOverride = null, this.onDisposeObservable = new x.Observable, this._behaviors = new Array, this.name = e, this.id = e, this._scene = t || x.Engine.LastCreatedScene, this.uniqueId = this._scene.getUniqueId(), this._initCache(), this.addToSceneRootNodes()
                    }
                    return e.AddNodeConstructor = function(e, t) {
                        this._NodeConstructors[e] = t
                    }, e.Construct = function(e, t, i, r) {
                        var n = this._NodeConstructors[e];
                        return n ? n(t, i, r) : null
                    }, e.prototype.isDisposed = function() {
                        return this._isDisposed
                    }, Object.defineProperty(e.prototype, "parent", {
                        get: function() {
                            return this._parentNode
                        },
                        set: function(e) {
                            if (this._parentNode !== e) {
                                var t = this._parentNode;
                                if (this._parentNode && void 0 !== this._parentNode._children && null !== this._parentNode._children) {
                                    var i = this._parentNode._children.indexOf(this); - 1 !== i && this._parentNode._children.splice(i, 1), e || this.addToSceneRootNodes()
                                }
                                this._parentNode = e, this._parentNode && (void 0 !== this._parentNode._children && null !== this._parentNode._children || (this._parentNode._children = new Array), this._parentNode._children.push(this), t || this.removeFromSceneRootNodes()), this._syncParentEnabledState()
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.addToSceneRootNodes = function() {
                        -1 === this._sceneRootNodesIndex && (this._sceneRootNodesIndex = this._scene.rootNodes.length, this._scene.rootNodes.push(this))
                    }, e.prototype.removeFromSceneRootNodes = function() {
                        if (-1 !== this._sceneRootNodesIndex) {
                            var e = this._scene.rootNodes,
                                t = e.length - 1;
                            e[this._sceneRootNodesIndex] = e[t], e[this._sceneRootNodesIndex]._sceneRootNodesIndex = this._sceneRootNodesIndex, this._scene.rootNodes.pop(), this._sceneRootNodesIndex = -1
                        }
                    }, Object.defineProperty(e.prototype, "animationPropertiesOverride", {
                        get: function() {
                            return this._animationPropertiesOverride ? this._animationPropertiesOverride : this._scene.animationPropertiesOverride
                        },
                        set: function(e) {
                            this._animationPropertiesOverride = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getClassName = function() {
                        return "Node"
                    }, Object.defineProperty(e.prototype, "onDispose", {
                        set: function(e) {
                            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getScene = function() {
                        return this._scene
                    }, e.prototype.getEngine = function() {
                        return this._scene.getEngine()
                    }, e.prototype.addBehavior = function(e, t) {
                        var i = this;
                        return void 0 === t && (t = !1), -1 !== this._behaviors.indexOf(e) || (e.init(), this._scene.isLoading && !t ? this._scene.onDataLoadedObservable.addOnce(function() {
                            e.attach(i)
                        }) : e.attach(this), this._behaviors.push(e)), this
                    }, e.prototype.removeBehavior = function(e) {
                        var t = this._behaviors.indexOf(e);
                        return -1 === t || (this._behaviors[t].detach(), this._behaviors.splice(t, 1)), this
                    }, Object.defineProperty(e.prototype, "behaviors", {
                        get: function() {
                            return this._behaviors
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getBehaviorByName = function(e) {
                        for (var t = 0, i = this._behaviors; t < i.length; t++) {
                            var r = i[t];
                            if (r.name === e) return r
                        }
                        return null
                    }, e.prototype.getWorldMatrix = function() {
                        return this._currentRenderId !== this._scene.getRenderId() && this.computeWorldMatrix(), this._worldMatrix
                    }, e.prototype._getWorldMatrixDeterminant = function() {
                        return this._worldMatrixDeterminant
                    }, Object.defineProperty(e.prototype, "worldMatrixFromCache", {
                        get: function() {
                            return this._worldMatrix
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._initCache = function() {
                        this._cache = {}, this._cache.parent = void 0
                    }, e.prototype.updateCache = function(e) {
                        !e && this.isSynchronized() || (this._cache.parent = this.parent, this._updateCache())
                    }, e.prototype._updateCache = function(e) {}, e.prototype._isSynchronized = function() {
                        return !0
                    }, e.prototype._markSyncedWithParent = function() {
                        this._parentNode && (this._parentRenderId = this._parentNode._childRenderId)
                    }, e.prototype.isSynchronizedWithParent = function() {
                        return !this._parentNode || this._parentRenderId === this._parentNode._childRenderId && this._parentNode.isSynchronized()
                    }, e.prototype.isSynchronized = function() {
                        return this._cache.parent != this._parentNode ? (this._cache.parent = this._parentNode, !1) : !(this._parentNode && !this.isSynchronizedWithParent()) && this._isSynchronized()
                    }, e.prototype.isReady = function(e) {
                        return void 0 === e && (e = !1), this._isReady
                    }, e.prototype.isEnabled = function(e) {
                        return void 0 === e && (e = !0), !1 === e ? this._isEnabled : !!this._isEnabled && this._isParentEnabled
                    }, e.prototype._syncParentEnabledState = function() {
                        this._isParentEnabled = !this._parentNode || this._parentNode.isEnabled(), this._children && this._children.forEach(function(e) {
                            e._syncParentEnabledState()
                        })
                    }, e.prototype.setEnabled = function(e) {
                        this._isEnabled = e, this._syncParentEnabledState()
                    }, e.prototype.isDescendantOf = function(e) {
                        return !!this.parent && (this.parent === e || this.parent.isDescendantOf(e))
                    }, e.prototype._getDescendants = function(e, t, i) {
                        if (void 0 === t && (t = !1), this._children)
                            for (var r = 0; r < this._children.length; r++) {
                                var n = this._children[r];
                                i && !i(n) || e.push(n), t || n._getDescendants(e, !1, i)
                            }
                    }, e.prototype.getDescendants = function(e, t) {
                        var i = new Array;
                        return this._getDescendants(i, e, t), i
                    }, e.prototype.getChildMeshes = function(e, t) {
                        var i = [];
                        return this._getDescendants(i, e, function(e) {
                            return (!t || t(e)) && e instanceof x.AbstractMesh
                        }), i
                    }, e.prototype.getChildTransformNodes = function(e, t) {
                        var i = [];
                        return this._getDescendants(i, e, function(e) {
                            return (!t || t(e)) && e instanceof x.TransformNode
                        }), i
                    }, e.prototype.getChildren = function(e) {
                        return this.getDescendants(!0, e)
                    }, e.prototype._setReady = function(e) {
                        e !== this._isReady && (e ? (this.onReady && this.onReady(this), this._isReady = !0) : this._isReady = !1)
                    }, e.prototype.getAnimationByName = function(e) {
                        for (var t = 0; t < this.animations.length; t++) {
                            var i = this.animations[t];
                            if (i.name === e) return i
                        }
                        return null
                    }, e.prototype.createAnimationRange = function(e, t, i) {
                        if (!this._ranges[e]) {
                            this._ranges[e] = new x.AnimationRange(e, t, i);
                            for (var r = 0, n = this.animations.length; r < n; r++) this.animations[r] && this.animations[r].createRange(e, t, i)
                        }
                    }, e.prototype.deleteAnimationRange = function(e, t) {
                        void 0 === t && (t = !0);
                        for (var i = 0, r = this.animations.length; i < r; i++) this.animations[i] && this.animations[i].deleteRange(e, t);
                        this._ranges[e] = null
                    }, e.prototype.getAnimationRange = function(e) {
                        return this._ranges[e]
                    }, e.prototype.beginAnimation = function(e, t, i, r) {
                        var n = this.getAnimationRange(e);
                        return n ? this._scene.beginAnimation(this, n.from, n.to, t, i, r) : null
                    }, e.prototype.serializeAnimationRanges = function() {
                        var e = [];
                        for (var t in this._ranges) {
                            var i = this._ranges[t];
                            if (i) {
                                var r = {};
                                r.name = t, r.from = i.from, r.to = i.to, e.push(r)
                            }
                        }
                        return e
                    }, e.prototype.computeWorldMatrix = function(e) {
                        return this._worldMatrix || (this._worldMatrix = x.Matrix.Identity()), this._worldMatrix
                    }, e.prototype.dispose = function(e, t) {
                        if (void 0 === t && (t = !1), e)
                            for (var i = 0, r = this.getChildTransformNodes(!0); i < r.length; i++) {
                                var n = r[i];
                                n.parent = null, n.computeWorldMatrix(!0)
                            } else
                                for (var o = 0, s = this.getDescendants(!0); o < s.length; o++) s[o].dispose(e, t);
                        this.parent ? this.parent = null : this.removeFromSceneRootNodes(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();
                        for (var a = 0, l = this._behaviors; a < l.length; a++) l[a].detach();
                        this._behaviors = [], this._isDisposed = !0
                    }, e.ParseAnimationRanges = function(e, t, i) {
                        if (t.ranges)
                            for (var r = 0; r < t.ranges.length; r++) {
                                var n = t.ranges[r];
                                e.createAnimationRange(n.name, n.from, n.to)
                            }
                    }, e._NodeConstructors = {}, y([x.serialize()], e.prototype, "name", void 0), y([x.serialize()], e.prototype, "id", void 0), y([x.serialize()], e.prototype, "uniqueId", void 0), y([x.serialize()], e.prototype, "state", void 0), y([x.serialize()], e.prototype, "metadata", void 0), e
                }(), x.Node = T, E = $a || ($a = {}), S = E.Matrix.Identity(), P = function() {
                    function e(e, t) {
                        this.center = E.Vector3.Zero(), this.centerWorld = E.Vector3.Zero(), this.minimum = E.Vector3.Zero(), this.maximum = E.Vector3.Zero(), this.reConstruct(e, t)
                    }
                    return e.prototype.reConstruct = function(e, t) {
                        this.minimum.copyFrom(e), this.maximum.copyFrom(t);
                        var i = E.Vector3.Distance(e, t);
                        E.Vector3.LerpToRef(e, t, .5, this.center), this.radius = .5 * i, this.centerWorld.set(0, 0, 0), this._update(S)
                    }, e.prototype.scale = function(e) {
                        var t = this.radius * e,
                            i = E.Tmp.Vector3[0].set(t, t, t),
                            r = E.Tmp.Vector3[1].copyFrom(this.center).subtractInPlace(i),
                            n = E.Tmp.Vector3[2].copyFrom(this.center).addInPlace(i);
                        return this.reConstruct(r, n), this
                    }, e.prototype._update = function(e) {
                        E.Vector3.TransformCoordinatesToRef(this.center, e, this.centerWorld);
                        var t = E.Tmp.Vector3[0];
                        E.Vector3.TransformNormalFromFloatsToRef(1, 1, 1, e, t), this.radiusWorld = Math.max(Math.abs(t.x), Math.abs(t.y), Math.abs(t.z)) * this.radius
                    }, e.prototype.isInFrustum = function(e) {
                        for (var t = 0; t < 6; t++)
                            if (e[t].dotCoordinate(this.centerWorld) <= -this.radiusWorld) return !1;
                        return !0
                    }, e.prototype.intersectsPoint = function(e) {
                        var t = this.centerWorld.x - e.x,
                            i = this.centerWorld.y - e.y,
                            r = this.centerWorld.z - e.z,
                            n = Math.sqrt(t * t + i * i + r * r);
                        return !(this.radiusWorld < n)
                    }, e.Intersects = function(e, t) {
                        var i = e.centerWorld.x - t.centerWorld.x,
                            r = e.centerWorld.y - t.centerWorld.y,
                            n = e.centerWorld.z - t.centerWorld.z,
                            o = Math.sqrt(i * i + r * r + n * n);
                        return !(e.radiusWorld + t.radiusWorld < o)
                    }, e
                }(), E.BoundingSphere = P, A = $a || ($a = {}), C = function() {
                    function e(e, t) {
                        this.vectors = [A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero()], this.center = A.Vector3.Zero(), this.centerWorld = A.Vector3.Zero(), this.extendSize = A.Vector3.Zero(), this.extendSizeWorld = A.Vector3.Zero(), this.directions = [A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero()], this.vectorsWorld = [A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero(), A.Vector3.Zero()], this.minimumWorld = A.Vector3.Zero(), this.maximumWorld = A.Vector3.Zero(), this.minimum = A.Vector3.Zero(), this.maximum = A.Vector3.Zero(), this.reConstruct(e, t)
                    }
                    return e.prototype.reConstruct = function(e, t) {
                        this.minimum.copyFrom(e), this.maximum.copyFrom(t), this.vectors[0].copyFrom(this.minimum), this.vectors[1].copyFrom(this.maximum), this.vectors[2].copyFrom(this.minimum), this.vectors[3].copyFrom(this.minimum), this.vectors[4].copyFrom(this.minimum), this.vectors[5].copyFrom(this.maximum), this.vectors[6].copyFrom(this.maximum), this.vectors[7].copyFrom(this.maximum), this.vectors[2].x = this.maximum.x, this.vectors[3].y = this.maximum.y, this.vectors[4].z = this.maximum.z, this.vectors[5].z = this.minimum.z, this.vectors[6].x = this.minimum.x, this.vectors[7].y = this.minimum.y, this.center.copyFrom(this.maximum).addInPlace(this.minimum).scaleInPlace(.5), this.extendSize.copyFrom(this.maximum).subtractInPlace(this.minimum).scaleInPlace(.5);
                        for (var i = 0; i < 3; i++) this.directions[i].copyFromFloats(0, 0, 0);
                        for (i = 0; i < 8; i++) this.vectorsWorld[i].copyFromFloats(0, 0, 0);
                        this.minimumWorld.copyFromFloats(0, 0, 0), this.maximumWorld.copyFromFloats(0, 0, 0), this.centerWorld.copyFromFloats(0, 0, 0), this.extendSizeWorld.copyFromFloats(0, 0, 0), this._update(this._worldMatrix || A.Matrix.Identity())
                    }, e.prototype.scale = function(e) {
                        var t = A.Tmp.Vector3[0].copyFrom(this.maximum).subtractInPlace(this.minimum),
                            i = t.length() * e;
                        t.normalize();
                        var r = t.scaleInPlace(.5 * i),
                            n = A.Tmp.Vector3[1].copyFrom(this.center).subtractInPlace(r),
                            o = A.Tmp.Vector3[2].copyFrom(this.center).addInPlace(r);
                        return this.reConstruct(n, o), this
                    }, e.prototype.getWorldMatrix = function() {
                        return this._worldMatrix
                    }, e.prototype.setWorldMatrix = function(e) {
                        return this._worldMatrix.copyFrom(e), this
                    }, e.prototype._update = function(e) {
                        A.Vector3.FromFloatsToRef(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, this.minimumWorld), A.Vector3.FromFloatsToRef(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, this.maximumWorld);
                        for (var t = 0; t < 8; t++) {
                            var i = this.vectorsWorld[t];
                            A.Vector3.TransformCoordinatesToRef(this.vectors[t], e, i), this.minimumWorld.minimizeInPlace(i), this.maximumWorld.maximizeInPlace(i)
                        }
                        this.maximumWorld.subtractToRef(this.minimumWorld, this.extendSizeWorld), this.extendSizeWorld.scaleInPlace(.5), this.maximumWorld.addToRef(this.minimumWorld, this.centerWorld), this.centerWorld.scaleInPlace(.5), A.Vector3.FromFloatArrayToRef(e.m, 0, this.directions[0]), A.Vector3.FromFloatArrayToRef(e.m, 4, this.directions[1]), A.Vector3.FromFloatArrayToRef(e.m, 8, this.directions[2]), this._worldMatrix = e
                    }, e.prototype.isInFrustum = function(t) {
                        return e.IsInFrustum(this.vectorsWorld, t)
                    }, e.prototype.isCompletelyInFrustum = function(t) {
                        return e.IsCompletelyInFrustum(this.vectorsWorld, t)
                    }, e.prototype.intersectsPoint = function(e) {
                        var t = -A.Epsilon;
                        return !(this.maximumWorld.x - e.x < t || t > e.x - this.minimumWorld.x || this.maximumWorld.y - e.y < t || t > e.y - this.minimumWorld.y || this.maximumWorld.z - e.z < t || t > e.z - this.minimumWorld.z)
                    }, e.prototype.intersectsSphere = function(t) {
                        return e.IntersectsSphere(this.minimumWorld, this.maximumWorld, t.centerWorld, t.radiusWorld)
                    }, e.prototype.intersectsMinMax = function(e, t) {
                        return !(this.maximumWorld.x < e.x || this.minimumWorld.x > t.x || this.maximumWorld.y < e.y || this.minimumWorld.y > t.y || this.maximumWorld.z < e.z || this.minimumWorld.z > t.z)
                    }, e.Intersects = function(e, t) {
                        return !(e.maximumWorld.x < t.minimumWorld.x || e.minimumWorld.x > t.maximumWorld.x || e.maximumWorld.y < t.minimumWorld.y || e.minimumWorld.y > t.maximumWorld.y || e.maximumWorld.z < t.minimumWorld.z || e.minimumWorld.z > t.maximumWorld.z)
                    }, e.IntersectsSphere = function(e, t, i, r) {
                        var n = A.Vector3.Clamp(i, e, t);
                        return A.Vector3.DistanceSquared(i, n) <= r * r
                    }, e.IsCompletelyInFrustum = function(e, t) {
                        for (var i = 0; i < 6; i++)
                            for (var r = 0; r < 8; r++)
                                if (t[i].dotCoordinate(e[r]) < 0) return !1;
                        return !0
                    }, e.IsInFrustum = function(e, t) {
                        for (var i = 0; i < 6; i++) {
                            for (var r = 8, n = 0; n < 8 && t[i].dotCoordinate(e[n]) < 0; n++) --r;
                            if (0 === r) return !1
                        }
                        return !0
                    }, e
                }(), A.BoundingBox = C, M = $a || ($a = {}), R = function(e, t) {
                    var i = M.Vector3.Dot(t.centerWorld, e),
                        r = Math.abs(M.Vector3.Dot(t.directions[0], e)) * t.extendSize.x + Math.abs(M.Vector3.Dot(t.directions[1], e)) * t.extendSize.y + Math.abs(M.Vector3.Dot(t.directions[2], e)) * t.extendSize.z;
                    return {
                        min: i - r,
                        max: i + r
                    }
                }, O = function(e, t, i) {
                    var r, n, o, s = R(e, t),
                        a = R(e, i);
                    return r = s.min, n = s.max, o = a.min, !(a.max < r || n < o)
                }, w = function() {
                    function e(e, t) {
                        this._isLocked = !1, this.boundingBox = new M.BoundingBox(e, t), this.boundingSphere = new M.BoundingSphere(e, t)
                    }
                    return Object.defineProperty(e.prototype, "minimum", {
                        get: function() {
                            return this.boundingBox.minimum
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "maximum", {
                        get: function() {
                            return this.boundingBox.maximum
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "isLocked", {
                        get: function() {
                            return this._isLocked
                        },
                        set: function(e) {
                            this._isLocked = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.update = function(e) {
                        this._isLocked || (this.boundingBox._update(e), this.boundingSphere._update(e))
                    }, e.prototype.centerOn = function(e, t) {
                        var i = M.Tmp.Vector3[0].copyFrom(e).subtractInPlace(t),
                            r = M.Tmp.Vector3[1].copyFrom(e).addInPlace(t);
                        return this.boundingBox.reConstruct(i, r), this.boundingSphere.reConstruct(i, r), this
                    }, e.prototype.scale = function(e) {
                        return this.boundingBox.scale(e), this.boundingSphere.scale(e), this
                    }, e.prototype.isInFrustum = function(e, t) {
                        return void 0 === t && (t = M.AbstractMesh.CULLINGSTRATEGY_STANDARD), !!this.boundingSphere.isInFrustum(e) && (t === M.AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY || this.boundingBox.isInFrustum(e))
                    }, Object.defineProperty(e.prototype, "diagonalLength", {
                        get: function() {
                            var e = this.boundingBox;
                            return e.maximumWorld.subtract(e.minimumWorld).length()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.isCompletelyInFrustum = function(e) {
                        return this.boundingBox.isCompletelyInFrustum(e)
                    }, e.prototype._checkCollision = function(e) {
                        return e._canDoCollision(this.boundingSphere.centerWorld, this.boundingSphere.radiusWorld, this.boundingBox.minimumWorld, this.boundingBox.maximumWorld)
                    }, e.prototype.intersectsPoint = function(e) {
                        return !!this.boundingSphere.centerWorld && !!this.boundingSphere.intersectsPoint(e) && !!this.boundingBox.intersectsPoint(e)
                    }, e.prototype.intersects = function(e, t) {
                        if (!this.boundingSphere.centerWorld || !e.boundingSphere.centerWorld) return !1;
                        if (!M.BoundingSphere.Intersects(this.boundingSphere, e.boundingSphere)) return !1;
                        if (!M.BoundingBox.Intersects(this.boundingBox, e.boundingBox)) return !1;
                        if (!t) return !0;
                        var i = this.boundingBox,
                            r = e.boundingBox;
                        return !!(O(i.directions[0], i, r) && O(i.directions[1], i, r) && O(i.directions[2], i, r) && O(r.directions[0], i, r) && O(r.directions[1], i, r) && O(r.directions[2], i, r) && O(M.Vector3.Cross(i.directions[0], r.directions[0]), i, r) && O(M.Vector3.Cross(i.directions[0], r.directions[1]), i, r) && O(M.Vector3.Cross(i.directions[0], r.directions[2]), i, r) && O(M.Vector3.Cross(i.directions[1], r.directions[0]), i, r) && O(M.Vector3.Cross(i.directions[1], r.directions[1]), i, r) && O(M.Vector3.Cross(i.directions[1], r.directions[2]), i, r) && O(M.Vector3.Cross(i.directions[2], r.directions[0]), i, r) && O(M.Vector3.Cross(i.directions[2], r.directions[1]), i, r) && O(M.Vector3.Cross(i.directions[2], r.directions[2]), i, r))
                    }, e
                }(), M.BoundingInfo = w, I = $a || ($a = {}), D = function(e) {
                    function t(i, r, n) {
                        void 0 === r && (r = null), void 0 === n && (n = !0);
                        var o = e.call(this, i, r) || this;
                        return o._forward = new I.Vector3(0, 0, 1), o._forwardInverted = new I.Vector3(0, 0, -1), o._up = new I.Vector3(0, 1, 0), o._right = new I.Vector3(1, 0, 0), o._rightInverted = new I.Vector3(-1, 0, 0), o._position = I.Vector3.Zero(), o._rotation = I.Vector3.Zero(), o._scaling = I.Vector3.One(), o._isDirty = !1, o.billboardMode = t.BILLBOARDMODE_NONE, o.scalingDeterminant = 1, o.infiniteDistance = !1, o.ignoreNonUniformScaling = !1, o._localWorld = I.Matrix.Zero(), o._absolutePosition = I.Vector3.Zero(), o._pivotMatrix = I.Matrix.Identity(), o._postMultiplyPivotMatrix = !1, o._isWorldMatrixFrozen = !1, o.onAfterWorldMatrixUpdateObservable = new I.Observable, o._nonUniformScaling = !1, n && o.getScene().addTransformNode(o), o
                    }
                    return b(t, e), t.prototype.getClassName = function() {
                        return "TransformNode"
                    }, Object.defineProperty(t.prototype, "position", {
                        get: function() {
                            return this._position
                        },
                        set: function(e) {
                            this._position = e, this._isDirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "rotation", {
                        get: function() {
                            return this._rotation
                        },
                        set: function(e) {
                            this._rotation = e, this._isDirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "scaling", {
                        get: function() {
                            return this._scaling
                        },
                        set: function(e) {
                            this._scaling = e, this._isDirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "rotationQuaternion", {
                        get: function() {
                            return this._rotationQuaternion
                        },
                        set: function(e) {
                            (this._rotationQuaternion = e) && this.rotation.length() && this.rotation.copyFromFloats(0, 0, 0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "forward", {
                        get: function() {
                            return I.Vector3.Normalize(I.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._forwardInverted : this._forward, this.getWorldMatrix()))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "up", {
                        get: function() {
                            return I.Vector3.Normalize(I.Vector3.TransformNormal(this._up, this.getWorldMatrix()))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "right", {
                        get: function() {
                            return I.Vector3.Normalize(I.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._rightInverted : this._right, this.getWorldMatrix()))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.updatePoseMatrix = function(e) {
                        return this._poseMatrix.copyFrom(e), this
                    }, t.prototype.getPoseMatrix = function() {
                        return this._poseMatrix
                    }, t.prototype._isSynchronized = function() {
                        return !(this._isDirty || this.billboardMode !== this._cache.billboardMode || this.billboardMode !== t.BILLBOARDMODE_NONE || this._cache.pivotMatrixUpdated || this.infiniteDistance || !this._cache.position.equals(this._position) || this._rotationQuaternion && !this._cache.rotationQuaternion.equals(this._rotationQuaternion) || !this._cache.rotation.equals(this._rotation) || !this._cache.scaling.equals(this._scaling))
                    }, t.prototype._initCache = function() {
                        e.prototype._initCache.call(this), this._cache.localMatrixUpdated = !1, this._cache.position = I.Vector3.Zero(), this._cache.scaling = I.Vector3.Zero(), this._cache.rotation = I.Vector3.Zero(), this._cache.rotationQuaternion = new I.Quaternion(0, 0, 0, 0), this._cache.billboardMode = -1
                    }, t.prototype.markAsDirty = function(e) {
                        return "rotation" === e && (this.rotationQuaternion = null), this._currentRenderId = Number.MAX_VALUE, this._isDirty = !0, this
                    }, Object.defineProperty(t.prototype, "absolutePosition", {
                        get: function() {
                            return this._absolutePosition
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.setPreTransformMatrix = function(e) {
                        return this.setPivotMatrix(e, !1)
                    }, t.prototype.setPivotMatrix = function(e, t) {
                        return void 0 === t && (t = !0), this._pivotMatrix = e.clone(), this._cache.pivotMatrixUpdated = !0, this._postMultiplyPivotMatrix = t, this._postMultiplyPivotMatrix && (this._pivotMatrixInverse ? this._pivotMatrix.invertToRef(this._pivotMatrixInverse) : this._pivotMatrixInverse = I.Matrix.Invert(this._pivotMatrix)), this
                    }, t.prototype.getPivotMatrix = function() {
                        return this._pivotMatrix
                    }, t.prototype.freezeWorldMatrix = function() {
                        return this._isWorldMatrixFrozen = !1, this.computeWorldMatrix(!0), this._isWorldMatrixFrozen = !0, this
                    }, t.prototype.unfreezeWorldMatrix = function() {
                        return this._isWorldMatrixFrozen = !1, this.computeWorldMatrix(!0), this
                    }, Object.defineProperty(t.prototype, "isWorldMatrixFrozen", {
                        get: function() {
                            return this._isWorldMatrixFrozen
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getAbsolutePosition = function() {
                        return this.computeWorldMatrix(), this._absolutePosition
                    }, t.prototype.setAbsolutePosition = function(e) {
                        if (!e) return this;
                        var t, i, r;
                        if (void 0 === e.x) {
                            if (arguments.length < 3) return this;
                            t = e, i = arguments[1], r = arguments[2]
                        } else t = e.x, i = e.y, r = e.z;
                        if (this.parent) {
                            var n = this.parent.getWorldMatrix().clone();
                            n.invert();
                            var o = new I.Vector3(t, i, r);
                            this.position = I.Vector3.TransformCoordinates(o, n)
                        } else this.position.x = t, this.position.y = i, this.position.z = r;
                        return this
                    }, t.prototype.setPositionWithLocalVector = function(e) {
                        return this.computeWorldMatrix(), this.position = I.Vector3.TransformNormal(e, this._localWorld), this
                    }, t.prototype.getPositionExpressedInLocalSpace = function() {
                        this.computeWorldMatrix();
                        var e = this._localWorld.clone();
                        return e.invert(), I.Vector3.TransformNormal(this.position, e)
                    }, t.prototype.locallyTranslate = function(e) {
                        return this.computeWorldMatrix(!0), this.position = I.Vector3.TransformCoordinates(e, this._localWorld), this
                    }, t.prototype.lookAt = function(e, i, r, n, o) {
                        void 0 === i && (i = 0), void 0 === r && (r = 0), void 0 === n && (n = 0), void 0 === o && (o = I.Space.LOCAL);
                        var s = t._lookAtVectorCache,
                            a = o === I.Space.LOCAL ? this.position : this.getAbsolutePosition();
                        e.subtractToRef(a, s);
                        var l = -Math.atan2(s.z, s.x) - Math.PI / 2,
                            u = Math.sqrt(s.x * s.x + s.z * s.z),
                            c = Math.atan2(s.y, u);
                        return this.rotationQuaternion ? I.Quaternion.RotationYawPitchRollToRef(l + i, c + r, n, this.rotationQuaternion) : (this.rotation.x = c + r, this.rotation.y = l + i, this.rotation.z = n), this
                    }, t.prototype.getDirection = function(e) {
                        var t = I.Vector3.Zero();
                        return this.getDirectionToRef(e, t), t
                    }, t.prototype.getDirectionToRef = function(e, t) {
                        return I.Vector3.TransformNormalToRef(e, this.getWorldMatrix(), t), this
                    }, t.prototype.setPivotPoint = function(e, t) {
                        void 0 === t && (t = I.Space.LOCAL), 0 == this.getScene().getRenderId() && this.computeWorldMatrix(!0);
                        var i = this.getWorldMatrix();
                        if (t == I.Space.WORLD) {
                            var r = I.Tmp.Matrix[0];
                            i.invertToRef(r), e = I.Vector3.TransformCoordinates(e, r)
                        }
                        return this.setPivotMatrix(I.Matrix.Translation(-e.x, -e.y, -e.z), !0)
                    }, t.prototype.getPivotPoint = function() {
                        var e = I.Vector3.Zero();
                        return this.getPivotPointToRef(e), e
                    }, t.prototype.getPivotPointToRef = function(e) {
                        return e.x = -this._pivotMatrix.m[12], e.y = -this._pivotMatrix.m[13], e.z = -this._pivotMatrix.m[14], this
                    }, t.prototype.getAbsolutePivotPoint = function() {
                        var e = I.Vector3.Zero();
                        return this.getAbsolutePivotPointToRef(e), e
                    }, t.prototype.getAbsolutePivotPointToRef = function(e) {
                        return e.x = this._pivotMatrix.m[12], e.y = this._pivotMatrix.m[13], e.z = this._pivotMatrix.m[14], this.getPivotPointToRef(e), I.Vector3.TransformCoordinatesToRef(e, this.getWorldMatrix(), e), this
                    }, t.prototype.setParent = function(e) {
                        if (!e && !this.parent) return this;
                        if (e) {
                            r = I.Tmp.Quaternion[0], n = I.Tmp.Vector3[0], o = I.Tmp.Vector3[1];
                            var t = I.Tmp.Matrix[0],
                                i = I.Tmp.Matrix[1];
                            this.computeWorldMatrix(!0), e.computeWorldMatrix(!0), e.getWorldMatrix().invertToRef(i), this.getWorldMatrix().multiplyToRef(i, t), t.decompose(o, r, n), this.rotationQuaternion ? this.rotationQuaternion.copyFrom(r) : r.toEulerAnglesToRef(this.rotation), this.position.x = n.x, this.position.y = n.y, this.position.z = n.z, this.scaling.x = o.x, this.scaling.y = o.y, this.scaling.z = o.z
                        } else {
                            var r = I.Tmp.Quaternion[0],
                                n = I.Tmp.Vector3[0],
                                o = I.Tmp.Vector3[1];
                            this.parent && this.parent.computeWorldMatrix && this.parent.computeWorldMatrix(!0), this.computeWorldMatrix(!0), this.getWorldMatrix().decompose(o, r, n), this.rotationQuaternion ? this.rotationQuaternion.copyFrom(r) : r.toEulerAnglesToRef(this.rotation), this.scaling.x = o.x, this.scaling.y = o.y, this.scaling.z = o.z, this.position.x = n.x, this.position.y = n.y, this.position.z = n.z
                        }
                        return this.parent = e, this
                    }, Object.defineProperty(t.prototype, "nonUniformScaling", {
                        get: function() {
                            return this._nonUniformScaling
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._updateNonUniformScalingState = function(e) {
                        return this._nonUniformScaling !== e && (this._nonUniformScaling = e, !0)
                    }, t.prototype.attachToBone = function(e, t) {
                        return this._transformToBoneReferal = t, (this.parent = e).getWorldMatrix().determinant() < 0 && (this.scalingDeterminant *= -1), this
                    }, t.prototype.detachFromBone = function() {
                        return this.parent && (this.parent.getWorldMatrix().determinant() < 0 && (this.scalingDeterminant *= -1), this._transformToBoneReferal = null, this.parent = null), this
                    }, t.prototype.rotate = function(e, i, r) {
                        var n;
                        if (e.normalize(), this.rotationQuaternion || (this.rotationQuaternion = I.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z), this.rotation = I.Vector3.Zero()), r && r !== I.Space.LOCAL) {
                            if (this.parent) {
                                var o = this.parent.getWorldMatrix().clone();
                                o.invert(), e = I.Vector3.TransformNormal(e, o)
                            }(n = I.Quaternion.RotationAxisToRef(e, i, t._rotationAxisCache)).multiplyToRef(this.rotationQuaternion, this.rotationQuaternion)
                        } else n = I.Quaternion.RotationAxisToRef(e, i, t._rotationAxisCache), this.rotationQuaternion.multiplyToRef(n, this.rotationQuaternion);
                        return this
                    }, t.prototype.rotateAround = function(e, t, i) {
                        return t.normalize(), this.rotationQuaternion || (this.rotationQuaternion = I.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z), this.rotation.copyFromFloats(0, 0, 0)), e.subtractToRef(this.position, I.Tmp.Vector3[0]), I.Matrix.TranslationToRef(I.Tmp.Vector3[0].x, I.Tmp.Vector3[0].y, I.Tmp.Vector3[0].z, I.Tmp.Matrix[0]), I.Tmp.Matrix[0].invertToRef(I.Tmp.Matrix[2]), I.Matrix.RotationAxisToRef(t, i, I.Tmp.Matrix[1]), I.Tmp.Matrix[2].multiplyToRef(I.Tmp.Matrix[1], I.Tmp.Matrix[2]), I.Tmp.Matrix[2].multiplyToRef(I.Tmp.Matrix[0], I.Tmp.Matrix[2]), I.Tmp.Matrix[2].decompose(I.Tmp.Vector3[0], I.Tmp.Quaternion[0], I.Tmp.Vector3[1]), this.position.addInPlace(I.Tmp.Vector3[1]), I.Tmp.Quaternion[0].multiplyToRef(this.rotationQuaternion, this.rotationQuaternion), this
                    }, t.prototype.translate = function(e, t, i) {
                        var r = e.scale(t);
                        if (i && i !== I.Space.LOCAL) this.setAbsolutePosition(this.getAbsolutePosition().add(r));
                        else {
                            var n = this.getPositionExpressedInLocalSpace().add(r);
                            this.setPositionWithLocalVector(n)
                        }
                        return this
                    }, t.prototype.addRotation = function(e, t, i) {
                        var r;
                        this.rotationQuaternion ? r = this.rotationQuaternion : (r = I.Tmp.Quaternion[1], I.Quaternion.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, r));
                        var n = I.Tmp.Quaternion[0];
                        return I.Quaternion.RotationYawPitchRollToRef(t, e, i, n), r.multiplyInPlace(n), this.rotationQuaternion || r.toEulerAnglesToRef(this.rotation), this
                    }, t.prototype.computeWorldMatrix = function(e) {
                        if (this._isWorldMatrixFrozen) return this._worldMatrix;
                        if (!e && this.isSynchronized()) return this._currentRenderId = this.getScene().getRenderId(), this._worldMatrix;
                        this._updateCache(), this._cache.position.copyFrom(this.position), this._cache.scaling.copyFrom(this.scaling), this._cache.pivotMatrixUpdated = !1, this._cache.billboardMode = this.billboardMode, this._currentRenderId = this.getScene().getRenderId(), this._childRenderId = this.getScene().getRenderId(), this._isDirty = !1, I.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, I.Tmp.Matrix[1]), this.rotationQuaternion && this.rotation.length() && (this.rotationQuaternion.multiplyInPlace(I.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z)), this.rotation.copyFromFloats(0, 0, 0)), this.rotationQuaternion ? (this.rotationQuaternion.toRotationMatrix(I.Tmp.Matrix[0]), this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)) : (I.Matrix.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, I.Tmp.Matrix[0]), this._cache.rotation.copyFrom(this.rotation));
                        var i = this.getScene().activeCamera;
                        if (this.infiniteDistance && !this.parent && i) {
                            var r = i.getWorldMatrix(),
                                n = new I.Vector3(r.m[12], r.m[13], r.m[14]);
                            I.Matrix.TranslationToRef(this.position.x + n.x, this.position.y + n.y, this.position.z + n.z, I.Tmp.Matrix[2])
                        } else I.Matrix.TranslationToRef(this.position.x, this.position.y, this.position.z, I.Tmp.Matrix[2]);
                        if (this._pivotMatrix.multiplyToRef(I.Tmp.Matrix[1], I.Tmp.Matrix[4]), I.Tmp.Matrix[4].multiplyToRef(I.Tmp.Matrix[0], I.Tmp.Matrix[5]), this.billboardMode !== t.BILLBOARDMODE_NONE && i) {
                            if ((this.billboardMode & t.BILLBOARDMODE_ALL) !== t.BILLBOARDMODE_ALL) {
                                var o = I.Tmp.Vector3[3];
                                this.parent && this.parent.getWorldMatrix ? this._transformToBoneReferal ? (this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), I.Tmp.Matrix[6]), I.Vector3.TransformCoordinatesToRef(this.position, I.Tmp.Matrix[6], o)) : I.Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), o) : o.copyFrom(this.position), o.subtractInPlace(i.globalPosition);
                                var s = I.Tmp.Vector3[4].copyFromFloats(0, 0, 0);
                                (this.billboardMode & t.BILLBOARDMODE_X) === t.BILLBOARDMODE_X && (s.x = Math.atan2(-o.y, o.z)), (this.billboardMode & t.BILLBOARDMODE_Y) === t.BILLBOARDMODE_Y && (s.y = Math.atan2(o.x, o.z)), (this.billboardMode & t.BILLBOARDMODE_Z) === t.BILLBOARDMODE_Z && (s.z = Math.atan2(o.y, o.x)), I.Matrix.RotationYawPitchRollToRef(s.y, s.x, s.z, I.Tmp.Matrix[0])
                            } else I.Tmp.Matrix[1].copyFrom(i.getViewMatrix()), I.Tmp.Matrix[1].setTranslationFromFloats(0, 0, 0), I.Tmp.Matrix[1].invertToRef(I.Tmp.Matrix[0]);
                            I.Tmp.Matrix[1].copyFrom(I.Tmp.Matrix[5]), I.Tmp.Matrix[1].multiplyToRef(I.Tmp.Matrix[0], I.Tmp.Matrix[5])
                        }
                        return this._postMultiplyPivotMatrix && I.Tmp.Matrix[5].multiplyToRef(this._pivotMatrixInverse, I.Tmp.Matrix[5]), I.Tmp.Matrix[5].multiplyToRef(I.Tmp.Matrix[2], this._localWorld), this.parent && this.parent.getWorldMatrix ? (this.billboardMode !== t.BILLBOARDMODE_NONE ? (this._transformToBoneReferal ? (this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), I.Tmp.Matrix[6]), I.Tmp.Matrix[5].copyFrom(I.Tmp.Matrix[6])) : I.Tmp.Matrix[5].copyFrom(this.parent.getWorldMatrix()), this._localWorld.getTranslationToRef(I.Tmp.Vector3[5]), I.Vector3.TransformCoordinatesToRef(I.Tmp.Vector3[5], I.Tmp.Matrix[5], I.Tmp.Vector3[5]), this._worldMatrix.copyFrom(this._localWorld), this._worldMatrix.setTranslation(I.Tmp.Vector3[5])) : this._transformToBoneReferal ? (this._localWorld.multiplyToRef(this.parent.getWorldMatrix(), I.Tmp.Matrix[6]), I.Tmp.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), this._worldMatrix)) : this._localWorld.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix), this._markSyncedWithParent()) : this._worldMatrix.copyFrom(this._localWorld), this.ignoreNonUniformScaling ? this._updateNonUniformScalingState(!1) : this.scaling.isNonUniform ? this._updateNonUniformScalingState(!0) : this.parent && this.parent._nonUniformScaling ? this._updateNonUniformScalingState(this.parent._nonUniformScaling) : this._updateNonUniformScalingState(!1), this._afterComputeWorldMatrix(), this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]), this.onAfterWorldMatrixUpdateObservable.notifyObservers(this), this._poseMatrix || (this._poseMatrix = I.Matrix.Invert(this._worldMatrix)), this._worldMatrixDeterminant = this._worldMatrix.determinant(), this._worldMatrix
                    }, t.prototype._afterComputeWorldMatrix = function() {}, t.prototype.registerAfterWorldMatrixUpdate = function(e) {
                        return this.onAfterWorldMatrixUpdateObservable.add(e), this
                    }, t.prototype.unregisterAfterWorldMatrixUpdate = function(e) {
                        return this.onAfterWorldMatrixUpdateObservable.removeCallback(e), this
                    }, t.prototype.clone = function(e, i, r) {
                        var n = this,
                            o = I.SerializationHelper.Clone(function() {
                                return new t(e, n.getScene())
                            }, this);
                        if (o.name = e, o.id = e, i && (o.parent = i), !r)
                            for (var s = this.getDescendants(!0), a = 0; a < s.length; a++) {
                                var l = s[a];
                                l.clone && l.clone(e + "." + l.name, o)
                            }
                        return o
                    }, t.prototype.serialize = function(e) {
                        var t = I.SerializationHelper.Serialize(this, e);
                        return t.type = this.getClassName(), this.parent && (t.parentId = this.parent.id), I.Tags && I.Tags.HasTags(this) && (t.tags = I.Tags.GetTags(this)), t.localMatrix = this.getPivotMatrix().asArray(), t.isEnabled = this.isEnabled(), this.parent && (t.parentId = this.parent.id), t
                    }, t.Parse = function(e, i, r) {
                        var n = I.SerializationHelper.Parse(function() {
                            return new t(e.name, i)
                        }, e, i, r);
                        return I.Tags && I.Tags.AddTagsTo(n, e.tags), e.localMatrix ? n.setPreTransformMatrix(I.Matrix.FromArray(e.localMatrix)) : e.pivotMatrix && n.setPivotMatrix(I.Matrix.FromArray(e.pivotMatrix)), n.setEnabled(e.isEnabled), e.parentId && (n._waitingParentId = e.parentId), n
                    }, t.prototype.dispose = function(t, i) {
                        void 0 === i && (i = !1), this.getScene().stopAnimation(this), this.getScene().removeTransformNode(this), this.onAfterWorldMatrixUpdateObservable.clear(), e.prototype.dispose.call(this, t, i)
                    }, t.BILLBOARDMODE_NONE = 0, t.BILLBOARDMODE_X = 1, t.BILLBOARDMODE_Y = 2, t.BILLBOARDMODE_Z = 4, t.BILLBOARDMODE_ALL = 7, t._lookAtVectorCache = new I.Vector3(0, 0, 0), t._rotationAxisCache = new I.Quaternion, y([I.serializeAsVector3("position")], t.prototype, "_position", void 0), y([I.serializeAsVector3("rotation")], t.prototype, "_rotation", void 0), y([I.serializeAsQuaternion("rotationQuaternion")], t.prototype, "_rotationQuaternion", void 0), y([I.serializeAsVector3("scaling")], t.prototype, "_scaling", void 0), y([I.serialize()], t.prototype, "billboardMode", void 0), y([I.serialize()], t.prototype, "scalingDeterminant", void 0), y([I.serialize()], t.prototype, "infiniteDistance", void 0), y([I.serialize()], t.prototype, "ignoreNonUniformScaling", void 0), t
                }(I.Node), I.TransformNode = D, L = $a || ($a = {}), B = function() {
                    this.facetNb = 0, this.partitioningSubdivisions = 10, this.partitioningBBoxRatio = 1.01, this.facetDataEnabled = !1, this.facetParameters = {}, this.bbSize = L.Vector3.Zero(), this.subDiv = {
                        max: 1,
                        X: 1,
                        Y: 1,
                        Z: 1
                    }, this.facetDepthSort = !1, this.facetDepthSortEnabled = !1
                }, F = function(e) {
                    function t(i, r) {
                        void 0 === r && (r = null);
                        var n = e.call(this, i, r, !1) || this;
                        return n._facetData = new B, n.cullingStrategy = t.CULLINGSTRATEGY_STANDARD, n.onCollideObservable = new L.Observable, n.onCollisionPositionChangeObservable = new L.Observable, n.onMaterialChangedObservable = new L.Observable, n.definedFacingForward = !0, n._visibility = 1, n.alphaIndex = Number.MAX_VALUE, n.isVisible = !0, n.isPickable = !0, n.showSubMeshesBoundingBox = !1, n.isBlocker = !1, n.enablePointerMoveEvents = !1, n.renderingGroupId = 0, n._receiveShadows = !1, n.outlineColor = L.Color3.Red(), n.outlineWidth = .02, n.overlayColor = L.Color3.Red(), n.overlayAlpha = .5, n._hasVertexAlpha = !1, n._useVertexColors = !0, n._computeBonesUsingShaders = !0, n._numBoneInfluencers = 4, n._applyFog = !0, n.useOctreeForRenderingSelection = !0, n.useOctreeForPicking = !0, n.useOctreeForCollisions = !0, n._layerMask = 268435455, n.alwaysSelectAsActiveMesh = !1, n.actionManager = null, n._checkCollisions = !1, n._collisionMask = -1, n._collisionGroup = -1, n.ellipsoid = new L.Vector3(.5, 1, .5), n.ellipsoidOffset = new L.Vector3(0, 0, 0), n._oldPositionForCollisions = new L.Vector3(0, 0, 0), n._diffPositionForCollisions = new L.Vector3(0, 0, 0), n.edgesWidth = 1, n.edgesColor = new L.Color4(1, 0, 0, 1), n._renderId = 0, n._intersectionsInProgress = new Array, n._unIndexed = !1, n._lightSources = new Array, n.onRebuildObservable = new L.Observable, n._onCollisionPositionChange = function(e, t, i) {
                            void 0 === i && (i = null), n.getScene().workerCollisions && t.multiplyInPlace(n._collider._radius), t.subtractToRef(n._oldPositionForCollisions, n._diffPositionForCollisions), n._diffPositionForCollisions.length() > L.Engine.CollisionsEpsilon && n.position.addInPlace(n._diffPositionForCollisions), i && n.onCollideObservable.notifyObservers(i), n.onCollisionPositionChangeObservable.notifyObservers(n.position)
                        }, n.getScene().addMesh(n), n._resyncLightSources(), n
                    }
                    return b(t, e), Object.defineProperty(t, "BILLBOARDMODE_NONE", {
                            get: function() {
                                return L.TransformNode.BILLBOARDMODE_NONE
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "BILLBOARDMODE_X", {
                            get: function() {
                                return L.TransformNode.BILLBOARDMODE_X
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "BILLBOARDMODE_Y", {
                            get: function() {
                                return L.TransformNode.BILLBOARDMODE_Y
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "BILLBOARDMODE_Z", {
                            get: function() {
                                return L.TransformNode.BILLBOARDMODE_Z
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "BILLBOARDMODE_ALL", {
                            get: function() {
                                return L.TransformNode.BILLBOARDMODE_ALL
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "facetNb", {
                            get: function() {
                                return this._facetData.facetNb
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "partitioningSubdivisions", {
                            get: function() {
                                return this._facetData.partitioningSubdivisions
                            },
                            set: function(e) {
                                this._facetData.partitioningSubdivisions = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "partitioningBBoxRatio", {
                            get: function() {
                                return this._facetData.partitioningBBoxRatio
                            },
                            set: function(e) {
                                this._facetData.partitioningBBoxRatio = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "mustDepthSortFacets", {
                            get: function() {
                                return this._facetData.facetDepthSort
                            },
                            set: function(e) {
                                this._facetData.facetDepthSort = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "facetDepthSortFrom", {
                            get: function() {
                                return this._facetData.facetDepthSortFrom
                            },
                            set: function(e) {
                                this._facetData.facetDepthSortFrom = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "isFacetDataEnabled", {
                            get: function() {
                                return this._facetData.facetDataEnabled
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype._updateNonUniformScalingState = function(t) {
                            return !!e.prototype._updateNonUniformScalingState.call(this, t) && (this._markSubMeshesAsMiscDirty(), !0)
                        }, Object.defineProperty(t.prototype, "onCollide", {
                            set: function(e) {
                                this._onCollideObserver && this.onCollideObservable.remove(this._onCollideObserver), this._onCollideObserver = this.onCollideObservable.add(e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "onCollisionPositionChange", {
                            set: function(e) {
                                this._onCollisionPositionChangeObserver && this.onCollisionPositionChangeObservable.remove(this._onCollisionPositionChangeObserver), this._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "visibility", {
                            get: function() {
                                return this._visibility
                            },
                            set: function(e) {
                                this._visibility !== e && (this._visibility = e, this._markSubMeshesAsMiscDirty())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "material", {
                            get: function() {
                                return this._material
                            },
                            set: function(e) {
                                this._material !== e && (this._material = e, this.onMaterialChangedObservable.hasObservers && this.onMaterialChangedObservable.notifyObservers(this), this.subMeshes && this._unBindEffect())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "receiveShadows", {
                            get: function() {
                                return this._receiveShadows
                            },
                            set: function(e) {
                                this._receiveShadows !== e && (this._receiveShadows = e, this._markSubMeshesAsLightDirty())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "hasVertexAlpha", {
                            get: function() {
                                return this._hasVertexAlpha
                            },
                            set: function(e) {
                                this._hasVertexAlpha !== e && (this._hasVertexAlpha = e, this._markSubMeshesAsAttributesDirty(), this._markSubMeshesAsMiscDirty())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "useVertexColors", {
                            get: function() {
                                return this._useVertexColors
                            },
                            set: function(e) {
                                this._useVertexColors !== e && (this._useVertexColors = e, this._markSubMeshesAsAttributesDirty())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "computeBonesUsingShaders", {
                            get: function() {
                                return this._computeBonesUsingShaders
                            },
                            set: function(e) {
                                this._computeBonesUsingShaders !== e && (this._computeBonesUsingShaders = e, this._markSubMeshesAsAttributesDirty())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "numBoneInfluencers", {
                            get: function() {
                                return this._numBoneInfluencers
                            },
                            set: function(e) {
                                this._numBoneInfluencers !== e && (this._numBoneInfluencers = e, this._markSubMeshesAsAttributesDirty())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "applyFog", {
                            get: function() {
                                return this._applyFog
                            },
                            set: function(e) {
                                this._applyFog !== e && (this._applyFog = e, this._markSubMeshesAsMiscDirty())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "layerMask", {
                            get: function() {
                                return this._layerMask
                            },
                            set: function(e) {
                                e !== this._layerMask && (this._layerMask = e, this._resyncLightSources())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "collisionMask", {
                            get: function() {
                                return this._collisionMask
                            },
                            set: function(e) {
                                this._collisionMask = isNaN(e) ? -1 : e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "collisionGroup", {
                            get: function() {
                                return this._collisionGroup
                            },
                            set: function(e) {
                                this._collisionGroup = isNaN(e) ? -1 : e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "_positions", {
                            get: function() {
                                return null
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "skeleton", {
                            get: function() {
                                return this._skeleton
                            },
                            set: function(e) {
                                this._skeleton && this._skeleton.needInitialSkinMatrix && this._skeleton._unregisterMeshWithPoseMatrix(this), e && e.needInitialSkinMatrix && e._registerMeshWithPoseMatrix(this), this._skeleton = e, this._skeleton || (this._bonesTransformMatrices = null), this._markSubMeshesAsAttributesDirty()
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.getClassName = function() {
                            return "AbstractMesh"
                        }, t.prototype.toString = function(e) {
                            var t = "Name: " + this.name + ", isInstance: " + (this instanceof L.InstancedMesh ? "YES" : "NO");
                            return t += ", # of submeshes: " + (this.subMeshes ? this.subMeshes.length : 0), this._skeleton && (t += ", skeleton: " + this._skeleton.name), e && (t += ", billboard mode: " + ["NONE", "X", "Y", null, "Z", null, null, "ALL"][this.billboardMode], t += ", freeze wrld mat: " + (this._isWorldMatrixFrozen || this._waitingFreezeWorldMatrix ? "YES" : "NO")), t
                        }, t.prototype._rebuild = function() {
                            if (this.onRebuildObservable.notifyObservers(this), this._occlusionQuery && (this._occlusionQuery = null), this.subMeshes)
                                for (var e = 0, t = this.subMeshes; e < t.length; e++) t[e]._rebuild()
                        }, t.prototype._resyncLightSources = function() {
                            for (var e = this._lightSources.length = 0, t = this.getScene().lights; e < t.length; e++) {
                                var i = t[e];
                                i.isEnabled() && i.canAffectMesh(this) && this._lightSources.push(i)
                            }
                            this._markSubMeshesAsLightDirty()
                        }, t.prototype._resyncLighSource = function(e) {
                            var t = e.isEnabled() && e.canAffectMesh(this),
                                i = this._lightSources.indexOf(e);
                            if (-1 === i) {
                                if (!t) return;
                                this._lightSources.push(e)
                            } else {
                                if (t) return;
                                this._lightSources.splice(i, 1)
                            }
                            this._markSubMeshesAsLightDirty()
                        }, t.prototype._unBindEffect = function() {
                            for (var e = 0, t = this.subMeshes; e < t.length; e++) t[e].setEffect(null)
                        }, t.prototype._removeLightSource = function(e) {
                            var t = this._lightSources.indexOf(e); - 1 !== t && (this._lightSources.splice(t, 1), this._markSubMeshesAsLightDirty())
                        }, t.prototype._markSubMeshesAsDirty = function(e) {
                            if (this.subMeshes)
                                for (var t = 0, i = this.subMeshes; t < i.length; t++) {
                                    var r = i[t];
                                    r._materialDefines && e(r._materialDefines)
                                }
                        }, t.prototype._markSubMeshesAsLightDirty = function() {
                            this._markSubMeshesAsDirty(function(e) {
                                return e.markAsLightDirty()
                            })
                        }, t.prototype._markSubMeshesAsAttributesDirty = function() {
                            this._markSubMeshesAsDirty(function(e) {
                                return e.markAsAttributesDirty()
                            })
                        }, t.prototype._markSubMeshesAsMiscDirty = function() {
                            if (this.subMeshes)
                                for (var e = 0, t = this.subMeshes; e < t.length; e++) {
                                    var i = t[e].getMaterial();
                                    i && i.markAsDirty(L.Material.MiscDirtyFlag)
                                }
                        }, Object.defineProperty(t.prototype, "scaling", {
                            get: function() {
                                return this._scaling
                            },
                            set: function(e) {
                                this._scaling = e, this.physicsImpostor && this.physicsImpostor.forceUpdate()
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "isBlocked", {
                            get: function() {
                                return !1
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.getLOD = function(e) {
                            return this
                        }, t.prototype.getTotalVertices = function() {
                            return 0
                        }, t.prototype.getIndices = function() {
                            return null
                        }, t.prototype.getVerticesData = function(e) {
                            return null
                        }, t.prototype.setVerticesData = function(e, t, i, r) {
                            return this
                        }, t.prototype.updateVerticesData = function(e, t, i, r) {
                            return this
                        }, t.prototype.setIndices = function(e, t) {
                            return this
                        }, t.prototype.isVerticesDataPresent = function(e) {
                            return !1
                        }, t.prototype.getBoundingInfo = function() {
                            return this._masterMesh ? this._masterMesh.getBoundingInfo() : (this._boundingInfo || this._updateBoundingInfo(), this._boundingInfo)
                        }, t.prototype.normalizeToUnitCube = function(e) {
                            void 0 === e && (e = !0);
                            var t = this.getHierarchyBoundingVectors(e),
                                i = t.max.subtract(t.min),
                                r = Math.max(i.x, i.y, i.z);
                            if (0 === r) return this;
                            var n = 1 / r;
                            return this.scaling.scaleInPlace(n), this
                        }, t.prototype.setBoundingInfo = function(e) {
                            return this._boundingInfo = e, this
                        }, Object.defineProperty(t.prototype, "useBones", {
                            get: function() {
                                return this.skeleton && this.getScene().skeletonsEnabled && this.isVerticesDataPresent(L.VertexBuffer.MatricesIndicesKind) && this.isVerticesDataPresent(L.VertexBuffer.MatricesWeightsKind)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype._preActivate = function() {}, t.prototype._preActivateForIntermediateRendering = function(e) {}, t.prototype._activate = function(e) {
                            this._renderId = e
                        }, t.prototype.getWorldMatrix = function() {
                            return this._masterMesh ? this._masterMesh.getWorldMatrix() : e.prototype.getWorldMatrix.call(this)
                        }, t.prototype._getWorldMatrixDeterminant = function() {
                            return this._masterMesh ? this._masterMesh._getWorldMatrixDeterminant() : e.prototype._getWorldMatrixDeterminant.call(this)
                        }, t.prototype.movePOV = function(e, t, i) {
                            return this.position.addInPlace(this.calcMovePOV(e, t, i)), this
                        }, t.prototype.calcMovePOV = function(e, t, i) {
                            var r = new L.Matrix;
                            (this.rotationQuaternion ? this.rotationQuaternion : L.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z)).toRotationMatrix(r);
                            var n = L.Vector3.Zero(),
                                o = this.definedFacingForward ? -1 : 1;
                            return L.Vector3.TransformCoordinatesFromFloatsToRef(e * o, t, i * o, r, n), n
                        }, t.prototype.rotatePOV = function(e, t, i) {
                            return this.rotation.addInPlace(this.calcRotatePOV(e, t, i)), this
                        }, t.prototype.calcRotatePOV = function(e, t, i) {
                            var r = this.definedFacingForward ? 1 : -1;
                            return new L.Vector3(e * r, t, i * r)
                        }, t.prototype.getHierarchyBoundingVectors = function(e, t) {
                            var i, r;
                            void 0 === e && (e = !0), void 0 === t && (t = null), this.getScene().incrementRenderId(), this.computeWorldMatrix(!0);
                            var n = this.getBoundingInfo();
                            if (this.subMeshes ? (i = n.boundingBox.minimumWorld, r = n.boundingBox.maximumWorld) : (i = new L.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), r = new L.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE)), e)
                                for (var o = 0, s = this.getDescendants(!1); o < s.length; o++) {
                                    var a = s[o];
                                    if (a.computeWorldMatrix(!0), (!t || t(a)) && a.getBoundingInfo && 0 !== a.getTotalVertices()) {
                                        var l = a.getBoundingInfo().boundingBox,
                                            u = l.minimumWorld,
                                            c = l.maximumWorld;
                                        L.Tools.CheckExtends(u, i, r), L.Tools.CheckExtends(c, i, r)
                                    }
                                }
                            return {
                                min: i,
                                max: r
                            }
                        }, t.prototype._updateBoundingInfo = function() {
                            return this._boundingInfo = this._boundingInfo || new L.BoundingInfo(this.absolutePosition, this.absolutePosition), this._boundingInfo.update(this.worldMatrixFromCache), this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache), this
                        }, t.prototype._updateSubMeshesBoundingInfo = function(e) {
                            if (!this.subMeshes) return this;
                            for (var t = this.subMeshes.length, i = 0; i < t; i++) {
                                var r = this.subMeshes[i];
                                (1 < t || !r.IsGlobal) && r.updateBoundingInfo(e)
                            }
                            return this
                        }, t.prototype._afterComputeWorldMatrix = function() {
                            this._updateBoundingInfo()
                        }, t.prototype.isInFrustum = function(e) {
                            return null !== this._boundingInfo && this._boundingInfo.isInFrustum(e, this.cullingStrategy)
                        }, t.prototype.isCompletelyInFrustum = function(e) {
                            return null !== this._boundingInfo && this._boundingInfo.isCompletelyInFrustum(e)
                        }, t.prototype.intersectsMesh = function(e, t, i) {
                            if (void 0 === t && (t = !1), !this._boundingInfo || !e._boundingInfo) return !1;
                            if (this._boundingInfo.intersects(e._boundingInfo, t)) return !0;
                            if (i)
                                for (var r = 0, n = this.getChildMeshes(); r < n.length; r++)
                                    if (n[r].intersectsMesh(e, t, !0)) return !0;
                            return !1
                        },
                        t.prototype.intersectsPoint = function(e) {
                            return !!this._boundingInfo && this._boundingInfo.intersectsPoint(e)
                        }, t.prototype.getPositionInCameraSpace = function(e) {
                            return void 0 === e && (e = null), e || (e = this.getScene().activeCamera), L.Vector3.TransformCoordinates(this.absolutePosition, e.getViewMatrix())
                        }, t.prototype.getDistanceToCamera = function(e) {
                            return void 0 === e && (e = null), e || (e = this.getScene().activeCamera), this.absolutePosition.subtract(e.position).length()
                        }, Object.defineProperty(t.prototype, "checkCollisions", {
                            get: function() {
                                return this._checkCollisions
                            },
                            set: function(e) {
                                this._checkCollisions = e, this.getScene().workerCollisions && this.getScene().collisionCoordinator.onMeshUpdated(this)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "collider", {
                            get: function() {
                                return this._collider
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.moveWithCollisions = function(e) {
                            return this.getAbsolutePosition().addToRef(this.ellipsoidOffset, this._oldPositionForCollisions), this._collider || (this._collider = new L.Collider), this._collider._radius = this.ellipsoid, this.getScene().collisionCoordinator.getNewPosition(this._oldPositionForCollisions, e, this._collider, 3, this, this._onCollisionPositionChange, this.uniqueId), this
                        }, t.prototype._collideForSubMesh = function(e, t, i) {
                            if (this._generatePointsArray(), !this._positions) return this;
                            if (!e._lastColliderWorldVertices || !e._lastColliderTransformMatrix.equals(t)) {
                                e._lastColliderTransformMatrix = t.clone(), e._lastColliderWorldVertices = [], e._trianglePlanes = [];
                                for (var r = e.verticesStart, n = e.verticesStart + e.verticesCount, o = r; o < n; o++) e._lastColliderWorldVertices.push(L.Vector3.TransformCoordinates(this._positions[o], t))
                            }
                            return i._collide(e._trianglePlanes, e._lastColliderWorldVertices, this.getIndices(), e.indexStart, e.indexStart + e.indexCount, e.verticesStart, !!e.getMaterial()), i.collisionFound && (i.collidedMesh = this), this
                        }, t.prototype._processCollisionsForSubMeshes = function(e, t) {
                            for (var i = this._scene.getCollidingSubMeshCandidates(this, e), r = i.length, n = 0; n < r; n++) {
                                var o = i.data[n];
                                1 < r && !o._checkCollision(e) || this._collideForSubMesh(o, t, e)
                            }
                            return this
                        }, t.prototype._checkCollision = function(e) {
                            if (!this._boundingInfo || !this._boundingInfo._checkCollision(e)) return this;
                            var t = L.Tmp.Matrix[0],
                                i = L.Tmp.Matrix[1];
                            return L.Matrix.ScalingToRef(1 / e._radius.x, 1 / e._radius.y, 1 / e._radius.z, t), this.worldMatrixFromCache.multiplyToRef(t, i), this._processCollisionsForSubMeshes(e, i), this
                        }, t.prototype._generatePointsArray = function() {
                            return !1
                        }, t.prototype.intersects = function(e, t) {
                            var i = new L.PickingInfo;
                            if (!(this.subMeshes && this._boundingInfo && e.intersectsSphere(this._boundingInfo.boundingSphere) && e.intersectsBox(this._boundingInfo.boundingBox))) return i;
                            if (!this._generatePointsArray()) return i;
                            for (var r = null, n = this._scene.getIntersectingSubMeshCandidates(this, e), o = n.length, s = 0; s < o; s++) {
                                var a = n.data[s];
                                if (!(1 < o) || a.canIntersects(e)) {
                                    var l = a.intersects(e, this._positions, this.getIndices(), t);
                                    if (l && (t || !r || l.distance < r.distance) && ((r = l).subMeshId = s, t)) break
                                }
                            }
                            if (r) {
                                var u = this.getWorldMatrix(),
                                    c = L.Vector3.TransformCoordinates(e.origin, u),
                                    h = e.direction.clone();
                                h = h.scale(r.distance);
                                var d = L.Vector3.TransformNormal(h, u),
                                    p = c.add(d);
                                return i.hit = !0, i.distance = L.Vector3.Distance(c, p), i.pickedPoint = p, i.pickedMesh = this, i.bu = r.bu || 0, i.bv = r.bv || 0, i.faceId = r.faceId, i.subMeshId = r.subMeshId, i
                            }
                            return i
                        }, t.prototype.clone = function(e, t, i) {
                            return null
                        }, t.prototype.releaseSubMeshes = function() {
                            if (this.subMeshes)
                                for (; this.subMeshes.length;) this.subMeshes[0].dispose();
                            else this.subMeshes = new Array;
                            return this
                        }, t.prototype.dispose = function(t, i) {
                            var r, n = this;
                            for (void 0 === i && (i = !1), this.getScene().freeActiveMeshes(), this.getScene().freeRenderingGroups(), void 0 !== this.actionManager && null !== this.actionManager && (this.actionManager.dispose(), this.actionManager = null), this._skeleton = null, r = 0; r < this._intersectionsInProgress.length; r++) {
                                var o = this._intersectionsInProgress[r],
                                    s = o._intersectionsInProgress.indexOf(this);
                                o._intersectionsInProgress.splice(s, 1)
                            }
                            this._intersectionsInProgress = [], this.getScene().lights.forEach(function(e) {
                                var t = e.includedOnlyMeshes.indexOf(n); - 1 !== t && e.includedOnlyMeshes.splice(t, 1), -1 !== (t = e.excludedMeshes.indexOf(n)) && e.excludedMeshes.splice(t, 1);
                                var i = e.getShadowGenerator();
                                if (i) {
                                    var r = i.getShadowMap();
                                    r && r.renderList && -1 !== (t = r.renderList.indexOf(n)) && r.renderList.splice(t, 1)
                                }
                            }), "InstancedMesh" !== this.getClassName() && this.releaseSubMeshes();
                            var a = this.getScene().getEngine();
                            if (this._occlusionQuery && (this.isOcclusionQueryInProgress = !1, a.deleteQuery(this._occlusionQuery), this._occlusionQuery = null), a.wipeCaches(), this.getScene().removeMesh(this), i && this.material && this.material.dispose(!1, !0), !t)
                                for (r = 0; r < this.getScene().particleSystems.length; r++) this.getScene().particleSystems[r].emitter === this && (this.getScene().particleSystems[r].dispose(), r--);
                            this._facetData.facetDataEnabled && this.disableFacetData(), this.onAfterWorldMatrixUpdateObservable.clear(), this.onCollideObservable.clear(), this.onCollisionPositionChangeObservable.clear(), this.onRebuildObservable.clear(), e.prototype.dispose.call(this, t, i)
                        }, t.prototype.addChild = function(e) {
                            return e.setParent(this), this
                        }, t.prototype.removeChild = function(e) {
                            return e.setParent(null), this
                        }, t.prototype._initFacetData = function() {
                            var e = this._facetData;
                            e.facetNormals || (e.facetNormals = new Array), e.facetPositions || (e.facetPositions = new Array), e.facetPartitioning || (e.facetPartitioning = new Array), e.facetNb = this.getIndices().length / 3 | 0, e.partitioningSubdivisions = e.partitioningSubdivisions ? e.partitioningSubdivisions : 10, e.partitioningBBoxRatio = e.partitioningBBoxRatio ? e.partitioningBBoxRatio : 1.01;
                            for (var t = 0; t < e.facetNb; t++) e.facetNormals[t] = L.Vector3.Zero(), e.facetPositions[t] = L.Vector3.Zero();
                            return e.facetDataEnabled = !0, this
                        }, t.prototype.updateFacetData = function() {
                            var e = this._facetData;
                            e.facetDataEnabled || this._initFacetData();
                            var t = this.getVerticesData(L.VertexBuffer.PositionKind),
                                i = this.getIndices(),
                                r = this.getVerticesData(L.VertexBuffer.NormalKind),
                                n = this.getBoundingInfo();
                            if (e.facetDepthSort && !e.facetDepthSortEnabled) {
                                if (e.facetDepthSortEnabled = !0, i instanceof Uint16Array) e.depthSortedIndices = new Uint16Array(i);
                                else if (i instanceof Uint32Array) e.depthSortedIndices = new Uint32Array(i);
                                else {
                                    for (var o = !1, s = 0; s < i.length; s++)
                                        if (65535 < i[s]) {
                                            o = !0;
                                            break
                                        }
                                    e.depthSortedIndices = o ? new Uint32Array(i) : new Uint16Array(i)
                                }
                                if (e.facetDepthSortFunction = function(e, t) {
                                        return t.sqDistance - e.sqDistance
                                    }, !e.facetDepthSortFrom) {
                                    var a = this.getScene().activeCamera;
                                    e.facetDepthSortFrom = a ? a.position : L.Vector3.Zero()
                                }
                                e.depthSortedFacets = [];
                                for (var l = 0; l < e.facetNb; l++) {
                                    var u = {
                                        ind: 3 * l,
                                        sqDistance: 0
                                    };
                                    e.depthSortedFacets.push(u)
                                }
                                e.invertedMatrix = L.Matrix.Identity(), e.facetDepthSortOrigin = L.Vector3.Zero()
                            }
                            e.bbSize.x = n.maximum.x - n.minimum.x > L.Epsilon ? n.maximum.x - n.minimum.x : L.Epsilon, e.bbSize.y = n.maximum.y - n.minimum.y > L.Epsilon ? n.maximum.y - n.minimum.y : L.Epsilon, e.bbSize.z = n.maximum.z - n.minimum.z > L.Epsilon ? n.maximum.z - n.minimum.z : L.Epsilon;
                            var c = e.bbSize.x > e.bbSize.y ? e.bbSize.x : e.bbSize.y;
                            if (c = c > e.bbSize.z ? c : e.bbSize.z, e.subDiv.max = e.partitioningSubdivisions, e.subDiv.X = Math.floor(e.subDiv.max * e.bbSize.x / c), e.subDiv.Y = Math.floor(e.subDiv.max * e.bbSize.y / c), e.subDiv.Z = Math.floor(e.subDiv.max * e.bbSize.z / c), e.subDiv.X = e.subDiv.X < 1 ? 1 : e.subDiv.X, e.subDiv.Y = e.subDiv.Y < 1 ? 1 : e.subDiv.Y, e.subDiv.Z = e.subDiv.Z < 1 ? 1 : e.subDiv.Z, e.facetParameters.facetNormals = this.getFacetLocalNormals(), e.facetParameters.facetPositions = this.getFacetLocalPositions(), e.facetParameters.facetPartitioning = this.getFacetLocalPartitioning(), e.facetParameters.bInfo = n, e.facetParameters.bbSize = e.bbSize, e.facetParameters.subDiv = e.subDiv, e.facetParameters.ratio = this.partitioningBBoxRatio, e.facetParameters.depthSort = e.facetDepthSort, e.facetDepthSort && e.facetDepthSortEnabled && (this.computeWorldMatrix(!0), this._worldMatrix.invertToRef(e.invertedMatrix), L.Vector3.TransformCoordinatesToRef(e.facetDepthSortFrom, e.invertedMatrix, e.facetDepthSortOrigin), e.facetParameters.distanceTo = e.facetDepthSortOrigin), e.facetParameters.depthSortedFacets = e.depthSortedFacets, L.VertexData.ComputeNormals(t, i, r, e.facetParameters), e.facetDepthSort && e.facetDepthSortEnabled) {
                                e.depthSortedFacets.sort(e.facetDepthSortFunction);
                                var h = e.depthSortedIndices.length / 3 | 0;
                                for (l = 0; l < h; l++) {
                                    var d = e.depthSortedFacets[l].ind;
                                    e.depthSortedIndices[3 * l] = i[d], e.depthSortedIndices[3 * l + 1] = i[d + 1], e.depthSortedIndices[3 * l + 2] = i[d + 2]
                                }
                                this.updateIndices(e.depthSortedIndices)
                            }
                            return this
                        }, t.prototype.getFacetLocalNormals = function() {
                            return this._facetData.facetNormals || this.updateFacetData(), this._facetData.facetNormals
                        }, t.prototype.getFacetLocalPositions = function() {
                            return this._facetData.facetPositions || this.updateFacetData(), this._facetData.facetPositions
                        }, t.prototype.getFacetLocalPartitioning = function() {
                            return this._facetData.facetPartitioning || this.updateFacetData(), this._facetData.facetPartitioning
                        }, t.prototype.getFacetPosition = function(e) {
                            var t = L.Vector3.Zero();
                            return this.getFacetPositionToRef(e, t), t
                        }, t.prototype.getFacetPositionToRef = function(e, t) {
                            var i = this.getFacetLocalPositions()[e],
                                r = this.getWorldMatrix();
                            return L.Vector3.TransformCoordinatesToRef(i, r, t), this
                        }, t.prototype.getFacetNormal = function(e) {
                            var t = L.Vector3.Zero();
                            return this.getFacetNormalToRef(e, t), t
                        }, t.prototype.getFacetNormalToRef = function(e, t) {
                            var i = this.getFacetLocalNormals()[e];
                            return L.Vector3.TransformNormalToRef(i, this.getWorldMatrix(), t), this
                        }, t.prototype.getFacetsAtLocalCoordinates = function(e, t, i) {
                            var r = this.getBoundingInfo(),
                                n = this._facetData,
                                o = Math.floor((e - r.minimum.x * n.partitioningBBoxRatio) * n.subDiv.X * n.partitioningBBoxRatio / n.bbSize.x),
                                s = Math.floor((t - r.minimum.y * n.partitioningBBoxRatio) * n.subDiv.Y * n.partitioningBBoxRatio / n.bbSize.y),
                                a = Math.floor((i - r.minimum.z * n.partitioningBBoxRatio) * n.subDiv.Z * n.partitioningBBoxRatio / n.bbSize.z);
                            return o < 0 || o > n.subDiv.max || s < 0 || s > n.subDiv.max || a < 0 || a > n.subDiv.max ? null : n.facetPartitioning[o + n.subDiv.max * s + n.subDiv.max * n.subDiv.max * a]
                        }, t.prototype.getClosestFacetAtCoordinates = function(e, t, i, r, n, o) {
                            void 0 === n && (n = !1), void 0 === o && (o = !0);
                            var s = this.getWorldMatrix(),
                                a = L.Tmp.Matrix[5];
                            s.invertToRef(a);
                            var l = L.Tmp.Vector3[8];
                            L.Vector3.TransformCoordinatesFromFloatsToRef(e, t, i, a, l);
                            var u = this.getClosestFacetAtLocalCoordinates(l.x, l.y, l.z, r, n, o);
                            return r && L.Vector3.TransformCoordinatesFromFloatsToRef(r.x, r.y, r.z, s, r), u
                        }, t.prototype.getClosestFacetAtLocalCoordinates = function(e, t, i, r, n, o) {
                            void 0 === n && (n = !1), void 0 === o && (o = !0);
                            var s = null,
                                a = 0,
                                l = 0,
                                u = 0,
                                c = 0,
                                h = 0,
                                d = 0,
                                p = 0,
                                f = 0,
                                _ = this.getFacetLocalPositions(),
                                m = this.getFacetLocalNormals(),
                                g = this.getFacetsAtLocalCoordinates(e, t, i);
                            if (!g) return null;
                            for (var v, y, b, x = Number.MAX_VALUE, T = x, E = 0; E < g.length; E++) y = m[v = g[E]], c = (e - (b = _[v]).x) * y.x + (t - b.y) * y.y + (i - b.z) * y.z, (!n || n && o && 0 <= c || n && !o && c <= 0) && (c = y.x * b.x + y.y * b.y + y.z * b.z, h = -(y.x * e + y.y * t + y.z * i - c) / (y.x * y.x + y.y * y.y + y.z * y.z), (T = (a = (d = e + y.x * h) - e) * a + (l = (p = t + y.y * h) - t) * l + (u = (f = i + y.z * h) - i) * u) < x && (x = T, s = v, r && (r.x = d, r.y = p, r.z = f)));
                            return s
                        }, t.prototype.getFacetDataParameters = function() {
                            return this._facetData.facetParameters
                        }, t.prototype.disableFacetData = function() {
                            return this._facetData.facetDataEnabled && (this._facetData.facetDataEnabled = !1, this._facetData.facetPositions = new Array, this._facetData.facetNormals = new Array, this._facetData.facetPartitioning = new Array, this._facetData.facetParameters = null, this._facetData.depthSortedIndices = new Uint32Array(0)), this
                        }, t.prototype.updateIndices = function(e) {
                            return this
                        }, t.prototype.createNormals = function(e) {
                            var t, i = this.getVerticesData(L.VertexBuffer.PositionKind),
                                r = this.getIndices();
                            return t = this.isVerticesDataPresent(L.VertexBuffer.NormalKind) ? this.getVerticesData(L.VertexBuffer.NormalKind) : [], L.VertexData.ComputeNormals(i, r, t, {
                                useRightHandedSystem: this.getScene().useRightHandedSystem
                            }), this.setVerticesData(L.VertexBuffer.NormalKind, t, e), this
                        }, t.prototype.alignWithNormal = function(e, t) {
                            t || (t = L.Axis.Y);
                            var i = L.Tmp.Vector3[0],
                                r = L.Tmp.Vector3[1];
                            return L.Vector3.CrossToRef(t, e, r), L.Vector3.CrossToRef(e, r, i), this.rotationQuaternion ? L.Quaternion.RotationQuaternionFromAxisToRef(i, e, r, this.rotationQuaternion) : L.Vector3.RotationFromAxisToRef(i, e, r, this.rotation), this
                        }, t.prototype._checkOcclusionQuery = function() {
                            return !1
                        }, t.OCCLUSION_TYPE_NONE = 0, t.OCCLUSION_TYPE_OPTIMISTIC = 1, t.OCCLUSION_TYPE_STRICT = 2, t.OCCLUSION_ALGORITHM_TYPE_ACCURATE = 0, t.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE = 1, t.CULLINGSTRATEGY_STANDARD = 0, t.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1, t
                }(L.TransformNode), L.AbstractMesh = F, N = $a || ($a = {}), V = function(e) {
                    function t(i, r) {
                        var n = e.call(this, i, r) || this;
                        return n.diffuse = new N.Color3(1, 1, 1), n.specular = new N.Color3(1, 1, 1), n.falloffType = t.FALLOFF_DEFAULT, n.intensity = 1, n._range = Number.MAX_VALUE, n._inverseSquaredRange = 0, n._photometricScale = 1, n._intensityMode = t.INTENSITYMODE_AUTOMATIC, n._radius = 1e-5, n.renderPriority = 0, n._shadowEnabled = !0, n._excludeWithLayerMask = 0, n._includeOnlyWithLayerMask = 0, n._lightmapMode = 0, n._excludedMeshesIds = new Array, n._includedOnlyMeshesIds = new Array, n.getScene().addLight(n), n._uniformBuffer = new N.UniformBuffer(n.getScene().getEngine()), n._buildUniformLayout(), n.includedOnlyMeshes = new Array, n.excludedMeshes = new Array, n._resyncMeshes(), n
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "range", {
                        get: function() {
                            return this._range
                        },
                        set: function(e) {
                            this._range = e, this._inverseSquaredRange = 1 / (this.range * this.range)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "intensityMode", {
                        get: function() {
                            return this._intensityMode
                        },
                        set: function(e) {
                            this._intensityMode = e, this._computePhotometricScale()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "radius", {
                        get: function() {
                            return this._radius
                        },
                        set: function(e) {
                            this._radius = e, this._computePhotometricScale()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "shadowEnabled", {
                        get: function() {
                            return this._shadowEnabled
                        },
                        set: function(e) {
                            this._shadowEnabled !== e && (this._shadowEnabled = e, this._markMeshesAsLightDirty())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "includedOnlyMeshes", {
                        get: function() {
                            return this._includedOnlyMeshes
                        },
                        set: function(e) {
                            this._includedOnlyMeshes = e, this._hookArrayForIncludedOnly(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "excludedMeshes", {
                        get: function() {
                            return this._excludedMeshes
                        },
                        set: function(e) {
                            this._excludedMeshes = e, this._hookArrayForExcluded(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "excludeWithLayerMask", {
                        get: function() {
                            return this._excludeWithLayerMask
                        },
                        set: function(e) {
                            this._excludeWithLayerMask = e, this._resyncMeshes()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "includeOnlyWithLayerMask", {
                        get: function() {
                            return this._includeOnlyWithLayerMask
                        },
                        set: function(e) {
                            this._includeOnlyWithLayerMask = e, this._resyncMeshes()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "lightmapMode", {
                        get: function() {
                            return this._lightmapMode
                        },
                        set: function(e) {
                            this._lightmapMode !== e && (this._lightmapMode = e, this._markMeshesAsLightDirty())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getClassName = function() {
                        return "Light"
                    }, t.prototype.toString = function(e) {
                        var t = "Name: " + this.name;
                        if (t += ", type: " + ["Point", "Directional", "Spot", "Hemispheric"][this.getTypeID()], this.animations)
                            for (var i = 0; i < this.animations.length; i++) t += ", animation[0]: " + this.animations[i].toString(e);
                        return t
                    }, t.prototype._syncParentEnabledState = function() {
                        e.prototype._syncParentEnabledState.call(this), this._resyncMeshes()
                    }, t.prototype.setEnabled = function(t) {
                        e.prototype.setEnabled.call(this, t), this._resyncMeshes()
                    }, t.prototype.getShadowGenerator = function() {
                        return this._shadowGenerator
                    }, t.prototype.getAbsolutePosition = function() {
                        return N.Vector3.Zero()
                    }, t.prototype.canAffectMesh = function(e) {
                        return !(e && (this.includedOnlyMeshes && 0 < this.includedOnlyMeshes.length && -1 === this.includedOnlyMeshes.indexOf(e) || this.excludedMeshes && 0 < this.excludedMeshes.length && -1 !== this.excludedMeshes.indexOf(e) || 0 !== this.includeOnlyWithLayerMask && 0 == (this.includeOnlyWithLayerMask & e.layerMask) || 0 !== this.excludeWithLayerMask && this.excludeWithLayerMask & e.layerMask))
                    }, t.CompareLightsPriority = function(e, t) {
                        return e.shadowEnabled !== t.shadowEnabled ? (t.shadowEnabled ? 1 : 0) - (e.shadowEnabled ? 1 : 0) : t.renderPriority - e.renderPriority
                    }, t.prototype.dispose = function(t, i) {
                        void 0 === i && (i = !1), this._shadowGenerator && (this._shadowGenerator.dispose(), this._shadowGenerator = null), this.getScene().stopAnimation(this);
                        for (var r = 0, n = this.getScene().meshes; r < n.length; r++) n[r]._removeLightSource(this);
                        this._uniformBuffer.dispose(), this.getScene().removeLight(this), e.prototype.dispose.call(this, t, i)
                    }, t.prototype.getTypeID = function() {
                        return 0
                    }, t.prototype.getScaledIntensity = function() {
                        return this._photometricScale * this.intensity
                    }, t.prototype.clone = function(e) {
                        var i = t.GetConstructorFromName(this.getTypeID(), e, this.getScene());
                        return i ? N.SerializationHelper.Clone(i, this) : null
                    }, t.prototype.serialize = function() {
                        var e = N.SerializationHelper.Serialize(this);
                        return e.type = this.getTypeID(), this.parent && (e.parentId = this.parent.id), 0 < this.excludedMeshes.length && (e.excludedMeshesIds = [], this.excludedMeshes.forEach(function(t) {
                            e.excludedMeshesIds.push(t.id)
                        })), 0 < this.includedOnlyMeshes.length && (e.includedOnlyMeshesIds = [], this.includedOnlyMeshes.forEach(function(t) {
                            e.includedOnlyMeshesIds.push(t.id)
                        })), N.Animation.AppendSerializedAnimations(this, e), e.ranges = this.serializeAnimationRanges(), e
                    }, t.GetConstructorFromName = function(e, t, i) {
                        return N.Node.Construct("Light_Type_" + e, t, i) || null
                    }, t.Parse = function(e, i) {
                        var r = t.GetConstructorFromName(e.type, e.name, i);
                        if (!r) return null;
                        var n = N.SerializationHelper.Parse(r, e, i);
                        if (e.excludedMeshesIds && (n._excludedMeshesIds = e.excludedMeshesIds), e.includedOnlyMeshesIds && (n._includedOnlyMeshesIds = e.includedOnlyMeshesIds), e.parentId && (n._waitingParentId = e.parentId), e.animations) {
                            for (var o = 0; o < e.animations.length; o++) {
                                var s = e.animations[o];
                                n.animations.push(N.Animation.Parse(s))
                            }
                            N.Node.ParseAnimationRanges(n, e, i)
                        }
                        return e.autoAnimate && i.beginAnimation(n, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1), n
                    }, t.prototype._hookArrayForExcluded = function(e) {
                        var t = this,
                            i = e.push;
                        e.push = function() {
                            for (var r = [], n = 0; n < arguments.length; n++) r[n] = arguments[n];
                            for (var o = i.apply(e, r), s = 0, a = r; s < a.length; s++) a[s]._resyncLighSource(t);
                            return o
                        };
                        var r = e.splice;
                        e.splice = function(i, n) {
                            for (var o = r.apply(e, [i, n]), s = 0, a = o; s < a.length; s++) a[s]._resyncLighSource(t);
                            return o
                        };
                        for (var n = 0, o = e; n < o.length; n++) o[n]._resyncLighSource(this)
                    }, t.prototype._hookArrayForIncludedOnly = function(e) {
                        var t = this,
                            i = e.push;
                        e.push = function() {
                            for (var r = [], n = 0; n < arguments.length; n++) r[n] = arguments[n];
                            var o = i.apply(e, r);
                            return t._resyncMeshes(), o
                        };
                        var r = e.splice;
                        e.splice = function(i, n) {
                            var o = r.apply(e, [i, n]);
                            return t._resyncMeshes(), o
                        }, this._resyncMeshes()
                    }, t.prototype._resyncMeshes = function() {
                        for (var e = 0, t = this.getScene().meshes; e < t.length; e++) t[e]._resyncLighSource(this)
                    }, t.prototype._markMeshesAsLightDirty = function() {
                        for (var e = 0, t = this.getScene().meshes; e < t.length; e++) {
                            var i = t[e]; - 1 !== i._lightSources.indexOf(this) && i._markSubMeshesAsLightDirty()
                        }
                    }, t.prototype._computePhotometricScale = function() {
                        this._photometricScale = this._getPhotometricScale(), this.getScene().resetCachedMaterial()
                    }, t.prototype._getPhotometricScale = function() {
                        var e = 0,
                            i = this.getTypeID(),
                            r = this.intensityMode;
                        switch (r === t.INTENSITYMODE_AUTOMATIC && (r = i === t.LIGHTTYPEID_DIRECTIONALLIGHT ? t.INTENSITYMODE_ILLUMINANCE : t.INTENSITYMODE_LUMINOUSINTENSITY), i) {
                            case t.LIGHTTYPEID_POINTLIGHT:
                            case t.LIGHTTYPEID_SPOTLIGHT:
                                switch (r) {
                                    case t.INTENSITYMODE_LUMINOUSPOWER:
                                        e = 1 / (4 * Math.PI);
                                        break;
                                    case t.INTENSITYMODE_LUMINOUSINTENSITY:
                                        e = 1;
                                        break;
                                    case t.INTENSITYMODE_LUMINANCE:
                                        e = this.radius * this.radius
                                }
                                break;
                            case t.LIGHTTYPEID_DIRECTIONALLIGHT:
                                switch (r) {
                                    case t.INTENSITYMODE_ILLUMINANCE:
                                        e = 1;
                                        break;
                                    case t.INTENSITYMODE_LUMINANCE:
                                        var n = this.radius;
                                        n = Math.max(n, .001), e = 2 * Math.PI * (1 - Math.cos(n))
                                }
                                break;
                            case t.LIGHTTYPEID_HEMISPHERICLIGHT:
                                e = 1
                        }
                        return e
                    }, t.prototype._reorderLightsInScene = function() {
                        var e = this.getScene();
                        0 != this._renderPriority && (e.requireLightSorting = !0), this.getScene().sortLightsByPriority()
                    }, t.FALLOFF_DEFAULT = 0, t.FALLOFF_PHYSICAL = 1, t.FALLOFF_GLTF = 2, t.FALLOFF_STANDARD = 3, t.LIGHTMAP_DEFAULT = 0, t.LIGHTMAP_SPECULAR = 1, t.LIGHTMAP_SHADOWSONLY = 2, t.INTENSITYMODE_AUTOMATIC = 0, t.INTENSITYMODE_LUMINOUSPOWER = 1, t.INTENSITYMODE_LUMINOUSINTENSITY = 2, t.INTENSITYMODE_ILLUMINANCE = 3, t.INTENSITYMODE_LUMINANCE = 4, t.LIGHTTYPEID_POINTLIGHT = 0, t.LIGHTTYPEID_DIRECTIONALLIGHT = 1, t.LIGHTTYPEID_SPOTLIGHT = 2, t.LIGHTTYPEID_HEMISPHERICLIGHT = 3, y([N.serializeAsColor3()], t.prototype, "diffuse", void 0), y([N.serializeAsColor3()], t.prototype, "specular", void 0), y([N.serialize()], t.prototype, "falloffType", void 0), y([N.serialize()], t.prototype, "intensity", void 0), y([N.serialize()], t.prototype, "range", null), y([N.serialize()], t.prototype, "intensityMode", null), y([N.serialize()], t.prototype, "radius", null), y([N.serialize()], t.prototype, "_renderPriority", void 0), y([N.expandToProperty("_reorderLightsInScene")], t.prototype, "renderPriority", void 0), y([N.serialize("shadowEnabled")], t.prototype, "_shadowEnabled", void 0), y([N.serialize("excludeWithLayerMask")], t.prototype, "_excludeWithLayerMask", void 0), y([N.serialize("includeOnlyWithLayerMask")], t.prototype, "_includeOnlyWithLayerMask", void 0), y([N.serialize("lightmapMode")], t.prototype, "_lightmapMode", void 0), t
                }(N.Node), N.Light = V, k = $a || ($a = {}), U = function(e) {
                    function t(i, r, n, o) {
                        void 0 === o && (o = !0);
                        var s = e.call(this, i, n) || this;
                        return s.upVector = k.Vector3.Up(), s.orthoLeft = null, s.orthoRight = null, s.orthoBottom = null, s.orthoTop = null, s.fov = .8, s.minZ = 1, s.maxZ = 1e4, s.inertia = .9, s.mode = t.PERSPECTIVE_CAMERA, s.isIntermediate = !1, s.viewport = new k.Viewport(0, 0, 1, 1), s.layerMask = 268435455, s.fovMode = t.FOVMODE_VERTICAL_FIXED, s.cameraRigMode = t.RIG_MODE_NONE, s.customRenderTargets = new Array, s.onViewMatrixChangedObservable = new k.Observable, s.onProjectionMatrixChangedObservable = new k.Observable, s.onAfterCheckInputsObservable = new k.Observable, s.onRestoreStateObservable = new k.Observable, s._rigCameras = new Array, s._webvrViewMatrix = k.Matrix.Identity(), s._skipRendering = !1, s._projectionMatrix = new k.Matrix, s._postProcesses = new Array, s._activeMeshes = new k.SmartArray(256), s._globalPosition = k.Vector3.Zero(), s._computedViewMatrix = k.Matrix.Identity(), s._doNotComputeProjectionMatrix = !1, s._transformMatrix = k.Matrix.Zero(), s._refreshFrustumPlanes = !0, s.getScene().addCamera(s), o && !s.getScene().activeCamera && (s.getScene().activeCamera = s), s.position = r, s
                    }
                    return b(t, e), t.prototype.storeState = function() {
                        return this._stateStored = !0, this._storedFov = this.fov, this
                    }, t.prototype._restoreStateValues = function() {
                        return !!this._stateStored && (this.fov = this._storedFov, !0)
                    }, t.prototype.restoreState = function() {
                        return !!this._restoreStateValues() && (this.onRestoreStateObservable.notifyObservers(this), !0)
                    }, t.prototype.getClassName = function() {
                        return "Camera"
                    }, t.prototype.toString = function(e) {
                        var t = "Name: " + this.name;
                        if (t += ", type: " + this.getClassName(), this.animations)
                            for (var i = 0; i < this.animations.length; i++) t += ", animation[0]: " + this.animations[i].toString(e);
                        return t
                    }, Object.defineProperty(t.prototype, "globalPosition", {
                        get: function() {
                            return this._globalPosition
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getActiveMeshes = function() {
                        return this._activeMeshes
                    }, t.prototype.isActiveMesh = function(e) {
                        return -1 !== this._activeMeshes.indexOf(e)
                    }, t.prototype.isReady = function(t) {
                        if (void 0 === t && (t = !1), t)
                            for (var i = 0, r = this._postProcesses; i < r.length; i++) {
                                var n = r[i];
                                if (n && !n.isReady()) return !1
                            }
                        return e.prototype.isReady.call(this, t)
                    }, t.prototype._initCache = function() {
                        e.prototype._initCache.call(this), this._cache.position = new k.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.upVector = new k.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.mode = void 0, this._cache.minZ = void 0, this._cache.maxZ = void 0, this._cache.fov = void 0, this._cache.fovMode = void 0, this._cache.aspectRatio = void 0, this._cache.orthoLeft = void 0, this._cache.orthoRight = void 0, this._cache.orthoBottom = void 0, this._cache.orthoTop = void 0, this._cache.renderWidth = void 0, this._cache.renderHeight = void 0
                    }, t.prototype._updateCache = function(t) {
                        t || e.prototype._updateCache.call(this), this._cache.position.copyFrom(this.position), this._cache.upVector.copyFrom(this.upVector)
                    }, t.prototype._isSynchronized = function() {
                        return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix()
                    }, t.prototype._isSynchronizedViewMatrix = function() {
                        return !!e.prototype._isSynchronized.call(this) && this._cache.position.equals(this.position) && this._cache.upVector.equals(this.upVector) && this.isSynchronizedWithParent()
                    }, t.prototype._isSynchronizedProjectionMatrix = function() {
                        var e = this._cache.mode === this.mode && this._cache.minZ === this.minZ && this._cache.maxZ === this.maxZ;
                        if (!e) return !1;
                        var i = this.getEngine();
                        return e = this.mode === t.PERSPECTIVE_CAMERA ? this._cache.fov === this.fov && this._cache.fovMode === this.fovMode && this._cache.aspectRatio === i.getAspectRatio(this) : this._cache.orthoLeft === this.orthoLeft && this._cache.orthoRight === this.orthoRight && this._cache.orthoBottom === this.orthoBottom && this._cache.orthoTop === this.orthoTop && this._cache.renderWidth === i.getRenderWidth() && this._cache.renderHeight === i.getRenderHeight()
                    }, t.prototype.attachControl = function(e, t) {}, t.prototype.detachControl = function(e) {}, t.prototype.update = function() {
                        this._checkInputs(), this.cameraRigMode !== t.RIG_MODE_NONE && this._updateRigCameras()
                    }, t.prototype._checkInputs = function() {
                        this.onAfterCheckInputsObservable.notifyObservers(this)
                    }, Object.defineProperty(t.prototype, "rigCameras", {
                        get: function() {
                            return this._rigCameras
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "rigPostProcess", {
                        get: function() {
                            return this._rigPostProcess
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._getFirstPostProcess = function() {
                        for (var e = 0; e < this._postProcesses.length; e++)
                            if (null !== this._postProcesses[e]) return this._postProcesses[e];
                        return null
                    }, t.prototype._cascadePostProcessesToRigCams = function() {
                        var e = this._getFirstPostProcess();
                        e && e.markTextureDirty();
                        for (var t = 0, i = this._rigCameras.length; t < i; t++) {
                            var r = this._rigCameras[t],
                                n = r._rigPostProcess;
                            n ? (n instanceof k.PassPostProcess && (r.isIntermediate = 0 === this._postProcesses.length), r._postProcesses = this._postProcesses.slice(0).concat(n), n.markTextureDirty()) : r._postProcesses = this._postProcesses.slice(0)
                        }
                    }, t.prototype.attachPostProcess = function(e, t) {
                        return void 0 === t && (t = null), !e.isReusable() && -1 < this._postProcesses.indexOf(e) ? (k.Tools.Error("You're trying to reuse a post process not defined as reusable."), 0) : (null == t || t < 0 ? this._postProcesses.push(e) : null === this._postProcesses[t] ? this._postProcesses[t] = e : this._postProcesses.splice(t, 0, e), this._cascadePostProcessesToRigCams(), this._postProcesses.indexOf(e))
                    }, t.prototype.detachPostProcess = function(e) {
                        var t = this._postProcesses.indexOf(e); - 1 !== t && (this._postProcesses[t] = null), this._cascadePostProcessesToRigCams()
                    }, t.prototype.getWorldMatrix = function() {
                        return this._isSynchronizedViewMatrix() || this.getViewMatrix(), this._worldMatrix
                    }, t.prototype._getViewMatrix = function() {
                        return k.Matrix.Identity()
                    }, t.prototype.getViewMatrix = function(e) {
                        return !e && this._isSynchronizedViewMatrix() || (this.updateCache(), this._computedViewMatrix = this._getViewMatrix(), this._currentRenderId = this.getScene().getRenderId(), this._childRenderId = this._currentRenderId, this._refreshFrustumPlanes = !0, this._cameraRigParams && this._cameraRigParams.vrPreViewMatrix && this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix, this._computedViewMatrix), this.onViewMatrixChangedObservable.notifyObservers(this), this._computedViewMatrix.invertToRef(this._worldMatrix)), this._computedViewMatrix
                    }, t.prototype.freezeProjectionMatrix = function(e) {
                        this._doNotComputeProjectionMatrix = !0, void 0 !== e && (this._projectionMatrix = e)
                    }, t.prototype.unfreezeProjectionMatrix = function() {
                        this._doNotComputeProjectionMatrix = !1
                    }, t.prototype.getProjectionMatrix = function(e) {
                        if (this._doNotComputeProjectionMatrix || !e && this._isSynchronizedProjectionMatrix()) return this._projectionMatrix;
                        this._cache.mode = this.mode, this._cache.minZ = this.minZ, this._cache.maxZ = this.maxZ, this._refreshFrustumPlanes = !0;
                        var i = this.getEngine(),
                            r = this.getScene();
                        if (this.mode === t.PERSPECTIVE_CAMERA) this._cache.fov = this.fov, this._cache.fovMode = this.fovMode, this._cache.aspectRatio = i.getAspectRatio(this), this.minZ <= 0 && (this.minZ = .1), r.useRightHandedSystem ? k.Matrix.PerspectiveFovRHToRef(this.fov, i.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode === t.FOVMODE_VERTICAL_FIXED) : k.Matrix.PerspectiveFovLHToRef(this.fov, i.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode === t.FOVMODE_VERTICAL_FIXED);
                        else {
                            var n = i.getRenderWidth() / 2,
                                o = i.getRenderHeight() / 2;
                            r.useRightHandedSystem ? k.Matrix.OrthoOffCenterRHToRef(this.orthoLeft || -n, this.orthoRight || n, this.orthoBottom || -o, this.orthoTop || o, this.minZ, this.maxZ, this._projectionMatrix) : k.Matrix.OrthoOffCenterLHToRef(this.orthoLeft || -n, this.orthoRight || n, this.orthoBottom || -o, this.orthoTop || o, this.minZ, this.maxZ, this._projectionMatrix), this._cache.orthoLeft = this.orthoLeft, this._cache.orthoRight = this.orthoRight, this._cache.orthoBottom = this.orthoBottom, this._cache.orthoTop = this.orthoTop, this._cache.renderWidth = i.getRenderWidth(), this._cache.renderHeight = i.getRenderHeight()
                        }
                        return this.onProjectionMatrixChangedObservable.notifyObservers(this), this._projectionMatrix
                    }, t.prototype.getTransformationMatrix = function() {
                        return this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix), this._transformMatrix
                    }, t.prototype._updateFrustumPlanes = function() {
                        this._refreshFrustumPlanes && (this.getTransformationMatrix(), this._frustumPlanes ? k.Frustum.GetPlanesToRef(this._transformMatrix, this._frustumPlanes) : this._frustumPlanes = k.Frustum.GetPlanes(this._transformMatrix), this._refreshFrustumPlanes = !1)
                    }, t.prototype.isInFrustum = function(e) {
                        return this._updateFrustumPlanes(), e.isInFrustum(this._frustumPlanes)
                    }, t.prototype.isCompletelyInFrustum = function(e) {
                        return this._updateFrustumPlanes(), e.isCompletelyInFrustum(this._frustumPlanes)
                    }, t.prototype.getForwardRay = function(e, t, i) {
                        void 0 === e && (e = 100), t || (t = this.getWorldMatrix()), i || (i = this.position);
                        var r = this._scene.useRightHandedSystem ? new k.Vector3(0, 0, -1) : new k.Vector3(0, 0, 1),
                            n = k.Vector3.TransformNormal(r, t),
                            o = k.Vector3.Normalize(n);
                        return new k.Ray(i, o, e)
                    }, t.prototype.dispose = function(i, r) {
                        for (void 0 === r && (r = !1), this.onViewMatrixChangedObservable.clear(), this.onProjectionMatrixChangedObservable.clear(), this.onAfterCheckInputsObservable.clear(), this.onRestoreStateObservable.clear(), this.inputs && this.inputs.clear(), this.getScene().stopAnimation(this), this.getScene().removeCamera(this); 0 < this._rigCameras.length;) {
                            var n = this._rigCameras.pop();
                            n && n.dispose()
                        }
                        if (this._rigPostProcess) this._rigPostProcess.dispose(this), this._rigPostProcess = null, this._postProcesses = [];
                        else if (this.cameraRigMode !== t.RIG_MODE_NONE) this._rigPostProcess = null, this._postProcesses = [];
                        else
                            for (var o = this._postProcesses.length; 0 <= --o;) {
                                var s = this._postProcesses[o];
                                s && s.dispose(this)
                            }
                        for (o = this.customRenderTargets.length; 0 <= --o;) this.customRenderTargets[o].dispose();
                        this.customRenderTargets = [], this._activeMeshes.dispose(), e.prototype.dispose.call(this, i, r)
                    }, Object.defineProperty(t.prototype, "leftCamera", {
                        get: function() {
                            return this._rigCameras.length < 1 ? null : this._rigCameras[0]
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "rightCamera", {
                        get: function() {
                            return this._rigCameras.length < 2 ? null : this._rigCameras[1]
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getLeftTarget = function() {
                        return this._rigCameras.length < 1 ? null : this._rigCameras[0].getTarget()
                    }, t.prototype.getRightTarget = function() {
                        return this._rigCameras.length < 2 ? null : this._rigCameras[1].getTarget()
                    }, t.prototype.setCameraRigMode = function(e, i) {
                        if (this.cameraRigMode !== e) {
                            for (; 0 < this._rigCameras.length;) {
                                var r = this._rigCameras.pop();
                                r && r.dispose()
                            }
                            if (this.cameraRigMode = e, this._cameraRigParams = {}, this._cameraRigParams.interaxialDistance = i.interaxialDistance || .0637, this._cameraRigParams.stereoHalfAngle = k.Tools.ToRadians(this._cameraRigParams.interaxialDistance / .0637),
                                this.cameraRigMode !== t.RIG_MODE_NONE) {
                                var n = this.createRigCamera(this.name + "_L", 0),
                                    o = this.createRigCamera(this.name + "_R", 1);
                                n && o && (this._rigCameras.push(n), this._rigCameras.push(o))
                            }
                            switch (this.cameraRigMode) {
                                case t.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
                                    this._rigCameras[0]._rigPostProcess = new k.PassPostProcess(this.name + "_passthru", 1, this._rigCameras[0]), this._rigCameras[1]._rigPostProcess = new k.AnaglyphPostProcess(this.name + "_anaglyph", 1, this._rigCameras);
                                    break;
                                case t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
                                case t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
                                case t.RIG_MODE_STEREOSCOPIC_OVERUNDER:
                                    var s = this.cameraRigMode === t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL || this.cameraRigMode === t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;
                                    this._rigCameras[0]._rigPostProcess = new k.PassPostProcess(this.name + "_passthru", 1, this._rigCameras[0]), this._rigCameras[1]._rigPostProcess = new k.StereoscopicInterlacePostProcess(this.name + "_stereoInterlace", this._rigCameras, s);
                                    break;
                                case t.RIG_MODE_VR:
                                    var a = i.vrCameraMetrics || k.VRCameraMetrics.GetDefault();
                                    this._rigCameras[0]._cameraRigParams.vrMetrics = a, this._rigCameras[0].viewport = new k.Viewport(0, 0, .5, 1), this._rigCameras[0]._cameraRigParams.vrWorkMatrix = new k.Matrix, this._rigCameras[0]._cameraRigParams.vrHMatrix = a.leftHMatrix, this._rigCameras[0]._cameraRigParams.vrPreViewMatrix = a.leftPreViewMatrix, this._rigCameras[0].getProjectionMatrix = this._rigCameras[0]._getVRProjectionMatrix, this._rigCameras[1]._cameraRigParams.vrMetrics = a, this._rigCameras[1].viewport = new k.Viewport(.5, 0, .5, 1), this._rigCameras[1]._cameraRigParams.vrWorkMatrix = new k.Matrix, this._rigCameras[1]._cameraRigParams.vrHMatrix = a.rightHMatrix, this._rigCameras[1]._cameraRigParams.vrPreViewMatrix = a.rightPreViewMatrix, this._rigCameras[1].getProjectionMatrix = this._rigCameras[1]._getVRProjectionMatrix, a.compensateDistortion && (this._rigCameras[0]._rigPostProcess = new k.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Left", this._rigCameras[0], !1, a), this._rigCameras[1]._rigPostProcess = new k.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Right", this._rigCameras[1], !0, a));
                                    break;
                                case t.RIG_MODE_WEBVR:
                                    if (i.vrDisplay) {
                                        var l = i.vrDisplay.getEyeParameters("left"),
                                            u = i.vrDisplay.getEyeParameters("right");
                                        this._rigCameras[0].viewport = new k.Viewport(0, 0, .5, 1), this._rigCameras[0].setCameraRigParameter("left", !0), this._rigCameras[0].setCameraRigParameter("specs", i.specs), this._rigCameras[0].setCameraRigParameter("eyeParameters", l), this._rigCameras[0].setCameraRigParameter("frameData", i.frameData), this._rigCameras[0].setCameraRigParameter("parentCamera", i.parentCamera), this._rigCameras[0]._cameraRigParams.vrWorkMatrix = new k.Matrix, this._rigCameras[0].getProjectionMatrix = this._getWebVRProjectionMatrix, (this._rigCameras[0].parent = this)._rigCameras[0]._getViewMatrix = this._getWebVRViewMatrix, this._rigCameras[1].viewport = new k.Viewport(.5, 0, .5, 1), this._rigCameras[1].setCameraRigParameter("eyeParameters", u), this._rigCameras[1].setCameraRigParameter("specs", i.specs), this._rigCameras[1].setCameraRigParameter("frameData", i.frameData), this._rigCameras[1].setCameraRigParameter("parentCamera", i.parentCamera), this._rigCameras[1]._cameraRigParams.vrWorkMatrix = new k.Matrix, this._rigCameras[1].getProjectionMatrix = this._getWebVRProjectionMatrix, (this._rigCameras[1].parent = this)._rigCameras[1]._getViewMatrix = this._getWebVRViewMatrix, t.UseAlternateWebVRRendering && (this._rigCameras[1]._skipRendering = !0, this._rigCameras[0]._alternateCamera = this._rigCameras[1])
                                    }
                            }
                            this._cascadePostProcessesToRigCams(), this.update()
                        }
                    }, t.prototype._getVRProjectionMatrix = function() {
                        return k.Matrix.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix), this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix), this._projectionMatrix
                    }, t.prototype._updateCameraRotationMatrix = function() {}, t.prototype._updateWebVRCameraRotationMatrix = function() {}, t.prototype._getWebVRProjectionMatrix = function() {
                        return k.Matrix.Identity()
                    }, t.prototype._getWebVRViewMatrix = function() {
                        return k.Matrix.Identity()
                    }, t.prototype.setCameraRigParameter = function(e, t) {
                        this._cameraRigParams || (this._cameraRigParams = {}), this._cameraRigParams[e] = t, "interaxialDistance" === e && (this._cameraRigParams.stereoHalfAngle = k.Tools.ToRadians(t / .0637))
                    }, t.prototype.createRigCamera = function(e, t) {
                        return null
                    }, t.prototype._updateRigCameras = function() {
                        for (var e = 0; e < this._rigCameras.length; e++) this._rigCameras[e].minZ = this.minZ, this._rigCameras[e].maxZ = this.maxZ, this._rigCameras[e].fov = this.fov;
                        this.cameraRigMode === t.RIG_MODE_STEREOSCOPIC_ANAGLYPH && (this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport)
                    }, t.prototype._setupInputs = function() {}, t.prototype.serialize = function() {
                        var e = k.SerializationHelper.Serialize(this);
                        return e.type = this.getClassName(), this.parent && (e.parentId = this.parent.id), this.inputs && this.inputs.serialize(e), k.Animation.AppendSerializedAnimations(this, e), e.ranges = this.serializeAnimationRanges(), e
                    }, t.prototype.clone = function(e) {
                        return k.SerializationHelper.Clone(t.GetConstructorFromName(this.getClassName(), e, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this)
                    }, t.prototype.getDirection = function(e) {
                        var t = k.Vector3.Zero();
                        return this.getDirectionToRef(e, t), t
                    }, t.prototype.getDirectionToRef = function(e, t) {
                        k.Vector3.TransformNormalToRef(e, this.getWorldMatrix(), t)
                    }, t.GetConstructorFromName = function(e, t, i, r, n) {
                        return void 0 === r && (r = 0), void 0 === n && (n = !0), k.Node.Construct(e, t, i, {
                            interaxial_distance: r,
                            isStereoscopicSideBySide: n
                        }) || function() {
                            return new k.UniversalCamera(t, k.Vector3.Zero(), i)
                        }
                    }, t.prototype.computeWorldMatrix = function() {
                        return this.getWorldMatrix()
                    }, t.Parse = function(e, i) {
                        var r = e.type,
                            n = t.GetConstructorFromName(r, e.name, i, e.interaxial_distance, e.isStereoscopicSideBySide),
                            o = k.SerializationHelper.Parse(n, e, i);
                        if (e.parentId && (o._waitingParentId = e.parentId), o.inputs && (o.inputs.parse(e), o._setupInputs()), o.setPosition && (o.position.copyFromFloats(0, 0, 0), o.setPosition(k.Vector3.FromArray(e.position))), e.target && o.setTarget && o.setTarget(k.Vector3.FromArray(e.target)), e.cameraRigMode) {
                            var s = e.interaxial_distance ? {
                                interaxialDistance: e.interaxial_distance
                            } : {};
                            o.setCameraRigMode(e.cameraRigMode, s)
                        }
                        if (e.animations) {
                            for (var a = 0; a < e.animations.length; a++) {
                                var l = e.animations[a];
                                o.animations.push(k.Animation.Parse(l))
                            }
                            k.Node.ParseAnimationRanges(o, e, i)
                        }
                        return e.autoAnimate && i.beginAnimation(o, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1), o
                    }, t.PERSPECTIVE_CAMERA = 0, t.ORTHOGRAPHIC_CAMERA = 1, t.FOVMODE_VERTICAL_FIXED = 0, t.FOVMODE_HORIZONTAL_FIXED = 1, t.RIG_MODE_NONE = 0, t.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10, t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11, t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12, t.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13, t.RIG_MODE_VR = 20, t.RIG_MODE_WEBVR = 21, t.ForceAttachControlToAlwaysPreventDefault = !1, t.UseAlternateWebVRRendering = !1, y([k.serializeAsVector3()], t.prototype, "position", void 0), y([k.serializeAsVector3()], t.prototype, "upVector", void 0), y([k.serialize()], t.prototype, "orthoLeft", void 0), y([k.serialize()], t.prototype, "orthoRight", void 0), y([k.serialize()], t.prototype, "orthoBottom", void 0), y([k.serialize()], t.prototype, "orthoTop", void 0), y([k.serialize()], t.prototype, "fov", void 0), y([k.serialize()], t.prototype, "minZ", void 0), y([k.serialize()], t.prototype, "maxZ", void 0), y([k.serialize()], t.prototype, "inertia", void 0), y([k.serialize()], t.prototype, "mode", void 0), y([k.serialize()], t.prototype, "layerMask", void 0), y([k.serialize()], t.prototype, "fovMode", void 0), y([k.serialize()], t.prototype, "cameraRigMode", void 0), y([k.serialize()], t.prototype, "interaxialDistance", void 0), y([k.serialize()], t.prototype, "isStereoscopicSideBySide", void 0), t
                }(k.Node), k.Camera = U, G = $a || ($a = {}), z = function() {
                    function e(t) {
                        this._useSceneAutoClearSetup = !1, this._renderingGroups = new Array, this._autoClearDepthStencil = {}, this._customOpaqueSortCompareFn = {}, this._customAlphaTestSortCompareFn = {}, this._customTransparentSortCompareFn = {}, this._renderingGroupInfo = new G.RenderingGroupInfo, this._scene = t;
                        for (var i = e.MIN_RENDERINGGROUPS; i < e.MAX_RENDERINGGROUPS; i++) this._autoClearDepthStencil[i] = {
                            autoClear: !0,
                            depth: !0,
                            stencil: !0
                        }
                    }
                    return e.prototype._clearDepthStencilBuffer = function(e, t) {
                        void 0 === e && (e = !0), void 0 === t && (t = !0), this._depthStencilBufferAlreadyCleaned || (this._scene.getEngine().clear(null, !1, e, t), this._depthStencilBufferAlreadyCleaned = !0)
                    }, e.prototype.render = function(t, i, r, n) {
                        var o = this._renderingGroupInfo;
                        if (o.scene = this._scene, o.camera = this._scene.activeCamera, this._scene.spriteManagers && n)
                            for (var s = 0; s < this._scene.spriteManagers.length; s++) {
                                var a = this._scene.spriteManagers[s];
                                this.dispatchSprites(a)
                            }
                        for (s = e.MIN_RENDERINGGROUPS; s < e.MAX_RENDERINGGROUPS; s++) {
                            this._depthStencilBufferAlreadyCleaned = s === e.MIN_RENDERINGGROUPS;
                            var l = this._renderingGroups[s];
                            if (l) {
                                var u = Math.pow(2, s);
                                if (o.renderingGroupId = s, this._scene.onBeforeRenderingGroupObservable.notifyObservers(o, u), e.AUTOCLEAR) {
                                    var c = this._useSceneAutoClearSetup ? this._scene.getAutoClearDepthStencilSetup(s) : this._autoClearDepthStencil[s];
                                    c && c.autoClear && this._clearDepthStencilBuffer(c.depth, c.stencil)
                                }
                                for (var h = 0, d = this._scene._beforeRenderingGroupDrawStage; h < d.length; h++) d[h].action(s);
                                l.render(t, n, r, i);
                                for (var p = 0, f = this._scene._afterRenderingGroupDrawStage; p < f.length; p++) f[p].action(s);
                                this._scene.onAfterRenderingGroupObservable.notifyObservers(o, u)
                            }
                        }
                    }, e.prototype.reset = function() {
                        for (var t = e.MIN_RENDERINGGROUPS; t < e.MAX_RENDERINGGROUPS; t++) {
                            var i = this._renderingGroups[t];
                            i && i.prepare()
                        }
                    }, e.prototype.dispose = function() {
                        this.freeRenderingGroups(), this._renderingGroups.length = 0, this._renderingGroupInfo = null
                    }, e.prototype.freeRenderingGroups = function() {
                        for (var t = e.MIN_RENDERINGGROUPS; t < e.MAX_RENDERINGGROUPS; t++) {
                            var i = this._renderingGroups[t];
                            i && i.dispose()
                        }
                    }, e.prototype._prepareRenderingGroup = function(e) {
                        void 0 === this._renderingGroups[e] && (this._renderingGroups[e] = new G.RenderingGroup(e, this._scene, this._customOpaqueSortCompareFn[e], this._customAlphaTestSortCompareFn[e], this._customTransparentSortCompareFn[e]))
                    }, e.prototype.dispatchSprites = function(e) {
                        var t = e.renderingGroupId || 0;
                        this._prepareRenderingGroup(t), this._renderingGroups[t].dispatchSprites(e)
                    }, e.prototype.dispatchParticles = function(e) {
                        var t = e.renderingGroupId || 0;
                        this._prepareRenderingGroup(t), this._renderingGroups[t].dispatchParticles(e)
                    }, e.prototype.dispatch = function(e, t, i) {
                        void 0 === t && (t = e.getMesh());
                        var r = t.renderingGroupId || 0;
                        this._prepareRenderingGroup(r), this._renderingGroups[r].dispatch(e, t, i)
                    }, e.prototype.setRenderingOrder = function(e, t, i, r) {
                        if (void 0 === t && (t = null), void 0 === i && (i = null), void 0 === r && (r = null), this._customOpaqueSortCompareFn[e] = t, this._customAlphaTestSortCompareFn[e] = i, this._customTransparentSortCompareFn[e] = r, this._renderingGroups[e]) {
                            var n = this._renderingGroups[e];
                            n.opaqueSortCompareFn = this._customOpaqueSortCompareFn[e], n.alphaTestSortCompareFn = this._customAlphaTestSortCompareFn[e], n.transparentSortCompareFn = this._customTransparentSortCompareFn[e]
                        }
                    }, e.prototype.setRenderingAutoClearDepthStencil = function(e, t, i, r) {
                        void 0 === i && (i = !0), void 0 === r && (r = !0), this._autoClearDepthStencil[e] = {
                            autoClear: t,
                            depth: i,
                            stencil: r
                        }
                    }, e.prototype.getAutoClearDepthStencilSetup = function(e) {
                        return this._autoClearDepthStencil[e]
                    }, e.MAX_RENDERINGGROUPS = 4, e.MIN_RENDERINGGROUPS = 0, e.AUTOCLEAR = !0, e
                }(), G.RenderingManager = z, j = $a || ($a = {}), H = function() {
                    function e(e, t, i, r, n) {
                        void 0 === i && (i = null), void 0 === r && (r = null), void 0 === n && (n = null), this.index = e, this._opaqueSubMeshes = new j.SmartArray(256), this._transparentSubMeshes = new j.SmartArray(256), this._alphaTestSubMeshes = new j.SmartArray(256), this._depthOnlySubMeshes = new j.SmartArray(256), this._particleSystems = new j.SmartArray(256), this._spriteManagers = new j.SmartArray(256), this._edgesRenderers = new j.SmartArray(16), this._scene = t, this.opaqueSortCompareFn = i, this.alphaTestSortCompareFn = r, this.transparentSortCompareFn = n
                    }
                    return Object.defineProperty(e.prototype, "opaqueSortCompareFn", {
                        set: function(t) {
                            this._opaqueSortCompareFn = t, this._renderOpaque = t ? this.renderOpaqueSorted : e.renderUnsorted
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "alphaTestSortCompareFn", {
                        set: function(t) {
                            this._alphaTestSortCompareFn = t, this._renderAlphaTest = t ? this.renderAlphaTestSorted : e.renderUnsorted
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "transparentSortCompareFn", {
                        set: function(t) {
                            this._transparentSortCompareFn = t || e.defaultTransparentSortCompare, this._renderTransparent = this.renderTransparentSorted
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.render = function(e, t, i, r) {
                        if (e) e(this._opaqueSubMeshes, this._alphaTestSubMeshes, this._transparentSubMeshes, this._depthOnlySubMeshes);
                        else {
                            var n = this._scene.getEngine();
                            0 !== this._depthOnlySubMeshes.length && (n.setColorWrite(!1), this._renderAlphaTest(this._depthOnlySubMeshes), n.setColorWrite(!0)), 0 !== this._opaqueSubMeshes.length && this._renderOpaque(this._opaqueSubMeshes), 0 !== this._alphaTestSubMeshes.length && this._renderAlphaTest(this._alphaTestSubMeshes);
                            var o = n.getStencilBuffer();
                            if (n.setStencilBuffer(!1), t && this._renderSprites(), i && this._renderParticles(r), this.onBeforeTransparentRendering && this.onBeforeTransparentRendering(), 0 !== this._transparentSubMeshes.length && (this._renderTransparent(this._transparentSubMeshes), n.setAlphaMode(j.Engine.ALPHA_DISABLE)), n.setStencilBuffer(!1), this._edgesRenderers.length) {
                                for (var s = 0; s < this._edgesRenderers.length; s++) this._edgesRenderers.data[s].render();
                                n.setAlphaMode(j.Engine.ALPHA_DISABLE)
                            }
                            n.setStencilBuffer(o)
                        }
                    }, e.prototype.renderOpaqueSorted = function(t) {
                        return e.renderSorted(t, this._opaqueSortCompareFn, this._scene.activeCamera, !1)
                    }, e.prototype.renderAlphaTestSorted = function(t) {
                        return e.renderSorted(t, this._alphaTestSortCompareFn, this._scene.activeCamera, !1)
                    }, e.prototype.renderTransparentSorted = function(t) {
                        return e.renderSorted(t, this._transparentSortCompareFn, this._scene.activeCamera, !0)
                    }, e.renderSorted = function(e, t, i, r) {
                        for (var n, o = 0, s = i ? i.globalPosition : j.Vector3.Zero(); o < e.length; o++)(n = e.data[o])._alphaIndex = n.getMesh().alphaIndex, n._distanceToCamera = n.getBoundingInfo().boundingSphere.centerWorld.subtract(s).length();
                        var a = e.data.slice(0, e.length);
                        for (t && a.sort(t), o = 0; o < a.length; o++) {
                            if (n = a[o], r) {
                                var l = n.getMaterial();
                                if (l && l.needDepthPrePass) {
                                    var u = l.getScene().getEngine();
                                    u.setColorWrite(!1), u.setAlphaMode(j.Engine.ALPHA_DISABLE), n.render(!1), u.setColorWrite(!0)
                                }
                            }
                            n.render(r)
                        }
                    }, e.renderUnsorted = function(e) {
                        for (var t = 0; t < e.length; t++) e.data[t].render(!1)
                    }, e.defaultTransparentSortCompare = function(t, i) {
                        return t._alphaIndex > i._alphaIndex ? 1 : t._alphaIndex < i._alphaIndex ? -1 : e.backToFrontSortCompare(t, i)
                    }, e.backToFrontSortCompare = function(e, t) {
                        return e._distanceToCamera < t._distanceToCamera ? 1 : e._distanceToCamera > t._distanceToCamera ? -1 : 0
                    }, e.frontToBackSortCompare = function(e, t) {
                        return e._distanceToCamera < t._distanceToCamera ? -1 : e._distanceToCamera > t._distanceToCamera ? 1 : 0
                    }, e.prototype.prepare = function() {
                        this._opaqueSubMeshes.reset(), this._transparentSubMeshes.reset(), this._alphaTestSubMeshes.reset(), this._depthOnlySubMeshes.reset(), this._particleSystems.reset(), this._spriteManagers.reset(), this._edgesRenderers.reset()
                    }, e.prototype.dispose = function() {
                        this._opaqueSubMeshes.dispose(), this._transparentSubMeshes.dispose(), this._alphaTestSubMeshes.dispose(), this._depthOnlySubMeshes.dispose(), this._particleSystems.dispose(), this._spriteManagers.dispose(), this._edgesRenderers.dispose()
                    }, e.prototype.dispatch = function(e, t, i) {
                        void 0 === t && (t = e.getMesh()), void 0 === i && (i = e.getMaterial()), null != i && (i.needAlphaBlendingForMesh(t) ? this._transparentSubMeshes.push(e) : i.needAlphaTesting() ? (i.needDepthPrePass && this._depthOnlySubMeshes.push(e), this._alphaTestSubMeshes.push(e)) : (i.needDepthPrePass && this._depthOnlySubMeshes.push(e), this._opaqueSubMeshes.push(e)), t._edgesRenderer && t._edgesRenderer.isEnabled && this._edgesRenderers.push(t._edgesRenderer))
                    }, e.prototype.dispatchSprites = function(e) {
                        this._spriteManagers.push(e)
                    }, e.prototype.dispatchParticles = function(e) {
                        this._particleSystems.push(e)
                    }, e.prototype._renderParticles = function(e) {
                        if (0 !== this._particleSystems.length) {
                            var t = this._scene.activeCamera;
                            this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);
                            for (var i = 0; i < this._particleSystems.length; i++) {
                                var r = this._particleSystems.data[i];
                                if (0 !== (t && t.layerMask & r.layerMask)) {
                                    var n = r.emitter;
                                    n.position && e && -1 === e.indexOf(n) || this._scene._activeParticles.addCount(r.render(), !1)
                                }
                            }
                            this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)
                        }
                    }, e.prototype._renderSprites = function() {
                        if (this._scene.spritesEnabled && 0 !== this._spriteManagers.length) {
                            var e = this._scene.activeCamera;
                            this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);
                            for (var t = 0; t < this._spriteManagers.length; t++) {
                                var i = this._spriteManagers.data[t];
                                0 !== (e && e.layerMask & i.layerMask) && i.render()
                            }
                            this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene)
                        }
                    }, e
                }(), j.RenderingGroup = H,
                function(e) {
                    var t = function() {
                        function e() {}
                        return e.NAME_EFFECTLAYER = "EffectLayer", e.NAME_LAYER = "Layer", e.NAME_LENSFLARESYSTEM = "LensFlareSystem", e.NAME_BOUNDINGBOXRENDERER = "BoundingBoxRenderer", e.NAME_PARTICLESYSTEM = "ParticleSystem", e.NAME_GAMEPAD = "Gamepad", e.NAME_SIMPLIFICATIONQUEUE = "SimplificationQueue", e.NAME_GEOMETRYBUFFERRENDERER = "GeometryBufferRenderer", e.NAME_DEPTHRENDERER = "DepthRenderer", e.NAME_POSTPROCESSRENDERPIPELINEMANAGER = "PostProcessRenderPipelineManager", e.NAME_SPRITE = "Sprite", e.NAME_OUTLINERENDERER = "Outline", e.NAME_PROCEDURALTEXTURE = "ProceduralTexture", e.NAME_SHADOWGENERATOR = "ShadowGenerator", e.NAME_OCTREE = "Octree", e.NAME_PHYSICSENGINE = "PhysicsEngine", e.NAME_AUDIO = "Audio", e.STEP_ISREADYFORMESH_EFFECTLAYER = 0, e.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0, e.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0, e.STEP_ACTIVEMESH_BOUNDINGBOXRENDERER = 0, e.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER = 1, e.STEP_BEFORECAMERADRAW_EFFECTLAYER = 0, e.STEP_BEFORECAMERADRAW_LAYER = 1, e.STEP_BEFORERENDERINGMESH_OUTLINE = 0, e.STEP_AFTERRENDERINGMESH_OUTLINE = 0, e.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0, e.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1, e.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0, e.STEP_BEFORECAMERAUPDATE_GAMEPAD = 1, e.STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0, e.STEP_AFTERCAMERADRAW_EFFECTLAYER = 0, e.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 1, e.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW = 2, e.STEP_AFTERCAMERADRAW_LAYER = 3, e.STEP_AFTERRENDER_AUDIO = 0, e.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 0, e.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1, e.STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 2, e.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3, e.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER = 0, e.STEP_POINTERMOVE_SPRITE = 0, e.STEP_POINTERDOWN_SPRITE = 0, e.STEP_POINTERUP_SPRITE = 0, e
                    }();
                    e.SceneComponentConstants = t;
                    var i = function(e) {
                        function t(t) {
                            return e.apply(this, t) || this
                        }
                        return b(t, e), t.Create = function() {
                            return Object.create(t.prototype)
                        }, t.prototype.registerStep = function(e, t, i) {
                            var r = 0;
                            for (Number.MAX_VALUE; r < this.length && !(e < this[r].index); r++);
                            this.splice(r, 0, {
                                index: e,
                                component: t,
                                action: i.bind(t)
                            })
                        }, t.prototype.clear = function() {
                            this.length = 0
                        }, t
                    }(Array);
                    e.Stage = i
                }($a || ($a = {})), W = $a || ($a = {}), X = function() {
                    function e() {
                        this.rootNodes = new Array, this.cameras = new Array, this.lights = new Array, this.meshes = new Array, this.skeletons = new Array, this.particleSystems = new Array, this.animations = [], this.animationGroups = new Array, this.multiMaterials = new Array, this.materials = new Array, this.morphTargetManagers = new Array, this.geometries = new Array, this.transformNodes = new Array, this.actionManagers = new Array, this.textures = new Array
                    }
                    return e.AddParser = function(e, t) {
                        this._BabylonFileParsers[e] = t
                    }, e.GetParser = function(e) {
                        return this._BabylonFileParsers[e] ? this._BabylonFileParsers[e] : null
                    }, e.AddIndividualParser = function(e, t) {
                        this._IndividualBabylonFileParsers[e] = t
                    }, e.GetIndividualParser = function(e) {
                        return this._IndividualBabylonFileParsers[e] ? this._IndividualBabylonFileParsers[e] : null
                    }, e.Parse = function(e, t, i, r) {
                        for (var n in this._BabylonFileParsers) this._BabylonFileParsers.hasOwnProperty(n) && this._BabylonFileParsers[n](e, t, i, r)
                    }, e._BabylonFileParsers = {}, e._IndividualBabylonFileParsers = {}, e
                }(), W.AbstractScene = X,
                function(e) {
                    var t = function() {
                            function e() {
                                this._singleClick = !1, this._doubleClick = !1, this._hasSwiped = !1, this._ignore = !1
                            }
                            return Object.defineProperty(e.prototype, "singleClick", {
                                get: function() {
                                    return this._singleClick
                                },
                                set: function(e) {
                                    this._singleClick = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(e.prototype, "doubleClick", {
                                get: function() {
                                    return this._doubleClick
                                },
                                set: function(e) {
                                    this._doubleClick = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(e.prototype, "hasSwiped", {
                                get: function() {
                                    return this._hasSwiped
                                },
                                set: function(e) {
                                    this._hasSwiped = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(e.prototype, "ignore", {
                                get: function() {
                                    return this._ignore
                                },
                                set: function(e) {
                                    this._ignore = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), e
                        }(),
                        i = function() {};
                    e.RenderingGroupInfo = i;
                    var r = function(i) {
                        function r(t) {
                            var n = i.call(this) || this;
                            return n.autoClear = !0, n.autoClearDepthAndStencil = !0, n.clearColor = new e.Color4(.2, .2, .3, 1), n.ambientColor = new e.Color3(0, 0, 0), n._forceWireframe = !1, n._forcePointsCloud = !1, n.animationsEnabled = !0, n._animationPropertiesOverride = null, n.useConstantAnimationDeltaTime = !1, n.constantlyUpdateMeshUnderPointer = !1, n.hoverCursor = "pointer", n.defaultCursor = "", n.preventDefaultOnPointerDown = !0, n.metadata = null, n.disableOfflineSupportExceptionRules = new Array, n.onDisposeObservable = new e.Observable, n._onDisposeObserver = null, n.onBeforeRenderObservable = new e.Observable, n._onBeforeRenderObserver = null, n.onAfterRenderObservable = new e.Observable, n._onAfterRenderObserver = null, n.onBeforeAnimationsObservable = new e.Observable, n.onAfterAnimationsObservable = new e.Observable, n.onBeforeDrawPhaseObservable = new e.Observable, n.onAfterDrawPhaseObservable = new e.Observable, n.onReadyObservable = new e.Observable, n.onBeforeCameraRenderObservable = new e.Observable, n._onBeforeCameraRenderObserver = null, n.onAfterCameraRenderObservable = new e.Observable, n._onAfterCameraRenderObserver = null, n.onBeforeActiveMeshesEvaluationObservable = new e.Observable, n.onAfterActiveMeshesEvaluationObservable = new e.Observable, n.onBeforeParticlesRenderingObservable = new e.Observable, n.onAfterParticlesRenderingObservable = new e.Observable, n.onDataLoadedObservable = new e.Observable, n.onNewCameraAddedObservable = new e.Observable, n.onCameraRemovedObservable = new e.Observable, n.onNewLightAddedObservable = new e.Observable, n.onLightRemovedObservable = new e.Observable, n.onNewGeometryAddedObservable = new e.Observable, n.onGeometryRemovedObservable = new e.Observable, n.onNewTransformNodeAddedObservable = new e.Observable, n.onTransformNodeRemovedObservable = new e.Observable, n.onNewMeshAddedObservable = new e.Observable, n.onMeshRemovedObservable = new e.Observable, n.onNewMaterialAddedObservable = new e.Observable, n.onMaterialRemovedObservable = new e.Observable, n.onNewTextureAddedObservable = new e.Observable, n.onTextureRemovedObservable = new e.Observable, n.onBeforeRenderTargetsRenderObservable = new e.Observable, n.onAfterRenderTargetsRenderObservable = new e.Observable, n.onBeforeStepObservable = new e.Observable, n.onAfterStepObservable = new e.Observable, n.onBeforeRenderingGroupObservable = new e.Observable, n.onAfterRenderingGroupObservable = new e.Observable, n.onMeshImportedObservable = new e.Observable, n._registeredForLateAnimationBindings = new e.SmartArrayNoDuplicate(256), n.onPrePointerObservable = new e.Observable, n.onPointerObservable = new e.Observable, n._meshPickProceed = !1, n._currentPickResult = null, n._previousPickResult = null, n._totalPointersPressed = 0, n._doubleClickOccured = !1, n.cameraToUseForPointers = null, n._pointerX = 0, n._pointerY = 0, n._startingPointerPosition = new e.Vector2(0, 0), n._previousStartingPointerPosition = new e.Vector2(0, 0), n._startingPointerTime = 0, n._previousStartingPointerTime = 0, n._pointerCaptures = {}, n._timeAccumulator = 0, n._currentStepId = 0, n._currentInternalStep = 0, n.onPreKeyboardObservable = new e.Observable, n.onKeyboardObservable = new e.Observable, n._useRightHandedSystem = !1, n._fogEnabled = !0, n._fogMode = r.FOGMODE_NONE, n.fogColor = new e.Color3(.2, .2, .3), n.fogDensity = .1, n.fogStart = 0, n.fogEnd = 1e3, n._shadowsEnabled = !0, n._lightsEnabled = !0, n.activeCameras = new Array, n._texturesEnabled = !0, n.particlesEnabled = !0, n.spritesEnabled = !0, n._skeletonsEnabled = !0, n.lensFlaresEnabled = !0, n.collisionsEnabled = !0, n.gravity = new e.Vector3(0, -9.807, 0), n.postProcessesEnabled = !0, n.postProcesses = new Array, n.renderTargetsEnabled = !0, n.dumpNextRenderTargets = !1, n.customRenderTargets = new Array, n.importedMeshesFiles = new Array, n.probesEnabled = !0, n._meshesForIntersections = new e.SmartArrayNoDuplicate(256), n.proceduralTexturesEnabled = !0, n._totalVertices = new e.PerfCounter, n._activeIndices = new e.PerfCounter, n._activeParticles = new e.PerfCounter, n._activeBones = new e.PerfCounter, n._animationTime = 0, n.animationTimeScale = 1, n._renderId = 0, n._frameId = 0, n._executeWhenReadyTimeoutId = -1, n._intermediateRendering = !1, n._viewUpdateFlag = -1, n._projectionUpdateFlag = -1, n._alternateViewUpdateFlag = -1, n._alternateProjectionUpdateFlag = -1, n._toBeDisposed = new Array(256), n._activeRequests = new Array, n._pendingData = new Array, n._isDisposed = !1, n.dispatchAllSubMeshesOfActiveMeshes = !1, n._activeMeshes = new e.SmartArray(256), n._processedMaterials = new e.SmartArray(256), n._renderTargets = new e.SmartArrayNoDuplicate(256), n._activeParticleSystems = new e.SmartArray(256), n._activeSkeletons = new e.SmartArrayNoDuplicate(32), n._softwareSkinnedMeshes = new e.SmartArrayNoDuplicate(32), n._activeAnimatables = new Array, n._transformMatrix = e.Matrix.Zero(), n._useAlternateCameraConfiguration = !1, n._alternateRendering = !1, n.requireLightSorting = !1, n._components = [], n._serializableComponents = [], n._transientComponents = [], n._beforeCameraUpdateStage = e.Stage.Create(), n._beforeClearStage = e.Stage.Create(), n._gatherRenderTargetsStage = e.Stage.Create(), n._gatherActiveCameraRenderTargetsStage = e.Stage.Create(), n._isReadyForMeshStage = e.Stage.Create(), n._beforeEvaluateActiveMeshStage = e.Stage.Create(), n._evaluateSubMeshStage = e.Stage.Create(), n._activeMeshStage = e.Stage.Create(), n._cameraDrawRenderTargetStage = e.Stage.Create(), n._beforeCameraDrawStage = e.Stage.Create(), n._beforeRenderingGroupDrawStage = e.Stage.Create(), n._beforeRenderingMeshStage = e.Stage.Create(), n._afterRenderingMeshStage = e.Stage.Create(), n._afterRenderingGroupDrawStage = e.Stage.Create(), n._afterCameraDrawStage = e.Stage.Create(), n._afterRenderStage = e.Stage.Create(), n._pointerMoveStage = e.Stage.Create(), n._pointerDownStage = e.Stage.Create(), n._pointerUpStage = e.Stage.Create(), n._defaultMeshCandidates = {
                                data: [],
                                length: 0
                            }, n._defaultSubMeshCandidates = {
                                data: [],
                                length: 0
                            }, n._activeMeshesFrozen = !1, n._allowPostProcessClearColor = !0, n.getDeterministicFrameTime = function() {
                                return 1e3 / 60
                            }, n._tempPickingRay = e.Ray ? e.Ray.Zero() : null, n._blockMaterialDirtyMechanism = !1, n._engine = t || e.Engine.LastCreatedEngine, n._engine.scenes.push(n), n._uid = null, n._renderingManager = new e.RenderingManager(n), e.PostProcessManager && (n.postProcessManager = new e.PostProcessManager(n)), e.Tools.IsWindowObjectExist() && n.attachControl(), n.workerCollisions = !1, n._createUbo(), e.ImageProcessingConfiguration && (n._imageProcessingConfiguration = new e.ImageProcessingConfiguration), n.setDefaultCandidateProviders(), n
                        }
                        return b(r, i), Object.defineProperty(r.prototype, "environmentTexture", {
                            get: function() {
                                return this._environmentTexture
                            },
                            set: function(t) {
                                this._environmentTexture !== t && (this._environmentTexture = t, this.markAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "imageProcessingConfiguration", {
                            get: function() {
                                return this._imageProcessingConfiguration
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "forceWireframe", {
                            get: function() {
                                return this._forceWireframe
                            },
                            set: function(t) {
                                this._forceWireframe !== t && (this._forceWireframe = t, this.markAllMaterialsAsDirty(e.Material.MiscDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "forcePointsCloud", {
                            get: function() {
                                return this._forcePointsCloud
                            },
                            set: function(t) {
                                this._forcePointsCloud !== t && (this._forcePointsCloud = t, this.markAllMaterialsAsDirty(e.Material.MiscDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "animationPropertiesOverride", {
                            get: function() {
                                return this._animationPropertiesOverride
                            },
                            set: function(e) {
                                this._animationPropertiesOverride = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "onDispose", {
                            set: function(e) {
                                this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "beforeRender", {
                            set: function(e) {
                                this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), e && (this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(e))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "afterRender", {
                            set: function(e) {
                                this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), e && (this._onAfterRenderObserver = this.onAfterRenderObservable.add(e))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "beforeCameraRender", {
                            set: function(e) {
                                this._onBeforeCameraRenderObserver && this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = this.onBeforeCameraRenderObservable.add(e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "afterCameraRender", {
                            set: function(e) {
                                this._onAfterCameraRenderObserver && this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = this.onAfterCameraRenderObservable.add(e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "unTranslatedPointer", {
                            get: function() {
                                return new e.Vector2(this._unTranslatedPointerX, this._unTranslatedPointerY)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "useRightHandedSystem", {
                            get: function() {
                                return this._useRightHandedSystem
                            },
                            set: function(t) {
                                this._useRightHandedSystem !== t && (this._useRightHandedSystem = t, this.markAllMaterialsAsDirty(e.Material.MiscDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.setStepId = function(e) {
                            this._currentStepId = e
                        }, r.prototype.getStepId = function() {
                            return this._currentStepId
                        }, r.prototype.getInternalStep = function() {
                            return this._currentInternalStep
                        }, Object.defineProperty(r.prototype, "fogEnabled", {
                            get: function() {
                                return this._fogEnabled
                            },
                            set: function(t) {
                                this._fogEnabled !== t && (this._fogEnabled = t, this.markAllMaterialsAsDirty(e.Material.MiscDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "fogMode", {
                            get: function() {
                                return this._fogMode
                            },
                            set: function(t) {
                                this._fogMode !== t && (this._fogMode = t, this.markAllMaterialsAsDirty(e.Material.MiscDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "shadowsEnabled", {
                            get: function() {
                                return this._shadowsEnabled
                            },
                            set: function(t) {
                                this._shadowsEnabled !== t && (this._shadowsEnabled = t, this.markAllMaterialsAsDirty(e.Material.LightDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "lightsEnabled", {
                            get: function() {
                                return this._lightsEnabled
                            },
                            set: function(t) {
                                this._lightsEnabled !== t && (this._lightsEnabled = t, this.markAllMaterialsAsDirty(e.Material.LightDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "defaultMaterial", {
                            get: function() {
                                return this._defaultMaterial || (this._defaultMaterial = new e.StandardMaterial("default material", this)), this._defaultMaterial
                            },
                            set: function(e) {
                                this._defaultMaterial = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "texturesEnabled", {
                            get: function() {
                                return this._texturesEnabled
                            },
                            set: function(t) {
                                this._texturesEnabled !== t && (this._texturesEnabled = t, this.markAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "skeletonsEnabled", {
                            get: function() {
                                return this._skeletonsEnabled
                            },
                            set: function(t) {
                                this._skeletonsEnabled !== t && (this._skeletonsEnabled = t, this.markAllMaterialsAsDirty(e.Material.AttributesDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "_isAlternateRenderingEnabled", {
                            get: function() {
                                return this._alternateRendering
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "frustumPlanes", {
                            get: function() {
                                return this._frustumPlanes
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype._registerTransientComponents = function() {
                            if (0 < this._transientComponents.length) {
                                for (var e = 0, t = this._transientComponents; e < t.length; e++) t[e].register();
                                this._transientComponents = []
                            }
                        }, r.prototype._addComponent = function(e) {
                            this._components.push(e), this._transientComponents.push(e);
                            var t = e;
                            t.addFromContainer && this._serializableComponents.push(t)
                        }, r.prototype._getComponent = function(e) {
                            for (var t = 0, i = this._components; t < i.length; t++) {
                                var r = i[t];
                                if (r.name === e) return r
                            }
                            return null
                        }, r.prototype._getDefaultMeshCandidates = function() {
                            return this._defaultMeshCandidates.data = this.meshes, this._defaultMeshCandidates.length = this.meshes.length, this._defaultMeshCandidates
                        }, r.prototype._getDefaultSubMeshCandidates = function(e) {
                            return this._defaultSubMeshCandidates.data = e.subMeshes, this._defaultSubMeshCandidates.length = e.subMeshes.length, this._defaultSubMeshCandidates
                        }, r.prototype.setDefaultCandidateProviders = function() {
                            this.getActiveMeshCandidates = this._getDefaultMeshCandidates.bind(this), this.getActiveSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this), this.getIntersectingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this), this.getCollidingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this)
                        }, Object.defineProperty(r.prototype, "workerCollisions", {
                            get: function() {
                                return this._workerCollisions
                            },
                            set: function(t) {
                                e.CollisionCoordinatorLegacy && (t = t && !!Worker && !!e.CollisionWorker, this._workerCollisions = t, this.collisionCoordinator && this.collisionCoordinator.destroy(), this.collisionCoordinator = t ? new e.CollisionCoordinatorWorker : new e.CollisionCoordinatorLegacy, this.collisionCoordinator.init(this))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "meshUnderPointer", {
                            get: function() {
                                return this._pointerOverMesh
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "pointerX", {
                            get: function() {
                                return this._pointerX
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "pointerY", {
                            get: function() {
                                return this._pointerY
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getCachedMaterial = function() {
                            return this._cachedMaterial
                        }, r.prototype.getCachedEffect = function() {
                            return this._cachedEffect
                        }, r.prototype.getCachedVisibility = function() {
                            return this._cachedVisibility
                        }, r.prototype.isCachedMaterialInvalid = function(e, t, i) {
                            return void 0 === i && (i = 1), this._cachedEffect !== t || this._cachedMaterial !== e || this._cachedVisibility !== i
                        }, r.prototype.getEngine = function() {
                            return this._engine
                        }, r.prototype.getTotalVertices = function() {
                            return this._totalVertices.current
                        }, Object.defineProperty(r.prototype, "totalVerticesPerfCounter", {
                            get: function() {
                                return this._totalVertices
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getActiveIndices = function() {
                            return this._activeIndices.current
                        }, Object.defineProperty(r.prototype, "totalActiveIndicesPerfCounter", {
                            get: function() {
                                return this._activeIndices
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getActiveParticles = function() {
                            return this._activeParticles.current
                        }, Object.defineProperty(r.prototype, "activeParticlesPerfCounter", {
                            get: function() {
                                return this._activeParticles
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getActiveBones = function() {
                            return this._activeBones.current
                        }, Object.defineProperty(r.prototype, "activeBonesPerfCounter", {
                            get: function() {
                                return this._activeBones
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getInterFramePerfCounter = function() {
                            return e.Tools.Warn("getInterFramePerfCounter is deprecated. Please use SceneInstrumentation class"), 0
                        }, Object.defineProperty(r.prototype, "interFramePerfCounter", {
                            get: function() {
                                return e.Tools.Warn("interFramePerfCounter is deprecated. Please use SceneInstrumentation class"), null
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getLastFrameDuration = function() {
                            return e.Tools.Warn("getLastFrameDuration is deprecated. Please use SceneInstrumentation class"), 0
                        }, Object.defineProperty(r.prototype, "lastFramePerfCounter", {
                            get: function() {
                                return e.Tools.Warn("lastFramePerfCounter is deprecated. Please use SceneInstrumentation class"), null
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getEvaluateActiveMeshesDuration = function() {
                            return e.Tools.Warn("getEvaluateActiveMeshesDuration is deprecated. Please use SceneInstrumentation class"), 0
                        }, Object.defineProperty(r.prototype, "evaluateActiveMeshesDurationPerfCounter", {
                            get: function() {
                                return e.Tools.Warn("evaluateActiveMeshesDurationPerfCounter is deprecated. Please use SceneInstrumentation class"), null
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getActiveMeshes = function() {
                            return this._activeMeshes
                        }, r.prototype.getRenderTargetsDuration = function() {
                            return e.Tools.Warn("getRenderTargetsDuration is deprecated. Please use SceneInstrumentation class"), 0
                        }, r.prototype.getRenderDuration = function() {
                            return e.Tools.Warn("getRenderDuration is deprecated. Please use SceneInstrumentation class"), 0
                        }, Object.defineProperty(r.prototype, "renderDurationPerfCounter", {
                            get: function() {
                                return e.Tools.Warn("renderDurationPerfCounter is deprecated. Please use SceneInstrumentation class"), null
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getParticlesDuration = function() {
                            return e.Tools.Warn("getParticlesDuration is deprecated. Please use SceneInstrumentation class"), 0
                        }, Object.defineProperty(r.prototype, "particlesDurationPerfCounter", {
                            get: function() {
                                return e.Tools.Warn("particlesDurationPerfCounter is deprecated. Please use SceneInstrumentation class"), null
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getSpritesDuration = function() {
                            return e.Tools.Warn("getSpritesDuration is deprecated. Please use SceneInstrumentation class"), 0
                        }, Object.defineProperty(r.prototype, "spriteDuractionPerfCounter", {
                            get: function() {
                                return e.Tools.Warn("spriteDuractionPerfCounter is deprecated. Please use SceneInstrumentation class"), null
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getAnimationRatio = function() {
                            return void 0 !== this._animationRatio ? this._animationRatio : 1
                        }, r.prototype.getRenderId = function() {
                            return this._renderId
                        }, r.prototype.getFrameId = function() {
                            return this._frameId
                        }, r.prototype.incrementRenderId = function() {
                            this._renderId++
                        }, r.prototype._updatePointerPosition = function(e) {
                            var t = this._engine.getRenderingCanvasClientRect();
                            t && (this._pointerX = e.clientX - t.left, this._pointerY = e.clientY - t.top, this._unTranslatedPointerX = this._pointerX, this._unTranslatedPointerY = this._pointerY)
                        }, r.prototype._createUbo = function() {
                            this._sceneUbo = new e.UniformBuffer(this._engine, void 0, !0), this._sceneUbo.addUniform("viewProjection", 16), this._sceneUbo.addUniform("view", 16)
                        }, r.prototype._createAlternateUbo = function() {
                            this._alternateSceneUbo = new e.UniformBuffer(this._engine, void 0, !0), this._alternateSceneUbo.addUniform("viewProjection", 16), this._alternateSceneUbo.addUniform("view", 16)
                        }, r.prototype._setRayOnPointerInfo = function(t) {
                            t.pickInfo && (t.pickInfo.ray || (t.pickInfo.ray = this.createPickingRay(t.event.offsetX, t.event.offsetY, e.Matrix.Identity(), this.activeCamera)))
                        }, r.prototype.simulatePointerMove = function(t, i) {
                            var r = new PointerEvent("pointermove", i);
                            return this._checkPrePointerObservable(t, r, e.PointerEventTypes.POINTERMOVE) ? this : this._processPointerMove(t, r)
                        }, r.prototype._processPointerMove = function(t, i) {
                            var r = this._engine.getRenderingCanvas();
                            if (!r) return this;
                            r.style.cursor = this.defaultCursor;
                            var n = !!(t && t.hit && t.pickedMesh);
                            n ? (this.setPointerOverMesh(t.pickedMesh), this._pointerOverMesh && this._pointerOverMesh.actionManager && this._pointerOverMesh.actionManager.hasPointerTriggers && (this._pointerOverMesh.actionManager.hoverCursor ? r.style.cursor = this._pointerOverMesh.actionManager.hoverCursor : r.style.cursor = this.hoverCursor)) : this.setPointerOverMesh(null);
                            for (var o = 0, s = this._pointerMoveStage; o < s.length; o++) t = s[o].action(this._unTranslatedPointerX, this._unTranslatedPointerY, t, n, r);
                            if (t) {
                                var a = "mousewheel" === i.type || "DOMMouseScroll" === i.type ? e.PointerEventTypes.POINTERWHEEL : e.PointerEventTypes.POINTERMOVE;
                                if (this.onPointerMove && this.onPointerMove(i, t, a), this.onPointerObservable.hasObservers()) {
                                    var l = new e.PointerInfo(a, i, t);
                                    this._setRayOnPointerInfo(l), this.onPointerObservable.notifyObservers(l, a)
                                }
                            }
                            return this
                        }, r.prototype._checkPrePointerObservable = function(t, i, r) {
                            var n = new e.PointerInfoPre(r, i, this._unTranslatedPointerX, this._unTranslatedPointerY);
                            return t && (n.ray = t.ray), this.onPrePointerObservable.notifyObservers(n, r), !!n.skipOnPointerObservable
                        }, r.prototype.simulatePointerDown = function(t, i) {
                            var r = new PointerEvent("pointerdown", i);
                            return this._checkPrePointerObservable(t, r, e.PointerEventTypes.POINTERDOWN) ? this : this._processPointerDown(t, r)
                        }, r.prototype._processPointerDown = function(t, i) {
                            var n = this;
                            if (t && t.hit && t.pickedMesh) {
                                this._pickedDownMesh = t.pickedMesh;
                                var o = t.pickedMesh.actionManager;
                                if (o) {
                                    if (o.hasPickTriggers) switch (o.processTrigger(e.ActionManager.OnPickDownTrigger, e.ActionEvent.CreateNew(t.pickedMesh, i)), i.button) {
                                        case 0:
                                            o.processTrigger(e.ActionManager.OnLeftPickTrigger, e.ActionEvent.CreateNew(t.pickedMesh, i));
                                            break;
                                        case 1:
                                            o.processTrigger(e.ActionManager.OnCenterPickTrigger, e.ActionEvent.CreateNew(t.pickedMesh, i));
                                            break;
                                        case 2:
                                            o.processTrigger(e.ActionManager.OnRightPickTrigger, e.ActionEvent.CreateNew(t.pickedMesh, i))
                                    }
                                    o.hasSpecificTrigger(e.ActionManager.OnLongPressTrigger) && window.setTimeout(function() {
                                        var t = n.pick(n._unTranslatedPointerX, n._unTranslatedPointerY, function(t) {
                                            return t.isPickable && t.isVisible && t.isReady() && t.actionManager && t.actionManager.hasSpecificTrigger(e.ActionManager.OnLongPressTrigger) && t == n._pickedDownMesh
                                        }, !1, n.cameraToUseForPointers);
                                        t && t.hit && t.pickedMesh && o && 0 !== n._totalPointersPressed && Date.now() - n._startingPointerTime > r.LongPressDelay && !n._isPointerSwiping() && (n._startingPointerTime = 0, o.processTrigger(e.ActionManager.OnLongPressTrigger, e.ActionEvent.CreateNew(t.pickedMesh, i)))
                                    }, r.LongPressDelay)
                                }
                            } else
                                for (var s = 0, a = this._pointerDownStage; s < a.length; s++) t = a[s].action(this._unTranslatedPointerX, this._unTranslatedPointerY, t, i);
                            if (t) {
                                var l = e.PointerEventTypes.POINTERDOWN;
                                if (this.onPointerDown && this.onPointerDown(i, t, l), this.onPointerObservable.hasObservers()) {
                                    var u = new e.PointerInfo(l, i, t);
                                    this._setRayOnPointerInfo(u), this.onPointerObservable.notifyObservers(u, l)
                                }
                            }
                            return this
                        }, r.prototype.simulatePointerUp = function(i, r) {
                            var n = new PointerEvent("pointerup", r),
                                o = new t;
                            return o.singleClick = !0, o.ignore = !0, this._checkPrePointerObservable(i, n, e.PointerEventTypes.POINTERUP) ? this : this._processPointerUp(i, n, o)
                        }, r.prototype._processPointerUp = function(t, i, r) {
                            if (t && t && t.pickedMesh) {
                                if (this._pickedUpMesh = t.pickedMesh, this._pickedDownMesh === this._pickedUpMesh && (this.onPointerPick && this.onPointerPick(i, t), r.singleClick && !r.ignore && this.onPointerObservable.hasObservers())) {
                                    var n = e.PointerEventTypes.POINTERPICK,
                                        o = new e.PointerInfo(n, i, t);
                                    this._setRayOnPointerInfo(o), this.onPointerObservable.notifyObservers(o, n)
                                }
                                t.pickedMesh.actionManager && (r.ignore && t.pickedMesh.actionManager.processTrigger(e.ActionManager.OnPickUpTrigger, e.ActionEvent.CreateNew(t.pickedMesh, i)), r.hasSwiped || r.ignore || !r.singleClick || t.pickedMesh.actionManager.processTrigger(e.ActionManager.OnPickTrigger, e.ActionEvent.CreateNew(t.pickedMesh, i)), r.doubleClick && !r.ignore && t.pickedMesh.actionManager.hasSpecificTrigger(e.ActionManager.OnDoublePickTrigger) && t.pickedMesh.actionManager.processTrigger(e.ActionManager.OnDoublePickTrigger, e.ActionEvent.CreateNew(t.pickedMesh, i)))
                            } else if (!r.ignore)
                                for (var s = 0, a = this._pointerUpStage; s < a.length; s++) t = a[s].action(this._unTranslatedPointerX, this._unTranslatedPointerY, t, i);
                            this._pickedDownMesh && this._pickedDownMesh.actionManager && this._pickedDownMesh.actionManager.hasSpecificTrigger(e.ActionManager.OnPickOutTrigger) && this._pickedDownMesh !== this._pickedUpMesh && this._pickedDownMesh.actionManager.processTrigger(e.ActionManager.OnPickOutTrigger, e.ActionEvent.CreateNew(this._pickedDownMesh, i));
                            var l = e.PointerEventTypes.POINTERUP;
                            if (this.onPointerObservable.hasObservers())
                                if (r.ignore) o = new e.PointerInfo(l, i, t), this._setRayOnPointerInfo(o), this.onPointerObservable.notifyObservers(o, l);
                                else if (!r.hasSwiped) {
                                if (r.singleClick && this.onPointerObservable.hasSpecificMask(e.PointerEventTypes.POINTERTAP)) {
                                    var u = e.PointerEventTypes.POINTERTAP,
                                        o = new e.PointerInfo(u, i, t);
                                    this._setRayOnPointerInfo(o), this.onPointerObservable.notifyObservers(o, u)
                                }
                                if (r.doubleClick && this.onPointerObservable.hasSpecificMask(e.PointerEventTypes.POINTERDOUBLETAP)) {
                                    var c = e.PointerEventTypes.POINTERDOUBLETAP;
                                    o = new e.PointerInfo(c, i, t), this._setRayOnPointerInfo(o), this.onPointerObservable.notifyObservers(o, c)
                                }
                            }
                            return this.onPointerUp && this.onPointerUp(i, t, l), this
                        }, r.prototype.isPointerCaptured = function(e) {
                            return void 0 === e && (e = 0), this._pointerCaptures[e]
                        }, r.prototype._isPointerSwiping = function() {
                            return Math.abs(this._startingPointerPosition.x - this._pointerX) > r.DragMovementThreshold || Math.abs(this._startingPointerPosition.y - this._pointerY) > r.DragMovementThreshold
                        }, r.prototype.attachControl = function(i, n, o) {
                            var s = this;
                            void 0 === i && (i = !0), void 0 === n && (n = !0), void 0 === o && (o = !0), this._initActionManager = function(e, t) {
                                if (!s._meshPickProceed) {
                                    var i = s.pick(s._unTranslatedPointerX, s._unTranslatedPointerY, s.pointerDownPredicate, !1, s.cameraToUseForPointers);
                                    (s._currentPickResult = i) && (e = i.hit && i.pickedMesh ? i.pickedMesh.actionManager : null), s._meshPickProceed = !0
                                }
                                return e
                            }, this._delayedSimpleClick = function(e, t, i) {
                                (Date.now() - s._previousStartingPointerTime > r.DoubleClickDelay && !s._doubleClickOccured || e !== s._previousButtonPressed) && (s._doubleClickOccured = !1, t.singleClick = !0, t.ignore = !1, i(t, s._currentPickResult))
                            }, this._initClickEvent = function(i, n, o, a) {
                                var l = new t,
                                    u = s._currentPickResult = null,
                                    c = i.hasSpecificMask(e.PointerEventTypes.POINTERPICK) || n.hasSpecificMask(e.PointerEventTypes.POINTERPICK) || i.hasSpecificMask(e.PointerEventTypes.POINTERTAP) || n.hasSpecificMask(e.PointerEventTypes.POINTERTAP) || i.hasSpecificMask(e.PointerEventTypes.POINTERDOUBLETAP) || n.hasSpecificMask(e.PointerEventTypes.POINTERDOUBLETAP);
                                if (!c && e.ActionManager && e.ActionManager.HasPickTriggers && (u = s._initActionManager(u, l)) && (c = u.hasPickTriggers), c) {
                                    var h = o.button;
                                    if (l.hasSwiped = s._isPointerSwiping(), !l.hasSwiped) {
                                        var d = !r.ExclusiveDoubleClickMode;
                                        d || (d = !i.hasSpecificMask(e.PointerEventTypes.POINTERDOUBLETAP) && !n.hasSpecificMask(e.PointerEventTypes.POINTERDOUBLETAP)) && !e.ActionManager.HasSpecificTrigger(e.ActionManager.OnDoublePickTrigger) && (u = s._initActionManager(u, l)) && (d = !u.hasSpecificTrigger(e.ActionManager.OnDoublePickTrigger)), d ? (Date.now() - s._previousStartingPointerTime > r.DoubleClickDelay || h !== s._previousButtonPressed) && (l.singleClick = !0, a(l, s._currentPickResult)) : (s._previousDelayedSimpleClickTimeout = s._delayedSimpleClickTimeout, s._delayedSimpleClickTimeout = window.setTimeout(s._delayedSimpleClick.bind(s, h, l, a), r.DoubleClickDelay));
                                        var p = i.hasSpecificMask(e.PointerEventTypes.POINTERDOUBLETAP) || n.hasSpecificMask(e.PointerEventTypes.POINTERDOUBLETAP);
                                        !p && e.ActionManager.HasSpecificTrigger(e.ActionManager.OnDoublePickTrigger) && (u = s._initActionManager(u, l)) && (p = u.hasSpecificTrigger(e.ActionManager.OnDoublePickTrigger)), p && (h === s._previousButtonPressed && Date.now() - s._previousStartingPointerTime < r.DoubleClickDelay && !s._doubleClickOccured ? l.hasSwiped || s._isPointerSwiping() ? (s._doubleClickOccured = !1, s._previousStartingPointerTime = s._startingPointerTime, s._previousStartingPointerPosition.x = s._startingPointerPosition.x, s._previousStartingPointerPosition.y = s._startingPointerPosition.y, s._previousButtonPressed = h, r.ExclusiveDoubleClickMode ? (s._previousDelayedSimpleClickTimeout && clearTimeout(s._previousDelayedSimpleClickTimeout), s._previousDelayedSimpleClickTimeout = s._delayedSimpleClickTimeout, a(l, s._previousPickResult)) : a(l, s._currentPickResult)) : (s._previousStartingPointerTime = 0, s._doubleClickOccured = !0, l.doubleClick = !0, l.ignore = !1, r.ExclusiveDoubleClickMode && s._previousDelayedSimpleClickTimeout && clearTimeout(s._previousDelayedSimpleClickTimeout), s._previousDelayedSimpleClickTimeout = s._delayedSimpleClickTimeout, a(l, s._currentPickResult)) : (s._doubleClickOccured = !1, s._previousStartingPointerTime = s._startingPointerTime, s._previousStartingPointerPosition.x = s._startingPointerPosition.x, s._previousStartingPointerPosition.y = s._startingPointerPosition.y, s._previousButtonPressed = h))
                                    }
                                }
                                l.ignore = !0, a(l, s._currentPickResult)
                            }, this._onPointerMove = function(t) {
                                if (s._updatePointerPosition(t), !s._checkPrePointerObservable(null, t, "mousewheel" === t.type || "DOMMouseScroll" === t.type ? e.PointerEventTypes.POINTERWHEEL : e.PointerEventTypes.POINTERMOVE) && (s.cameraToUseForPointers || s.activeCamera)) {
                                    s.pointerMovePredicate || (s.pointerMovePredicate = function(e) {
                                        return e.isPickable && e.isVisible && e.isReady() && e.isEnabled() && (e.enablePointerMoveEvents || s.constantlyUpdateMeshUnderPointer || null !== e.actionManager && void 0 !== e.actionManager)
                                    });
                                    var i = s.pick(s._unTranslatedPointerX, s._unTranslatedPointerY, s.pointerMovePredicate, !1, s.cameraToUseForPointers);
                                    s._processPointerMove(i, t)
                                }
                            }, this._onPointerDown = function(t) {
                                if (s._totalPointersPressed++, s._pickedDownMesh = null, s._meshPickProceed = !1, s._updatePointerPosition(t), s.preventDefaultOnPointerDown && u && (t.preventDefault(), u.focus()), !s._checkPrePointerObservable(null, t, e.PointerEventTypes.POINTERDOWN) && (s.cameraToUseForPointers || s.activeCamera)) {
                                    s._pointerCaptures[t.pointerId] = !0, s._startingPointerPosition.x = s._pointerX, s._startingPointerPosition.y = s._pointerY, s._startingPointerTime = Date.now(), s.pointerDownPredicate || (s.pointerDownPredicate = function(e) {
                                        return e.isPickable && e.isVisible && e.isReady() && e.isEnabled()
                                    }), s._pickedDownMesh = null;
                                    var i = s.pick(s._unTranslatedPointerX, s._unTranslatedPointerY, s.pointerDownPredicate, !1, s.cameraToUseForPointers);
                                    s._processPointerDown(i, t)
                                }
                            }, this._onPointerUp = function(t) {
                                0 !== s._totalPointersPressed && (s._totalPointersPressed--, s._pickedUpMesh = null, s._meshPickProceed = !1, s._updatePointerPosition(t), s._initClickEvent(s.onPrePointerObservable, s.onPointerObservable, t, function(i, r) {
                                    if (s.onPrePointerObservable.hasObservers())
                                        if (i.ignore) {
                                            if (s._checkPrePointerObservable(null, t, e.PointerEventTypes.POINTERUP)) return
                                        } else if (!i.hasSwiped) {
                                        if (i.singleClick && s.onPrePointerObservable.hasSpecificMask(e.PointerEventTypes.POINTERTAP) && s._checkPrePointerObservable(null, t, e.PointerEventTypes.POINTERTAP)) return;
                                        if (i.doubleClick && s.onPrePointerObservable.hasSpecificMask(e.PointerEventTypes.POINTERDOUBLETAP) && s._checkPrePointerObservable(null, t, e.PointerEventTypes.POINTERDOUBLETAP)) return
                                    }(s.cameraToUseForPointers || s.activeCamera) && (s._pointerCaptures[t.pointerId] = !1, s.pointerUpPredicate || (s.pointerUpPredicate = function(e) {
                                        return e.isPickable && e.isVisible && e.isReady() && e.isEnabled()
                                    }), !s._meshPickProceed && (e.ActionManager && e.ActionManager.HasTriggers || s.onPointerObservable.hasObservers()) && s._initActionManager(null, i), r || (r = s._currentPickResult), s._processPointerUp(r, t, i), s._previousPickResult = s._currentPickResult)
                                }))
                            }, this._onKeyDown = function(t) {
                                var i = e.KeyboardEventTypes.KEYDOWN;
                                if (s.onPreKeyboardObservable.hasObservers()) {
                                    var r = new e.KeyboardInfoPre(i, t);
                                    if (s.onPreKeyboardObservable.notifyObservers(r, i), r.skipOnPointerObservable) return
                                }
                                s.onKeyboardObservable.hasObservers() && (r = new e.KeyboardInfo(i, t), s.onKeyboardObservable.notifyObservers(r, i)), s.actionManager && s.actionManager.processTrigger(e.ActionManager.OnKeyDownTrigger, e.ActionEvent.CreateNewFromScene(s, t))
                            }, this._onKeyUp = function(t) {
                                var i = e.KeyboardEventTypes.KEYUP;
                                if (s.onPreKeyboardObservable.hasObservers()) {
                                    var r = new e.KeyboardInfoPre(i, t);
                                    if (s.onPreKeyboardObservable.notifyObservers(r, i), r.skipOnPointerObservable) return
                                }
                                s.onKeyboardObservable.hasObservers() && (r = new e.KeyboardInfo(i, t), s.onKeyboardObservable.notifyObservers(r, i)), s.actionManager && s.actionManager.processTrigger(e.ActionManager.OnKeyUpTrigger, e.ActionEvent.CreateNewFromScene(s, t))
                            };
                            var a = this.getEngine();
                            this._onCanvasFocusObserver = a.onCanvasFocusObservable.add(function() {
                                u && (u.addEventListener("keydown", s._onKeyDown, !1), u.addEventListener("keyup", s._onKeyUp, !1))
                            }), this._onCanvasBlurObserver = a.onCanvasBlurObservable.add(function() {
                                u && (u.removeEventListener("keydown", s._onKeyDown), u.removeEventListener("keyup", s._onKeyUp))
                            });
                            var l = e.Tools.GetPointerPrefix(),
                                u = this._engine.getRenderingCanvas();
                            u && (o && (u.addEventListener(l + "move", this._onPointerMove, !1), u.addEventListener("mousewheel", this._onPointerMove, !1), u.addEventListener("DOMMouseScroll", this._onPointerMove, !1)), n && u.addEventListener(l + "down", this._onPointerDown, !1), i && window.addEventListener(l + "up", this._onPointerUp, !1), u.tabIndex = 1)
                        }, r.prototype.detachControl = function() {
                            var t = this.getEngine(),
                                i = e.Tools.GetPointerPrefix(),
                                r = t.getRenderingCanvas();
                            r && (r.removeEventListener(i + "move", this._onPointerMove), r.removeEventListener(i + "down", this._onPointerDown), window.removeEventListener(i + "up", this._onPointerUp), this._onCanvasBlurObserver && t.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onCanvasFocusObserver && t.onCanvasFocusObservable.remove(this._onCanvasFocusObserver), r.removeEventListener("mousewheel", this._onPointerMove), r.removeEventListener("DOMMouseScroll", this._onPointerMove), r.removeEventListener("keydown", this._onKeyDown), r.removeEventListener("keyup", this._onKeyUp), this.onKeyboardObservable.clear(), this.onPreKeyboardObservable.clear(), this.onPointerObservable.clear(), this.onPrePointerObservable.clear())
                        }, r.prototype.isReady = function() {
                            if (this._isDisposed) return !1;
                            if (0 < this._pendingData.length) return !1;
                            var t, i = this.getEngine();
                            for (t = 0; t < this.geometries.length; t++)
                                if (this.geometries[t].delayLoadState === e.Engine.DELAYLOADSTATE_LOADING) return !1;
                            for (t = 0; t < this.meshes.length; t++) {
                                var r = this.meshes[t];
                                if (r.isEnabled() && r.subMeshes && 0 !== r.subMeshes.length) {
                                    if (!r.isReady(!0)) return !1;
                                    for (var n = "InstancedMesh" === r.getClassName() || i.getCaps().instancedArrays && 0 < r.instances.length, o = 0, s = this._isReadyForMeshStage; o < s.length; o++)
                                        if (!s[o].action(r, n)) return !1
                                }
                            }
                            if (this.activeCameras && 0 < this.activeCameras.length) {
                                for (var a = 0, l = this.activeCameras; a < l.length; a++)
                                    if (!l[a].isReady(!0)) return !1
                            } else if (this.activeCamera && !this.activeCamera.isReady(!0)) return !1;
                            for (var u = 0, c = this.particleSystems; u < c.length; u++)
                                if (!c[u].isReady()) return !1;
                            return !0
                        }, r.prototype.resetCachedMaterial = function() {
                            this._cachedMaterial = null, this._cachedEffect = null, this._cachedVisibility = null
                        }, r.prototype.registerBeforeRender = function(e) {
                            this.onBeforeRenderObservable.add(e)
                        }, r.prototype.unregisterBeforeRender = function(e) {
                            this.onBeforeRenderObservable.removeCallback(e)
                        }, r.prototype.registerAfterRender = function(e) {
                            this.onAfterRenderObservable.add(e)
                        }, r.prototype.unregisterAfterRender = function(e) {
                            this.onAfterRenderObservable.removeCallback(e)
                        }, r.prototype._executeOnceBeforeRender = function(e) {
                            var t = this,
                                i = function() {
                                    e(), setTimeout(function() {
                                        t.unregisterBeforeRender(i)
                                    })
                                };
                            this.registerBeforeRender(i)
                        }, r.prototype.executeOnceBeforeRender = function(e, t) {
                            var i = this;
                            void 0 !== t ? setTimeout(function() {
                                i._executeOnceBeforeRender(e)
                            }, t) : this._executeOnceBeforeRender(e)
                        }, r.prototype._addPendingData = function(e) {
                            this._pendingData.push(e)
                        }, r.prototype._removePendingData = function(e) {
                            var t = this.isLoading,
                                i = this._pendingData.indexOf(e); - 1 !== i && this._pendingData.splice(i, 1), t && !this.isLoading && this.onDataLoadedObservable.notifyObservers(this)
                        }, r.prototype.getWaitingItemsCount = function() {
                            return this._pendingData.length
                        }, Object.defineProperty(r.prototype, "isLoading", {
                            get: function() {
                                return 0 < this._pendingData.length
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.executeWhenReady = function(e) {
                            var t = this;
                            this.onReadyObservable.add(e), -1 === this._executeWhenReadyTimeoutId && (this._executeWhenReadyTimeoutId = setTimeout(function() {
                                t._checkIsReady()
                            }, 150))
                        }, r.prototype.whenReadyAsync = function() {
                            var e = this;
                            return new Promise(function(t) {
                                e.executeWhenReady(function() {
                                    t()
                                })
                            })
                        }, r.prototype._checkIsReady = function() {
                            var e = this;
                            if (this._registerTransientComponents(), this.isReady()) return this.onReadyObservable.notifyObservers(this), this.onReadyObservable.clear(), void(this._executeWhenReadyTimeoutId = -1);
                            this._executeWhenReadyTimeoutId = setTimeout(function() {
                                e._checkIsReady()
                            }, 150)
                        }, r.prototype.beginWeightedAnimation = function(e, t, i, r, n, o, s, a, l) {
                            void 0 === r && (r = 1), void 0 === o && (o = 1);
                            var u = this.beginAnimation(e, t, i, n, o, s, a, !1, l);
                            return u.weight = r, u
                        }, r.prototype.beginAnimation = function(t, i, r, n, o, s, a, l, u) {
                            void 0 === o && (o = 1), void 0 === l && (l = !0), r < i && 0 < o && (o *= -1), l && this.stopAnimation(t, void 0, u), a || (a = new e.Animatable(this, t, i, r, n, o, s));
                            var c = !u || u(t);
                            if (t.animations && c && a.appendAnimations(t, t.animations), t.getAnimatables)
                                for (var h = t.getAnimatables(), d = 0; d < h.length; d++) this.beginAnimation(h[d], i, r, n, o, s, a, l, u);
                            return a.reset(), a
                        }, r.prototype.beginDirectAnimation = function(t, i, r, n, o, s, a) {
                            return void 0 === s && (s = 1), new e.Animatable(this, t, r, n, o, s, a, i)
                        }, r.prototype.beginDirectHierarchyAnimation = function(e, t, i, r, n, o, s, a) {
                            var l = e.getDescendants(t),
                                u = [];
                            u.push(this.beginDirectAnimation(e, i, r, n, o, s, a));
                            for (var c = 0, h = l; c < h.length; c++) {
                                var d = h[c];
                                u.push(this.beginDirectAnimation(d, i, r, n, o, s, a))
                            }
                            return u
                        }, r.prototype.getAnimatableByTarget = function(e) {
                            for (var t = 0; t < this._activeAnimatables.length; t++)
                                if (this._activeAnimatables[t].target === e) return this._activeAnimatables[t];
                            return null
                        }, r.prototype.getAllAnimatablesByTarget = function(e) {
                            for (var t = [], i = 0; i < this._activeAnimatables.length; i++) this._activeAnimatables[i].target === e && t.push(this._activeAnimatables[i]);
                            return t
                        }, Object.defineProperty(r.prototype, "animatables", {
                            get: function() {
                                return this._activeAnimatables
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.stopAnimation = function(e, t, i) {
                            for (var r = 0, n = this.getAllAnimatablesByTarget(e); r < n.length; r++) n[r].stop(t, i)
                        }, r.prototype.stopAllAnimations = function() {
                            if (this._activeAnimatables) {
                                for (var e = 0; e < this._activeAnimatables.length; e++) this._activeAnimatables[e].stop();
                                this._activeAnimatables = []
                            }
                            for (var t = 0, i = this.animationGroups; t < i.length; t++) i[t].stop()
                        }, r.prototype._animate = function() {
                            if (this.animationsEnabled && 0 !== this._activeAnimatables.length) {
                                var t = e.Tools.Now;
                                if (!this._animationTimeLast) {
                                    if (0 < this._pendingData.length) return;
                                    this._animationTimeLast = t
                                }
                                var i = this.useConstantAnimationDeltaTime ? 16 : (t - this._animationTimeLast) * this.animationTimeScale;
                                this._animationTime += i, this._animationTimeLast = t;
                                for (var r = 0; r < this._activeAnimatables.length; r++) this._activeAnimatables[r]._animate(this._animationTime);
                                this._processLateAnimationBindings()
                            }
                        }, r.prototype._registerTargetForLateAnimationBinding = function(e, t) {
                            var i = e.target;
                            this._registeredForLateAnimationBindings.pushNoDuplicate(i), i._lateAnimationHolders || (i._lateAnimationHolders = {}), i._lateAnimationHolders[e.targetPath] || (i._lateAnimationHolders[e.targetPath] = {
                                totalWeight: 0,
                                animations: [],
                                originalValue: t
                            }), i._lateAnimationHolders[e.targetPath].animations.push(e), i._lateAnimationHolders[e.targetPath].totalWeight += e.weight
                        }, r.prototype._processLateAnimationBindingsForMatrices = function(t) {
                            var i = 1,
                                r = e.Tmp.Vector3[0],
                                n = e.Tmp.Vector3[1],
                                o = e.Tmp.Quaternion[0],
                                s = 0,
                                a = t.animations[0],
                                l = t.originalValue,
                                u = 1;
                            if (t.totalWeight < 1) l.decompose(n, o, r), u = 1 - t.totalWeight;
                            else if (s = 1, i = t.totalWeight, a.currentValue.decompose(n, o, r), 1 == (u = a.weight / i)) return a.currentValue;
                            n.scaleInPlace(u), r.scaleInPlace(u), o.scaleInPlace(u);
                            for (var c = s; c < t.animations.length; c++) {
                                var h = t.animations[c],
                                    d = (u = h.weight / i, e.Tmp.Vector3[2]),
                                    p = e.Tmp.Vector3[3],
                                    f = e.Tmp.Quaternion[1];
                                h.currentValue.decompose(p, f, d), p.scaleAndAddToRef(u, n), f.scaleAndAddToRef(u, o), d.scaleAndAddToRef(u, r)
                            }
                            return e.Matrix.ComposeToRef(n, o, r, a._workValue), a._workValue
                        }, r.prototype._processLateAnimationBindingsForQuaternions = function(t, i) {
                            var r = t.animations[0],
                                n = t.originalValue;
                            if (1 === t.animations.length) return e.Quaternion.SlerpToRef(n, r.currentValue, Math.min(1, t.totalWeight), i), i;
                            var o, s, a = 1;
                            if (t.totalWeight < 1) {
                                var l = 1 - t.totalWeight;
                                s = [], (o = []).push(n), s.push(l)
                            } else {
                                if (2 === t.animations.length) return e.Quaternion.SlerpToRef(t.animations[0].currentValue, t.animations[1].currentValue, t.animations[1].weight / t.totalWeight, i), i;
                                o = [], s = [], a = t.totalWeight
                            }
                            for (var u = 0; u < t.animations.length; u++) {
                                var c = t.animations[u];
                                o.push(c.currentValue), s.push(c.weight / a)
                            }
                            for (var h = 0, d = null, p = 0; p < o.length;) d ? (h += s[p], e.Quaternion.SlerpToRef(d, o[p], s[p] / h, d), p++) : (e.Quaternion.SlerpToRef(o[p], o[p + 1], s[p + 1] / (s[p] + s[p + 1]), i), d = i, h = s[p] + s[p + 1], p += 2);
                            return d
                        }, r.prototype._processLateAnimationBindings = function() {
                            if (this._registeredForLateAnimationBindings.length) {
                                for (var t = 0; t < this._registeredForLateAnimationBindings.length; t++) {
                                    var i = this._registeredForLateAnimationBindings.data[t];
                                    for (var r in i._lateAnimationHolders) {
                                        var n = i._lateAnimationHolders[r],
                                            o = n.animations[0],
                                            s = n.originalValue,
                                            a = e.Animation.AllowMatrixDecomposeForInterpolation && s.m,
                                            l = i[r];
                                        if (a) l = this._processLateAnimationBindingsForMatrices(n);
                                        else if (void 0 !== s.w) l = this._processLateAnimationBindingsForQuaternions(n, l || e.Quaternion.Identity());
                                        else {
                                            var u = 0,
                                                c = 1;
                                            if (n.totalWeight < 1) l = s.scale ? s.scale(1 - n.totalWeight) : s * (1 - n.totalWeight);
                                            else {
                                                c = n.totalWeight;
                                                var h = o.weight / c;
                                                l = 1 !== h ? o.currentValue.scale ? o.currentValue.scale(h) : o.currentValue * h : o.currentValue, u = 1
                                            }
                                            for (var d = u; d < n.animations.length; d++) {
                                                var p = n.animations[d],
                                                    f = p.weight / c;
                                                p.currentValue.scaleAndAddToRef ? p.currentValue.scaleAndAddToRef(f, l) : l += p.currentValue * f
                                            }
                                        }
                                        i[r] = l
                                    }
                                    i._lateAnimationHolders = {}
                                }
                                this._registeredForLateAnimationBindings.reset()
                            }
                        }, r.prototype._switchToAlternateCameraConfiguration = function(e) {
                            this._useAlternateCameraConfiguration = e
                        }, r.prototype.getViewMatrix = function() {
                            return this._useAlternateCameraConfiguration ? this._alternateViewMatrix : this._viewMatrix
                        }, r.prototype.getProjectionMatrix = function() {
                            return this._useAlternateCameraConfiguration ? this._alternateProjectionMatrix : this._projectionMatrix
                        }, r.prototype.getTransformMatrix = function() {
                            return this._useAlternateCameraConfiguration ? this._alternateTransformMatrix : this._transformMatrix
                        }, r.prototype.setTransformMatrix = function(t, i) {
                            if (this._viewUpdateFlag !== t.updateFlag || this._projectionUpdateFlag !== i.updateFlag) {
                                if (this._viewUpdateFlag = t.updateFlag, this._projectionUpdateFlag = i.updateFlag, this._viewMatrix = t, this._projectionMatrix = i, this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix), this._frustumPlanes ? e.Frustum.GetPlanesToRef(this._transformMatrix, this._frustumPlanes) : this._frustumPlanes = e.Frustum.GetPlanes(this._transformMatrix), this.activeCamera && this.activeCamera._alternateCamera) {
                                    var r = this.activeCamera._alternateCamera;
                                    r.getViewMatrix().multiplyToRef(r.getProjectionMatrix(), e.Tmp.Matrix[0]), e.Frustum.GetRightPlaneToRef(e.Tmp.Matrix[0], this._frustumPlanes[3])
                                }
                                this._sceneUbo.useUbo && (this._sceneUbo.updateMatrix("viewProjection", this._transformMatrix), this._sceneUbo.updateMatrix("view", this._viewMatrix), this._sceneUbo.update())
                            }
                        }, r.prototype._setAlternateTransformMatrix = function(t, i) {
                            this._alternateViewUpdateFlag === t.updateFlag && this._alternateProjectionUpdateFlag === i.updateFlag || (this._alternateViewUpdateFlag = t.updateFlag, this._alternateProjectionUpdateFlag = i.updateFlag, this._alternateViewMatrix = t, this._alternateProjectionMatrix = i, this._alternateTransformMatrix || (this._alternateTransformMatrix = e.Matrix.Zero()), this._alternateViewMatrix.multiplyToRef(this._alternateProjectionMatrix, this._alternateTransformMatrix), this._alternateSceneUbo || this._createAlternateUbo(), this._alternateSceneUbo.useUbo && (this._alternateSceneUbo.updateMatrix("viewProjection", this._alternateTransformMatrix), this._alternateSceneUbo.updateMatrix("view", this._alternateViewMatrix), this._alternateSceneUbo.update()))
                        }, r.prototype.getSceneUniformBuffer = function() {
                            return this._useAlternateCameraConfiguration ? this._alternateSceneUbo : this._sceneUbo
                        }, r.prototype.getUniqueId = function() {
                            var e = r._uniqueIdCounter;
                            return r._uniqueIdCounter++, e
                        }, r.prototype.addMesh = function(e, t) {
                            var i = this;
                            void 0 === t && (t = !1), this.meshes.push(e),
                                this.collisionCoordinator && this.collisionCoordinator.onMeshAdded(e), e._resyncLightSources(), this.onNewMeshAddedObservable.notifyObservers(e), t && e.getChildMeshes().forEach(function(e) {
                                    i.addMesh(e)
                                })
                        }, r.prototype.removeMesh = function(e, t) {
                            var i = this;
                            void 0 === t && (t = !1);
                            var r = this.meshes.indexOf(e);
                            return -1 !== r && this.meshes.splice(r, 1), this.onMeshRemovedObservable.notifyObservers(e), t && e.getChildMeshes().forEach(function(e) {
                                i.removeMesh(e)
                            }), r
                        }, r.prototype.addTransformNode = function(e) {
                            this.transformNodes.push(e), this.onNewTransformNodeAddedObservable.notifyObservers(e)
                        }, r.prototype.removeTransformNode = function(e) {
                            var t = this.transformNodes.indexOf(e);
                            return -1 !== t && this.transformNodes.splice(t, 1), this.onTransformNodeRemovedObservable.notifyObservers(e), t
                        }, r.prototype.removeSkeleton = function(e) {
                            var t = this.skeletons.indexOf(e);
                            return -1 !== t && this.skeletons.splice(t, 1), t
                        }, r.prototype.removeMorphTargetManager = function(e) {
                            var t = this.morphTargetManagers.indexOf(e);
                            return -1 !== t && this.morphTargetManagers.splice(t, 1), t
                        }, r.prototype.removeLight = function(e) {
                            var t = this.lights.indexOf(e);
                            if (-1 !== t) {
                                for (var i = 0, r = this.meshes; i < r.length; i++) r[i]._removeLightSource(e);
                                this.lights.splice(t, 1), this.sortLightsByPriority()
                            }
                            return this.onLightRemovedObservable.notifyObservers(e), t
                        }, r.prototype.removeCamera = function(e) {
                            var t = this.cameras.indexOf(e); - 1 !== t && this.cameras.splice(t, 1);
                            var i = this.activeCameras.indexOf(e);
                            return -1 !== i && this.activeCameras.splice(i, 1), this.activeCamera === e && (0 < this.cameras.length ? this.activeCamera = this.cameras[0] : this.activeCamera = null), this.onCameraRemovedObservable.notifyObservers(e), t
                        }, r.prototype.removeParticleSystem = function(e) {
                            var t = this.particleSystems.indexOf(e);
                            return -1 !== t && this.particleSystems.splice(t, 1), t
                        }, r.prototype.removeAnimation = function(e) {
                            var t = this.animations.indexOf(e);
                            return -1 !== t && this.animations.splice(t, 1), t
                        }, r.prototype.removeAnimationGroup = function(e) {
                            var t = this.animationGroups.indexOf(e);
                            return -1 !== t && this.animationGroups.splice(t, 1), t
                        }, r.prototype.removeMultiMaterial = function(e) {
                            var t = this.multiMaterials.indexOf(e);
                            return -1 !== t && this.multiMaterials.splice(t, 1), t
                        }, r.prototype.removeMaterial = function(e) {
                            var t = this.materials.indexOf(e);
                            return -1 !== t && this.materials.splice(t, 1), this.onMaterialRemovedObservable.notifyObservers(e), t
                        }, r.prototype.removeActionManager = function(e) {
                            var t = this.actionManagers.indexOf(e);
                            return -1 !== t && this.actionManagers.splice(t, 1), t
                        }, r.prototype.removeTexture = function(e) {
                            var t = this.textures.indexOf(e);
                            return -1 !== t && this.textures.splice(t, 1), this.onTextureRemovedObservable.notifyObservers(e), t
                        }, r.prototype.addLight = function(e) {
                            this.lights.push(e), this.sortLightsByPriority();
                            for (var t = 0, i = this.meshes; t < i.length; t++) {
                                var r = i[t]; - 1 === r._lightSources.indexOf(e) && (r._lightSources.push(e), r._resyncLightSources())
                            }
                            this.onNewLightAddedObservable.notifyObservers(e)
                        }, r.prototype.sortLightsByPriority = function() {
                            this.requireLightSorting && this.lights.sort(e.Light.CompareLightsPriority)
                        }, r.prototype.addCamera = function(e) {
                            this.cameras.push(e), this.onNewCameraAddedObservable.notifyObservers(e)
                        }, r.prototype.addSkeleton = function(e) {
                            this.skeletons.push(e)
                        }, r.prototype.addParticleSystem = function(e) {
                            this.particleSystems.push(e)
                        }, r.prototype.addAnimation = function(e) {
                            this.animations.push(e)
                        }, r.prototype.addAnimationGroup = function(e) {
                            this.animationGroups.push(e)
                        }, r.prototype.addMultiMaterial = function(e) {
                            this.multiMaterials.push(e)
                        }, r.prototype.addMaterial = function(e) {
                            this.materials.push(e), this.onNewMaterialAddedObservable.notifyObservers(e)
                        }, r.prototype.addMorphTargetManager = function(e) {
                            this.morphTargetManagers.push(e)
                        }, r.prototype.addGeometry = function(e) {
                            this.geometries.push(e)
                        }, r.prototype.addActionManager = function(e) {
                            this.actionManagers.push(e)
                        }, r.prototype.addTexture = function(e) {
                            this.textures.push(e), this.onNewTextureAddedObservable.notifyObservers(e)
                        }, r.prototype.switchActiveCamera = function(e, t) {
                            void 0 === t && (t = !0);
                            var i = this._engine.getRenderingCanvas();
                            i && (this.activeCamera && this.activeCamera.detachControl(i), this.activeCamera = e, t && e.attachControl(i))
                        }, r.prototype.setActiveCameraByID = function(e) {
                            var t = this.getCameraByID(e);
                            return t ? this.activeCamera = t : null
                        }, r.prototype.setActiveCameraByName = function(e) {
                            var t = this.getCameraByName(e);
                            return t ? this.activeCamera = t : null
                        }, r.prototype.getAnimationGroupByName = function(e) {
                            for (var t = 0; t < this.animationGroups.length; t++)
                                if (this.animationGroups[t].name === e) return this.animationGroups[t];
                            return null
                        }, r.prototype.getMaterialByID = function(e) {
                            for (var t = 0; t < this.materials.length; t++)
                                if (this.materials[t].id === e) return this.materials[t];
                            return null
                        }, r.prototype.getMaterialByName = function(e) {
                            for (var t = 0; t < this.materials.length; t++)
                                if (this.materials[t].name === e) return this.materials[t];
                            return null
                        }, r.prototype.getCameraByID = function(e) {
                            for (var t = 0; t < this.cameras.length; t++)
                                if (this.cameras[t].id === e) return this.cameras[t];
                            return null
                        }, r.prototype.getCameraByUniqueID = function(e) {
                            for (var t = 0; t < this.cameras.length; t++)
                                if (this.cameras[t].uniqueId === e) return this.cameras[t];
                            return null
                        }, r.prototype.getCameraByName = function(e) {
                            for (var t = 0; t < this.cameras.length; t++)
                                if (this.cameras[t].name === e) return this.cameras[t];
                            return null
                        }, r.prototype.getBoneByID = function(e) {
                            for (var t = 0; t < this.skeletons.length; t++)
                                for (var i = this.skeletons[t], r = 0; r < i.bones.length; r++)
                                    if (i.bones[r].id === e) return i.bones[r];
                            return null
                        }, r.prototype.getBoneByName = function(e) {
                            for (var t = 0; t < this.skeletons.length; t++)
                                for (var i = this.skeletons[t], r = 0; r < i.bones.length; r++)
                                    if (i.bones[r].name === e) return i.bones[r];
                            return null
                        }, r.prototype.getLightByName = function(e) {
                            for (var t = 0; t < this.lights.length; t++)
                                if (this.lights[t].name === e) return this.lights[t];
                            return null
                        }, r.prototype.getLightByID = function(e) {
                            for (var t = 0; t < this.lights.length; t++)
                                if (this.lights[t].id === e) return this.lights[t];
                            return null
                        }, r.prototype.getLightByUniqueID = function(e) {
                            for (var t = 0; t < this.lights.length; t++)
                                if (this.lights[t].uniqueId === e) return this.lights[t];
                            return null
                        }, r.prototype.getParticleSystemByID = function(e) {
                            for (var t = 0; t < this.particleSystems.length; t++)
                                if (this.particleSystems[t].id === e) return this.particleSystems[t];
                            return null
                        }, r.prototype.getGeometryByID = function(e) {
                            for (var t = 0; t < this.geometries.length; t++)
                                if (this.geometries[t].id === e) return this.geometries[t];
                            return null
                        }, r.prototype.pushGeometry = function(e, t) {
                            return !(!t && this.getGeometryByID(e.id) || (this.geometries.push(e), this.collisionCoordinator && this.collisionCoordinator.onGeometryAdded(e), this.onNewGeometryAddedObservable.notifyObservers(e), 0))
                        }, r.prototype.removeGeometry = function(e) {
                            var t = this.geometries.indexOf(e);
                            return -1 < t && (this.geometries.splice(t, 1), this.collisionCoordinator && this.collisionCoordinator.onGeometryDeleted(e), this.onGeometryRemovedObservable.notifyObservers(e), !0)
                        }, r.prototype.getGeometries = function() {
                            return this.geometries
                        }, r.prototype.getMeshByID = function(e) {
                            for (var t = 0; t < this.meshes.length; t++)
                                if (this.meshes[t].id === e) return this.meshes[t];
                            return null
                        }, r.prototype.getMeshesByID = function(e) {
                            return this.meshes.filter(function(t) {
                                return t.id === e
                            })
                        }, r.prototype.getTransformNodeByID = function(e) {
                            for (var t = 0; t < this.transformNodes.length; t++)
                                if (this.transformNodes[t].id === e) return this.transformNodes[t];
                            return null
                        }, r.prototype.getTransformNodesByID = function(e) {
                            return this.transformNodes.filter(function(t) {
                                return t.id === e
                            })
                        }, r.prototype.getMeshByUniqueID = function(e) {
                            for (var t = 0; t < this.meshes.length; t++)
                                if (this.meshes[t].uniqueId === e) return this.meshes[t];
                            return null
                        }, r.prototype.getLastMeshByID = function(e) {
                            for (var t = this.meshes.length - 1; 0 <= t; t--)
                                if (this.meshes[t].id === e) return this.meshes[t];
                            return null
                        }, r.prototype.getLastEntryByID = function(e) {
                            var t;
                            for (t = this.meshes.length - 1; 0 <= t; t--)
                                if (this.meshes[t].id === e) return this.meshes[t];
                            for (t = this.transformNodes.length - 1; 0 <= t; t--)
                                if (this.transformNodes[t].id === e) return this.transformNodes[t];
                            for (t = this.cameras.length - 1; 0 <= t; t--)
                                if (this.cameras[t].id === e) return this.cameras[t];
                            for (t = this.lights.length - 1; 0 <= t; t--)
                                if (this.lights[t].id === e) return this.lights[t];
                            return null
                        }, r.prototype.getNodeByID = function(e) {
                            var t = this.getMeshByID(e);
                            if (t) return t;
                            var i = this.getLightByID(e);
                            return i || (this.getCameraByID(e) || this.getBoneByID(e))
                        }, r.prototype.getNodeByName = function(e) {
                            var t = this.getMeshByName(e);
                            if (t) return t;
                            var i = this.getLightByName(e);
                            return i || (this.getCameraByName(e) || this.getBoneByName(e))
                        }, r.prototype.getMeshByName = function(e) {
                            for (var t = 0; t < this.meshes.length; t++)
                                if (this.meshes[t].name === e) return this.meshes[t];
                            return null
                        }, r.prototype.getTransformNodeByName = function(e) {
                            for (var t = 0; t < this.transformNodes.length; t++)
                                if (this.transformNodes[t].name === e) return this.transformNodes[t];
                            return null
                        }, r.prototype.getLastSkeletonByID = function(e) {
                            for (var t = this.skeletons.length - 1; 0 <= t; t--)
                                if (this.skeletons[t].id === e) return this.skeletons[t];
                            return null
                        }, r.prototype.getSkeletonById = function(e) {
                            for (var t = 0; t < this.skeletons.length; t++)
                                if (this.skeletons[t].id === e) return this.skeletons[t];
                            return null
                        }, r.prototype.getSkeletonByName = function(e) {
                            for (var t = 0; t < this.skeletons.length; t++)
                                if (this.skeletons[t].name === e) return this.skeletons[t];
                            return null
                        }, r.prototype.getMorphTargetManagerById = function(e) {
                            for (var t = 0; t < this.morphTargetManagers.length; t++)
                                if (this.morphTargetManagers[t].uniqueId === e) return this.morphTargetManagers[t];
                            return null
                        }, r.prototype.isActiveMesh = function(e) {
                            return -1 !== this._activeMeshes.indexOf(e)
                        }, Object.defineProperty(r.prototype, "uid", {
                            get: function() {
                                return this._uid || (this._uid = e.Tools.RandomId()), this._uid
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.addExternalData = function(t, i) {
                            return this._externalData || (this._externalData = new e.StringDictionary), this._externalData.add(t, i)
                        }, r.prototype.getExternalData = function(e) {
                            return this._externalData ? this._externalData.get(e) : null
                        }, r.prototype.getOrAddExternalDataWithFactory = function(t, i) {
                            return this._externalData || (this._externalData = new e.StringDictionary), this._externalData.getOrAddWithFactory(t, i)
                        }, r.prototype.removeExternalData = function(e) {
                            return this._externalData.remove(e)
                        }, r.prototype._evaluateSubMesh = function(e, t) {
                            if (this.dispatchAllSubMeshesOfActiveMeshes || t.alwaysSelectAsActiveMesh || 1 === t.subMeshes.length || e.isInFrustum(this._frustumPlanes)) {
                                for (var i = 0, r = this._evaluateSubMeshStage; i < r.length; i++) r[i].action(t, e);
                                var n = e.getMaterial();
                                null != n && (n.hasRenderTargetTextures && void 0 !== n.getRenderTargetTextures && -1 === this._processedMaterials.indexOf(n) && (this._processedMaterials.push(n), this._renderTargets.concatWithNoDuplicate(n.getRenderTargetTextures())), this._activeIndices.addCount(e.indexCount, !1), this._renderingManager.dispatch(e, t, n))
                            }
                        }, r.prototype.freeProcessedMaterials = function() {
                            this._processedMaterials.dispose()
                        }, r.prototype.freeActiveMeshes = function() {
                            if (this._activeMeshes.dispose(), this.activeCamera && this.activeCamera._activeMeshes && this.activeCamera._activeMeshes.dispose(), this.activeCameras)
                                for (var e = 0; e < this.activeCameras.length; e++) {
                                    var t = this.activeCameras[e];
                                    t && t._activeMeshes && t._activeMeshes.dispose()
                                }
                        }, r.prototype.freeRenderingGroups = function() {
                            if (this._renderingManager && this._renderingManager.freeRenderingGroups(), this.textures)
                                for (var e = 0; e < this.textures.length; e++) {
                                    var t = this.textures[e];
                                    t && t.renderList && t.freeRenderingGroups()
                                }
                        }, r.prototype._isInIntermediateRendering = function() {
                            return this._intermediateRendering
                        }, r.prototype.freezeActiveMeshes = function() {
                            return this.activeCamera && (this._frustumPlanes || this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix()), this._evaluateActiveMeshes(), this._activeMeshesFrozen = !0), this
                        }, r.prototype.unfreezeActiveMeshes = function() {
                            return this._activeMeshesFrozen = !1, this
                        }, r.prototype._evaluateActiveMeshes = function() {
                            if ((!this._activeMeshesFrozen || !this._activeMeshes.length) && this.activeCamera) {
                                this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this), this.activeCamera._activeMeshes.reset(), this._activeMeshes.reset(), this._renderingManager.reset(), this._processedMaterials.reset(), this._activeParticleSystems.reset(), this._activeSkeletons.reset(), this._softwareSkinnedMeshes.reset();
                                for (var t = 0, i = this._beforeEvaluateActiveMeshStage; t < i.length; t++) i[t].action();
                                for (var r = this.getActiveMeshCandidates(), n = r.length, o = 0; o < n; o++) {
                                    var s = r.data[o];
                                    if (!s.isBlocked && (this._totalVertices.addCount(s.getTotalVertices(), !1), s.isReady() && s.isEnabled())) {
                                        s.computeWorldMatrix(), s.actionManager && s.actionManager.hasSpecificTriggers2(e.ActionManager.OnIntersectionEnterTrigger, e.ActionManager.OnIntersectionExitTrigger) && this._meshesForIntersections.pushNoDuplicate(s);
                                        var a = s.getLOD(this.activeCamera);
                                        null != a && (s._preActivate(), s.isVisible && 0 < s.visibility && (s.alwaysSelectAsActiveMesh || 0 != (s.layerMask & this.activeCamera.layerMask) && s.isInFrustum(this._frustumPlanes)) && (this._activeMeshes.push(s), this.activeCamera._activeMeshes.push(s), s._activate(this._renderId), a !== s && a._activate(this._renderId), this._activeMesh(s, a)))
                                    }
                                }
                                if (this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this), this.particlesEnabled) {
                                    this.onBeforeParticlesRenderingObservable.notifyObservers(this);
                                    for (var l = 0; l < this.particleSystems.length; l++) {
                                        var u = this.particleSystems[l];
                                        if (u.isStarted() && u.emitter) {
                                            var c = u.emitter;
                                            c.position && !c.isEnabled() || (this._activeParticleSystems.push(u), u.animate(), this._renderingManager.dispatchParticles(u))
                                        }
                                    }
                                    this.onAfterParticlesRenderingObservable.notifyObservers(this)
                                }
                            }
                        }, r.prototype._activeMesh = function(e, t) {
                            this._skeletonsEnabled && null !== t.skeleton && void 0 !== t.skeleton && (this._activeSkeletons.pushNoDuplicate(t.skeleton) && t.skeleton.prepare(), t.computeBonesUsingShaders || this._softwareSkinnedMeshes.pushNoDuplicate(t));
                            for (var i = 0, r = this._activeMeshStage; i < r.length; i++) r[i].action(e, t);
                            if (null != t && void 0 !== t.subMeshes && null !== t.subMeshes && 0 < t.subMeshes.length)
                                for (var n = this.getActiveSubMeshCandidates(t), o = n.length, s = 0; s < o; s++) {
                                    var a = n.data[s];
                                    this._evaluateSubMesh(a, t)
                                }
                        }, r.prototype.updateTransformMatrix = function(e) {
                            this.activeCamera && this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(e))
                        }, r.prototype.updateAlternateTransformMatrix = function(e) {
                            this._setAlternateTransformMatrix(e.getViewMatrix(), e.getProjectionMatrix())
                        }, r.prototype._renderForCamera = function(t, i) {
                            if (!t || !t._skipRendering) {
                                var r = this._engine;
                                if (this.activeCamera = t, !this.activeCamera) throw new Error("Active camera not set");
                                r.setViewport(this.activeCamera.viewport), this.resetCachedMaterial(), this._renderId++, this.updateTransformMatrix(), t._alternateCamera && (this.updateAlternateTransformMatrix(t._alternateCamera), this._alternateRendering = !0), this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera), this._evaluateActiveMeshes();
                                for (var n = 0; n < this._softwareSkinnedMeshes.length; n++) {
                                    var o = this._softwareSkinnedMeshes.data[n];
                                    o.applySkeleton(o.skeleton)
                                }
                                this.onBeforeRenderTargetsRenderObservable.notifyObservers(this), t.customRenderTargets && 0 < t.customRenderTargets.length && this._renderTargets.concatWithNoDuplicate(t.customRenderTargets), i && i.customRenderTargets && 0 < i.customRenderTargets.length && this._renderTargets.concatWithNoDuplicate(i.customRenderTargets);
                                for (var s = 0, a = this._gatherActiveCameraRenderTargetsStage; s < a.length; s++) a[s].action(this._renderTargets);
                                if (this.renderTargetsEnabled) {
                                    if (this._intermediateRendering = !0, 0 < this._renderTargets.length) {
                                        e.Tools.StartPerformanceCounter("Render targets", 0 < this._renderTargets.length);
                                        for (var l = 0; l < this._renderTargets.length; l++) {
                                            var u = this._renderTargets.data[l];
                                            if (u._shouldRender()) {
                                                this._renderId++;
                                                var c = u.activeCamera && u.activeCamera !== this.activeCamera;
                                                u.render(c, this.dumpNextRenderTargets)
                                            }
                                        }
                                        e.Tools.EndPerformanceCounter("Render targets", 0 < this._renderTargets.length), this._renderId++
                                    }
                                    for (var h = 0, d = this._cameraDrawRenderTargetStage; h < d.length; h++) d[h].action(this.activeCamera);
                                    this._intermediateRendering = !1, r.restoreDefaultFramebuffer()
                                }
                                this.onAfterRenderTargetsRenderObservable.notifyObservers(this), this.postProcessManager && this.postProcessManager._prepareFrame();
                                for (var p = 0, f = this._beforeCameraDrawStage; p < f.length; p++) f[p].action(this.activeCamera);
                                this.onBeforeDrawPhaseObservable.notifyObservers(this), this._renderingManager.render(null, null, !0, !0), this.onAfterDrawPhaseObservable.notifyObservers(this);
                                for (var _ = 0, m = this._afterCameraDrawStage; _ < m.length; _++) m[_].action(this.activeCamera);
                                this.postProcessManager && this.postProcessManager._finalizeFrame(t.isIntermediate), this._renderTargets.reset(), this._alternateRendering = !1, this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera)
                            }
                        }, r.prototype._processSubCameras = function(t) {
                            if (t.cameraRigMode !== e.Camera.RIG_MODE_NONE) {
                                for (var i = 0; i < t._rigCameras.length; i++) this._renderForCamera(t._rigCameras[i], t);
                                this.activeCamera = t, this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix())
                            } else this._renderForCamera(t)
                        }, r.prototype._checkIntersections = function() {
                            for (var t = 0; t < this._meshesForIntersections.length; t++) {
                                var i = this._meshesForIntersections.data[t];
                                if (i.actionManager)
                                    for (var r = 0; r < i.actionManager.actions.length; r++) {
                                        var n = i.actionManager.actions[r];
                                        if (n.trigger === e.ActionManager.OnIntersectionEnterTrigger || n.trigger === e.ActionManager.OnIntersectionExitTrigger) {
                                            var o = n.getTriggerParameter(),
                                                s = o instanceof e.AbstractMesh ? o : o.mesh,
                                                a = s.intersectsMesh(i, o.usePreciseIntersection),
                                                l = i._intersectionsInProgress.indexOf(s);
                                            a && -1 === l ? n.trigger === e.ActionManager.OnIntersectionEnterTrigger ? (n._executeCurrent(e.ActionEvent.CreateNew(i, void 0, s)), i._intersectionsInProgress.push(s)) : n.trigger === e.ActionManager.OnIntersectionExitTrigger && i._intersectionsInProgress.push(s) : !a && -1 < l && (n.trigger === e.ActionManager.OnIntersectionExitTrigger && n._executeCurrent(e.ActionEvent.CreateNew(i, void 0, s)), i.actionManager.hasSpecificTrigger(e.ActionManager.OnIntersectionExitTrigger, function(t) {
                                                var i = t instanceof e.AbstractMesh ? t : t.mesh;
                                                return s === i
                                            }) && n.trigger !== e.ActionManager.OnIntersectionExitTrigger || i._intersectionsInProgress.splice(l, 1))
                                        }
                                    }
                            }
                        }, r.prototype._advancePhysicsEngineStep = function(e) {}, r.prototype.render = function(t) {
                            if (void 0 === t && (t = !0), !this.isDisposed) {
                                if (this._frameId++, this._registerTransientComponents(), this._activeParticles.fetchNewFrame(), this._totalVertices.fetchNewFrame(), this._activeIndices.fetchNewFrame(), this._activeBones.fetchNewFrame(), this._meshesForIntersections.reset(), this.resetCachedMaterial(), this.onBeforeAnimationsObservable.notifyObservers(this), this.actionManager && this.actionManager.processTrigger(e.ActionManager.OnEveryFrameTrigger), this._engine.isDeterministicLockStep()) {
                                    var i = Math.max(r.MinDeltaTime, Math.min(this._engine.getDeltaTime(), r.MaxDeltaTime)) + this._timeAccumulator,
                                        n = this.getDeterministicFrameTime(),
                                        o = 0,
                                        s = this._engine.getLockstepMaxSteps(),
                                        a = Math.floor(i / 60);
                                    for (a = Math.min(a, s); this.onBeforeStepObservable.notifyObservers(this), this._animationRatio = .06 * n, this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this._advancePhysicsEngineStep(n), this.onAfterStepObservable.notifyObservers(this), this._currentStepId++, 0 < (i -= n) && ++o < a;);
                                    this._timeAccumulator = i < 0 ? 0 : i
                                } else i = this.useConstantAnimationDeltaTime ? 16 : Math.max(r.MinDeltaTime, Math.min(this._engine.getDeltaTime(), r.MaxDeltaTime)), this._animationRatio = .06 * i, this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this._advancePhysicsEngineStep(i);
                                for (var l = 0, u = this._beforeCameraUpdateStage; l < u.length; l++) u[l].action();
                                if (t)
                                    if (0 < this.activeCameras.length)
                                        for (var c = 0; c < this.activeCameras.length; c++) {
                                            var h = this.activeCameras[c];
                                            if (h.update(), h.cameraRigMode !== e.Camera.RIG_MODE_NONE)
                                                for (var d = 0; d < h._rigCameras.length; d++) h._rigCameras[d].update()
                                        } else if (this.activeCamera && (this.activeCamera.update(), this.activeCamera.cameraRigMode !== e.Camera.RIG_MODE_NONE))
                                            for (d = 0; d < this.activeCamera._rigCameras.length; d++) this.activeCamera._rigCameras[d].update();
                                this.onBeforeRenderObservable.notifyObservers(this), this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);
                                var p = this.getEngine(),
                                    f = this.activeCamera;
                                if (this.renderTargetsEnabled) {
                                    e.Tools.StartPerformanceCounter("Custom render targets", 0 < this.customRenderTargets.length), this._intermediateRendering = !0;
                                    for (var _ = 0; _ < this.customRenderTargets.length; _++) {
                                        var m = this.customRenderTargets[_];
                                        if (m._shouldRender()) {
                                            if (this._renderId++, this.activeCamera = m.activeCamera || this.activeCamera, !this.activeCamera) throw new Error("Active camera not set");
                                            p.setViewport(this.activeCamera.viewport), this.updateTransformMatrix(), m.render(f !== this.activeCamera, this.dumpNextRenderTargets)
                                        }
                                    }
                                    e.Tools.EndPerformanceCounter("Custom render targets", 0 < this.customRenderTargets.length), this._intermediateRendering = !1, this._renderId++
                                }
                                0 < this.customRenderTargets.length && p.restoreDefaultFramebuffer(), this.onAfterRenderTargetsRenderObservable.notifyObservers(this), this.activeCamera = f;
                                for (var g = 0, v = this._beforeClearStage; g < v.length; g++) v[g].action();
                                (this.autoClearDepthAndStencil || this.autoClear) && this._engine.clear(this.clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, this.autoClearDepthAndStencil, this.autoClearDepthAndStencil);
                                for (var y = 0, b = this._gatherRenderTargetsStage; y < b.length; y++) b[y].action(this._renderTargets);
                                if (0 < this.activeCameras.length)
                                    for (c = 0; c < this.activeCameras.length; c++) 0 < c && this._engine.clear(null, !1, !0, !0), this._processSubCameras(this.activeCameras[c]);
                                else {
                                    if (!this.activeCamera) throw new Error("No camera defined");
                                    this._processSubCameras(this.activeCamera)
                                }
                                this._checkIntersections();
                                for (var x = 0, T = this._afterRenderStage; x < T.length; x++) T[x].action();
                                if (this.afterRender && this.afterRender(), this.onAfterRenderObservable.notifyObservers(this), this._toBeDisposed.length) {
                                    for (d = 0; d < this._toBeDisposed.length; d++) {
                                        var E = this._toBeDisposed[d];
                                        E && E.dispose()
                                    }
                                    this._toBeDisposed = []
                                }
                                this.dumpNextRenderTargets && (this.dumpNextRenderTargets = !1), this._activeBones.addCount(0, !0), this._activeIndices.addCount(0, !0), this._activeParticles.addCount(0, !0)
                            }
                        }, r.prototype.freezeMaterials = function() {
                            for (var e = 0; e < this.materials.length; e++) this.materials[e].freeze()
                        }, r.prototype.unfreezeMaterials = function() {
                            for (var e = 0; e < this.materials.length; e++) this.materials[e].unfreeze()
                        }, r.prototype.dispose = function() {
                            this.beforeRender = null, this.afterRender = null, this.skeletons = [], this.morphTargetManagers = [], this._transientComponents = [], this._isReadyForMeshStage.clear(), this._beforeEvaluateActiveMeshStage.clear(), this._evaluateSubMeshStage.clear(), this._activeMeshStage.clear(), this._cameraDrawRenderTargetStage.clear(), this._beforeCameraDrawStage.clear(), this._beforeRenderingGroupDrawStage.clear(), this._beforeRenderingMeshStage.clear(), this._afterRenderingMeshStage.clear(), this._afterRenderingGroupDrawStage.clear(), this._afterCameraDrawStage.clear(), this._afterRenderStage.clear(), this._beforeCameraUpdateStage.clear(), this._beforeClearStage.clear(), this._gatherRenderTargetsStage.clear(), this._gatherActiveCameraRenderTargetsStage.clear(), this._pointerMoveStage.clear(), this._pointerDownStage.clear(), this._pointerUpStage.clear();
                            for (var e = 0, t = this._components; e < t.length; e++) t[e].dispose();
                            this.importedMeshesFiles = new Array, this.stopAllAnimations(), this.resetCachedMaterial(), this.activeCamera && (this.activeCamera._activeMeshes.dispose(), this.activeCamera = null), this._activeMeshes.dispose(), this._renderingManager.dispose(), this._processedMaterials.dispose(), this._activeParticleSystems.dispose(), this._activeSkeletons.dispose(), this._softwareSkinnedMeshes.dispose(), this._renderTargets.dispose(), this._registeredForLateAnimationBindings.dispose(), this._meshesForIntersections.dispose(), this._toBeDisposed = [];
                            for (var i = 0, r = this._activeRequests; i < r.length; i++) r[i].abort();
                            this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onBeforeRenderObservable.clear(), this.onAfterRenderObservable.clear(), this.onBeforeRenderTargetsRenderObservable.clear(), this.onAfterRenderTargetsRenderObservable.clear(), this.onAfterStepObservable.clear(), this.onBeforeStepObservable.clear(), this.onBeforeActiveMeshesEvaluationObservable.clear(), this.onAfterActiveMeshesEvaluationObservable.clear(), this.onBeforeParticlesRenderingObservable.clear(), this.onAfterParticlesRenderingObservable.clear(), this.onBeforeDrawPhaseObservable.clear(), this.onAfterDrawPhaseObservable.clear(), this.onBeforeAnimationsObservable.clear(), this.onAfterAnimationsObservable.clear(), this.onDataLoadedObservable.clear(), this.onBeforeRenderingGroupObservable.clear(), this.onAfterRenderingGroupObservable.clear(), this.onMeshImportedObservable.clear(), this.onBeforeCameraRenderObservable.clear(), this.onAfterCameraRenderObservable.clear(), this.onReadyObservable.clear(), this.onNewCameraAddedObservable.clear(), this.onCameraRemovedObservable.clear(), this.onNewLightAddedObservable.clear(), this.onLightRemovedObservable.clear(), this.onNewGeometryAddedObservable.clear(), this.onGeometryRemovedObservable.clear(), this.onNewTransformNodeAddedObservable.clear(), this.onTransformNodeRemovedObservable.clear(), this.onNewMeshAddedObservable.clear(), this.onMeshRemovedObservable.clear(), this.onNewMaterialAddedObservable.clear(), this.onMaterialRemovedObservable.clear(), this.onNewTextureAddedObservable.clear(), this.onTextureRemovedObservable.clear(), this.onPrePointerObservable.clear(), this.onPointerObservable.clear(), this.onPreKeyboardObservable.clear(), this.onKeyboardObservable.clear(), this.detachControl();
                            var n, o = this._engine.getRenderingCanvas();
                            if (o)
                                for (n = 0; n < this.cameras.length; n++) this.cameras[n].detachControl(o);
                            for (; this.animationGroups.length;) this.animationGroups[0].dispose();
                            for (; this.lights.length;) this.lights[0].dispose();
                            for (; this.meshes.length;) this.meshes[0].dispose(!0);
                            for (; this.transformNodes.length;) this.removeTransformNode(this.transformNodes[0]);
                            for (; this.cameras.length;) this.cameras[0].dispose();
                            for (this.defaultMaterial && this.defaultMaterial.dispose(); this.multiMaterials.length;) this.multiMaterials[0].dispose();
                            for (; this.materials.length;) this.materials[0].dispose();
                            for (; this.particleSystems.length;) this.particleSystems[0].dispose();
                            for (; this.postProcesses.length;) this.postProcesses[0].dispose();
                            for (; this.textures.length;) this.textures[0].dispose();
                            this._sceneUbo.dispose(), this._alternateSceneUbo && this._alternateSceneUbo.dispose(), this.postProcessManager.dispose(), -1 < (n = this._engine.scenes.indexOf(this)) && this._engine.scenes.splice(n, 1), this._engine.wipeCaches(!0), this._isDisposed = !0
                        }, Object.defineProperty(r.prototype, "isDisposed", {
                            get: function() {
                                return this._isDisposed
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.clearCachedVertexData = function() {
                            for (var e = 0; e < this.meshes.length; e++) {
                                var t = this.meshes[e].geometry;
                                if (t)
                                    for (var i in t._indices = [], t._vertexBuffers) t._vertexBuffers.hasOwnProperty(i) && (t._vertexBuffers[i]._buffer._data = null)
                            }
                        }, r.prototype.cleanCachedTextureBuffer = function() {
                            for (var e = 0, t = this.textures; e < t.length; e++) {
                                var i = t[e];
                                i._buffer && (i._buffer = null)
                            }
                        }, r.prototype.getWorldExtends = function(t) {
                            var i = new e.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE),
                                r = new e.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
                            return t = t || function() {
                                return !0
                            }, this.meshes.filter(t).forEach(function(t) {
                                if (t.computeWorldMatrix(!0), t.subMeshes && 0 !== t.subMeshes.length && !t.infiniteDistance) {
                                    var n = t.getBoundingInfo(),
                                        o = n.boundingBox.minimumWorld,
                                        s = n.boundingBox.maximumWorld;
                                    e.Tools.CheckExtends(o, i, r), e.Tools.CheckExtends(s, i, r)
                                }
                            }), {
                                min: i,
                                max: r
                            }
                        }, r.prototype.createPickingRay = function(t, i, r, n, o) {
                            void 0 === o && (o = !1);
                            var s = e.Ray.Zero();
                            return this.createPickingRayToRef(t, i, r, s, n, o), s
                        }, r.prototype.createPickingRayToRef = function(t, i, r, n, o, s) {
                            void 0 === s && (s = !1);
                            var a = this._engine;
                            if (!o) {
                                if (!this.activeCamera) throw new Error("Active camera not set");
                                o = this.activeCamera
                            }
                            var l = o.viewport.toGlobal(a.getRenderWidth(), a.getRenderHeight());
                            return t = t / this._engine.getHardwareScalingLevel() - l.x, i = i / this._engine.getHardwareScalingLevel() - (this._engine.getRenderHeight() - l.y - l.height), n.update(t, i, l.width, l.height, r || e.Matrix.Identity(), s ? e.Matrix.Identity() : o.getViewMatrix(), o.getProjectionMatrix()), this
                        }, r.prototype.createPickingRayInCameraSpace = function(t, i, r) {
                            var n = e.Ray.Zero();
                            return this.createPickingRayInCameraSpaceToRef(t, i, n, r), n
                        }, r.prototype.createPickingRayInCameraSpaceToRef = function(t, i, r, n) {
                            if (!e.PickingInfo) return this;
                            var o = this._engine;
                            if (!n) {
                                if (!this.activeCamera) throw new Error("Active camera not set");
                                n = this.activeCamera
                            }
                            var s = n.viewport.toGlobal(o.getRenderWidth(), o.getRenderHeight()),
                                a = e.Matrix.Identity();
                            return t = t / this._engine.getHardwareScalingLevel() - s.x, i = i / this._engine.getHardwareScalingLevel() - (this._engine.getRenderHeight() - s.y - s.height), r.update(t, i, s.width, s.height, a, a, n.getProjectionMatrix()), this
                        }, r.prototype._internalPick = function(t, i, r) {
                            if (!e.PickingInfo) return null;
                            for (var n = null, o = 0; o < this.meshes.length; o++) {
                                var s = this.meshes[o];
                                if (i) {
                                    if (!i(s)) continue
                                } else if (!s.isEnabled() || !s.isVisible || !s.isPickable) continue;
                                var a = t(s.getWorldMatrix()),
                                    l = s.intersects(a, r);
                                if (l && l.hit && (r || null == n || !(l.distance >= n.distance)) && (n = l, r)) break
                            }
                            return n || new e.PickingInfo
                        }, r.prototype._internalMultiPick = function(t, i) {
                            if (!e.PickingInfo) return null;
                            for (var r = new Array, n = 0; n < this.meshes.length; n++) {
                                var o = this.meshes[n];
                                if (i) {
                                    if (!i(o)) continue
                                } else if (!o.isEnabled() || !o.isVisible || !o.isPickable) continue;
                                var s = t(o.getWorldMatrix()),
                                    a = o.intersects(s, !1);
                                a && a.hit && r.push(a)
                            }
                            return r
                        }, r.prototype.pick = function(t, i, r, n, o) {
                            var s = this;
                            if (!e.PickingInfo) return null;
                            var a = this._internalPick(function(e) {
                                return s.createPickingRayToRef(t, i, e, s._tempPickingRay, o || null), s._tempPickingRay
                            }, r, n);
                            return a && (a.ray = this.createPickingRay(t, i, e.Matrix.Identity(), o || null)), a
                        }, r.prototype.pickWithRay = function(t, i, r) {
                            var n = this,
                                o = this._internalPick(function(i) {
                                    return n._pickWithRayInverseMatrix || (n._pickWithRayInverseMatrix = e.Matrix.Identity()), i.invertToRef(n._pickWithRayInverseMatrix), n._cachedRayForTransform || (n._cachedRayForTransform = e.Ray.Zero()), e.Ray.TransformToRef(t, n._pickWithRayInverseMatrix, n._cachedRayForTransform), n._cachedRayForTransform
                                }, i, r);
                            return o && (o.ray = t), o
                        }, r.prototype.multiPick = function(e, t, i, r) {
                            var n = this;
                            return this._internalMultiPick(function(i) {
                                return n.createPickingRay(e, t, i, r || null)
                            }, i)
                        }, r.prototype.multiPickWithRay = function(t, i) {
                            var r = this;
                            return this._internalMultiPick(function(i) {
                                return r._pickWithRayInverseMatrix || (r._pickWithRayInverseMatrix = e.Matrix.Identity()), i.invertToRef(r._pickWithRayInverseMatrix), r._cachedRayForTransform || (r._cachedRayForTransform = e.Ray.Zero()), e.Ray.TransformToRef(t, r._pickWithRayInverseMatrix, r._cachedRayForTransform), r._cachedRayForTransform
                            }, i)
                        }, r.prototype.setPointerOverMesh = function(t) {
                            this._pointerOverMesh !== t && (this._pointerOverMesh && this._pointerOverMesh.actionManager && this._pointerOverMesh.actionManager.processTrigger(e.ActionManager.OnPointerOutTrigger, e.ActionEvent.CreateNew(this._pointerOverMesh)), this._pointerOverMesh = t, this._pointerOverMesh && this._pointerOverMesh.actionManager && this._pointerOverMesh.actionManager.processTrigger(e.ActionManager.OnPointerOverTrigger, e.ActionEvent.CreateNew(this._pointerOverMesh)))
                        }, r.prototype.getPointerOverMesh = function() {
                            return this._pointerOverMesh
                        }, r.prototype._rebuildGeometries = function() {
                            for (var e = 0, t = this.geometries; e < t.length; e++) t[e]._rebuild();
                            for (var i = 0, r = this.meshes; i < r.length; i++) r[i]._rebuild();
                            this.postProcessManager && this.postProcessManager._rebuild();
                            for (var n = 0, o = this._components; n < o.length; n++) o[n].rebuild();
                            for (var s = 0, a = this.particleSystems; s < a.length; s++) a[s].rebuild()
                        }, r.prototype._rebuildTextures = function() {
                            for (var t = 0, i = this.textures; t < i.length; t++) i[t]._rebuild();
                            this.markAllMaterialsAsDirty(e.Material.TextureDirtyFlag)
                        }, r.prototype._getByTags = function(t, i, r) {
                            if (void 0 === i) return t;
                            var n = [];
                            for (var o in r = r || function(e) {}, t) {
                                var s = t[o];
                                e.Tags && e.Tags.MatchesQuery(s, i) && (n.push(s), r(s))
                            }
                            return n
                        }, r.prototype.getMeshesByTags = function(e, t) {
                            return this._getByTags(this.meshes, e, t)
                        }, r.prototype.getCamerasByTags = function(e, t) {
                            return this._getByTags(this.cameras, e, t)
                        }, r.prototype.getLightsByTags = function(e, t) {
                            return this._getByTags(this.lights, e, t)
                        }, r.prototype.getMaterialByTags = function(e, t) {
                            return this._getByTags(this.materials, e, t).concat(this._getByTags(this.multiMaterials, e, t))
                        }, r.prototype.setRenderingOrder = function(e, t, i, r) {
                            void 0 === t && (t = null), void 0 === i && (i = null), void 0 === r && (r = null), this._renderingManager.setRenderingOrder(e, t, i, r)
                        }, r.prototype.setRenderingAutoClearDepthStencil = function(e, t, i, r) {
                            void 0 === i && (i = !0), void 0 === r && (r = !0), this._renderingManager.setRenderingAutoClearDepthStencil(e, t, i, r)
                        }, r.prototype.getAutoClearDepthStencilSetup = function(e) {
                            return this._renderingManager.getAutoClearDepthStencilSetup(e)
                        }, Object.defineProperty(r.prototype, "blockMaterialDirtyMechanism", {
                            get: function() {
                                return this._blockMaterialDirtyMechanism
                            },
                            set: function(t) {
                                this._blockMaterialDirtyMechanism !== t && ((this._blockMaterialDirtyMechanism = t) || this.markAllMaterialsAsDirty(e.Material.AllDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.markAllMaterialsAsDirty = function(e, t) {
                            if (!this._blockMaterialDirtyMechanism)
                                for (var i = 0, r = this.materials; i < r.length; i++) {
                                    var n = r[i];
                                    t && !t(n) || n.markAsDirty(e)
                                }
                        }, r.prototype._loadFile = function(t, i, r, n, o, s) {
                            var a = this,
                                l = e.Tools.LoadFile(t, i, r, n ? this.database : void 0, o, s);
                            return this._activeRequests.push(l), l.onCompleteObservable.add(function(e) {
                                a._activeRequests.splice(a._activeRequests.indexOf(e), 1)
                            }), l
                        }, r.prototype._loadFileAsync = function(e, t, i) {
                            var r = this;
                            return new Promise(function(n, o) {
                                r._loadFile(e, function(e) {
                                    n(e)
                                }, void 0, t, i, function(e, t) {
                                    o(t)
                                })
                            })
                        }, r._uniqueIdCounter = 0, r.FOGMODE_NONE = 0, r.FOGMODE_EXP = 1, r.FOGMODE_EXP2 = 2, r.FOGMODE_LINEAR = 3, r.MinDeltaTime = 1, r.MaxDeltaTime = 1e3, r.DragMovementThreshold = 10, r.LongPressDelay = 500, r.DoubleClickDelay = 300, r.ExclusiveDoubleClickMode = !1, r
                    }(e.AbstractScene);
                    e.Scene = r
                }($a || ($a = {})),
                function(e) {
                    var t = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t
                    }(e.AbstractScene);
                    e.KeepAssets = t;
                    var i = function(i) {
                        function r(e) {
                            var t = i.call(this) || this;
                            return t.scene = e, t
                        }
                        return b(r, i), r.prototype.addAllToScene = function() {
                            var e = this;
                            this.cameras.forEach(function(t) {
                                e.scene.addCamera(t)
                            }), this.lights.forEach(function(t) {
                                e.scene.addLight(t)
                            }), this.meshes.forEach(function(t) {
                                e.scene.addMesh(t)
                            }), this.skeletons.forEach(function(t) {
                                e.scene.addSkeleton(t)
                            }), this.animations.forEach(function(t) {
                                e.scene.addAnimation(t)
                            }), this.animationGroups.forEach(function(t) {
                                e.scene.addAnimationGroup(t)
                            }), this.multiMaterials.forEach(function(t) {
                                e.scene.addMultiMaterial(t)
                            }), this.materials.forEach(function(t) {
                                e.scene.addMaterial(t)
                            }), this.morphTargetManagers.forEach(function(t) {
                                e.scene.addMorphTargetManager(t)
                            }), this.geometries.forEach(function(t) {
                                e.scene.addGeometry(t)
                            }), this.transformNodes.forEach(function(t) {
                                e.scene.addTransformNode(t)
                            }), this.actionManagers.forEach(function(t) {
                                e.scene.addActionManager(t)
                            }), this.textures.forEach(function(t) {
                                e.scene.addTexture(t)
                            });
                            for (var t = 0, i = this.scene._serializableComponents; t < i.length; t++) i[t].addFromContainer(this.scene)
                        }, r.prototype.removeAllFromScene = function() {
                            var e = this;
                            this.cameras.forEach(function(t) {
                                e.scene.removeCamera(t)
                            }), this.lights.forEach(function(t) {
                                e.scene.removeLight(t)
                            }), this.meshes.forEach(function(t) {
                                e.scene.removeMesh(t)
                            }), this.skeletons.forEach(function(t) {
                                e.scene.removeSkeleton(t)
                            }), this.animations.forEach(function(t) {
                                e.scene.removeAnimation(t)
                            }), this.animationGroups.forEach(function(t) {
                                e.scene.removeAnimationGroup(t)
                            }), this.multiMaterials.forEach(function(t) {
                                e.scene.removeMultiMaterial(t)
                            }), this.materials.forEach(function(t) {
                                e.scene.removeMaterial(t)
                            }), this.morphTargetManagers.forEach(function(t) {
                                e.scene.removeMorphTargetManager(t)
                            }), this.geometries.forEach(function(t) {
                                e.scene.removeGeometry(t)
                            }), this.transformNodes.forEach(function(t) {
                                e.scene.removeTransformNode(t)
                            }), this.actionManagers.forEach(function(t) {
                                e.scene.removeActionManager(t)
                            }), this.textures.forEach(function(t) {
                                e.scene.removeTexture(t)
                            });
                            for (var t = 0, i = this.scene._serializableComponents; t < i.length; t++) i[t].removeFromContainer(this.scene)
                        }, r.prototype._moveAssets = function(e, t, i) {
                            if (e)
                                for (var r = 0, n = e; r < n.length; r++) {
                                    var o = n[r],
                                        s = !0;
                                    if (i)
                                        for (var a = 0, l = i; a < l.length; a++)
                                            if (o === l[a]) {
                                                s = !1;
                                                break
                                            }
                                    s && t.push(o)
                                }
                        }, r.prototype.moveAllFromScene = function(e) {
                            for (var i in void 0 === e && (e = new t), this) this.hasOwnProperty(i) && (this[i] = this[i] || [], this._moveAssets(this.scene[i], this[i], e[i]));
                            this.removeAllFromScene()
                        }, r.prototype.createRootMesh = function() {
                            var t = new e.Mesh("assetContainerRootMesh", this.scene);
                            return this.meshes.forEach(function(e) {
                                e.parent || t.addChild(e)
                            }), this.meshes.unshift(t), t
                        }, r
                    }(e.AbstractScene);
                    e.AssetContainer = i
                }($a || ($a = {})), Y = $a || ($a = {}), q = function() {
                    function e(e, t, i, r, n, o, s) {
                        void 0 === r && (r = 0), void 0 === n && (n = !1), void 0 === o && (o = !1), void 0 === s && (s = !1), e instanceof Y.Mesh ? this._engine = e.getScene().getEngine() : this._engine = e, this._updatable = i, this._instanced = o, this._data = t, this.byteStride = s ? r : r * Float32Array.BYTES_PER_ELEMENT, n || this.create()
                    }
                    return e.prototype.createVertexBuffer = function(e, t, i, r, n, o) {
                        void 0 === o && (o = !1);
                        var s = o ? t : t * Float32Array.BYTES_PER_ELEMENT,
                            a = r ? o ? r : r * Float32Array.BYTES_PER_ELEMENT : this.byteStride;
                        return new Y.VertexBuffer(this._engine, this, e, this._updatable, !0, a, void 0 === n ? this._instanced : n, s, i, void 0, void 0, !0)
                    }, e.prototype.isUpdatable = function() {
                        return this._updatable
                    }, e.prototype.getData = function() {
                        return this._data
                    }, e.prototype.getBuffer = function() {
                        return this._buffer
                    }, e.prototype.getStrideSize = function() {
                        return this.byteStride / Float32Array.BYTES_PER_ELEMENT
                    }, e.prototype.create = function(e) {
                        void 0 === e && (e = null), !e && this._buffer || (e = e || this._data) && (this._buffer ? this._updatable && (this._engine.updateDynamicVertexBuffer(this._buffer, e), this._data = e) : this._updatable ? (this._buffer = this._engine.createDynamicVertexBuffer(e), this._data = e) : this._buffer = this._engine.createVertexBuffer(e))
                    }, e.prototype._rebuild = function() {
                        this._buffer = null, this.create(this._data)
                    }, e.prototype.update = function(e) {
                        this.create(e)
                    }, e.prototype.updateDirectly = function(e, t, i, r) {
                        void 0 === r && (r = !1), this._buffer && this._updatable && (this._engine.updateDynamicVertexBuffer(this._buffer, e, r ? t : t * Float32Array.BYTES_PER_ELEMENT, i ? i * this.byteStride : void 0), this._data = null)
                    }, e.prototype.dispose = function() {
                        this._buffer && this._engine._releaseBuffer(this._buffer) && (this._buffer = null)
                    }, e
                }(), Y.Buffer = q, K = $a || ($a = {}), Q = function() {
                    function e(t, i, r, n, o, s, a, l, u, c, h, d) {
                        if (void 0 === h && (h = !1), void 0 === d && (d = !1), i instanceof K.Buffer ? (this._buffer = i, this._ownsBuffer = !1) : (this._buffer = new K.Buffer(t, i, n, s, o, a, d), this._ownsBuffer = !0), this._kind = r, null == c) {
                            var p = this.getData();
                            this.type = e.FLOAT, p instanceof Int8Array ? this.type = e.BYTE : p instanceof Uint8Array ? this.type = e.UNSIGNED_BYTE : p instanceof Int16Array ? this.type = e.SHORT : p instanceof Uint16Array ? this.type = e.UNSIGNED_SHORT : p instanceof Int32Array ? this.type = e.INT : p instanceof Uint32Array && (this.type = e.UNSIGNED_INT)
                        } else this.type = c;
                        var f = e.GetTypeByteLength(this.type);
                        d ? (this._size = u || (s ? s / f : e.DeduceStride(r)), this.byteStride = s || this._buffer.byteStride || this._size * f, this.byteOffset = l || 0) : (this._size = u || s || e.DeduceStride(r), this.byteStride = s ? s * f : this._buffer.byteStride || this._size * f, this.byteOffset = (l || 0) * f), this.normalized = h, this._instanced = void 0 !== a && a, this._instanceDivisor = a ? 1 : 0
                    }
                    return Object.defineProperty(e.prototype, "instanceDivisor", {
                        get: function() {
                            return this._instanceDivisor
                        },
                        set: function(e) {
                            this._instanceDivisor = e, this._instanced = 0 != e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._rebuild = function() {
                        this._buffer && this._buffer._rebuild()
                    }, e.prototype.getKind = function() {
                        return this._kind
                    }, e.prototype.isUpdatable = function() {
                        return this._buffer.isUpdatable()
                    }, e.prototype.getData = function() {
                        return this._buffer.getData()
                    }, e.prototype.getBuffer = function() {
                        return this._buffer.getBuffer()
                    }, e.prototype.getStrideSize = function() {
                        return this.byteStride / e.GetTypeByteLength(this.type)
                    }, e.prototype.getOffset = function() {
                        return this.byteOffset / e.GetTypeByteLength(this.type)
                    }, e.prototype.getSize = function() {
                        return this._size
                    }, e.prototype.getIsInstanced = function() {
                        return this._instanced
                    }, e.prototype.getInstanceDivisor = function() {
                        return this._instanceDivisor
                    }, e.prototype.create = function(e) {
                        this._buffer.create(e)
                    }, e.prototype.update = function(e) {
                        this._buffer.update(e)
                    }, e.prototype.updateDirectly = function(e, t, i) {
                        void 0 === i && (i = !1), this._buffer.updateDirectly(e, t, void 0, i)
                    }, e.prototype.dispose = function() {
                        this._ownsBuffer && this._buffer.dispose()
                    }, e.prototype.forEach = function(t, i) {
                        e.ForEach(this._buffer.getData(), this.byteOffset, this.byteStride, this._size, this.type, t, this.normalized, i)
                    }, e.DeduceStride = function(t) {
                        switch (t) {
                            case e.UVKind:
                            case e.UV2Kind:
                            case e.UV3Kind:
                            case e.UV4Kind:
                            case e.UV5Kind:
                            case e.UV6Kind:
                                return 2;
                            case e.NormalKind:
                            case e.PositionKind:
                                return 3;
                            case e.ColorKind:
                            case e.MatricesIndicesKind:
                            case e.MatricesIndicesExtraKind:
                            case e.MatricesWeightsKind:
                            case e.MatricesWeightsExtraKind:
                            case e.TangentKind:
                                return 4;
                            default:
                                throw new Error("Invalid kind '" + t + "'")
                        }
                    }, e.GetTypeByteLength = function(t) {
                        switch (t) {
                            case e.BYTE:
                            case e.UNSIGNED_BYTE:
                                return 1;
                            case e.SHORT:
                            case e.UNSIGNED_SHORT:
                                return 2;
                            case e.INT:
                            case e.FLOAT:
                                return 4;
                            default:
                                throw new Error("Invalid type '" + t + "'")
                        }
                    }, e.ForEach = function(t, i, r, n, o, s, a, l) {
                        if (t instanceof Array)
                            for (var u = i / 4, c = r / 4, h = 0; h < s; h += n) {
                                for (var d = 0; d < n; d++) l(t[u + d], h + d);
                                u += c
                            } else {
                                var p = t instanceof ArrayBuffer ? new DataView(t) : new DataView(t.buffer, t.byteOffset, t.byteLength),
                                    f = e.GetTypeByteLength(o);
                                for (h = 0; h < s; h += n) {
                                    var _ = i;
                                    for (d = 0; d < n; d++) l(e._GetFloatValue(p, o, _, a), h + d), _ += f;
                                    i += r
                                }
                            }
                    }, e._GetFloatValue = function(t, i, r, n) {
                        switch (i) {
                            case e.BYTE:
                                var o = t.getInt8(r);
                                return n && (o = Math.max(o / 127, -1)), o;
                            case e.UNSIGNED_BYTE:
                                return o = t.getUint8(r), n && (o /= 255), o;
                            case e.SHORT:
                                return o = t.getInt16(r, !0), n && (o = Math.max(o / 16383, -1)), o;
                            case e.UNSIGNED_SHORT:
                                return o = t.getUint16(r, !0), n && (o /= 65535), o;
                            case e.FLOAT:
                                return t.getFloat32(r, !0);
                            default:
                                throw new Error("Invalid component type " + i)
                        }
                    }, e.BYTE = 5120, e.UNSIGNED_BYTE = 5121, e.SHORT = 5122, e.UNSIGNED_SHORT = 5123, e.INT = 5124, e.UNSIGNED_INT = 5125, e.FLOAT = 5126, e.PositionKind = "position", e.NormalKind = "normal", e.TangentKind = "tangent", e.UVKind = "uv", e.UV2Kind = "uv2", e.UV3Kind = "uv3", e.UV4Kind = "uv4", e.UV5Kind = "uv5", e.UV6Kind = "uv6", e.ColorKind = "color", e.MatricesIndicesKind = "matricesIndices", e.MatricesWeightsKind = "matricesWeights", e.MatricesIndicesExtraKind = "matricesIndicesExtra", e.MatricesWeightsExtraKind = "matricesWeightsExtra", e
                }(), K.VertexBuffer = Q, Z = function() {
                    this.previous = null, this.next = null
                }, ($a || ($a = {})).DummyInternalTextureTracker = Z, J = $a || ($a = {}), $ = function() {
                    function e(t, i) {
                        this.onLoadedObservable = new J.Observable, this.previous = null, this.next = null, this._initialSlot = -1, this._designatedSlot = -1, this._dataSource = e.DATASOURCE_UNKNOWN, this._comparisonFunction = 0, this._sphericalPolynomial = null, this._lodGenerationScale = 0, this._lodGenerationOffset = 0, this._isRGBD = !1, this._references = 1, this._engine = t, this._dataSource = i, this._webGLTexture = t._createTexture()
                    }
                    return e.prototype.getEngine = function() {
                        return this._engine
                    }, Object.defineProperty(e.prototype, "dataSource", {
                        get: function() {
                            return this._dataSource
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.incrementReferences = function() {
                        this._references++
                    }, e.prototype.updateSize = function(e, t, i) {
                        void 0 === i && (i = 1), this.width = e, this.height = t, this.depth = i, this.baseWidth = e, this.baseHeight = t, this.baseDepth = i, this._size = e * t * i
                    }, e.prototype._rebuild = function() {
                        var t, i = this;
                        switch (this.isReady = !1, this._cachedCoordinatesMode = null, this._cachedWrapU = null, this._cachedWrapV = null, this._cachedAnisotropicFilteringLevel = null, this._dataSource) {
                            case e.DATASOURCE_TEMP:
                                return;
                            case e.DATASOURCE_URL:
                                return void(t = this._engine.createTexture(this.url, !this.generateMipMaps, this.invertY, null, this.samplingMode, function() {
                                    i.isReady = !0
                                }, null, this._buffer, void 0, this.format))._swapAndDie(this);
                            case e.DATASOURCE_RAW:
                                return (t = this._engine.createRawTexture(this._bufferView, this.baseWidth, this.baseHeight, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression))._swapAndDie(this), void(this.isReady = !0);
                            case e.DATASOURCE_RAW3D:
                                return (t = this._engine.createRawTexture3D(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression))._swapAndDie(this), void(this.isReady = !0);
                            case e.DATASOURCE_DYNAMIC:
                                return void(t = this._engine.createDynamicTexture(this.baseWidth, this.baseHeight, this.generateMipMaps, this.samplingMode))._swapAndDie(this);
                            case e.DATASOURCE_RENDERTARGET:
                                var r = new J.RenderTargetCreationOptions;
                                if (r.generateDepthBuffer = this._generateDepthBuffer, r.generateMipMaps = this.generateMipMaps, r.generateStencilBuffer = this._generateStencilBuffer, r.samplingMode = this.samplingMode, r.type = this.type, this.isCube) t = this._engine.createRenderTargetCubeTexture(this.width, r);
                                else {
                                    var n = {
                                        width: this.width,
                                        height: this.height
                                    };
                                    t = this._engine.createRenderTargetTexture(n, r)
                                }
                                return t._swapAndDie(this), void(this.isReady = !0);
                            case e.DATASOURCE_DEPTHTEXTURE:
                                var o = {
                                    bilinearFiltering: this.samplingMode !== J.Texture.BILINEAR_SAMPLINGMODE,
                                    comparisonFunction: this._comparisonFunction,
                                    generateStencil: this._generateStencilBuffer,
                                    isCube: this.isCube
                                };
                                return (t = this._engine.createDepthStencilTexture({
                                    width: this.width,
                                    height: this.height
                                }, o))._swapAndDie(this), void(this.isReady = !0);
                            case e.DATASOURCE_CUBE:
                                return void(t = this._engine.createCubeTexture(this.url, null, this._files, !this.generateMipMaps, function() {
                                    i.isReady = !0
                                }, null, this.format, this._extension))._swapAndDie(this);
                            case e.DATASOURCE_CUBERAW:
                                return (t = this._engine.createRawCubeTexture(this._bufferViewArray, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression))._swapAndDie(this), void(this.isReady = !0);
                            case e.DATASOURCE_CUBERAW_RGBD:
                                return t = this._engine.createRawCubeTexture(null, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression), J.RawCubeTexture._UpdateRGBDAsync(t, this._bufferViewArrayArray, this._sphericalPolynomial, this._lodGenerationScale, this._lodGenerationOffset).then(function() {
                                    i.isReady = !0
                                }), void t._swapAndDie(this);
                            case e.DATASOURCE_CUBEPREFILTERED:
                                return void((t = this._engine.createPrefilteredCubeTexture(this.url, null, this._lodGenerationScale, this._lodGenerationOffset, function(e) {
                                    e && e._swapAndDie(i), i.isReady = !0
                                }, null, this.format, this._extension))._sphericalPolynomial = this._sphericalPolynomial)
                        }
                    }, e.prototype._swapAndDie = function(e) {
                        e._webGLTexture = this._webGLTexture, this._framebuffer && (e._framebuffer = this._framebuffer), this._depthStencilBuffer && (e._depthStencilBuffer = this._depthStencilBuffer), this._lodTextureHigh && (e._lodTextureHigh && e._lodTextureHigh.dispose(), e._lodTextureHigh = this._lodTextureHigh), this._lodTextureMid && (e._lodTextureMid && e._lodTextureMid.dispose(), e._lodTextureMid = this._lodTextureMid), this._lodTextureLow && (e._lodTextureLow && e._lodTextureLow.dispose(), e._lodTextureLow = this._lodTextureLow);
                        var t = this._engine.getLoadedTexturesCache(),
                            i = t.indexOf(this); - 1 !== i && t.splice(i, 1)
                    }, e.prototype.dispose = function() {
                        this._webGLTexture && 0 === --this._references && (this._engine._releaseTexture(this), this._webGLTexture = null, this.previous = null, this.next = null)
                    }, e.DATASOURCE_UNKNOWN = 0, e.DATASOURCE_URL = 1, e.DATASOURCE_TEMP = 2, e.DATASOURCE_RAW = 3, e.DATASOURCE_DYNAMIC = 4, e.DATASOURCE_RENDERTARGET = 5, e.DATASOURCE_MULTIRENDERTARGET = 6, e.DATASOURCE_CUBE = 7, e.DATASOURCE_CUBERAW = 8, e.DATASOURCE_CUBEPREFILTERED = 9, e.DATASOURCE_RAW3D = 10, e.DATASOURCE_DEPTHTEXTURE = 11, e.DATASOURCE_CUBERAW_RGBD = 12, e
                }(), J.InternalTexture = $, ee = $a || ($a = {}), te = function() {
                    function e(t) {
                        this._hasAlpha = !1, this.getAlphaFromRGB = !1, this.level = 1, this.coordinatesIndex = 0, this._coordinatesMode = ee.Texture.EXPLICIT_MODE, this.wrapU = ee.Texture.WRAP_ADDRESSMODE, this.wrapV = ee.Texture.WRAP_ADDRESSMODE, this.wrapR = ee.Texture.WRAP_ADDRESSMODE, this.anisotropicFilteringLevel = e.DEFAULT_ANISOTROPIC_FILTERING_LEVEL, this.isCube = !1, this.is3D = !1, this.gammaSpace = !0, this.invertZ = !1, this.lodLevelInAlpha = !1, this.isRenderTarget = !1, this.animations = new Array, this.onDisposeObservable = new ee.Observable, this.delayLoadState = ee.Engine.DELAYLOADSTATE_NONE, this._cachedSize = ee.Size.Zero(), this._scene = t || ee.Engine.LastCreatedScene, this._scene && (this._scene.textures.push(this), this._scene.onNewTextureAddedObservable.notifyObservers(this)), this._uid = null
                    }
                    return Object.defineProperty(e.prototype, "hasAlpha", {
                        get: function() {
                            return this._hasAlpha
                        },
                        set: function(e) {
                            this._hasAlpha !== e && (this._hasAlpha = e, this._scene && this._scene.markAllMaterialsAsDirty(ee.Material.TextureDirtyFlag | ee.Material.MiscDirtyFlag))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "coordinatesMode", {
                        get: function() {
                            return this._coordinatesMode
                        },
                        set: function(e) {
                            this._coordinatesMode !== e && (this._coordinatesMode = e, this._scene && this._scene.markAllMaterialsAsDirty(ee.Material.TextureDirtyFlag))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "isRGBD", {
                        get: function() {
                            return null != this._texture && this._texture._isRGBD
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "lodGenerationOffset", {
                        get: function() {
                            return this._texture ? this._texture._lodGenerationOffset : 0
                        },
                        set: function(e) {
                            this._texture && (this._texture._lodGenerationOffset = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "lodGenerationScale", {
                        get: function() {
                            return this._texture ? this._texture._lodGenerationScale : 0
                        },
                        set: function(e) {
                            this._texture && (this._texture._lodGenerationScale = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "uid", {
                        get: function() {
                            return this._uid || (this._uid = ee.Tools.RandomId()), this._uid
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.toString = function() {
                        return this.name
                    }, e.prototype.getClassName = function() {
                        return "BaseTexture"
                    }, Object.defineProperty(e.prototype, "onDispose", {
                        set: function(e) {
                            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "isBlocking", {
                        get: function() {
                            return !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getScene = function() {
                        return this._scene
                    }, e.prototype.getTextureMatrix = function() {
                        return ee.Matrix.IdentityReadOnly
                    }, e.prototype.getReflectionTextureMatrix = function() {
                        return ee.Matrix.IdentityReadOnly
                    }, e.prototype.getInternalTexture = function() {
                        return this._texture
                    }, e.prototype.isReadyOrNotBlocking = function() {
                        return !this.isBlocking || this.isReady()
                    }, e.prototype.isReady = function() {
                        return this.delayLoadState === ee.Engine.DELAYLOADSTATE_NOTLOADED ? (this.delayLoad(), !1) : !!this._texture && this._texture.isReady
                    }, e.prototype.getSize = function() {
                        if (this._texture) {
                            if (this._texture.width) return this._cachedSize.width = this._texture.width, this._cachedSize.height = this._texture.height, this._cachedSize;
                            if (this._texture._size) return this._cachedSize.width = this._texture._size, this._cachedSize.height = this._texture._size, this._cachedSize
                        }
                        return this._cachedSize
                    }, e.prototype.getBaseSize = function() {
                        return this.isReady() && this._texture ? this._texture._size ? new ee.Size(this._texture._size, this._texture._size) : new ee.Size(this._texture.baseWidth, this._texture.baseHeight) : ee.Size.Zero()
                    }, e.prototype.scale = function(e) {}, Object.defineProperty(e.prototype, "canRescale", {
                        get: function() {
                            return !1
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._getFromCache = function(e, t, i) {
                        if (!this._scene) return null;
                        for (var r = this._scene.getEngine().getLoadedTexturesCache(), n = 0; n < r.length; n++) {
                            var o = r[n];
                            if (o.url === e && o.generateMipMaps === !t && (!i || i === o.samplingMode)) return o.incrementReferences(), o
                        }
                        return null
                    }, e.prototype._rebuild = function() {}, e.prototype.delayLoad = function() {}, e.prototype.clone = function() {
                        return null
                    }, Object.defineProperty(e.prototype, "textureType", {
                        get: function() {
                            return this._texture && void 0 !== this._texture.type ? this._texture.type : ee.Engine.TEXTURETYPE_UNSIGNED_INT
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "textureFormat", {
                        get: function() {
                            return this._texture && void 0 !== this._texture.format ? this._texture.format : ee.Engine.TEXTUREFORMAT_RGBA
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.readPixels = function(e, t, i) {
                        if (void 0 === e && (e = 0), void 0 === t && (t = 0), void 0 === i && (i = null), !this._texture) return null;
                        var r = this.getSize(),
                            n = r.width,
                            o = r.height,
                            s = this.getScene();
                        if (!s) return null;
                        var a = s.getEngine();
                        return 0 != t && (n /= Math.pow(2, t), o /= Math.pow(2, t), n = Math.round(n), o = Math.round(o)), this._texture.isCube ? a._readTexturePixels(this._texture, n, o, e, t, i) : a._readTexturePixels(this._texture, n, o, -1, t, i)
                    }, e.prototype.releaseInternalTexture = function() {
                        this._texture && (this._texture.dispose(), this._texture = null)
                    }, Object.defineProperty(e.prototype, "sphericalPolynomial", {
                        get: function() {
                            return this._texture && ee.CubeMapToSphericalPolynomialTools && this.isReady() ? (this._texture._sphericalPolynomial || (this._texture._sphericalPolynomial = ee.CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial(this)), this._texture._sphericalPolynomial) : null
                        },
                        set: function(e) {
                            this._texture && (this._texture._sphericalPolynomial = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "_lodTextureHigh", {
                        get: function() {
                            return this._texture ? this._texture._lodTextureHigh : null
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "_lodTextureMid", {
                        get: function() {
                            return this._texture ? this._texture._lodTextureMid : null
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "_lodTextureLow", {
                        get: function() {
                            return this._texture ? this._texture._lodTextureLow : null
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.dispose = function() {
                        if (this._scene) {
                            this._scene.stopAnimation(this), this._scene._removePendingData(this);
                            var e = this._scene.textures.indexOf(this);
                            0 <= e && this._scene.textures.splice(e, 1), this._scene.onTextureRemovedObservable.notifyObservers(this), void 0 !== this._texture && (this.releaseInternalTexture(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear())
                        }
                    }, e.prototype.serialize = function() {
                        if (!this.name) return null;
                        var e = ee.SerializationHelper.Serialize(this);
                        return ee.Animation.AppendSerializedAnimations(this, e), e
                    }, e.WhenAllReady = function(e, t) {
                        var i = e.length;
                        if (0 !== i)
                            for (var r, n, o = 0; o < e.length; o++) ! function() {
                                if ((r = e[o]).isReady()) 0 == --i && t();
                                else {
                                    n = r.onLoadObservable;
                                    var s = function() {
                                        n.removeCallback(s), 0 == --i && t()
                                    };
                                    n.add(s)
                                }
                            }();
                        else t()
                    }, e.DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4, y([ee.serialize()], e.prototype, "name", void 0), y([ee.serialize("hasAlpha")], e.prototype, "_hasAlpha", void 0), y([ee.serialize()], e.prototype, "getAlphaFromRGB", void 0), y([ee.serialize()], e.prototype, "level", void 0), y([ee.serialize()], e.prototype, "coordinatesIndex", void 0), y([ee.serialize("coordinatesMode")], e.prototype, "_coordinatesMode", void 0), y([ee.serialize()], e.prototype, "wrapU", void 0), y([ee.serialize()], e.prototype, "wrapV", void 0), y([ee.serialize()], e.prototype, "wrapR", void 0), y([ee.serialize()], e.prototype, "anisotropicFilteringLevel", void 0), y([ee.serialize()], e.prototype, "isCube", void 0), y([ee.serialize()], e.prototype, "is3D", void 0), y([ee.serialize()], e.prototype, "gammaSpace", void 0), y([ee.serialize()], e.prototype, "invertZ", void 0), y([ee.serialize()], e.prototype, "lodLevelInAlpha", void 0), y([ee.serialize()], e.prototype, "lodGenerationOffset", null), y([ee.serialize()], e.prototype, "lodGenerationScale", null), y([ee.serialize()], e.prototype, "isRenderTarget", void 0), e
                }(), ee.BaseTexture = te, ie = $a || ($a = {}), re = function(e) {
                    function t(i, r, n, o, s, a, l, u, c, h) {
                        void 0 === n && (n = !1), void 0 === o && (o = !0), void 0 === s && (s = t.TRILINEAR_SAMPLINGMODE), void 0 === a && (a = null), void 0 === l && (l = null), void 0 === u && (u = null), void 0 === c && (c = !1);
                        var d = e.call(this, r) || this;
                        if (d.uOffset = 0, d.vOffset = 0, d.uScale = 1, d.vScale = 1, d.uAng = 0, d.vAng = 0, d.wAng = 0, d.uRotationCenter = .5, d.vRotationCenter = .5, d.wRotationCenter = .5, d.onLoadObservable = new ie.Observable, d._isBlocking = !0, d.name = i || "", d.url = i, d._noMipmap = n, d._invertY = o, d._samplingMode = s, d._buffer = u, d._deleteBuffer = c, h && (d._format = h), !(r = d.getScene())) return d;
                        r.getEngine().onBeforeTextureInitObservable.notifyObservers(d);
                        var p = function() {
                            d.onLoadObservable.hasObservers() && d.onLoadObservable.notifyObservers(d), a && a(), !d.isBlocking && r && r.resetCachedMaterial()
                        };
                        return d.url ? (d._texture = d._getFromCache(d.url, n, s), d._texture ? d._texture.isReady ? ie.Tools.SetImmediate(function() {
                            return p()
                        }) : d._texture.onLoadedObservable.add(p) : r.useDelayedTextureLoading ? (d.delayLoadState = ie.Engine.DELAYLOADSTATE_NOTLOADED, d._delayedOnLoad = p, d._delayedOnError = l) : (d._texture = r.getEngine().createTexture(d.url, n, o, r, d._samplingMode, p, l, d._buffer, void 0, d._format), c && delete d._buffer)) : (d._delayedOnLoad = p, d._delayedOnError = l), d
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "noMipmap", {
                        get: function() {
                            return this._noMipmap
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "isBlocking", {
                        get: function() {
                            return this._isBlocking
                        },
                        set: function(e) {
                            this._isBlocking = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "samplingMode", {
                        get: function() {
                            return this._samplingMode
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.updateURL = function(e, t) {
                        if (void 0 === t && (t = null), this.url) throw new Error("URL is already set");
                        this.url = e, this._buffer = t, this.delayLoadState = ie.Engine.DELAYLOADSTATE_NOTLOADED, this.delayLoad()
                    }, t.prototype.delayLoad = function() {
                        if (this.delayLoadState === ie.Engine.DELAYLOADSTATE_NOTLOADED) {
                            var e = this.getScene();
                            e && (this.delayLoadState = ie.Engine.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, this._noMipmap, this._samplingMode), this._texture ? this._delayedOnLoad && (this._texture.isReady ? ie.Tools.SetImmediate(this._delayedOnLoad) : this._texture.onLoadedObservable.add(this._delayedOnLoad)) : (this._texture = e.getEngine().createTexture(this.url, this._noMipmap, this._invertY, e, this._samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format), this._deleteBuffer && delete this._buffer), this._delayedOnLoad = null, this._delayedOnError = null)
                        }
                    }, t.prototype.updateSamplingMode = function(e) {
                        if (this._texture) {
                            var t = this.getScene();
                            t && (this._samplingMode = e, t.getEngine().updateTextureSamplingMode(e, this._texture))
                        }
                    }, t.prototype._prepareRowForTextureGeneration = function(e, t, i, r) {
                        e *= this.uScale, t *= this.vScale, e -= this.uRotationCenter * this.uScale, t -= this.vRotationCenter * this.vScale, i -= this.wRotationCenter, ie.Vector3.TransformCoordinatesFromFloatsToRef(e, t, i, this._rowGenerationMatrix, r), r.x += this.uRotationCenter * this.uScale + this.uOffset, r.y += this.vRotationCenter * this.vScale + this.vOffset, r.z += this.wRotationCenter
                    }, t.prototype.getTextureMatrix = function() {
                        var e = this;
                        if (this.uOffset === this._cachedUOffset && this.vOffset === this._cachedVOffset && this.uScale === this._cachedUScale && this.vScale === this._cachedVScale && this.uAng === this._cachedUAng && this.vAng === this._cachedVAng && this.wAng === this._cachedWAng) return this._cachedTextureMatrix;
                        this._cachedUOffset = this.uOffset, this._cachedVOffset = this.vOffset, this._cachedUScale = this.uScale, this._cachedVScale = this.vScale, this._cachedUAng = this.uAng, this._cachedVAng = this.vAng, this._cachedWAng = this.wAng, this._cachedTextureMatrix || (this._cachedTextureMatrix = ie.Matrix.Zero(), this._rowGenerationMatrix = new ie.Matrix, this._t0 = ie.Vector3.Zero(), this._t1 = ie.Vector3.Zero(), this._t2 = ie.Vector3.Zero()), ie.Matrix.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix), this._prepareRowForTextureGeneration(0, 0, 0, this._t0), this._prepareRowForTextureGeneration(1, 0, 0, this._t1), this._prepareRowForTextureGeneration(0, 1, 0, this._t2), this._t1.subtractInPlace(this._t0), this._t2.subtractInPlace(this._t0), ie.Matrix.IdentityToRef(this._cachedTextureMatrix), this._cachedTextureMatrix.m[0] = this._t1.x, this._cachedTextureMatrix.m[1] = this._t1.y, this._cachedTextureMatrix.m[2] = this._t1.z, this._cachedTextureMatrix.m[4] = this._t2.x, this._cachedTextureMatrix.m[5] = this._t2.y, this._cachedTextureMatrix.m[6] = this._t2.z, this._cachedTextureMatrix.m[8] = this._t0.x, this._cachedTextureMatrix.m[9] = this._t0.y, this._cachedTextureMatrix.m[10] = this._t0.z;
                        var t = this.getScene();
                        return t && t.markAllMaterialsAsDirty(ie.Material.TextureDirtyFlag, function(t) {
                            return t.hasTexture(e)
                        }), this._cachedTextureMatrix
                    }, t.prototype.getReflectionTextureMatrix = function() {
                        var e = this,
                            i = this.getScene();
                        if (!i) return this._cachedTextureMatrix;
                        if (this.uOffset === this._cachedUOffset && this.vOffset === this._cachedVOffset && this.uScale === this._cachedUScale && this.vScale === this._cachedVScale && this.coordinatesMode === this._cachedCoordinatesMode) {
                            if (this.coordinatesMode !== t.PROJECTION_MODE) return this._cachedTextureMatrix;
                            if (this._cachedProjectionMatrixId === i.getProjectionMatrix().updateFlag) return this._cachedTextureMatrix
                        }
                        switch (this._cachedTextureMatrix || (this._cachedTextureMatrix = ie.Matrix.Zero()), this._projectionModeMatrix || (this._projectionModeMatrix = ie.Matrix.Zero()), this._cachedUOffset = this.uOffset, this._cachedVOffset = this.vOffset, this._cachedUScale = this.uScale, this._cachedVScale = this.vScale, this._cachedCoordinatesMode = this.coordinatesMode, this.coordinatesMode) {
                            case t.PLANAR_MODE:
                                ie.Matrix.IdentityToRef(this._cachedTextureMatrix), this._cachedTextureMatrix[0] = this.uScale, this._cachedTextureMatrix[5] = this.vScale, this._cachedTextureMatrix[12] = this.uOffset, this._cachedTextureMatrix[13] = this.vOffset;
                                break;
                            case t.PROJECTION_MODE:
                                ie.Matrix.IdentityToRef(this._projectionModeMatrix), this._projectionModeMatrix.m[0] = .5, this._projectionModeMatrix.m[5] = -.5, this._projectionModeMatrix.m[10] = 0, this._projectionModeMatrix.m[12] = .5, this._projectionModeMatrix.m[13] = .5, this._projectionModeMatrix.m[14] = 1, this._projectionModeMatrix.m[15] = 1;
                                var r = i.getProjectionMatrix();
                                this._cachedProjectionMatrixId = r.updateFlag, r.multiplyToRef(this._projectionModeMatrix, this._cachedTextureMatrix);
                                break;
                            default:
                                ie.Matrix.IdentityToRef(this._cachedTextureMatrix)
                        }
                        return i.markAllMaterialsAsDirty(ie.Material.TextureDirtyFlag, function(t) {
                            return -1 !== t.getActiveTextures().indexOf(e)
                        }), this._cachedTextureMatrix
                    }, t.prototype.clone = function() {
                        var e = this;
                        return ie.SerializationHelper.Clone(function() {
                            return new t(e._texture ? e._texture.url : null, e.getScene(), e._noMipmap, e._invertY, e._samplingMode)
                        }, this)
                    }, t.prototype.serialize = function() {
                        var t = e.prototype.serialize.call(this);
                        return "string" == typeof this._buffer && "data:" === this._buffer.substr(0, 5) && (t.base64String = this._buffer, t.name = t.name.replace("data:", "")), t.invertY = this._invertY, t.samplingMode = this.samplingMode, t
                    }, t.prototype.getClassName = function() {
                        return "Texture"
                    }, t.prototype.dispose = function() {
                        e.prototype.dispose.call(this), this.onLoadObservable.clear(), this._delayedOnLoad = null, this._delayedOnError = null
                    }, t.Parse = function(e, i, r) {
                        if (e.customType) {
                            var n = ie.Tools.Instantiate(e.customType).Parse(e, i, r);
                            return e.samplingMode && n.updateSamplingMode && n._samplingMode && n._samplingMode !== e.samplingMode && n.updateSamplingMode(e.samplingMode), n
                        }
                        if (e.isCube) return ie.CubeTexture.Parse(e, i, r);
                        if (!e.name && !e.isRenderTarget) return null;
                        var o = ie.SerializationHelper.Parse(function() {
                            var n, o = !0;
                            if (e.noMipmap && (o = !1), e.mirrorPlane) {
                                var s = new ie.MirrorTexture(e.name, e.renderTargetSize, i, o);
                                return s._waitingRenderList = e.renderList, s.mirrorPlane = ie.Plane.FromArray(e.mirrorPlane), s
                            }
                            if (e.isRenderTarget) {
                                var a = new ie.RenderTargetTexture(e.name, e.renderTargetSize, i, o);
                                return a._waitingRenderList = e.renderList, a
                            }
                            if (e.base64String) n = t.CreateFromBase64String(e.base64String, e.name, i, !o);
                            else {
                                var l = r + e.name;
                                t.UseSerializedUrlIfAny && e.url && (l = e.url), n = new t(l, i, !o, e.invertY)
                            }
                            return n
                        }, e, i);
                        if (e.samplingMode) {
                            var s = e.samplingMode;
                            o._samplingMode !== s && o.updateSamplingMode(s)
                        }
                        if (e.animations)
                            for (var a = 0; a < e.animations.length; a++) {
                                var l = e.animations[a];
                                o.animations.push(ie.Animation.Parse(l))
                            }
                        return o
                    }, t.CreateFromBase64String = function(e, i, r, n, o, s, a, l, u) {
                        return void 0 === s && (s = t.TRILINEAR_SAMPLINGMODE), void 0 === a && (a = null), void 0 === l && (l = null), void 0 === u && (u = ie.Engine.TEXTUREFORMAT_RGBA), new t("data:" + i, r, n, o, s, a, l, e, !1, u)
                    }, t.LoadFromDataString = function(e, i, r, n, o, s, a, l, u, c) {
                        return void 0 === n && (n = !1), void 0 === o && (o = !1), void 0 === s && (s = !0), void 0 === a && (a = t.TRILINEAR_SAMPLINGMODE), void 0 === l && (l = null), void 0 === u && (u = null), void 0 === c && (c = ie.Engine.TEXTUREFORMAT_RGBA), "data:" !== e.substr(0, 5) && (e = "data:" + e),
                            new t(e, r, o, s, a, l, u, i, n, c)
                    }, t.NEAREST_SAMPLINGMODE = ie.Engine.TEXTURE_NEAREST_SAMPLINGMODE, t.NEAREST_NEAREST_MIPLINEAR = ie.Engine.TEXTURE_NEAREST_NEAREST_MIPLINEAR, t.BILINEAR_SAMPLINGMODE = ie.Engine.TEXTURE_BILINEAR_SAMPLINGMODE, t.LINEAR_LINEAR_MIPNEAREST = ie.Engine.TEXTURE_LINEAR_LINEAR_MIPNEAREST, t.TRILINEAR_SAMPLINGMODE = ie.Engine.TEXTURE_TRILINEAR_SAMPLINGMODE, t.LINEAR_LINEAR_MIPLINEAR = ie.Engine.TEXTURE_LINEAR_LINEAR_MIPLINEAR, t.NEAREST_NEAREST_MIPNEAREST = ie.Engine.TEXTURE_NEAREST_NEAREST_MIPNEAREST, t.NEAREST_LINEAR_MIPNEAREST = ie.Engine.TEXTURE_NEAREST_LINEAR_MIPNEAREST, t.NEAREST_LINEAR_MIPLINEAR = ie.Engine.TEXTURE_NEAREST_LINEAR_MIPLINEAR, t.NEAREST_LINEAR = ie.Engine.TEXTURE_NEAREST_LINEAR, t.NEAREST_NEAREST = ie.Engine.TEXTURE_NEAREST_NEAREST, t.LINEAR_NEAREST_MIPNEAREST = ie.Engine.TEXTURE_LINEAR_NEAREST_MIPNEAREST, t.LINEAR_NEAREST_MIPLINEAR = ie.Engine.TEXTURE_LINEAR_NEAREST_MIPLINEAR, t.LINEAR_LINEAR = ie.Engine.TEXTURE_LINEAR_LINEAR, t.LINEAR_NEAREST = ie.Engine.TEXTURE_LINEAR_NEAREST, t.EXPLICIT_MODE = ie.Engine.TEXTURE_EXPLICIT_MODE, t.SPHERICAL_MODE = ie.Engine.TEXTURE_SPHERICAL_MODE, t.PLANAR_MODE = ie.Engine.TEXTURE_PLANAR_MODE, t.CUBIC_MODE = ie.Engine.TEXTURE_CUBIC_MODE, t.PROJECTION_MODE = ie.Engine.TEXTURE_PROJECTION_MODE, t.SKYBOX_MODE = ie.Engine.TEXTURE_SKYBOX_MODE, t.INVCUBIC_MODE = ie.Engine.TEXTURE_INVCUBIC_MODE, t.EQUIRECTANGULAR_MODE = ie.Engine.TEXTURE_EQUIRECTANGULAR_MODE, t.FIXED_EQUIRECTANGULAR_MODE = ie.Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE, t.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = ie.Engine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE, t.CLAMP_ADDRESSMODE = ie.Engine.TEXTURE_CLAMP_ADDRESSMODE, t.WRAP_ADDRESSMODE = ie.Engine.TEXTURE_WRAP_ADDRESSMODE, t.MIRROR_ADDRESSMODE = ie.Engine.TEXTURE_MIRROR_ADDRESSMODE, t.UseSerializedUrlIfAny = !1, y([ie.serialize()], t.prototype, "url", void 0), y([ie.serialize()], t.prototype, "uOffset", void 0), y([ie.serialize()], t.prototype, "vOffset", void 0), y([ie.serialize()], t.prototype, "uScale", void 0), y([ie.serialize()], t.prototype, "vScale", void 0), y([ie.serialize()], t.prototype, "uAng", void 0), y([ie.serialize()], t.prototype, "vAng", void 0), y([ie.serialize()], t.prototype, "wAng", void 0), y([ie.serialize()], t.prototype, "uRotationCenter", void 0), y([ie.serialize()], t.prototype, "vRotationCenter", void 0), y([ie.serialize()], t.prototype, "wRotationCenter", void 0), y([ie.serialize()], t.prototype, "isBlocking", null), t
                }(ie.BaseTexture), ie.Texture = re,
                function(e) {
                    var t = function() {};
                    e._CreationDataStorage = t;
                    var i = function() {
                            this.visibleInstances = {}, this.renderIdForInstances = new Array, this.batchCache = new r, this.instancesBufferSize = 2048
                        },
                        r = function() {
                            this.mustReturn = !1, this.visibleInstances = new Array, this.renderSelf = new Array
                        };
                    e._InstancesBatch = r;
                    var n = function(t) {
                        function r(n, o, s, a, l, u) {
                            void 0 === o && (o = null), void 0 === s && (s = null), void 0 === a && (a = null), void 0 === u && (u = !0);
                            var c = t.call(this, n, o) || this;
                            if (c.delayLoadState = e.Engine.DELAYLOADSTATE_NONE, c.instances = new Array, c._LODLevels = new Array, c._instanceDataStorage = new i, c._originalBuilderSideOrientation = r.DEFAULTSIDE, c.overrideMaterialSideOrientation = null, c._areNormalsFrozen = !1, c._source = null, o = c.getScene(), a) {
                                if (a._geometry && a._geometry.applyToMesh(c), e.Tools.DeepCopy(a, c, ["name", "material", "skeleton", "instances", "parent", "uniqueId", "source", "metadata", "hasLODLevels", "geometry", "isBlocked", "areNormalsFrozen", "onBeforeDrawObservable", "onBeforeRenderObservable", "onAfterRenderObservable", "onBeforeDraw"], ["_poseMatrix"]), c._source = a, c._originalBuilderSideOrientation = a._originalBuilderSideOrientation, c._creationDataStorage = a._creationDataStorage, c._source._ranges) {
                                    var h = c._source._ranges;
                                    for (var n in h) h.hasOwnProperty(n) && h[n] && c.createAnimationRange(n, h[n].from, h[n].to)
                                }
                                var d;
                                if (a.metadata && a.metadata.clone ? c.metadata = a.metadata.clone() : c.metadata = a.metadata, e.Tags && e.Tags.HasTags(a) && e.Tags.AddTagsTo(c, e.Tags.GetTags(a, !0)), c.parent = a.parent, c.setPivotMatrix(a.getPivotMatrix()), c.id = n + "." + a.id, c.material = a.material, !l)
                                    for (var p = a.getDescendants(!0), f = 0; f < p.length; f++) {
                                        var _ = p[f];
                                        _.clone && _.clone(n + "." + _.name, c)
                                    }
                                var m = c.getScene().getPhysicsEngine();
                                if (u && m) {
                                    var g = m.getImpostorForPhysicsObject(a);
                                    g && (c.physicsImpostor = g.clone(c))
                                }
                                for (d = 0; d < o.particleSystems.length; d++) {
                                    var v = o.particleSystems[d];
                                    v.emitter === a && v.clone(v.name, c)
                                }
                                c.refreshBoundingInfo(), c.computeWorldMatrix(!0)
                            }
                            return null !== s && (c.parent = s), c
                        }
                        return b(r, t), Object.defineProperty(r.prototype, "onBeforeRenderObservable", {
                            get: function() {
                                return this._onBeforeRenderObservable || (this._onBeforeRenderObservable = new e.Observable), this._onBeforeRenderObservable
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "onAfterRenderObservable", {
                            get: function() {
                                return this._onAfterRenderObservable || (this._onAfterRenderObservable = new e.Observable), this._onAfterRenderObservable
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "onBeforeDrawObservable", {
                            get: function() {
                                return this._onBeforeDrawObservable || (this._onBeforeDrawObservable = new e.Observable), this._onBeforeDrawObservable
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "onBeforeDraw", {
                            set: function(e) {
                                this._onBeforeDrawObserver && this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver), this._onBeforeDrawObserver = this.onBeforeDrawObservable.add(e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "morphTargetManager", {
                            get: function() {
                                return this._morphTargetManager
                            },
                            set: function(e) {
                                this._morphTargetManager !== e && (this._morphTargetManager = e, this._syncGeometryWithMorphTargetManager())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "source", {
                            get: function() {
                                return this._source
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "isUnIndexed", {
                            get: function() {
                                return this._unIndexed
                            },
                            set: function(e) {
                                this._unIndexed !== e && (this._unIndexed = e, this._markSubMeshesAsAttributesDirty())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getClassName = function() {
                            return "Mesh"
                        }, r.prototype.toString = function(i) {
                            var r = t.prototype.toString.call(this, i);
                            if (r += ", n vertices: " + this.getTotalVertices(), r += ", parent: " + (this._waitingParentId ? this._waitingParentId : this.parent ? this.parent.name : "NONE"), this.animations)
                                for (var n = 0; n < this.animations.length; n++) r += ", animation[0]: " + this.animations[n].toString(i);
                            if (i)
                                if (this._geometry) {
                                    var o = this.getIndices(),
                                        s = this.getVerticesData(e.VertexBuffer.PositionKind);
                                    s && o && (r += ", flat shading: " + (s.length / 3 === o.length ? "YES" : "NO"))
                                } else r += ", flat shading: UNKNOWN";
                            return r
                        }, r.prototype._unBindEffect = function() {
                            t.prototype._unBindEffect.call(this);
                            for (var e = 0, i = this.instances; e < i.length; e++) i[e]._unBindEffect()
                        }, Object.defineProperty(r.prototype, "hasLODLevels", {
                            get: function() {
                                return 0 < this._LODLevels.length
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getLODLevels = function() {
                            return this._LODLevels
                        }, r.prototype._sortLODLevels = function() {
                            this._LODLevels.sort(function(e, t) {
                                return e.distance < t.distance ? 1 : e.distance > t.distance ? -1 : 0
                            })
                        }, r.prototype.addLODLevel = function(t, i) {
                            if (i && i._masterMesh) return e.Tools.Warn("You cannot use a mesh as LOD level twice"), this;
                            var r = new e.MeshLODLevel(t, i);
                            return this._LODLevels.push(r), i && (i._masterMesh = this), this._sortLODLevels(), this
                        }, r.prototype.getLODLevelAtDistance = function(e) {
                            for (var t = 0; t < this._LODLevels.length; t++) {
                                var i = this._LODLevels[t];
                                if (i.distance === e) return i.mesh
                            }
                            return null
                        }, r.prototype.removeLODLevel = function(e) {
                            for (var t = 0; t < this._LODLevels.length; t++) this._LODLevels[t].mesh === e && (this._LODLevels.splice(t, 1), e && (e._masterMesh = null));
                            return this._sortLODLevels(), this
                        }, r.prototype.getLOD = function(e, t) {
                            if (!this._LODLevels || 0 === this._LODLevels.length) return this;
                            var i;
                            i = t || this.getBoundingInfo().boundingSphere;
                            var r = i.centerWorld.subtract(e.globalPosition).length();
                            if (this._LODLevels[this._LODLevels.length - 1].distance > r) return this.onLODLevelSelection && this.onLODLevelSelection(r, this, this._LODLevels[this._LODLevels.length - 1].mesh), this;
                            for (var n = 0; n < this._LODLevels.length; n++) {
                                var o = this._LODLevels[n];
                                if (o.distance < r) return o.mesh && (o.mesh._preActivate(), o.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache)), this.onLODLevelSelection && this.onLODLevelSelection(r, this, o.mesh), o.mesh
                            }
                            return this.onLODLevelSelection && this.onLODLevelSelection(r, this, this), this
                        }, Object.defineProperty(r.prototype, "geometry", {
                            get: function() {
                                return this._geometry
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getTotalVertices = function() {
                            return null === this._geometry || void 0 === this._geometry ? 0 : this._geometry.getTotalVertices()
                        }, r.prototype.getVerticesData = function(e, t, i) {
                            return this._geometry ? this._geometry.getVerticesData(e, t, i) : null
                        }, r.prototype.getVertexBuffer = function(e) {
                            return this._geometry ? this._geometry.getVertexBuffer(e) : null
                        }, r.prototype.isVerticesDataPresent = function(e) {
                            return this._geometry ? this._geometry.isVerticesDataPresent(e) : !!this._delayInfo && -1 !== this._delayInfo.indexOf(e)
                        }, r.prototype.isVertexBufferUpdatable = function(e) {
                            return this._geometry ? this._geometry.isVertexBufferUpdatable(e) : !!this._delayInfo && -1 !== this._delayInfo.indexOf(e)
                        }, r.prototype.getVerticesDataKinds = function() {
                            if (!this._geometry) {
                                var e = new Array;
                                return this._delayInfo && this._delayInfo.forEach(function(t, i, r) {
                                    e.push(t)
                                }), e
                            }
                            return this._geometry.getVerticesDataKinds()
                        }, r.prototype.getTotalIndices = function() {
                            return this._geometry ? this._geometry.getTotalIndices() : 0
                        }, r.prototype.getIndices = function(e, t) {
                            return this._geometry ? this._geometry.getIndices(e, t) : []
                        }, Object.defineProperty(r.prototype, "isBlocked", {
                            get: function() {
                                return null !== this._masterMesh && void 0 !== this._masterMesh
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.isReady = function(i, r) {
                            if (void 0 === i && (i = !1), void 0 === r && (r = !1), this.delayLoadState === e.Engine.DELAYLOADSTATE_LOADING) return !1;
                            if (!t.prototype.isReady.call(this, i)) return !1;
                            if (!this.subMeshes || 0 === this.subMeshes.length) return !0;
                            if (!i) return !0;
                            var n = this.getEngine(),
                                o = this.getScene(),
                                s = r || n.getCaps().instancedArrays && 0 < this.instances.length;
                            this.computeWorldMatrix();
                            var a = this.material || o.defaultMaterial;
                            if (a)
                                if (a.storeEffectOnSubMeshes)
                                    for (var l = 0, u = this.subMeshes; l < u.length; l++) {
                                        var c = (m = u[l]).getMaterial();
                                        if (c)
                                            if (c.storeEffectOnSubMeshes) {
                                                if (!c.isReadyForSubMesh(this, m, s)) return !1
                                            } else if (!c.isReady(this, s)) return !1
                                    } else if (!a.isReady(this, s)) return !1;
                            for (var h = 0, d = this._lightSources; h < d.length; h++) {
                                var p = d[h].getShadowGenerator();
                                if (p)
                                    for (var f = 0, _ = this.subMeshes; f < _.length; f++) {
                                        var m = _[f];
                                        if (!p.isReady(m, s)) return !1
                                    }
                            }
                            for (var g = 0, v = this._LODLevels; g < v.length; g++) {
                                var y = v[g];
                                if (y.mesh && !y.mesh.isReady(s)) return !1
                            }
                            return !0
                        }, Object.defineProperty(r.prototype, "areNormalsFrozen", {
                            get: function() {
                                return this._areNormalsFrozen
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.freezeNormals = function() {
                            return this._areNormalsFrozen = !0, this
                        }, r.prototype.unfreezeNormals = function() {
                            return this._areNormalsFrozen = !1, this
                        }, Object.defineProperty(r.prototype, "overridenInstanceCount", {
                            set: function(e) {
                                this._instanceDataStorage.overridenInstanceCount = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype._preActivate = function() {
                            var e = this.getScene().getRenderId();
                            return this._preActivateId === e || (this._preActivateId = e, this._instanceDataStorage.visibleInstances = null), this
                        }, r.prototype._preActivateForIntermediateRendering = function(e) {
                            return this._instanceDataStorage.visibleInstances && (this._instanceDataStorage.visibleInstances.intermediateDefaultRenderId = e), this
                        }, r.prototype._registerInstanceForRenderId = function(e, t) {
                            return this._instanceDataStorage.visibleInstances || (this._instanceDataStorage.visibleInstances = {}, this._instanceDataStorage.visibleInstances.defaultRenderId = t, this._instanceDataStorage.visibleInstances.selfDefaultRenderId = this._renderId), this._instanceDataStorage.visibleInstances[t] || (this._instanceDataStorage.visibleInstances[t] = new Array), this._instanceDataStorage.visibleInstances[t].push(e), this
                        }, r.prototype.refreshBoundingInfo = function() {
                            return this._refreshBoundingInfo(!1)
                        }, r.prototype._refreshBoundingInfo = function(t) {
                            if (this._boundingInfo && this._boundingInfo.isLocked) return this;
                            var i = this._getPositionData(t);
                            if (i) {
                                var r = this.geometry ? this.geometry.boundingBias : null,
                                    n = e.Tools.ExtractMinAndMax(i, 0, this.getTotalVertices(), r);
                                this._boundingInfo = new e.BoundingInfo(n.minimum, n.maximum)
                            }
                            if (this.subMeshes)
                                for (var o = 0; o < this.subMeshes.length; o++) this.subMeshes[o].refreshBoundingInfo();
                            return this._updateBoundingInfo(), this
                        }, r.prototype._getPositionData = function(t) {
                            var i = this.getVerticesData(e.VertexBuffer.PositionKind);
                            if (i && t && this.skeleton) {
                                i = e.Tools.Slice(i);
                                var r = this.getVerticesData(e.VertexBuffer.MatricesIndicesKind),
                                    n = this.getVerticesData(e.VertexBuffer.MatricesWeightsKind);
                                if (n && r)
                                    for (var o = 4 < this.numBoneInfluencers, s = o ? this.getVerticesData(e.VertexBuffer.MatricesIndicesExtraKind) : null, a = o ? this.getVerticesData(e.VertexBuffer.MatricesWeightsExtraKind) : null, l = this.skeleton.getTransformMatrices(this), u = e.Tmp.Vector3[0], c = e.Tmp.Matrix[0], h = e.Tmp.Matrix[1], d = 0, p = 0; p < i.length; p += 3, d += 4) {
                                        var f, _;
                                        for (c.reset(), f = 0; f < 4; f++) 0 < (_ = n[d + f]) && (e.Matrix.FromFloat32ArrayToRefScaled(l, Math.floor(16 * r[d + f]), _, h), c.addToSelf(h));
                                        if (o)
                                            for (f = 0; f < 4; f++) 0 < (_ = a[d + f]) && (e.Matrix.FromFloat32ArrayToRefScaled(l, Math.floor(16 * s[d + f]), _, h), c.addToSelf(h));
                                        e.Vector3.TransformCoordinatesFromFloatsToRef(i[p], i[p + 1], i[p + 2], c, u), u.toArray(i, p)
                                    }
                            }
                            return i
                        }, r.prototype._createGlobalSubMesh = function(t) {
                            var i = this.getTotalVertices();
                            if (!i || !this.getIndices()) return null;
                            if (this.subMeshes && 0 < this.subMeshes.length) {
                                var r = this.getIndices();
                                if (!r) return null;
                                var n = r.length,
                                    o = !1;
                                if (t) o = !0;
                                else
                                    for (var s = 0, a = this.subMeshes; s < a.length; s++) {
                                        var l = a[s];
                                        if (l.indexStart + l.indexCount >= n) {
                                            o = !0;
                                            break
                                        }
                                        if (l.verticesStart + l.verticesCount >= i) {
                                            o = !0;
                                            break
                                        }
                                    }
                                if (!o) return this.subMeshes[0]
                            }
                            return this.releaseSubMeshes(), new e.SubMesh(0, 0, i, 0, this.getTotalIndices(), this)
                        }, r.prototype.subdivide = function(t) {
                            if (!(t < 1)) {
                                for (var i = this.getTotalIndices(), r = i / t | 0, n = 0; r % 3 != 0;) r++;
                                this.releaseSubMeshes();
                                for (var o = 0; o < t && !(i <= n); o++) e.SubMesh.CreateFromIndices(0, n, Math.min(r, i - n), this), n += r;
                                this.synchronizeInstances()
                            }
                        }, r.prototype.setVerticesData = function(t, i, r, n) {
                            if (void 0 === r && (r = !1), this._geometry) this._geometry.setVerticesData(t, i, r, n);
                            else {
                                var o = new e.VertexData;
                                o.set(i, t);
                                var s = this.getScene();
                                new e.Geometry(e.Geometry.RandomId(), s, o, r, this)
                            }
                            return this
                        }, r.prototype.markVerticesDataAsUpdatable = function(e, t) {
                            void 0 === t && (t = !0);
                            var i = this.getVertexBuffer(e);
                            i && i.isUpdatable() !== t && this.setVerticesData(e, this.getVerticesData(e), t)
                        }, r.prototype.setVerticesBuffer = function(t) {
                            return this._geometry || (this._geometry = e.Geometry.CreateGeometryForMesh(this)), this._geometry.setVerticesBuffer(t), this
                        }, r.prototype.updateVerticesData = function(e, t, i, r) {
                            return this._geometry && (r ? (this.makeGeometryUnique(), this.updateVerticesData(e, t, i, !1)) : this._geometry.updateVerticesData(e, t, i)), this
                        }, r.prototype.updateMeshPositions = function(t, i) {
                            void 0 === i && (i = !0);
                            var r = this.getVerticesData(e.VertexBuffer.PositionKind);
                            if (!r) return this;
                            if (t(r), this.updateVerticesData(e.VertexBuffer.PositionKind, r, !1, !1), i) {
                                var n = this.getIndices(),
                                    o = this.getVerticesData(e.VertexBuffer.NormalKind);
                                if (!o) return this;
                                e.VertexData.ComputeNormals(r, n, o), this.updateVerticesData(e.VertexBuffer.NormalKind, o, !1, !1)
                            }
                            return this
                        }, r.prototype.makeGeometryUnique = function() {
                            if (!this._geometry) return this;
                            var t = this._geometry,
                                i = this._geometry.copy(e.Geometry.RandomId());
                            return t.releaseForMesh(this, !0), i.applyToMesh(this), this
                        }, r.prototype.setIndices = function(t, i, r) {
                            if (void 0 === i && (i = null), void 0 === r && (r = !1), this._geometry) this._geometry.setIndices(t, i, r);
                            else {
                                var n = new e.VertexData;
                                n.indices = t;
                                var o = this.getScene();
                                new e.Geometry(e.Geometry.RandomId(), o, n, r, this)
                            }
                            return this
                        }, r.prototype.updateIndices = function(e, t) {
                            return this._geometry && this._geometry.updateIndices(e, t), this
                        }, r.prototype.toLeftHanded = function() {
                            return this._geometry && this._geometry.toLeftHanded(), this
                        }, r.prototype._bind = function(t, i, r) {
                            if (!this._geometry) return this;
                            var n, o = this.getScene().getEngine();
                            if (this._unIndexed) n = null;
                            else switch (r) {
                                case e.Material.PointFillMode:
                                    n = null;
                                    break;
                                case e.Material.WireFrameFillMode:
                                    n = t._getLinesIndexBuffer(this.getIndices(), o);
                                    break;
                                default:
                                case e.Material.TriangleFillMode:
                                    n = this._unIndexed ? null : this._geometry.getIndexBuffer()
                            }
                            return this._geometry._bind(i, n), this
                        }, r.prototype._draw = function(t, i, r, n) {
                            if (void 0 === n && (n = !1), !this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer()) return this;
                            this._onBeforeDrawObservable && this._onBeforeDrawObservable.notifyObservers(this);
                            var o = this.getScene(),
                                s = o.getEngine();
                            if (this._unIndexed || i == e.Material.PointFillMode ? s.drawArraysType(i, t.verticesStart, t.verticesCount, r) : i == e.Material.WireFrameFillMode ? s.drawElementsType(i, 0, t._linesIndexCount, r) : s.drawElementsType(i, t.indexStart, t.indexCount, r), o._isAlternateRenderingEnabled && !n) {
                                var a = t.effect || this._effectiveMaterial.getEffect();
                                if (!a || !o.activeCamera) return this;
                                o._switchToAlternateCameraConfiguration(!0), this._effectiveMaterial.bindView(a), this._effectiveMaterial.bindViewProjection(a), s.setViewport(o.activeCamera._alternateCamera.viewport), this._draw(t, i, r, !0), s.setViewport(o.activeCamera.viewport), o._switchToAlternateCameraConfiguration(!1), this._effectiveMaterial.bindView(a), this._effectiveMaterial.bindViewProjection(a)
                            }
                            return this
                        }, r.prototype.registerBeforeRender = function(e) {
                            return this.onBeforeRenderObservable.add(e), this
                        }, r.prototype.unregisterBeforeRender = function(e) {
                            return this.onBeforeRenderObservable.removeCallback(e), this
                        }, r.prototype.registerAfterRender = function(e) {
                            return this.onAfterRenderObservable.add(e), this
                        }, r.prototype.unregisterAfterRender = function(e) {
                            return this.onAfterRenderObservable.removeCallback(e), this
                        }, r.prototype._getInstancesRenderList = function(e) {
                            var t = this.getScene(),
                                i = this._instanceDataStorage.batchCache;
                            if (i.mustReturn = !1, i.renderSelf[e] = this.isEnabled() && this.isVisible, i.visibleInstances[e] = null, this._instanceDataStorage.visibleInstances) {
                                var r = this._instanceDataStorage.visibleInstances,
                                    n = t.getRenderId(),
                                    o = t._isInIntermediateRendering() ? r.intermediateDefaultRenderId : r.defaultRenderId;
                                i.visibleInstances[e] = r[n];
                                var s = this._renderId;
                                !i.visibleInstances[e] && o && (i.visibleInstances[e] = r[o], n = Math.max(o, n), s = Math.max(r.selfDefaultRenderId, n));
                                var a = i.visibleInstances[e];
                                if (a && a.length) {
                                    if (this._instanceDataStorage.renderIdForInstances[e] === n) return i.mustReturn = !0, i;
                                    n !== s && (i.renderSelf[e] = !1)
                                }
                                this._instanceDataStorage.renderIdForInstances[e] = n
                            }
                            return i
                        }, r.prototype._renderWithInstances = function(t, i, r, n, o) {
                            var s = r.visibleInstances[t._id];
                            if (!s) return this;
                            for (var a = 16 * (s.length + 1) * 4, l = this._instanceDataStorage, u = l.instancesBufferSize, c = l.instancesBuffer; l.instancesBufferSize < a;) l.instancesBufferSize *= 2;
                            l.instancesData && u == l.instancesBufferSize || (l.instancesData = new Float32Array(l.instancesBufferSize / 4));
                            var h = 0,
                                d = 0,
                                p = this.getWorldMatrix();
                            if (r.renderSelf[t._id] && (p.copyToArray(l.instancesData, h), h += 16, d++), s)
                                for (var f = 0; f < s.length; f++) s[f].getWorldMatrix().copyToArray(l.instancesData, h), h += 16, d++;
                            return c && u == l.instancesBufferSize ? c.updateDirectly(l.instancesData, 0, d) : (c && c.dispose(), c = new e.Buffer(o, l.instancesData, !0, 16, !1, !0), l.instancesBuffer = c, this.setVerticesBuffer(c.createVertexBuffer("world0", 0, 4)), this.setVerticesBuffer(c.createVertexBuffer("world1", 4, 4)), this.setVerticesBuffer(c.createVertexBuffer("world2", 8, 4)), this.setVerticesBuffer(c.createVertexBuffer("world3", 12, 4))), this._bind(t, n, i), this._draw(t, i, d), o.unbindInstanceAttributes(), this
                        }, r.prototype._processRendering = function(e, t, i, r, n, o, s) {
                            var a = this.getScene().getEngine();
                            if (n) this._renderWithInstances(e, i, r, t, a);
                            else {
                                r.renderSelf[e._id] && (o && o(!1, this.getWorldMatrix(), s), this._draw(e, i, this._instanceDataStorage.overridenInstanceCount));
                                var l = r.visibleInstances[e._id];
                                if (l)
                                    for (var u = 0; u < l.length; u++) {
                                        var c = l[u].getWorldMatrix();
                                        o && o(!0, c, s), this._draw(e, i)
                                    }
                            }
                            return this
                        }, r.prototype.render = function(t, i) {
                            if (this._checkOcclusionQuery()) return this;
                            var r = this.getScene(),
                                n = this._getInstancesRenderList(t._id);
                            if (n.mustReturn) return this;
                            if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer()) return this;
                            this._onBeforeRenderObservable && this._onBeforeRenderObservable.notifyObservers(this);
                            var o, s = r.getEngine(),
                                a = s.getCaps().instancedArrays && null !== n.visibleInstances[t._id] && void 0 !== n.visibleInstances[t._id],
                                l = t.getMaterial();
                            if (!l) return this;
                            if (this._effectiveMaterial = l, this._effectiveMaterial.storeEffectOnSubMeshes) {
                                if (!this._effectiveMaterial.isReadyForSubMesh(this, t, a)) return this
                            } else if (!this._effectiveMaterial.isReady(this, a)) return this;
                            i && s.setAlphaMode(this._effectiveMaterial.alphaMode);
                            for (var u = 0, c = r._beforeRenderingMeshStage; u < c.length; u++) c[u].action(this, t, n);
                            if (!(o = this._effectiveMaterial.storeEffectOnSubMeshes ? t.effect : this._effectiveMaterial.getEffect())) return this;
                            var h = this.overrideMaterialSideOrientation;
                            null == h && (h = this._effectiveMaterial.sideOrientation, this._getWorldMatrixDeterminant() < 0 && (h = h === e.Material.ClockWiseSideOrientation ? e.Material.CounterClockWiseSideOrientation : e.Material.ClockWiseSideOrientation));
                            var d = this._effectiveMaterial._preBind(o, h);
                            this._effectiveMaterial.forceDepthWrite && s.setDepthWrite(!0);
                            var p = r.forcePointsCloud ? e.Material.PointFillMode : r.forceWireframe ? e.Material.WireFrameFillMode : this._effectiveMaterial.fillMode;
                            a || this._bind(t, o, p);
                            var f = this.getWorldMatrix();
                            this._effectiveMaterial.storeEffectOnSubMeshes ? this._effectiveMaterial.bindForSubMesh(f, this, t) : this._effectiveMaterial.bind(f, this), !this._effectiveMaterial.backFaceCulling && this._effectiveMaterial.separateCullingPass && (s.setState(!0, this._effectiveMaterial.zOffset, !1, !d), this._processRendering(t, o, p, n, a, this._onBeforeDraw, this._effectiveMaterial), s.setState(!0, this._effectiveMaterial.zOffset, !1, d)), this._processRendering(t, o, p, n, a, this._onBeforeDraw, this._effectiveMaterial), this._effectiveMaterial.unbind();
                            for (var _ = 0, m = r._afterRenderingMeshStage; _ < m.length; _++) m[_].action(this, t, n);
                            return this._onAfterRenderObservable && this._onAfterRenderObservable.notifyObservers(this), this
                        }, r.prototype._onBeforeDraw = function(e, t, i) {
                            e && i && i.bindOnlyWorldMatrix(t)
                        }, r.prototype.cleanMatrixWeights = function() {
                            this.isVerticesDataPresent(e.VertexBuffer.MatricesWeightsKind) && (this.isVerticesDataPresent(e.VertexBuffer.MatricesWeightsExtraKind) ? this.normalizeSkinWeightsAndExtra() : this.normalizeSkinFourWeights())
                        }, r.prototype.normalizeSkinFourWeights = function() {
                            for (var t = this.getVerticesData(e.VertexBuffer.MatricesWeightsKind), i = t.length, r = 0; r < i; r += 4) {
                                var n = t[r] + t[r + 1] + t[r + 2] + t[r + 3];
                                if (0 === n) t[r] = 1;
                                else {
                                    var o = 1 / n;
                                    t[r] *= o, t[r + 1] *= o, t[r + 2] *= o, t[r + 3] *= o
                                }
                            }
                            this.setVerticesData(e.VertexBuffer.MatricesWeightsKind, t)
                        }, r.prototype.normalizeSkinWeightsAndExtra = function() {
                            for (var t = this.getVerticesData(e.VertexBuffer.MatricesWeightsExtraKind), i = this.getVerticesData(e.VertexBuffer.MatricesWeightsKind), r = i.length, n = 0; n < r; n += 4) {
                                var o = i[n] + i[n + 1] + i[n + 2] + i[n + 3];
                                if (0 === (o += t[n] + t[n + 1] + t[n + 2] + t[n + 3])) i[n] = 1;
                                else {
                                    var s = 1 / o;
                                    i[n] *= s, i[n + 1] *= s, i[n + 2] *= s, i[n + 3] *= s, t[n] *= s, t[n + 1] *= s, t[n + 2] *= s, t[n + 3] *= s
                                }
                            }
                            this.setVerticesData(e.VertexBuffer.MatricesWeightsKind, i), this.setVerticesData(e.VertexBuffer.MatricesWeightsKind, t)
                        }, r.prototype.validateSkinning = function() {
                            var t = this.getVerticesData(e.VertexBuffer.MatricesWeightsExtraKind),
                                i = this.getVerticesData(e.VertexBuffer.MatricesWeightsKind);
                            if (null === i || null == this.skeleton) return {
                                skinned: !1,
                                valid: !0,
                                report: "not skinned"
                            };
                            for (var r = i.length, n = 0, o = 0, s = 0, a = 0, l = null === t ? 4 : 8, u = new Array, c = 0; c <= l; c++) u[c] = 0;
                            for (c = 0; c < r; c += 4) {
                                for (var h = i[c], d = h, p = 0 === d ? 0 : 1, f = 1; f < l; f++) {
                                    var _ = f < 4 ? i[c + f] : t[c + f - 4];
                                    h < _ && n++, 0 !== _ && p++, d += _, h = _
                                }
                                if (u[p]++, s < p && (s = p), 0 === d) o++;
                                else {
                                    var m = 1 / d,
                                        g = 0;
                                    for (f = 0; f < l; f++) g += f < 4 ? Math.abs(i[c + f] - i[c + f] * m) : Math.abs(t[c + f - 4] - t[c + f - 4] * m);
                                    .001 < g && a++
                                }
                            }
                            var v = this.skeleton.bones.length,
                                y = this.getVerticesData(e.VertexBuffer.MatricesIndicesKind),
                                b = this.getVerticesData(e.VertexBuffer.MatricesIndicesExtraKind),
                                x = 0;
                            for (c = 0; c < r; c++)
                                for (f = 0; f < l; f++) {
                                    var T = f < 4 ? y[f] : b[f - 4];
                                    (v <= T || T < 0) && x++
                                }
                            return {
                                skinned: !0,
                                valid: 0 === o && 0 === a && 0 === x,
                                report: "Number of Weights = " + r / 4 + "\nMaximum influences = " + s + "\nMissing Weights = " + o + "\nNot Sorted = " + n + "\nNot Normalized = " + a + "\nWeightCounts = [" + u + "]\nNumber of bones = " + v + "\nBad Bone Indices = " + x
                            }
                        }, r.prototype._checkDelayState = function() {
                            var t = this.getScene();
                            return this._geometry ? this._geometry.load(t) : this.delayLoadState === e.Engine.DELAYLOADSTATE_NOTLOADED && (this.delayLoadState = e.Engine.DELAYLOADSTATE_LOADING, this._queueLoad(t)), this
                        }, r.prototype._queueLoad = function(t) {
                            var i = this;
                            t._addPendingData(this);
                            var r = -1 !== this.delayLoadingFile.indexOf(".babylonbinarymeshdata");
                            return e.Tools.LoadFile(this.delayLoadingFile, function(r) {
                                r instanceof ArrayBuffer ? i._delayLoadingFunction(r, i) : i._delayLoadingFunction(JSON.parse(r), i), i.instances.forEach(function(e) {
                                    e._syncSubMeshes()
                                }), i.delayLoadState = e.Engine.DELAYLOADSTATE_LOADED, t._removePendingData(i)
                            }, function() {}, t.database, r), this
                        }, r.prototype.isInFrustum = function(i) {
                            return this.delayLoadState !== e.Engine.DELAYLOADSTATE_LOADING && !!t.prototype.isInFrustum.call(this, i) && (this._checkDelayState(), !0)
                        }, r.prototype.setMaterialByID = function(e) {
                            var t, i = this.getScene().materials;
                            for (t = i.length - 1; - 1 < t; t--)
                                if (i[t].id === e) return this.material = i[t], this;
                            var r = this.getScene().multiMaterials;
                            for (t = r.length - 1; - 1 < t; t--)
                                if (r[t].id === e) return this.material = r[t], this;
                            return this
                        }, r.prototype.getAnimatables = function() {
                            var e = new Array;
                            return this.material && e.push(this.material), this.skeleton && e.push(this.skeleton), e
                        }, r.prototype.bakeTransformIntoVertices = function(t) {
                            if (!this.isVerticesDataPresent(e.VertexBuffer.PositionKind)) return this;
                            var i = this.subMeshes.splice(0);
                            this._resetPointsArrayCache();
                            var r, n = this.getVerticesData(e.VertexBuffer.PositionKind),
                                o = new Array;
                            for (r = 0; r < n.length; r += 3) e.Vector3.TransformCoordinates(e.Vector3.FromArray(n, r), t).toArray(o, r);
                            if (this.setVerticesData(e.VertexBuffer.PositionKind, o, this.getVertexBuffer(e.VertexBuffer.PositionKind).isUpdatable()), this.isVerticesDataPresent(e.VertexBuffer.NormalKind)) {
                                for (n = this.getVerticesData(e.VertexBuffer.NormalKind), o = [], r = 0; r < n.length; r += 3) e.Vector3.TransformNormal(e.Vector3.FromArray(n, r), t).normalize().toArray(o, r);
                                this.setVerticesData(e.VertexBuffer.NormalKind, o, this.getVertexBuffer(e.VertexBuffer.NormalKind).isUpdatable())
                            }
                            return t.m[0] * t.m[5] * t.m[10] < 0 && this.flipFaces(), this.releaseSubMeshes(), this.subMeshes = i, this
                        }, r.prototype.bakeCurrentTransformIntoVertices = function() {
                            return this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)), this.scaling.copyFromFloats(1, 1, 1), this.position.copyFromFloats(0, 0, 0), this.rotation.copyFromFloats(0, 0, 0), this.rotationQuaternion && (this.rotationQuaternion = e.Quaternion.Identity()), this._worldMatrix = e.Matrix.Identity(), this
                        }, Object.defineProperty(r.prototype, "_positions", {
                            get: function() {
                                return this._geometry ? this._geometry._positions : null
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype._resetPointsArrayCache = function() {
                            return this._geometry && this._geometry._resetPointsArrayCache(), this
                        }, r.prototype._generatePointsArray = function() {
                            return !!this._geometry && this._geometry._generatePointsArray()
                        }, r.prototype.clone = function(e, t, i, n) {
                            return void 0 === e && (e = ""), void 0 === n && (n = !0), new r(e, this.getScene(), t, this, i, n)
                        }, r.prototype.dispose = function(e, i) {
                            var r = this;
                            for (void 0 === i && (i = !1), this.morphTargetManager = null, this._geometry && this._geometry.releaseForMesh(this, !0), this._onBeforeDrawObservable && this._onBeforeDrawObservable.clear(), this._onBeforeRenderObservable && this._onBeforeRenderObservable.clear(), this._onAfterRenderObservable && this._onAfterRenderObservable.clear(), this.getScene().meshes.forEach(function(e) {
                                    var t = e;
                                    t._source && t._source === r && (t._source = null)
                                }), this._source = null, this._instanceDataStorage.instancesBuffer && (this._instanceDataStorage.instancesBuffer.dispose(), this._instanceDataStorage.instancesBuffer = null); this.instances.length;) this.instances[0].dispose();
                            t.prototype.dispose.call(this, e, i)
                        }, r.prototype.applyDisplacementMap = function(t, i, r, n, o, s, a) {
                            var l = this;
                            void 0 === a && (a = !1);
                            var u = this.getScene();
                            return e.Tools.LoadImage(t, function(e) {
                                var t = document.createElement("canvas"),
                                    u = t.getContext("2d"),
                                    c = e.width,
                                    h = e.height;
                                t.width = c, t.height = h, u.drawImage(e, 0, 0);
                                var d = u.getImageData(0, 0, c, h).data;
                                l.applyDisplacementMapFromBuffer(d, c, h, i, r, o, s, a), n && n(l)
                            }, function() {}, u.database), this
                        }, r.prototype.applyDisplacementMapFromBuffer = function(t, i, r, n, o, s, a, l) {
                            if (void 0 === l && (l = !1), !this.isVerticesDataPresent(e.VertexBuffer.PositionKind) || !this.isVerticesDataPresent(e.VertexBuffer.NormalKind) || !this.isVerticesDataPresent(e.VertexBuffer.UVKind)) return e.Tools.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"), this;
                            var u = this.getVerticesData(e.VertexBuffer.PositionKind, !0, !0),
                                c = this.getVerticesData(e.VertexBuffer.NormalKind),
                                h = this.getVerticesData(e.VertexBuffer.UVKind),
                                d = e.Vector3.Zero(),
                                p = e.Vector3.Zero(),
                                f = e.Vector2.Zero();
                            s = s || e.Vector2.Zero(), a = a || new e.Vector2(1, 1);
                            for (var _ = 0; _ < u.length; _ += 3) {
                                e.Vector3.FromArrayToRef(u, _, d), e.Vector3.FromArrayToRef(c, _, p), e.Vector2.FromArrayToRef(h, _ / 3 * 2, f);
                                var m = 4 * ((Math.abs(f.x * a.x + s.x) * i % i | 0) + (Math.abs(f.y * a.y + s.y) * r % r | 0) * i),
                                    g = t[m] / 255 * .3 + t[m + 1] / 255 * .59 + t[m + 2] / 255 * .11;
                                p.normalize(), p.scaleInPlace(n + (o - n) * g), (d = d.add(p)).toArray(u, _)
                            }
                            return e.VertexData.ComputeNormals(u, this.getIndices(), c), l ? (this.setVerticesData(e.VertexBuffer.PositionKind, u), this.setVerticesData(e.VertexBuffer.NormalKind, c)) : (this.updateVerticesData(e.VertexBuffer.PositionKind, u), this.updateVerticesData(e.VertexBuffer.NormalKind, c)), this
                        }, r.prototype.convertToFlatShadedMesh = function() {
                            var t, i, r = this.getVerticesDataKinds(),
                                n = {},
                                o = {},
                                s = {},
                                a = !1;
                            for (t = 0; t < r.length; t++) {
                                i = r[t];
                                var l = this.getVertexBuffer(i);
                                i !== e.VertexBuffer.NormalKind ? (n[i] = l, o[i] = n[i].getData(), s[i] = []) : (a = l.isUpdatable(), r.splice(t, 1), t--)
                            }
                            var u, c = this.subMeshes.slice(0),
                                h = this.getIndices(),
                                d = this.getTotalIndices();
                            for (u = 0; u < d; u++) {
                                var p = h[u];
                                for (t = 0; t < r.length; t++)
                                    for (var f = n[i = r[t]].getStrideSize(), _ = 0; _ < f; _++) s[i].push(o[i][p * f + _])
                            }
                            var m = [],
                                g = s[e.VertexBuffer.PositionKind];
                            for (u = 0; u < d; u += 3) {
                                h[u] = u, h[u + 1] = u + 1, h[u + 2] = u + 2;
                                for (var v = e.Vector3.FromArray(g, 3 * u), y = e.Vector3.FromArray(g, 3 * (u + 1)), b = e.Vector3.FromArray(g, 3 * (u + 2)), x = v.subtract(y), T = b.subtract(y), E = e.Vector3.Normalize(e.Vector3.Cross(x, T)), S = 0; S < 3; S++) m.push(E.x), m.push(E.y), m.push(E.z)
                            }
                            for (this.setIndices(h), this.setVerticesData(e.VertexBuffer.NormalKind, m, a), t = 0; t < r.length; t++) i = r[t], this.setVerticesData(i, s[i], n[i].isUpdatable());
                            this.releaseSubMeshes();
                            for (var P = 0; P < c.length; P++) {
                                var A = c[P];
                                e.SubMesh.AddToMesh(A.materialIndex, A.indexStart, A.indexCount, A.indexStart, A.indexCount, this)
                            }
                            return this.synchronizeInstances(), this
                        }, r.prototype.convertToUnIndexedMesh = function() {
                            var t, i, r = this.getVerticesDataKinds(),
                                n = {},
                                o = {},
                                s = {};
                            for (t = 0; t < r.length; t++) {
                                i = r[t];
                                var a = this.getVertexBuffer(i);
                                n[i] = a, o[i] = n[i].getData(), s[i] = []
                            }
                            var l, u = this.subMeshes.slice(0),
                                c = this.getIndices(),
                                h = this.getTotalIndices();
                            for (l = 0; l < h; l++) {
                                var d = c[l];
                                for (t = 0; t < r.length; t++)
                                    for (var p = n[i = r[t]].getStrideSize(), f = 0; f < p; f++) s[i].push(o[i][d * p + f])
                            }
                            for (l = 0; l < h; l += 3) c[l] = l, c[l + 1] = l + 1, c[l + 2] = l + 2;
                            for (this.setIndices(c), t = 0; t < r.length; t++) i = r[t], this.setVerticesData(i, s[i], n[i].isUpdatable());
                            this.releaseSubMeshes();
                            for (var _ = 0; _ < u.length; _++) {
                                var m = u[_];
                                e.SubMesh.AddToMesh(m.materialIndex, m.indexStart, m.indexCount, m.indexStart, m.indexCount, this)
                            }
                            return this._unIndexed = !0, this.synchronizeInstances(), this
                        }, r.prototype.flipFaces = function(t) {
                            void 0 === t && (t = !1);
                            var i, r, n = e.VertexData.ExtractFromMesh(this);
                            if (t && this.isVerticesDataPresent(e.VertexBuffer.NormalKind) && n.normals)
                                for (i = 0; i < n.normals.length; i++) n.normals[i] *= -1;
                            if (n.indices)
                                for (i = 0; i < n.indices.length; i += 3) r = n.indices[i + 1], n.indices[i + 1] = n.indices[i + 2], n.indices[i + 2] = r;
                            return n.applyToMesh(this), this
                        }, r.prototype.createInstance = function(t) {
                            return new e.InstancedMesh(t, this)
                        }, r.prototype.synchronizeInstances = function() {
                            for (var e = 0; e < this.instances.length; e++) this.instances[e]._syncSubMeshes();
                            return this
                        }, r.prototype.optimizeIndices = function(t) {
                            var i = this,
                                r = this.getIndices(),
                                n = this.getVerticesData(e.VertexBuffer.PositionKind);
                            if (!n || !r) return this;
                            for (var o = new Array, s = 0; s < n.length; s += 3) o.push(e.Vector3.FromArray(n, s));
                            var a = new Array;
                            return e.AsyncLoop.SyncAsyncForLoop(o.length, 40, function(e) {
                                for (var t = o.length - 1 - e, i = o[t], r = 0; r < t; ++r) {
                                    var n = o[r];
                                    if (i.equals(n)) {
                                        a[t] = r;
                                        break
                                    }
                                }
                            }, function() {
                                for (var e = 0; e < r.length; ++e) r[e] = a[r[e]] || r[e];
                                var n = i.subMeshes.slice(0);
                                i.setIndices(r), i.subMeshes = n, t && t(i)
                            }), this
                        }, r.prototype.serialize = function(t) {
                            t.name = this.name, t.id = this.id, t.type = this.getClassName(), e.Tags && e.Tags.HasTags(this) && (t.tags = e.Tags.GetTags(this)), t.position = this.position.asArray(), this.rotationQuaternion ? t.rotationQuaternion = this.rotationQuaternion.asArray() : this.rotation && (t.rotation = this.rotation.asArray()), t.scaling = this.scaling.asArray(), t.localMatrix = this.getPivotMatrix().asArray(), t.isEnabled = this.isEnabled(!1), t.isVisible = this.isVisible, t.infiniteDistance = this.infiniteDistance, t.pickable = this.isPickable, t.receiveShadows = this.receiveShadows, t.billboardMode = this.billboardMode, t.visibility = this.visibility, t.checkCollisions = this.checkCollisions, t.isBlocker = this.isBlocker, this.parent && (t.parentId = this.parent.id), t.isUnIndexed = this.isUnIndexed;
                            var i = this._geometry;
                            if (i) {
                                var r = i.id;
                                t.geometryId = r, t.subMeshes = [];
                                for (var n = 0; n < this.subMeshes.length; n++) {
                                    var o = this.subMeshes[n];
                                    t.subMeshes.push({
                                        materialIndex: o.materialIndex,
                                        verticesStart: o.verticesStart,
                                        verticesCount: o.verticesCount,
                                        indexStart: o.indexStart,
                                        indexCount: o.indexCount
                                    })
                                }
                            }
                            this.material ? t.materialId = this.material.id : this.material = null, this.morphTargetManager && (t.morphTargetManagerId = this.morphTargetManager.uniqueId), this.skeleton && (t.skeletonId = this.skeleton.id);
                            var s = this.getPhysicsImpostor();
                            s && (t.physicsMass = s.getParam("mass"), t.physicsFriction = s.getParam("friction"), t.physicsRestitution = s.getParam("mass"), t.physicsImpostor = s.type), this.metadata && (t.metadata = this.metadata), t.instances = [];
                            for (var a = 0; a < this.instances.length; a++) {
                                var l = this.instances[a];
                                if (!l.doNotSerialize) {
                                    var u = {
                                        name: l.name,
                                        id: l.id,
                                        position: l.position.asArray(),
                                        scaling: l.scaling.asArray()
                                    };
                                    l.parent && (u.parentId = l.parent.id), l.rotationQuaternion ? u.rotationQuaternion = l.rotationQuaternion.asArray() : l.rotation && (u.rotation = l.rotation.asArray()), t.instances.push(u), e.Animation.AppendSerializedAnimations(l, u), u.ranges = l.serializeAnimationRanges()
                                }
                            }
                            e.Animation.AppendSerializedAnimations(this, t), t.ranges = this.serializeAnimationRanges(), t.layerMask = this.layerMask, t.alphaIndex = this.alphaIndex, t.hasVertexAlpha = this.hasVertexAlpha, t.overlayAlpha = this.overlayAlpha, t.overlayColor = this.overlayColor.asArray(), t.renderOverlay = this.renderOverlay, t.applyFog = this.applyFog, this.actionManager && (t.actions = this.actionManager.serialize(this.name))
                        }, r.prototype._syncGeometryWithMorphTargetManager = function() {
                            if (this.geometry) {
                                this._markSubMeshesAsAttributesDirty();
                                var t = this._morphTargetManager;
                                if (t && t.vertexCount) {
                                    if (t.vertexCount !== this.getTotalVertices()) return e.Tools.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."), void(this.morphTargetManager = null);
                                    for (var i = 0; i < t.numInfluencers; i++) {
                                        var r = t.getActiveTarget(i),
                                            n = r.getPositions();
                                        if (!n) return void e.Tools.Error("Invalid morph target. Target must have positions.");
                                        this.geometry.setVerticesData(e.VertexBuffer.PositionKind + i, n, !1, 3);
                                        var o = r.getNormals();
                                        o && this.geometry.setVerticesData(e.VertexBuffer.NormalKind + i, o, !1, 3);
                                        var s = r.getTangents();
                                        s && this.geometry.setVerticesData(e.VertexBuffer.TangentKind + i, s, !1, 3)
                                    }
                                } else
                                    for (i = 0; this.geometry.isVerticesDataPresent(e.VertexBuffer.PositionKind + i);) this.geometry.removeVerticesData(e.VertexBuffer.PositionKind + i), this.geometry.isVerticesDataPresent(e.VertexBuffer.NormalKind + i) && this.geometry.removeVerticesData(e.VertexBuffer.NormalKind + i), this.geometry.isVerticesDataPresent(e.VertexBuffer.TangentKind + i) && this.geometry.removeVerticesData(e.VertexBuffer.TangentKind + i), i++
                            }
                        }, r.Parse = function(t, i, n) {
                            var o;
                            if ((o = t.type && "GroundMesh" === t.type ? e.GroundMesh.Parse(t, i) : new r(t.name, i)).id = t.id, e.Tags && e.Tags.AddTagsTo(o, t.tags), o.position = e.Vector3.FromArray(t.position), void 0 !== t.metadata && (o.metadata = t.metadata), t.rotationQuaternion ? o.rotationQuaternion = e.Quaternion.FromArray(t.rotationQuaternion) : t.rotation && (o.rotation = e.Vector3.FromArray(t.rotation)), o.scaling = e.Vector3.FromArray(t.scaling), t.localMatrix ? o.setPreTransformMatrix(e.Matrix.FromArray(t.localMatrix)) : t.pivotMatrix && o.setPivotMatrix(e.Matrix.FromArray(t.pivotMatrix)), o.setEnabled(t.isEnabled), o.isVisible = t.isVisible, o.infiniteDistance = t.infiniteDistance, o.showBoundingBox = t.showBoundingBox, o.showSubMeshesBoundingBox = t.showSubMeshesBoundingBox, void 0 !== t.applyFog && (o.applyFog = t.applyFog), void 0 !== t.pickable && (o.isPickable = t.pickable), void 0 !== t.alphaIndex && (o.alphaIndex = t.alphaIndex), o.receiveShadows = t.receiveShadows, o.billboardMode = t.billboardMode, void 0 !== t.visibility && (o.visibility = t.visibility), o.checkCollisions = t.checkCollisions, void 0 !== t.isBlocker && (o.isBlocker = t.isBlocker), o._shouldGenerateFlatShading = t.useFlatShading, t.freezeWorldMatrix && (o._waitingFreezeWorldMatrix = t.freezeWorldMatrix), t.parentId && (o._waitingParentId = t.parentId), void 0 !== t.actions && (o._waitingActions = t.actions), void 0 !== t.overlayAlpha && (o.overlayAlpha = t.overlayAlpha), void 0 !== t.overlayColor && (o.overlayColor = e.Color3.FromArray(t.overlayColor)), void 0 !== t.renderOverlay && (o.renderOverlay = t.renderOverlay), o.isUnIndexed = !!t.isUnIndexed, o.hasVertexAlpha = t.hasVertexAlpha, t.delayLoadingFile ? (o.delayLoadState = e.Engine.DELAYLOADSTATE_NOTLOADED, o.delayLoadingFile = n + t.delayLoadingFile, o._boundingInfo = new e.BoundingInfo(e.Vector3.FromArray(t.boundingBoxMinimum), e.Vector3.FromArray(t.boundingBoxMaximum)), t._binaryInfo && (o._binaryInfo = t._binaryInfo), o._delayInfo = [], t.hasUVs && o._delayInfo.push(e.VertexBuffer.UVKind), t.hasUVs2 && o._delayInfo.push(e.VertexBuffer.UV2Kind), t.hasUVs3 && o._delayInfo.push(e.VertexBuffer.UV3Kind), t.hasUVs4 && o._delayInfo.push(e.VertexBuffer.UV4Kind), t.hasUVs5 && o._delayInfo.push(e.VertexBuffer.UV5Kind), t.hasUVs6 && o._delayInfo.push(e.VertexBuffer.UV6Kind), t.hasColors && o._delayInfo.push(e.VertexBuffer.ColorKind), t.hasMatricesIndices && o._delayInfo.push(e.VertexBuffer.MatricesIndicesKind), t.hasMatricesWeights && o._delayInfo.push(e.VertexBuffer.MatricesWeightsKind), o._delayLoadingFunction = e.Geometry._ImportGeometry, e.SceneLoader.ForceFullSceneLoadingForIncremental && o._checkDelayState()) : e.Geometry._ImportGeometry(t, o), t.materialId ? o.setMaterialByID(t.materialId) : o.material = null, -1 < t.morphTargetManagerId && (o.morphTargetManager = i.getMorphTargetManagerById(t.morphTargetManagerId)), -1 < t.skeletonId && (o.skeleton = i.getLastSkeletonByID(t.skeletonId), t.numBoneInfluencers && (o.numBoneInfluencers = t.numBoneInfluencers)), t.animations) {
                                for (var s = 0; s < t.animations.length; s++) {
                                    var a = t.animations[s];
                                    o.animations.push(e.Animation.Parse(a))
                                }
                                e.Node.ParseAnimationRanges(o, t, i)
                            }
                            if (t.autoAnimate && i.beginAnimation(o, t.autoAnimateFrom, t.autoAnimateTo, t.autoAnimateLoop, t.autoAnimateSpeed || 1), t.layerMask && !isNaN(t.layerMask) ? o.layerMask = Math.abs(parseInt(t.layerMask)) : o.layerMask = 268435455, t.physicsImpostor && (o.physicsImpostor = new e.PhysicsImpostor(o, t.physicsImpostor, {
                                    mass: t.physicsMass,
                                    friction: t.physicsFriction,
                                    restitution: t.physicsRestitution
                                }, i)), t.instances)
                                for (var l = 0; l < t.instances.length; l++) {
                                    var u = t.instances[l],
                                        c = o.createInstance(u.name);
                                    if (u.id && (c.id = u.id), e.Tags && (u.tags ? e.Tags.AddTagsTo(c, u.tags) : e.Tags.AddTagsTo(c, t.tags)), c.position = e.Vector3.FromArray(u.position), u.parentId && (c._waitingParentId = u.parentId), u.rotationQuaternion ? c.rotationQuaternion = e.Quaternion.FromArray(u.rotationQuaternion) : u.rotation && (c.rotation = e.Vector3.FromArray(u.rotation)), c.scaling = e.Vector3.FromArray(u.scaling), null != u.checkCollisions && null != u.checkCollisions && (c.checkCollisions = u.checkCollisions), null != u.pickable && null != u.pickable && (c.isPickable = u.pickable), null != u.showBoundingBox && null != u.showBoundingBox && (c.showBoundingBox = u.showBoundingBox), null != u.showSubMeshesBoundingBox && null != u.showSubMeshesBoundingBox && (c.showSubMeshesBoundingBox = u.showSubMeshesBoundingBox), null != u.alphaIndex && null != u.showSubMeshesBoundingBox && (c.alphaIndex = u.alphaIndex), u.physicsImpostor && (c.physicsImpostor = new e.PhysicsImpostor(c, u.physicsImpostor, {
                                            mass: u.physicsMass,
                                            friction: u.physicsFriction,
                                            restitution: u.physicsRestitution
                                        }, i)), u.animations) {
                                        for (s = 0; s < u.animations.length; s++) a = u.animations[s], c.animations.push(e.Animation.Parse(a));
                                        e.Node.ParseAnimationRanges(c, u, i), u.autoAnimate && i.beginAnimation(c, u.autoAnimateFrom, u.autoAnimateTo, u.autoAnimateLoop, u.autoAnimateSpeed || 1)
                                    }
                                }
                            return o
                        }, r.CreateRibbon = function(t, i, r, n, o, s, a, l, u) {
                            return void 0 === r && (r = !1), void 0 === a && (a = !1), e.MeshBuilder.CreateRibbon(t, {
                                pathArray: i,
                                closeArray: r,
                                closePath: n,
                                offset: o,
                                updatable: a,
                                sideOrientation: l,
                                instance: u
                            }, s)
                        }, r.CreateDisc = function(t, i, r, n, o, s) {
                            void 0 === n && (n = null);
                            var a = {
                                radius: i,
                                tessellation: r,
                                sideOrientation: s,
                                updatable: o
                            };
                            return e.MeshBuilder.CreateDisc(t, a, n)
                        }, r.CreateBox = function(t, i, r, n, o) {
                            void 0 === r && (r = null);
                            var s = {
                                size: i,
                                sideOrientation: o,
                                updatable: n
                            };
                            return e.MeshBuilder.CreateBox(t, s, r)
                        }, r.CreateSphere = function(t, i, r, n, o, s) {
                            var a = {
                                segments: i,
                                diameterX: r,
                                diameterY: r,
                                diameterZ: r,
                                sideOrientation: s,
                                updatable: o
                            };
                            return e.MeshBuilder.CreateSphere(t, a, n)
                        }, r.CreateCylinder = function(t, i, n, o, s, a, l, u, c) {
                            void 0 !== l && l instanceof e.Scene || (void 0 !== l && (c = u || r.DEFAULTSIDE, u = l), l = a, a = 1);
                            var h = {
                                height: i,
                                diameterTop: n,
                                diameterBottom: o,
                                tessellation: s,
                                subdivisions: a,
                                sideOrientation: c,
                                updatable: u
                            };
                            return e.MeshBuilder.CreateCylinder(t, h, l)
                        }, r.CreateTorus = function(t, i, r, n, o, s, a) {
                            var l = {
                                diameter: i,
                                thickness: r,
                                tessellation: n,
                                sideOrientation: a,
                                updatable: s
                            };
                            return e.MeshBuilder.CreateTorus(t, l, o)
                        }, r.CreateTorusKnot = function(t, i, r, n, o, s, a, l, u, c) {
                            var h = {
                                radius: i,
                                tube: r,
                                radialSegments: n,
                                tubularSegments: o,
                                p: s,
                                q: a,
                                sideOrientation: c,
                                updatable: u
                            };
                            return e.MeshBuilder.CreateTorusKnot(t, h, l)
                        }, r.CreateLines = function(t, i, r, n, o) {
                            void 0 === r && (r = null), void 0 === n && (n = !1), void 0 === o && (o = null);
                            var s = {
                                points: i,
                                updatable: n,
                                instance: o
                            };
                            return e.MeshBuilder.CreateLines(t, s, r)
                        }, r.CreateDashedLines = function(t, i, r, n, o, s, a, l) {
                            void 0 === s && (s = null);
                            var u = {
                                points: i,
                                dashSize: r,
                                gapSize: n,
                                dashNb: o,
                                updatable: a,
                                instance: l
                            };
                            return e.MeshBuilder.CreateDashedLines(t, u, s)
                        }, r.CreatePolygon = function(t, i, r, n, o, s) {
                            var a = {
                                shape: i,
                                holes: n,
                                updatable: o,
                                sideOrientation: s
                            };
                            return e.MeshBuilder.CreatePolygon(t, a, r)
                        }, r.ExtrudePolygon = function(t, i, r, n, o, s, a) {
                            var l = {
                                shape: i,
                                holes: o,
                                depth: r,
                                updatable: s,
                                sideOrientation: a
                            };
                            return e.MeshBuilder.ExtrudePolygon(t, l, n)
                        }, r.ExtrudeShape = function(t, i, n, o, s, a, l, u, c, h) {
                            void 0 === l && (l = null);
                            var d = {
                                shape: i,
                                path: n,
                                scale: o,
                                rotation: s,
                                cap: 0 === a ? 0 : a || r.NO_CAP,
                                sideOrientation: c,
                                instance: h,
                                updatable: u
                            };
                            return e.MeshBuilder.ExtrudeShape(t, d, l)
                        }, r.ExtrudeShapeCustom = function(t, i, n, o, s, a, l, u, c, h, d, p) {
                            var f = {
                                shape: i,
                                path: n,
                                scaleFunction: o,
                                rotationFunction: s,
                                ribbonCloseArray: a,
                                ribbonClosePath: l,
                                cap: 0 === u ? 0 : u || r.NO_CAP,
                                sideOrientation: d,
                                instance: p,
                                updatable: h
                            };
                            return e.MeshBuilder.ExtrudeShapeCustom(t, f, c)
                        }, r.CreateLathe = function(t, i, r, n, o, s, a) {
                            var l = {
                                shape: i,
                                radius: r,
                                tessellation: n,
                                sideOrientation: a,
                                updatable: s
                            };
                            return e.MeshBuilder.CreateLathe(t, l, o)
                        }, r.CreatePlane = function(t, i, r, n, o) {
                            var s = {
                                size: i,
                                width: i,
                                height: i,
                                sideOrientation: o,
                                updatable: n
                            };
                            return e.MeshBuilder.CreatePlane(t, s, r)
                        }, r.CreateGround = function(t, i, r, n, o, s) {
                            var a = {
                                width: i,
                                height: r,
                                subdivisions: n,
                                updatable: s
                            };
                            return e.MeshBuilder.CreateGround(t, a, o)
                        }, r.CreateTiledGround = function(t, i, r, n, o, s, a, l, u) {
                            var c = {
                                xmin: i,
                                zmin: r,
                                xmax: n,
                                zmax: o,
                                subdivisions: s,
                                precision: a,
                                updatable: u
                            };
                            return e.MeshBuilder.CreateTiledGround(t, c, l)
                        }, r.CreateGroundFromHeightMap = function(t, i, r, n, o, s, a, l, u, c, h) {
                            var d = {
                                width: r,
                                height: n,
                                subdivisions: o,
                                minHeight: s,
                                maxHeight: a,
                                updatable: u,
                                onReady: c,
                                alphaFilter: h
                            };
                            return e.MeshBuilder.CreateGroundFromHeightMap(t, i, d, l)
                        }, r.CreateTube = function(t, i, r, n, o, s, a, l, u, c) {
                            var h = {
                                path: i,
                                radius: r,
                                tessellation: n,
                                radiusFunction: o,
                                arc: 1,
                                cap: s,
                                updatable: l,
                                sideOrientation: u,
                                instance: c
                            };
                            return e.MeshBuilder.CreateTube(t, h, a)
                        }, r.CreatePolyhedron = function(t, i, r) {
                            return e.MeshBuilder.CreatePolyhedron(t, i, r)
                        }, r.CreateIcoSphere = function(t, i, r) {
                            return e.MeshBuilder.CreateIcoSphere(t, i, r)
                        }, r.CreateDecal = function(t, i, r, n, o, s) {
                            var a = {
                                position: r,
                                normal: n,
                                size: o,
                                angle: s
                            };
                            return e.MeshBuilder.CreateDecal(t, i, a)
                        }, r.prototype.setPositionsForCPUSkinning = function() {
                            if (!this._sourcePositions) {
                                var t = this.getVerticesData(e.VertexBuffer.PositionKind);
                                if (!t) return this._sourcePositions;
                                this._sourcePositions = new Float32Array(t), this.isVertexBufferUpdatable(e.VertexBuffer.PositionKind) || this.setVerticesData(e.VertexBuffer.PositionKind, t, !0)
                            }
                            return this._sourcePositions
                        }, r.prototype.setNormalsForCPUSkinning = function() {
                            if (!this._sourceNormals) {
                                var t = this.getVerticesData(e.VertexBuffer.NormalKind);
                                if (!t) return this._sourceNormals;
                                this._sourceNormals = new Float32Array(t), this.isVertexBufferUpdatable(e.VertexBuffer.NormalKind) || this.setVerticesData(e.VertexBuffer.NormalKind, t, !0)
                            }
                            return this._sourceNormals
                        }, r.prototype.applySkeleton = function(t) {
                            if (!this.geometry) return this;
                            if (this.geometry._softwareSkinningFrameId == this.getScene().getFrameId()) return this;
                            if (this.geometry._softwareSkinningFrameId = this.getScene().getFrameId(), !this.isVerticesDataPresent(e.VertexBuffer.PositionKind)) return this;
                            if (!this.isVerticesDataPresent(e.VertexBuffer.NormalKind)) return this;
                            if (!this.isVerticesDataPresent(e.VertexBuffer.MatricesIndicesKind)) return this;
                            if (!this.isVerticesDataPresent(e.VertexBuffer.MatricesWeightsKind)) return this;
                            if (!this._sourcePositions) {
                                var i = this.subMeshes.slice();
                                this.setPositionsForCPUSkinning(), this.subMeshes = i
                            }
                            this._sourceNormals || this.setNormalsForCPUSkinning();
                            var r = this.getVerticesData(e.VertexBuffer.PositionKind);
                            if (!r) return this;
                            r instanceof Float32Array || (r = new Float32Array(r));
                            var n = this.getVerticesData(e.VertexBuffer.NormalKind);
                            if (!n) return this;
                            n instanceof Float32Array || (n = new Float32Array(n));
                            var o = this.getVerticesData(e.VertexBuffer.MatricesIndicesKind),
                                s = this.getVerticesData(e.VertexBuffer.MatricesWeightsKind);
                            if (!s || !o) return this;
                            for (var a, l = 4 < this.numBoneInfluencers, u = l ? this.getVerticesData(e.VertexBuffer.MatricesIndicesExtraKind) : null, c = l ? this.getVerticesData(e.VertexBuffer.MatricesWeightsExtraKind) : null, h = t.getTransformMatrices(this), d = e.Vector3.Zero(), p = new e.Matrix, f = new e.Matrix, _ = 0, m = 0; m < r.length; m += 3, _ += 4) {
                                var g;
                                for (a = 0; a < 4; a++) 0 < (g = s[_ + a]) && (e.Matrix.FromFloat32ArrayToRefScaled(h, Math.floor(16 * o[_ + a]), g, f), p.addToSelf(f));
                                if (l)
                                    for (a = 0; a < 4; a++) 0 < (g = c[_ + a]) && (e.Matrix.FromFloat32ArrayToRefScaled(h, Math.floor(16 * u[_ + a]), g, f), p.addToSelf(f));
                                e.Vector3.TransformCoordinatesFromFloatsToRef(this._sourcePositions[m], this._sourcePositions[m + 1], this._sourcePositions[m + 2], p, d), d.toArray(r, m), e.Vector3.TransformNormalFromFloatsToRef(this._sourceNormals[m], this._sourceNormals[m + 1], this._sourceNormals[m + 2], p, d), d.toArray(n, m), p.reset()
                            }
                            return this.updateVerticesData(e.VertexBuffer.PositionKind, r), this.updateVerticesData(e.VertexBuffer.NormalKind, n), this
                        }, r.MinMax = function(t) {
                            var i = null,
                                r = null;
                            return t.forEach(function(e, t, n) {
                                var o = e.getBoundingInfo().boundingBox;
                                i && r ? (i.minimizeInPlace(o.minimumWorld), r.maximizeInPlace(o.maximumWorld)) : (i = o.minimumWorld, r = o.maximumWorld)
                            }), i && r ? {
                                min: i,
                                max: r
                            } : {
                                min: e.Vector3.Zero(),
                                max: e.Vector3.Zero()
                            }
                        }, r.Center = function(t) {
                            var i = t instanceof Array ? r.MinMax(t) : t;
                            return e.Vector3.Center(i.min, i.max)
                        }, r.MergeMeshes = function(t, i, n, o, s) {
                            var a;
                            if (void 0 === i && (i = !0), !n) {
                                var l = 0;
                                for (a = 0; a < t.length; a++)
                                    if (t[a] && 65536 < (l += t[a].getTotalVertices())) return e.Tools.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"), null
                            }
                            var u, c = null,
                                h = new Array,
                                d = null;
                            for (a = 0; a < t.length; a++)
                                if (t[a]) {
                                    var p = t[a].computeWorldMatrix(!0);
                                    (u = e.VertexData.ExtractFromMesh(t[a], !0, !0)).transform(p), c ? c.merge(u, n) : (c = u, d = t[a]), s && h.push(t[a].getTotalIndices())
                                }
                            if (d = d, o || (o = new r(d.name + "_merged", d.getScene())), c.applyToMesh(o), o.material = d.material, o.checkCollisions = d.checkCollisions, i)
                                for (a = 0; a < t.length; a++) t[a] && t[a].dispose();
                            if (s) {
                                o.releaseSubMeshes();
                                for (var f = a = 0; a < h.length;) e.SubMesh.CreateFromIndices(0, f, h[a], o), f += h[a], a++
                            }
                            return o
                        }, r.FRONTSIDE = 0, r.BACKSIDE = 1, r.DOUBLESIDE = 2, r.DEFAULTSIDE = 0, r.NO_CAP = 0, r.CAP_START = 1, r.CAP_END = 2, r.CAP_ALL = 3, r
                    }(e.AbstractMesh);
                    e.Mesh = n
                }($a || ($a = {})), ne = $a || ($a = {}), oe = function() {
                    function e() {}
                    return Object.defineProperty(e.prototype, "effect", {
                        get: function() {
                            return this._materialEffect
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.setEffect = function(e, t) {
                        void 0 === t && (t = null), this._materialEffect !== e ? (this._materialDefines = t, this._materialEffect = e) : e || (this._materialDefines = null)
                    }, e
                }(), se = function(e) {
                    function t(t, i, r, n, o, s, a, l) {
                        void 0 === l && (l = !0);
                        var u = e.call(this) || this;
                        return u.materialIndex = t, u.verticesStart = i, u.verticesCount = r, u.indexStart = n, u.indexCount = o, u._renderId = 0, u._mesh = s, u._renderingMesh = a || s, s.subMeshes.push(u), u._trianglePlanes = [], u._id = s.subMeshes.length - 1, l && (u.refreshBoundingInfo(), s.computeWorldMatrix(!0)), u
                    }
                    return b(t, e), t.AddToMesh = function(e, i, r, n, o, s, a, l) {
                        return void 0 === l && (l = !0), new t(e, i, r, n, o, s, a, l)
                    }, Object.defineProperty(t.prototype, "IsGlobal", {
                        get: function() {
                            return 0 === this.verticesStart && this.verticesCount === this._mesh.getTotalVertices()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getBoundingInfo = function() {
                        return this.IsGlobal ? this._mesh.getBoundingInfo() : this._boundingInfo
                    }, t.prototype.setBoundingInfo = function(e) {
                        return this._boundingInfo = e, this
                    }, t.prototype.getMesh = function() {
                        return this._mesh
                    }, t.prototype.getRenderingMesh = function() {
                        return this._renderingMesh
                    }, t.prototype.getMaterial = function() {
                        var e = this._renderingMesh.material;
                        if (null == e) return this._mesh.getScene().defaultMaterial;
                        if (e.getSubMaterial) {
                            var t = e.getSubMaterial(this.materialIndex);
                            return this._currentMaterial !== t && (this._currentMaterial = t, this._materialDefines = null), t
                        }
                        return e
                    }, t.prototype.refreshBoundingInfo = function() {
                        if (this._lastColliderWorldVertices = null, this.IsGlobal || !this._renderingMesh || !this._renderingMesh.geometry) return this;
                        var e = this._renderingMesh.getVerticesData(ne.VertexBuffer.PositionKind);
                        if (!e) return this._boundingInfo = this._mesh.getBoundingInfo(), this;
                        var t, i = this._renderingMesh.getIndices();
                        if (0 === this.indexStart && this.indexCount === i.length) {
                            var r = this._renderingMesh.getBoundingInfo();
                            t = {
                                minimum: r.minimum.clone(),
                                maximum: r.maximum.clone()
                            }
                        } else t = ne.Tools.ExtractMinAndMaxIndexed(e, i, this.indexStart, this.indexCount, this._renderingMesh.geometry.boundingBias);
                        return this._boundingInfo = new ne.BoundingInfo(t.minimum, t.maximum), this
                    }, t.prototype._checkCollision = function(e) {
                        return this.getBoundingInfo()._checkCollision(e)
                    }, t.prototype.updateBoundingInfo = function(e) {
                        var t = this.getBoundingInfo();
                        return t || (this.refreshBoundingInfo(), t = this.getBoundingInfo()), t.update(e), this
                    }, t.prototype.isInFrustum = function(e) {
                        var t = this.getBoundingInfo();
                        return !!t && t.isInFrustum(e, this._mesh.cullingStrategy)
                    }, t.prototype.isCompletelyInFrustum = function(e) {
                        var t = this.getBoundingInfo();
                        return !!t && t.isCompletelyInFrustum(e)
                    }, t.prototype.render = function(e) {
                        return this._renderingMesh.render(this, e), this
                    }, t.prototype._getLinesIndexBuffer = function(e, t) {
                        if (!this._linesIndexBuffer) {
                            for (var i = [], r = this.indexStart; r < this.indexStart + this.indexCount; r += 3) i.push(e[r], e[r + 1], e[r + 1], e[r + 2], e[r + 2], e[r]);
                            this._linesIndexBuffer = t.createIndexBuffer(i), this._linesIndexCount = i.length
                        }
                        return this._linesIndexBuffer
                    }, t.prototype.canIntersects = function(e) {
                        var t = this.getBoundingInfo();
                        return !!t && e.intersectsBox(t.boundingBox)
                    }, t.prototype.intersects = function(e, t, i, r) {
                        var n = this.getMaterial();
                        if (!n) return null;
                        switch (n.fillMode) {
                            case ne.Material.PointListDrawMode:
                            case ne.Material.LineListDrawMode:
                            case ne.Material.LineLoopDrawMode:
                            case ne.Material.LineStripDrawMode:
                            case ne.Material.TriangleFanDrawMode:
                            case ne.Material.TriangleStripDrawMode:
                                return null
                        }
                        if (ne.LinesMesh) {
                            var o = this._mesh instanceof ne.InstancedMesh ? this._mesh.sourceMesh : this._mesh;
                            if (o instanceof ne.LinesMesh) {
                                var s = o;
                                return this._intersectLines(e, t, i, s.intersectionThreshold, r)
                            }
                        }
                        return this._intersectTriangles(e, t, i, r)
                    }, t.prototype._intersectLines = function(e, t, i, r, n) {
                        for (var o = null, s = this.indexStart; s < this.indexStart + this.indexCount; s += 2) {
                            var a = t[i[s]],
                                l = t[i[s + 1]],
                                u = e.intersectionSegment(a, l, r);
                            if (!(u < 0) && (n || !o || u < o.distance) && (o = new ne.IntersectionInfo(null, null, u), n)) break
                        }
                        return o
                    }, t.prototype._intersectTriangles = function(e, t, i, r) {
                        for (var n = null, o = this.indexStart; o < this.indexStart + this.indexCount; o += 3) {
                            var s = t[i[o]],
                                a = t[i[o + 1]],
                                l = t[i[o + 2]],
                                u = e.intersectsTriangle(s, a, l);
                            if (u) {
                                if (u.distance < 0) continue;
                                if ((r || !n || u.distance < n.distance) && ((n = u).faceId = o / 3, r)) break
                            }
                        }
                        return n
                    }, t.prototype._rebuild = function() {
                        this._linesIndexBuffer && (this._linesIndexBuffer = null)
                    }, t.prototype.clone = function(e, i) {
                        var r = new t(this.materialIndex, this.verticesStart, this.verticesCount, this.indexStart, this.indexCount, e, i, !1);
                        if (!this.IsGlobal) {
                            var n = this.getBoundingInfo();
                            if (!n) return r;
                            r._boundingInfo = new ne.BoundingInfo(n.minimum, n.maximum)
                        }
                        return r
                    }, t.prototype.dispose = function() {
                        this._linesIndexBuffer && (this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer), this._linesIndexBuffer = null);
                        var e = this._mesh.subMeshes.indexOf(this);
                        this._mesh.subMeshes.splice(e, 1)
                    }, t.CreateFromIndices = function(e, i, r, n, o) {
                        for (var s = Number.MAX_VALUE, a = -Number.MAX_VALUE, l = (o = o || n).getIndices(), u = i; u < i + r; u++) {
                            var c = l[u];
                            c < s && (s = c), a < c && (a = c)
                        }
                        return new t(e, s, a - s + 1, i, r, n, o)
                    }, t
                }(ne.BaseSubMesh = oe), ne.SubMesh = se;
            var le, ue, ce, he, de, pe, fe, _e, me, ge, ve, ye, be, xe, Te, Ee, Se, Pe, Ae, Ce, Me, Re, Oe, we, Ie, De, Le, Be, Fe, Ne, Ve, ke, Ue, Ge, ze, je, He, We, Xe, Ye, qe, Ke, Qe, Ze, Je, $e, et, tt, it, rt, nt, ot, st, at, lt, ut, ct, ht, dt, pt, ft, _t, mt, gt, vt, yt, bt, xt, Tt, Et, St, Pt, At, Ct, Mt, Rt, Ot, wt, It, Dt, Lt, Bt, Ft, Nt, Vt, kt, Ut, Gt, zt, jt, Ht, Wt, Xt, Yt, qt, Kt, Qt, Zt, Jt, $t, ei, ti, ii, ri, ni, oi, si, ai, li, ui, ci, hi, di, pi, fi, _i, mi, gi, vi, yi, bi, xi, Ti, Ei, Si, Pi, Ai, Ci, Mi, Ri, Oi, wi, Ii, Di, Li, Bi, Fi, Ni, Vi, ki, Ui, Gi, zi, ji, Hi, Wi, Xi, Yi, qi, Ki, Qi, Zi, Ji;
            ae = this && this.__assign || function() {
                    return (ae = Object.assign || function(e) {
                        for (var t, i = 1, r = arguments.length; i < r; i++)
                            for (var n in t = arguments[i]) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
                        return e
                    }).apply(this, arguments)
                }, ! function(e) {
                    var t = function() {
                        function e() {
                            this._isDirty = !0, this._areLightsDirty = !0, this._areAttributesDirty = !0, this._areTexturesDirty = !0, this._areFresnelDirty = !0, this._areMiscDirty = !0, this._areImageProcessingDirty = !0, this._normals = !1, this._uvs = !1, this._needNormals = !1, this._needUVs = !1
                        }
                        return Object.defineProperty(e.prototype, "isDirty", {
                            get: function() {
                                return this._isDirty
                            },
                            enumerable: !0,
                            configurable: !0
                        }), e.prototype.markAsProcessed = function() {
                            this._isDirty = !1, this._areAttributesDirty = !1, this._areTexturesDirty = !1, this._areFresnelDirty = !1, this._areLightsDirty = !1, this._areMiscDirty = !1, this._areImageProcessingDirty = !1
                        }, e.prototype.markAsUnprocessed = function() {
                            this._isDirty = !0
                        }, e.prototype.markAllAsDirty = function() {
                            this._areTexturesDirty = !0, this._areAttributesDirty = !0, this._areLightsDirty = !0, this._areFresnelDirty = !0, this._areMiscDirty = !0, this._areImageProcessingDirty = !0, this._isDirty = !0
                        }, e.prototype.markAsImageProcessingDirty = function() {
                            this._areImageProcessingDirty = !0, this._isDirty = !0
                        }, e.prototype.markAsLightDirty = function() {
                            this._areLightsDirty = !0, this._isDirty = !0
                        }, e.prototype.markAsAttributesDirty = function() {
                            this._areAttributesDirty = !0, this._isDirty = !0
                        }, e.prototype.markAsTexturesDirty = function() {
                            this._areTexturesDirty = !0, this._isDirty = !0
                        }, e.prototype.markAsFresnelDirty = function() {
                            this._areFresnelDirty = !0, this._isDirty = !0
                        }, e.prototype.markAsMiscDirty = function() {
                            this._areMiscDirty = !0, this._isDirty = !0
                        }, e.prototype.rebuild = function() {
                            this._keys && delete this._keys, this._keys = [];
                            for (var e = 0, t = Object.keys(this); e < t.length; e++) {
                                var i = t[e];
                                "_" !== i[0] && this._keys.push(i)
                            }
                        }, e.prototype.isEqual = function(e) {
                            if (this._keys.length !== e._keys.length) return !1;
                            for (var t = 0; t < this._keys.length; t++) {
                                var i = this._keys[t];
                                if (this[i] !== e[i]) return !1
                            }
                            return !0
                        }, e.prototype.cloneTo = function(e) {
                            this._keys.length !== e._keys.length && (e._keys = this._keys.slice(0));
                            for (var t = 0; t < this._keys.length; t++) {
                                var i = this._keys[t];
                                e[i] = this[i]
                            }
                        }, e.prototype.reset = function() {
                            for (var e = 0; e < this._keys.length; e++) {
                                var t = this._keys[e];
                                switch (typeof this[t]) {
                                    case "number":
                                        this[t] = 0;
                                        break;
                                    case "string":
                                        this[t] = "";
                                        break;
                                    default:
                                        this[t] = !1
                                }
                            }
                        }, e.prototype.toString = function() {
                            for (var e = "", t = 0; t < this._keys.length; t++) {
                                var i = this._keys[t],
                                    r = this[i];
                                switch (typeof r) {
                                    case "number":
                                    case "string":
                                        e += "#define " + i + " " + r + "\n";
                                        break;
                                    default:
                                        r && (e += "#define " + i + "\n")
                                }
                            }
                            return e
                        }, e
                    }();
                    e.MaterialDefines = t;
                    var i = function() {
                        function t(i, r, n) {
                            this.checkReadyOnEveryCall = !1, this.checkReadyOnlyOnce = !1, this.state = "", this._alpha = 1, this._backFaceCulling = !0, this.doNotSerialize = !1, this.storeEffectOnSubMeshes = !1, this.onDisposeObservable = new e.Observable, this._alphaMode = e.Engine.ALPHA_COMBINE, this._needDepthPrePass = !1, this.disableDepthWrite = !1, this.forceDepthWrite = !1, this.separateCullingPass = !1, this._fogEnabled = !0, this.pointSize = 1, this.zOffset = 0, this._wasPreviouslyReady = !1, this._fillMode = t.TriangleFillMode, this.name = i, this.id = i || e.Tools.RandomId(), this._scene = r || e.Engine.LastCreatedScene, this.uniqueId = this._scene.getUniqueId(), this._scene.useRightHandedSystem ? this.sideOrientation = t.ClockWiseSideOrientation : this.sideOrientation = t.CounterClockWiseSideOrientation, this._uniformBuffer = new e.UniformBuffer(this._scene.getEngine()), this._useUBO = this.getScene().getEngine().supportsUniformBuffers, n || (this._scene.materials.push(this), this._scene.onNewMaterialAddedObservable.notifyObservers(this))
                        }
                        return Object.defineProperty(t, "TriangleFillMode", {
                            get: function() {
                                return t._TriangleFillMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "WireFrameFillMode", {
                            get: function() {
                                return t._WireFrameFillMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "PointFillMode", {
                            get: function() {
                                return t._PointFillMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "PointListDrawMode", {
                            get: function() {
                                return t._PointListDrawMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "LineListDrawMode", {
                            get: function() {
                                return t._LineListDrawMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "LineLoopDrawMode", {
                            get: function() {
                                return t._LineLoopDrawMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "LineStripDrawMode", {
                            get: function() {
                                return t._LineStripDrawMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "TriangleStripDrawMode", {
                            get: function() {
                                return t._TriangleStripDrawMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "TriangleFanDrawMode", {
                            get: function() {
                                return t._TriangleFanDrawMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "ClockWiseSideOrientation", {
                            get: function() {
                                return t._ClockWiseSideOrientation
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "CounterClockWiseSideOrientation", {
                            get: function() {
                                return t._CounterClockWiseSideOrientation
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "alpha", {
                            get: function() {
                                return this._alpha
                            },
                            set: function(e) {
                                this._alpha !== e && (this._alpha = e, this.markAsDirty(t.MiscDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "backFaceCulling", {
                            get: function() {
                                return this._backFaceCulling
                            },
                            set: function(e) {
                                this._backFaceCulling !== e && (this._backFaceCulling = e, this.markAsDirty(t.TextureDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "hasRenderTargetTextures", {
                            get: function() {
                                return !1
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "onDispose", {
                            set: function(e) {
                                this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "onBindObservable", {
                            get: function() {
                                return this._onBindObservable || (this._onBindObservable = new e.Observable), this._onBindObservable
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "onBind", {
                            set: function(e) {
                                this._onBindObserver && this.onBindObservable.remove(this._onBindObserver), this._onBindObserver = this.onBindObservable.add(e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "onUnBindObservable", {
                            get: function() {
                                return this._onUnBindObservable || (this._onUnBindObservable = new e.Observable), this._onUnBindObservable
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "alphaMode", {
                            get: function() {
                                return this._alphaMode
                            },
                            set: function(e) {
                                this._alphaMode !== e && (this._alphaMode = e, this.markAsDirty(t.TextureDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "needDepthPrePass", {
                            get: function() {
                                return this._needDepthPrePass
                            },
                            set: function(e) {
                                this._needDepthPrePass !== e && (this._needDepthPrePass = e, this._needDepthPrePass && (this.checkReadyOnEveryCall = !0))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "fogEnabled", {
                            get: function() {
                                return this._fogEnabled
                            },
                            set: function(e) {
                                this._fogEnabled !== e && (this._fogEnabled = e, this.markAsDirty(t.MiscDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "wireframe", {
                            get: function() {
                                switch (this._fillMode) {
                                    case t.WireFrameFillMode:
                                    case t.LineListDrawMode:
                                    case t.LineLoopDrawMode:
                                    case t.LineStripDrawMode:
                                        return !0
                                }
                                return this._scene.forceWireframe
                            },
                            set: function(e) {
                                this.fillMode = e ? t.WireFrameFillMode : t.TriangleFillMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "pointsCloud", {
                            get: function() {
                                switch (this._fillMode) {
                                    case t.PointFillMode:
                                    case t.PointListDrawMode:
                                        return !0
                                }
                                return this._scene.forcePointsCloud
                            },
                            set: function(e) {
                                this.fillMode = e ? t.PointFillMode : t.TriangleFillMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "fillMode", {
                            get: function() {
                                return this._fillMode
                            },
                            set: function(e) {
                                this._fillMode !== e && (this._fillMode = e, this.markAsDirty(t.MiscDirtyFlag))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.toString = function(e) {
                            return "Name: " + this.name
                        }, t.prototype.getClassName = function() {
                            return "Material"
                        }, Object.defineProperty(t.prototype, "isFrozen", {
                            get: function() {
                                return this.checkReadyOnlyOnce
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.freeze = function() {
                            this.checkReadyOnlyOnce = !0
                        }, t.prototype.unfreeze = function() {
                            this.checkReadyOnlyOnce = !1
                        }, t.prototype.isReady = function(e, t) {
                            return !0
                        }, t.prototype.isReadyForSubMesh = function(e, t, i) {
                            return !1
                        }, t.prototype.getEffect = function() {
                            return this._effect
                        }, t.prototype.getScene = function() {
                            return this._scene
                        }, t.prototype.needAlphaBlending = function() {
                            return this.alpha < 1
                        }, t.prototype.needAlphaBlendingForMesh = function(e) {
                            return this.needAlphaBlending() || e.visibility < 1 || e.hasVertexAlpha
                        }, t.prototype.needAlphaTesting = function() {
                            return !1
                        }, t.prototype.getAlphaTestTexture = function() {
                            return null
                        }, t.prototype.markDirty = function() {
                            this._wasPreviouslyReady = !1
                        }, t.prototype._preBind = function(e, i) {
                            void 0 === i && (i = null);
                            var r = this._scene.getEngine(),
                                n = (null == i ? this.sideOrientation : i) === t.ClockWiseSideOrientation;
                            return r.enableEffect(e || this._effect), r.setState(this.backFaceCulling, this.zOffset, !1, n), n
                        }, t.prototype.bind = function(e, t) {}, t.prototype.bindForSubMesh = function(e, t, i) {}, t.prototype.bindOnlyWorldMatrix = function(e) {}, t.prototype.bindSceneUniformBuffer = function(e, t) {
                            t.bindToEffect(e, "Scene")
                        }, t.prototype.bindView = function(e) {
                            this._useUBO ? this.bindSceneUniformBuffer(e, this.getScene().getSceneUniformBuffer()) : e.setMatrix("view", this.getScene().getViewMatrix())
                        }, t.prototype.bindViewProjection = function(e) {
                            this._useUBO ? this.bindSceneUniformBuffer(e, this.getScene().getSceneUniformBuffer()) : e.setMatrix("viewProjection", this.getScene().getTransformMatrix())
                        }, t.prototype._shouldTurnAlphaTestOn = function(e) {
                            return !this.needAlphaBlendingForMesh(e) && this.needAlphaTesting()
                        }, t.prototype._afterBind = function(e) {
                            if ((this._scene._cachedMaterial = this)._scene._cachedVisibility = e ? e.visibility : 1, this._onBindObservable && e && this._onBindObservable.notifyObservers(e), this.disableDepthWrite) {
                                var t = this._scene.getEngine();
                                this._cachedDepthWriteState = t.getDepthWrite(),
                                    t.setDepthWrite(!1)
                            }
                        }, t.prototype.unbind = function() {
                            this._onUnBindObservable && this._onUnBindObservable.notifyObservers(this), this.disableDepthWrite && this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState)
                        }, t.prototype.getActiveTextures = function() {
                            return []
                        }, t.prototype.hasTexture = function(e) {
                            return !1
                        }, t.prototype.clone = function(e) {
                            return null
                        }, t.prototype.getBindedMeshes = function() {
                            for (var e = new Array, t = 0; t < this._scene.meshes.length; t++) {
                                var i = this._scene.meshes[t];
                                i.material === this && e.push(i)
                            }
                            return e
                        }, t.prototype.forceCompilation = function(t, i, r) {
                            var n = this,
                                o = ae({
                                    clipPlane: !1
                                }, r),
                                s = new e.BaseSubMesh,
                                a = this.getScene(),
                                l = function() {
                                    if (n._scene && n._scene.getEngine()) {
                                        s._materialDefines && (s._materialDefines._renderId = -1);
                                        var r = a.clipPlane;
                                        o.clipPlane && (a.clipPlane = new e.Plane(0, 0, 0, 1)), n.storeEffectOnSubMeshes ? n.isReadyForSubMesh(t, s) ? i && i(n) : setTimeout(l, 16) : n.isReady(t) ? i && i(n) : setTimeout(l, 16), o.clipPlane && (a.clipPlane = r)
                                    }
                                };
                            l()
                        }, t.prototype.forceCompilationAsync = function(e, t) {
                            var i = this;
                            return new Promise(function(r) {
                                i.forceCompilation(e, function() {
                                    r()
                                }, t)
                            })
                        }, t.prototype.markAsDirty = function(e) {
                            e & t.TextureDirtyFlag && this._markAllSubMeshesAsTexturesDirty(), e & t.LightDirtyFlag && this._markAllSubMeshesAsLightsDirty(), e & t.FresnelDirtyFlag && this._markAllSubMeshesAsFresnelDirty(), e & t.AttributesDirtyFlag && this._markAllSubMeshesAsAttributesDirty(), e & t.MiscDirtyFlag && this._markAllSubMeshesAsMiscDirty(), this.getScene().resetCachedMaterial()
                        }, t.prototype._markAllSubMeshesAsDirty = function(e) {
                            for (var t = 0, i = this.getScene().meshes; t < i.length; t++) {
                                var r = i[t];
                                if (r.subMeshes)
                                    for (var n = 0, o = r.subMeshes; n < o.length; n++) {
                                        var s = o[n];
                                        s.getMaterial() === this && s._materialDefines && e(s._materialDefines)
                                    }
                            }
                        }, t.prototype._markAllSubMeshesAsImageProcessingDirty = function() {
                            this._markAllSubMeshesAsDirty(function(e) {
                                return e.markAsImageProcessingDirty()
                            })
                        }, t.prototype._markAllSubMeshesAsTexturesDirty = function() {
                            this._markAllSubMeshesAsDirty(function(e) {
                                return e.markAsTexturesDirty()
                            })
                        }, t.prototype._markAllSubMeshesAsFresnelDirty = function() {
                            this._markAllSubMeshesAsDirty(function(e) {
                                return e.markAsFresnelDirty()
                            })
                        }, t.prototype._markAllSubMeshesAsFresnelAndMiscDirty = function() {
                            this._markAllSubMeshesAsDirty(function(e) {
                                e.markAsFresnelDirty(), e.markAsMiscDirty()
                            })
                        }, t.prototype._markAllSubMeshesAsLightsDirty = function() {
                            this._markAllSubMeshesAsDirty(function(e) {
                                return e.markAsLightDirty()
                            })
                        }, t.prototype._markAllSubMeshesAsAttributesDirty = function() {
                            this._markAllSubMeshesAsDirty(function(e) {
                                return e.markAsAttributesDirty()
                            })
                        }, t.prototype._markAllSubMeshesAsMiscDirty = function() {
                            this._markAllSubMeshesAsDirty(function(e) {
                                return e.markAsMiscDirty()
                            })
                        }, t.prototype._markAllSubMeshesAsTexturesAndMiscDirty = function() {
                            this._markAllSubMeshesAsDirty(function(e) {
                                e.markAsTexturesDirty(), e.markAsMiscDirty()
                            })
                        }, t.prototype.dispose = function(e, t) {
                            this.getScene().stopAnimation(this), this.getScene().freeProcessedMaterials();
                            var i = this._scene.materials.indexOf(this);
                            for (0 <= i && this._scene.materials.splice(i, 1), this._scene.onMaterialRemovedObservable.notifyObservers(this), i = 0; i < this._scene.meshes.length; i++) {
                                var r = this._scene.meshes[i];
                                if (r.material === this && (r.material = null, r.geometry)) {
                                    var n = r.geometry;
                                    if (this.storeEffectOnSubMeshes)
                                        for (var o = 0, s = r.subMeshes; o < s.length; o++) {
                                            var a = s[o];
                                            n._releaseVertexArrayObject(a._materialEffect), e && a._materialEffect && this._scene.getEngine()._releaseEffect(a._materialEffect)
                                        } else n._releaseVertexArrayObject(this._effect)
                                }
                            }
                            this._uniformBuffer.dispose(), e && this._effect && (this.storeEffectOnSubMeshes || this._scene.getEngine()._releaseEffect(this._effect), this._effect = null), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this._onBindObservable && this._onBindObservable.clear(), this._onUnBindObservable && this._onUnBindObservable.clear()
                        }, t.prototype.serialize = function() {
                            return e.SerializationHelper.Serialize(this)
                        }, t.ParseMultiMaterial = function(t, i) {
                            var r = new e.MultiMaterial(t.name, i);
                            r.id = t.id, e.Tags && e.Tags.AddTagsTo(r, t.tags);
                            for (var n = 0; n < t.materials.length; n++) {
                                var o = t.materials[n];
                                o ? r.subMaterials.push(i.getMaterialByID(o)) : r.subMaterials.push(null)
                            }
                            return r
                        }, t.Parse = function(t, i, r) {
                            return t.customType && "BABYLON.StandardMaterial" !== t.customType ? "BABYLON.PBRMaterial" !== t.customType || !t.overloadedAlbedo || (t.customType = "BABYLON.LegacyPBRMaterial", e.LegacyPBRMaterial) ? e.Tools.Instantiate(t.customType).Parse(t, i, r) : void e.Tools.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library.") : e.StandardMaterial.Parse(t, i, r)
                        }, t._TriangleFillMode = 0, t._WireFrameFillMode = 1, t._PointFillMode = 2, t._PointListDrawMode = 3, t._LineListDrawMode = 4, t._LineLoopDrawMode = 5, t._LineStripDrawMode = 6, t._TriangleStripDrawMode = 7, t._TriangleFanDrawMode = 8, t._ClockWiseSideOrientation = 0, t._CounterClockWiseSideOrientation = 1, t.TextureDirtyFlag = 1, t.LightDirtyFlag = 2, t.FresnelDirtyFlag = 4, t.AttributesDirtyFlag = 8, t.MiscDirtyFlag = 16, t.AllDirtyFlag = 31, y([e.serialize()], t.prototype, "id", void 0), y([e.serialize()], t.prototype, "uniqueId", void 0), y([e.serialize()], t.prototype, "name", void 0), y([e.serialize()], t.prototype, "checkReadyOnEveryCall", void 0), y([e.serialize()], t.prototype, "checkReadyOnlyOnce", void 0), y([e.serialize()], t.prototype, "state", void 0), y([e.serialize("alpha")], t.prototype, "_alpha", void 0), y([e.serialize("backFaceCulling")], t.prototype, "_backFaceCulling", void 0), y([e.serialize()], t.prototype, "sideOrientation", void 0), y([e.serialize("alphaMode")], t.prototype, "_alphaMode", void 0), y([e.serialize()], t.prototype, "_needDepthPrePass", void 0), y([e.serialize()], t.prototype, "disableDepthWrite", void 0), y([e.serialize()], t.prototype, "forceDepthWrite", void 0), y([e.serialize()], t.prototype, "separateCullingPass", void 0), y([e.serialize("fogEnabled")], t.prototype, "_fogEnabled", void 0), y([e.serialize()], t.prototype, "pointSize", void 0), y([e.serialize()], t.prototype, "zOffset", void 0), y([e.serialize()], t.prototype, "wireframe", null), y([e.serialize()], t.prototype, "pointsCloud", null), y([e.serialize()], t.prototype, "fillMode", null), t
                    }();
                    e.Material = i
                }($a || ($a = {})), le = $a || ($a = {}), ue = function() {
                    function e(e, t, i) {
                        this._engine = e, this._noUBO = !e.supportsUniformBuffers, this._dynamic = i, this._data = t || [], this._uniformLocations = {}, this._uniformSizes = {}, this._uniformLocationPointer = 0, this._needSync = !1, this._noUBO ? (this.updateMatrix3x3 = this._updateMatrix3x3ForEffect, this.updateMatrix2x2 = this._updateMatrix2x2ForEffect, this.updateFloat = this._updateFloatForEffect, this.updateFloat2 = this._updateFloat2ForEffect, this.updateFloat3 = this._updateFloat3ForEffect, this.updateFloat4 = this._updateFloat4ForEffect, this.updateMatrix = this._updateMatrixForEffect, this.updateVector3 = this._updateVector3ForEffect, this.updateVector4 = this._updateVector4ForEffect, this.updateColor3 = this._updateColor3ForEffect, this.updateColor4 = this._updateColor4ForEffect) : (this._engine._uniformBuffers.push(this), this.updateMatrix3x3 = this._updateMatrix3x3ForUniform, this.updateMatrix2x2 = this._updateMatrix2x2ForUniform, this.updateFloat = this._updateFloatForUniform, this.updateFloat2 = this._updateFloat2ForUniform, this.updateFloat3 = this._updateFloat3ForUniform, this.updateFloat4 = this._updateFloat4ForUniform, this.updateMatrix = this._updateMatrixForUniform, this.updateVector3 = this._updateVector3ForUniform, this.updateVector4 = this._updateVector4ForUniform, this.updateColor3 = this._updateColor3ForUniform, this.updateColor4 = this._updateColor4ForUniform)
                    }
                    return Object.defineProperty(e.prototype, "useUbo", {
                        get: function() {
                            return !this._noUBO
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "isSync", {
                        get: function() {
                            return !this._needSync
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.isDynamic = function() {
                        return void 0 !== this._dynamic
                    }, e.prototype.getData = function() {
                        return this._bufferData
                    }, e.prototype.getBuffer = function() {
                        return this._buffer
                    }, e.prototype._fillAlignment = function(e) {
                        var t;
                        if (t = e <= 2 ? e : 4, this._uniformLocationPointer % t != 0) {
                            var i = this._uniformLocationPointer;
                            this._uniformLocationPointer += t - this._uniformLocationPointer % t;
                            for (var r = this._uniformLocationPointer - i, n = 0; n < r; n++) this._data.push(0)
                        }
                    }, e.prototype.addUniform = function(e, t) {
                        if (!this._noUBO && void 0 === this._uniformLocations[e]) {
                            var i;
                            if (t instanceof Array) t = (i = t).length;
                            else {
                                t = t, i = [];
                                for (var r = 0; r < t; r++) i.push(0)
                            }
                            for (this._fillAlignment(t), this._uniformSizes[e] = t, this._uniformLocations[e] = this._uniformLocationPointer, this._uniformLocationPointer += t, r = 0; r < t; r++) this._data.push(i[r]);
                            this._needSync = !0
                        }
                    }, e.prototype.addMatrix = function(e, t) {
                        this.addUniform(e, Array.prototype.slice.call(t.toArray()))
                    }, e.prototype.addFloat2 = function(e, t, i) {
                        var r = [t, i];
                        this.addUniform(e, r)
                    }, e.prototype.addFloat3 = function(e, t, i, r) {
                        var n = [t, i, r];
                        this.addUniform(e, n)
                    }, e.prototype.addColor3 = function(e, t) {
                        var i = new Array;
                        t.toArray(i), this.addUniform(e, i)
                    }, e.prototype.addColor4 = function(e, t, i) {
                        var r = new Array;
                        t.toArray(r), r.push(i), this.addUniform(e, r)
                    }, e.prototype.addVector3 = function(e, t) {
                        var i = new Array;
                        t.toArray(i), this.addUniform(e, i)
                    }, e.prototype.addMatrix3x3 = function(e) {
                        this.addUniform(e, 12)
                    }, e.prototype.addMatrix2x2 = function(e) {
                        this.addUniform(e, 8)
                    }, e.prototype.create = function() {
                        this._noUBO || this._buffer || (this._fillAlignment(4), this._bufferData = new Float32Array(this._data), this._rebuild(), this._needSync = !0)
                    }, e.prototype._rebuild = function() {
                        this._noUBO || (this._dynamic ? this._buffer = this._engine.createDynamicUniformBuffer(this._bufferData) : this._buffer = this._engine.createUniformBuffer(this._bufferData))
                    }, e.prototype.update = function() {
                        this._buffer ? (this._dynamic || this._needSync) && (this._engine.updateUniformBuffer(this._buffer, this._bufferData), this._needSync = !1) : this.create()
                    }, e.prototype.updateUniform = function(e, t, i) {
                        var r = this._uniformLocations[e];
                        if (void 0 === r) {
                            if (this._buffer) return void le.Tools.Error("Cannot add an uniform after UBO has been created.");
                            this.addUniform(e, i), r = this._uniformLocations[e]
                        }
                        if (this._buffer || this.create(), this._dynamic)
                            for (o = 0; o < i; o++) this._bufferData[r + o] = t[o];
                        else {
                            for (var n = !1, o = 0; o < i; o++) this._bufferData[r + o] !== t[o] && (n = !0, this._bufferData[r + o] = t[o]);
                            this._needSync = this._needSync || n
                        }
                    }, e.prototype._updateMatrix3x3ForUniform = function(t, i) {
                        for (var r = 0; r < 3; r++) e._tempBuffer[4 * r] = i[3 * r], e._tempBuffer[4 * r + 1] = i[3 * r + 1], e._tempBuffer[4 * r + 2] = i[3 * r + 2], e._tempBuffer[4 * r + 3] = 0;
                        this.updateUniform(t, e._tempBuffer, 12)
                    }, e.prototype._updateMatrix3x3ForEffect = function(e, t) {
                        this._currentEffect.setMatrix3x3(e, t)
                    }, e.prototype._updateMatrix2x2ForEffect = function(e, t) {
                        this._currentEffect.setMatrix2x2(e, t)
                    }, e.prototype._updateMatrix2x2ForUniform = function(t, i) {
                        for (var r = 0; r < 2; r++) e._tempBuffer[4 * r] = i[2 * r], e._tempBuffer[4 * r + 1] = i[2 * r + 1], e._tempBuffer[4 * r + 2] = 0, e._tempBuffer[4 * r + 3] = 0;
                        this.updateUniform(t, e._tempBuffer, 8)
                    }, e.prototype._updateFloatForEffect = function(e, t) {
                        this._currentEffect.setFloat(e, t)
                    }, e.prototype._updateFloatForUniform = function(t, i) {
                        e._tempBuffer[0] = i, this.updateUniform(t, e._tempBuffer, 1)
                    }, e.prototype._updateFloat2ForEffect = function(e, t, i, r) {
                        void 0 === r && (r = ""), this._currentEffect.setFloat2(e + r, t, i)
                    }, e.prototype._updateFloat2ForUniform = function(t, i, r, n) {
                        void 0 === n && (n = ""), e._tempBuffer[0] = i, e._tempBuffer[1] = r, this.updateUniform(t, e._tempBuffer, 2)
                    }, e.prototype._updateFloat3ForEffect = function(e, t, i, r, n) {
                        void 0 === n && (n = ""), this._currentEffect.setFloat3(e + n, t, i, r)
                    }, e.prototype._updateFloat3ForUniform = function(t, i, r, n, o) {
                        void 0 === o && (o = ""), e._tempBuffer[0] = i, e._tempBuffer[1] = r, e._tempBuffer[2] = n, this.updateUniform(t, e._tempBuffer, 3)
                    }, e.prototype._updateFloat4ForEffect = function(e, t, i, r, n, o) {
                        void 0 === o && (o = ""), this._currentEffect.setFloat4(e + o, t, i, r, n)
                    }, e.prototype._updateFloat4ForUniform = function(t, i, r, n, o, s) {
                        void 0 === s && (s = ""), e._tempBuffer[0] = i, e._tempBuffer[1] = r, e._tempBuffer[2] = n, e._tempBuffer[3] = o, this.updateUniform(t, e._tempBuffer, 4)
                    }, e.prototype._updateMatrixForEffect = function(e, t) {
                        this._currentEffect.setMatrix(e, t)
                    }, e.prototype._updateMatrixForUniform = function(e, t) {
                        this.updateUniform(e, t.toArray(), 16)
                    }, e.prototype._updateVector3ForEffect = function(e, t) {
                        this._currentEffect.setVector3(e, t)
                    }, e.prototype._updateVector3ForUniform = function(t, i) {
                        i.toArray(e._tempBuffer), this.updateUniform(t, e._tempBuffer, 3)
                    }, e.prototype._updateVector4ForEffect = function(e, t) {
                        this._currentEffect.setVector4(e, t)
                    }, e.prototype._updateVector4ForUniform = function(t, i) {
                        i.toArray(e._tempBuffer), this.updateUniform(t, e._tempBuffer, 4)
                    }, e.prototype._updateColor3ForEffect = function(e, t, i) {
                        void 0 === i && (i = ""), this._currentEffect.setColor3(e + i, t)
                    }, e.prototype._updateColor3ForUniform = function(t, i, r) {
                        void 0 === r && (r = ""), i.toArray(e._tempBuffer), this.updateUniform(t, e._tempBuffer, 3)
                    }, e.prototype._updateColor4ForEffect = function(e, t, i, r) {
                        void 0 === r && (r = ""), this._currentEffect.setColor4(e + r, t, i)
                    }, e.prototype._updateColor4ForUniform = function(t, i, r, n) {
                        void 0 === n && (n = ""), i.toArray(e._tempBuffer), e._tempBuffer[3] = r, this.updateUniform(t, e._tempBuffer, 4)
                    }, e.prototype.setTexture = function(e, t) {
                        this._currentEffect.setTexture(e, t)
                    }, e.prototype.updateUniformDirectly = function(e, t) {
                        this.updateUniform(e, t, t.length), this.update()
                    }, e.prototype.bindToEffect = function(e, t) {
                        this._currentEffect = e, !this._noUBO && this._buffer && e.bindUniformBuffer(this._buffer, t)
                    }, e.prototype.dispose = function() {
                        if (!this._noUBO) {
                            var e = this._engine._uniformBuffers.indexOf(this); - 1 !== e && this._engine._uniformBuffers.splice(e, 1), this._buffer && this._engine._releaseBuffer(this._buffer) && (this._buffer = null)
                        }
                    }, e._MAX_UNIFORM_SIZE = 256, e._tempBuffer = new Float32Array(e._MAX_UNIFORM_SIZE), e
                }(), le.UniformBuffer = ue, ce = $a || ($a = {}), he = function() {
                    function e() {}
                    return e.prototype.set = function(e, t) {
                        switch (t) {
                            case ce.VertexBuffer.PositionKind:
                                this.positions = e;
                                break;
                            case ce.VertexBuffer.NormalKind:
                                this.normals = e;
                                break;
                            case ce.VertexBuffer.TangentKind:
                                this.tangents = e;
                                break;
                            case ce.VertexBuffer.UVKind:
                                this.uvs = e;
                                break;
                            case ce.VertexBuffer.UV2Kind:
                                this.uvs2 = e;
                                break;
                            case ce.VertexBuffer.UV3Kind:
                                this.uvs3 = e;
                                break;
                            case ce.VertexBuffer.UV4Kind:
                                this.uvs4 = e;
                                break;
                            case ce.VertexBuffer.UV5Kind:
                                this.uvs5 = e;
                                break;
                            case ce.VertexBuffer.UV6Kind:
                                this.uvs6 = e;
                                break;
                            case ce.VertexBuffer.ColorKind:
                                this.colors = e;
                                break;
                            case ce.VertexBuffer.MatricesIndicesKind:
                                this.matricesIndices = e;
                                break;
                            case ce.VertexBuffer.MatricesWeightsKind:
                                this.matricesWeights = e;
                                break;
                            case ce.VertexBuffer.MatricesIndicesExtraKind:
                                this.matricesIndicesExtra = e;
                                break;
                            case ce.VertexBuffer.MatricesWeightsExtraKind:
                                this.matricesWeightsExtra = e
                        }
                    }, e.prototype.applyToMesh = function(e, t) {
                        return this._applyTo(e, t), this
                    }, e.prototype.applyToGeometry = function(e, t) {
                        return this._applyTo(e, t), this
                    }, e.prototype.updateMesh = function(e, t, i) {
                        return this._update(e), this
                    }, e.prototype.updateGeometry = function(e, t, i) {
                        return this._update(e), this
                    }, e.prototype._applyTo = function(e, t) {
                        return void 0 === t && (t = !1), this.positions && e.setVerticesData(ce.VertexBuffer.PositionKind, this.positions, t), this.normals && e.setVerticesData(ce.VertexBuffer.NormalKind, this.normals, t), this.tangents && e.setVerticesData(ce.VertexBuffer.TangentKind, this.tangents, t), this.uvs && e.setVerticesData(ce.VertexBuffer.UVKind, this.uvs, t), this.uvs2 && e.setVerticesData(ce.VertexBuffer.UV2Kind, this.uvs2, t), this.uvs3 && e.setVerticesData(ce.VertexBuffer.UV3Kind, this.uvs3, t), this.uvs4 && e.setVerticesData(ce.VertexBuffer.UV4Kind, this.uvs4, t), this.uvs5 && e.setVerticesData(ce.VertexBuffer.UV5Kind, this.uvs5, t), this.uvs6 && e.setVerticesData(ce.VertexBuffer.UV6Kind, this.uvs6, t), this.colors && e.setVerticesData(ce.VertexBuffer.ColorKind, this.colors, t), this.matricesIndices && e.setVerticesData(ce.VertexBuffer.MatricesIndicesKind, this.matricesIndices, t), this.matricesWeights && e.setVerticesData(ce.VertexBuffer.MatricesWeightsKind, this.matricesWeights, t), this.matricesIndicesExtra && e.setVerticesData(ce.VertexBuffer.MatricesIndicesExtraKind, this.matricesIndicesExtra, t), this.matricesWeightsExtra && e.setVerticesData(ce.VertexBuffer.MatricesWeightsExtraKind, this.matricesWeightsExtra, t), this.indices ? e.setIndices(this.indices, null, t) : e.setIndices([], null), this
                    }, e.prototype._update = function(e, t, i) {
                        return this.positions && e.updateVerticesData(ce.VertexBuffer.PositionKind, this.positions, t, i), this.normals && e.updateVerticesData(ce.VertexBuffer.NormalKind, this.normals, t, i), this.tangents && e.updateVerticesData(ce.VertexBuffer.TangentKind, this.tangents, t, i), this.uvs && e.updateVerticesData(ce.VertexBuffer.UVKind, this.uvs, t, i), this.uvs2 && e.updateVerticesData(ce.VertexBuffer.UV2Kind, this.uvs2, t, i), this.uvs3 && e.updateVerticesData(ce.VertexBuffer.UV3Kind, this.uvs3, t, i), this.uvs4 && e.updateVerticesData(ce.VertexBuffer.UV4Kind, this.uvs4, t, i), this.uvs5 && e.updateVerticesData(ce.VertexBuffer.UV5Kind, this.uvs5, t, i), this.uvs6 && e.updateVerticesData(ce.VertexBuffer.UV6Kind, this.uvs6, t, i), this.colors && e.updateVerticesData(ce.VertexBuffer.ColorKind, this.colors, t, i), this.matricesIndices && e.updateVerticesData(ce.VertexBuffer.MatricesIndicesKind, this.matricesIndices, t, i), this.matricesWeights && e.updateVerticesData(ce.VertexBuffer.MatricesWeightsKind, this.matricesWeights, t, i), this.matricesIndicesExtra && e.updateVerticesData(ce.VertexBuffer.MatricesIndicesExtraKind, this.matricesIndicesExtra, t, i), this.matricesWeightsExtra && e.updateVerticesData(ce.VertexBuffer.MatricesWeightsExtraKind, this.matricesWeightsExtra, t, i), this.indices && e.setIndices(this.indices, null), this
                    }, e.prototype.transform = function(e) {
                        var t, i = e.m[0] * e.m[5] * e.m[10] < 0,
                            r = ce.Vector3.Zero();
                        if (this.positions) {
                            var n = ce.Vector3.Zero();
                            for (t = 0; t < this.positions.length; t += 3) ce.Vector3.FromArrayToRef(this.positions, t, n), ce.Vector3.TransformCoordinatesToRef(n, e, r), this.positions[t] = r.x, this.positions[t + 1] = r.y, this.positions[t + 2] = r.z
                        }
                        if (this.normals) {
                            var o = ce.Vector3.Zero();
                            for (t = 0; t < this.normals.length; t += 3) ce.Vector3.FromArrayToRef(this.normals, t, o), ce.Vector3.TransformNormalToRef(o, e, r), this.normals[t] = r.x, this.normals[t + 1] = r.y, this.normals[t + 2] = r.z
                        }
                        if (this.tangents) {
                            var s = ce.Vector4.Zero(),
                                a = ce.Vector4.Zero();
                            for (t = 0; t < this.tangents.length; t += 4) ce.Vector4.FromArrayToRef(this.tangents, t, s), ce.Vector4.TransformNormalToRef(s, e, a), this.tangents[t] = a.x, this.tangents[t + 1] = a.y, this.tangents[t + 2] = a.z, this.tangents[t + 3] = a.w
                        }
                        if (i && this.indices)
                            for (t = 0; t < this.indices.length; t += 3) {
                                var l = this.indices[t + 1];
                                this.indices[t + 1] = this.indices[t + 2], this.indices[t + 2] = l
                            }
                        return this
                    }, e.prototype.merge = function(e, t) {
                        if (void 0 === t && (t = !1), this._validate(), e._validate(), !this.normals != !e.normals || !this.tangents != !e.tangents || !this.uvs != !e.uvs || !this.uvs2 != !e.uvs2 || !this.uvs3 != !e.uvs3 || !this.uvs4 != !e.uvs4 || !this.uvs5 != !e.uvs5 || !this.uvs6 != !e.uvs6 || !this.colors != !e.colors || !this.matricesIndices != !e.matricesIndices || !this.matricesWeights != !e.matricesWeights || !this.matricesIndicesExtra != !e.matricesIndicesExtra || !this.matricesWeightsExtra != !e.matricesWeightsExtra) throw new Error("Cannot merge vertex data that do not have the same set of attributes");
                        if (e.indices) {
                            this.indices || (this.indices = []);
                            var i = this.positions ? this.positions.length / 3 : 0;
                            if (void 0 !== this.indices.BYTES_PER_ELEMENT) {
                                var r = this.indices.length + e.indices.length,
                                    n = t || this.indices instanceof Uint32Array ? new Uint32Array(r) : new Uint16Array(r);
                                n.set(this.indices);
                                for (var o = this.indices.length, s = 0; s < e.indices.length; s++) n[o + s] = e.indices[s] + i;
                                this.indices = n
                            } else
                                for (s = 0; s < e.indices.length; s++) this.indices.push(e.indices[s] + i)
                        }
                        return this.positions = this._mergeElement(this.positions, e.positions), this.normals = this._mergeElement(this.normals, e.normals), this.tangents = this._mergeElement(this.tangents, e.tangents), this.uvs = this._mergeElement(this.uvs, e.uvs), this.uvs2 = this._mergeElement(this.uvs2, e.uvs2), this.uvs3 = this._mergeElement(this.uvs3, e.uvs3), this.uvs4 = this._mergeElement(this.uvs4, e.uvs4), this.uvs5 = this._mergeElement(this.uvs5, e.uvs5), this.uvs6 = this._mergeElement(this.uvs6, e.uvs6), this.colors = this._mergeElement(this.colors, e.colors), this.matricesIndices = this._mergeElement(this.matricesIndices, e.matricesIndices), this.matricesWeights = this._mergeElement(this.matricesWeights, e.matricesWeights), this.matricesIndicesExtra = this._mergeElement(this.matricesIndicesExtra, e.matricesIndicesExtra), this.matricesWeightsExtra = this._mergeElement(this.matricesWeightsExtra, e.matricesWeightsExtra), this
                    }, e.prototype._mergeElement = function(e, t) {
                        if (!e) return t;
                        if (!t) return e;
                        var i = t.length + e.length,
                            r = e instanceof Float32Array,
                            n = t instanceof Float32Array;
                        if (r) {
                            var o = new Float32Array(i);
                            return o.set(e), o.set(t, e.length), o
                        }
                        if (n) {
                            var s = e.slice(0),
                                a = 0;
                            for (i = t.length; a < i; a++) s.push(t[a]);
                            return s
                        }
                        return e.concat(t)
                    }, e.prototype._validate = function() {
                        if (!this.positions) throw new Error("Positions are required");
                        var e = function(e, t) {
                                var i = ce.VertexBuffer.DeduceStride(e);
                                if (t.length % i != 0) throw new Error("The " + e + "s array count must be a multiple of " + i);
                                return t.length / i
                            },
                            t = e(ce.VertexBuffer.PositionKind, this.positions),
                            i = function(i, r) {
                                var n = e(i, r);
                                if (n !== t) throw new Error("The " + i + "s element count (" + n + ") does not match the positions count (" + t + ")")
                            };
                        this.normals && i(ce.VertexBuffer.NormalKind, this.normals), this.tangents && i(ce.VertexBuffer.TangentKind, this.tangents), this.uvs && i(ce.VertexBuffer.UVKind, this.uvs), this.uvs2 && i(ce.VertexBuffer.UV2Kind, this.uvs2), this.uvs3 && i(ce.VertexBuffer.UV3Kind, this.uvs3), this.uvs4 && i(ce.VertexBuffer.UV4Kind, this.uvs4), this.uvs5 && i(ce.VertexBuffer.UV5Kind, this.uvs5), this.uvs6 && i(ce.VertexBuffer.UV6Kind, this.uvs6), this.colors && i(ce.VertexBuffer.ColorKind, this.colors), this.matricesIndices && i(ce.VertexBuffer.MatricesIndicesKind, this.matricesIndices), this.matricesWeights && i(ce.VertexBuffer.MatricesWeightsKind, this.matricesWeights), this.matricesIndicesExtra && i(ce.VertexBuffer.MatricesIndicesExtraKind, this.matricesIndicesExtra), this.matricesWeightsExtra && i(ce.VertexBuffer.MatricesWeightsExtraKind, this.matricesWeightsExtra)
                    }, e.prototype.serialize = function() {
                        var e = this.serialize();
                        return this.positions && (e.positions = this.positions), this.normals && (e.normals = this.normals), this.tangents && (e.tangents = this.tangents), this.uvs && (e.uvs = this.uvs), this.uvs2 && (e.uvs2 = this.uvs2), this.uvs3 && (e.uvs3 = this.uvs3), this.uvs4 && (e.uvs4 = this.uvs4), this.uvs5 && (e.uvs5 = this.uvs5), this.uvs6 && (e.uvs6 = this.uvs6), this.colors && (e.colors = this.colors), this.matricesIndices && (e.matricesIndices = this.matricesIndices, e.matricesIndices._isExpanded = !0), this.matricesWeights && (e.matricesWeights = this.matricesWeights), this.matricesIndicesExtra && (e.matricesIndicesExtra = this.matricesIndicesExtra, e.matricesIndicesExtra._isExpanded = !0), this.matricesWeightsExtra && (e.matricesWeightsExtra = this.matricesWeightsExtra), e.indices = this.indices, e
                    }, e.ExtractFromMesh = function(t, i, r) {
                        return e._ExtractFrom(t, i, r)
                    }, e.ExtractFromGeometry = function(t, i, r) {
                        return e._ExtractFrom(t, i, r)
                    }, e._ExtractFrom = function(t, i, r) {
                        var n = new e;
                        return t.isVerticesDataPresent(ce.VertexBuffer.PositionKind) && (n.positions = t.getVerticesData(ce.VertexBuffer.PositionKind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.NormalKind) && (n.normals = t.getVerticesData(ce.VertexBuffer.NormalKind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.TangentKind) && (n.tangents = t.getVerticesData(ce.VertexBuffer.TangentKind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.UVKind) && (n.uvs = t.getVerticesData(ce.VertexBuffer.UVKind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.UV2Kind) && (n.uvs2 = t.getVerticesData(ce.VertexBuffer.UV2Kind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.UV3Kind) && (n.uvs3 = t.getVerticesData(ce.VertexBuffer.UV3Kind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.UV4Kind) && (n.uvs4 = t.getVerticesData(ce.VertexBuffer.UV4Kind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.UV5Kind) && (n.uvs5 = t.getVerticesData(ce.VertexBuffer.UV5Kind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.UV6Kind) && (n.uvs6 = t.getVerticesData(ce.VertexBuffer.UV6Kind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.ColorKind) && (n.colors = t.getVerticesData(ce.VertexBuffer.ColorKind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.MatricesIndicesKind) && (n.matricesIndices = t.getVerticesData(ce.VertexBuffer.MatricesIndicesKind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.MatricesWeightsKind) && (n.matricesWeights = t.getVerticesData(ce.VertexBuffer.MatricesWeightsKind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.MatricesIndicesExtraKind) && (n.matricesIndicesExtra = t.getVerticesData(ce.VertexBuffer.MatricesIndicesExtraKind, i, r)), t.isVerticesDataPresent(ce.VertexBuffer.MatricesWeightsExtraKind) && (n.matricesWeightsExtra = t.getVerticesData(ce.VertexBuffer.MatricesWeightsExtraKind, i, r)), n.indices = t.getIndices(i, r), n
                    }, e.CreateRibbon = function(t) {
                        var i = t.pathArray,
                            r = t.closeArray || !1,
                            n = t.closePath || !1,
                            o = t.invertUV || !1,
                            s = Math.floor(i[0].length / 2),
                            a = t.offset || s;
                        a = s < a ? s : Math.floor(a);
                        var l, u, c, h, d = 0 === t.sideOrientation ? 0 : t.sideOrientation || ce.Mesh.DEFAULTSIDE,
                            p = t.uvs,
                            f = t.colors,
                            _ = [],
                            m = [],
                            g = [],
                            v = [],
                            y = [],
                            b = [],
                            x = [],
                            T = [],
                            E = [],
                            S = [];
                        if (i.length < 2) {
                            var P = [],
                                A = [];
                            for (c = 0; c < i[0].length - a; c++) P.push(i[0][c]), A.push(i[0][c + a]);
                            i = [P, A]
                        }
                        var C, M, R, O, w, I = 0,
                            D = n ? 1 : 0;
                        for (l = i[0].length, u = 0; u < i.length; u++) {
                            for (x[u] = 0, y[u] = [0], l = l < (M = (C = i[u]).length) ? l : M, h = 0; h < M;) _.push(C[h].x, C[h].y, C[h].z), 0 < h && (R = C[h].subtract(C[h - 1]).length() + x[u], y[u].push(R), x[u] = R), h++;
                            n && (h--, _.push(C[0].x, C[0].y, C[0].z), R = C[h].subtract(C[0]).length() + x[u], y[u].push(R), x[u] = R), E[u] = M + D, S[u] = I, I += M + D
                        }
                        var L, B, F = null,
                            N = null;
                        for (c = 0; c < l + D; c++) {
                            for (T[c] = 0, b[c] = [0], u = 0; u < i.length - 1; u++) O = i[u], w = i[u + 1], c === l ? (F = O[0], N = w[0]) : (F = O[c], N = w[c]), R = N.subtract(F).length() + T[c], b[c].push(R), T[c] = R;
                            r && N && F && (O = i[u], w = i[0], c === l && (N = w[0]), R = N.subtract(F).length() + T[c], T[c] = R)
                        }
                        if (p)
                            for (u = 0; u < p.length; u++) v.push(p[u].x, p[u].y);
                        else
                            for (u = 0; u < i.length; u++)
                                for (c = 0; c < l + D; c++) L = 0 != x[u] ? y[u][c] / x[u] : 0, B = 0 != T[c] ? b[c][u] / T[c] : 0, o ? v.push(B, L) : v.push(L, B);
                        for (var V = u = 0, k = E[u] - 1, U = E[u + 1] - 1, G = k < U ? k : U, z = S[1] - S[0], j = r ? E.length : E.length - 1; V <= G && u < j;) m.push(V, V + z, V + 1), m.push(V + z + 1, V + 1, V + z), (V += 1) === G && (++u == E.length - 1 ? (z = S[0] - S[u], k = E[u] - 1, U = E[0] - 1) : (z = S[u + 1] - S[u], k = E[u] - 1, U = E[u + 1] - 1), V = S[u], G = k < U ? k + V : U + V);
                        if (e.ComputeNormals(_, m, g), n) {
                            var H = 0,
                                W = 0;
                            for (u = 0; u < i.length; u++) H = 3 * S[u], W = u + 1 < i.length ? 3 * (S[u + 1] - 1) : g.length - 3, g[H] = .5 * (g[H] + g[W]), g[H + 1] = .5 * (g[H + 1] + g[W + 1]), g[H + 2] = .5 * (g[H + 2] + g[W + 2]), g[W] = g[H], g[W + 1] = g[H + 1], g[W + 2] = g[H + 2]
                        }
                        e._ComputeSides(d, _, m, g, v, t.frontUVs, t.backUVs);
                        var X = null;
                        if (f) {
                            X = new Float32Array(4 * f.length);
                            for (var Y = 0; Y < f.length; Y++) X[4 * Y] = f[Y].r, X[4 * Y + 1] = f[Y].g, X[4 * Y + 2] = f[Y].b, X[4 * Y + 3] = f[Y].a
                        }
                        var q = new e,
                            K = new Float32Array(_),
                            Q = new Float32Array(g),
                            Z = new Float32Array(v);
                        return q.indices = m, q.positions = K, q.normals = Q, q.uvs = Z, X && q.set(X, ce.VertexBuffer.ColorKind), n && (q._idx = S), q
                    }, e.CreateBox = function(t) {
                        for (var i = [new ce.Vector3(0, 0, 1), new ce.Vector3(0, 0, -1), new ce.Vector3(1, 0, 0), new ce.Vector3(-1, 0, 0), new ce.Vector3(0, 1, 0), new ce.Vector3(0, -1, 0)], r = [], n = [], o = [], s = [], a = t.width || t.size || 1, l = t.height || t.size || 1, u = t.depth || t.size || 1, c = 0 === t.sideOrientation ? 0 : t.sideOrientation || ce.Mesh.DEFAULTSIDE, h = t.faceUV || new Array(6), d = t.faceColors, p = [], f = 0; f < 6; f++) void 0 === h[f] && (h[f] = new ce.Vector4(0, 0, 1, 1)), d && void 0 === d[f] && (d[f] = new ce.Color4(1, 1, 1, 1));
                        for (var _ = new ce.Vector3(a / 2, l / 2, u / 2), m = 0; m < i.length; m++) {
                            var g = i[m],
                                v = new ce.Vector3(g.y, g.z, g.x),
                                y = ce.Vector3.Cross(g, v),
                                b = n.length / 3;
                            r.push(b), r.push(b + 1), r.push(b + 2), r.push(b), r.push(b + 2), r.push(b + 3);
                            var x = g.subtract(v).subtract(y).multiply(_);
                            n.push(x.x, x.y, x.z), o.push(g.x, g.y, g.z), s.push(h[m].z, h[m].w), d && p.push(d[m].r, d[m].g, d[m].b, d[m].a), x = g.subtract(v).add(y).multiply(_), n.push(x.x, x.y, x.z), o.push(g.x, g.y, g.z), s.push(h[m].x, h[m].w), d && p.push(d[m].r, d[m].g, d[m].b, d[m].a), x = g.add(v).add(y).multiply(_), n.push(x.x, x.y, x.z), o.push(g.x, g.y, g.z), s.push(h[m].x, h[m].y), d && p.push(d[m].r, d[m].g, d[m].b, d[m].a), x = g.add(v).subtract(y).multiply(_), n.push(x.x, x.y, x.z), o.push(g.x, g.y, g.z), s.push(h[m].z, h[m].y), d && p.push(d[m].r, d[m].g, d[m].b, d[m].a)
                        }
                        e._ComputeSides(c, n, r, o, s, t.frontUVs, t.backUVs);
                        var T = new e;
                        if (T.indices = r, T.positions = n, T.normals = o, T.uvs = s, d) {
                            var E = c === ce.Mesh.DOUBLESIDE ? p.concat(p) : p;
                            T.colors = E
                        }
                        return T
                    }, e.CreateSphere = function(t) {
                        for (var i = t.segments || 32, r = t.diameterX || t.diameter || 1, n = t.diameterY || t.diameter || 1, o = t.diameterZ || t.diameter || 1, s = t.arc && (t.arc <= 0 || 1 < t.arc) ? 1 : t.arc || 1, a = t.slice && t.slice <= 0 ? 1 : t.slice || 1, l = 0 === t.sideOrientation ? 0 : t.sideOrientation || ce.Mesh.DEFAULTSIDE, u = new ce.Vector3(r / 2, n / 2, o / 2), c = 2 + i, h = 2 * c, d = [], p = [], f = [], _ = [], m = 0; m <= c; m++) {
                            for (var g = m / c, v = g * Math.PI * a, y = 0; y <= h; y++) {
                                var b = y / h,
                                    x = b * Math.PI * 2 * s,
                                    T = ce.Matrix.RotationZ(-v),
                                    E = ce.Matrix.RotationY(x),
                                    S = ce.Vector3.TransformCoordinates(ce.Vector3.Up(), T),
                                    P = ce.Vector3.TransformCoordinates(S, E),
                                    A = P.multiply(u),
                                    C = P.divide(u).normalize();
                                p.push(A.x, A.y, A.z), f.push(C.x, C.y, C.z), _.push(b, g)
                            }
                            if (0 < m)
                                for (var M = p.length / 3, R = M - 2 * (h + 1); R + h + 2 < M; R++) d.push(R), d.push(R + 1), d.push(R + h + 1), d.push(R + h + 1), d.push(R + 1), d.push(R + h + 2)
                        }
                        e._ComputeSides(l, p, d, f, _, t.frontUVs, t.backUVs);
                        var O = new e;
                        return O.indices = d, O.positions = p, O.normals = f, O.uvs = _, O
                    }, e.CreateCylinder = function(t) {
                        var i, r = t.height || 2,
                            n = 0 === t.diameterTop ? 0 : t.diameterTop || t.diameter || 1,
                            o = 0 === t.diameterBottom ? 0 : t.diameterBottom || t.diameter || 1,
                            s = t.tessellation || 24,
                            a = t.subdivisions || 1,
                            l = !!t.hasRings,
                            u = !!t.enclose,
                            c = t.arc && (t.arc <= 0 || 1 < t.arc) ? 1 : t.arc || 1,
                            h = 0 === t.sideOrientation ? 0 : t.sideOrientation || ce.Mesh.DEFAULTSIDE,
                            d = t.faceUV || new Array(3),
                            p = t.faceColors,
                            f = 2 + (1 + (1 !== c && u ? 2 : 0)) * (l ? a : 1);
                        for (i = 0; i < f; i++) p && void 0 === p[i] && (p[i] = new ce.Color4(1, 1, 1, 1));
                        for (i = 0; i < f; i++) d && void 0 === d[i] && (d[i] = new ce.Vector4(0, 0, 1, 1));
                        var _, m, g, v, y, b, x = new Array,
                            T = new Array,
                            E = new Array,
                            S = new Array,
                            P = new Array,
                            A = 2 * Math.PI * c / s,
                            C = (o - n) / 2 / r,
                            M = ce.Vector3.Zero(),
                            R = ce.Vector3.Zero(),
                            O = ce.Vector3.Zero(),
                            w = ce.Vector3.Zero(),
                            I = ce.Vector3.Zero(),
                            D = ce.Axis.Y,
                            L = 1,
                            B = 1,
                            F = 0,
                            N = 0;
                        for (v = 0; v <= a; v++)
                            for (g = ((m = v / a) * (n - o) + o) / 2, L = l && 0 !== v && v !== a ? 2 : 1, b = 0; b < L; b++) {
                                for (l && (B += b), u && (B += 2 * b), y = 0; y <= s; y++) _ = y * A, M.x = Math.cos(-_) * g, M.y = -r / 2 + m * r, M.z = Math.sin(-_) * g, 0 === n && v === a ? (R.x = E[E.length - 3 * (s + 1)], R.y = E[E.length - 3 * (s + 1) + 1], R.z = E[E.length - 3 * (s + 1) + 2]) : (R.x = M.x, R.z = M.z, R.y = Math.sqrt(R.x * R.x + R.z * R.z) * C, R.normalize()), 0 === y && (O.copyFrom(M), w.copyFrom(R)), T.push(M.x, M.y, M.z), E.push(R.x, R.y, R.z), N = l ? F !== B ? d[B].y : d[B].w : d[B].y + (d[B].w - d[B].y) * m, S.push(d[B].x + (d[B].z - d[B].x) * y / s, N), p && P.push(p[B].r, p[B].g, p[B].b, p[B].a);
                                1 !== c && u && (T.push(M.x, M.y, M.z), T.push(0, M.y, 0), T.push(0, M.y, 0), T.push(O.x, O.y, O.z), ce.Vector3.CrossToRef(D, R, I), I.normalize(), E.push(I.x, I.y, I.z, I.x, I.y, I.z), ce.Vector3.CrossToRef(w, D, I), I.normalize(), E.push(I.x, I.y, I.z, I.x, I.y, I.z), N = l ? F !== B ? d[B + 1].y : d[B + 1].w : d[B + 1].y + (d[B + 1].w - d[B + 1].y) * m, S.push(d[B + 1].x, N), S.push(d[B + 1].z, N), N = l ? F !== B ? d[B + 2].y : d[B + 2].w : d[B + 2].y + (d[B + 2].w - d[B + 2].y) * m, S.push(d[B + 2].x, N), S.push(d[B + 2].z, N), p && (P.push(p[B + 1].r, p[B + 1].g, p[B + 1].b, p[B + 1].a), P.push(p[B + 1].r, p[B + 1].g, p[B + 1].b, p[B + 1].a), P.push(p[B + 2].r, p[B + 2].g, p[B + 2].b, p[B + 2].a), P.push(p[B + 2].r, p[B + 2].g, p[B + 2].b, p[B + 2].a))), F !== B && (F = B)
                            }
                        var V = 1 !== c && u ? s + 4 : s;
                        for (B = v = 0; B < a; B++) {
                            var k = 0,
                                U = 0,
                                G = 0,
                                z = 0;
                            for (y = 0; y < s; y++) k = v * (V + 1) + y, U = (v + 1) * (V + 1) + y, G = v * (V + 1) + (y + 1), z = (v + 1) * (V + 1) + (y + 1), x.push(k, U, G), x.push(z, G, U);
                            1 !== c && u && (x.push(k + 2, U + 2, G + 2), x.push(z + 2, G + 2, U + 2), x.push(k + 4, U + 4, G + 4), x.push(z + 4, G + 4, U + 4)), v = l ? v + 2 : v + 1
                        }
                        var j = function(e) {
                            var t = e ? n / 2 : o / 2;
                            if (0 !== t) {
                                var i, a, l, u = e ? d[f - 1] : d[0],
                                    h = null;
                                p && (h = e ? p[f - 1] : p[0]);
                                var _ = T.length / 3,
                                    m = e ? r / 2 : -r / 2,
                                    g = new ce.Vector3(0, m, 0);
                                T.push(g.x, g.y, g.z), E.push(0, e ? 1 : -1, 0), S.push(u.x + .5 * (u.z - u.x), u.y + .5 * (u.w - u.y)), h && P.push(h.r, h.g, h.b, h.a);
                                var v = new ce.Vector2(.5, .5);
                                for (l = 0; l <= s; l++) {
                                    i = 2 * Math.PI * l * c / s;
                                    var y = Math.cos(-i),
                                        b = Math.sin(-i);
                                    a = new ce.Vector3(y * t, m, b * t);
                                    var A = new ce.Vector2(y * v.x + .5, b * v.y + .5);
                                    T.push(a.x, a.y, a.z), E.push(0, e ? 1 : -1, 0), S.push(u.x + (u.z - u.x) * A.x, u.y + (u.w - u.y) * A.y), h && P.push(h.r, h.g, h.b, h.a)
                                }
                                for (l = 0; l < s; l++) e ? (x.push(_), x.push(_ + (l + 2)), x.push(_ + (l + 1))) : (x.push(_), x.push(_ + (l + 1)), x.push(_ + (l + 2)))
                            }
                        };
                        j(!1), j(!0), e._ComputeSides(h, T, x, E, S, t.frontUVs, t.backUVs);
                        var H = new e;
                        return H.indices = x, H.positions = T, H.normals = E, H.uvs = S, p && (H.colors = P), H
                    }, e.CreateTorus = function(t) {
                        for (var i = [], r = [], n = [], o = [], s = t.diameter || 1, a = t.thickness || .5, l = t.tessellation || 16, u = 0 === t.sideOrientation ? 0 : t.sideOrientation || ce.Mesh.DEFAULTSIDE, c = l + 1, h = 0; h <= l; h++)
                            for (var d = h / l, p = h * Math.PI * 2 / l - Math.PI / 2, f = ce.Matrix.Translation(s / 2, 0, 0).multiply(ce.Matrix.RotationY(p)), _ = 0; _ <= l; _++) {
                                var m = 1 - _ / l,
                                    g = _ * Math.PI * 2 / l + Math.PI,
                                    v = Math.cos(g),
                                    y = Math.sin(g),
                                    b = new ce.Vector3(v, y, 0),
                                    x = b.scale(a / 2),
                                    T = new ce.Vector2(d, m);
                                x = ce.Vector3.TransformCoordinates(x, f), b = ce.Vector3.TransformNormal(b, f), r.push(x.x, x.y, x.z), n.push(b.x, b.y, b.z), o.push(T.x, T.y);
                                var E = (h + 1) % c,
                                    S = (_ + 1) % c;
                                i.push(h * c + _), i.push(h * c + S), i.push(E * c + _), i.push(h * c + S), i.push(E * c + S), i.push(E * c + _)
                            }
                        e._ComputeSides(u, r, i, n, o, t.frontUVs, t.backUVs);
                        var P = new e;
                        return P.indices = i, P.positions = r, P.normals = n, P.uvs = o, P
                    }, e.CreateLineSystem = function(t) {
                        for (var i = [], r = [], n = t.lines, o = t.colors, s = [], a = 0, l = 0; l < n.length; l++)
                            for (var u = n[l], c = 0; c < u.length; c++) {
                                if (r.push(u[c].x, u[c].y, u[c].z), o) {
                                    var h = o[l];
                                    s.push(h[c].r, h[c].g, h[c].b, h[c].a)
                                }
                                0 < c && (i.push(a - 1), i.push(a)), a++
                            }
                        var d = new e;
                        return d.indices = i, d.positions = r, o && (d.colors = s), d
                    }, e.CreateDashedLines = function(t) {
                        var i, r, n = t.dashSize || 3,
                            o = t.gapSize || 1,
                            s = t.dashNb || 200,
                            a = t.points,
                            l = new Array,
                            u = new Array,
                            c = ce.Vector3.Zero(),
                            h = 0,
                            d = 0,
                            p = 0,
                            f = 0,
                            _ = 0;
                        for (_ = 0; _ < a.length - 1; _++) a[_ + 1].subtractToRef(a[_], c), h += c.length();
                        for (r = n * (i = h / s) / (n + o), _ = 0; _ < a.length - 1; _++) {
                            a[_ + 1].subtractToRef(a[_], c), d = Math.floor(c.length() / i), c.normalize();
                            for (var m = 0; m < d; m++) p = i * m, l.push(a[_].x + p * c.x, a[_].y + p * c.y, a[_].z + p * c.z), l.push(a[_].x + (p + r) * c.x, a[_].y + (p + r) * c.y, a[_].z + (p + r) * c.z), u.push(f, f + 1), f += 2
                        }
                        var g = new e;
                        return g.positions = l, g.indices = u, g
                    }, e.CreateGround = function(t) {
                        var i, r, n = [],
                            o = [],
                            s = [],
                            a = [],
                            l = t.width || 1,
                            u = t.height || 1,
                            c = t.subdivisionsX || t.subdivisions || 1,
                            h = t.subdivisionsY || t.subdivisions || 1;
                        for (i = 0; i <= h; i++)
                            for (r = 0; r <= c; r++) {
                                var d = new ce.Vector3(r * l / c - l / 2, 0, (h - i) * u / h - u / 2),
                                    p = new ce.Vector3(0, 1, 0);
                                o.push(d.x, d.y, d.z), s.push(p.x, p.y, p.z), a.push(r / c, 1 - i / h)
                            }
                        for (i = 0; i < h; i++)
                            for (r = 0; r < c; r++) n.push(r + 1 + (i + 1) * (c + 1)), n.push(r + 1 + i * (c + 1)), n.push(r + i * (c + 1)), n.push(r + (i + 1) * (c + 1)), n.push(r + 1 + (i + 1) * (c + 1)), n.push(r + i * (c + 1));
                        var f = new e;
                        return f.indices = n, f.positions = o, f.normals = s, f.uvs = a, f
                    }, e.CreateTiledGround = function(t) {
                        var i, r, n, o, s = void 0 !== t.xmin && null !== t.xmin ? t.xmin : -1,
                            a = void 0 !== t.zmin && null !== t.zmin ? t.zmin : -1,
                            l = void 0 !== t.xmax && null !== t.xmax ? t.xmax : 1,
                            u = void 0 !== t.zmax && null !== t.zmax ? t.zmax : 1,
                            c = t.subdivisions || {
                                w: 1,
                                h: 1
                            },
                            h = t.precision || {
                                w: 1,
                                h: 1
                            },
                            d = new Array,
                            p = new Array,
                            f = new Array,
                            _ = new Array;
                        c.h = c.h < 1 ? 1 : c.h, c.w = c.w < 1 ? 1 : c.w, h.w = h.w < 1 ? 1 : h.w, h.h = h.h < 1 ? 1 : h.h;
                        var m = (l - s) / c.w,
                            g = (u - a) / c.h;
                        for (n = 0; n < c.h; n++)
                            for (o = 0; o < c.w; o++) ! function(e, t, n, o) {
                                var s = p.length / 3,
                                    a = h.w + 1;
                                for (i = 0; i < h.h; i++)
                                    for (r = 0; r < h.w; r++) {
                                        var l = [s + r + i * a, s + (r + 1) + i * a, s + (r + 1) + (i + 1) * a, s + r + (i + 1) * a];
                                        d.push(l[1]), d.push(l[2]), d.push(l[3]), d.push(l[0]), d.push(l[1]), d.push(l[3])
                                    }
                                var u = ce.Vector3.Zero(),
                                    c = new ce.Vector3(0, 1, 0);
                                for (i = 0; i <= h.h; i++)
                                    for (u.z = i * (o - t) / h.h + t, r = 0; r <= h.w; r++) u.x = r * (n - e) / h.w + e, u.y = 0, p.push(u.x, u.y, u.z), f.push(c.x, c.y, c.z), _.push(r / h.w, i / h.h)
                            }(s + o * m, a + n * g, s + (o + 1) * m, a + (n + 1) * g);
                        var v = new e;
                        return v.indices = d, v.positions = p, v.normals = f, v.uvs = _, v
                    }, e.CreateGroundFromHeightMap = function(t) {
                        var i, r, n = [],
                            o = [],
                            s = [],
                            a = [],
                            l = t.colorFilter || new ce.Color3(.3, .59, .11),
                            u = t.alphaFilter || 0;
                        for (i = 0; i <= t.subdivisions; i++)
                            for (r = 0; r <= t.subdivisions; r++) {
                                var c = new ce.Vector3(r * t.width / t.subdivisions - t.width / 2, 0, (t.subdivisions - i) * t.height / t.subdivisions - t.height / 2),
                                    h = 4 * (((c.x + t.width / 2) / t.width * (t.bufferWidth - 1) | 0) + ((1 - (c.z + t.height / 2) / t.height) * (t.bufferHeight - 1) | 0) * t.bufferWidth),
                                    d = t.buffer[h] / 255,
                                    p = t.buffer[h + 1] / 255,
                                    f = t.buffer[h + 2] / 255,
                                    _ = t.buffer[h + 3] / 255,
                                    m = d * l.r + p * l.g + f * l.b;
                                c.y = u <= _ ? t.minHeight + (t.maxHeight - t.minHeight) * m : t.minHeight - ce.Epsilon, o.push(c.x, c.y, c.z), s.push(0, 0, 0), a.push(r / t.subdivisions, 1 - i / t.subdivisions)
                            }
                        for (i = 0; i < t.subdivisions; i++)
                            for (r = 0; r < t.subdivisions; r++) {
                                var g = r + 1 + (i + 1) * (t.subdivisions + 1),
                                    v = r + 1 + i * (t.subdivisions + 1),
                                    y = r + i * (t.subdivisions + 1),
                                    b = r + (i + 1) * (t.subdivisions + 1),
                                    x = o[3 * g + 1] >= t.minHeight,
                                    T = o[3 * v + 1] >= t.minHeight,
                                    E = o[3 * y + 1] >= t.minHeight;
                                x && T && E && (n.push(g), n.push(v), n.push(y)), o[3 * b + 1] >= t.minHeight && x && E && (n.push(b), n.push(g), n.push(y))
                            }
                        e.ComputeNormals(o, n, s);
                        var S = new e;
                        return S.indices = n, S.positions = o, S.normals = s, S.uvs = a, S
                    }, e.CreatePlane = function(t) {
                        var i = [],
                            r = [],
                            n = [],
                            o = [],
                            s = t.width || t.size || 1,
                            a = t.height || t.size || 1,
                            l = 0 === t.sideOrientation ? 0 : t.sideOrientation || ce.Mesh.DEFAULTSIDE,
                            u = s / 2,
                            c = a / 2;
                        r.push(-u, -c, 0), n.push(0, 0, -1), o.push(0, 0), r.push(u, -c, 0), n.push(0, 0, -1), o.push(1, 0), r.push(u, c, 0), n.push(0, 0, -1), o.push(1, 1), r.push(-u, c, 0), n.push(0, 0, -1), o.push(0, 1), i.push(0), i.push(1), i.push(2), i.push(0), i.push(2), i.push(3), e._ComputeSides(l, r, i, n, o, t.frontUVs, t.backUVs);
                        var h = new e;
                        return h.indices = i, h.positions = r, h.normals = n, h.uvs = o, h
                    }, e.CreateDisc = function(t) {
                        var i = new Array,
                            r = new Array,
                            n = new Array,
                            o = new Array,
                            s = t.radius || .5,
                            a = t.tessellation || 64,
                            l = t.arc && (t.arc <= 0 || 1 < t.arc) ? 1 : t.arc || 1,
                            u = 0 === t.sideOrientation ? 0 : t.sideOrientation || ce.Mesh.DEFAULTSIDE;
                        i.push(0, 0, 0), o.push(.5, .5);
                        for (var c = 2 * Math.PI * l, h = c / a, d = 0; d < c; d += h) {
                            var p = Math.cos(d),
                                f = Math.sin(d),
                                _ = (p + 1) / 2,
                                m = (1 - f) / 2;
                            i.push(s * p, s * f, 0), o.push(_, m)
                        }
                        1 === l && (i.push(i[3], i[4], i[5]), o.push(o[2], o[3]));
                        for (var g = i.length / 3, v = 1; v < g - 1; v++) r.push(v + 1, 0, v);
                        e.ComputeNormals(i, r, n), e._ComputeSides(u, i, r, n, o, t.frontUVs, t.backUVs);
                        var y = new e;
                        return y.indices = r, y.positions = i, y.normals = n, y.uvs = o, y
                    }, e.CreatePolygon = function(t, i, r, n, o, s) {
                        for (var a = r || new Array(3), l = n, u = [], c = 0; c < 3; c++) void 0 === a[c] && (a[c] = new ce.Vector4(0, 0, 1, 1)), l && void 0 === l[c] && (l[c] = new ce.Color4(1, 1, 1, 1));
                        for (var h = t.getVerticesData(ce.VertexBuffer.PositionKind), d = t.getVerticesData(ce.VertexBuffer.NormalKind), p = t.getVerticesData(ce.VertexBuffer.UVKind), f = t.getIndices(), _ = 0, m = 0, g = 0; g < d.length; g += 3) Math.abs(d[g + 1]) < .001 && (m = 1), Math.abs(d[g + 1] - 1) < .001 && (m = 0), Math.abs(d[g + 1] + 1) < .001 && (m = 2), p[2 * (_ = g / 3)] = (1 - p[2 * _]) * a[m].x + p[2 * _] * a[m].z, p[2 * _ + 1] = (1 - p[2 * _ + 1]) * a[m].y + p[2 * _ + 1] * a[m].w, l && u.push(l[m].r, l[m].g, l[m].b, l[m].a);
                        e._ComputeSides(i, h, f, d, p, o, s);
                        var v = new e;
                        if (v.indices = f, v.positions = h, v.normals = d, v.uvs = p, l) {
                            var y = i === ce.Mesh.DOUBLESIDE ? u.concat(u) : u;
                            v.colors = y
                        }
                        return v
                    }, e.CreateIcoSphere = function(t) {
                        var i, r = t.sideOrientation || ce.Mesh.DEFAULTSIDE,
                            n = t.radius || 1,
                            o = void 0 === t.flat || t.flat,
                            s = t.subdivisions || 4,
                            a = t.radiusX || n,
                            l = t.radiusY || n,
                            u = t.radiusZ || n,
                            c = (1 + Math.sqrt(5)) / 2,
                            h = [-1, c, -0, 1, c, 0, -1, -c, 0, 1, -c, 0, 0, -1, -c, 0, 1, -c, 0, -1, c, 0, 1, c, c, 0, 1, c, 0, -1, -c, 0, 1, -c, 0, -1],
                            d = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 12, 22, 23, 1, 5, 20, 5, 11, 4, 23, 22, 13, 22, 18, 6, 7, 1, 8, 14, 21, 4, 14, 4, 2, 16, 13, 6, 15, 6, 19, 3, 8, 9, 4, 21, 5, 13, 17, 23, 6, 13, 22, 19, 6, 18, 9, 8, 1],
                            p = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 2, 3, 3, 3, 4, 7, 8, 9, 9, 10, 11],
                            f = [5, 1, 3, 1, 6, 4, 0, 0, 5, 3, 4, 2, 2, 2, 4, 0, 2, 0, 1, 1, 6, 0, 6, 2, 0, 4, 3, 3, 4, 4, 3, 1, 4, 2, 4, 4, 0, 2, 1, 1, 2, 2, 3, 3, 1, 3, 2, 4],
                            _ = [0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0],
                            m = new Array,
                            g = new Array,
                            v = new Array,
                            y = new Array,
                            b = 0,
                            x = new Array(3),
                            T = new Array(3);
                        for (i = 0; i < 3; i++) x[i] = ce.Vector3.Zero(), T[i] = ce.Vector2.Zero();
                        for (var E = 0; E < 20; E++) {
                            for (i = 0; i < 3; i++) {
                                var S = d[3 * E + i];
                                x[i].copyFromFloats(h[3 * p[S]], h[3 * p[S] + 1], h[3 * p[S] + 2]), x[i].normalize().scaleInPlace(n), T[i].copyFromFloats(f[2 * S] * (138 / 1024) + 60 / 1024 + _[E] * (-40 / 1024), f[2 * S + 1] * (239 / 1024) + 26 / 1024 + _[E] * (20 / 1024))
                            }
                            for (var P = function(e, t, i, r) {
                                    var n, c = ce.Vector3.Lerp(x[0], x[2], t / s),
                                        h = ce.Vector3.Lerp(x[1], x[2], t / s),
                                        d = s === t ? x[2] : ce.Vector3.Lerp(c, h, e / (s - t));
                                    if (d.normalize(), o) {
                                        var p = ce.Vector3.Lerp(x[0], x[2], r / s),
                                            f = ce.Vector3.Lerp(x[1], x[2], r / s);
                                        n = ce.Vector3.Lerp(p, f, i / (s - r))
                                    } else n = new ce.Vector3(d.x, d.y, d.z);
                                    n.x /= a, n.y /= l, n.z /= u, n.normalize();
                                    var _ = ce.Vector2.Lerp(T[0], T[2], t / s),
                                        E = ce.Vector2.Lerp(T[1], T[2], t / s),
                                        S = s === t ? T[2] : ce.Vector2.Lerp(_, E, e / (s - t));
                                    g.push(d.x * a, d.y * l, d.z * u), v.push(n.x, n.y, n.z), y.push(S.x, S.y), m.push(b), b++
                                }, A = 0; A < s; A++)
                                for (var C = 0; C + A < s; C++) P(C, A, C + 1 / 3, A + 1 / 3), P(C + 1, A, C + 1 / 3, A + 1 / 3), P(C, A + 1, C + 1 / 3, A + 1 / 3), C + A + 1 < s && (P(C + 1, A, C + 2 / 3, A + 2 / 3), P(C + 1, A + 1, C + 2 / 3, A + 2 / 3), P(C, A + 1, C + 2 / 3, A + 2 / 3))
                        }
                        e._ComputeSides(r, g, m, v, y, t.frontUVs, t.backUVs);
                        var M = new e;
                        return M.indices = m, M.positions = g, M.normals = v, M.uvs = y, M
                    }, e.CreatePolyhedron = function(t) {
                        var i = [];
                        i[0] = {
                            vertex: [
                                [0, 0, 1.732051],
                                [1.632993, 0, -.5773503],
                                [-.8164966, 1.414214, -.5773503],
                                [-.8164966, -1.414214, -.5773503]
                            ],
                            face: [
                                [0, 1, 2],
                                [0, 2, 3],
                                [0, 3, 1],
                                [1, 3, 2]
                            ]
                        }, i[1] = {
                            vertex: [
                                [0, 0, 1.414214],
                                [1.414214, 0, 0],
                                [0, 1.414214, 0],
                                [-1.414214, 0, 0],
                                [0, -1.414214, 0],
                                [0, 0, -1.414214]
                            ],
                            face: [
                                [0, 1, 2],
                                [0, 2, 3],
                                [0, 3, 4],
                                [0, 4, 1],
                                [1, 4, 5],
                                [1, 5, 2],
                                [2, 5, 3],
                                [3, 5, 4]
                            ]
                        }, i[2] = {
                            vertex: [
                                [0, 0, 1.070466],
                                [.7136442, 0, .7978784],
                                [-.3568221, .618034, .7978784],
                                [-.3568221, -.618034, .7978784],
                                [.7978784, .618034, .3568221],
                                [.7978784, -.618034, .3568221],
                                [-.9341724, .381966, .3568221],
                                [.1362939, 1, .3568221],
                                [.1362939, -1, .3568221],
                                [-.9341724, -.381966, .3568221],
                                [.9341724, .381966, -.3568221],
                                [.9341724, -.381966, -.3568221],
                                [-.7978784, .618034, -.3568221],
                                [-.1362939, 1, -.3568221],
                                [-.1362939, -1, -.3568221],
                                [-.7978784, -.618034, -.3568221],
                                [.3568221, .618034, -.7978784],
                                [.3568221, -.618034, -.7978784],
                                [-.7136442, 0, -.7978784],
                                [0, 0, -1.070466]
                            ],
                            face: [
                                [0, 1, 4, 7, 2],
                                [0, 2, 6, 9, 3],
                                [0, 3, 8, 5, 1],
                                [1, 5, 11, 10, 4],
                                [2, 7, 13, 12, 6],
                                [3, 9, 15, 14, 8],
                                [4, 10, 16, 13, 7],
                                [5, 8, 14, 17, 11],
                                [6, 12, 18, 15, 9],
                                [10, 11, 17, 19, 16],
                                [12, 13, 16, 19, 18],
                                [14, 15, 18, 19, 17]
                            ]
                        }, i[3] = {
                            vertex: [
                                [0, 0, 1.175571],
                                [1.051462, 0, .5257311],
                                [.3249197, 1, .5257311],
                                [-.8506508, .618034, .5257311],
                                [-.8506508, -.618034, .5257311],
                                [.3249197, -1, .5257311],
                                [.8506508, .618034, -.5257311],
                                [.8506508, -.618034, -.5257311],
                                [-.3249197, 1, -.5257311],
                                [-1.051462, 0, -.5257311],
                                [-.3249197, -1, -.5257311],
                                [0, 0, -1.175571]
                            ],
                            face: [
                                [0, 1, 2],
                                [0, 2, 3],
                                [0, 3, 4],
                                [0, 4, 5],
                                [0, 5, 1],
                                [1, 5, 7],
                                [1, 7, 6],
                                [1, 6, 2],
                                [2, 6, 8],
                                [2, 8, 3],
                                [3, 8, 9],
                                [3, 9, 4],
                                [4, 9, 10],
                                [4, 10, 5],
                                [5, 10, 7],
                                [6, 7, 11],
                                [6, 11, 8],
                                [7, 10, 11],
                                [8, 11, 9],
                                [9, 11, 10]
                            ]
                        }, i[4] = {
                            vertex: [
                                [0, 0, 1.070722],
                                [.7148135, 0, .7971752],
                                [-.104682, .7071068, .7971752],
                                [-.6841528, .2071068, .7971752],
                                [-.104682, -.7071068, .7971752],
                                [.6101315, .7071068, .5236279],
                                [1.04156, .2071068, .1367736],
                                [.6101315, -.7071068, .5236279],
                                [-.3574067, 1, .1367736],
                                [-.7888348, -.5, .5236279],
                                [-.9368776, .5, .1367736],
                                [-.3574067, -1, .1367736],
                                [.3574067, 1, -.1367736],
                                [.9368776, -.5, -.1367736],
                                [.7888348, .5, -.5236279],
                                [.3574067, -1, -.1367736],
                                [-.6101315, .7071068, -.5236279],
                                [-1.04156, -.2071068, -.1367736],
                                [-.6101315, -.7071068, -.5236279],
                                [.104682, .7071068, -.7971752],
                                [.6841528, -.2071068, -.7971752],
                                [.104682, -.7071068, -.7971752],
                                [-.7148135, 0, -.7971752],
                                [0, 0, -1.070722]
                            ],
                            face: [
                                [0, 2, 3],
                                [1, 6, 5],
                                [4, 9, 11],
                                [7, 15, 13],
                                [8, 16, 10],
                                [12, 14, 19],
                                [17, 22, 18],
                                [20, 21, 23],
                                [0, 1, 5, 2],
                                [0, 3, 9, 4],
                                [0, 4, 7, 1],
                                [1, 7, 13, 6],
                                [2, 5, 12, 8],
                                [2, 8, 10, 3],
                                [3, 10, 17, 9],
                                [4, 11, 15, 7],
                                [5, 6, 14, 12],
                                [6, 13, 20, 14],
                                [8, 12, 19, 16],
                                [9, 17, 18, 11],
                                [10, 16, 22, 17],
                                [11, 18, 21, 15],
                                [13, 15, 21, 20],
                                [14, 20, 23, 19],
                                [16, 19, 23, 22],
                                [18, 22, 23, 21]
                            ]
                        }, i[5] = {
                            vertex: [
                                [0, 0, 1.322876],
                                [1.309307, 0, .1889822],
                                [-.9819805, .8660254, .1889822],
                                [.1636634, -1.299038, .1889822],
                                [.3273268, .8660254, -.9449112],
                                [-.8183171, -.4330127, -.9449112]
                            ],
                            face: [
                                [0, 3, 1],
                                [2, 4, 5],
                                [0, 1, 4, 2],
                                [0, 2, 5, 3],
                                [1, 3, 5, 4]
                            ]
                        }, i[6] = {
                            vertex: [
                                [0, 0, 1.159953],
                                [1.013464, 0, .5642542],
                                [-.3501431, .9510565, .5642542],
                                [-.7715208, -.6571639, .5642542],
                                [.6633206, .9510565, -.03144481],
                                [.8682979, -.6571639, -.3996071],
                                [-1.121664, .2938926, -.03144481],
                                [-.2348831, -1.063314, -.3996071],
                                [.5181548, .2938926, -.9953061],
                                [-.5850262, -.112257, -.9953061]
                            ],
                            face: [
                                [0, 1, 4, 2],
                                [0, 2, 6, 3],
                                [1, 5, 8, 4],
                                [3, 6, 9, 7],
                                [5, 7, 9, 8],
                                [0, 3, 7, 5, 1],
                                [2, 4, 8, 9, 6]
                            ]
                        }, i[7] = {
                            vertex: [
                                [0, 0, 1.118034],
                                [.8944272, 0, .6708204],
                                [-.2236068, .8660254, .6708204],
                                [-.7826238, -.4330127, .6708204],
                                [.6708204, .8660254, .2236068],
                                [1.006231, -.4330127, -.2236068],
                                [-1.006231, .4330127, .2236068],
                                [-.6708204, -.8660254, -.2236068],
                                [.7826238, .4330127, -.6708204],
                                [.2236068, -.8660254, -.6708204],
                                [-.8944272, 0, -.6708204],
                                [0, 0, -1.118034]
                            ],
                            face: [
                                [0, 1, 4, 2],
                                [0, 2, 6, 3],
                                [1, 5, 8, 4],
                                [3, 6, 10, 7],
                                [5, 9, 11, 8],
                                [7, 10, 11, 9],
                                [0, 3, 7, 9, 5, 1],
                                [2, 4, 8, 11, 10, 6]
                            ]
                        }, i[8] = {
                            vertex: [
                                [-.729665, .670121, .319155],
                                [-.655235, -.29213, -.754096],
                                [-.093922, -.607123, .537818],
                                [.702196, .595691, .485187],
                                [.776626, -.36656, -.588064]
                            ],
                            face: [
                                [1, 4, 2],
                                [0, 1, 2],
                                [3, 0, 2],
                                [4, 3, 2],
                                [4, 1, 0, 3]
                            ]
                        }, i[9] = {
                            vertex: [
                                [-.868849, -.100041, .61257],
                                [-.329458, .976099, .28078],
                                [-.26629, -.013796, -.477654],
                                [-.13392, -1.034115, .229829],
                                [.738834, .707117, -.307018],
                                [.859683, -.535264, -.338508]
                            ],
                            face: [
                                [3, 0, 2],
                                [5, 3, 2],
                                [4, 5, 2],
                                [1, 4, 2],
                                [0, 1, 2],
                                [0, 3, 5, 4, 1]
                            ]
                        }, i[10] = {
                            vertex: [
                                [-.610389, .243975, .531213],
                                [-.187812, -.48795, -.664016],
                                [-.187812, .9759, -.664016],
                                [.187812, -.9759, .664016],
                                [.798201, .243975, .132803]
                            ],
                            face: [
                                [1, 3, 0],
                                [3, 4, 0],
                                [3, 1, 4],
                                [0, 2, 1],
                                [0, 4, 2],
                                [2, 4, 1]
                            ]
                        }, i[11] = {
                            vertex: [
                                [-1.028778, .392027, -.048786],
                                [-.640503, -.646161, .621837],
                                [-.125162, -.395663, -.540059],
                                [.004683, .888447, -.651988],
                                [.125161, .395663, .540059],
                                [.632925, -.791376, .433102],
                                [1.031672, .157063, -.354165]
                            ],
                            face: [
                                [3, 2, 0],
                                [2, 1, 0],
                                [2, 5, 1],
                                [0, 4, 3],
                                [0, 1, 4],
                                [4, 1, 5],
                                [2, 3, 6],
                                [3, 4, 6],
                                [5, 2, 6],
                                [4, 5, 6]
                            ]
                        }, i[12] = {
                            vertex: [
                                [-.669867, .334933, -.529576],
                                [-.669867, .334933, .529577],
                                [-.4043, 1.212901, 0],
                                [-.334933, -.669867, -.529576],
                                [-.334933, -.669867, .529577],
                                [.334933, .669867, -.529576],
                                [.334933, .669867, .529577],
                                [.4043, -1.212901, 0],
                                [.669867, -.334933, -.529576],
                                [.669867, -.334933, .529577]
                            ],
                            face: [
                                [8, 9, 7],
                                [6, 5, 2],
                                [3, 8, 7],
                                [5, 0, 2],
                                [4, 3, 7],
                                [0, 1, 2],
                                [9, 4, 7],
                                [1, 6, 2],
                                [9, 8, 5, 6],
                                [8, 3, 0, 5],
                                [3, 4, 1, 0],
                                [4, 9, 6, 1]
                            ]
                        }, i[13] = {
                            vertex: [
                                [-.931836, .219976, -.264632],
                                [-.636706, .318353, .692816],
                                [-.613483, -.735083, -.264632],
                                [-.326545, .979634, 0],
                                [-.318353, -.636706, .692816],
                                [-.159176, .477529, -.856368],
                                [.159176, -.477529, -.856368],
                                [.318353, .636706, .692816],
                                [.326545, -.979634, 0],
                                [.613482, .735082, -.264632],
                                [.636706, -.318353, .692816],
                                [.931835, -.219977, -.264632]
                            ],
                            face: [
                                [11, 10, 8],
                                [7, 9, 3],
                                [6, 11, 8],
                                [9, 5, 3],
                                [2, 6, 8],
                                [5, 0, 3],
                                [4, 2, 8],
                                [0, 1, 3],
                                [10, 4, 8],
                                [1, 7, 3],
                                [10, 11, 9, 7],
                                [11, 6, 5, 9],
                                [6, 2, 0, 5],
                                [2, 4, 1, 0],
                                [4, 10, 7, 1]
                            ]
                        }, i[14] = {
                            vertex: [
                                [-.93465, .300459, -.271185],
                                [-.838689, -.260219, -.516017],
                                [-.711319, .717591, .128359],
                                [-.710334, -.156922, .080946],
                                [-.599799, .556003, -.725148],
                                [-.503838, -.004675, -.969981],
                                [-.487004, .26021, .48049],
                                [-.460089, -.750282, -.512622],
                                [-.376468, .973135, -.325605],
                                [-.331735, -.646985, .084342],
                                [-.254001, .831847, .530001],
                                [-.125239, -.494738, -.966586],
                                [.029622, .027949, .730817],
                                [.056536, -.982543, -.262295],
                                [.08085, 1.087391, .076037],
                                [.125583, -.532729, .485984],
                                [.262625, .599586, .780328],
                                [.391387, -.726999, -.716259],
                                [.513854, -.868287, .139347],
                                [.597475, .85513, .326364],
                                [.641224, .109523, .783723],
                                [.737185, -.451155, .538891],
                                [.848705, -.612742, -.314616],
                                [.976075, .365067, .32976],
                                [1.072036, -.19561, .084927]
                            ],
                            face: [
                                [15, 18, 21],
                                [12, 20, 16],
                                [6, 10, 2],
                                [3, 0, 1],
                                [9, 7, 13],
                                [2, 8, 4, 0],
                                [0, 4, 5, 1],
                                [1, 5, 11, 7],
                                [7, 11, 17, 13],
                                [13, 17, 22, 18],
                                [18, 22, 24, 21],
                                [21, 24, 23, 20],
                                [20, 23, 19, 16],
                                [16, 19, 14, 10],
                                [10, 14, 8, 2],
                                [15, 9, 13, 18],
                                [12, 15, 21, 20],
                                [6, 12, 16, 10],
                                [3, 6, 2, 0],
                                [9, 3, 1, 7],
                                [9, 15, 12, 6, 3],
                                [22, 17, 11, 5, 4, 8, 14, 19, 23, 24]
                            ]
                        };
                        var r, n, o, s, a, l, u = t.type && (t.type < 0 || t.type >= i.length) ? 0 : t.type || 0,
                            c = t.size,
                            h = t.sizeX || c || 1,
                            d = t.sizeY || c || 1,
                            p = t.sizeZ || c || 1,
                            f = t.custom || i[u],
                            _ = f.face.length,
                            m = t.faceUV || new Array(_),
                            g = t.faceColors,
                            v = void 0 === t.flat || t.flat,
                            y = 0 === t.sideOrientation ? 0 : t.sideOrientation || ce.Mesh.DEFAULTSIDE,
                            b = new Array,
                            x = new Array,
                            T = new Array,
                            E = new Array,
                            S = new Array,
                            P = 0,
                            A = 0,
                            C = new Array,
                            M = 0,
                            R = 0;
                        if (v)
                            for (R = 0; R < _; R++) g && void 0 === g[R] && (g[R] = new ce.Color4(1, 1, 1, 1)), m && void 0 === m[R] && (m[R] = new ce.Vector4(0, 0, 1, 1));
                        if (v)
                            for (R = 0; R < _; R++) {
                                var O = f.face[R].length;
                                for (o = 2 * Math.PI / O, s = .5 * Math.tan(o / 2), a = .5, M = 0; M < O; M++) b.push(f.vertex[f.face[R][M]][0] * h, f.vertex[f.face[R][M]][1] * d, f.vertex[f.face[R][M]][2] * p), C.push(P), P++, r = m[R].x + (m[R].z - m[R].x) * (.5 + s), n = m[R].y + (m[R].w - m[R].y) * (a - .5), E.push(r, n), l = s * Math.cos(o) - a * Math.sin(o), a = s * Math.sin(o) + a * Math.cos(o), s = l, g && S.push(g[R].r, g[R].g, g[R].b, g[R].a);
                                for (M = 0; M < O - 2; M++) x.push(C[0 + A], C[M + 2 + A], C[M + 1 + A]);
                                A += O
                            } else {
                                for (M = 0; M < f.vertex.length; M++) b.push(f.vertex[M][0] * h, f.vertex[M][1] * d, f.vertex[M][2] * p), E.push(0, 0);
                                for (R = 0; R < _; R++)
                                    for (M = 0; M < f.face[R].length - 2; M++) x.push(f.face[R][0], f.face[R][M + 2], f.face[R][M + 1])
                            }
                        e.ComputeNormals(b, x, T), e._ComputeSides(y, b, x, T, E, t.frontUVs, t.backUVs);
                        var w = new e;
                        return w.positions = b, w.indices = x, w.normals = T, w.uvs = E, g && v && (w.colors = S), w
                    }, e.CreateTorusKnot = function(t) {
                        var i, r, n = new Array,
                            o = new Array,
                            s = new Array,
                            a = new Array,
                            l = t.radius || 2,
                            u = t.tube || .5,
                            c = t.radialSegments || 32,
                            h = t.tubularSegments || 32,
                            d = t.p || 2,
                            p = t.q || 3,
                            f = 0 === t.sideOrientation ? 0 : t.sideOrientation || ce.Mesh.DEFAULTSIDE,
                            _ = function(e) {
                                var t = Math.cos(e),
                                    i = Math.sin(e),
                                    r = p / d * e,
                                    n = Math.cos(r),
                                    o = l * (2 + n) * .5 * t,
                                    s = l * (2 + n) * i * .5,
                                    a = l * Math.sin(r) * .5;
                                return new ce.Vector3(o, s, a)
                            };
                        for (i = 0; i <= c; i++) {
                            var m = i % c / c * 2 * d * Math.PI,
                                g = _(m),
                                v = _(m + .01),
                                y = v.subtract(g),
                                b = v.add(g),
                                x = ce.Vector3.Cross(y, b);
                            for (b = ce.Vector3.Cross(x, y), x.normalize(), b.normalize(), r = 0; r < h; r++) {
                                var T = r % h / h * 2 * Math.PI,
                                    E = -u * Math.cos(T),
                                    S = u * Math.sin(T);
                                o.push(g.x + E * b.x + S * x.x), o.push(g.y + E * b.y + S * x.y), o.push(g.z + E * b.z + S * x.z), a.push(i / c), a.push(r / h)
                            }
                        }
                        for (i = 0; i < c; i++)
                            for (r = 0; r < h; r++) {
                                var P = (r + 1) % h,
                                    A = i * h + r,
                                    C = (i + 1) * h + r,
                                    M = (i + 1) * h + P,
                                    R = i * h + P;
                                n.push(R), n.push(C), n.push(A), n.push(R), n.push(M), n.push(C)
                            }
                        e.ComputeNormals(o, n, s), e._ComputeSides(f, o, n, s, a, t.frontUVs, t.backUVs);
                        var O = new e;
                        return O.indices = n, O.positions = o, O.normals = s, O.uvs = a, O
                    }, e.ComputeNormals = function(e, t, i, r) {
                        var n = 0,
                            o = 0,
                            s = 0,
                            a = 0,
                            l = 0,
                            u = 0,
                            c = 0,
                            h = 0,
                            d = 0,
                            p = 0,
                            f = 0,
                            _ = 0,
                            m = 0,
                            g = 0,
                            v = 0,
                            y = 0,
                            b = 0,
                            x = 0,
                            T = 0,
                            E = 0,
                            S = !1,
                            P = !1,
                            A = !1,
                            C = !1,
                            M = 1,
                            R = 0,
                            O = null;
                        if (r && (S = !!r.facetNormals, P = !!r.facetPositions, A = !!r.facetPartitioning, M = !0 === r.useRightHandedSystem ? -1 : 1, R = r.ratio || 0, C = !!r.depthSort, O = r.distanceTo, C)) {
                            void 0 === O && (O = ce.Vector3.Zero());
                            var w = r.depthSortedFacets
                        }
                        var I = 0,
                            D = 0,
                            L = 0,
                            B = 0;
                        if (A && r && r.bbSize) {
                            var F = 0,
                                N = 0,
                                V = 0,
                                k = 0,
                                U = 0,
                                G = 0,
                                z = 0,
                                j = 0,
                                H = 0,
                                W = 0,
                                X = 0,
                                Y = 0,
                                q = 0,
                                K = 0,
                                Q = 0,
                                Z = 0,
                                J = r.bbSize.x > r.bbSize.y ? r.bbSize.x : r.bbSize.y;
                            J = J > r.bbSize.z ? J : r.bbSize.z, I = r.subDiv.X * R / r.bbSize.x, D = r.subDiv.Y * R / r.bbSize.y, L = r.subDiv.Z * R / r.bbSize.z, B = r.subDiv.max * r.subDiv.max, r.facetPartitioning.length = 0
                        }
                        for (n = 0; n < e.length; n++) i[n] = 0;
                        var $ = t.length / 3 | 0;
                        for (n = 0; n < $; n++) {
                            if (m = 1 + (_ = 3 * t[3 * n]), g = _ + 2, y = 1 + (v = 3 * t[3 * n + 1]), b = v + 2, T = 1 + (x = 3 * t[3 * n + 2]), E = x + 2, o = e[_] - e[v], s = e[m] - e[y], a = e[g] - e[b], l = e[x] - e[v], u = e[T] - e[y], h = M * (s * (c = e[E] - e[b]) - a * u), d = M * (a * l - o * c), p = M * (o * u - s * l), h /= f = 0 === (f = Math.sqrt(h * h + d * d + p * p)) ? 1 : f, d /= f, p /= f, S && r && (r.facetNormals[n].x = h, r.facetNormals[n].y = d, r.facetNormals[n].z = p), P && r && (r.facetPositions[n].x = (e[_] + e[v] + e[x]) / 3, r.facetPositions[n].y = (e[m] + e[y] + e[T]) / 3, r.facetPositions[n].z = (e[g] + e[b] + e[E]) / 3), A && r && (F = Math.floor((r.facetPositions[n].x - r.bInfo.minimum.x * R) * I), N = Math.floor((r.facetPositions[n].y - r.bInfo.minimum.y * R) * D), V = Math.floor((r.facetPositions[n].z - r.bInfo.minimum.z * R) * L), k = Math.floor((e[_] - r.bInfo.minimum.x * R) * I), U = Math.floor((e[m] - r.bInfo.minimum.y * R) * D), G = Math.floor((e[g] - r.bInfo.minimum.z * R) * L), z = Math.floor((e[v] - r.bInfo.minimum.x * R) * I), j = Math.floor((e[y] - r.bInfo.minimum.y * R) * D), H = Math.floor((e[b] - r.bInfo.minimum.z * R) * L), W = Math.floor((e[x] - r.bInfo.minimum.x * R) * I), X = Math.floor((e[T] - r.bInfo.minimum.y * R) * D), Y = Math.floor((e[E] - r.bInfo.minimum.z * R) * L), K = k + r.subDiv.max * U + B * G, Q = z + r.subDiv.max * j + B * H, Z = W + r.subDiv.max * X + B * Y, q = F + r.subDiv.max * N + B * V, r.facetPartitioning[q] = r.facetPartitioning[q] ? r.facetPartitioning[q] : new Array, r.facetPartitioning[K] = r.facetPartitioning[K] ? r.facetPartitioning[K] : new Array, r.facetPartitioning[Q] = r.facetPartitioning[Q] ? r.facetPartitioning[Q] : new Array, r.facetPartitioning[Z] = r.facetPartitioning[Z] ? r.facetPartitioning[Z] : new Array, r.facetPartitioning[K].push(n), Q != K && r.facetPartitioning[Q].push(n), Z != Q && Z != K && r.facetPartitioning[Z].push(n), q != K && q != Q && q != Z && r.facetPartitioning[q].push(n)), C && r && r.facetPositions) {
                                var ee = w[n];
                                ee.ind = 3 * n, ee.sqDistance = ce.Vector3.DistanceSquared(r.facetPositions[n], O)
                            }
                            i[_] += h, i[m] += d, i[g] += p, i[v] += h, i[y] += d, i[b] += p, i[x] += h, i[T] += d, i[E] += p
                        }
                        for (n = 0; n < i.length / 3; n++) h = i[3 * n], d = i[3 * n + 1], p = i[3 * n + 2], h /= f = 0 === (f = Math.sqrt(h * h + d * d + p * p)) ? 1 : f, d /= f, p /= f, i[3 * n] = h, i[3 * n + 1] = d, i[3 * n + 2] = p
                    }, e._ComputeSides = function(e, t, i, r, n, o, s) {
                        var a, l, u = i.length,
                            c = r.length;
                        switch (e = e || ce.Mesh.DEFAULTSIDE) {
                            case ce.Mesh.FRONTSIDE:
                                break;
                            case ce.Mesh.BACKSIDE:
                                var h;
                                for (a = 0; a < u; a += 3) h = i[a], i[a] = i[a + 2], i[a + 2] = h;
                                for (l = 0; l < c; l++) r[l] = -r[l];
                                break;
                            case ce.Mesh.DOUBLESIDE:
                                for (var d = t.length, p = d / 3, f = 0; f < d; f++) t[d + f] = t[f];
                                for (a = 0; a < u; a += 3) i[a + u] = i[a + 2] + p, i[a + 1 + u] = i[a + 1] + p, i[a + 2 + u] = i[a] + p;
                                for (l = 0; l < c; l++) r[c + l] = -r[l];
                                var _ = n.length,
                                    m = 0;
                                for (m = 0; m < _; m++) n[m + _] = n[m];
                                for (o = o || new ce.Vector4(0, 0, 1, 1), s = s || new ce.Vector4(0, 0, 1, 1), a = m = 0; a < _ / 2; a++) n[m] = o.x + (o.z - o.x) * n[m], n[m + 1] = o.y + (o.w - o.y) * n[m + 1], n[m + _] = s.x + (s.z - s.x) * n[m + _], n[m + _ + 1] = s.y + (s.w - s.y) * n[m + _ + 1], m += 2
                        }
                    }, e.ImportVertexData = function(t, i) {
                        var r = new e,
                            n = t.positions;
                        n && r.set(n, ce.VertexBuffer.PositionKind);
                        var o = t.normals;
                        o && r.set(o, ce.VertexBuffer.NormalKind);
                        var s = t.tangents;
                        s && r.set(s, ce.VertexBuffer.TangentKind);
                        var a = t.uvs;
                        a && r.set(a, ce.VertexBuffer.UVKind);
                        var l = t.uv2s;
                        l && r.set(l, ce.VertexBuffer.UV2Kind);
                        var u = t.uv3s;
                        u && r.set(u, ce.VertexBuffer.UV3Kind);
                        var c = t.uv4s;
                        c && r.set(c, ce.VertexBuffer.UV4Kind);
                        var h = t.uv5s;
                        h && r.set(h, ce.VertexBuffer.UV5Kind);
                        var d = t.uv6s;
                        d && r.set(d, ce.VertexBuffer.UV6Kind);
                        var p = t.colors;
                        p && r.set(ce.Color4.CheckColors4(p, n.length / 3), ce.VertexBuffer.ColorKind);
                        var f = t.matricesIndices;
                        f && r.set(f, ce.VertexBuffer.MatricesIndicesKind);
                        var _ = t.matricesWeights;
                        _ && r.set(_, ce.VertexBuffer.MatricesWeightsKind);
                        var m = t.indices;
                        m && (r.indices = m), i.setAllVerticesData(r, t.updatable)
                    }, e
                }(), ce.VertexData = he,
                function(e) {
                    var t = function() {
                            function t(t, i, r, n, o) {
                                void 0 === n && (n = !1), void 0 === o && (o = null), this.delayLoadState = e.Engine.DELAYLOADSTATE_NONE, this._totalVertices = 0, this._isDisposed = !1, this._indexBufferIsUpdatable = !1, this.id = t, this._engine = i.getEngine(), this._meshes = [], this._scene = i, this._vertexBuffers = {}, this._indices = [], this._updatable = n, r ? this.setAllVerticesData(r, n) : (this._totalVertices = 0, this._indices = []), this._engine.getCaps().vertexArrayObject && (this._vertexArrayObjects = {}), o && ("LinesMesh" === o.getClassName() && (this.boundingBias = new e.Vector2(0, o.intersectionThreshold), this._updateExtend()), this.applyToMesh(o), o.computeWorldMatrix(!0))
                            }
                            return Object.defineProperty(t.prototype, "boundingBias", {
                                get: function() {
                                    return this._boundingBias
                                },
                                set: function(e) {
                                    if (this._boundingBias) {
                                        if (this._boundingBias.equals(e)) return;
                                        this._boundingBias.copyFrom(e)
                                    } else this._boundingBias = e.clone();
                                    this._updateBoundingInfo(!0, null)
                                },
                                enumerable: !0,
                                configurable: !0
                            }), t.CreateGeometryForMesh = function(e) {
                                var i = new t(t.RandomId(), e.getScene());
                                return i.applyToMesh(e), i
                            }, Object.defineProperty(t.prototype, "extend", {
                                get: function() {
                                    return this._extend
                                },
                                enumerable: !0,
                                configurable: !0
                            }), t.prototype.getScene = function() {
                                return this._scene
                            }, t.prototype.getEngine = function() {
                                return this._engine
                            }, t.prototype.isReady = function() {
                                return this.delayLoadState === e.Engine.DELAYLOADSTATE_LOADED || this.delayLoadState === e.Engine.DELAYLOADSTATE_NONE
                            }, Object.defineProperty(t.prototype, "doNotSerialize", {
                                get: function() {
                                    for (var e = 0; e < this._meshes.length; e++)
                                        if (!this._meshes[e].doNotSerialize) return !1;
                                    return !0
                                },
                                enumerable: !0,
                                configurable: !0
                            }), t.prototype._rebuild = function() {
                                for (var e in this._vertexArrayObjects && (this._vertexArrayObjects = {}), 0 !== this._meshes.length && this._indices && (this._indexBuffer = this._engine.createIndexBuffer(this._indices)), this._vertexBuffers) this._vertexBuffers[e]._rebuild()
                            }, t.prototype.setAllVerticesData = function(e, t) {
                                e.applyToGeometry(this, t), this.notifyUpdate()
                            }, t.prototype.setVerticesData = function(t, i, r, n) {
                                void 0 === r && (r = !1);
                                var o = new e.VertexBuffer(this._engine, i, t, r, 0 === this._meshes.length, n);
                                this.setVerticesBuffer(o)
                            }, t.prototype.removeVerticesData = function(e) {
                                this._vertexBuffers[e] && (this._vertexBuffers[e].dispose(), delete this._vertexBuffers[e])
                            }, t.prototype.setVerticesBuffer = function(t, i) {
                                void 0 === i && (i = null);
                                var r = t.getKind();
                                if (this._vertexBuffers[r] && this._vertexBuffers[r].dispose(), this._vertexBuffers[r] = t, r === e.VertexBuffer.PositionKind) {
                                    var n = t.getData();
                                    null != i ? this._totalVertices = i : null != n && (this._totalVertices = n.length / (t.byteStride / 4)), this._updateExtend(n), this._resetPointsArrayCache();
                                    for (var o = this._meshes, s = o.length, a = 0; a < s; a++) {
                                        var l = o[a];
                                        l._boundingInfo = new e.BoundingInfo(this._extend.minimum, this._extend.maximum), l._createGlobalSubMesh(!1), l.computeWorldMatrix(!0)
                                    }
                                }
                                this.notifyUpdate(r), this._vertexArrayObjects && (this._disposeVertexArrayObjects(), this._vertexArrayObjects = {})
                            }, t.prototype.updateVerticesDataDirectly = function(e, t, i, r) {
                                void 0 === r && (r = !1);
                                var n = this.getVertexBuffer(e);
                                n && (n.updateDirectly(t, i, r), this.notifyUpdate(e))
                            }, t.prototype.updateVerticesData = function(t, i, r) {
                                void 0 === r && (r = !1);
                                var n = this.getVertexBuffer(t);
                                n && (n.update(i), t === e.VertexBuffer.PositionKind && this._updateBoundingInfo(r, i), this.notifyUpdate(t))
                            }, t.prototype._updateBoundingInfo = function(t, i) {
                                t && this._updateExtend(i);
                                var r = this._meshes,
                                    n = r.length;
                                this._resetPointsArrayCache();
                                for (var o = 0; o < n; o++) {
                                    var s = r[o];
                                    if (t) {
                                        s._boundingInfo = new e.BoundingInfo(this._extend.minimum, this._extend.maximum);
                                        for (var a = 0; a < s.subMeshes.length; a++) s.subMeshes[a].refreshBoundingInfo()
                                    }
                                }
                            }, t.prototype._bind = function(e, t) {
                                if (e) {
                                    void 0 === t && (t = this._indexBuffer);
                                    var i = this.getVertexBuffers();
                                    i && (t == this._indexBuffer && this._vertexArrayObjects ? (this._vertexArrayObjects[e.key] || (this._vertexArrayObjects[e.key] = this._engine.recordVertexArrayObject(i, t, e)), this._engine.bindVertexArrayObject(this._vertexArrayObjects[e.key], t)) : this._engine.bindBuffers(i, t, e))
                                }
                            }, t.prototype.getTotalVertices = function() {
                                return this.isReady() ? this._totalVertices : 0
                            }, t.prototype.getVerticesData = function(t, i, r) {
                                var n = this.getVertexBuffer(t);
                                if (!n) return null;
                                var o = n.getData();
                                if (!o) return null;
                                var s = n.getSize() * e.VertexBuffer.GetTypeByteLength(n.type),
                                    a = this._totalVertices * n.getSize();
                                if (n.type !== e.VertexBuffer.FLOAT || n.byteStride !== s) {
                                    var l = new Array(a);
                                    return n.forEach(a, function(e, t) {
                                        l[t] = e
                                    }), l
                                }
                                if (!(o instanceof Array || o instanceof Float32Array) || 0 !== n.byteOffset || o.length !== a) {
                                    if (o instanceof Array) {
                                        var u = n.byteOffset / 4;
                                        return e.Tools.Slice(o, u, u + a)
                                    }
                                    if (o instanceof ArrayBuffer) return new Float32Array(o, n.byteOffset, a);
                                    if (u = o.byteOffset + n.byteOffset, r || i && 1 !== this._meshes.length) {
                                        var c = new Float32Array(a),
                                            h = new Float32Array(o.buffer, u, a);
                                        return c.set(h), c
                                    }
                                    return new Float32Array(o.buffer, u, a)
                                }
                                return r || i && 1 !== this._meshes.length ? e.Tools.Slice(o) : o
                            }, t.prototype.isVertexBufferUpdatable = function(e) {
                                var t = this._vertexBuffers[e];
                                return !!t && t.isUpdatable()
                            }, t.prototype.getVertexBuffer = function(e) {
                                return this.isReady() ? this._vertexBuffers[e] : null
                            }, t.prototype.getVertexBuffers = function() {
                                return this.isReady() ? this._vertexBuffers : null
                            }, t.prototype.isVerticesDataPresent = function(e) {
                                return this._vertexBuffers ? void 0 !== this._vertexBuffers[e] : !!this._delayInfo && -1 !== this._delayInfo.indexOf(e)
                            }, t.prototype.getVerticesDataKinds = function() {
                                var e, t = [];
                                if (!this._vertexBuffers && this._delayInfo)
                                    for (e in this._delayInfo) t.push(e);
                                else
                                    for (e in this._vertexBuffers) t.push(e);
                                return t
                            }, t.prototype.updateIndices = function(e, t) {
                                this._indexBuffer && (this._indexBufferIsUpdatable ? this._engine.updateDynamicIndexBuffer(this._indexBuffer, e, t) : this.setIndices(e, null, !0))
                            }, t.prototype.setIndices = function(e, t, i) {
                                void 0 === t && (t = null), void 0 === i && (i = !1), this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer), this._disposeVertexArrayObjects(), this._indices = e, this._indexBufferIsUpdatable = i, 0 !== this._meshes.length && this._indices && (this._indexBuffer = this._engine.createIndexBuffer(this._indices, i)), null != t && (this._totalVertices = t);
                                for (var r = this._meshes, n = r.length, o = 0; o < n; o++) r[o]._createGlobalSubMesh(!0);
                                this.notifyUpdate()
                            }, t.prototype.getTotalIndices = function() {
                                return this.isReady() ? this._indices.length : 0
                            }, t.prototype.getIndices = function(e, t) {
                                if (!this.isReady()) return null;
                                var i = this._indices;
                                if (t || e && 1 !== this._meshes.length) {
                                    for (var r = i.length, n = [], o = 0; o < r; o++) n.push(i[o]);
                                    return n
                                }
                                return i
                            }, t.prototype.getIndexBuffer = function() {
                                return this.isReady() ? this._indexBuffer : null
                            }, t.prototype._releaseVertexArrayObject = function(e) {
                                void 0 === e && (e = null), e && this._vertexArrayObjects && this._vertexArrayObjects[e.key] && (this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]), delete this._vertexArrayObjects[e.key])
                            }, t.prototype.releaseForMesh = function(e, t) {
                                var i = this._meshes,
                                    r = i.indexOf(e); - 1 !== r && (i.splice(r, 1), e._geometry = null, 0 === i.length && t && this.dispose())
                            }, t.prototype.applyToMesh = function(e) {
                                if (e._geometry !== this) {
                                    var t = e._geometry;
                                    t && t.releaseForMesh(e);
                                    var i = this._meshes;
                                    (e._geometry = this)._scene.pushGeometry(this), i.push(e), this.isReady() ? this._applyToMesh(e) : e._boundingInfo = this._boundingInfo
                                }
                            }, t.prototype._updateExtend = function(t) {
                                void 0 === t && (t = null), t || (t = this.getVerticesData(e.VertexBuffer.PositionKind)), this._extend = e.Tools.ExtractMinAndMax(t, 0, this._totalVertices, this.boundingBias, 3)
                            }, t.prototype._applyToMesh = function(t) {
                                var i = this._meshes.length;
                                for (var r in this._vertexBuffers) {
                                    1 === i && this._vertexBuffers[r].create();
                                    var n = this._vertexBuffers[r].getBuffer();
                                    n && (n.references = i), r === e.VertexBuffer.PositionKind && (this._extend || this._updateExtend(), t._boundingInfo = new e.BoundingInfo(this._extend.minimum, this._extend.maximum), t._createGlobalSubMesh(!1), t._updateBoundingInfo())
                                }
                                1 === i && this._indices && 0 < this._indices.length && (this._indexBuffer = this._engine.createIndexBuffer(this._indices)), this._indexBuffer && (this._indexBuffer.references = i), t._syncGeometryWithMorphTargetManager()
                            }, t.prototype.notifyUpdate = function(e) {
                                this.onGeometryUpdated && this.onGeometryUpdated(this, e);
                                for (var t = 0, i = this._meshes; t < i.length; t++) i[t]._markSubMeshesAsAttributesDirty()
                            }, t.prototype.load = function(t, i) {
                                this.delayLoadState !== e.Engine.DELAYLOADSTATE_LOADING && (this.isReady() ? i && i() : (this.delayLoadState = e.Engine.DELAYLOADSTATE_LOADING, this._queueLoad(t, i)))
                            }, t.prototype._queueLoad = function(t, i) {
                                var r = this;
                                this.delayLoadingFile && (t._addPendingData(this), t._loadFile(this.delayLoadingFile, function(n) {
                                    if (r._delayLoadingFunction) {
                                        r._delayLoadingFunction(JSON.parse(n), r), r.delayLoadState = e.Engine.DELAYLOADSTATE_LOADED, r._delayInfo = [], t._removePendingData(r);
                                        for (var o = r._meshes, s = o.length, a = 0; a < s; a++) r._applyToMesh(o[a]);
                                        i && i()
                                    }
                                }, void 0, !0))
                            }, t.prototype.toLeftHanded = function() {
                                var t = this.getIndices(!1);
                                if (null != t && 0 < t.length) {
                                    for (var i = 0; i < t.length; i += 3) {
                                        var r = t[i + 0];
                                        t[i + 0] = t[i + 2], t[i + 2] = r
                                    }
                                    this.setIndices(t)
                                }
                                var n = this.getVerticesData(e.VertexBuffer.PositionKind, !1);
                                if (null != n && 0 < n.length) {
                                    for (i = 0; i < n.length; i += 3) n[i + 2] = -n[i + 2];
                                    this.setVerticesData(e.VertexBuffer.PositionKind, n, !1)
                                }
                                var o = this.getVerticesData(e.VertexBuffer.NormalKind, !1);
                                if (null != o && 0 < o.length) {
                                    for (i = 0; i < o.length; i += 3) o[i + 2] = -o[i + 2];
                                    this.setVerticesData(e.VertexBuffer.NormalKind, o, !1)
                                }
                            }, t.prototype._resetPointsArrayCache = function() {
                                this._positions = null
                            }, t.prototype._generatePointsArray = function() {
                                if (this._positions) return !0;
                                var t = this.getVerticesData(e.VertexBuffer.PositionKind);
                                if (!t || 0 === t.length) return !1;
                                this._positions = [];
                                for (var i = 0; i < t.length; i += 3) this._positions.push(e.Vector3.FromArray(t, i));
                                return !0
                            }, t.prototype.isDisposed = function() {
                                return this._isDisposed
                            }, t.prototype._disposeVertexArrayObjects = function() {
                                if (this._vertexArrayObjects) {
                                    for (var e in this._vertexArrayObjects) this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e]);
                                    this._vertexArrayObjects = {}
                                }
                            }, t.prototype.dispose = function() {
                                var t, i = this._meshes,
                                    r = i.length;
                                for (t = 0; t < r; t++) this.releaseForMesh(i[t]);
                                for (var n in this._meshes = [], this._disposeVertexArrayObjects(), this._vertexBuffers) this._vertexBuffers[n].dispose();
                                this._vertexBuffers = {}, this._totalVertices = 0, this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null, this._indices = [], this.delayLoadState = e.Engine.DELAYLOADSTATE_NONE, this.delayLoadingFile = null, this._delayLoadingFunction = null, this._delayInfo = [], this._boundingInfo = null, this._scene.removeGeometry(this), this._isDisposed = !0
                            }, t.prototype.copy = function(i) {
                                var r = new e.VertexData;
                                r.indices = [];
                                var n = this.getIndices();
                                if (n)
                                    for (var o = 0; o < n.length; o++) r.indices.push(n[o]);
                                var s, a = !1,
                                    l = !1;
                                for (s in this._vertexBuffers) {
                                    var u = this.getVerticesData(s);
                                    if (u instanceof Float32Array ? r.set(new Float32Array(u), s) : r.set(u.slice(0), s), !l) {
                                        var c = this.getVertexBuffer(s);
                                        c && (l = !(a = c.isUpdatable()))
                                    }
                                }
                                var h = new t(i, this._scene, r, a);
                                for (s in h.delayLoadState = this.delayLoadState, h.delayLoadingFile = this.delayLoadingFile, h._delayLoadingFunction = this._delayLoadingFunction, this._delayInfo) h._delayInfo = h._delayInfo || [], h._delayInfo.push(s);
                                return h._boundingInfo = new e.BoundingInfo(this._extend.minimum, this._extend.maximum), h
                            }, t.prototype.serialize = function() {
                                var t = {};
                                return t.id = this.id, t.updatable = this._updatable, e.Tags && e.Tags.HasTags(this) && (t.tags = e.Tags.GetTags(this)), t
                            }, t.prototype.toNumberArray = function(e) {
                                return Array.isArray(e) ? e : Array.prototype.slice.call(e)
                            }, t.prototype.serializeVerticeData = function() {
                                var t = this.serialize();
                                return this.isVerticesDataPresent(e.VertexBuffer.PositionKind) && (t.positions = this.toNumberArray(this.getVerticesData(e.VertexBuffer.PositionKind)),
                                    this.isVertexBufferUpdatable(e.VertexBuffer.PositionKind) && (t.positions._updatable = !0)), this.isVerticesDataPresent(e.VertexBuffer.NormalKind) && (t.normals = this.toNumberArray(this.getVerticesData(e.VertexBuffer.NormalKind)), this.isVertexBufferUpdatable(e.VertexBuffer.NormalKind) && (t.normals._updatable = !0)), this.isVerticesDataPresent(e.VertexBuffer.TangentKind) && (t.tangets = this.toNumberArray(this.getVerticesData(e.VertexBuffer.TangentKind)), this.isVertexBufferUpdatable(e.VertexBuffer.TangentKind) && (t.tangets._updatable = !0)), this.isVerticesDataPresent(e.VertexBuffer.UVKind) && (t.uvs = this.toNumberArray(this.getVerticesData(e.VertexBuffer.UVKind)), this.isVertexBufferUpdatable(e.VertexBuffer.UVKind) && (t.uvs._updatable = !0)), this.isVerticesDataPresent(e.VertexBuffer.UV2Kind) && (t.uv2s = this.toNumberArray(this.getVerticesData(e.VertexBuffer.UV2Kind)), this.isVertexBufferUpdatable(e.VertexBuffer.UV2Kind) && (t.uv2s._updatable = !0)), this.isVerticesDataPresent(e.VertexBuffer.UV3Kind) && (t.uv3s = this.toNumberArray(this.getVerticesData(e.VertexBuffer.UV3Kind)), this.isVertexBufferUpdatable(e.VertexBuffer.UV3Kind) && (t.uv3s._updatable = !0)), this.isVerticesDataPresent(e.VertexBuffer.UV4Kind) && (t.uv4s = this.toNumberArray(this.getVerticesData(e.VertexBuffer.UV4Kind)), this.isVertexBufferUpdatable(e.VertexBuffer.UV4Kind) && (t.uv4s._updatable = !0)), this.isVerticesDataPresent(e.VertexBuffer.UV5Kind) && (t.uv5s = this.toNumberArray(this.getVerticesData(e.VertexBuffer.UV5Kind)), this.isVertexBufferUpdatable(e.VertexBuffer.UV5Kind) && (t.uv5s._updatable = !0)), this.isVerticesDataPresent(e.VertexBuffer.UV6Kind) && (t.uv6s = this.toNumberArray(this.getVerticesData(e.VertexBuffer.UV6Kind)), this.isVertexBufferUpdatable(e.VertexBuffer.UV6Kind) && (t.uv6s._updatable = !0)), this.isVerticesDataPresent(e.VertexBuffer.ColorKind) && (t.colors = this.toNumberArray(this.getVerticesData(e.VertexBuffer.ColorKind)), this.isVertexBufferUpdatable(e.VertexBuffer.ColorKind) && (t.colors._updatable = !0)), this.isVerticesDataPresent(e.VertexBuffer.MatricesIndicesKind) && (t.matricesIndices = this.toNumberArray(this.getVerticesData(e.VertexBuffer.MatricesIndicesKind)), t.matricesIndices._isExpanded = !0, this.isVertexBufferUpdatable(e.VertexBuffer.MatricesIndicesKind) && (t.matricesIndices._updatable = !0)), this.isVerticesDataPresent(e.VertexBuffer.MatricesWeightsKind) && (t.matricesWeights = this.toNumberArray(this.getVerticesData(e.VertexBuffer.MatricesWeightsKind)), this.isVertexBufferUpdatable(e.VertexBuffer.MatricesWeightsKind) && (t.matricesWeights._updatable = !0)), t.indices = this.toNumberArray(this.getIndices()), t
                            }, t.ExtractFromMesh = function(e, t) {
                                var i = e._geometry;
                                return i ? i.copy(t) : null
                            }, t.RandomId = function() {
                                return e.Tools.RandomId()
                            }, t._ImportGeometry = function(i, r) {
                                var n = r.getScene(),
                                    o = i.geometryId;
                                if (o) {
                                    var s = n.getGeometryByID(o);
                                    s && s.applyToMesh(r)
                                } else if (i instanceof ArrayBuffer) {
                                    var a = r._binaryInfo;
                                    if (a.positionsAttrDesc && 0 < a.positionsAttrDesc.count) {
                                        var l = new Float32Array(i, a.positionsAttrDesc.offset, a.positionsAttrDesc.count);
                                        r.setVerticesData(e.VertexBuffer.PositionKind, l, !1)
                                    }
                                    if (a.normalsAttrDesc && 0 < a.normalsAttrDesc.count) {
                                        var u = new Float32Array(i, a.normalsAttrDesc.offset, a.normalsAttrDesc.count);
                                        r.setVerticesData(e.VertexBuffer.NormalKind, u, !1)
                                    }
                                    if (a.tangetsAttrDesc && 0 < a.tangetsAttrDesc.count) {
                                        var c = new Float32Array(i, a.tangetsAttrDesc.offset, a.tangetsAttrDesc.count);
                                        r.setVerticesData(e.VertexBuffer.TangentKind, c, !1)
                                    }
                                    if (a.uvsAttrDesc && 0 < a.uvsAttrDesc.count) {
                                        var h = new Float32Array(i, a.uvsAttrDesc.offset, a.uvsAttrDesc.count);
                                        r.setVerticesData(e.VertexBuffer.UVKind, h, !1)
                                    }
                                    if (a.uvs2AttrDesc && 0 < a.uvs2AttrDesc.count) {
                                        var d = new Float32Array(i, a.uvs2AttrDesc.offset, a.uvs2AttrDesc.count);
                                        r.setVerticesData(e.VertexBuffer.UV2Kind, d, !1)
                                    }
                                    if (a.uvs3AttrDesc && 0 < a.uvs3AttrDesc.count) {
                                        var p = new Float32Array(i, a.uvs3AttrDesc.offset, a.uvs3AttrDesc.count);
                                        r.setVerticesData(e.VertexBuffer.UV3Kind, p, !1)
                                    }
                                    if (a.uvs4AttrDesc && 0 < a.uvs4AttrDesc.count) {
                                        var f = new Float32Array(i, a.uvs4AttrDesc.offset, a.uvs4AttrDesc.count);
                                        r.setVerticesData(e.VertexBuffer.UV4Kind, f, !1)
                                    }
                                    if (a.uvs5AttrDesc && 0 < a.uvs5AttrDesc.count) {
                                        var _ = new Float32Array(i, a.uvs5AttrDesc.offset, a.uvs5AttrDesc.count);
                                        r.setVerticesData(e.VertexBuffer.UV5Kind, _, !1)
                                    }
                                    if (a.uvs6AttrDesc && 0 < a.uvs6AttrDesc.count) {
                                        var m = new Float32Array(i, a.uvs6AttrDesc.offset, a.uvs6AttrDesc.count);
                                        r.setVerticesData(e.VertexBuffer.UV6Kind, m, !1)
                                    }
                                    if (a.colorsAttrDesc && 0 < a.colorsAttrDesc.count) {
                                        var g = new Float32Array(i, a.colorsAttrDesc.offset, a.colorsAttrDesc.count);
                                        r.setVerticesData(e.VertexBuffer.ColorKind, g, !1, a.colorsAttrDesc.stride)
                                    }
                                    if (a.matricesIndicesAttrDesc && 0 < a.matricesIndicesAttrDesc.count) {
                                        for (var v = new Int32Array(i, a.matricesIndicesAttrDesc.offset, a.matricesIndicesAttrDesc.count), y = [], b = 0; b < v.length; b++) {
                                            var x = v[b];
                                            y.push(255 & x), y.push((65280 & x) >> 8), y.push((16711680 & x) >> 16), y.push(x >> 24)
                                        }
                                        r.setVerticesData(e.VertexBuffer.MatricesIndicesKind, y, !1)
                                    }
                                    if (a.matricesWeightsAttrDesc && 0 < a.matricesWeightsAttrDesc.count) {
                                        var T = new Float32Array(i, a.matricesWeightsAttrDesc.offset, a.matricesWeightsAttrDesc.count);
                                        r.setVerticesData(e.VertexBuffer.MatricesWeightsKind, T, !1)
                                    }
                                    if (a.indicesAttrDesc && 0 < a.indicesAttrDesc.count) {
                                        var E = new Int32Array(i, a.indicesAttrDesc.offset, a.indicesAttrDesc.count);
                                        r.setIndices(E, null)
                                    }
                                    if (a.subMeshesAttrDesc && 0 < a.subMeshesAttrDesc.count) {
                                        var S = new Int32Array(i, a.subMeshesAttrDesc.offset, 5 * a.subMeshesAttrDesc.count);
                                        for (r.subMeshes = [], b = 0; b < a.subMeshesAttrDesc.count; b++) {
                                            var P = S[5 * b + 0],
                                                A = S[5 * b + 1],
                                                C = S[5 * b + 2],
                                                M = S[5 * b + 3],
                                                R = S[5 * b + 4];
                                            e.SubMesh.AddToMesh(P, A, C, M, R, r)
                                        }
                                    }
                                } else if (i.positions && i.normals && i.indices) {
                                    if (r.setVerticesData(e.VertexBuffer.PositionKind, i.positions, i.positions._updatable), r.setVerticesData(e.VertexBuffer.NormalKind, i.normals, i.normals._updatable), i.tangents && r.setVerticesData(e.VertexBuffer.TangentKind, i.tangents, i.tangents._updatable), i.uvs && r.setVerticesData(e.VertexBuffer.UVKind, i.uvs, i.uvs._updatable), i.uvs2 && r.setVerticesData(e.VertexBuffer.UV2Kind, i.uvs2, i.uvs2._updatable), i.uvs3 && r.setVerticesData(e.VertexBuffer.UV3Kind, i.uvs3, i.uvs3._updatable), i.uvs4 && r.setVerticesData(e.VertexBuffer.UV4Kind, i.uvs4, i.uvs4._updatable), i.uvs5 && r.setVerticesData(e.VertexBuffer.UV5Kind, i.uvs5, i.uvs5._updatable), i.uvs6 && r.setVerticesData(e.VertexBuffer.UV6Kind, i.uvs6, i.uvs6._updatable), i.colors && r.setVerticesData(e.VertexBuffer.ColorKind, e.Color4.CheckColors4(i.colors, i.positions.length / 3), i.colors._updatable), i.matricesIndices)
                                        if (i.matricesIndices._isExpanded) delete i.matricesIndices._isExpanded, r.setVerticesData(e.VertexBuffer.MatricesIndicesKind, i.matricesIndices, i.matricesIndices._updatable);
                                        else {
                                            for (y = [], b = 0; b < i.matricesIndices.length; b++) {
                                                var O = i.matricesIndices[b];
                                                y.push(255 & O), y.push((65280 & O) >> 8), y.push((16711680 & O) >> 16), y.push(O >> 24)
                                            }
                                            r.setVerticesData(e.VertexBuffer.MatricesIndicesKind, y, i.matricesIndices._updatable)
                                        }
                                    if (i.matricesIndicesExtra)
                                        if (i.matricesIndicesExtra._isExpanded) delete i.matricesIndices._isExpanded, r.setVerticesData(e.VertexBuffer.MatricesIndicesExtraKind, i.matricesIndicesExtra, i.matricesIndicesExtra._updatable);
                                        else {
                                            for (y = [], b = 0; b < i.matricesIndicesExtra.length; b++) O = i.matricesIndicesExtra[b], y.push(255 & O), y.push((65280 & O) >> 8), y.push((16711680 & O) >> 16), y.push(O >> 24);
                                            r.setVerticesData(e.VertexBuffer.MatricesIndicesExtraKind, y, i.matricesIndicesExtra._updatable)
                                        }
                                    i.matricesWeights && (t._CleanMatricesWeights(i, r), r.setVerticesData(e.VertexBuffer.MatricesWeightsKind, i.matricesWeights, i.matricesWeights._updatable)), i.matricesWeightsExtra && r.setVerticesData(e.VertexBuffer.MatricesWeightsExtraKind, i.matricesWeightsExtra, i.matricesWeights._updatable), r.setIndices(i.indices, null)
                                }
                                if (i.subMeshes) {
                                    r.subMeshes = [];
                                    for (var w = 0; w < i.subMeshes.length; w++) {
                                        var I = i.subMeshes[w];
                                        e.SubMesh.AddToMesh(I.materialIndex, I.verticesStart, I.verticesCount, I.indexStart, I.indexCount, r)
                                    }
                                }
                                r._shouldGenerateFlatShading && (r.convertToFlatShadedMesh(), delete r._shouldGenerateFlatShading), r.computeWorldMatrix(!0), n.onMeshImportedObservable.notifyObservers(r)
                            }, t._CleanMatricesWeights = function(t, i) {
                                if (e.SceneLoader.CleanBoneMatrixWeights) {
                                    var r = 0;
                                    if (-1 < t.skeletonId) {
                                        var n = i.getScene().getLastSkeletonByID(t.skeletonId);
                                        if (n) {
                                            r = n.bones.length;
                                            for (var o = i.getVerticesData(e.VertexBuffer.MatricesIndicesKind), s = i.getVerticesData(e.VertexBuffer.MatricesIndicesExtraKind), a = t.matricesWeights, l = t.matricesWeightsExtra, u = t.numBoneInfluencer, c = a.length, h = 0; h < c; h += 4) {
                                                for (var d = 0, p = -1, f = 0; f < 4; f++) d += _ = a[h + f], _ < .001 && p < 0 && (p = f);
                                                if (l)
                                                    for (f = 0; f < 4; f++) {
                                                        var _;
                                                        d += _ = l[h + f], _ < .001 && p < 0 && (p = f + 4)
                                                    }
                                                if ((p < 0 || u - 1 < p) && (p = u - 1), .001 < d) {
                                                    var m = 1 / d;
                                                    for (f = 0; f < 4; f++) a[h + f] *= m;
                                                    if (l)
                                                        for (f = 0; f < 4; f++) l[h + f] *= m
                                                } else 4 <= p ? (l[h + p - 4] = 1 - d, s[h + p - 4] = r) : (a[h + p] = 1 - d, o[h + p] = r)
                                            }
                                            i.setVerticesData(e.VertexBuffer.MatricesIndicesKind, o), t.matricesWeightsExtra && i.setVerticesData(e.VertexBuffer.MatricesIndicesExtraKind, s)
                                        }
                                    }
                                }
                            }, t.Parse = function(i, r, n) {
                                if (r.getGeometryByID(i.id)) return null;
                                var o = new t(i.id, r, void 0, i.updatable);
                                return e.Tags && e.Tags.AddTagsTo(o, i.tags), i.delayLoadingFile ? (o.delayLoadState = e.Engine.DELAYLOADSTATE_NOTLOADED, o.delayLoadingFile = n + i.delayLoadingFile, o._boundingInfo = new e.BoundingInfo(e.Vector3.FromArray(i.boundingBoxMinimum), e.Vector3.FromArray(i.boundingBoxMaximum)), o._delayInfo = [], i.hasUVs && o._delayInfo.push(e.VertexBuffer.UVKind), i.hasUVs2 && o._delayInfo.push(e.VertexBuffer.UV2Kind), i.hasUVs3 && o._delayInfo.push(e.VertexBuffer.UV3Kind), i.hasUVs4 && o._delayInfo.push(e.VertexBuffer.UV4Kind), i.hasUVs5 && o._delayInfo.push(e.VertexBuffer.UV5Kind), i.hasUVs6 && o._delayInfo.push(e.VertexBuffer.UV6Kind), i.hasColors && o._delayInfo.push(e.VertexBuffer.ColorKind), i.hasMatricesIndices && o._delayInfo.push(e.VertexBuffer.MatricesIndicesKind), i.hasMatricesWeights && o._delayInfo.push(e.VertexBuffer.MatricesWeightsKind), o._delayLoadingFunction = e.VertexData.ImportVertexData) : e.VertexData.ImportVertexData(i, o), r.pushGeometry(o, !0), o
                            }, t
                        }(),
                        i = function(e) {
                            function t(t, i, r, n) {
                                void 0 === r && (r = !1), void 0 === n && (n = null);
                                var o = e.call(this, t, i, void 0, !1, n) || this;
                                return o._canBeRegenerated = r, o._beingRegenerated = !0, o.regenerate(), o._beingRegenerated = !1, o
                            }
                            return b(t, e), t.prototype.canBeRegenerated = function() {
                                return this._canBeRegenerated
                            }, t.prototype.regenerate = function() {
                                this._canBeRegenerated && (this._beingRegenerated = !0, this.setAllVerticesData(this._regenerateVertexData(), !1), this._beingRegenerated = !1)
                            }, t.prototype.asNewGeometry = function(t) {
                                return e.prototype.copy.call(this, t)
                            }, t.prototype.setAllVerticesData = function(t, i) {
                                this._beingRegenerated && e.prototype.setAllVerticesData.call(this, t, !1)
                            }, t.prototype.setVerticesData = function(t, i, r) {
                                this._beingRegenerated && e.prototype.setVerticesData.call(this, t, i, !1)
                            }, t.prototype._regenerateVertexData = function() {
                                throw new Error("Abstract method")
                            }, t.prototype.copy = function(e) {
                                throw new Error("Must be overriden in sub-classes.")
                            }, t.prototype.serialize = function() {
                                var t = e.prototype.serialize.call(this);
                                return t.canBeRegenerated = this.canBeRegenerated(), t
                            }, t
                        }(e.Geometry = t),
                        r = function(t) {
                            function i(i, r, n, o, s, a, l, u, c) {
                                void 0 === c && (c = e.Mesh.DEFAULTSIDE);
                                var h = t.call(this, i, r, l, u) || this;
                                return h.pathArray = n, h.closeArray = o, h.closePath = s, h.offset = a, h.side = c, h
                            }
                            return b(i, t), i.prototype._regenerateVertexData = function() {
                                return e.VertexData.CreateRibbon({
                                    pathArray: this.pathArray,
                                    closeArray: this.closeArray,
                                    closePath: this.closePath,
                                    offset: this.offset,
                                    sideOrientation: this.side
                                })
                            }, i.prototype.copy = function(e) {
                                return new i(e, this.getScene(), this.pathArray, this.closeArray, this.closePath, this.offset, this.canBeRegenerated(), void 0, this.side)
                            }, i
                        }(e._PrimitiveGeometry = i);
                    e.RibbonGeometry = r;
                    var n = function(t) {
                        function i(i, r, n, o, s, a) {
                            void 0 === s && (s = null), void 0 === a && (a = e.Mesh.DEFAULTSIDE);
                            var l = t.call(this, i, r, o, s) || this;
                            return l.size = n, l.side = a, l
                        }
                        return b(i, t), i.prototype._regenerateVertexData = function() {
                            return e.VertexData.CreateBox({
                                size: this.size,
                                sideOrientation: this.side
                            })
                        }, i.prototype.copy = function(e) {
                            return new i(e, this.getScene(), this.size, this.canBeRegenerated(), void 0, this.side)
                        }, i.prototype.serialize = function() {
                            var e = t.prototype.serialize.call(this);
                            return e.size = this.size, e
                        }, i.Parse = function(t, r) {
                            if (r.getGeometryByID(t.id)) return null;
                            var n = new i(t.id, r, t.size, t.canBeRegenerated, null);
                            return e.Tags && e.Tags.AddTagsTo(n, t.tags), r.pushGeometry(n, !0), n
                        }, i
                    }(i);
                    e.BoxGeometry = n;
                    var o = function(t) {
                        function i(i, r, n, o, s, a, l) {
                            void 0 === a && (a = null), void 0 === l && (l = e.Mesh.DEFAULTSIDE);
                            var u = t.call(this, i, r, s, a) || this;
                            return u.segments = n, u.diameter = o, u.side = l, u
                        }
                        return b(i, t), i.prototype._regenerateVertexData = function() {
                            return e.VertexData.CreateSphere({
                                segments: this.segments,
                                diameter: this.diameter,
                                sideOrientation: this.side
                            })
                        }, i.prototype.copy = function(e) {
                            return new i(e, this.getScene(), this.segments, this.diameter, this.canBeRegenerated(), null, this.side)
                        }, i.prototype.serialize = function() {
                            var e = t.prototype.serialize.call(this);
                            return e.segments = this.segments, e.diameter = this.diameter, e
                        }, i.Parse = function(t, r) {
                            if (r.getGeometryByID(t.id)) return null;
                            var n = new i(t.id, r, t.segments, t.diameter, t.canBeRegenerated, null);
                            return e.Tags && e.Tags.AddTagsTo(n, t.tags), r.pushGeometry(n, !0), n
                        }, i
                    }(i);
                    e.SphereGeometry = o;
                    var s = function(t) {
                        function i(i, r, n, o, s, a, l) {
                            void 0 === a && (a = null), void 0 === l && (l = e.Mesh.DEFAULTSIDE);
                            var u = t.call(this, i, r, s, a) || this;
                            return u.radius = n, u.tessellation = o, u.side = l, u
                        }
                        return b(i, t), i.prototype._regenerateVertexData = function() {
                            return e.VertexData.CreateDisc({
                                radius: this.radius,
                                tessellation: this.tessellation,
                                sideOrientation: this.side
                            })
                        }, i.prototype.copy = function(e) {
                            return new i(e, this.getScene(), this.radius, this.tessellation, this.canBeRegenerated(), null, this.side)
                        }, i
                    }(i);
                    e.DiscGeometry = s;
                    var a = function(t) {
                        function i(i, r, n, o, s, a, l, u, c, h) {
                            void 0 === l && (l = 1), void 0 === c && (c = null), void 0 === h && (h = e.Mesh.DEFAULTSIDE);
                            var d = t.call(this, i, r, u, c) || this;
                            return d.height = n, d.diameterTop = o, d.diameterBottom = s, d.tessellation = a, d.subdivisions = l, d.side = h, d
                        }
                        return b(i, t), i.prototype._regenerateVertexData = function() {
                            return e.VertexData.CreateCylinder({
                                height: this.height,
                                diameterTop: this.diameterTop,
                                diameterBottom: this.diameterBottom,
                                tessellation: this.tessellation,
                                subdivisions: this.subdivisions,
                                sideOrientation: this.side
                            })
                        }, i.prototype.copy = function(e) {
                            return new i(e, this.getScene(), this.height, this.diameterTop, this.diameterBottom, this.tessellation, this.subdivisions, this.canBeRegenerated(), null, this.side)
                        }, i.prototype.serialize = function() {
                            var e = t.prototype.serialize.call(this);
                            return e.height = this.height, e.diameterTop = this.diameterTop, e.diameterBottom = this.diameterBottom, e.tessellation = this.tessellation, e
                        }, i.Parse = function(t, r) {
                            if (r.getGeometryByID(t.id)) return null;
                            var n = new i(t.id, r, t.height, t.diameterTop, t.diameterBottom, t.tessellation, t.subdivisions, t.canBeRegenerated, null);
                            return e.Tags && e.Tags.AddTagsTo(n, t.tags), r.pushGeometry(n, !0), n
                        }, i
                    }(i);
                    e.CylinderGeometry = a;
                    var l = function(t) {
                        function i(i, r, n, o, s, a, l, u) {
                            void 0 === l && (l = null), void 0 === u && (u = e.Mesh.DEFAULTSIDE);
                            var c = t.call(this, i, r, a, l) || this;
                            return c.diameter = n, c.thickness = o, c.tessellation = s, c.side = u, c
                        }
                        return b(i, t), i.prototype._regenerateVertexData = function() {
                            return e.VertexData.CreateTorus({
                                diameter: this.diameter,
                                thickness: this.thickness,
                                tessellation: this.tessellation,
                                sideOrientation: this.side
                            })
                        }, i.prototype.copy = function(e) {
                            return new i(e, this.getScene(), this.diameter, this.thickness, this.tessellation, this.canBeRegenerated(), null, this.side)
                        }, i.prototype.serialize = function() {
                            var e = t.prototype.serialize.call(this);
                            return e.diameter = this.diameter, e.thickness = this.thickness, e.tessellation = this.tessellation, e
                        }, i.Parse = function(t, r) {
                            if (r.getGeometryByID(t.id)) return null;
                            var n = new i(t.id, r, t.diameter, t.thickness, t.tessellation, t.canBeRegenerated, null);
                            return e.Tags && e.Tags.AddTagsTo(n, t.tags), r.pushGeometry(n, !0), n
                        }, i
                    }(i);
                    e.TorusGeometry = l;
                    var u = function(t) {
                        function i(e, i, r, n, o, s, a) {
                            void 0 === a && (a = null);
                            var l = t.call(this, e, i, s, a) || this;
                            return l.width = r, l.height = n, l.subdivisions = o, l
                        }
                        return b(i, t), i.prototype._regenerateVertexData = function() {
                            return e.VertexData.CreateGround({
                                width: this.width,
                                height: this.height,
                                subdivisions: this.subdivisions
                            })
                        }, i.prototype.copy = function(e) {
                            return new i(e, this.getScene(), this.width, this.height, this.subdivisions, this.canBeRegenerated(), null)
                        }, i.prototype.serialize = function() {
                            var e = t.prototype.serialize.call(this);
                            return e.width = this.width, e.height = this.height, e.subdivisions = this.subdivisions, e
                        }, i.Parse = function(t, r) {
                            if (r.getGeometryByID(t.id)) return null;
                            var n = new i(t.id, r, t.width, t.height, t.subdivisions, t.canBeRegenerated, null);
                            return e.Tags && e.Tags.AddTagsTo(n, t.tags), r.pushGeometry(n, !0), n
                        }, i
                    }(i);
                    e.GroundGeometry = u;
                    var c = function(t) {
                        function i(e, i, r, n, o, s, a, l, u, c) {
                            void 0 === c && (c = null);
                            var h = t.call(this, e, i, u, c) || this;
                            return h.xmin = r, h.zmin = n, h.xmax = o, h.zmax = s, h.subdivisions = a, h.precision = l, h
                        }
                        return b(i, t), i.prototype._regenerateVertexData = function() {
                            return e.VertexData.CreateTiledGround({
                                xmin: this.xmin,
                                zmin: this.zmin,
                                xmax: this.xmax,
                                zmax: this.zmax,
                                subdivisions: this.subdivisions,
                                precision: this.precision
                            })
                        }, i.prototype.copy = function(e) {
                            return new i(e, this.getScene(), this.xmin, this.zmin, this.xmax, this.zmax, this.subdivisions, this.precision, this.canBeRegenerated(), null)
                        }, i
                    }(i);
                    e.TiledGroundGeometry = c;
                    var h = function(t) {
                        function i(i, r, n, o, s, a) {
                            void 0 === s && (s = null), void 0 === a && (a = e.Mesh.DEFAULTSIDE);
                            var l = t.call(this, i, r, o, s) || this;
                            return l.size = n, l.side = a, l
                        }
                        return b(i, t), i.prototype._regenerateVertexData = function() {
                            return e.VertexData.CreatePlane({
                                size: this.size,
                                sideOrientation: this.side
                            })
                        }, i.prototype.copy = function(e) {
                            return new i(e, this.getScene(), this.size, this.canBeRegenerated(), null, this.side)
                        }, i.prototype.serialize = function() {
                            var e = t.prototype.serialize.call(this);
                            return e.size = this.size, e
                        }, i.Parse = function(t, r) {
                            if (r.getGeometryByID(t.id)) return null;
                            var n = new i(t.id, r, t.size, t.canBeRegenerated, null);
                            return e.Tags && e.Tags.AddTagsTo(n, t.tags), r.pushGeometry(n, !0), n
                        }, i
                    }(i);
                    e.PlaneGeometry = h;
                    var d = function(t) {
                        function i(i, r, n, o, s, a, l, u, c, h, d) {
                            void 0 === h && (h = null), void 0 === d && (d = e.Mesh.DEFAULTSIDE);
                            var p = t.call(this, i, r, c, h) || this;
                            return p.radius = n, p.tube = o, p.radialSegments = s, p.tubularSegments = a, p.p = l, p.q = u, p.side = d, p
                        }
                        return b(i, t), i.prototype._regenerateVertexData = function() {
                            return e.VertexData.CreateTorusKnot({
                                radius: this.radius,
                                tube: this.tube,
                                radialSegments: this.radialSegments,
                                tubularSegments: this.tubularSegments,
                                p: this.p,
                                q: this.q,
                                sideOrientation: this.side
                            })
                        }, i.prototype.copy = function(e) {
                            return new i(e, this.getScene(), this.radius, this.tube, this.radialSegments, this.tubularSegments, this.p, this.q, this.canBeRegenerated(), null, this.side)
                        }, i.prototype.serialize = function() {
                            var e = t.prototype.serialize.call(this);
                            return e.radius = this.radius, e.tube = this.tube, e.radialSegments = this.radialSegments, e.tubularSegments = this.tubularSegments, e.p = this.p, e.q = this.q, e
                        }, i.Parse = function(t, r) {
                            if (r.getGeometryByID(t.id)) return null;
                            var n = new i(t.id, r, t.radius, t.tube, t.radialSegments, t.tubularSegments, t.p, t.q, t.canBeRegenerated, null);
                            return e.Tags && e.Tags.AddTagsTo(n, t.tags), r.pushGeometry(n, !0), n
                        }, i
                    }(i);
                    e.TorusKnotGeometry = d
                }($a || ($a = {})),
                function(e) {
                    var t = function() {
                        function t(e) {
                            void 0 === e && (e = 30), this._enabled = !0, this._rollingFrameTime = new i(e)
                        }
                        return t.prototype.sampleFrame = function(t) {
                            if (void 0 === t && (t = e.Tools.Now), this._enabled) {
                                if (null != this._lastFrameTimeMs) {
                                    var i = t - this._lastFrameTimeMs;
                                    this._rollingFrameTime.add(i)
                                }
                                this._lastFrameTimeMs = t
                            }
                        }, Object.defineProperty(t.prototype, "averageFrameTime", {
                            get: function() {
                                return this._rollingFrameTime.average
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "averageFrameTimeVariance", {
                            get: function() {
                                return this._rollingFrameTime.variance
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "instantaneousFrameTime", {
                            get: function() {
                                return this._rollingFrameTime.history(0)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "averageFPS", {
                            get: function() {
                                return 1e3 / this._rollingFrameTime.average
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "instantaneousFPS", {
                            get: function() {
                                var e = this._rollingFrameTime.history(0);
                                return 0 === e ? 0 : 1e3 / e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "isSaturated", {
                            get: function() {
                                return this._rollingFrameTime.isSaturated()
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.enable = function() {
                            this._enabled = !0
                        }, t.prototype.disable = function() {
                            this._enabled = !1, this._lastFrameTimeMs = null
                        }, Object.defineProperty(t.prototype, "isEnabled", {
                            get: function() {
                                return this._enabled
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.reset = function() {
                            this._lastFrameTimeMs = null, this._rollingFrameTime.reset()
                        }, t
                    }();
                    e.PerformanceMonitor = t;
                    var i = function() {
                        function e(e) {
                            this._samples = new Array(e), this.reset()
                        }
                        return e.prototype.add = function(e) {
                            var t;
                            if (this.isSaturated()) {
                                var i = this._samples[this._pos];
                                t = i - this.average, this.average -= t / (this._sampleCount - 1), this._m2 -= t * (i - this.average)
                            } else this._sampleCount++;
                            t = e - this.average, this.average += t / this._sampleCount, this._m2 += t * (e - this.average), this.variance = this._m2 / (this._sampleCount - 1), this._samples[this._pos] = e, this._pos++, this._pos %= this._samples.length
                        }, e.prototype.history = function(e) {
                            if (e >= this._sampleCount || e >= this._samples.length) return 0;
                            var t = this._wrapPosition(this._pos - 1);
                            return this._samples[this._wrapPosition(t - e)]
                        }, e.prototype.isSaturated = function() {
                            return this._sampleCount >= this._samples.length
                        }, e.prototype.reset = function() {
                            this.average = 0, this.variance = 0, this._sampleCount = 0, this._pos = 0, this._m2 = 0
                        }, e.prototype._wrapPosition = function(e) {
                            var t = this._samples.length;
                            return (e % t + t) % t
                        }, e
                    }();
                    e.RollingAverage = i
                }($a || ($a = {})), de = $a || ($a = {}), pe = function() {
                    function e() {}
                    return e.BindEyePosition = function(e, t) {
                        t._forcedViewPosition ? e.setVector3("vEyePosition", t._forcedViewPosition) : e.setVector3("vEyePosition", t._mirroredCameraPosition ? t._mirroredCameraPosition : t.activeCamera.globalPosition)
                    }, e.PrepareDefinesForMergedUV = function(e, t, i) {
                        t._needUVs = !0, t[i] = !0, e.getTextureMatrix().isIdentity(!0) ? (t[i + "DIRECTUV"] = e.coordinatesIndex + 1, 0 === e.coordinatesIndex ? t.MAINUV1 = !0 : t.MAINUV2 = !0) : t[i + "DIRECTUV"] = 0
                    }, e.BindTextureMatrix = function(e, t, i) {
                        var r = e.getTextureMatrix();
                        r.isIdentity(!0) || t.updateMatrix(i + "Matrix", r)
                    }, e.PrepareDefinesForMisc = function(e, t, i, r, n, o, s) {
                        s._areMiscDirty && (s.LOGARITHMICDEPTH = i, s.POINTSIZE = r, s.FOG = t.fogEnabled && e.applyFog && t.fogMode !== de.Scene.FOGMODE_NONE && n, s.NONUNIFORMSCALING = e.nonUniformScaling, s.ALPHATEST = o)
                    }, e.PrepareDefinesForFrameBoundValues = function(e, t, i, r, n) {
                        void 0 === n && (n = null);
                        var o, s, a, l, u = !1;
                        o = null == n ? void 0 !== e.clipPlane && null !== e.clipPlane : n, s = null == n ? void 0 !== e.clipPlane2 && null !== e.clipPlane2 : n, a = null == n ? void 0 !== e.clipPlane3 && null !== e.clipPlane3 : n, l = null == n ? void 0 !== e.clipPlane4 && null !== e.clipPlane4 : n, i.CLIPPLANE !== o && (i.CLIPPLANE = o, u = !0), i.CLIPPLANE2 !== s && (i.CLIPPLANE2 = s, u = !0), i.CLIPPLANE3 !== a && (i.CLIPPLANE3 = a, u = !0), i.CLIPPLANE4 !== l && (i.CLIPPLANE4 = l, u = !0), i.DEPTHPREPASS !== !t.getColorWrite() && (i.DEPTHPREPASS = !i.DEPTHPREPASS, u = !0), i.INSTANCES !== r && (i.INSTANCES = r, u = !0), u && i.markAsUnprocessed()
                    }, e.PrepareDefinesForAttributes = function(e, t, i, r, n, o) {
                        if (void 0 === n && (n = !1), void 0 === o && (o = !0), !t._areAttributesDirty && t._needNormals === t._normals && t._needUVs === t._uvs) return !1;
                        if (t._normals = t._needNormals, t._uvs = t._needUVs, t.NORMAL = t._needNormals && e.isVerticesDataPresent(de.VertexBuffer.NormalKind), t._needNormals && e.isVerticesDataPresent(de.VertexBuffer.TangentKind) && (t.TANGENT = !0), t._needUVs ? (t.UV1 = e.isVerticesDataPresent(de.VertexBuffer.UVKind), t.UV2 = e.isVerticesDataPresent(de.VertexBuffer.UV2Kind)) : (t.UV1 = !1, t.UV2 = !1), i) {
                            var s = e.useVertexColors && e.isVerticesDataPresent(de.VertexBuffer.ColorKind);
                            t.VERTEXCOLOR = s, t.VERTEXALPHA = e.hasVertexAlpha && s && o
                        }
                        if (r && (e.useBones && e.computeBonesUsingShaders && e.skeleton ? (t.NUM_BONE_INFLUENCERS = e.numBoneInfluencers, t.BonesPerMesh = e.skeleton.bones.length + 1) : (t.NUM_BONE_INFLUENCERS = 0, t.BonesPerMesh = 0)), n) {
                            var a = e.morphTargetManager;
                            a ? (t.MORPHTARGETS_TANGENT = a.supportsTangents && t.TANGENT, t.MORPHTARGETS_NORMAL = a.supportsNormals && t.NORMAL, t.MORPHTARGETS = 0 < a.numInfluencers, t.NUM_MORPH_INFLUENCERS = a.numInfluencers) : (t.MORPHTARGETS_TANGENT = !1, t.MORPHTARGETS_NORMAL = !1, t.MORPHTARGETS = !1, t.NUM_MORPH_INFLUENCERS = 0)
                        }
                        return !0
                    }, e.PrepareDefinesForLights = function(e, t, i, r, n, o) {
                        if (void 0 === n && (n = 4), void 0 === o && (o = !1), !i._areLightsDirty) return i._needNormals;
                        var s = 0,
                            a = !1,
                            l = !1,
                            u = !1,
                            c = !1,
                            h = !1;
                        if (e.lightsEnabled && !o)
                            for (var d = 0, p = t._lightSources; d < p.length; d++) {
                                var f = p[d];
                                switch (a = !0, void 0 === i["LIGHT" + s] && (l = !0), i["LIGHT" + s] = !0, i["SPOTLIGHT" + s] = !1, i["HEMILIGHT" + s] = !1, i["POINTLIGHT" + s] = !1, i["DIRLIGHT" + s] = !1, f.prepareLightSpecificDefines(i, s), i["LIGHT_FALLOFF_PHYSICAL" + s] = !1, i["LIGHT_FALLOFF_GLTF" + s] = !1, i["LIGHT_FALLOFF_STANDARD" + s] = !1, f.falloffType) {
                                    case de.Light.FALLOFF_GLTF:
                                        i["LIGHT_FALLOFF_GLTF" + s] = !0;
                                        break;
                                    case de.Light.FALLOFF_PHYSICAL:
                                        i["LIGHT_FALLOFF_PHYSICAL" + s] = !0;
                                        break;
                                    case de.Light.FALLOFF_STANDARD:
                                        i["LIGHT_FALLOFF_STANDARD" + s] = !0
                                }
                                if (r && !f.specular.equalsFloats(0, 0, 0) && (h = !0), i["SHADOW" + s] = !1, i["SHADOWPCF" + s] = !1, i["SHADOWPCSS" + s] = !1, i["SHADOWPOISSON" + s] = !1, i["SHADOWESM" + s] = !1, i["SHADOWCUBE" + s] = !1, i["SHADOWLOWQUALITY" + s] = !1, i["SHADOWMEDIUMQUALITY" + s] = !1, t && t.receiveShadows && e.shadowsEnabled && f.shadowEnabled) {
                                    var _ = f.getShadowGenerator();
                                    if (_) {
                                        var m = _.getShadowMap();
                                        m && m.renderList && 0 < m.renderList.length && (c = !0, _.prepareDefines(i, s))
                                    }
                                }
                                if (f.lightmapMode != de.Light.LIGHTMAP_DEFAULT ? (u = !0, i["LIGHTMAPEXCLUDED" + s] = !0, i["LIGHTMAPNOSPECULAR" + s] = f.lightmapMode == de.Light.LIGHTMAP_SHADOWSONLY) : (i["LIGHTMAPEXCLUDED" + s] = !1, i["LIGHTMAPNOSPECULAR" + s] = !1), ++s === n) break
                            }
                        i.SPECULARTERM = h, i.SHADOWS = c;
                        for (var g = s; g < n; g++) void 0 !== i["LIGHT" + g] && (i["LIGHT" + g] = !1, i["HEMILIGHT" + s] = !1, i["POINTLIGHT" + s] = !1, i["DIRLIGHT" + s] = !1, i["SPOTLIGHT" + s] = !1, i["SHADOW" + s] = !1);
                        var v = e.getEngine().getCaps();
                        return void 0 === i.SHADOWFLOAT && (l = !0), i.SHADOWFLOAT = c && (v.textureFloatRender && v.textureFloatLinearFiltering || v.textureHalfFloatRender && v.textureHalfFloatLinearFiltering), i.LIGHTMAPEXCLUDED = u, l && i.rebuild(), a
                    }, e.PrepareUniformsAndSamplersList = function(e, t, i, r) {
                        var n;
                        void 0 === r && (r = 4);
                        var o = null;
                        if (e.uniformsNames) {
                            var s = e;
                            n = s.uniformsNames, o = s.uniformBuffersNames, t = s.samplers, i = s.defines, r = s.maxSimultaneousLights
                        } else n = e, t || (t = []);
                        for (var a = 0; a < r && i["LIGHT" + a]; a++) n.push("vLightData" + a, "vLightDiffuse" + a, "vLightSpecular" + a, "vLightDirection" + a, "vLightFalloff" + a, "vLightGround" + a, "lightMatrix" + a, "shadowsInfo" + a, "depthValues" + a), o && o.push("Light" + a), t.push("shadowSampler" + a), t.push("depthSampler" + a), i["PROJECTEDLIGHTTEXTURE" + a] && (t.push("projectionLightSampler" + a), n.push("textureProjectionMatrix" + a));
                        i.NUM_MORPH_INFLUENCERS && n.push("morphTargetInfluences")
                    }, e.HandleFallbacksForShadows = function(e, t, i, r) {
                        void 0 === i && (i = 4), void 0 === r && (r = 0);
                        for (var n = 0, o = 0; o < i && e["LIGHT" + o]; o++) 0 < o && (n = r + o, t.addFallback(n, "LIGHT" + o)), e.SHADOWS || (e["SHADOW" + o] && t.addFallback(r, "SHADOW" + o), e["SHADOWPCF" + o] && t.addFallback(r, "SHADOWPCF" + o), e["SHADOWPCSS" + o] && t.addFallback(r, "SHADOWPCSS" + o), e["SHADOWPOISSON" + o] && t.addFallback(r, "SHADOWPOISSON" + o), e["SHADOWESM" + o] && t.addFallback(r, "SHADOWESM" + o));
                        return n++
                    }, e.PrepareAttributesForMorphTargets = function(e, t, i) {
                        var r = i.NUM_MORPH_INFLUENCERS;
                        if (0 < r && de.Engine.LastCreatedEngine)
                            for (var n = de.Engine.LastCreatedEngine.getCaps().maxVertexAttribs, o = t.morphTargetManager, s = o && o.supportsNormals && i.NORMAL, a = o && o.supportsTangents && i.TANGENT, l = 0; l < r; l++) e.push(de.VertexBuffer.PositionKind + l), s && e.push(de.VertexBuffer.NormalKind + l), a && e.push(de.VertexBuffer.TangentKind + l), e.length > n && de.Tools.Error("Cannot add more vertex attributes for mesh " + t.name)
                    }, e.PrepareAttributesForBones = function(e, t, i, r) {
                        0 < i.NUM_BONE_INFLUENCERS && (r.addCPUSkinningFallback(0, t), e.push(de.VertexBuffer.MatricesIndicesKind), e.push(de.VertexBuffer.MatricesWeightsKind), 4 < i.NUM_BONE_INFLUENCERS && (e.push(de.VertexBuffer.MatricesIndicesExtraKind), e.push(de.VertexBuffer.MatricesWeightsExtraKind)))
                    }, e.PrepareAttributesForInstances = function(e, t) {
                        t.INSTANCES && (e.push("world0"), e.push("world1"), e.push("world2"), e.push("world3"))
                    }, e.BindLightShadow = function(e, t, i, r, n) {
                        if (e.shadowEnabled && i.receiveShadows) {
                            var o = e.getShadowGenerator();
                            o && o.bindShadowLight(r, n)
                        }
                    }, e.BindLightProperties = function(e, t, i) {
                        e.transferToEffect(t, i + "")
                    }, e.BindLights = function(t, i, r, n, o, s) {
                        void 0 === o && (o = 4), void 0 === s && (s = !1);
                        for (var a = Math.min(i._lightSources.length, o), l = 0; l < a; l++) {
                            var u = i._lightSources[l],
                                c = l.toString(),
                                h = u.getScaledIntensity();
                            u._uniformBuffer.bindToEffect(r, "Light" + l), e.BindLightProperties(u, r, l), u.diffuse.scaleToRef(h, de.Tmp.Color3[0]), u._uniformBuffer.updateColor4("vLightDiffuse", de.Tmp.Color3[0], s ? u.radius : u.range, c), n.SPECULARTERM && (u.specular.scaleToRef(h, de.Tmp.Color3[1]), u._uniformBuffer.updateColor3("vLightSpecular", de.Tmp.Color3[1], c)), t.shadowsEnabled && this.BindLightShadow(u, t, i, c, r), u._uniformBuffer.update()
                        }
                    }, e.BindFogParameters = function(e, t, i, r) {
                        void 0 === r && (r = !1), e.fogEnabled && t.applyFog && e.fogMode !== de.Scene.FOGMODE_NONE && (i.setFloat4("vFogInfos", e.fogMode, e.fogStart, e.fogEnd, e.fogDensity), r ? (e.fogColor.toLinearSpaceToRef(this._tempFogColor), i.setColor3("vFogColor", this._tempFogColor)) : i.setColor3("vFogColor", e.fogColor))
                    }, e.BindBonesParameters = function(e, t) {
                        if (t && e && (e.computeBonesUsingShaders && t._bonesComputationForcedToCPU && (e.computeBonesUsingShaders = !1), e.useBones && e.computeBonesUsingShaders && e.skeleton)) {
                            var i = e.skeleton.getTransformMatrices(e);
                            i && t.setMatrices("mBones", i)
                        }
                    }, e.BindMorphTargetParameters = function(e, t) {
                        var i = e.morphTargetManager;
                        e && i && t.setFloatArray("morphTargetInfluences", i.influences)
                    }, e.BindLogDepth = function(e, t, i) {
                        e.LOGARITHMICDEPTH && t.setFloat("logarithmicDepthConstant", 2 / (Math.log(i.activeCamera.maxZ + 1) / Math.LN2))
                    }, e.BindClipPlane = function(e, t) {
                        if (t.clipPlane) {
                            var i = t.clipPlane;
                            e.setFloat4("vClipPlane", i.normal.x, i.normal.y, i.normal.z, i.d)
                        }
                        t.clipPlane2 && (i = t.clipPlane2, e.setFloat4("vClipPlane2", i.normal.x, i.normal.y, i.normal.z, i.d)), t.clipPlane3 && (i = t.clipPlane3, e.setFloat4("vClipPlane3", i.normal.x, i.normal.y, i.normal.z, i.d)), t.clipPlane4 && (i = t.clipPlane4, e.setFloat4("vClipPlane4", i.normal.x, i.normal.y, i.normal.z, i.d))
                    }, e._tempFogColor = de.Color3.Black(), e
                }(), de.MaterialHelper = pe, fe = $a || ($a = {}), _e = function(e) {
                    function t(t, i) {
                        var r = e.call(this, t, i) || this;
                        return r._normalMatrix = new fe.Matrix, r.storeEffectOnSubMeshes = !0, r
                    }
                    return b(t, e), t.prototype.getEffect = function() {
                        return this._activeEffect
                    }, t.prototype.isReady = function(e, t) {
                        return !!e && (!e.subMeshes || 0 === e.subMeshes.length || this.isReadyForSubMesh(e, e.subMeshes[0], t))
                    }, t.prototype.bindOnlyWorldMatrix = function(e) {
                        this._activeEffect.setMatrix("world", e)
                    }, t.prototype.bindOnlyNormalMatrix = function(e) {
                        this._activeEffect.setMatrix("normalMatrix", e)
                    }, t.prototype.bind = function(e, t) {
                        t && this.bindForSubMesh(e, t, t.subMeshes[0])
                    }, t.prototype._afterBind = function(t, i) {
                        void 0 === i && (i = null), e.prototype._afterBind.call(this, t), this.getScene()._cachedEffect = i
                    }, t.prototype._mustRebind = function(e, t, i) {
                        return void 0 === i && (i = 1), e.isCachedMaterialInvalid(this, t, i)
                    }, t
                }(fe.Material), fe.PushMaterial = _e,
                function(e) {
                    var t = function(e) {
                        function t() {
                            var t = e.call(this) || this;
                            return t.MAINUV1 = !1, t.MAINUV2 = !1, t.DIFFUSE = !1, t.DIFFUSEDIRECTUV = 0, t.AMBIENT = !1, t.AMBIENTDIRECTUV = 0, t.OPACITY = !1, t.OPACITYDIRECTUV = 0, t.OPACITYRGB = !1, t.REFLECTION = !1, t.EMISSIVE = !1, t.EMISSIVEDIRECTUV = 0, t.SPECULAR = !1, t.SPECULARDIRECTUV = 0, t.BUMP = !1, t.BUMPDIRECTUV = 0, t.PARALLAX = !1, t.PARALLAXOCCLUSION = !1, t.SPECULAROVERALPHA = !1, t.CLIPPLANE = !1, t.CLIPPLANE2 = !1, t.CLIPPLANE3 = !1, t.CLIPPLANE4 = !1, t.ALPHATEST = !1, t.DEPTHPREPASS = !1, t.ALPHAFROMDIFFUSE = !1, t.POINTSIZE = !1, t.FOG = !1, t.SPECULARTERM = !1, t.DIFFUSEFRESNEL = !1, t.OPACITYFRESNEL = !1, t.REFLECTIONFRESNEL = !1, t.REFRACTIONFRESNEL = !1, t.EMISSIVEFRESNEL = !1, t.FRESNEL = !1, t.NORMAL = !1, t.UV1 = !1, t.UV2 = !1, t.VERTEXCOLOR = !1, t.VERTEXALPHA = !1, t.NUM_BONE_INFLUENCERS = 0, t.BonesPerMesh = 0, t.INSTANCES = !1, t.GLOSSINESS = !1, t.ROUGHNESS = !1, t.EMISSIVEASILLUMINATION = !1, t.LINKEMISSIVEWITHDIFFUSE = !1, t.REFLECTIONFRESNELFROMSPECULAR = !1, t.LIGHTMAP = !1, t.LIGHTMAPDIRECTUV = 0, t.OBJECTSPACE_NORMALMAP = !1, t.USELIGHTMAPASSHADOWMAP = !1, t.REFLECTIONMAP_3D = !1, t.REFLECTIONMAP_SPHERICAL = !1, t.REFLECTIONMAP_PLANAR = !1, t.REFLECTIONMAP_CUBIC = !1, t.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, t.REFLECTIONMAP_PROJECTION = !1, t.REFLECTIONMAP_SKYBOX = !1,
                                t.REFLECTIONMAP_SKYBOX_TRANSFORMED = !1, t.REFLECTIONMAP_EXPLICIT = !1, t.REFLECTIONMAP_EQUIRECTANGULAR = !1, t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, t.INVERTCUBICMAP = !1, t.LOGARITHMICDEPTH = !1, t.REFRACTION = !1, t.REFRACTIONMAP_3D = !1, t.REFLECTIONOVERALPHA = !1, t.TWOSIDEDLIGHTING = !1, t.SHADOWFLOAT = !1, t.MORPHTARGETS = !1, t.MORPHTARGETS_NORMAL = !1, t.MORPHTARGETS_TANGENT = !1, t.NUM_MORPH_INFLUENCERS = 0, t.NONUNIFORMSCALING = !1, t.PREMULTIPLYALPHA = !1, t.IMAGEPROCESSING = !1, t.VIGNETTE = !1, t.VIGNETTEBLENDMODEMULTIPLY = !1, t.VIGNETTEBLENDMODEOPAQUE = !1, t.TONEMAPPING = !1, t.TONEMAPPING_ACES = !1, t.CONTRAST = !1, t.COLORCURVES = !1, t.COLORGRADING = !1, t.COLORGRADING3D = !1, t.SAMPLER3DGREENDEPTH = !1, t.SAMPLER3DBGRMAP = !1, t.IMAGEPROCESSINGPOSTPROCESS = !1, t.IS_REFLECTION_LINEAR = !1, t.IS_REFRACTION_LINEAR = !1, t.EXPOSURE = !1, t.rebuild(), t
                        }
                        return b(t, e), t.prototype.setReflectionMode = function(e) {
                            for (var t = 0, i = ["REFLECTIONMAP_CUBIC", "REFLECTIONMAP_EXPLICIT", "REFLECTIONMAP_PLANAR", "REFLECTIONMAP_PROJECTION", "REFLECTIONMAP_PROJECTION", "REFLECTIONMAP_SKYBOX", "REFLECTIONMAP_SPHERICAL", "REFLECTIONMAP_EQUIRECTANGULAR", "REFLECTIONMAP_EQUIRECTANGULAR_FIXED", "REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED"]; t < i.length; t++) {
                                var r = i[t];
                                this[r] = r === e
                            }
                        }, t
                    }(e.MaterialDefines);
                    e.StandardMaterialDefines = t;
                    var i = function(i) {
                        function r(t, n) {
                            var o = i.call(this, t, n) || this;
                            return o.ambientColor = new e.Color3(0, 0, 0), o.diffuseColor = new e.Color3(1, 1, 1), o.specularColor = new e.Color3(1, 1, 1), o.emissiveColor = new e.Color3(0, 0, 0), o.specularPower = 64, o._useAlphaFromDiffuseTexture = !1, o._useEmissiveAsIllumination = !1, o._linkEmissiveWithDiffuse = !1, o._useSpecularOverAlpha = !1, o._useReflectionOverAlpha = !1, o._disableLighting = !1, o._useObjectSpaceNormalMap = !1, o._useParallax = !1, o._useParallaxOcclusion = !1, o.parallaxScaleBias = .05, o._roughness = 0, o.indexOfRefraction = .98, o.invertRefractionY = !0, o.alphaCutOff = .4, o._useLightmapAsShadowmap = !1, o._useReflectionFresnelFromSpecular = !1, o._useGlossinessFromSpecularMapAlpha = !1, o._maxSimultaneousLights = 4, o._invertNormalMapX = !1, o._invertNormalMapY = !1, o._twoSidedLighting = !1, o._renderTargets = new e.SmartArray(16), o._worldViewProjectionMatrix = e.Matrix.Zero(), o._globalAmbientColor = new e.Color3(0, 0, 0), o._attachImageProcessingConfiguration(null), o.getRenderTargetTextures = function() {
                                return o._renderTargets.reset(), r.ReflectionTextureEnabled && o._reflectionTexture && o._reflectionTexture.isRenderTarget && o._renderTargets.push(o._reflectionTexture), r.RefractionTextureEnabled && o._refractionTexture && o._refractionTexture.isRenderTarget && o._renderTargets.push(o._refractionTexture), o._renderTargets
                            }, o
                        }
                        return b(r, i), Object.defineProperty(r.prototype, "imageProcessingConfiguration", {
                                get: function() {
                                    return this._imageProcessingConfiguration
                                },
                                set: function(e) {
                                    this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty()
                                },
                                enumerable: !0,
                                configurable: !0
                            }), r.prototype._attachImageProcessingConfiguration = function(e) {
                                var t = this;
                                e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = e || this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function(e) {
                                    t._markAllSubMeshesAsImageProcessingDirty()
                                })))
                            }, Object.defineProperty(r.prototype, "cameraColorCurvesEnabled", {
                                get: function() {
                                    return this.imageProcessingConfiguration.colorCurvesEnabled
                                },
                                set: function(e) {
                                    this.imageProcessingConfiguration.colorCurvesEnabled = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r.prototype, "cameraColorGradingEnabled", {
                                get: function() {
                                    return this.imageProcessingConfiguration.colorGradingEnabled
                                },
                                set: function(e) {
                                    this.imageProcessingConfiguration.colorGradingEnabled = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r.prototype, "cameraToneMappingEnabled", {
                                get: function() {
                                    return this._imageProcessingConfiguration.toneMappingEnabled
                                },
                                set: function(e) {
                                    this._imageProcessingConfiguration.toneMappingEnabled = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r.prototype, "cameraExposure", {
                                get: function() {
                                    return this._imageProcessingConfiguration.exposure
                                },
                                set: function(e) {
                                    this._imageProcessingConfiguration.exposure = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r.prototype, "cameraContrast", {
                                get: function() {
                                    return this._imageProcessingConfiguration.contrast
                                },
                                set: function(e) {
                                    this._imageProcessingConfiguration.contrast = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r.prototype, "cameraColorGradingTexture", {
                                get: function() {
                                    return this._imageProcessingConfiguration.colorGradingTexture
                                },
                                set: function(e) {
                                    this._imageProcessingConfiguration.colorGradingTexture = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r.prototype, "cameraColorCurves", {
                                get: function() {
                                    return this._imageProcessingConfiguration.colorCurves
                                },
                                set: function(e) {
                                    this._imageProcessingConfiguration.colorCurves = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r.prototype, "hasRenderTargetTextures", {
                                get: function() {
                                    return !!(r.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) || !!(r.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget)
                                },
                                enumerable: !0,
                                configurable: !0
                            }), r.prototype.getClassName = function() {
                                return "StandardMaterial"
                            }, Object.defineProperty(r.prototype, "useLogarithmicDepth", {
                                get: function() {
                                    return this._useLogarithmicDepth
                                },
                                set: function(e) {
                                    this._useLogarithmicDepth = e && this.getScene().getEngine().getCaps().fragmentDepthSupported, this._markAllSubMeshesAsMiscDirty()
                                },
                                enumerable: !0,
                                configurable: !0
                            }), r.prototype.needAlphaBlending = function() {
                                return this.alpha < 1 || null != this._opacityTexture || this._shouldUseAlphaFromDiffuseTexture() || this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled
                            }, r.prototype.needAlphaTesting = function() {
                                return null != this._diffuseTexture && this._diffuseTexture.hasAlpha
                            }, r.prototype._shouldUseAlphaFromDiffuseTexture = function() {
                                return null != this._diffuseTexture && this._diffuseTexture.hasAlpha && this._useAlphaFromDiffuseTexture
                            }, r.prototype.getAlphaTestTexture = function() {
                                return this._diffuseTexture
                            }, r.prototype.isReadyForSubMesh = function(i, n, o) {
                                if (void 0 === o && (o = !1), n.effect && this.isFrozen && this._wasPreviouslyReady) return !0;
                                n._materialDefines || (n._materialDefines = new t);
                                var s = this.getScene(),
                                    a = n._materialDefines;
                                if (!this.checkReadyOnEveryCall && n.effect && a._renderId === s.getRenderId()) return !0;
                                var l = s.getEngine();
                                if (a._needNormals = e.MaterialHelper.PrepareDefinesForLights(s, i, a, !0, this._maxSimultaneousLights, this._disableLighting), a._areTexturesDirty) {
                                    if (a._needUVs = !1, a.MAINUV1 = !1, a.MAINUV2 = !1, s.texturesEnabled) {
                                        if (this._diffuseTexture && r.DiffuseTextureEnabled) {
                                            if (!this._diffuseTexture.isReadyOrNotBlocking()) return !1;
                                            e.MaterialHelper.PrepareDefinesForMergedUV(this._diffuseTexture, a, "DIFFUSE")
                                        } else a.DIFFUSE = !1;
                                        if (this._ambientTexture && r.AmbientTextureEnabled) {
                                            if (!this._ambientTexture.isReadyOrNotBlocking()) return !1;
                                            e.MaterialHelper.PrepareDefinesForMergedUV(this._ambientTexture, a, "AMBIENT")
                                        } else a.AMBIENT = !1;
                                        if (this._opacityTexture && r.OpacityTextureEnabled) {
                                            if (!this._opacityTexture.isReadyOrNotBlocking()) return !1;
                                            e.MaterialHelper.PrepareDefinesForMergedUV(this._opacityTexture, a, "OPACITY"), a.OPACITYRGB = this._opacityTexture.getAlphaFromRGB
                                        } else a.OPACITY = !1;
                                        if (this._reflectionTexture && r.ReflectionTextureEnabled) {
                                            if (!this._reflectionTexture.isReadyOrNotBlocking()) return !1;
                                            switch (a._needNormals = !0, a.REFLECTION = !0, a.ROUGHNESS = 0 < this._roughness, a.REFLECTIONOVERALPHA = this._useReflectionOverAlpha, a.INVERTCUBICMAP = this._reflectionTexture.coordinatesMode === e.Texture.INVCUBIC_MODE, a.REFLECTIONMAP_3D = this._reflectionTexture.isCube, this._reflectionTexture.coordinatesMode) {
                                                case e.Texture.EXPLICIT_MODE:
                                                    a.setReflectionMode("REFLECTIONMAP_EXPLICIT");
                                                    break;
                                                case e.Texture.PLANAR_MODE:
                                                    a.setReflectionMode("REFLECTIONMAP_PLANAR");
                                                    break;
                                                case e.Texture.PROJECTION_MODE:
                                                    a.setReflectionMode("REFLECTIONMAP_PROJECTION");
                                                    break;
                                                case e.Texture.SKYBOX_MODE:
                                                    a.setReflectionMode("REFLECTIONMAP_SKYBOX"), a.REFLECTIONMAP_SKYBOX_TRANSFORMED = !this._reflectionTexture.getReflectionTextureMatrix().isIdentity();
                                                    break;
                                                case e.Texture.SPHERICAL_MODE:
                                                    a.setReflectionMode("REFLECTIONMAP_SPHERICAL");
                                                    break;
                                                case e.Texture.EQUIRECTANGULAR_MODE:
                                                    a.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");
                                                    break;
                                                case e.Texture.FIXED_EQUIRECTANGULAR_MODE:
                                                    a.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");
                                                    break;
                                                case e.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
                                                    a.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");
                                                    break;
                                                case e.Texture.CUBIC_MODE:
                                                case e.Texture.INVCUBIC_MODE:
                                                default:
                                                    a.setReflectionMode("REFLECTIONMAP_CUBIC")
                                            }
                                            a.USE_LOCAL_REFLECTIONMAP_CUBIC = !!this._reflectionTexture.boundingBoxSize
                                        } else a.REFLECTION = !1;
                                        if (this._emissiveTexture && r.EmissiveTextureEnabled) {
                                            if (!this._emissiveTexture.isReadyOrNotBlocking()) return !1;
                                            e.MaterialHelper.PrepareDefinesForMergedUV(this._emissiveTexture, a, "EMISSIVE")
                                        } else a.EMISSIVE = !1;
                                        if (this._lightmapTexture && r.LightmapTextureEnabled) {
                                            if (!this._lightmapTexture.isReadyOrNotBlocking()) return !1;
                                            e.MaterialHelper.PrepareDefinesForMergedUV(this._lightmapTexture, a, "LIGHTMAP"), a.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap
                                        } else a.LIGHTMAP = !1;
                                        if (this._specularTexture && r.SpecularTextureEnabled) {
                                            if (!this._specularTexture.isReadyOrNotBlocking()) return !1;
                                            e.MaterialHelper.PrepareDefinesForMergedUV(this._specularTexture, a, "SPECULAR"), a.GLOSSINESS = this._useGlossinessFromSpecularMapAlpha
                                        } else a.SPECULAR = !1;
                                        if (s.getEngine().getCaps().standardDerivatives && this._bumpTexture && r.BumpTextureEnabled) {
                                            if (!this._bumpTexture.isReady()) return !1;
                                            e.MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture, a, "BUMP"), a.PARALLAX = this._useParallax, a.PARALLAXOCCLUSION = this._useParallaxOcclusion, a.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap
                                        } else a.BUMP = !1;
                                        if (this._refractionTexture && r.RefractionTextureEnabled) {
                                            if (!this._refractionTexture.isReadyOrNotBlocking()) return !1;
                                            a._needUVs = !0, a.REFRACTION = !0, a.REFRACTIONMAP_3D = this._refractionTexture.isCube
                                        } else a.REFRACTION = !1;
                                        a.TWOSIDEDLIGHTING = !this._backFaceCulling && this._twoSidedLighting
                                    } else a.DIFFUSE = !1, a.AMBIENT = !1, a.OPACITY = !1, a.REFLECTION = !1, a.EMISSIVE = !1, a.LIGHTMAP = !1, a.BUMP = !1, a.REFRACTION = !1;
                                    a.ALPHAFROMDIFFUSE = this._shouldUseAlphaFromDiffuseTexture(), a.EMISSIVEASILLUMINATION = this._useEmissiveAsIllumination, a.LINKEMISSIVEWITHDIFFUSE = this._linkEmissiveWithDiffuse, a.SPECULAROVERALPHA = this._useSpecularOverAlpha, a.PREMULTIPLYALPHA = this.alphaMode === e.Engine.ALPHA_PREMULTIPLIED || this.alphaMode === e.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF
                                }
                                if (a._areImageProcessingDirty && this._imageProcessingConfiguration) {
                                    if (!this._imageProcessingConfiguration.isReady()) return !1;
                                    this._imageProcessingConfiguration.prepareDefines(a), a.IS_REFLECTION_LINEAR = null != this.reflectionTexture && !this.reflectionTexture.gammaSpace, a.IS_REFRACTION_LINEAR = null != this.refractionTexture && !this.refractionTexture.gammaSpace
                                }
                                if (a._areFresnelDirty && (r.FresnelEnabled ? (this._diffuseFresnelParameters || this._opacityFresnelParameters || this._emissiveFresnelParameters || this._refractionFresnelParameters || this._reflectionFresnelParameters) && (a.DIFFUSEFRESNEL = this._diffuseFresnelParameters && this._diffuseFresnelParameters.isEnabled, a.OPACITYFRESNEL = this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled, a.REFLECTIONFRESNEL = this._reflectionFresnelParameters && this._reflectionFresnelParameters.isEnabled, a.REFLECTIONFRESNELFROMSPECULAR = this._useReflectionFresnelFromSpecular, a.REFRACTIONFRESNEL = this._refractionFresnelParameters && this._refractionFresnelParameters.isEnabled, a.EMISSIVEFRESNEL = this._emissiveFresnelParameters && this._emissiveFresnelParameters.isEnabled, a._needNormals = !0, a.FRESNEL = !0) : a.FRESNEL = !1), e.MaterialHelper.PrepareDefinesForMisc(i, s, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(i), a), e.MaterialHelper.PrepareDefinesForAttributes(i, a, !0, !0, !0), e.MaterialHelper.PrepareDefinesForFrameBoundValues(s, l, a, o), a.isDirty) {
                                    a.markAsProcessed(), s.resetCachedMaterial();
                                    var u = new e.EffectFallbacks;
                                    a.REFLECTION && u.addFallback(0, "REFLECTION"), a.SPECULAR && u.addFallback(0, "SPECULAR"), a.BUMP && u.addFallback(0, "BUMP"), a.PARALLAX && u.addFallback(1, "PARALLAX"), a.PARALLAXOCCLUSION && u.addFallback(0, "PARALLAXOCCLUSION"), a.SPECULAROVERALPHA && u.addFallback(0, "SPECULAROVERALPHA"), a.FOG && u.addFallback(1, "FOG"), a.POINTSIZE && u.addFallback(0, "POINTSIZE"), a.LOGARITHMICDEPTH && u.addFallback(0, "LOGARITHMICDEPTH"), e.MaterialHelper.HandleFallbacksForShadows(a, u, this._maxSimultaneousLights), a.SPECULARTERM && u.addFallback(0, "SPECULARTERM"), a.DIFFUSEFRESNEL && u.addFallback(1, "DIFFUSEFRESNEL"), a.OPACITYFRESNEL && u.addFallback(2, "OPACITYFRESNEL"), a.REFLECTIONFRESNEL && u.addFallback(3, "REFLECTIONFRESNEL"), a.EMISSIVEFRESNEL && u.addFallback(4, "EMISSIVEFRESNEL"), a.FRESNEL && u.addFallback(4, "FRESNEL");
                                    var c = [e.VertexBuffer.PositionKind];
                                    a.NORMAL && c.push(e.VertexBuffer.NormalKind), a.UV1 && c.push(e.VertexBuffer.UVKind), a.UV2 && c.push(e.VertexBuffer.UV2Kind), a.VERTEXCOLOR && c.push(e.VertexBuffer.ColorKind), e.MaterialHelper.PrepareAttributesForBones(c, i, a, u), e.MaterialHelper.PrepareAttributesForInstances(c, a), e.MaterialHelper.PrepareAttributesForMorphTargets(c, i, a);
                                    var h = "default",
                                        d = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vAmbientColor", "vDiffuseColor", "vSpecularColor", "vEmissiveColor", "vFogInfos", "vFogColor", "pointSize", "vDiffuseInfos", "vAmbientInfos", "vOpacityInfos", "vReflectionInfos", "vEmissiveInfos", "vSpecularInfos", "vBumpInfos", "vLightmapInfos", "vRefractionInfos", "mBones", "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "diffuseMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "specularMatrix", "bumpMatrix", "normalMatrix", "lightmapMatrix", "refractionMatrix", "diffuseLeftColor", "diffuseRightColor", "opacityParts", "reflectionLeftColor", "reflectionRightColor", "emissiveLeftColor", "emissiveRightColor", "refractionLeftColor", "refractionRightColor", "vReflectionPosition", "vReflectionSize", "logarithmicDepthConstant", "vTangentSpaceParams", "alphaCutOff"],
                                        p = ["diffuseSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler", "lightmapSampler", "refractionCubeSampler", "refraction2DSampler"],
                                        f = ["Material", "Scene"];
                                    e.ImageProcessingConfiguration && (e.ImageProcessingConfiguration.PrepareUniforms(d, a), e.ImageProcessingConfiguration.PrepareSamplers(p, a)), e.MaterialHelper.PrepareUniformsAndSamplersList({
                                        uniformsNames: d,
                                        uniformBuffersNames: f,
                                        samplers: p,
                                        defines: a,
                                        maxSimultaneousLights: this._maxSimultaneousLights
                                    }), this.customShaderNameResolve && (h = this.customShaderNameResolve(h, d, f, p, a));
                                    var _ = a.toString();
                                    n.setEffect(s.getEngine().createEffect(h, {
                                        attributes: c,
                                        uniformsNames: d,
                                        uniformBuffersNames: f,
                                        samplers: p,
                                        defines: _,
                                        fallbacks: u,
                                        onCompiled: this.onCompiled,
                                        onError: this.onError,
                                        indexParameters: {
                                            maxSimultaneousLights: this._maxSimultaneousLights,
                                            maxSimultaneousMorphTargets: a.NUM_MORPH_INFLUENCERS
                                        }
                                    }, l), a), this.buildUniformLayout()
                                }
                                return !(!n.effect || !n.effect.isReady()) && (a._renderId = s.getRenderId(), this._wasPreviouslyReady = !0)
                            }, r.prototype.buildUniformLayout = function() {
                                this._uniformBuffer.addUniform("diffuseLeftColor", 4), this._uniformBuffer.addUniform("diffuseRightColor", 4), this._uniformBuffer.addUniform("opacityParts", 4), this._uniformBuffer.addUniform("reflectionLeftColor", 4), this._uniformBuffer.addUniform("reflectionRightColor", 4), this._uniformBuffer.addUniform("refractionLeftColor", 4), this._uniformBuffer.addUniform("refractionRightColor", 4), this._uniformBuffer.addUniform("emissiveLeftColor", 4), this._uniformBuffer.addUniform("emissiveRightColor", 4), this._uniformBuffer.addUniform("vDiffuseInfos", 2), this._uniformBuffer.addUniform("vAmbientInfos", 2), this._uniformBuffer.addUniform("vOpacityInfos", 2), this._uniformBuffer.addUniform("vReflectionInfos", 2), this._uniformBuffer.addUniform("vReflectionPosition", 3), this._uniformBuffer.addUniform("vReflectionSize", 3), this._uniformBuffer.addUniform("vEmissiveInfos", 2), this._uniformBuffer.addUniform("vLightmapInfos", 2), this._uniformBuffer.addUniform("vSpecularInfos", 2), this._uniformBuffer.addUniform("vBumpInfos", 3), this._uniformBuffer.addUniform("diffuseMatrix", 16), this._uniformBuffer.addUniform("ambientMatrix", 16), this._uniformBuffer.addUniform("opacityMatrix", 16), this._uniformBuffer.addUniform("reflectionMatrix", 16), this._uniformBuffer.addUniform("emissiveMatrix", 16), this._uniformBuffer.addUniform("lightmapMatrix", 16), this._uniformBuffer.addUniform("specularMatrix", 16), this._uniformBuffer.addUniform("bumpMatrix", 16), this._uniformBuffer.addUniform("vTangentSpaceParams", 2), this._uniformBuffer.addUniform("refractionMatrix", 16), this._uniformBuffer.addUniform("vRefractionInfos", 4), this._uniformBuffer.addUniform("vSpecularColor", 4), this._uniformBuffer.addUniform("vEmissiveColor", 3), this._uniformBuffer.addUniform("vDiffuseColor", 4), this._uniformBuffer.addUniform("pointSize", 1), this._uniformBuffer.create()
                            }, r.prototype.unbind = function() {
                                if (this._activeEffect) {
                                    var e = !1;
                                    this._reflectionTexture && this._reflectionTexture.isRenderTarget && (this._activeEffect.setTexture("reflection2DSampler", null), e = !0), this._refractionTexture && this._refractionTexture.isRenderTarget && (this._activeEffect.setTexture("refraction2DSampler", null), e = !0), e && this._markAllSubMeshesAsTexturesDirty()
                                }
                                i.prototype.unbind.call(this)
                            }, r.prototype.bindForSubMesh = function(t, i, n) {
                                var o = this.getScene(),
                                    s = n._materialDefines;
                                if (s) {
                                    var a = n.effect;
                                    if (a) {
                                        this._activeEffect = a, this.bindOnlyWorldMatrix(t), s.OBJECTSPACE_NORMALMAP && (t.toNormalMatrix(this._normalMatrix), this.bindOnlyNormalMatrix(this._normalMatrix));
                                        var l = this._mustRebind(o, a, i.visibility);
                                        if (e.MaterialHelper.BindBonesParameters(i, a), l) {
                                            if (this._uniformBuffer.bindToEffect(a, "Material"), this.bindViewProjection(a), !this._uniformBuffer.useUbo || !this.isFrozen || !this._uniformBuffer.isSync) {
                                                if (r.FresnelEnabled && s.FRESNEL && (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled && (this._uniformBuffer.updateColor4("diffuseLeftColor", this.diffuseFresnelParameters.leftColor, this.diffuseFresnelParameters.power), this._uniformBuffer.updateColor4("diffuseRightColor", this.diffuseFresnelParameters.rightColor, this.diffuseFresnelParameters.bias)), this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled && this._uniformBuffer.updateColor4("opacityParts", new e.Color3(this.opacityFresnelParameters.leftColor.toLuminance(), this.opacityFresnelParameters.rightColor.toLuminance(), this.opacityFresnelParameters.bias), this.opacityFresnelParameters.power), this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled && (this._uniformBuffer.updateColor4("reflectionLeftColor", this.reflectionFresnelParameters.leftColor, this.reflectionFresnelParameters.power), this._uniformBuffer.updateColor4("reflectionRightColor", this.reflectionFresnelParameters.rightColor, this.reflectionFresnelParameters.bias)), this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled && (this._uniformBuffer.updateColor4("refractionLeftColor", this.refractionFresnelParameters.leftColor, this.refractionFresnelParameters.power), this._uniformBuffer.updateColor4("refractionRightColor", this.refractionFresnelParameters.rightColor, this.refractionFresnelParameters.bias)), this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled && (this._uniformBuffer.updateColor4("emissiveLeftColor", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power), this._uniformBuffer.updateColor4("emissiveRightColor", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias))), o.texturesEnabled) {
                                                    if (this._diffuseTexture && r.DiffuseTextureEnabled && (this._uniformBuffer.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), e.MaterialHelper.BindTextureMatrix(this._diffuseTexture, this._uniformBuffer, "diffuse"), this._diffuseTexture.hasAlpha && a.setFloat("alphaCutOff", this.alphaCutOff)), this._ambientTexture && r.AmbientTextureEnabled && (this._uniformBuffer.updateFloat2("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level), e.MaterialHelper.BindTextureMatrix(this._ambientTexture, this._uniformBuffer, "ambient")), this._opacityTexture && r.OpacityTextureEnabled && (this._uniformBuffer.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level), e.MaterialHelper.BindTextureMatrix(this._opacityTexture, this._uniformBuffer, "opacity")), this._reflectionTexture && r.ReflectionTextureEnabled && (this._uniformBuffer.updateFloat2("vReflectionInfos", this._reflectionTexture.level, this.roughness), this._uniformBuffer.updateMatrix("reflectionMatrix", this._reflectionTexture.getReflectionTextureMatrix()), this._reflectionTexture.boundingBoxSize)) {
                                                        var u = this._reflectionTexture;
                                                        this._uniformBuffer.updateVector3("vReflectionPosition", u.boundingBoxPosition), this._uniformBuffer.updateVector3("vReflectionSize", u.boundingBoxSize)
                                                    }
                                                    if (this._emissiveTexture && r.EmissiveTextureEnabled && (this._uniformBuffer.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level), e.MaterialHelper.BindTextureMatrix(this._emissiveTexture, this._uniformBuffer, "emissive")), this._lightmapTexture && r.LightmapTextureEnabled && (this._uniformBuffer.updateFloat2("vLightmapInfos", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level), e.MaterialHelper.BindTextureMatrix(this._lightmapTexture, this._uniformBuffer, "lightmap")), this._specularTexture && r.SpecularTextureEnabled && (this._uniformBuffer.updateFloat2("vSpecularInfos", this._specularTexture.coordinatesIndex, this._specularTexture.level), e.MaterialHelper.BindTextureMatrix(this._specularTexture, this._uniformBuffer, "specular")), this._bumpTexture && o.getEngine().getCaps().standardDerivatives && r.BumpTextureEnabled && (this._uniformBuffer.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, 1 / this._bumpTexture.level, this.parallaxScaleBias), e.MaterialHelper.BindTextureMatrix(this._bumpTexture, this._uniformBuffer, "bump"), o._mirroredCameraPosition ? this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1 : -1, this._invertNormalMapY ? 1 : -1) : this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1 : 1, this._invertNormalMapY ? -1 : 1)), this._refractionTexture && r.RefractionTextureEnabled) {
                                                        var c = 1;
                                                        this._refractionTexture.isCube || (this._uniformBuffer.updateMatrix("refractionMatrix", this._refractionTexture.getReflectionTextureMatrix()), this._refractionTexture.depth && (c = this._refractionTexture.depth)), this._uniformBuffer.updateFloat4("vRefractionInfos", this._refractionTexture.level, this.indexOfRefraction, c, this.invertRefractionY ? -1 : 1)
                                                    }
                                                }
                                                this.pointsCloud && this._uniformBuffer.updateFloat("pointSize", this.pointSize), s.SPECULARTERM && this._uniformBuffer.updateColor4("vSpecularColor", this.specularColor, this.specularPower), this._uniformBuffer.updateColor3("vEmissiveColor", this.emissiveColor), this._uniformBuffer.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha * i.visibility)
                                            }
                                            o.texturesEnabled && (this._diffuseTexture && r.DiffuseTextureEnabled && a.setTexture("diffuseSampler", this._diffuseTexture), this._ambientTexture && r.AmbientTextureEnabled && a.setTexture("ambientSampler", this._ambientTexture), this._opacityTexture && r.OpacityTextureEnabled && a.setTexture("opacitySampler", this._opacityTexture), this._reflectionTexture && r.ReflectionTextureEnabled && (this._reflectionTexture.isCube ? a.setTexture("reflectionCubeSampler", this._reflectionTexture) : a.setTexture("reflection2DSampler", this._reflectionTexture)), this._emissiveTexture && r.EmissiveTextureEnabled && a.setTexture("emissiveSampler", this._emissiveTexture), this._lightmapTexture && r.LightmapTextureEnabled && a.setTexture("lightmapSampler", this._lightmapTexture), this._specularTexture && r.SpecularTextureEnabled && a.setTexture("specularSampler", this._specularTexture), this._bumpTexture && o.getEngine().getCaps().standardDerivatives && r.BumpTextureEnabled && a.setTexture("bumpSampler", this._bumpTexture), this._refractionTexture && r.RefractionTextureEnabled) && (c = 1, this._refractionTexture.isCube ? a.setTexture("refractionCubeSampler", this._refractionTexture) : a.setTexture("refraction2DSampler", this._refractionTexture)), e.MaterialHelper.BindClipPlane(a, o), o.ambientColor.multiplyToRef(this.ambientColor, this._globalAmbientColor), e.MaterialHelper.BindEyePosition(a, o), a.setColor3("vAmbientColor", this._globalAmbientColor)
                                        }!l && this.isFrozen || (o.lightsEnabled && !this._disableLighting && e.MaterialHelper.BindLights(o, i, a, s, this._maxSimultaneousLights), (o.fogEnabled && i.applyFog && o.fogMode !== e.Scene.FOGMODE_NONE || this._reflectionTexture || this._refractionTexture) && this.bindView(a), e.MaterialHelper.BindFogParameters(o, i, a), s.NUM_MORPH_INFLUENCERS && e.MaterialHelper.BindMorphTargetParameters(i, a), e.MaterialHelper.BindLogDepth(s, a, o), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(this._activeEffect)), this._uniformBuffer.update(), this._afterBind(i, this._activeEffect)
                                    }
                                }
                            }, r.prototype.getAnimatables = function() {
                                var e = [];
                                return this._diffuseTexture && this._diffuseTexture.animations && 0 < this._diffuseTexture.animations.length && e.push(this._diffuseTexture), this._ambientTexture && this._ambientTexture.animations && 0 < this._ambientTexture.animations.length && e.push(this._ambientTexture), this._opacityTexture && this._opacityTexture.animations && 0 < this._opacityTexture.animations.length && e.push(this._opacityTexture), this._reflectionTexture && this._reflectionTexture.animations && 0 < this._reflectionTexture.animations.length && e.push(this._reflectionTexture), this._emissiveTexture && this._emissiveTexture.animations && 0 < this._emissiveTexture.animations.length && e.push(this._emissiveTexture), this._specularTexture && this._specularTexture.animations && 0 < this._specularTexture.animations.length && e.push(this._specularTexture), this._bumpTexture && this._bumpTexture.animations && 0 < this._bumpTexture.animations.length && e.push(this._bumpTexture), this._lightmapTexture && this._lightmapTexture.animations && 0 < this._lightmapTexture.animations.length && e.push(this._lightmapTexture), this._refractionTexture && this._refractionTexture.animations && 0 < this._refractionTexture.animations.length && e.push(this._refractionTexture), e
                            }, r.prototype.getActiveTextures = function() {
                                var e = i.prototype.getActiveTextures.call(this);
                                return this._diffuseTexture && e.push(this._diffuseTexture), this._ambientTexture && e.push(this._ambientTexture), this._opacityTexture && e.push(this._opacityTexture), this._reflectionTexture && e.push(this._reflectionTexture), this._emissiveTexture && e.push(this._emissiveTexture), this._specularTexture && e.push(this._specularTexture), this._bumpTexture && e.push(this._bumpTexture), this._lightmapTexture && e.push(this._lightmapTexture), this._refractionTexture && e.push(this._refractionTexture), e
                            }, r.prototype.hasTexture = function(e) {
                                return !!i.prototype.hasTexture.call(this, e) || this._diffuseTexture === e || this._ambientTexture === e || this._opacityTexture === e || this._reflectionTexture === e || this._emissiveTexture === e || this._specularTexture === e || this._bumpTexture === e || this._lightmapTexture === e || this._refractionTexture === e
                            }, r.prototype.dispose = function(e, t) {
                                t && (this._diffuseTexture && this._diffuseTexture.dispose(), this._ambientTexture && this._ambientTexture.dispose(), this._opacityTexture && this._opacityTexture.dispose(), this._reflectionTexture && this._reflectionTexture.dispose(), this._emissiveTexture && this._emissiveTexture.dispose(), this._specularTexture && this._specularTexture.dispose(), this._bumpTexture && this._bumpTexture.dispose(), this._lightmapTexture && this._lightmapTexture.dispose(), this._refractionTexture && this._refractionTexture.dispose()), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), i.prototype.dispose.call(this, e, t)
                            }, r.prototype.clone = function(t) {
                                var i = this,
                                    n = e.SerializationHelper.Clone(function() {
                                        return new r(t, i.getScene())
                                    }, this);
                                return n.name = t, n.id = t, n
                            }, r.prototype.serialize = function() {
                                return e.SerializationHelper.Serialize(this)
                            }, r.Parse = function(t, i, n) {
                                return e.SerializationHelper.Parse(function() {
                                    return new r(t.name, i)
                                }, t, i, n)
                            }, Object.defineProperty(r, "DiffuseTextureEnabled", {
                                get: function() {
                                    return r._DiffuseTextureEnabled
                                },
                                set: function(t) {
                                    r._DiffuseTextureEnabled !== t && (r._DiffuseTextureEnabled = t, e.Engine.MarkAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r, "AmbientTextureEnabled", {
                                get: function() {
                                    return r._AmbientTextureEnabled
                                },
                                set: function(t) {
                                    r._AmbientTextureEnabled !== t && (r._AmbientTextureEnabled = t, e.Engine.MarkAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r, "OpacityTextureEnabled", {
                                get: function() {
                                    return r._OpacityTextureEnabled
                                },
                                set: function(t) {
                                    r._OpacityTextureEnabled !== t && (r._OpacityTextureEnabled = t, e.Engine.MarkAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r, "ReflectionTextureEnabled", {
                                get: function() {
                                    return r._ReflectionTextureEnabled
                                },
                                set: function(t) {
                                    r._ReflectionTextureEnabled !== t && (r._ReflectionTextureEnabled = t, e.Engine.MarkAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r, "EmissiveTextureEnabled", {
                                get: function() {
                                    return r._EmissiveTextureEnabled
                                },
                                set: function(t) {
                                    r._EmissiveTextureEnabled !== t && (r._EmissiveTextureEnabled = t, e.Engine.MarkAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r, "SpecularTextureEnabled", {
                                get: function() {
                                    return r._SpecularTextureEnabled
                                },
                                set: function(t) {
                                    r._SpecularTextureEnabled !== t && (r._SpecularTextureEnabled = t, e.Engine.MarkAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r, "BumpTextureEnabled", {
                                get: function() {
                                    return r._BumpTextureEnabled
                                },
                                set: function(t) {
                                    r._BumpTextureEnabled !== t && (r._BumpTextureEnabled = t, e.Engine.MarkAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r, "LightmapTextureEnabled", {
                                get: function() {
                                    return r._LightmapTextureEnabled
                                },
                                set: function(t) {
                                    r._LightmapTextureEnabled !== t && (r._LightmapTextureEnabled = t, e.Engine.MarkAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r, "RefractionTextureEnabled", {
                                get: function() {
                                    return r._RefractionTextureEnabled
                                },
                                set: function(t) {
                                    r._RefractionTextureEnabled !== t && (r._RefractionTextureEnabled = t, e.Engine.MarkAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r, "ColorGradingTextureEnabled", {
                                get: function() {
                                    return r._ColorGradingTextureEnabled
                                },
                                set: function(t) {
                                    r._ColorGradingTextureEnabled !== t && (r._ColorGradingTextureEnabled = t, e.Engine.MarkAllMaterialsAsDirty(e.Material.TextureDirtyFlag))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r, "FresnelEnabled", {
                                get: function() {
                                    return r._FresnelEnabled
                                },
                                set: function(t) {
                                    r._FresnelEnabled !== t && (r._FresnelEnabled = t, e.Engine.MarkAllMaterialsAsDirty(e.Material.FresnelDirtyFlag))
                                },
                                enumerable: !0,
                                configurable: !0
                            }), r._DiffuseTextureEnabled = !0, r._AmbientTextureEnabled = !0, r._OpacityTextureEnabled = !0, r._ReflectionTextureEnabled = !0, r._EmissiveTextureEnabled = !0, r._SpecularTextureEnabled = !0, r._BumpTextureEnabled = !0, r._LightmapTextureEnabled = !0, r._RefractionTextureEnabled = !0, r._ColorGradingTextureEnabled = !0, r._FresnelEnabled = !0, y([e.serializeAsTexture("diffuseTexture")], r.prototype, "_diffuseTexture", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")], r.prototype, "diffuseTexture", void 0), y([e.serializeAsTexture("ambientTexture")], r.prototype, "_ambientTexture", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "ambientTexture", void 0), y([e.serializeAsTexture("opacityTexture")], r.prototype, "_opacityTexture", void 0),
                            y([e.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")], r.prototype, "opacityTexture", void 0), y([e.serializeAsTexture("reflectionTexture")], r.prototype, "_reflectionTexture", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "reflectionTexture", void 0), y([e.serializeAsTexture("emissiveTexture")], r.prototype, "_emissiveTexture", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "emissiveTexture", void 0), y([e.serializeAsTexture("specularTexture")], r.prototype, "_specularTexture", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "specularTexture", void 0), y([e.serializeAsTexture("bumpTexture")], r.prototype, "_bumpTexture", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "bumpTexture", void 0), y([e.serializeAsTexture("lightmapTexture")], r.prototype, "_lightmapTexture", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "lightmapTexture", void 0), y([e.serializeAsTexture("refractionTexture")], r.prototype, "_refractionTexture", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "refractionTexture", void 0), y([e.serializeAsColor3("ambient")], r.prototype, "ambientColor", void 0), y([e.serializeAsColor3("diffuse")], r.prototype, "diffuseColor", void 0), y([e.serializeAsColor3("specular")], r.prototype, "specularColor", void 0), y([e.serializeAsColor3("emissive")], r.prototype, "emissiveColor", void 0), y([e.serialize()], r.prototype, "specularPower", void 0), y([e.serialize("useAlphaFromDiffuseTexture")], r.prototype, "_useAlphaFromDiffuseTexture", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "useAlphaFromDiffuseTexture", void 0), y([e.serialize("useEmissiveAsIllumination")], r.prototype, "_useEmissiveAsIllumination", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "useEmissiveAsIllumination", void 0), y([e.serialize("linkEmissiveWithDiffuse")], r.prototype, "_linkEmissiveWithDiffuse", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "linkEmissiveWithDiffuse", void 0), y([e.serialize("useSpecularOverAlpha")], r.prototype, "_useSpecularOverAlpha", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "useSpecularOverAlpha", void 0), y([e.serialize("useReflectionOverAlpha")], r.prototype, "_useReflectionOverAlpha", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "useReflectionOverAlpha", void 0), y([e.serialize("disableLighting")], r.prototype, "_disableLighting", void 0), y([e.expandToProperty("_markAllSubMeshesAsLightsDirty")], r.prototype, "disableLighting", void 0), y([e.serialize("useObjectSpaceNormalMap")], r.prototype, "_useObjectSpaceNormalMap", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "useObjectSpaceNormalMap", void 0), y([e.serialize("useParallax")], r.prototype, "_useParallax", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "useParallax", void 0), y([e.serialize("useParallaxOcclusion")], r.prototype, "_useParallaxOcclusion", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "useParallaxOcclusion", void 0), y([e.serialize()], r.prototype, "parallaxScaleBias", void 0), y([e.serialize("roughness")], r.prototype, "_roughness", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "roughness", void 0), y([e.serialize()], r.prototype, "indexOfRefraction", void 0), y([e.serialize()], r.prototype, "invertRefractionY", void 0), y([e.serialize()], r.prototype, "alphaCutOff", void 0), y([e.serialize("useLightmapAsShadowmap")], r.prototype, "_useLightmapAsShadowmap", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "useLightmapAsShadowmap", void 0), y([e.serializeAsFresnelParameters("diffuseFresnelParameters")], r.prototype, "_diffuseFresnelParameters", void 0), y([e.expandToProperty("_markAllSubMeshesAsFresnelDirty")], r.prototype, "diffuseFresnelParameters", void 0), y([e.serializeAsFresnelParameters("opacityFresnelParameters")], r.prototype, "_opacityFresnelParameters", void 0), y([e.expandToProperty("_markAllSubMeshesAsFresnelAndMiscDirty")], r.prototype, "opacityFresnelParameters", void 0), y([e.serializeAsFresnelParameters("reflectionFresnelParameters")], r.prototype, "_reflectionFresnelParameters", void 0), y([e.expandToProperty("_markAllSubMeshesAsFresnelDirty")], r.prototype, "reflectionFresnelParameters", void 0), y([e.serializeAsFresnelParameters("refractionFresnelParameters")], r.prototype, "_refractionFresnelParameters", void 0), y([e.expandToProperty("_markAllSubMeshesAsFresnelDirty")], r.prototype, "refractionFresnelParameters", void 0), y([e.serializeAsFresnelParameters("emissiveFresnelParameters")], r.prototype, "_emissiveFresnelParameters", void 0), y([e.expandToProperty("_markAllSubMeshesAsFresnelDirty")], r.prototype, "emissiveFresnelParameters", void 0), y([e.serialize("useReflectionFresnelFromSpecular")], r.prototype, "_useReflectionFresnelFromSpecular", void 0), y([e.expandToProperty("_markAllSubMeshesAsFresnelDirty")], r.prototype, "useReflectionFresnelFromSpecular", void 0), y([e.serialize("useGlossinessFromSpecularMapAlpha")], r.prototype, "_useGlossinessFromSpecularMapAlpha", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "useGlossinessFromSpecularMapAlpha", void 0), y([e.serialize("maxSimultaneousLights")], r.prototype, "_maxSimultaneousLights", void 0), y([e.expandToProperty("_markAllSubMeshesAsLightsDirty")], r.prototype, "maxSimultaneousLights", void 0), y([e.serialize("invertNormalMapX")], r.prototype, "_invertNormalMapX", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "invertNormalMapX", void 0), y([e.serialize("invertNormalMapY")], r.prototype, "_invertNormalMapY", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "invertNormalMapY", void 0), y([e.serialize("twoSidedLighting")], r.prototype, "_twoSidedLighting", void 0), y([e.expandToProperty("_markAllSubMeshesAsTexturesDirty")], r.prototype, "twoSidedLighting", void 0), y([e.serialize()], r.prototype, "useLogarithmicDepth", null), r
                    }(e.PushMaterial);
                    e.StandardMaterial = i
                }($a || ($a = {})),
                function(e) {
                    var t = function() {
                        function t() {
                            this.x = e.Vector3.Zero(), this.y = e.Vector3.Zero(), this.z = e.Vector3.Zero(), this.xx = e.Vector3.Zero(), this.yy = e.Vector3.Zero(), this.zz = e.Vector3.Zero(), this.xy = e.Vector3.Zero(), this.yz = e.Vector3.Zero(), this.zx = e.Vector3.Zero()
                        }
                        return t.prototype.addAmbient = function(t) {
                            var i = new e.Vector3(t.r, t.g, t.b);
                            this.xx = this.xx.add(i), this.yy = this.yy.add(i), this.zz = this.zz.add(i)
                        }, t.prototype.scale = function(e) {
                            this.x = this.x.scale(e), this.y = this.y.scale(e), this.z = this.z.scale(e), this.xx = this.xx.scale(e), this.yy = this.yy.scale(e), this.zz = this.zz.scale(e), this.yz = this.yz.scale(e), this.zx = this.zx.scale(e), this.xy = this.xy.scale(e)
                        }, t.FromHarmonics = function(e) {
                            var i = new t;
                            return i.x = e.l11.scale(1.02333), i.y = e.l1_1.scale(1.02333), i.z = e.l10.scale(1.02333), i.xx = e.l00.scale(.886277).subtract(e.l20.scale(.247708)).add(e.lL22.scale(.429043)), i.yy = e.l00.scale(.886277).subtract(e.l20.scale(.247708)).subtract(e.lL22.scale(.429043)), i.zz = e.l00.scale(.886277).add(e.l20.scale(.495417)), i.yz = e.l2_1.scale(.858086), i.zx = e.l21.scale(.858086), i.xy = e.l2_2.scale(.858086), i.scale(1 / Math.PI), i
                        }, t.FromArray = function(i) {
                            var r = new t;
                            return e.Vector3.FromArrayToRef(i[0], 0, r.x), e.Vector3.FromArrayToRef(i[1], 0, r.y), e.Vector3.FromArrayToRef(i[2], 0, r.z), e.Vector3.FromArrayToRef(i[3], 0, r.xx), e.Vector3.FromArrayToRef(i[4], 0, r.yy), e.Vector3.FromArrayToRef(i[5], 0, r.zz), e.Vector3.FromArrayToRef(i[6], 0, r.yz), e.Vector3.FromArrayToRef(i[7], 0, r.zx), e.Vector3.FromArrayToRef(i[8], 0, r.xy), r
                        }, t
                    }();
                    e.SphericalPolynomial = t;
                    var i = function() {
                        function t() {
                            this.l00 = e.Vector3.Zero(), this.l1_1 = e.Vector3.Zero(), this.l10 = e.Vector3.Zero(), this.l11 = e.Vector3.Zero(), this.l2_2 = e.Vector3.Zero(), this.l2_1 = e.Vector3.Zero(), this.l20 = e.Vector3.Zero(), this.l21 = e.Vector3.Zero(), this.lL22 = e.Vector3.Zero()
                        }
                        return t.prototype.addLight = function(t, i, r) {
                            var n = new e.Vector3(i.r, i.g, i.b).scale(r);
                            this.l00 = this.l00.add(n.scale(.282095)), this.l1_1 = this.l1_1.add(n.scale(.488603 * t.y)), this.l10 = this.l10.add(n.scale(.488603 * t.z)), this.l11 = this.l11.add(n.scale(.488603 * t.x)), this.l2_2 = this.l2_2.add(n.scale(1.092548 * t.x * t.y)), this.l2_1 = this.l2_1.add(n.scale(1.092548 * t.y * t.z)), this.l21 = this.l21.add(n.scale(1.092548 * t.x * t.z)), this.l20 = this.l20.add(n.scale(.315392 * (3 * t.z * t.z - 1))), this.lL22 = this.lL22.add(n.scale(.546274 * (t.x * t.x - t.y * t.y)))
                        }, t.prototype.scale = function(e) {
                            this.l00 = this.l00.scale(e), this.l1_1 = this.l1_1.scale(e), this.l10 = this.l10.scale(e), this.l11 = this.l11.scale(e), this.l2_2 = this.l2_2.scale(e), this.l2_1 = this.l2_1.scale(e), this.l20 = this.l20.scale(e), this.l21 = this.l21.scale(e), this.lL22 = this.lL22.scale(e)
                        }, t.prototype.convertIncidentRadianceToIrradiance = function() {
                            this.l00 = this.l00.scale(3.141593), this.l1_1 = this.l1_1.scale(2.094395), this.l10 = this.l10.scale(2.094395), this.l11 = this.l11.scale(2.094395), this.l2_2 = this.l2_2.scale(.785398), this.l2_1 = this.l2_1.scale(.785398), this.l20 = this.l20.scale(.785398), this.l21 = this.l21.scale(.785398), this.lL22 = this.lL22.scale(.785398)
                        }, t.prototype.convertIrradianceToLambertianRadiance = function() {
                            this.scale(1 / Math.PI)
                        }, t.FromPolynomial = function(e) {
                            var i = new t;
                            return i.l00 = e.xx.scale(.376127).add(e.yy.scale(.376127)).add(e.zz.scale(.376126)), i.l1_1 = e.y.scale(.977204), i.l10 = e.z.scale(.977204), i.l11 = e.x.scale(.977204), i.l2_2 = e.xy.scale(1.16538), i.l2_1 = e.yz.scale(1.16538), i.l20 = e.zz.scale(1.34567).subtract(e.xx.scale(.672834)).subtract(e.yy.scale(.672834)), i.l21 = e.zx.scale(1.16538), i.lL22 = e.xx.scale(1.16538).subtract(e.yy.scale(1.16538)), i.scale(Math.PI), i
                        }, t.FromArray = function(i) {
                            var r = new t;
                            return e.Vector3.FromArrayToRef(i[0], 0, r.l00), e.Vector3.FromArrayToRef(i[1], 0, r.l1_1), e.Vector3.FromArrayToRef(i[2], 0, r.l10), e.Vector3.FromArrayToRef(i[3], 0, r.l11), e.Vector3.FromArrayToRef(i[4], 0, r.l2_2), e.Vector3.FromArrayToRef(i[5], 0, r.l2_1), e.Vector3.FromArrayToRef(i[6], 0, r.l20), e.Vector3.FromArrayToRef(i[7], 0, r.l21), e.Vector3.FromArrayToRef(i[8], 0, r.lL22), r
                        }, t
                    }();
                    e.SphericalHarmonics = i
                }($a || ($a = {})), me = $a || ($a = {}), ge = function(e, t, i, r) {
                    this.name = e, this.worldAxisForNormal = t, this.worldAxisForFileX = i, this.worldAxisForFileY = r
                }, ve = function() {
                    function e() {}
                    return e.ConvertCubeMapTextureToSphericalPolynomial = function(e) {
                        if (!e.isCube) return null;
                        var t, i, r = e.getSize().width,
                            n = e.readPixels(0),
                            o = e.readPixels(1);
                        e.isRenderTarget ? (t = e.readPixels(3), i = e.readPixels(2)) : (t = e.readPixels(2), i = e.readPixels(3));
                        var s = e.readPixels(4),
                            a = e.readPixels(5),
                            l = e.gammaSpace,
                            u = me.Engine.TEXTUREFORMAT_RGBA,
                            c = me.Engine.TEXTURETYPE_UNSIGNED_INT;
                        e.textureType && e.textureType !== me.Engine.TEXTURETYPE_UNSIGNED_INT && (c = me.Engine.TEXTURETYPE_FLOAT);
                        var h = {
                            size: r,
                            right: n,
                            left: o,
                            up: t,
                            down: i,
                            front: s,
                            back: a,
                            format: u,
                            type: c,
                            gammaSpace: l
                        };
                        return this.ConvertCubeMapToSphericalPolynomial(h)
                    }, e.ConvertCubeMapToSphericalPolynomial = function(e) {
                        for (var t = new me.SphericalHarmonics, i = 0, r = 2 / e.size, n = r, o = .5 * r - 1, s = 0; s < 6; s++)
                            for (var a = this.FileFaces[s], l = e[a.name], u = o, c = e.format === me.Engine.TEXTUREFORMAT_RGBA ? 4 : 3, h = 0; h < e.size; h++) {
                                for (var d = o, p = 0; p < e.size; p++) {
                                    var f = a.worldAxisForFileX.scale(d).add(a.worldAxisForFileY.scale(u)).add(a.worldAxisForNormal);
                                    f.normalize();
                                    var _ = Math.pow(1 + d * d + u * u, -1.5),
                                        m = l[h * e.size * c + p * c + 0],
                                        g = l[h * e.size * c + p * c + 1],
                                        v = l[h * e.size * c + p * c + 2];
                                    e.type === me.Engine.TEXTURETYPE_UNSIGNED_INT && (m /= 255, g /= 255, v /= 255), e.gammaSpace && (m = Math.pow(me.Scalar.Clamp(m), me.ToLinearSpace), g = Math.pow(me.Scalar.Clamp(g), me.ToLinearSpace), v = Math.pow(me.Scalar.Clamp(v), me.ToLinearSpace));
                                    var y = new me.Color3(m, g, v);
                                    t.addLight(f, y, _), i += _, d += r
                                }
                                u += n
                            }
                        var b = 4 * Math.PI * 6 / 6 / i;
                        return t.scale(b), t.convertIncidentRadianceToIrradiance(), t.convertIrradianceToLambertianRadiance(), me.SphericalPolynomial.FromHarmonics(t)
                    }, e.FileFaces = [new ge("right", new me.Vector3(1, 0, 0), new me.Vector3(0, 0, -1), new me.Vector3(0, -1, 0)), new ge("left", new me.Vector3(-1, 0, 0), new me.Vector3(0, 0, 1), new me.Vector3(0, -1, 0)), new ge("up", new me.Vector3(0, 1, 0), new me.Vector3(1, 0, 0), new me.Vector3(0, 0, 1)), new ge("down", new me.Vector3(0, -1, 0), new me.Vector3(1, 0, 0), new me.Vector3(0, 0, -1)), new ge("front", new me.Vector3(0, 0, 1), new me.Vector3(1, 0, 0), new me.Vector3(0, -1, 0)), new ge("back", new me.Vector3(0, 0, -1), new me.Vector3(-1, 0, 0), new me.Vector3(0, -1, 0))], e
                }(), me.CubeMapToSphericalPolynomialTools = ve, ye = $a || ($a = {}), be = function(e) {
                    function t() {
                        var t = e.call(this) || this;
                        return t.PBR = !0, t.MAINUV1 = !1, t.MAINUV2 = !1, t.UV1 = !1, t.UV2 = !1, t.ALBEDO = !1, t.ALBEDODIRECTUV = 0, t.VERTEXCOLOR = !1, t.AMBIENT = !1, t.AMBIENTDIRECTUV = 0, t.AMBIENTINGRAYSCALE = !1, t.OPACITY = !1, t.VERTEXALPHA = !1, t.OPACITYDIRECTUV = 0, t.OPACITYRGB = !1, t.ALPHATEST = !1, t.DEPTHPREPASS = !1, t.ALPHABLEND = !1, t.ALPHAFROMALBEDO = !1, t.ALPHATESTVALUE = "0.5", t.SPECULAROVERALPHA = !1, t.RADIANCEOVERALPHA = !1, t.ALPHAFRESNEL = !1, t.LINEARALPHAFRESNEL = !1, t.PREMULTIPLYALPHA = !1, t.EMISSIVE = !1, t.EMISSIVEDIRECTUV = 0, t.REFLECTIVITY = !1, t.REFLECTIVITYDIRECTUV = 0, t.SPECULARTERM = !1, t.MICROSURFACEFROMREFLECTIVITYMAP = !1, t.MICROSURFACEAUTOMATIC = !1, t.LODBASEDMICROSFURACE = !1, t.MICROSURFACEMAP = !1, t.MICROSURFACEMAPDIRECTUV = 0, t.METALLICWORKFLOW = !1, t.ROUGHNESSSTOREINMETALMAPALPHA = !1, t.ROUGHNESSSTOREINMETALMAPGREEN = !1, t.METALLNESSSTOREINMETALMAPBLUE = !1, t.AOSTOREINMETALMAPRED = !1, t.ENVIRONMENTBRDF = !1, t.NORMAL = !1, t.TANGENT = !1, t.BUMP = !1, t.BUMPDIRECTUV = 0, t.OBJECTSPACE_NORMALMAP = !1, t.PARALLAX = !1, t.PARALLAXOCCLUSION = !1, t.NORMALXYSCALE = !0, t.LIGHTMAP = !1, t.LIGHTMAPDIRECTUV = 0, t.USELIGHTMAPASSHADOWMAP = !1, t.GAMMALIGHTMAP = !1, t.REFLECTION = !1, t.REFLECTIONMAP_3D = !1, t.REFLECTIONMAP_SPHERICAL = !1, t.REFLECTIONMAP_PLANAR = !1, t.REFLECTIONMAP_CUBIC = !1, t.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, t.REFLECTIONMAP_PROJECTION = !1, t.REFLECTIONMAP_SKYBOX = !1, t.REFLECTIONMAP_SKYBOX_TRANSFORMED = !1, t.REFLECTIONMAP_EXPLICIT = !1, t.REFLECTIONMAP_EQUIRECTANGULAR = !1, t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, t.INVERTCUBICMAP = !1, t.USESPHERICALFROMREFLECTIONMAP = !1, t.USESPHERICALINVERTEX = !1, t.REFLECTIONMAP_OPPOSITEZ = !1, t.LODINREFLECTIONALPHA = !1, t.GAMMAREFLECTION = !1, t.RGBDREFLECTION = !1, t.RADIANCEOCCLUSION = !1, t.HORIZONOCCLUSION = !1, t.REFRACTION = !1, t.REFRACTIONMAP_3D = !1, t.REFRACTIONMAP_OPPOSITEZ = !1, t.LODINREFRACTIONALPHA = !1, t.GAMMAREFRACTION = !1, t.RGBDREFRACTION = !1, t.LINKREFRACTIONTOTRANSPARENCY = !1, t.INSTANCES = !1, t.NUM_BONE_INFLUENCERS = 0, t.BonesPerMesh = 0, t.NONUNIFORMSCALING = !1, t.MORPHTARGETS = !1, t.MORPHTARGETS_NORMAL = !1, t.MORPHTARGETS_TANGENT = !1, t.NUM_MORPH_INFLUENCERS = 0, t.IMAGEPROCESSING = !1, t.VIGNETTE = !1, t.VIGNETTEBLENDMODEMULTIPLY = !1, t.VIGNETTEBLENDMODEOPAQUE = !1, t.TONEMAPPING = !1, t.TONEMAPPING_ACES = !1, t.CONTRAST = !1, t.COLORCURVES = !1, t.COLORGRADING = !1, t.COLORGRADING3D = !1, t.SAMPLER3DGREENDEPTH = !1, t.SAMPLER3DBGRMAP = !1, t.IMAGEPROCESSINGPOSTPROCESS = !1, t.EXPOSURE = !1, t.USEPHYSICALLIGHTFALLOFF = !1, t.USEGLTFLIGHTFALLOFF = !1, t.TWOSIDEDLIGHTING = !1, t.SHADOWFLOAT = !1, t.CLIPPLANE = !1, t.CLIPPLANE2 = !1, t.CLIPPLANE3 = !1, t.CLIPPLANE4 = !1, t.POINTSIZE = !1, t.FOG = !1, t.LOGARITHMICDEPTH = !1, t.FORCENORMALFORWARD = !1, t.SPECULARAA = !1, t.UNLIT = !1, t.rebuild(), t
                    }
                    return b(t, e), t.prototype.reset = function() {
                        e.prototype.reset.call(this), this.ALPHATESTVALUE = "0.5", this.PBR = !0
                    }, t
                }(ye.MaterialDefines), xe = function(e) {
                    function t(i, r) {
                        var n = e.call(this, i, r) || this;
                        return n._directIntensity = 1, n._emissiveIntensity = 1, n._environmentIntensity = 1, n._specularIntensity = 1, n._lightingInfos = new ye.Vector4(n._directIntensity, n._emissiveIntensity, n._environmentIntensity, n._specularIntensity), n._disableBumpMap = !1, n._ambientTextureStrength = 1, n._ambientTextureImpactOnAnalyticalLights = ye.PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, n._ambientColor = new ye.Color3(0, 0, 0), n._albedoColor = new ye.Color3(1, 1, 1), n._reflectivityColor = new ye.Color3(1, 1, 1), n._reflectionColor = new ye.Color3(1, 1, 1), n._emissiveColor = new ye.Color3(0, 0, 0), n._microSurface = .9, n._indexOfRefraction = .66, n._invertRefractionY = !1, n._linkRefractionWithTransparency = !1, n._useLightmapAsShadowmap = !1, n._useHorizonOcclusion = !0, n._useRadianceOcclusion = !0, n._useAlphaFromAlbedoTexture = !1, n._useSpecularOverAlpha = !0, n._useMicroSurfaceFromReflectivityMapAlpha = !1, n._useRoughnessFromMetallicTextureAlpha = !0, n._useRoughnessFromMetallicTextureGreen = !1, n._useMetallnessFromMetallicTextureBlue = !1, n._useAmbientOcclusionFromMetallicTextureRed = !1, n._useAmbientInGrayScale = !1, n._useAutoMicroSurfaceFromReflectivityMap = !1, n._lightFalloff = t.LIGHTFALLOFF_PHYSICAL, n._useRadianceOverAlpha = !0, n._useObjectSpaceNormalMap = !1, n._useParallax = !1, n._useParallaxOcclusion = !1, n._parallaxScaleBias = .05, n._disableLighting = !1, n._maxSimultaneousLights = 4, n._invertNormalMapX = !1, n._invertNormalMapY = !1, n._twoSidedLighting = !1, n._alphaCutOff = .4, n._forceAlphaTest = !1, n._useAlphaFresnel = !1, n._useLinearAlphaFresnel = !1, n._transparencyMode = null, n._environmentBRDFTexture = null, n._forceIrradianceInFragment = !1, n._forceNormalForward = !1, n._enableSpecularAntiAliasing = !1, n._renderTargets = new ye.SmartArray(16), n._globalAmbientColor = new ye.Color3(0, 0, 0), n._unlit = !1, n._attachImageProcessingConfiguration(null), n.getRenderTargetTextures = function() {
                            return n._renderTargets.reset(), ye.StandardMaterial.ReflectionTextureEnabled && n._reflectionTexture && n._reflectionTexture.isRenderTarget && n._renderTargets.push(n._reflectionTexture), ye.StandardMaterial.RefractionTextureEnabled && n._refractionTexture && n._refractionTexture.isRenderTarget && n._renderTargets.push(n._refractionTexture), n._renderTargets
                        }, n._environmentBRDFTexture = ye.TextureTools.GetEnvironmentBRDFTexture(r), n
                    }
                    return b(t, e), t.prototype._attachImageProcessingConfiguration = function(e) {
                        var t = this;
                        e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = e || this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function(e) {
                            t._markAllSubMeshesAsImageProcessingDirty()
                        })))
                    }, Object.defineProperty(t.prototype, "hasRenderTargetTextures", {
                        get: function() {
                            return !!(ye.StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) || !!(ye.StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getClassName = function() {
                        return "PBRBaseMaterial"
                    }, Object.defineProperty(t.prototype, "useLogarithmicDepth", {
                        get: function() {
                            return this._useLogarithmicDepth
                        },
                        set: function(e) {
                            this._useLogarithmicDepth = e && this.getScene().getEngine().getCaps().fragmentDepthSupported
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "transparencyMode", {
                        get: function() {
                            return this._transparencyMode
                        },
                        set: function(e) {
                            this._transparencyMode !== e && (this._transparencyMode = e, this._forceAlphaTest = e === ye.PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND, this._markAllSubMeshesAsTexturesAndMiscDirty())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "_disableAlphaBlending", {
                        get: function() {
                            return this._linkRefractionWithTransparency || this._transparencyMode === ye.PBRMaterial.PBRMATERIAL_OPAQUE || this._transparencyMode === ye.PBRMaterial.PBRMATERIAL_ALPHATEST
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.needAlphaBlending = function() {
                        return !this._disableAlphaBlending && (this.alpha < 1 || null != this._opacityTexture || this._shouldUseAlphaFromAlbedoTexture())
                    }, t.prototype.needAlphaBlendingForMesh = function(t) {
                        return !this._disableAlphaBlending && e.prototype.needAlphaBlendingForMesh.call(this, t)
                    }, t.prototype.needAlphaTesting = function() {
                        return !!this._forceAlphaTest || !this._linkRefractionWithTransparency && null != this._albedoTexture && this._albedoTexture.hasAlpha && (null == this._transparencyMode || this._transparencyMode === ye.PBRMaterial.PBRMATERIAL_ALPHATEST)
                    }, t.prototype._shouldUseAlphaFromAlbedoTexture = function() {
                        return null != this._albedoTexture && this._albedoTexture.hasAlpha && this._useAlphaFromAlbedoTexture && this._transparencyMode !== ye.PBRMaterial.PBRMATERIAL_OPAQUE
                    }, t.prototype.getAlphaTestTexture = function() {
                        return this._albedoTexture
                    }, t.prototype.isReadyForSubMesh = function(e, t, i) {
                        if (t.effect && this.isFrozen && this._wasPreviouslyReady) return !0;
                        t._materialDefines || (t._materialDefines = new be);
                        var r = t._materialDefines;
                        if (!this.checkReadyOnEveryCall && t.effect && r._renderId === this.getScene().getRenderId()) return !0;
                        var n = this.getScene(),
                            o = n.getEngine();
                        if (r._areTexturesDirty && n.texturesEnabled) {
                            if (this._albedoTexture && ye.StandardMaterial.DiffuseTextureEnabled && !this._albedoTexture.isReadyOrNotBlocking()) return !1;
                            if (this._ambientTexture && ye.StandardMaterial.AmbientTextureEnabled && !this._ambientTexture.isReadyOrNotBlocking()) return !1;
                            if (this._opacityTexture && ye.StandardMaterial.OpacityTextureEnabled && !this._opacityTexture.isReadyOrNotBlocking()) return !1;
                            var s = this._getReflectionTexture();
                            if (s && ye.StandardMaterial.ReflectionTextureEnabled && !s.isReadyOrNotBlocking()) return !1;
                            if (this._lightmapTexture && ye.StandardMaterial.LightmapTextureEnabled && !this._lightmapTexture.isReadyOrNotBlocking()) return !1;
                            if (this._emissiveTexture && ye.StandardMaterial.EmissiveTextureEnabled && !this._emissiveTexture.isReadyOrNotBlocking()) return !1;
                            if (ye.StandardMaterial.SpecularTextureEnabled) {
                                if (this._metallicTexture) {
                                    if (!this._metallicTexture.isReadyOrNotBlocking()) return !1
                                } else if (this._reflectivityTexture && !this._reflectivityTexture.isReadyOrNotBlocking()) return !1;
                                if (this._microSurfaceTexture && !this._microSurfaceTexture.isReadyOrNotBlocking()) return !1
                            }
                            if (o.getCaps().standardDerivatives && this._bumpTexture && ye.StandardMaterial.BumpTextureEnabled && !this._disableBumpMap && !this._bumpTexture.isReady()) return !1;
                            var a = this._getRefractionTexture();
                            if (a && ye.StandardMaterial.RefractionTextureEnabled && !a.isReadyOrNotBlocking()) return !1;
                            if (this._environmentBRDFTexture && ye.StandardMaterial.ReflectionTextureEnabled && !this._environmentBRDFTexture.isReady()) return !1
                        }
                        if (r._areImageProcessingDirty && this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady()) return !1;
                        o.getCaps().standardDerivatives || e.isVerticesDataPresent(ye.VertexBuffer.NormalKind) || (e.createNormals(!0), ye.Tools.Warn("PBRMaterial: Normals have been created for the mesh: " + e.name));
                        var l = this._prepareEffect(e, r, this.onCompiled, this.onError, i);
                        return l && (n.resetCachedMaterial(), t.setEffect(l, r), this.buildUniformLayout()), !(!t.effect || !t.effect.isReady()) && (r._renderId = n.getRenderId(), this._wasPreviouslyReady = !0)
                    }, t.prototype.isMetallicWorkflow = function() {
                        return !(null == this._metallic && null == this._roughness && !this._metallicTexture)
                    }, t.prototype._prepareEffect = function(e, t, i, r, n, o) {
                        if (void 0 === i && (i = null), void 0 === r && (r = null), void 0 === n && (n = null), void 0 === o && (o = null), this._prepareDefines(e, t, n, o), !t.isDirty) return null;
                        t.markAsProcessed();
                        var s = this.getScene().getEngine(),
                            a = new ye.EffectFallbacks,
                            l = 0;
                        t.USESPHERICALINVERTEX && a.addFallback(l++, "USESPHERICALINVERTEX"), t.FOG && a.addFallback(l, "FOG"), t.SPECULARAA && a.addFallback(l, "SPECULARAA"), t.POINTSIZE && a.addFallback(l, "POINTSIZE"), t.LOGARITHMICDEPTH && a.addFallback(l, "LOGARITHMICDEPTH"), t.PARALLAX && a.addFallback(l, "PARALLAX"), t.PARALLAXOCCLUSION && a.addFallback(l++, "PARALLAXOCCLUSION"), t.ENVIRONMENTBRDF && a.addFallback(l++, "ENVIRONMENTBRDF"), t.TANGENT && a.addFallback(l++, "TANGENT"), t.BUMP && a.addFallback(l++, "BUMP"), l = ye.MaterialHelper.HandleFallbacksForShadows(t, a, this._maxSimultaneousLights, l++), t.SPECULARTERM && a.addFallback(l++, "SPECULARTERM"), t.USESPHERICALFROMREFLECTIONMAP && a.addFallback(l++, "USESPHERICALFROMREFLECTIONMAP"), t.LIGHTMAP && a.addFallback(l++, "LIGHTMAP"), t.NORMAL && a.addFallback(l++, "NORMAL"), t.AMBIENT && a.addFallback(l++, "AMBIENT"), t.EMISSIVE && a.addFallback(l++, "EMISSIVE"), t.VERTEXCOLOR && a.addFallback(l++, "VERTEXCOLOR"), 0 < t.NUM_BONE_INFLUENCERS && a.addCPUSkinningFallback(l++, e), t.MORPHTARGETS && a.addFallback(l++, "MORPHTARGETS");
                        var u = [ye.VertexBuffer.PositionKind];
                        t.NORMAL && u.push(ye.VertexBuffer.NormalKind), t.TANGENT && u.push(ye.VertexBuffer.TangentKind), t.UV1 && u.push(ye.VertexBuffer.UVKind), t.UV2 && u.push(ye.VertexBuffer.UV2Kind), t.VERTEXCOLOR && u.push(ye.VertexBuffer.ColorKind), ye.MaterialHelper.PrepareAttributesForBones(u, e, t, a), ye.MaterialHelper.PrepareAttributesForInstances(u, t), ye.MaterialHelper.PrepareAttributesForMorphTargets(u, e, t);
                        var c = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vAmbientColor", "vAlbedoColor", "vReflectivityColor", "vEmissiveColor", "vReflectionColor", "vFogInfos", "vFogColor", "pointSize", "vAlbedoInfos", "vAmbientInfos", "vOpacityInfos", "vReflectionInfos", "vReflectionPosition", "vReflectionSize", "vEmissiveInfos", "vReflectivityInfos", "vMicroSurfaceSamplerInfos", "vBumpInfos", "vLightmapInfos", "vRefractionInfos", "mBones", "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "albedoMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "reflectivityMatrix", "normalMatrix", "microSurfaceSamplerMatrix", "bumpMatrix", "lightmapMatrix", "refractionMatrix", "vLightingIntensity", "logarithmicDepthConstant", "vSphericalX", "vSphericalY", "vSphericalZ", "vSphericalXX", "vSphericalYY", "vSphericalZZ", "vSphericalXY", "vSphericalYZ", "vSphericalZX", "vReflectionMicrosurfaceInfos", "vRefractionMicrosurfaceInfos", "vTangentSpaceParams"],
                            h = ["albedoSampler", "reflectivitySampler", "ambientSampler", "emissiveSampler", "bumpSampler", "lightmapSampler", "opacitySampler", "refractionSampler", "refractionSamplerLow", "refractionSamplerHigh", "reflectionSampler", "reflectionSamplerLow", "reflectionSamplerHigh", "microSurfaceSampler", "environmentBrdfSampler"],
                            d = ["Material", "Scene"];
                        ye.ImageProcessingConfiguration && (ye.ImageProcessingConfiguration.PrepareUniforms(c, t), ye.ImageProcessingConfiguration.PrepareSamplers(h, t)), ye.MaterialHelper.PrepareUniformsAndSamplersList({
                            uniformsNames: c,
                            uniformBuffersNames: d,
                            samplers: h,
                            defines: t,
                            maxSimultaneousLights: this._maxSimultaneousLights
                        });
                        var p = t.toString();
                        return s.createEffect("pbr", {
                            attributes: u,
                            uniformsNames: c,
                            uniformBuffersNames: d,
                            samplers: h,
                            defines: p,
                            fallbacks: a,
                            onCompiled: i,
                            onError: r,
                            indexParameters: {
                                maxSimultaneousLights: this._maxSimultaneousLights,
                                maxSimultaneousMorphTargets: t.NUM_MORPH_INFLUENCERS
                            }
                        }, s)
                    }, t.prototype._prepareDefines = function(e, i, r, n) {
                        void 0 === r && (r = null), void 0 === n && (n = null);
                        var o = this.getScene(),
                            s = o.getEngine();
                        if (ye.MaterialHelper.PrepareDefinesForLights(o, e, i, !0, this._maxSimultaneousLights, this._disableLighting), i._needNormals = !0, i.METALLICWORKFLOW = this.isMetallicWorkflow(), i._areTexturesDirty) {
                            if (i._needUVs = !1, o.texturesEnabled) {
                                o.getEngine().getCaps().textureLOD && (i.LODBASEDMICROSFURACE = !0), this._albedoTexture && ye.StandardMaterial.DiffuseTextureEnabled ? ye.MaterialHelper.PrepareDefinesForMergedUV(this._albedoTexture, i, "ALBEDO") : i.ALBEDO = !1, this._ambientTexture && ye.StandardMaterial.AmbientTextureEnabled ? (ye.MaterialHelper.PrepareDefinesForMergedUV(this._ambientTexture, i, "AMBIENT"), i.AMBIENTINGRAYSCALE = this._useAmbientInGrayScale) : i.AMBIENT = !1, this._opacityTexture && ye.StandardMaterial.OpacityTextureEnabled ? (ye.MaterialHelper.PrepareDefinesForMergedUV(this._opacityTexture, i, "OPACITY"), i.OPACITYRGB = this._opacityTexture.getAlphaFromRGB) : i.OPACITY = !1;
                                var a = this._getReflectionTexture();
                                if (a && ye.StandardMaterial.ReflectionTextureEnabled) {
                                    switch (i.REFLECTION = !0, i.GAMMAREFLECTION = a.gammaSpace, i.RGBDREFLECTION = a.isRGBD, i.REFLECTIONMAP_OPPOSITEZ = this.getScene().useRightHandedSystem ? !a.invertZ : a.invertZ, i.LODINREFLECTIONALPHA = a.lodLevelInAlpha, a.coordinatesMode === ye.Texture.INVCUBIC_MODE && (i.INVERTCUBICMAP = !0), i.REFLECTIONMAP_3D = a.isCube, a.coordinatesMode) {
                                        case ye.Texture.EXPLICIT_MODE:
                                            i.REFLECTIONMAP_EXPLICIT = !0;
                                            break;
                                        case ye.Texture.PLANAR_MODE:
                                            i.REFLECTIONMAP_PLANAR = !0;
                                            break;
                                        case ye.Texture.PROJECTION_MODE:
                                            i.REFLECTIONMAP_PROJECTION = !0;
                                            break;
                                        case ye.Texture.SKYBOX_MODE:
                                            i.REFLECTIONMAP_SKYBOX = !0;
                                            break;
                                        case ye.Texture.SPHERICAL_MODE:
                                            i.REFLECTIONMAP_SPHERICAL = !0;
                                            break;
                                        case ye.Texture.EQUIRECTANGULAR_MODE:
                                            i.REFLECTIONMAP_EQUIRECTANGULAR = !0;
                                            break;
                                        case ye.Texture.FIXED_EQUIRECTANGULAR_MODE:
                                            i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !0;
                                            break;
                                        case ye.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
                                            i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !0;
                                            break;
                                        case ye.Texture.CUBIC_MODE:
                                        case ye.Texture.INVCUBIC_MODE:
                                        default:
                                            i.REFLECTIONMAP_CUBIC = !0, i.USE_LOCAL_REFLECTIONMAP_CUBIC = !!a.boundingBoxSize
                                    }
                                    a.coordinatesMode !== ye.Texture.SKYBOX_MODE ? a.sphericalPolynomial && (i.USESPHERICALFROMREFLECTIONMAP = !0, this._forceIrradianceInFragment || o.getEngine().getCaps().maxVaryingVectors <= 8 ? i.USESPHERICALINVERTEX = !1 : i.USESPHERICALINVERTEX = !0) : i.REFLECTIONMAP_SKYBOX_TRANSFORMED = !a.getReflectionTextureMatrix().isIdentity()
                                } else i.REFLECTION = !1, i.REFLECTIONMAP_3D = !1, i.REFLECTIONMAP_SPHERICAL = !1, i.REFLECTIONMAP_PLANAR = !1, i.REFLECTIONMAP_CUBIC = !1, i.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, i.REFLECTIONMAP_PROJECTION = !1, i.REFLECTIONMAP_SKYBOX = !1, i.REFLECTIONMAP_SKYBOX_TRANSFORMED = !1, i.REFLECTIONMAP_EXPLICIT = !1, i.REFLECTIONMAP_EQUIRECTANGULAR = !1, i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, i.INVERTCUBICMAP = !1, i.USESPHERICALFROMREFLECTIONMAP = !1, i.USESPHERICALINVERTEX = !1, i.REFLECTIONMAP_OPPOSITEZ = !1, i.LODINREFLECTIONALPHA = !1, i.GAMMAREFLECTION = !1, i.RGBDREFLECTION = !1;
                                this._lightmapTexture && ye.StandardMaterial.LightmapTextureEnabled ? (ye.MaterialHelper.PrepareDefinesForMergedUV(this._lightmapTexture, i, "LIGHTMAP"), i.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap, i.GAMMALIGHTMAP = this._lightmapTexture.gammaSpace) : i.LIGHTMAP = !1, this._emissiveTexture && ye.StandardMaterial.EmissiveTextureEnabled ? ye.MaterialHelper.PrepareDefinesForMergedUV(this._emissiveTexture, i, "EMISSIVE") : i.EMISSIVE = !1, ye.StandardMaterial.SpecularTextureEnabled ? (this._metallicTexture ? (ye.MaterialHelper.PrepareDefinesForMergedUV(this._metallicTexture, i, "REFLECTIVITY"), i.ROUGHNESSSTOREINMETALMAPALPHA = this._useRoughnessFromMetallicTextureAlpha, i.ROUGHNESSSTOREINMETALMAPGREEN = !this._useRoughnessFromMetallicTextureAlpha && this._useRoughnessFromMetallicTextureGreen, i.METALLNESSSTOREINMETALMAPBLUE = this._useMetallnessFromMetallicTextureBlue, i.AOSTOREINMETALMAPRED = this._useAmbientOcclusionFromMetallicTextureRed) : this._reflectivityTexture ? (ye.MaterialHelper.PrepareDefinesForMergedUV(this._reflectivityTexture, i, "REFLECTIVITY"), i.MICROSURFACEFROMREFLECTIVITYMAP = this._useMicroSurfaceFromReflectivityMapAlpha, i.MICROSURFACEAUTOMATIC = this._useAutoMicroSurfaceFromReflectivityMap) : i.REFLECTIVITY = !1, this._microSurfaceTexture ? ye.MaterialHelper.PrepareDefinesForMergedUV(this._microSurfaceTexture, i, "MICROSURFACEMAP") : i.MICROSURFACEMAP = !1) : (i.REFLECTIVITY = !1, i.MICROSURFACEMAP = !1), o.getEngine().getCaps().standardDerivatives && this._bumpTexture && ye.StandardMaterial.BumpTextureEnabled && !this._disableBumpMap ? (ye.MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture, i, "BUMP"), this._useParallax && this._albedoTexture && ye.StandardMaterial.DiffuseTextureEnabled ? (i.PARALLAX = !0, i.PARALLAXOCCLUSION = !!this._useParallaxOcclusion) : i.PARALLAX = !1, i.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap) : i.BUMP = !1;
                                var l = this._getRefractionTexture();
                                l && ye.StandardMaterial.RefractionTextureEnabled ? (i.REFRACTION = !0, i.REFRACTIONMAP_3D = l.isCube, i.GAMMAREFRACTION = l.gammaSpace, i.RGBDREFRACTION = l.isRGBD, i.REFRACTIONMAP_OPPOSITEZ = l.invertZ, i.LODINREFRACTIONALPHA = l.lodLevelInAlpha, this._linkRefractionWithTransparency && (i.LINKREFRACTIONTOTRANSPARENCY = !0)) : i.REFRACTION = !1, this._environmentBRDFTexture && ye.StandardMaterial.ReflectionTextureEnabled ? i.ENVIRONMENTBRDF = !0 : i.ENVIRONMENTBRDF = !1, this._shouldUseAlphaFromAlbedoTexture() ? i.ALPHAFROMALBEDO = !0 : i.ALPHAFROMALBEDO = !1
                            }
                            i.SPECULAROVERALPHA = this._useSpecularOverAlpha, this._lightFalloff === t.LIGHTFALLOFF_STANDARD ? (i.USEPHYSICALLIGHTFALLOFF = !1, i.USEGLTFLIGHTFALLOFF = !1) : this._lightFalloff === t.LIGHTFALLOFF_GLTF ? (i.USEPHYSICALLIGHTFALLOFF = !1, i.USEGLTFLIGHTFALLOFF = !0) : (i.USEPHYSICALLIGHTFALLOFF = !0, i.USEGLTFLIGHTFALLOFF = !1), i.RADIANCEOVERALPHA = this._useRadianceOverAlpha, !this.backFaceCulling && this._twoSidedLighting ? i.TWOSIDEDLIGHTING = !0 : i.TWOSIDEDLIGHTING = !1, i.ALPHATESTVALUE = this._alphaCutOff + (this._alphaCutOff % 1 == 0 ? "." : ""),
                                i.PREMULTIPLYALPHA = this.alphaMode === ye.Engine.ALPHA_PREMULTIPLIED || this.alphaMode === ye.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF, i.ALPHABLEND = this.needAlphaBlendingForMesh(e), i.ALPHAFRESNEL = this._useAlphaFresnel || this._useLinearAlphaFresnel, i.LINEARALPHAFRESNEL = this._useLinearAlphaFresnel, i.SPECULARAA = o.getEngine().getCaps().standardDerivatives && this._enableSpecularAntiAliasing
                        }
                        i._areImageProcessingDirty && this._imageProcessingConfiguration && this._imageProcessingConfiguration.prepareDefines(i), i.FORCENORMALFORWARD = this._forceNormalForward, i.RADIANCEOCCLUSION = this._useRadianceOcclusion, i.HORIZONOCCLUSION = this._useHorizonOcclusion, i._areMiscDirty && (ye.MaterialHelper.PrepareDefinesForMisc(e, o, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e) || this._forceAlphaTest, i), i.UNLIT = this._unlit || (this.pointsCloud || this.wireframe) && !e.isVerticesDataPresent(ye.VertexBuffer.NormalKind)), ye.MaterialHelper.PrepareDefinesForFrameBoundValues(o, s, i, !!r, n), ye.MaterialHelper.PrepareDefinesForAttributes(e, i, !0, !0, !0, this._transparencyMode !== ye.PBRMaterial.PBRMATERIAL_OPAQUE)
                    }, t.prototype.forceCompilation = function(e, t, i) {
                        var r = this,
                            n = ae({
                                clipPlane: !1
                            }, i),
                            o = new be,
                            s = this._prepareEffect(e, o, void 0, void 0, void 0, n.clipPlane);
                        s.isReady() ? t && t(this) : s.onCompileObservable.add(function() {
                            t && t(r)
                        })
                    }, t.prototype.buildUniformLayout = function() {
                        this._uniformBuffer.addUniform("vAlbedoInfos", 2), this._uniformBuffer.addUniform("vAmbientInfos", 4), this._uniformBuffer.addUniform("vOpacityInfos", 2), this._uniformBuffer.addUniform("vEmissiveInfos", 2), this._uniformBuffer.addUniform("vLightmapInfos", 2), this._uniformBuffer.addUniform("vReflectivityInfos", 3), this._uniformBuffer.addUniform("vMicroSurfaceSamplerInfos", 2), this._uniformBuffer.addUniform("vRefractionInfos", 4), this._uniformBuffer.addUniform("vReflectionInfos", 2), this._uniformBuffer.addUniform("vReflectionPosition", 3), this._uniformBuffer.addUniform("vReflectionSize", 3), this._uniformBuffer.addUniform("vBumpInfos", 3), this._uniformBuffer.addUniform("albedoMatrix", 16), this._uniformBuffer.addUniform("ambientMatrix", 16), this._uniformBuffer.addUniform("opacityMatrix", 16), this._uniformBuffer.addUniform("emissiveMatrix", 16), this._uniformBuffer.addUniform("lightmapMatrix", 16), this._uniformBuffer.addUniform("reflectivityMatrix", 16), this._uniformBuffer.addUniform("microSurfaceSamplerMatrix", 16), this._uniformBuffer.addUniform("bumpMatrix", 16), this._uniformBuffer.addUniform("vTangentSpaceParams", 2), this._uniformBuffer.addUniform("refractionMatrix", 16), this._uniformBuffer.addUniform("reflectionMatrix", 16), this._uniformBuffer.addUniform("vReflectionColor", 3), this._uniformBuffer.addUniform("vAlbedoColor", 4), this._uniformBuffer.addUniform("vLightingIntensity", 4), this._uniformBuffer.addUniform("vRefractionMicrosurfaceInfos", 3), this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos", 3), this._uniformBuffer.addUniform("vReflectivityColor", 4), this._uniformBuffer.addUniform("vEmissiveColor", 3), this._uniformBuffer.addUniform("pointSize", 1), this._uniformBuffer.create()
                    }, t.prototype.unbind = function() {
                        this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._uniformBuffer.setTexture("reflectionSampler", null), this._refractionTexture && this._refractionTexture.isRenderTarget && this._uniformBuffer.setTexture("refractionSampler", null), e.prototype.unbind.call(this)
                    }, t.prototype.bindForSubMesh = function(e, i, r) {
                        var n = this.getScene(),
                            o = r._materialDefines;
                        if (o) {
                            var s = r.effect;
                            if (s) {
                                this._activeEffect = s, this.bindOnlyWorldMatrix(e), o.OBJECTSPACE_NORMALMAP && (e.toNormalMatrix(this._normalMatrix), this.bindOnlyNormalMatrix(this._normalMatrix));
                                var a = this._mustRebind(n, s, i.visibility);
                                ye.MaterialHelper.BindBonesParameters(i, this._activeEffect);
                                var l = null;
                                if (a) {
                                    this._uniformBuffer.bindToEffect(s, "Material"), this.bindViewProjection(s), l = this._getReflectionTexture();
                                    var u = this._getRefractionTexture();
                                    if (!this._uniformBuffer.useUbo || !this.isFrozen || !this._uniformBuffer.isSync) {
                                        if (n.texturesEnabled) {
                                            if (this._albedoTexture && ye.StandardMaterial.DiffuseTextureEnabled && (this._uniformBuffer.updateFloat2("vAlbedoInfos", this._albedoTexture.coordinatesIndex, this._albedoTexture.level), ye.MaterialHelper.BindTextureMatrix(this._albedoTexture, this._uniformBuffer, "albedo")), this._ambientTexture && ye.StandardMaterial.AmbientTextureEnabled && (this._uniformBuffer.updateFloat4("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level, this._ambientTextureStrength, this._ambientTextureImpactOnAnalyticalLights), ye.MaterialHelper.BindTextureMatrix(this._ambientTexture, this._uniformBuffer, "ambient")), this._opacityTexture && ye.StandardMaterial.OpacityTextureEnabled && (this._uniformBuffer.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level), ye.MaterialHelper.BindTextureMatrix(this._opacityTexture, this._uniformBuffer, "opacity")), l && ye.StandardMaterial.ReflectionTextureEnabled) {
                                                if (this._uniformBuffer.updateMatrix("reflectionMatrix", l.getReflectionTextureMatrix()), this._uniformBuffer.updateFloat2("vReflectionInfos", l.level, 0), l.boundingBoxSize) {
                                                    var c = l;
                                                    this._uniformBuffer.updateVector3("vReflectionPosition", c.boundingBoxPosition), this._uniformBuffer.updateVector3("vReflectionSize", c.boundingBoxSize)
                                                }
                                                var h = l.sphericalPolynomial;
                                                o.USESPHERICALFROMREFLECTIONMAP && h && (this._activeEffect.setFloat3("vSphericalX", h.x.x, h.x.y, h.x.z), this._activeEffect.setFloat3("vSphericalY", h.y.x, h.y.y, h.y.z), this._activeEffect.setFloat3("vSphericalZ", h.z.x, h.z.y, h.z.z), this._activeEffect.setFloat3("vSphericalXX_ZZ", h.xx.x - h.zz.x, h.xx.y - h.zz.y, h.xx.z - h.zz.z), this._activeEffect.setFloat3("vSphericalYY_ZZ", h.yy.x - h.zz.x, h.yy.y - h.zz.y, h.yy.z - h.zz.z), this._activeEffect.setFloat3("vSphericalZZ", h.zz.x, h.zz.y, h.zz.z), this._activeEffect.setFloat3("vSphericalXY", h.xy.x, h.xy.y, h.xy.z), this._activeEffect.setFloat3("vSphericalYZ", h.yz.x, h.yz.y, h.yz.z), this._activeEffect.setFloat3("vSphericalZX", h.zx.x, h.zx.y, h.zx.z)), this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos", l.getSize().width, l.lodGenerationScale, l.lodGenerationOffset)
                                            }
                                            if (this._emissiveTexture && ye.StandardMaterial.EmissiveTextureEnabled && (this._uniformBuffer.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level), ye.MaterialHelper.BindTextureMatrix(this._emissiveTexture, this._uniformBuffer, "emissive")), this._lightmapTexture && ye.StandardMaterial.LightmapTextureEnabled && (this._uniformBuffer.updateFloat2("vLightmapInfos", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level), ye.MaterialHelper.BindTextureMatrix(this._lightmapTexture, this._uniformBuffer, "lightmap")), ye.StandardMaterial.SpecularTextureEnabled && (this._metallicTexture ? (this._uniformBuffer.updateFloat3("vReflectivityInfos", this._metallicTexture.coordinatesIndex, this._metallicTexture.level, this._ambientTextureStrength), ye.MaterialHelper.BindTextureMatrix(this._metallicTexture, this._uniformBuffer, "reflectivity")) : this._reflectivityTexture && (this._uniformBuffer.updateFloat3("vReflectivityInfos", this._reflectivityTexture.coordinatesIndex, this._reflectivityTexture.level, 1), ye.MaterialHelper.BindTextureMatrix(this._reflectivityTexture, this._uniformBuffer, "reflectivity")), this._microSurfaceTexture && (this._uniformBuffer.updateFloat2("vMicroSurfaceSamplerInfos", this._microSurfaceTexture.coordinatesIndex, this._microSurfaceTexture.level), ye.MaterialHelper.BindTextureMatrix(this._microSurfaceTexture, this._uniformBuffer, "microSurfaceSampler"))), this._bumpTexture && n.getEngine().getCaps().standardDerivatives && ye.StandardMaterial.BumpTextureEnabled && !this._disableBumpMap && (this._uniformBuffer.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, this._bumpTexture.level, this._parallaxScaleBias), ye.MaterialHelper.BindTextureMatrix(this._bumpTexture, this._uniformBuffer, "bump"), n._mirroredCameraPosition ? this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1 : -1, this._invertNormalMapY ? 1 : -1) : this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1 : 1, this._invertNormalMapY ? -1 : 1)), u && ye.StandardMaterial.RefractionTextureEnabled) {
                                                this._uniformBuffer.updateMatrix("refractionMatrix", u.getReflectionTextureMatrix());
                                                var d = 1;
                                                u.isCube || u.depth && (d = u.depth), this._uniformBuffer.updateFloat4("vRefractionInfos", u.level, this._indexOfRefraction, d, this._invertRefractionY ? -1 : 1), this._uniformBuffer.updateFloat3("vRefractionMicrosurfaceInfos", u.getSize().width, u.lodGenerationScale, u.lodGenerationOffset)
                                            }
                                        }
                                        this.pointsCloud && this._uniformBuffer.updateFloat("pointSize", this.pointSize), o.METALLICWORKFLOW ? (ye.PBRMaterial._scaledReflectivity.r = void 0 === this._metallic || null === this._metallic ? 1 : this._metallic, ye.PBRMaterial._scaledReflectivity.g = void 0 === this._roughness || null === this._roughness ? 1 : this._roughness, this._uniformBuffer.updateColor4("vReflectivityColor", ye.PBRMaterial._scaledReflectivity, 0)) : this._uniformBuffer.updateColor4("vReflectivityColor", this._reflectivityColor, this._microSurface), this._uniformBuffer.updateColor3("vEmissiveColor", this._emissiveColor), this._uniformBuffer.updateColor3("vReflectionColor", this._reflectionColor), this._uniformBuffer.updateColor4("vAlbedoColor", this._albedoColor, this.alpha * i.visibility), this._lightingInfos.x = this._directIntensity, this._lightingInfos.y = this._emissiveIntensity, this._lightingInfos.z = this._environmentIntensity, this._lightingInfos.w = this._specularIntensity, this._uniformBuffer.updateVector4("vLightingIntensity", this._lightingInfos)
                                    }
                                    n.texturesEnabled && (this._albedoTexture && ye.StandardMaterial.DiffuseTextureEnabled && this._uniformBuffer.setTexture("albedoSampler", this._albedoTexture), this._ambientTexture && ye.StandardMaterial.AmbientTextureEnabled && this._uniformBuffer.setTexture("ambientSampler", this._ambientTexture), this._opacityTexture && ye.StandardMaterial.OpacityTextureEnabled && this._uniformBuffer.setTexture("opacitySampler", this._opacityTexture), l && ye.StandardMaterial.ReflectionTextureEnabled && (o.LODBASEDMICROSFURACE ? this._uniformBuffer.setTexture("reflectionSampler", l) : (this._uniformBuffer.setTexture("reflectionSampler", l._lodTextureMid || l), this._uniformBuffer.setTexture("reflectionSamplerLow", l._lodTextureLow || l), this._uniformBuffer.setTexture("reflectionSamplerHigh", l._lodTextureHigh || l))), o.ENVIRONMENTBRDF && this._uniformBuffer.setTexture("environmentBrdfSampler", this._environmentBRDFTexture), u && ye.StandardMaterial.RefractionTextureEnabled && (o.LODBASEDMICROSFURACE ? this._uniformBuffer.setTexture("refractionSampler", u) : (this._uniformBuffer.setTexture("refractionSampler", u._lodTextureMid || u), this._uniformBuffer.setTexture("refractionSamplerLow", u._lodTextureLow || u), this._uniformBuffer.setTexture("refractionSamplerHigh", u._lodTextureHigh || u))), this._emissiveTexture && ye.StandardMaterial.EmissiveTextureEnabled && this._uniformBuffer.setTexture("emissiveSampler", this._emissiveTexture), this._lightmapTexture && ye.StandardMaterial.LightmapTextureEnabled && this._uniformBuffer.setTexture("lightmapSampler", this._lightmapTexture), ye.StandardMaterial.SpecularTextureEnabled && (this._metallicTexture ? this._uniformBuffer.setTexture("reflectivitySampler", this._metallicTexture) : this._reflectivityTexture && this._uniformBuffer.setTexture("reflectivitySampler", this._reflectivityTexture), this._microSurfaceTexture && this._uniformBuffer.setTexture("microSurfaceSampler", this._microSurfaceTexture)), this._bumpTexture && n.getEngine().getCaps().standardDerivatives && ye.StandardMaterial.BumpTextureEnabled && !this._disableBumpMap && this._uniformBuffer.setTexture("bumpSampler", this._bumpTexture)), ye.MaterialHelper.BindClipPlane(this._activeEffect, n), n.ambientColor.multiplyToRef(this._ambientColor, this._globalAmbientColor);
                                    var p = n._forcedViewPosition ? n._forcedViewPosition : n._mirroredCameraPosition ? n._mirroredCameraPosition : n.activeCamera.globalPosition,
                                        f = n.useRightHandedSystem === (null != n._mirroredCameraPosition);
                                    s.setFloat4("vEyePosition", p.x, p.y, p.z, f ? -1 : 1), s.setColor3("vAmbientColor", this._globalAmbientColor)
                                }!a && this.isFrozen || (n.lightsEnabled && !this._disableLighting && ye.MaterialHelper.BindLights(n, i, this._activeEffect, o, this._maxSimultaneousLights, this._lightFalloff !== t.LIGHTFALLOFF_STANDARD), (n.fogEnabled && i.applyFog && n.fogMode !== ye.Scene.FOGMODE_NONE || l) && this.bindView(s), ye.MaterialHelper.BindFogParameters(n, i, this._activeEffect, !0), o.NUM_MORPH_INFLUENCERS && ye.MaterialHelper.BindMorphTargetParameters(i, this._activeEffect), this._imageProcessingConfiguration.bind(this._activeEffect), ye.MaterialHelper.BindLogDepth(o, this._activeEffect, n)), this._uniformBuffer.update(), this._afterBind(i, this._activeEffect)
                            }
                        }
                    }, t.prototype.getAnimatables = function() {
                        var e = [];
                        return this._albedoTexture && this._albedoTexture.animations && 0 < this._albedoTexture.animations.length && e.push(this._albedoTexture), this._ambientTexture && this._ambientTexture.animations && 0 < this._ambientTexture.animations.length && e.push(this._ambientTexture), this._opacityTexture && this._opacityTexture.animations && 0 < this._opacityTexture.animations.length && e.push(this._opacityTexture), this._reflectionTexture && this._reflectionTexture.animations && 0 < this._reflectionTexture.animations.length && e.push(this._reflectionTexture), this._emissiveTexture && this._emissiveTexture.animations && 0 < this._emissiveTexture.animations.length && e.push(this._emissiveTexture), this._metallicTexture && this._metallicTexture.animations && 0 < this._metallicTexture.animations.length ? e.push(this._metallicTexture) : this._reflectivityTexture && this._reflectivityTexture.animations && 0 < this._reflectivityTexture.animations.length && e.push(this._reflectivityTexture), this._bumpTexture && this._bumpTexture.animations && 0 < this._bumpTexture.animations.length && e.push(this._bumpTexture), this._lightmapTexture && this._lightmapTexture.animations && 0 < this._lightmapTexture.animations.length && e.push(this._lightmapTexture), this._refractionTexture && this._refractionTexture.animations && 0 < this._refractionTexture.animations.length && e.push(this._refractionTexture), e
                    }, t.prototype._getReflectionTexture = function() {
                        return this._reflectionTexture ? this._reflectionTexture : this.getScene().environmentTexture
                    }, t.prototype._getRefractionTexture = function() {
                        return this._refractionTexture ? this._refractionTexture : this._linkRefractionWithTransparency ? this.getScene().environmentTexture : null
                    }, t.prototype.dispose = function(t, i) {
                        i && (this._albedoTexture && this._albedoTexture.dispose(), this._ambientTexture && this._ambientTexture.dispose(), this._opacityTexture && this._opacityTexture.dispose(), this._reflectionTexture && this._reflectionTexture.dispose(), this._environmentBRDFTexture && this.getScene()._environmentBRDFTexture !== this._environmentBRDFTexture && this._environmentBRDFTexture.dispose(), this._emissiveTexture && this._emissiveTexture.dispose(), this._metallicTexture && this._metallicTexture.dispose(), this._reflectivityTexture && this._reflectivityTexture.dispose(), this._bumpTexture && this._bumpTexture.dispose(), this._lightmapTexture && this._lightmapTexture.dispose(), this._refractionTexture && this._refractionTexture.dispose()), this._renderTargets.dispose(), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), e.prototype.dispose.call(this, t, i)
                    }, t.LIGHTFALLOFF_PHYSICAL = 0, t.LIGHTFALLOFF_GLTF = 1, t.LIGHTFALLOFF_STANDARD = 2, t._scaledReflectivity = new ye.Color3, y([ye.serializeAsImageProcessingConfiguration()], t.prototype, "_imageProcessingConfiguration", void 0), y([ye.serialize()], t.prototype, "useLogarithmicDepth", null), y([ye.serialize()], t.prototype, "transparencyMode", null), t
                }(ye.PushMaterial), ye.PBRBaseMaterial = xe, Te = $a || ($a = {}), Ee = function(e) {
                    function t(t, i) {
                        var r = e.call(this, t, i) || this;
                        return r.maxSimultaneousLights = 4, r.disableLighting = !1, r.invertNormalMapX = !1, r.invertNormalMapY = !1, r.emissiveColor = new Te.Color3(0, 0, 0), r.occlusionStrength = 1, r.useLightmapAsShadowmap = !1, r._useAlphaFromAlbedoTexture = !0, r._useAmbientInGrayScale = !0, r
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "doubleSided", {
                        get: function() {
                            return this._twoSidedLighting
                        },
                        set: function(e) {
                            this._twoSidedLighting !== e && (this._twoSidedLighting = e, this.backFaceCulling = !e, this._markAllSubMeshesAsTexturesDirty())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getActiveTextures = function() {
                        var t = e.prototype.getActiveTextures.call(this);
                        return this.environmentTexture && t.push(this.environmentTexture), this.normalTexture && t.push(this.normalTexture), this.emissiveTexture && t.push(this.emissiveTexture), this.occlusionTexture && t.push(this.occlusionTexture), this.lightmapTexture && t.push(this.lightmapTexture), t
                    }, t.prototype.hasTexture = function(t) {
                        return !!e.prototype.hasTexture.call(this, t) || this.lightmapTexture === t
                    }, t.prototype.getClassName = function() {
                        return "PBRBaseSimpleMaterial"
                    }, y([Te.serialize(), Te.expandToProperty("_markAllSubMeshesAsLightsDirty")], t.prototype, "maxSimultaneousLights", void 0), y([Te.serialize(), Te.expandToProperty("_markAllSubMeshesAsLightsDirty")], t.prototype, "disableLighting", void 0), y([Te.serializeAsTexture(), Te.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectionTexture")], t.prototype, "environmentTexture", void 0), y([Te.serialize(), Te.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "invertNormalMapX", void 0), y([Te.serialize(), Te.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "invertNormalMapY", void 0), y([Te.serializeAsTexture(), Te.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_bumpTexture")], t.prototype, "normalTexture", void 0), y([Te.serializeAsColor3("emissive"), Te.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "emissiveColor", void 0), y([Te.serializeAsTexture(), Te.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "emissiveTexture", void 0), y([Te.serialize(), Te.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_ambientTextureStrength")], t.prototype, "occlusionStrength", void 0), y([Te.serializeAsTexture(), Te.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_ambientTexture")], t.prototype, "occlusionTexture", void 0), y([Te.serialize(), Te.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_alphaCutOff")], t.prototype, "alphaCutOff", void 0), y([Te.serialize()], t.prototype, "doubleSided", null), y([Te.serializeAsTexture(), Te.expandToProperty("_markAllSubMeshesAsTexturesDirty", null)], t.prototype, "lightmapTexture", void 0), y([Te.serialize(), Te.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useLightmapAsShadowmap", void 0), t
                }(Te.PBRBaseMaterial), Te.PBRBaseSimpleMaterial = Ee, Se = $a || ($a = {}), Pe = function(e) {
                    function t(i, r) {
                        var n = e.call(this, i, r) || this;
                        return n.directIntensity = 1, n.emissiveIntensity = 1, n.environmentIntensity = 1, n.specularIntensity = 1, n.disableBumpMap = !1, n.ambientTextureStrength = 1, n.ambientTextureImpactOnAnalyticalLights = t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, n.ambientColor = new Se.Color3(0, 0, 0), n.albedoColor = new Se.Color3(1, 1, 1), n.reflectivityColor = new Se.Color3(1, 1, 1), n.reflectionColor = new Se.Color3(1, 1, 1), n.emissiveColor = new Se.Color3(0, 0, 0), n.microSurface = 1, n.indexOfRefraction = .66, n.invertRefractionY = !1, n.linkRefractionWithTransparency = !1, n.useLightmapAsShadowmap = !1, n.useAlphaFromAlbedoTexture = !1, n.forceAlphaTest = !1, n.alphaCutOff = .4, n.useSpecularOverAlpha = !0, n.useMicroSurfaceFromReflectivityMapAlpha = !1, n.useRoughnessFromMetallicTextureAlpha = !0, n.useRoughnessFromMetallicTextureGreen = !1, n.useMetallnessFromMetallicTextureBlue = !1, n.useAmbientOcclusionFromMetallicTextureRed = !1, n.useAmbientInGrayScale = !1, n.useAutoMicroSurfaceFromReflectivityMap = !1, n.useRadianceOverAlpha = !0, n.useObjectSpaceNormalMap = !1, n.useParallax = !1, n.useParallaxOcclusion = !1, n.parallaxScaleBias = .05, n.disableLighting = !1, n.forceIrradianceInFragment = !1, n.maxSimultaneousLights = 4, n.invertNormalMapX = !1, n.invertNormalMapY = !1, n.twoSidedLighting = !1, n.useAlphaFresnel = !1, n.useLinearAlphaFresnel = !1, n.environmentBRDFTexture = null, n.forceNormalForward = !1, n.enableSpecularAntiAliasing = !1, n.useHorizonOcclusion = !0, n.useRadianceOcclusion = !0, n.unlit = !1, n._environmentBRDFTexture = Se.TextureTools.GetEnvironmentBRDFTexture(r), n
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "usePhysicalLightFalloff", {
                        get: function() {
                            return this._lightFalloff === Se.PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL
                        },
                        set: function(e) {
                            e !== this.usePhysicalLightFalloff && (this._markAllSubMeshesAsTexturesDirty(), this._lightFalloff = e ? Se.PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL : Se.PBRBaseMaterial.LIGHTFALLOFF_STANDARD)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "useGLTFLightFalloff", {
                        get: function() {
                            return this._lightFalloff === Se.PBRBaseMaterial.LIGHTFALLOFF_GLTF
                        },
                        set: function(e) {
                            e !== this.useGLTFLightFalloff && (this._markAllSubMeshesAsTexturesDirty(), this._lightFalloff = e ? Se.PBRBaseMaterial.LIGHTFALLOFF_GLTF : Se.PBRBaseMaterial.LIGHTFALLOFF_STANDARD)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "imageProcessingConfiguration", {
                        get: function() {
                            return this._imageProcessingConfiguration
                        },
                        set: function(e) {
                            this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraColorCurvesEnabled", {
                        get: function() {
                            return this.imageProcessingConfiguration.colorCurvesEnabled
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.colorCurvesEnabled = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraColorGradingEnabled", {
                        get: function() {
                            return this.imageProcessingConfiguration.colorGradingEnabled
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.colorGradingEnabled = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraToneMappingEnabled", {
                        get: function() {
                            return this._imageProcessingConfiguration.toneMappingEnabled
                        },
                        set: function(e) {
                            this._imageProcessingConfiguration.toneMappingEnabled = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraExposure", {
                        get: function() {
                            return this._imageProcessingConfiguration.exposure
                        },
                        set: function(e) {
                            this._imageProcessingConfiguration.exposure = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraContrast", {
                        get: function() {
                            return this._imageProcessingConfiguration.contrast
                        },
                        set: function(e) {
                            this._imageProcessingConfiguration.contrast = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraColorGradingTexture", {
                        get: function() {
                            return this._imageProcessingConfiguration.colorGradingTexture
                        },
                        set: function(e) {
                            this._imageProcessingConfiguration.colorGradingTexture = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraColorCurves", {
                        get: function() {
                            return this._imageProcessingConfiguration.colorCurves
                        },
                        set: function(e) {
                            this._imageProcessingConfiguration.colorCurves = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getClassName = function() {
                        return "PBRMaterial"
                    }, t.prototype.getActiveTextures = function() {
                        var t = e.prototype.getActiveTextures.call(this);
                        return this._albedoTexture && t.push(this._albedoTexture), this._ambientTexture && t.push(this._ambientTexture), this._opacityTexture && t.push(this._opacityTexture), this._reflectionTexture && t.push(this._reflectionTexture), this._emissiveTexture && t.push(this._emissiveTexture), this._reflectivityTexture && t.push(this._reflectivityTexture), this._metallicTexture && t.push(this._metallicTexture), this._microSurfaceTexture && t.push(this._microSurfaceTexture), this._bumpTexture && t.push(this._bumpTexture), this._lightmapTexture && t.push(this._lightmapTexture), this._refractionTexture && t.push(this._refractionTexture), t
                    }, t.prototype.hasTexture = function(t) {
                        return !!e.prototype.hasTexture.call(this, t) || this._albedoTexture === t || this._ambientTexture === t || this._opacityTexture === t || this._reflectionTexture === t || this._reflectivityTexture === t || this._metallicTexture === t || this._microSurfaceTexture === t || this._bumpTexture === t || this._lightmapTexture === t || this._refractionTexture === t
                    }, t.prototype.clone = function(e) {
                        var i = this,
                            r = Se.SerializationHelper.Clone(function() {
                                return new t(e, i.getScene())
                            }, this);
                        return r.id = e, r.name = e, r
                    }, t.prototype.serialize = function() {
                        var e = Se.SerializationHelper.Serialize(this);
                        return e.customType = "BABYLON.PBRMaterial", e
                    }, t.Parse = function(e, i, r) {
                        return Se.SerializationHelper.Parse(function() {
                            return new t(e.name, i)
                        }, e, i, r)
                    }, t.PBRMATERIAL_OPAQUE = 0, t.PBRMATERIAL_ALPHATEST = 1, t.PBRMATERIAL_ALPHABLEND = 2, t.PBRMATERIAL_ALPHATESTANDBLEND = 3, t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = 1, y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "directIntensity", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "emissiveIntensity", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "environmentIntensity", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "specularIntensity", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "disableBumpMap", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "albedoTexture", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "ambientTexture", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "ambientTextureStrength", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "ambientTextureImpactOnAnalyticalLights", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")], t.prototype, "opacityTexture", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "reflectionTexture", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "emissiveTexture", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "reflectivityTexture", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "metallicTexture", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "metallic", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "roughness", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "microSurfaceTexture", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "bumpTexture", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty", null)], t.prototype, "lightmapTexture", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "refractionTexture", void 0), y([Se.serializeAsColor3("ambient"), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "ambientColor", void 0), y([Se.serializeAsColor3("albedo"), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "albedoColor", void 0), y([Se.serializeAsColor3("reflectivity"), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "reflectivityColor", void 0), y([Se.serializeAsColor3("reflection"), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "reflectionColor", void 0), y([Se.serializeAsColor3("emissive"), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "emissiveColor", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "microSurface", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "indexOfRefraction", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "invertRefractionY", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "linkRefractionWithTransparency", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useLightmapAsShadowmap", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")], t.prototype, "useAlphaFromAlbedoTexture", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")], t.prototype, "forceAlphaTest", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")], t.prototype, "alphaCutOff", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useSpecularOverAlpha", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useMicroSurfaceFromReflectivityMapAlpha", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useRoughnessFromMetallicTextureAlpha", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useRoughnessFromMetallicTextureGreen", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useMetallnessFromMetallicTextureBlue", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useAmbientOcclusionFromMetallicTextureRed", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useAmbientInGrayScale", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useAutoMicroSurfaceFromReflectivityMap", void 0), y([Se.serialize()], t.prototype, "usePhysicalLightFalloff", null), y([Se.serialize()], t.prototype, "useGLTFLightFalloff", null), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useRadianceOverAlpha", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useObjectSpaceNormalMap", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useParallax", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useParallaxOcclusion", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "parallaxScaleBias", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsLightsDirty")], t.prototype, "disableLighting", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "forceIrradianceInFragment", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsLightsDirty")], t.prototype, "maxSimultaneousLights", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "invertNormalMapX", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "invertNormalMapY", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "twoSidedLighting", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useAlphaFresnel", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useLinearAlphaFresnel", void 0), y([Se.serializeAsTexture(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "environmentBRDFTexture", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "forceNormalForward", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "enableSpecularAntiAliasing", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useHorizonOcclusion", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useRadianceOcclusion", void 0), y([Se.serialize(), Se.expandToProperty("_markAllSubMeshesAsMiscDirty")], t.prototype, "unlit", void 0), t
                }(Se.PBRBaseMaterial), Se.PBRMaterial = Pe, Ae = $a || ($a = {}), Ce = function(e) {
                    function t(t, i) {
                        var r = e.call(this, t, i) || this;
                        return r._useRoughnessFromMetallicTextureAlpha = !1, r._useRoughnessFromMetallicTextureGreen = !0, r._useMetallnessFromMetallicTextureBlue = !0, r.metallic = 1, r.roughness = 1, r
                    }
                    return b(t, e), t.prototype.getClassName = function() {
                        return "PBRMetallicRoughnessMaterial"
                    }, t.prototype.getActiveTextures = function() {
                        var t = e.prototype.getActiveTextures.call(this);
                        return this.baseTexture && t.push(this.baseTexture), this.metallicRoughnessTexture && t.push(this.metallicRoughnessTexture), t
                    }, t.prototype.hasTexture = function(t) {
                        return !!e.prototype.hasTexture.call(this, t) || this.baseTexture === t || this.metallicRoughnessTexture === t
                    }, t.prototype.clone = function(e) {
                        var i = this,
                            r = Ae.SerializationHelper.Clone(function() {
                                return new t(e, i.getScene())
                            }, this);
                        return r.id = e, r.name = e, r
                    }, t.prototype.serialize = function() {
                        var e = Ae.SerializationHelper.Serialize(this);
                        return e.customType = "BABYLON.PBRMetallicRoughnessMaterial", e
                    }, t.Parse = function(e, i, r) {
                        return Ae.SerializationHelper.Parse(function() {
                            return new t(e.name, i)
                        }, e, i, r)
                    }, y([Ae.serializeAsColor3(), Ae.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoColor")], t.prototype, "baseColor", void 0), y([Ae.serializeAsTexture(), Ae.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoTexture")], t.prototype, "baseTexture", void 0), y([Ae.serialize(), Ae.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "metallic", void 0), y([Ae.serialize(), Ae.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "roughness", void 0), y([Ae.serializeAsTexture(), Ae.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_metallicTexture")], t.prototype, "metallicRoughnessTexture", void 0), t
                }(Ae.PBRBaseSimpleMaterial), Ae.PBRMetallicRoughnessMaterial = Ce, Me = $a || ($a = {}), Re = function(e) {
                    function t(t, i) {
                        var r = e.call(this, t, i) || this;
                        return r._useMicroSurfaceFromReflectivityMapAlpha = !0, r
                    }
                    return b(t, e), t.prototype.getClassName = function() {
                        return "PBRSpecularGlossinessMaterial"
                    }, t.prototype.getActiveTextures = function() {
                        var t = e.prototype.getActiveTextures.call(this);
                        return this.diffuseTexture && t.push(this.diffuseTexture), this.specularGlossinessTexture && t.push(this.specularGlossinessTexture), t
                    }, t.prototype.hasTexture = function(t) {
                        return !!e.prototype.hasTexture.call(this, t) || this.diffuseTexture === t || this.specularGlossinessTexture === t
                    }, t.prototype.clone = function(e) {
                        var i = this,
                            r = Me.SerializationHelper.Clone(function() {
                                return new t(e, i.getScene())
                            }, this);
                        return r.id = e, r.name = e, r
                    }, t.prototype.serialize = function() {
                        var e = Me.SerializationHelper.Serialize(this);
                        return e.customType = "BABYLON.PBRSpecularGlossinessMaterial", e
                    }, t.Parse = function(e, i, r) {
                        return Me.SerializationHelper.Parse(function() {
                            return new t(e.name, i)
                        }, e, i, r)
                    }, y([Me.serializeAsColor3("diffuse"), Me.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoColor")], t.prototype, "diffuseColor", void 0), y([Me.serializeAsTexture(), Me.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoTexture")], t.prototype, "diffuseTexture", void 0), y([Me.serializeAsColor3("specular"), Me.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectivityColor")], t.prototype, "specularColor", void 0), y([Me.serialize(), Me.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_microSurface")], t.prototype, "glossiness", void 0), y([Me.serializeAsTexture(), Me.expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectivityTexture")], t.prototype, "specularGlossinessTexture", void 0), t
                }(Me.PBRBaseSimpleMaterial), Me.PBRSpecularGlossinessMaterial = Re,
                function(e) {
                    e.CameraInputTypes = {};
                    var t = function() {
                        function t(e) {
                            this.attached = {}, this.camera = e, this.checkInputs = function() {}
                        }
                        return t.prototype.add = function(t) {
                            var i = t.getSimpleName();
                            this.attached[i] ? e.Tools.Warn("camera input of type " + i + " already exists on camera") : ((this.attached[i] = t).camera = this.camera, t.checkInputs && (this.checkInputs = this._addCheckInputs(t.checkInputs.bind(t))), this.attachedElement && t.attachControl(this.attachedElement))
                        }, t.prototype.remove = function(e) {
                            for (var t in this.attached) {
                                var i = this.attached[t];
                                i === e && (i.detachControl(this.attachedElement), i.camera = null, delete this.attached[t], this.rebuildInputCheck())
                            }
                        }, t.prototype.removeByType = function(e) {
                            for (var t in this.attached) {
                                var i = this.attached[t];
                                i.getClassName() === e && (i.detachControl(this.attachedElement), i.camera = null, delete this.attached[t], this.rebuildInputCheck())
                            }
                        }, t.prototype._addCheckInputs = function(e) {
                            var t = this.checkInputs;
                            return function() {
                                t(), e()
                            }
                        }, t.prototype.attachInput = function(e) {
                            this.attachedElement && e.attachControl(this.attachedElement, this.noPreventDefault)
                        }, t.prototype.attachElement = function(t, i) {
                            if (void 0 === i && (i = !1), !this.attachedElement)
                                for (var r in i = !e.Camera.ForceAttachControlToAlwaysPreventDefault && i, this.attachedElement = t, this.noPreventDefault = i, this.attached) this.attached[r].attachControl(t, i)
                        }, t.prototype.detachElement = function(e, t) {
                            if (void 0 === t && (t = !1), this.attachedElement === e) {
                                for (var i in this.attached) this.attached[i].detachControl(e), t && (this.attached[i].camera = null);
                                this.attachedElement = null
                            }
                        }, t.prototype.rebuildInputCheck = function() {
                            for (var e in this.checkInputs = function() {}, this.attached) {
                                var t = this.attached[e];
                                t.checkInputs && (this.checkInputs = this._addCheckInputs(t.checkInputs.bind(t)))
                            }
                        }, t.prototype.clear = function() {
                            this.attachedElement && this.detachElement(this.attachedElement, !0), this.attached = {}, this.attachedElement = null, this.checkInputs = function() {}
                        }, t.prototype.serialize = function(t) {
                            var i = {};
                            for (var r in this.attached) {
                                var n = this.attached[r],
                                    o = e.SerializationHelper.Serialize(n);
                                i[n.getClassName()] = o
                            }
                            t.inputsmgr = i
                        }, t.prototype.parse = function(t) {
                            var i = t.inputsmgr;
                            if (i) {
                                for (var r in this.clear(), i)
                                    if (s = e.CameraInputTypes[r]) {
                                        var n = i[r],
                                            o = e.SerializationHelper.Parse(function() {
                                                return new s
                                            }, n, null);
                                        this.add(o)
                                    }
                            } else
                                for (var r in this.attached) {
                                    var s;
                                    (s = e.CameraInputTypes[this.attached[r].getClassName()]) && (o = e.SerializationHelper.Parse(function() {
                                        return new s
                                    }, t, null), this.remove(this.attached[r]), this.add(o))
                                }
                        }, t
                    }();
                    e.CameraInputsManager = t
                }($a || ($a = {})), Oe = $a || ($a = {}), we = function(e) {
                    function t(t, i, r, n) {
                        void 0 === n && (n = !0);
                        var o = e.call(this, t, i, r, n) || this;
                        return o.cameraDirection = new Oe.Vector3(0, 0, 0), o.cameraRotation = new Oe.Vector2(0, 0), o.rotation = new Oe.Vector3(0, 0, 0), o.speed = 2, o.noRotationConstraint = !1, o.lockedTarget = null, o._currentTarget = Oe.Vector3.Zero(), o._viewMatrix = Oe.Matrix.Zero(), o._camMatrix = Oe.Matrix.Zero(), o._cameraTransformMatrix = Oe.Matrix.Zero(), o._cameraRotationMatrix = Oe.Matrix.Zero(), o._referencePoint = new Oe.Vector3(0, 0, 1), o._transformedReferencePoint = Oe.Vector3.Zero(), o._globalCurrentTarget = Oe.Vector3.Zero(), o._globalCurrentUpVector = Oe.Vector3.Zero(), o._defaultUp = Oe.Vector3.Up(), o._cachedRotationZ = 0, o._cachedQuaternionRotationZ = 0, o
                    }
                    return b(t, e), t.prototype.getFrontPosition = function(e) {
                        this.getWorldMatrix();
                        var t = this.getTarget().subtract(this.position);
                        return t.normalize(), t.scaleInPlace(e), this.globalPosition.add(t)
                    }, t.prototype._getLockedTargetPosition = function() {
                        return this.lockedTarget ? (this.lockedTarget.absolutePosition && this.lockedTarget.computeWorldMatrix(), this.lockedTarget.absolutePosition || this.lockedTarget) : null
                    }, t.prototype.storeState = function() {
                        return this._storedPosition = this.position.clone(), this._storedRotation = this.rotation.clone(), this.rotationQuaternion && (this._storedRotationQuaternion = this.rotationQuaternion.clone()), e.prototype.storeState.call(this)
                    }, t.prototype._restoreStateValues = function() {
                        return !!e.prototype._restoreStateValues.call(this) && (this.position = this._storedPosition.clone(), this.rotation = this._storedRotation.clone(), this.rotationQuaternion && (this.rotationQuaternion = this._storedRotationQuaternion.clone()), this.cameraDirection.copyFromFloats(0, 0, 0), this.cameraRotation.copyFromFloats(0, 0), !0)
                    }, t.prototype._initCache = function() {
                        e.prototype._initCache.call(this), this._cache.lockedTarget = new Oe.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.rotation = new Oe.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.rotationQuaternion = new Oe.Quaternion(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE)
                    }, t.prototype._updateCache = function(t) {
                        t || e.prototype._updateCache.call(this);
                        var i = this._getLockedTargetPosition();
                        i ? this._cache.lockedTarget ? this._cache.lockedTarget.copyFrom(i) : this._cache.lockedTarget = i.clone() : this._cache.lockedTarget = null, this._cache.rotation.copyFrom(this.rotation), this.rotationQuaternion && this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)
                    }, t.prototype._isSynchronizedViewMatrix = function() {
                        if (!e.prototype._isSynchronizedViewMatrix.call(this)) return !1;
                        var t = this._getLockedTargetPosition();
                        return (this._cache.lockedTarget ? this._cache.lockedTarget.equals(t) : !t) && (this.rotationQuaternion ? this.rotationQuaternion.equals(this._cache.rotationQuaternion) : this._cache.rotation.equals(this.rotation))
                    }, t.prototype._computeLocalCameraSpeed = function() {
                        var e = this.getEngine();
                        return this.speed * Math.sqrt(e.getDeltaTime() / (100 * e.getFps()))
                    }, t.prototype.setTarget = function(e) {
                        this.upVector.normalize(), this.position.z === e.z && (this.position.z += Oe.Epsilon), Oe.Matrix.LookAtLHToRef(this.position, e, this._defaultUp, this._camMatrix), this._camMatrix.invert(), this.rotation.x = Math.atan(this._camMatrix.m[6] / this._camMatrix.m[10]);
                        var t = e.subtract(this.position);
                        0 <= t.x ? this.rotation.y = -Math.atan(t.z / t.x) + Math.PI / 2 : this.rotation.y = -Math.atan(t.z / t.x) - Math.PI / 2, this.rotation.z = 0, isNaN(this.rotation.x) && (this.rotation.x = 0), isNaN(this.rotation.y) && (this.rotation.y = 0), isNaN(this.rotation.z) && (this.rotation.z = 0), this.rotationQuaternion && Oe.Quaternion.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion)
                    }, t.prototype.getTarget = function() {
                        return this._currentTarget
                    }, t.prototype._decideIfNeedsToMove = function() {
                        return 0 < Math.abs(this.cameraDirection.x) || 0 < Math.abs(this.cameraDirection.y) || 0 < Math.abs(this.cameraDirection.z)
                    }, t.prototype._updatePosition = function() {
                        if (this.parent) return this.parent.getWorldMatrix().invertToRef(Oe.Tmp.Matrix[0]), Oe.Vector3.TransformNormalToRef(this.cameraDirection, Oe.Tmp.Matrix[0], Oe.Tmp.Vector3[0]), void this.position.addInPlace(Oe.Tmp.Vector3[0]);
                        this.position.addInPlace(this.cameraDirection)
                    }, t.prototype._checkInputs = function() {
                        var t = this._decideIfNeedsToMove(),
                            i = 0 < Math.abs(this.cameraRotation.x) || 0 < Math.abs(this.cameraRotation.y);
                        if (t && this._updatePosition(), i && (this.rotation.x += this.cameraRotation.x, this.rotation.y += this.cameraRotation.y, this.rotationQuaternion && this.rotation.lengthSquared() && Oe.Quaternion.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion), !this.noRotationConstraint)) {
                            var r = Math.PI / 2 * .95;
                            this.rotation.x > r && (this.rotation.x = r), this.rotation.x < -r && (this.rotation.x = -r)
                        }
                        t && (Math.abs(this.cameraDirection.x) < this.speed * Oe.Epsilon && (this.cameraDirection.x = 0), Math.abs(this.cameraDirection.y) < this.speed * Oe.Epsilon && (this.cameraDirection.y = 0), Math.abs(this.cameraDirection.z) < this.speed * Oe.Epsilon && (this.cameraDirection.z = 0), this.cameraDirection.scaleInPlace(this.inertia)), i && (Math.abs(this.cameraRotation.x) < this.speed * Oe.Epsilon && (this.cameraRotation.x = 0), Math.abs(this.cameraRotation.y) < this.speed * Oe.Epsilon && (this.cameraRotation.y = 0), this.cameraRotation.scaleInPlace(this.inertia)), e.prototype._checkInputs.call(this)
                    }, t.prototype._updateCameraRotationMatrix = function() {
                        this.rotationQuaternion ? this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix) : Oe.Matrix.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this._cameraRotationMatrix)
                    }, t.prototype._rotateUpVectorWithCameraRotationMatrix = function() {
                        return Oe.Vector3.TransformNormalToRef(this._defaultUp, this._cameraRotationMatrix, this.upVector), this
                    }, t.prototype._getViewMatrix = function() {
                        return this.lockedTarget && this.setTarget(this._getLockedTargetPosition()), this._updateCameraRotationMatrix(), this.rotationQuaternion && this._cachedQuaternionRotationZ != this.rotationQuaternion.z ? (this._rotateUpVectorWithCameraRotationMatrix(), this._cachedQuaternionRotationZ = this.rotationQuaternion.z) : this._cachedRotationZ != this.rotation.z && (this._rotateUpVectorWithCameraRotationMatrix(), this._cachedRotationZ = this.rotation.z), Oe.Vector3.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint), this.position.addToRef(this._transformedReferencePoint, this._currentTarget), this._computeViewMatrix(this.position, this._currentTarget, this.upVector), this._viewMatrix
                    }, t.prototype._computeViewMatrix = function(e, t, i) {
                        if (this.parent) {
                            var r = this.parent.getWorldMatrix();
                            Oe.Vector3.TransformCoordinatesToRef(e, r, this._globalPosition), Oe.Vector3.TransformCoordinatesToRef(t, r, this._globalCurrentTarget), Oe.Vector3.TransformNormalToRef(i, r, this._globalCurrentUpVector), this._markSyncedWithParent()
                        } else this._globalPosition.copyFrom(e), this._globalCurrentTarget.copyFrom(t), this._globalCurrentUpVector.copyFrom(i);
                        this.getScene().useRightHandedSystem ? Oe.Matrix.LookAtRHToRef(this._globalPosition, this._globalCurrentTarget, this._globalCurrentUpVector, this._viewMatrix) : Oe.Matrix.LookAtLHToRef(this._globalPosition, this._globalCurrentTarget, this._globalCurrentUpVector, this._viewMatrix)
                    }, t.prototype.createRigCamera = function(e, i) {
                        if (this.cameraRigMode !== Oe.Camera.RIG_MODE_NONE) {
                            var r = new t(e, this.position.clone(), this.getScene());
                            return this.cameraRigMode !== Oe.Camera.RIG_MODE_VR && this.cameraRigMode !== Oe.Camera.RIG_MODE_WEBVR || (this.rotationQuaternion || (this.rotationQuaternion = new Oe.Quaternion), r._cameraRigParams = {}, r.rotationQuaternion = new Oe.Quaternion), r
                        }
                        return null
                    }, t.prototype._updateRigCameras = function() {
                        var t = this._rigCameras[0],
                            i = this._rigCameras[1];
                        switch (this.cameraRigMode) {
                            case Oe.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
                            case Oe.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
                            case Oe.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
                            case Oe.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
                                var r = this.cameraRigMode === Oe.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? 1 : -1,
                                    n = this.cameraRigMode === Oe.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? -1 : 1;
                                this._getRigCamPosition(this._cameraRigParams.stereoHalfAngle * r, t.position), this._getRigCamPosition(this._cameraRigParams.stereoHalfAngle * n, i.position), t.setTarget(this.getTarget()), i.setTarget(this.getTarget());
                                break;
                            case Oe.Camera.RIG_MODE_VR:
                                t.rotationQuaternion ? (t.rotationQuaternion.copyFrom(this.rotationQuaternion), i.rotationQuaternion.copyFrom(this.rotationQuaternion)) : (t.rotation.copyFrom(this.rotation), i.rotation.copyFrom(this.rotation)), t.position.copyFrom(this.position), i.position.copyFrom(this.position)
                        }
                        e.prototype._updateRigCameras.call(this)
                    }, t.prototype._getRigCamPosition = function(e, t) {
                        this._rigCamTransformMatrix || (this._rigCamTransformMatrix = new Oe.Matrix);
                        var i = this.getTarget();
                        Oe.Matrix.Translation(-i.x, -i.y, -i.z).multiplyToRef(Oe.Matrix.RotationY(e), this._rigCamTransformMatrix), this._rigCamTransformMatrix = this._rigCamTransformMatrix.multiply(Oe.Matrix.Translation(i.x, i.y, i.z)), Oe.Vector3.TransformCoordinatesToRef(this.position, this._rigCamTransformMatrix, t)
                    }, t.prototype.getClassName = function() {
                        return "TargetCamera"
                    }, y([Oe.serializeAsVector3()], t.prototype, "rotation", void 0), y([Oe.serialize()], t.prototype, "speed", void 0), y([Oe.serializeAsMeshReference("lockedTargetId")], t.prototype, "lockedTarget", void 0), t
                }(Oe.Camera), Oe.TargetCamera = we, Ie = $a || ($a = {}), De = function() {
                    function e(e) {
                        void 0 === e && (e = !0), this.touchEnabled = e, this.buttons = [0, 1, 2], this.angularSensibility = 2e3, this.previousPosition = null
                    }
                    return e.prototype.attachControl = function(e, t) {
                        var i = this,
                            r = this.camera.getEngine();
                        this._pointerInput || (this._pointerInput = function(n, o) {
                            var s = n.event;
                            if (!r.isInVRExclusivePointerMode && (i.touchEnabled || "touch" !== s.pointerType) && (n.type === Ie.PointerEventTypes.POINTERMOVE || -1 !== i.buttons.indexOf(s.button))) {
                                var a = s.srcElement || s.target;
                                if (n.type === Ie.PointerEventTypes.POINTERDOWN && a) {
                                    try {
                                        a.setPointerCapture(s.pointerId)
                                    } catch (n) {}
                                    i.previousPosition = {
                                        x: s.clientX,
                                        y: s.clientY
                                    }, t || (s.preventDefault(), e.focus())
                                } else if (n.type === Ie.PointerEventTypes.POINTERUP && a) {
                                    try {
                                        a.releasePointerCapture(s.pointerId)
                                    } catch (n) {}
                                    i.previousPosition = null, t || s.preventDefault()
                                } else if (n.type === Ie.PointerEventTypes.POINTERMOVE) {
                                    if (!i.previousPosition || r.isPointerLock) return;
                                    var l = s.clientX - i.previousPosition.x;
                                    i.camera.getScene().useRightHandedSystem && (l *= -1), i.camera.parent && i.camera.parent._getWorldMatrixDeterminant() < 0 && (l *= -1), i.camera.cameraRotation.y += l / i.angularSensibility;
                                    var u = s.clientY - i.previousPosition.y;
                                    i.camera.cameraRotation.x += u / i.angularSensibility, i.previousPosition = {
                                        x: s.clientX,
                                        y: s.clientY
                                    }, t || s.preventDefault()
                                }
                            }
                        }), this._onMouseMove = function(e) {
                            if (r.isPointerLock && !r.isInVRExclusivePointerMode) {
                                var n = e.movementX || e.mozMovementX || e.webkitMovementX || e.msMovementX || 0;
                                i.camera.getScene().useRightHandedSystem && (n *= -1), i.camera.parent && i.camera.parent._getWorldMatrixDeterminant() < 0 && (n *= -1), i.camera.cameraRotation.y += n / i.angularSensibility;
                                var o = e.movementY || e.mozMovementY || e.webkitMovementY || e.msMovementY || 0;
                                i.camera.cameraRotation.x += o / i.angularSensibility, i.previousPosition = null, t || e.preventDefault()
                            }
                        }, this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, Ie.PointerEventTypes.POINTERDOWN | Ie.PointerEventTypes.POINTERUP | Ie.PointerEventTypes.POINTERMOVE), e.addEventListener("mousemove", this._onMouseMove, !1)
                    }, e.prototype.detachControl = function(e) {
                        this._observer && e && (this.camera.getScene().onPointerObservable.remove(this._observer), this._onMouseMove && e.removeEventListener("mousemove", this._onMouseMove), this._observer = null, this._onMouseMove = null, this.previousPosition = null)
                    }, e.prototype.getClassName = function() {
                        return "FreeCameraMouseInput"
                    }, e.prototype.getSimpleName = function() {
                        return "mouse"
                    }, y([Ie.serialize()], e.prototype, "buttons", void 0), y([Ie.serialize()], e.prototype, "angularSensibility", void 0), e
                }(), Ie.FreeCameraMouseInput = De, Ie.CameraInputTypes.FreeCameraMouseInput = De, Le = $a || ($a = {}), Be = function() {
                    function e() {
                        this.keysUp = [38], this.keysDown = [40], this.keysLeft = [37], this.keysRight = [39], this._keys = new Array
                    }
                    return e.prototype.attachControl = function(e, t) {
                        var i = this;
                        this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function() {
                            i._keys = []
                        }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function(e) {
                            var r, n = e.event;
                            e.type === Le.KeyboardEventTypes.KEYDOWN ? -1 === i.keysUp.indexOf(n.keyCode) && -1 === i.keysDown.indexOf(n.keyCode) && -1 === i.keysLeft.indexOf(n.keyCode) && -1 === i.keysRight.indexOf(n.keyCode) || (-1 === (r = i._keys.indexOf(n.keyCode)) && i._keys.push(n.keyCode), t || n.preventDefault()) : -1 === i.keysUp.indexOf(n.keyCode) && -1 === i.keysDown.indexOf(n.keyCode) && -1 === i.keysLeft.indexOf(n.keyCode) && -1 === i.keysRight.indexOf(n.keyCode) || (0 <= (r = i._keys.indexOf(n.keyCode)) && i._keys.splice(r, 1), t || n.preventDefault())
                        }))
                    }, e.prototype.detachControl = function(e) {
                        this._scene && (this._onKeyboardObserver && this._scene.onKeyboardObservable.remove(this._onKeyboardObserver), this._onCanvasBlurObserver && this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onKeyboardObserver = null, this._onCanvasBlurObserver = null), this._keys = []
                    }, e.prototype.checkInputs = function() {
                        if (this._onKeyboardObserver)
                            for (var e = this.camera, t = 0; t < this._keys.length; t++) {
                                var i = this._keys[t],
                                    r = e._computeLocalCameraSpeed(); - 1 !== this.keysLeft.indexOf(i) ? e._localDirection.copyFromFloats(-r, 0, 0) : -1 !== this.keysUp.indexOf(i) ? e._localDirection.copyFromFloats(0, 0, r) : -1 !== this.keysRight.indexOf(i) ? e._localDirection.copyFromFloats(r, 0, 0) : -1 !== this.keysDown.indexOf(i) && e._localDirection.copyFromFloats(0, 0, -r), e.getScene().useRightHandedSystem && (e._localDirection.z *= -1), e.getViewMatrix().invertToRef(e._cameraTransformMatrix), Le.Vector3.TransformNormalToRef(e._localDirection, e._cameraTransformMatrix, e._transformedDirection), e.cameraDirection.addInPlace(e._transformedDirection)
                            }
                    }, e.prototype.getClassName = function() {
                        return "FreeCameraKeyboardMoveInput"
                    }, e.prototype._onLostFocus = function(e) {
                        this._keys = []
                    }, e.prototype.getSimpleName = function() {
                        return "keyboard"
                    }, y([Le.serialize()], e.prototype, "keysUp", void 0), y([Le.serialize()], e.prototype, "keysDown", void 0), y([Le.serialize()], e.prototype, "keysLeft", void 0), y([Le.serialize()], e.prototype, "keysRight", void 0), e
                }(), Le.FreeCameraKeyboardMoveInput = Be, Le.CameraInputTypes.FreeCameraKeyboardMoveInput = Be, Fe = $a || ($a = {}), Ne = function(e) {
                    function t(t) {
                        return e.call(this, t) || this
                    }
                    return b(t, e), t.prototype.addKeyboard = function() {
                        return this.add(new Fe.FreeCameraKeyboardMoveInput), this
                    }, t.prototype.addMouse = function(e) {
                        return void 0 === e && (e = !0), this.add(new Fe.FreeCameraMouseInput(e)), this
                    }, t.prototype.addDeviceOrientation = function() {
                        return this.add(new Fe.FreeCameraDeviceOrientationInput), this
                    }, t.prototype.addTouch = function() {
                        return this.add(new Fe.FreeCameraTouchInput), this
                    }, t.prototype.addVirtualJoystick = function() {
                        return this.add(new Fe.FreeCameraVirtualJoystickInput), this
                    }, t
                }(Fe.CameraInputsManager), Fe.FreeCameraInputsManager = Ne,
                function(e) {
                    e.Node.AddNodeConstructor("FreeCamera", function(t, i) {
                        return function() {
                            return new e.UniversalCamera(t, e.Vector3.Zero(), i)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o) {
                            void 0 === o && (o = !0);
                            var s = t.call(this, i, r, n, o) || this;
                            return s.ellipsoid = new e.Vector3(.5, 1, .5), s.ellipsoidOffset = new e.Vector3(0, 0, 0), s.checkCollisions = !1, s.applyGravity = !1, s._needMoveForGravity = !1, s._oldPosition = e.Vector3.Zero(), s._diffPosition = e.Vector3.Zero(), s._newPosition = e.Vector3.Zero(), s._collisionMask = -1, s._onCollisionPositionChange = function(t, i, r) {
                                void 0 === r && (r = null), s.getScene().workerCollisions && i.multiplyInPlace(s._collider._radius);
                                var n;
                                n = i, s._newPosition.copyFrom(n), s._newPosition.subtractToRef(s._oldPosition, s._diffPosition), s._diffPosition.length() > e.Engine.CollisionsEpsilon && (s.position.addInPlace(s._diffPosition), s.onCollide && r && s.onCollide(r))
                            }, s.inputs = new e.FreeCameraInputsManager(s), s.inputs.addKeyboard().addMouse(), s
                        }
                        return b(i, t), Object.defineProperty(i.prototype, "angularSensibility", {
                            get: function() {
                                var e = this.inputs.attached.mouse;
                                return e ? e.angularSensibility : 0
                            },
                            set: function(e) {
                                var t = this.inputs.attached.mouse;
                                t && (t.angularSensibility = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "keysUp", {
                            get: function() {
                                var e = this.inputs.attached.keyboard;
                                return e ? e.keysUp : []
                            },
                            set: function(e) {
                                var t = this.inputs.attached.keyboard;
                                t && (t.keysUp = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "keysDown", {
                            get: function() {
                                var e = this.inputs.attached.keyboard;
                                return e ? e.keysDown : []
                            },
                            set: function(e) {
                                var t = this.inputs.attached.keyboard;
                                t && (t.keysDown = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "keysLeft", {
                            get: function() {
                                var e = this.inputs.attached.keyboard;
                                return e ? e.keysLeft : []
                            },
                            set: function(e) {
                                var t = this.inputs.attached.keyboard;
                                t && (t.keysLeft = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "keysRight", {
                            get: function() {
                                var e = this.inputs.attached.keyboard;
                                return e ? e.keysRight : []
                            },
                            set: function(e) {
                                var t = this.inputs.attached.keyboard;
                                t && (t.keysRight = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i.prototype.attachControl = function(e, t) {
                            this.inputs.attachElement(e, t)
                        }, i.prototype.detachControl = function(t) {
                            this.inputs.detachElement(t), this.cameraDirection = new e.Vector3(0, 0, 0), this.cameraRotation = new e.Vector2(0, 0)
                        }, Object.defineProperty(i.prototype, "collisionMask", {
                            get: function() {
                                return this._collisionMask
                            },
                            set: function(e) {
                                this._collisionMask = isNaN(e) ? -1 : e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i.prototype._collideWithWorld = function(t) {
                            (this.parent ? e.Vector3.TransformCoordinates(this.position, this.parent.getWorldMatrix()) : this.position).subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition), this._oldPosition.addInPlace(this.ellipsoidOffset), this._collider || (this._collider = new e.Collider), this._collider._radius = this.ellipsoid, this._collider.collisionMask = this._collisionMask;
                            var i = t;
                            this.applyGravity && (i = t.add(this.getScene().gravity)), this.getScene().collisionCoordinator.getNewPosition(this._oldPosition, i, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId)
                        }, i.prototype._checkInputs = function() {
                            this._localDirection || (this._localDirection = e.Vector3.Zero(), this._transformedDirection = e.Vector3.Zero()), this.inputs.checkInputs(), t.prototype._checkInputs.call(this)
                        }, i.prototype._decideIfNeedsToMove = function() {
                            return this._needMoveForGravity || 0 < Math.abs(this.cameraDirection.x) || 0 < Math.abs(this.cameraDirection.y) || 0 < Math.abs(this.cameraDirection.z)
                        }, i.prototype._updatePosition = function() {
                            this.checkCollisions && this.getScene().collisionsEnabled ? this._collideWithWorld(this.cameraDirection) : t.prototype._updatePosition.call(this)
                        }, i.prototype.dispose = function() {
                            this.inputs.clear(), t.prototype.dispose.call(this)
                        }, i.prototype.getClassName = function() {
                            return "FreeCamera"
                        }, y([e.serializeAsVector3()], i.prototype, "ellipsoid", void 0), y([e.serializeAsVector3()], i.prototype, "ellipsoidOffset", void 0), y([e.serialize()], i.prototype, "checkCollisions", void 0), y([e.serialize()], i.prototype, "applyGravity", void 0), i
                    }(e.TargetCamera);
                    e.FreeCamera = t
                }($a || ($a = {})), Ve = $a || ($a = {}), ke = function() {
                    function e() {
                        this.keysUp = [38], this.keysDown = [40], this.keysLeft = [37], this.keysRight = [39], this.keysReset = [220], this.panningSensibility = 50, this.zoomingSensibility = 25, this.useAltToZoom = !0, this.angularSpeed = .01, this._keys = new Array
                    }
                    return e.prototype.attachControl = function(e, t) {
                        var i = this;
                        this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function() {
                            i._keys = []
                        }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function(e) {
                            var r, n = e.event;
                            e.type === Ve.KeyboardEventTypes.KEYDOWN ? (i._ctrlPressed = n.ctrlKey, i._altPressed = n.altKey, (-1 !== i.keysUp.indexOf(n.keyCode) || -1 !== i.keysDown.indexOf(n.keyCode) || -1 !== i.keysLeft.indexOf(n.keyCode) || -1 !== i.keysRight.indexOf(n.keyCode) || -1 !== i.keysReset.indexOf(n.keyCode)) && (-1 === (r = i._keys.indexOf(n.keyCode)) && i._keys.push(n.keyCode), n.preventDefault && (t || n.preventDefault()))) : -1 === i.keysUp.indexOf(n.keyCode) && -1 === i.keysDown.indexOf(n.keyCode) && -1 === i.keysLeft.indexOf(n.keyCode) && -1 === i.keysRight.indexOf(n.keyCode) && -1 === i.keysReset.indexOf(n.keyCode) || (0 <= (r = i._keys.indexOf(n.keyCode)) && i._keys.splice(r, 1), n.preventDefault && (t || n.preventDefault()))
                        }))
                    }, e.prototype.detachControl = function(e) {
                        this._scene && (this._onKeyboardObserver && this._scene.onKeyboardObservable.remove(this._onKeyboardObserver), this._onCanvasBlurObserver && this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onKeyboardObserver = null, this._onCanvasBlurObserver = null), this._keys = []
                    }, e.prototype.checkInputs = function() {
                        if (this._onKeyboardObserver)
                            for (var e = this.camera, t = 0; t < this._keys.length; t++) {
                                var i = this._keys[t]; - 1 !== this.keysLeft.indexOf(i) ? this._ctrlPressed && this.camera._useCtrlForPanning ? e.inertialPanningX -= 1 / this.panningSensibility : e.inertialAlphaOffset -= this.angularSpeed : -1 !== this.keysUp.indexOf(i) ? this._ctrlPressed && this.camera._useCtrlForPanning ? e.inertialPanningY += 1 / this.panningSensibility : this._altPressed && this.useAltToZoom ? e.inertialRadiusOffset += 1 / this.zoomingSensibility : e.inertialBetaOffset -= this.angularSpeed : -1 !== this.keysRight.indexOf(i) ? this._ctrlPressed && this.camera._useCtrlForPanning ? e.inertialPanningX += 1 / this.panningSensibility : e.inertialAlphaOffset += this.angularSpeed : -1 !== this.keysDown.indexOf(i) ? this._ctrlPressed && this.camera._useCtrlForPanning ? e.inertialPanningY -= 1 / this.panningSensibility : this._altPressed && this.useAltToZoom ? e.inertialRadiusOffset -= 1 / this.zoomingSensibility : e.inertialBetaOffset += this.angularSpeed : -1 !== this.keysReset.indexOf(i) && e.useInputToRestoreState && e.restoreState()
                            }
                    }, e.prototype.getClassName = function() {
                        return "ArcRotateCameraKeyboardMoveInput"
                    }, e.prototype.getSimpleName = function() {
                        return "keyboard"
                    }, y([Ve.serialize()], e.prototype, "keysUp", void 0), y([Ve.serialize()], e.prototype, "keysDown", void 0), y([Ve.serialize()], e.prototype, "keysLeft", void 0), y([Ve.serialize()], e.prototype, "keysRight", void 0), y([Ve.serialize()], e.prototype, "keysReset", void 0), y([Ve.serialize()], e.prototype, "panningSensibility", void 0), y([Ve.serialize()], e.prototype, "zoomingSensibility", void 0), y([Ve.serialize()], e.prototype, "useAltToZoom", void 0), y([Ve.serialize()], e.prototype, "angularSpeed", void 0), e
                }(), Ve.ArcRotateCameraKeyboardMoveInput = ke, Ve.CameraInputTypes.ArcRotateCameraKeyboardMoveInput = ke, Ue = $a || ($a = {}), Ge = function() {
                    function e() {
                        this.wheelPrecision = 3, this.wheelDeltaPercentage = 0
                    }
                    return e.prototype.attachControl = function(e, t) {
                        var i = this;
                        this._wheel = function(e, r) {
                            if (e.type === Ue.PointerEventTypes.POINTERWHEEL) {
                                var n = e.event,
                                    o = 0;
                                if (n.wheelDelta)
                                    if (i.wheelDeltaPercentage) {
                                        var s = .01 * n.wheelDelta * i.wheelDeltaPercentage * i.camera.radius;
                                        o = 0 < n.wheelDelta ? s / (1 + i.wheelDeltaPercentage) : s * (1 + i.wheelDeltaPercentage)
                                    } else o = n.wheelDelta / (40 * i.wheelPrecision);
                                else n.detail && (o = -n.detail / i.wheelPrecision);
                                o && (i.camera.inertialRadiusOffset += o), n.preventDefault && (t || n.preventDefault())
                            }
                        }, this._observer = this.camera.getScene().onPointerObservable.add(this._wheel, Ue.PointerEventTypes.POINTERWHEEL)
                    }, e.prototype.detachControl = function(e) {
                        this._observer && e && (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null, this._wheel = null)
                    }, e.prototype.getClassName = function() {
                        return "ArcRotateCameraMouseWheelInput"
                    }, e.prototype.getSimpleName = function() {
                        return "mousewheel"
                    }, y([Ue.serialize()], e.prototype, "wheelPrecision", void 0), y([Ue.serialize()], e.prototype, "wheelDeltaPercentage", void 0), e
                }(), Ue.ArcRotateCameraMouseWheelInput = Ge, Ue.CameraInputTypes.ArcRotateCameraMouseWheelInput = Ge, ze = $a || ($a = {}), je = function() {
                    function e() {
                        this.buttons = [0, 1, 2], this.angularSensibilityX = 1e3, this.angularSensibilityY = 1e3, this.pinchPrecision = 12, this.pinchDeltaPercentage = 0, this.panningSensibility = 1e3, this.multiTouchPanning = !0, this.multiTouchPanAndZoom = !0, this.pinchInwards = !0, this._isPanClick = !1
                    }
                    return e.prototype.attachControl = function(e, t) {
                        var i, r = this,
                            n = this.camera.getEngine(),
                            o = null,
                            s = null,
                            a = 0,
                            l = 0,
                            u = 0,
                            c = {
                                x: 0,
                                y: 0,
                                isPaning: !1,
                                isPinching: !1
                            };
                        this._pointerInput = function(h, d) {
                            var p = h.event,
                                f = "touch" === h.event.pointerType;
                            if (!n.isInVRExclusivePointerMode && (h.type === ze.PointerEventTypes.POINTERMOVE || -1 !== r.buttons.indexOf(p.button))) {
                                var _ = p.srcElement || p.target;
                                if (h.type === ze.PointerEventTypes.POINTERDOWN && _) {
                                    try {
                                        _.setPointerCapture(p.pointerId)
                                    } catch (h) {}
                                    r._isPanClick = p.button === r.camera._panningMouseButton, i = {
                                        x: p.clientX,
                                        y: p.clientY,
                                        pointerId: p.pointerId,
                                        type: p.pointerType
                                    }, null === o ? o = i : null === s && (s = i), t || (p.preventDefault(), e.focus())
                                } else if (h.type === ze.PointerEventTypes.POINTERDOUBLETAP) r.camera.useInputToRestoreState && r.camera.restoreState();
                                else if (h.type === ze.PointerEventTypes.POINTERUP && _) {
                                    try {
                                        _.releasePointerCapture(p.pointerId)
                                    } catch (h) {}
                                    i = null, a = 0, c.isPaning = !1, c.isPinching = !1, l = u = 0, f || (s = null), n._badOS ? o = s = null : s && o && o.pointerId == p.pointerId ? (o = s, s = null, i = {
                                        x: o.x,
                                        y: o.y,
                                        pointerId: o.pointerId,
                                        type: p.pointerType
                                    }) : o && s && s.pointerId == p.pointerId ? (s = null, i = {
                                        x: o.x,
                                        y: o.y,
                                        pointerId: o.pointerId,
                                        type: p.pointerType
                                    }) : o = s = null, t || p.preventDefault()
                                } else if (h.type === ze.PointerEventTypes.POINTERMOVE)
                                    if (t || p.preventDefault(), o && null === s && i) {
                                        if (0 !== r.panningSensibility && (p.ctrlKey && r.camera._useCtrlForPanning || r._isPanClick)) r.camera.inertialPanningX += -(p.clientX - i.x) / r.panningSensibility, r.camera.inertialPanningY += (p.clientY - i.y) / r.panningSensibility;
                                        else {
                                            var m = p.clientX - i.x,
                                                g = p.clientY - i.y;
                                            r.camera.inertialAlphaOffset -= m / r.angularSensibilityX, r.camera.inertialBetaOffset -= g / r.angularSensibilityY
                                        }
                                        i.x = p.clientX, i.y = p.clientY
                                    } else if (o && s) {
                                    var v = o.pointerId === p.pointerId ? o : s;
                                    v.x = p.clientX, v.y = p.clientY;
                                    var y = r.pinchInwards ? 1 : -1,
                                        b = o.x - s.x,
                                        x = o.y - s.y,
                                        T = b * b + x * x,
                                        E = Math.sqrt(T);
                                    if (0 === a) return l = E, a = T, c.x = (o.x + s.x) / 2, void(c.y = (o.y + s.y) / 2);
                                    if (r.multiTouchPanAndZoom) {
                                        if (r.pinchDeltaPercentage ? r.camera.inertialRadiusOffset += .001 * (T - a) * r.camera.radius * r.pinchDeltaPercentage : r.camera.inertialRadiusOffset += (T - a) / (r.pinchPrecision * ((r.angularSensibilityX + r.angularSensibilityY) / 2) * y), 0 !== r.panningSensibility) {
                                            var S = (o.x + s.x) / 2,
                                                P = (o.y + s.y) / 2,
                                                A = S - c.x,
                                                C = P - c.y;
                                            c.x = S, c.y = P, r.camera.inertialPanningX += -A / r.panningSensibility, r.camera.inertialPanningY += C / r.panningSensibility
                                        }
                                    } else {
                                        if (u++,
                                            c.isPinching || u < 20 && Math.abs(E - l) > r.camera.pinchToPanMaxDistance) r.pinchDeltaPercentage ? r.camera.inertialRadiusOffset += .001 * (T - a) * r.camera.radius * r.pinchDeltaPercentage : r.camera.inertialRadiusOffset += (T - a) / (r.pinchPrecision * ((r.angularSensibilityX + r.angularSensibilityY) / 2) * y), c.isPaning = !1, c.isPinching = !0;
                                        else if (i && i.pointerId === v.pointerId && 0 !== r.panningSensibility && r.multiTouchPanning) {
                                            if (!c.isPaning) return c.isPaning = !0, c.isPinching = !1, c.x = v.x, void(c.y = v.y);
                                            r.camera.inertialPanningX += -(v.x - c.x) / r.panningSensibility, r.camera.inertialPanningY += (v.y - c.y) / r.panningSensibility
                                        }
                                        i && i.pointerId === p.pointerId && (c.x = v.x, c.y = v.y)
                                    }
                                    a = T
                                }
                            }
                        }, this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, ze.PointerEventTypes.POINTERDOWN | ze.PointerEventTypes.POINTERUP | ze.PointerEventTypes.POINTERMOVE | ze.PointerEventTypes.POINTERDOUBLETAP), this._onContextMenu = function(e) {
                            e.preventDefault()
                        }, this.camera._useCtrlForPanning || e.addEventListener("contextmenu", this._onContextMenu, !1), this._onLostFocus = function() {
                            o = s = null, a = 0, c.isPaning = !1, c.isPinching = !1, i = null, l = u = 0
                        }, this._onMouseMove = function(e) {
                            if (n.isPointerLock) {
                                var i = e.movementX || e.mozMovementX || e.webkitMovementX || e.msMovementX || 0,
                                    o = e.movementY || e.mozMovementY || e.webkitMovementY || e.msMovementY || 0;
                                r.camera.inertialAlphaOffset -= i / r.angularSensibilityX, r.camera.inertialBetaOffset -= o / r.angularSensibilityY, t || e.preventDefault()
                            }
                        }, this._onGestureStart = function(t) {
                            void 0 !== window.MSGesture && (r._MSGestureHandler || (r._MSGestureHandler = new MSGesture, r._MSGestureHandler.target = e), r._MSGestureHandler.addPointer(t.pointerId))
                        }, this._onGesture = function(e) {
                            r.camera.radius *= e.scale, e.preventDefault && (t || (e.stopPropagation(), e.preventDefault()))
                        }, e.addEventListener("mousemove", this._onMouseMove, !1), e.addEventListener("MSPointerDown", this._onGestureStart, !1), e.addEventListener("MSGestureChange", this._onGesture, !1), ze.Tools.RegisterTopRootEvents([{
                            name: "blur",
                            handler: this._onLostFocus
                        }])
                    }, e.prototype.detachControl = function(e) {
                        this._onLostFocus && ze.Tools.UnregisterTopRootEvents([{
                            name: "blur",
                            handler: this._onLostFocus
                        }]), e && this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null, this._onContextMenu && e.removeEventListener("contextmenu", this._onContextMenu), this._onMouseMove && e.removeEventListener("mousemove", this._onMouseMove), this._onGestureStart && e.removeEventListener("MSPointerDown", this._onGestureStart), this._onGesture && e.removeEventListener("MSGestureChange", this._onGesture), this._isPanClick = !1, this.pinchInwards = !0, this._onMouseMove = null, this._onGestureStart = null, this._onGesture = null, this._MSGestureHandler = null, this._onLostFocus = null, this._onContextMenu = null)
                    }, e.prototype.getClassName = function() {
                        return "ArcRotateCameraPointersInput"
                    }, e.prototype.getSimpleName = function() {
                        return "pointers"
                    }, y([ze.serialize()], e.prototype, "buttons", void 0), y([ze.serialize()], e.prototype, "angularSensibilityX", void 0), y([ze.serialize()], e.prototype, "angularSensibilityY", void 0), y([ze.serialize()], e.prototype, "pinchPrecision", void 0), y([ze.serialize()], e.prototype, "pinchDeltaPercentage", void 0), y([ze.serialize()], e.prototype, "panningSensibility", void 0), y([ze.serialize()], e.prototype, "multiTouchPanning", void 0), y([ze.serialize()], e.prototype, "multiTouchPanAndZoom", void 0), e
                }(), ze.ArcRotateCameraPointersInput = je, ze.CameraInputTypes.ArcRotateCameraPointersInput = je, He = $a || ($a = {}), We = function(e) {
                    function t(t) {
                        return e.call(this, t) || this
                    }
                    return b(t, e), t.prototype.addMouseWheel = function() {
                        return this.add(new He.ArcRotateCameraMouseWheelInput), this
                    }, t.prototype.addPointers = function() {
                        return this.add(new He.ArcRotateCameraPointersInput), this
                    }, t.prototype.addKeyboard = function() {
                        return this.add(new He.ArcRotateCameraKeyboardMoveInput), this
                    }, t.prototype.addVRDeviceOrientation = function() {
                        return this.add(new He.ArcRotateCameraVRDeviceOrientationInput), this
                    }, t
                }(He.CameraInputsManager), He.ArcRotateCameraInputsManager = We,
                function(e) {
                    e.Node.AddNodeConstructor("ArcRotateCamera", function(i, r) {
                        return function() {
                            return new t(i, 0, 0, 1, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o, s, a, l) {
                            void 0 === l && (l = !0);
                            var u = t.call(this, i, e.Vector3.Zero(), a, l) || this;
                            return u.inertialAlphaOffset = 0, u.inertialBetaOffset = 0, u.inertialRadiusOffset = 0, u.lowerAlphaLimit = null, u.upperAlphaLimit = null, u.lowerBetaLimit = .01, u.upperBetaLimit = Math.PI, u.lowerRadiusLimit = null, u.upperRadiusLimit = null, u.inertialPanningX = 0, u.inertialPanningY = 0, u.pinchToPanMaxDistance = 20, u.panningDistanceLimit = null, u.panningOriginTarget = e.Vector3.Zero(), u.panningInertia = .9, u.zoomOnFactor = 1, u.targetScreenOffset = e.Vector2.Zero(), u.allowUpsideDown = !0, u.useInputToRestoreState = !0, u._viewMatrix = new e.Matrix, u.panningAxis = new e.Vector3(1, 1, 0), u.onMeshTargetChangedObservable = new e.Observable, u.checkCollisions = !1, u.collisionRadius = new e.Vector3(.5, .5, .5), u._previousPosition = e.Vector3.Zero(), u._collisionVelocity = e.Vector3.Zero(), u._newPosition = e.Vector3.Zero(), u._computationVector = e.Vector3.Zero(), u._onCollisionPositionChange = function(e, t, i) {
                                void 0 === i && (i = null), u.getScene().workerCollisions && u.checkCollisions && t.multiplyInPlace(u._collider._radius), i ? (u.setPosition(t), u.onCollide && u.onCollide(i)) : u._previousPosition.copyFrom(u.position);
                                var r = Math.cos(u.alpha),
                                    n = Math.sin(u.alpha),
                                    o = Math.cos(u.beta),
                                    s = Math.sin(u.beta);
                                0 === s && (s = 1e-4);
                                var a = u._getTargetPosition();
                                u._computationVector.copyFromFloats(u.radius * r * s, u.radius * o, u.radius * n * s), a.addToRef(u._computationVector, u._newPosition), u.position.copyFrom(u._newPosition);
                                var l = u.upVector;
                                u.allowUpsideDown && u.beta < 0 && (l = (l = l.clone()).negate()), u._computeViewMatrix(u.position, a, l), u._viewMatrix.m[12] += u.targetScreenOffset.x, u._viewMatrix.m[13] += u.targetScreenOffset.y, u._collisionTriggered = !1
                            }, u._target = e.Vector3.Zero(), s && u.setTarget(s), u.alpha = r, u.beta = n, u.radius = o, u.getViewMatrix(), u.inputs = new e.ArcRotateCameraInputsManager(u), u.inputs.addKeyboard().addMouseWheel().addPointers(), u
                        }
                        return b(i, t), Object.defineProperty(i.prototype, "target", {
                            get: function() {
                                return this._target
                            },
                            set: function(e) {
                                this.setTarget(e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "angularSensibilityX", {
                            get: function() {
                                var e = this.inputs.attached.pointers;
                                return e ? e.angularSensibilityX : 0
                            },
                            set: function(e) {
                                var t = this.inputs.attached.pointers;
                                t && (t.angularSensibilityX = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "angularSensibilityY", {
                            get: function() {
                                var e = this.inputs.attached.pointers;
                                return e ? e.angularSensibilityY : 0
                            },
                            set: function(e) {
                                var t = this.inputs.attached.pointers;
                                t && (t.angularSensibilityY = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "pinchPrecision", {
                            get: function() {
                                var e = this.inputs.attached.pointers;
                                return e ? e.pinchPrecision : 0
                            },
                            set: function(e) {
                                var t = this.inputs.attached.pointers;
                                t && (t.pinchPrecision = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "pinchDeltaPercentage", {
                            get: function() {
                                var e = this.inputs.attached.pointers;
                                return e ? e.pinchDeltaPercentage : 0
                            },
                            set: function(e) {
                                var t = this.inputs.attached.pointers;
                                t && (t.pinchDeltaPercentage = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "panningSensibility", {
                            get: function() {
                                var e = this.inputs.attached.pointers;
                                return e ? e.panningSensibility : 0
                            },
                            set: function(e) {
                                var t = this.inputs.attached.pointers;
                                t && (t.panningSensibility = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "keysUp", {
                            get: function() {
                                var e = this.inputs.attached.keyboard;
                                return e ? e.keysUp : []
                            },
                            set: function(e) {
                                var t = this.inputs.attached.keyboard;
                                t && (t.keysUp = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "keysDown", {
                            get: function() {
                                var e = this.inputs.attached.keyboard;
                                return e ? e.keysDown : []
                            },
                            set: function(e) {
                                var t = this.inputs.attached.keyboard;
                                t && (t.keysDown = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "keysLeft", {
                            get: function() {
                                var e = this.inputs.attached.keyboard;
                                return e ? e.keysLeft : []
                            },
                            set: function(e) {
                                var t = this.inputs.attached.keyboard;
                                t && (t.keysLeft = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "keysRight", {
                            get: function() {
                                var e = this.inputs.attached.keyboard;
                                return e ? e.keysRight : []
                            },
                            set: function(e) {
                                var t = this.inputs.attached.keyboard;
                                t && (t.keysRight = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "wheelPrecision", {
                            get: function() {
                                var e = this.inputs.attached.mousewheel;
                                return e ? e.wheelPrecision : 0
                            },
                            set: function(e) {
                                var t = this.inputs.attached.mousewheel;
                                t && (t.wheelPrecision = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "wheelDeltaPercentage", {
                            get: function() {
                                var e = this.inputs.attached.mousewheel;
                                return e ? e.wheelDeltaPercentage : 0
                            },
                            set: function(e) {
                                var t = this.inputs.attached.mousewheel;
                                t && (t.wheelDeltaPercentage = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "bouncingBehavior", {
                            get: function() {
                                return this._bouncingBehavior
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "useBouncingBehavior", {
                            get: function() {
                                return null != this._bouncingBehavior
                            },
                            set: function(t) {
                                t !== this.useBouncingBehavior && (t ? (this._bouncingBehavior = new e.BouncingBehavior, this.addBehavior(this._bouncingBehavior)) : this._bouncingBehavior && (this.removeBehavior(this._bouncingBehavior), this._bouncingBehavior = null))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "framingBehavior", {
                            get: function() {
                                return this._framingBehavior
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "useFramingBehavior", {
                            get: function() {
                                return null != this._framingBehavior
                            },
                            set: function(t) {
                                t !== this.useFramingBehavior && (t ? (this._framingBehavior = new e.FramingBehavior, this.addBehavior(this._framingBehavior)) : this._framingBehavior && (this.removeBehavior(this._framingBehavior), this._framingBehavior = null))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "autoRotationBehavior", {
                            get: function() {
                                return this._autoRotationBehavior
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "useAutoRotationBehavior", {
                            get: function() {
                                return null != this._autoRotationBehavior
                            },
                            set: function(t) {
                                t !== this.useAutoRotationBehavior && (t ? (this._autoRotationBehavior = new e.AutoRotationBehavior, this.addBehavior(this._autoRotationBehavior)) : this._autoRotationBehavior && (this.removeBehavior(this._autoRotationBehavior), this._autoRotationBehavior = null))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i.prototype._initCache = function() {
                            t.prototype._initCache.call(this), this._cache._target = new e.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.alpha = void 0, this._cache.beta = void 0, this._cache.radius = void 0, this._cache.targetScreenOffset = e.Vector2.Zero()
                        }, i.prototype._updateCache = function(e) {
                            e || t.prototype._updateCache.call(this), this._cache._target.copyFrom(this._getTargetPosition()), this._cache.alpha = this.alpha, this._cache.beta = this.beta, this._cache.radius = this.radius, this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset)
                        }, i.prototype._getTargetPosition = function() {
                            if (this._targetHost && this._targetHost.getAbsolutePosition) {
                                var e = this._targetHost.getAbsolutePosition();
                                this._targetBoundingCenter ? e.addToRef(this._targetBoundingCenter, this._target) : this._target.copyFrom(e)
                            }
                            return this._getLockedTargetPosition() || this._target
                        }, i.prototype.storeState = function() {
                            return this._storedAlpha = this.alpha, this._storedBeta = this.beta, this._storedRadius = this.radius, this._storedTarget = this._getTargetPosition().clone(), t.prototype.storeState.call(this)
                        }, i.prototype._restoreStateValues = function() {
                            return !(!t.prototype._restoreStateValues.call(this) || (this.alpha = this._storedAlpha, this.beta = this._storedBeta, this.radius = this._storedRadius, this.setTarget(this._storedTarget.clone()), this.inertialAlphaOffset = 0, this.inertialBetaOffset = 0, this.inertialRadiusOffset = 0, this.inertialPanningX = 0, this.inertialPanningY = 0))
                        }, i.prototype._isSynchronizedViewMatrix = function() {
                            return !!t.prototype._isSynchronizedViewMatrix.call(this) && this._cache._target.equals(this._getTargetPosition()) && this._cache.alpha === this.alpha && this._cache.beta === this.beta && this._cache.radius === this.radius && this._cache.targetScreenOffset.equals(this.targetScreenOffset)
                        }, i.prototype.attachControl = function(e, t, i, r) {
                            var n = this;
                            void 0 === i && (i = !0), void 0 === r && (r = 2), this._useCtrlForPanning = i, this._panningMouseButton = r, this.inputs.attachElement(e, t), this._reset = function() {
                                n.inertialAlphaOffset = 0, n.inertialBetaOffset = 0, n.inertialRadiusOffset = 0, n.inertialPanningX = 0, n.inertialPanningY = 0
                            }
                        }, i.prototype.detachControl = function(e) {
                            this.inputs.detachElement(e), this._reset && this._reset()
                        }, i.prototype._checkInputs = function() {
                            if (!this._collisionTriggered) {
                                if (this.inputs.checkInputs(), 0 !== this.inertialAlphaOffset || 0 !== this.inertialBetaOffset || 0 !== this.inertialRadiusOffset) {
                                    var i = this.inertialAlphaOffset;
                                    this.beta <= 0 && (i *= -1), this.getScene().useRightHandedSystem && (i *= -1), this.parent && this.parent._getWorldMatrixDeterminant() < 0 && (i *= -1), this.alpha += i, this.beta += this.inertialBetaOffset, this.radius -= this.inertialRadiusOffset, this.inertialAlphaOffset *= this.inertia, this.inertialBetaOffset *= this.inertia, this.inertialRadiusOffset *= this.inertia, Math.abs(this.inertialAlphaOffset) < e.Epsilon && (this.inertialAlphaOffset = 0), Math.abs(this.inertialBetaOffset) < e.Epsilon && (this.inertialBetaOffset = 0), Math.abs(this.inertialRadiusOffset) < this.speed * e.Epsilon && (this.inertialRadiusOffset = 0)
                                }
                                0 === this.inertialPanningX && 0 === this.inertialPanningY || (this._localDirection || (this._localDirection = e.Vector3.Zero(), this._transformedDirection = e.Vector3.Zero()), this._localDirection.copyFromFloats(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY), this._localDirection.multiplyInPlace(this.panningAxis), this._viewMatrix.invertToRef(this._cameraTransformMatrix), e.Vector3.TransformNormalToRef(this._localDirection, this._cameraTransformMatrix, this._transformedDirection), this.panningAxis.y || (this._transformedDirection.y = 0), this._targetHost || (this.panningDistanceLimit ? (this._transformedDirection.addInPlace(this._target), e.Vector3.DistanceSquared(this._transformedDirection, this.panningOriginTarget) <= this.panningDistanceLimit * this.panningDistanceLimit && this._target.copyFrom(this._transformedDirection)) : this._target.addInPlace(this._transformedDirection)), this.inertialPanningX *= this.panningInertia, this.inertialPanningY *= this.panningInertia, Math.abs(this.inertialPanningX) < this.speed * e.Epsilon && (this.inertialPanningX = 0), Math.abs(this.inertialPanningY) < this.speed * e.Epsilon && (this.inertialPanningY = 0)), this._checkLimits(), t.prototype._checkInputs.call(this)
                            }
                        }, i.prototype._checkLimits = function() {
                            null === this.lowerBetaLimit || void 0 === this.lowerBetaLimit ? this.allowUpsideDown && this.beta > Math.PI && (this.beta = this.beta - 2 * Math.PI) : this.beta < this.lowerBetaLimit && (this.beta = this.lowerBetaLimit), null === this.upperBetaLimit || void 0 === this.upperBetaLimit ? this.allowUpsideDown && this.beta < -Math.PI && (this.beta = this.beta + 2 * Math.PI) : this.beta > this.upperBetaLimit && (this.beta = this.upperBetaLimit), null !== this.lowerAlphaLimit && this.alpha < this.lowerAlphaLimit && (this.alpha = this.lowerAlphaLimit), null !== this.upperAlphaLimit && this.alpha > this.upperAlphaLimit && (this.alpha = this.upperAlphaLimit), null !== this.lowerRadiusLimit && this.radius < this.lowerRadiusLimit && (this.radius = this.lowerRadiusLimit), null !== this.upperRadiusLimit && this.radius > this.upperRadiusLimit && (this.radius = this.upperRadiusLimit)
                        }, i.prototype.rebuildAnglesAndRadius = function() {
                            this.position.subtractToRef(this._getTargetPosition(), this._computationVector), this.radius = this._computationVector.length(), 0 === this.radius && (this.radius = 1e-4), this.alpha = Math.acos(this._computationVector.x / Math.sqrt(Math.pow(this._computationVector.x, 2) + Math.pow(this._computationVector.z, 2))), this._computationVector.z < 0 && (this.alpha = 2 * Math.PI - this.alpha), this.beta = Math.acos(this._computationVector.y / this.radius), this._checkLimits()
                        }, i.prototype.setPosition = function(e) {
                            this.position.equals(e) || (this.position.copyFrom(e), this.rebuildAnglesAndRadius())
                        }, i.prototype.setTarget = function(e, t, i) {
                            if (void 0 === t && (t = !1), void 0 === i && (i = !1), e.getBoundingInfo) this._targetBoundingCenter = t ? e.getBoundingInfo().boundingBox.centerWorld.clone() : null, this._targetHost = e, this._target = this._getTargetPosition(), this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);
                            else {
                                var r = e,
                                    n = this._getTargetPosition();
                                if (n && !i && n.equals(r)) return;
                                this._targetHost = null, this._target = r, this._targetBoundingCenter = null, this.onMeshTargetChangedObservable.notifyObservers(null)
                            }
                            this.rebuildAnglesAndRadius()
                        }, i.prototype._getViewMatrix = function() {
                            var t = Math.cos(this.alpha),
                                i = Math.sin(this.alpha),
                                r = Math.cos(this.beta),
                                n = Math.sin(this.beta);
                            0 === n && (n = 1e-4);
                            var o = this._getTargetPosition();
                            if (this._computationVector.copyFromFloats(this.radius * t * n, this.radius * r, this.radius * i * n), o.addToRef(this._computationVector, this._newPosition), this.getScene().collisionsEnabled && this.checkCollisions) this._collider || (this._collider = new e.Collider), this._collider._radius = this.collisionRadius, this._newPosition.subtractToRef(this.position, this._collisionVelocity), this._collisionTriggered = !0, this.getScene().collisionCoordinator.getNewPosition(this.position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
                            else {
                                this.position.copyFrom(this._newPosition);
                                var s = this.upVector;
                                this.allowUpsideDown && n < 0 && (s = (s = s.clone()).negate()), this._computeViewMatrix(this.position, o, s), this._viewMatrix.m[12] += this.targetScreenOffset.x, this._viewMatrix.m[13] += this.targetScreenOffset.y
                            }
                            return this._currentTarget = o, this._viewMatrix
                        }, i.prototype.zoomOn = function(t, i) {
                            void 0 === i && (i = !1), t = t || this.getScene().meshes;
                            var r = e.Mesh.MinMax(t),
                                n = e.Vector3.Distance(r.min, r.max);
                            this.radius = n * this.zoomOnFactor, this.focusOn({
                                min: r.min,
                                max: r.max,
                                distance: n
                            }, i)
                        }, i.prototype.focusOn = function(t, i) {
                            var r, n;
                            if (void 0 === i && (i = !1), void 0 === t.min) {
                                var o = t || this.getScene().meshes;
                                r = e.Mesh.MinMax(o), n = e.Vector3.Distance(r.min, r.max)
                            } else {
                                n = (r = t).distance
                            }
                            this._target = e.Mesh.Center(r), i || (this.maxZ = 2 * n)
                        }, i.prototype.createRigCamera = function(t, r) {
                            var n = 0;
                            switch (this.cameraRigMode) {
                                case e.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
                                case e.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
                                case e.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
                                case e.Camera.RIG_MODE_VR:
                                    n = this._cameraRigParams.stereoHalfAngle * (0 === r ? 1 : -1);
                                    break;
                                case e.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
                                    n = this._cameraRigParams.stereoHalfAngle * (0 === r ? -1 : 1)
                            }
                            var o = new i(t, this.alpha + n, this.beta, this.radius, this._target, this.getScene());
                            return o._cameraRigParams = {}, o
                        }, i.prototype._updateRigCameras = function() {
                            var i = this._rigCameras[0],
                                r = this._rigCameras[1];
                            switch (i.beta = r.beta = this.beta, i.radius = r.radius = this.radius, this.cameraRigMode) {
                                case e.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
                                case e.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
                                case e.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
                                case e.Camera.RIG_MODE_VR:
                                    i.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle, r.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle;
                                    break;
                                case e.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
                                    i.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle, r.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle
                            }
                            t.prototype._updateRigCameras.call(this)
                        }, i.prototype.dispose = function() {
                            this.inputs.clear(), t.prototype.dispose.call(this)
                        }, i.prototype.getClassName = function() {
                            return "ArcRotateCamera"
                        }, y([e.serialize()], i.prototype, "alpha", void 0), y([e.serialize()], i.prototype, "beta", void 0), y([e.serialize()], i.prototype, "radius", void 0), y([e.serializeAsVector3("target")], i.prototype, "_target", void 0), y([e.serialize()], i.prototype, "inertialAlphaOffset", void 0), y([e.serialize()], i.prototype, "inertialBetaOffset", void 0), y([e.serialize()], i.prototype, "inertialRadiusOffset", void 0), y([e.serialize()], i.prototype, "lowerAlphaLimit", void 0), y([e.serialize()], i.prototype, "upperAlphaLimit", void 0), y([e.serialize()], i.prototype, "lowerBetaLimit", void 0), y([e.serialize()], i.prototype, "upperBetaLimit", void 0), y([e.serialize()], i.prototype, "lowerRadiusLimit", void 0), y([e.serialize()], i.prototype, "upperRadiusLimit", void 0), y([e.serialize()], i.prototype, "inertialPanningX", void 0), y([e.serialize()], i.prototype, "inertialPanningY", void 0), y([e.serialize()], i.prototype, "pinchToPanMaxDistance", void 0), y([e.serialize()], i.prototype, "panningDistanceLimit", void 0), y([e.serializeAsVector3()], i.prototype, "panningOriginTarget", void 0), y([e.serialize()], i.prototype, "panningInertia", void 0), y([e.serialize()], i.prototype, "zoomOnFactor", void 0), y([e.serialize()], i.prototype, "targetScreenOffset", void 0), y([e.serialize()], i.prototype, "allowUpsideDown", void 0), y([e.serialize()], i.prototype, "useInputToRestoreState", void 0), i
                    }(e.TargetCamera);
                    e.ArcRotateCamera = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("Light_Type_3", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n) {
                            var o = t.call(this, i, n) || this;
                            return o.groundColor = new e.Color3(0, 0, 0), o.direction = r || e.Vector3.Up(), o
                        }
                        return b(i, t), i.prototype._buildUniformLayout = function() {
                            this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 3), this._uniformBuffer.addUniform("vLightGround", 3), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create()
                        }, i.prototype.getClassName = function() {
                            return "HemisphericLight"
                        }, i.prototype.setDirectionToTarget = function(t) {
                            return this.direction = e.Vector3.Normalize(t.subtract(e.Vector3.Zero())), this.direction
                        }, i.prototype.getShadowGenerator = function() {
                            return null
                        }, i.prototype.transferToEffect = function(t, i) {
                            var r = e.Vector3.Normalize(this.direction);
                            return this._uniformBuffer.updateFloat4("vLightData", r.x, r.y, r.z, 0, i), this._uniformBuffer.updateColor3("vLightGround", this.groundColor.scale(this.intensity), i), this
                        }, i.prototype.computeWorldMatrix = function(t, i) {
                            return this._worldMatrix || (this._worldMatrix = e.Matrix.Identity()), this._worldMatrix
                        }, i.prototype.getTypeID = function() {
                            return e.Light.LIGHTTYPEID_HEMISPHERICLIGHT
                        }, i.prototype.prepareLightSpecificDefines = function(e, t) {
                            e["HEMILIGHT" + t] = !0
                        }, y([e.serializeAsColor3()], i.prototype, "groundColor", void 0), y([e.serializeAsVector3()], i.prototype, "direction", void 0), i
                    }(e.Light);
                    e.HemisphericLight = t
                }($a || ($a = {})), Xe = $a || ($a = {}), Ye = function(e) {
                    function t() {
                        var t = null !== e && e.apply(this, arguments) || this;
                        return t._needProjectionMatrixCompute = !0, t
                    }
                    return b(t, e), t.prototype._setPosition = function(e) {
                        this._position = e
                    }, Object.defineProperty(t.prototype, "position", {
                        get: function() {
                            return this._position
                        },
                        set: function(e) {
                            this._setPosition(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._setDirection = function(e) {
                        this._direction = e
                    }, Object.defineProperty(t.prototype, "direction", {
                        get: function() {
                            return this._direction
                        },
                        set: function(e) {
                            this._setDirection(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "shadowMinZ", {
                        get: function() {
                            return this._shadowMinZ
                        },
                        set: function(e) {
                            this._shadowMinZ = e, this.forceProjectionMatrixCompute()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "shadowMaxZ", {
                        get: function() {
                            return this._shadowMaxZ
                        },
                        set: function(e) {
                            this._shadowMaxZ = e, this.forceProjectionMatrixCompute()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.computeTransformedInformation = function() {
                        return !(!this.parent || !this.parent.getWorldMatrix || (this.transformedPosition || (this.transformedPosition = Xe.Vector3.Zero()), Xe.Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition), this.direction && (this.transformedDirection || (this.transformedDirection = Xe.Vector3.Zero()), Xe.Vector3.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this.transformedDirection)), 0))
                    }, t.prototype.getDepthScale = function() {
                        return 50
                    }, t.prototype.getShadowDirection = function(e) {
                        return this.transformedDirection ? this.transformedDirection : this.direction
                    }, t.prototype.getAbsolutePosition = function() {
                        return this.transformedPosition ? this.transformedPosition : this.position
                    }, t.prototype.setDirectionToTarget = function(e) {
                        return this.direction = Xe.Vector3.Normalize(e.subtract(this.position)), this.direction
                    }, t.prototype.getRotation = function() {
                        this.direction.normalize();
                        var e = Xe.Vector3.Cross(this.direction, Xe.Axis.Y),
                            t = Xe.Vector3.Cross(e, this.direction);
                        return Xe.Vector3.RotationFromAxis(e, t, this.direction)
                    }, t.prototype.needCube = function() {
                        return !1
                    }, t.prototype.needProjectionMatrixCompute = function() {
                        return this._needProjectionMatrixCompute
                    }, t.prototype.forceProjectionMatrixCompute = function() {
                        this._needProjectionMatrixCompute = !0
                    }, t.prototype._initCache = function() {
                        e.prototype._initCache.call(this), this._cache.position = Xe.Vector3.Zero()
                    }, t.prototype._isSynchronized = function() {
                        return !!this._cache.position.equals(this.position)
                    }, t.prototype.computeWorldMatrix = function(e) {
                        return !e && this.isSynchronized() ? this._currentRenderId = this.getScene().getRenderId() : (this._updateCache(), this._cache.position.copyFrom(this.position), this._worldMatrix || (this._worldMatrix = Xe.Matrix.Identity()), Xe.Matrix.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix), this.parent && this.parent.getWorldMatrix && (this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix), this._markSyncedWithParent()), this._worldMatrixDeterminant = this._worldMatrix.determinant()), this._worldMatrix
                    }, t.prototype.getDepthMinZ = function(e) {
                        return void 0 !== this.shadowMinZ ? this.shadowMinZ : e.minZ
                    }, t.prototype.getDepthMaxZ = function(e) {
                        return void 0 !== this.shadowMaxZ ? this.shadowMaxZ : e.maxZ
                    }, t.prototype.setShadowProjectionMatrix = function(e, t, i) {
                        return this.customProjectionMatrixBuilder ? this.customProjectionMatrixBuilder(t, i, e) : this._setDefaultShadowProjectionMatrix(e, t, i), this
                    }, y([Xe.serializeAsVector3()], t.prototype, "position", null), y([Xe.serializeAsVector3()], t.prototype, "direction", null), y([Xe.serialize()], t.prototype, "shadowMinZ", null), y([Xe.serialize()], t.prototype, "shadowMaxZ", null), t
                }(Xe.Light), Xe.ShadowLight = Ye,
                function(e) {
                    e.Node.AddNodeConstructor("Light_Type_0", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(t) {
                        function i(e, i, r) {
                            var n = t.call(this, e, r) || this;
                            return n._shadowAngle = Math.PI / 2, n.position = i, n
                        }
                        return b(i, t), Object.defineProperty(i.prototype, "shadowAngle", {
                            get: function() {
                                return this._shadowAngle
                            },
                            set: function(e) {
                                this._shadowAngle = e, this.forceProjectionMatrixCompute()
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "direction", {
                            get: function() {
                                return this._direction
                            },
                            set: function(e) {
                                var t = this.needCube();
                                this._direction = e, this.needCube() !== t && this._shadowGenerator && this._shadowGenerator.recreateShadowMap()
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i.prototype.getClassName = function() {
                            return "PointLight"
                        }, i.prototype.getTypeID = function() {
                            return e.Light.LIGHTTYPEID_POINTLIGHT
                        }, i.prototype.needCube = function() {
                            return !this.direction
                        }, i.prototype.getShadowDirection = function(i) {
                            if (this.direction) return t.prototype.getShadowDirection.call(this, i);
                            switch (i) {
                                case 0:
                                    return new e.Vector3(1, 0, 0);
                                case 1:
                                    return new e.Vector3(-1, 0, 0);
                                case 2:
                                    return new e.Vector3(0, -1, 0);
                                case 3:
                                    return new e.Vector3(0, 1, 0);
                                case 4:
                                    return new e.Vector3(0, 0, 1);
                                case 5:
                                    return new e.Vector3(0, 0, -1)
                            }
                            return e.Vector3.Zero()
                        }, i.prototype._setDefaultShadowProjectionMatrix = function(t, i, r) {
                            var n = this.getScene().activeCamera;
                            n && e.Matrix.PerspectiveFovLHToRef(this.shadowAngle, 1, this.getDepthMinZ(n), this.getDepthMaxZ(n), t)
                        }, i.prototype._buildUniformLayout = function() {
                            this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 3), this._uniformBuffer.addUniform("vLightFalloff", 4), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create()
                        }, i.prototype.transferToEffect = function(e, t) {
                            return this.computeTransformedInformation() ? this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0, t) : this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, 0, t), this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, 0, 0, t), this
                        }, i.prototype.prepareLightSpecificDefines = function(e, t) {
                            e["POINTLIGHT" + t] = !0
                        }, y([e.serialize()], i.prototype, "shadowAngle", null), i
                    }(e.ShadowLight);
                    e.PointLight = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("Light_Type_1", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(t) {
                        function i(e, i, r) {
                            var n = t.call(this, e, r) || this;
                            return n._shadowFrustumSize = 0, n._shadowOrthoScale = .1, n.autoUpdateExtends = !0, n._orthoLeft = Number.MAX_VALUE, n._orthoRight = Number.MIN_VALUE, n._orthoTop = Number.MIN_VALUE, n._orthoBottom = Number.MAX_VALUE, n.position = i.scale(-1), n.direction = i, n
                        }
                        return b(i, t), Object.defineProperty(i.prototype, "shadowFrustumSize", {
                            get: function() {
                                return this._shadowFrustumSize
                            },
                            set: function(e) {
                                this._shadowFrustumSize = e, this.forceProjectionMatrixCompute()
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "shadowOrthoScale", {
                            get: function() {
                                return this._shadowOrthoScale
                            },
                            set: function(e) {
                                this._shadowOrthoScale = e, this.forceProjectionMatrixCompute()
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i.prototype.getClassName = function() {
                            return "DirectionalLight"
                        }, i.prototype.getTypeID = function() {
                            return e.Light.LIGHTTYPEID_DIRECTIONALLIGHT
                        }, i.prototype._setDefaultShadowProjectionMatrix = function(e, t, i) {
                            0 < this.shadowFrustumSize ? this._setDefaultFixedFrustumShadowProjectionMatrix(e, t) : this._setDefaultAutoExtendShadowProjectionMatrix(e, t, i)
                        }, i.prototype._setDefaultFixedFrustumShadowProjectionMatrix = function(t, i) {
                            var r = this.getScene().activeCamera;
                            r && e.Matrix.OrthoLHToRef(this.shadowFrustumSize, this.shadowFrustumSize, void 0 !== this.shadowMinZ ? this.shadowMinZ : r.minZ, void 0 !== this.shadowMaxZ ? this.shadowMaxZ : r.maxZ, t)
                        }, i.prototype._setDefaultAutoExtendShadowProjectionMatrix = function(t, i, r) {
                            var n = this.getScene().activeCamera;
                            if (n) {
                                if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) {
                                    var o = e.Vector3.Zero();
                                    this._orthoLeft = Number.MAX_VALUE, this._orthoRight = Number.MIN_VALUE, this._orthoTop = Number.MIN_VALUE, this._orthoBottom = Number.MAX_VALUE;
                                    for (var s = 0; s < r.length; s++) {
                                        var a = r[s];
                                        if (a)
                                            for (var l = a.getBoundingInfo().boundingBox, u = 0; u < l.vectorsWorld.length; u++) e.Vector3.TransformCoordinatesToRef(l.vectorsWorld[u], i, o), o.x < this._orthoLeft && (this._orthoLeft = o.x), o.y < this._orthoBottom && (this._orthoBottom = o.y), o.x > this._orthoRight && (this._orthoRight = o.x), o.y > this._orthoTop && (this._orthoTop = o.y)
                                    }
                                }
                                var c = this._orthoRight - this._orthoLeft,
                                    h = this._orthoTop - this._orthoBottom;
                                e.Matrix.OrthoOffCenterLHToRef(this._orthoLeft - c * this.shadowOrthoScale, this._orthoRight + c * this.shadowOrthoScale, this._orthoBottom - h * this.shadowOrthoScale, this._orthoTop + h * this.shadowOrthoScale, void 0 !== this.shadowMinZ ? this.shadowMinZ : n.minZ, void 0 !== this.shadowMaxZ ? this.shadowMaxZ : n.maxZ, t)
                            }
                        }, i.prototype._buildUniformLayout = function() {
                            this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 3), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create()
                        }, i.prototype.transferToEffect = function(e, t) {
                            return this.computeTransformedInformation() ? this._uniformBuffer.updateFloat4("vLightData", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, t) : this._uniformBuffer.updateFloat4("vLightData", this.direction.x, this.direction.y, this.direction.z, 1, t), this
                        }, i.prototype.getDepthMinZ = function(e) {
                            return 1
                        }, i.prototype.getDepthMaxZ = function(e) {
                            return 1
                        }, i.prototype.prepareLightSpecificDefines = function(e, t) {
                            e["DIRLIGHT" + t] = !0
                        }, y([e.serialize()], i.prototype, "shadowFrustumSize", null), y([e.serialize()], i.prototype, "shadowOrthoScale", null), y([e.serialize()], i.prototype, "autoUpdateExtends", void 0), i
                    }(e.ShadowLight);
                    e.DirectionalLight = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("Light_Type_2", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), e.Vector3.Zero(), 0, 0, r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o, s, a) {
                            var l = t.call(this, i, a) || this;
                            return l._innerAngle = 0, l._projectionTextureMatrix = e.Matrix.Zero(), l._projectionTextureLightNear = 1e-6, l._projectionTextureLightFar = 1e3, l._projectionTextureUpDirection = e.Vector3.Up(), l._projectionTextureViewLightDirty = !0, l._projectionTextureProjectionLightDirty = !0, l._projectionTextureDirty = !0, l._projectionTextureViewTargetVector = e.Vector3.Zero(), l._projectionTextureViewLightMatrix = e.Matrix.Zero(), l._projectionTextureProjectionLightMatrix = e.Matrix.Zero(), l._projectionTextureScalingMatrix = e.Matrix.FromValues(.5, 0, 0, 0, 0, .5, 0, 0, 0, 0, .5, 0, .5, .5, .5, 1), l.position = r, l.direction = n, l.angle = o, l.exponent = s, l
                        }
                        return b(i, t), Object.defineProperty(i.prototype, "angle", {
                            get: function() {
                                return this._angle
                            },
                            set: function(e) {
                                this._angle = e, this._cosHalfAngle = Math.cos(.5 * e), this._projectionTextureProjectionLightDirty = !0, this.forceProjectionMatrixCompute(), this._computeAngleValues()
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "innerAngle", {
                            get: function() {
                                return this._innerAngle
                            },
                            set: function(e) {
                                this._innerAngle = e, this._computeAngleValues()
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "shadowAngleScale", {
                            get: function() {
                                return this._shadowAngleScale
                            },
                            set: function(e) {
                                this._shadowAngleScale = e, this.forceProjectionMatrixCompute()
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "projectionTextureMatrix", {
                            get: function() {
                                return this._projectionTextureMatrix
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "projectionTextureLightNear", {
                            get: function() {
                                return this._projectionTextureLightNear
                            },
                            set: function(e) {
                                this._projectionTextureLightNear = e, this._projectionTextureProjectionLightDirty = !0
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "projectionTextureLightFar", {
                            get: function() {
                                return this._projectionTextureLightFar
                            },
                            set: function(e) {
                                this._projectionTextureLightFar = e, this._projectionTextureProjectionLightDirty = !0
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "projectionTextureUpDirection", {
                            get: function() {
                                return this._projectionTextureUpDirection
                            },
                            set: function(e) {
                                this._projectionTextureUpDirection = e, this._projectionTextureProjectionLightDirty = !0
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "projectionTexture", {
                            get: function() {
                                return this._projectionTexture
                            },
                            set: function(e) {
                                this._projectionTexture = e, this._projectionTextureDirty = !0
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i.prototype.getClassName = function() {
                            return "SpotLight"
                        }, i.prototype.getTypeID = function() {
                            return e.Light.LIGHTTYPEID_SPOTLIGHT
                        }, i.prototype._setDirection = function(e) {
                            t.prototype._setDirection.call(this, e), this._projectionTextureViewLightDirty = !0
                        }, i.prototype._setPosition = function(e) {
                            t.prototype._setPosition.call(this, e), this._projectionTextureViewLightDirty = !0
                        }, i.prototype._setDefaultShadowProjectionMatrix = function(t, i, r) {
                            var n = this.getScene().activeCamera;
                            if (n) {
                                this._shadowAngleScale = this._shadowAngleScale || 1;
                                var o = this._shadowAngleScale * this._angle;
                                e.Matrix.PerspectiveFovLHToRef(o, 1, this.getDepthMinZ(n), this.getDepthMaxZ(n), t)
                            }
                        }, i.prototype._computeProjectionTextureViewLightMatrix = function() {
                            this._projectionTextureViewLightDirty = !1, this._projectionTextureDirty = !0, this.position.addToRef(this.direction, this._projectionTextureViewTargetVector), e.Matrix.LookAtLHToRef(this.position, this._projectionTextureViewTargetVector, this._projectionTextureUpDirection, this._projectionTextureViewLightMatrix)
                        }, i.prototype._computeProjectionTextureProjectionLightMatrix = function() {
                            this._projectionTextureProjectionLightDirty = !1, this._projectionTextureDirty = !0;
                            var t = this.projectionTextureLightFar,
                                i = this.projectionTextureLightNear,
                                r = t / (t - i),
                                n = -r * i,
                                o = 1 / Math.tan(this._angle / 2);
                            e.Matrix.FromValuesToRef(o / 1, 0, 0, 0, 0, o, 0, 0, 0, 0, r, 1, 0, 0, n, 0, this._projectionTextureProjectionLightMatrix)
                        }, i.prototype._computeProjectionTextureMatrix = function() {
                            this._projectionTextureDirty = !1, this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix, this._projectionTextureMatrix), this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix, this._projectionTextureMatrix)
                        }, i.prototype._buildUniformLayout = function() {
                            this._uniformBuffer.addUniform("vLightData", 4), this._uniformBuffer.addUniform("vLightDiffuse", 4), this._uniformBuffer.addUniform("vLightSpecular", 3), this._uniformBuffer.addUniform("vLightDirection", 3), this._uniformBuffer.addUniform("vLightFalloff", 4), this._uniformBuffer.addUniform("shadowsInfo", 3), this._uniformBuffer.addUniform("depthValues", 2), this._uniformBuffer.create()
                        }, i.prototype._computeAngleValues = function() {
                            this._lightAngleScale = 1 / Math.max(.001, Math.cos(.5 * this._innerAngle) - this._cosHalfAngle), this._lightAngleOffset = -this._cosHalfAngle * this._lightAngleScale
                        }, i.prototype.transferToEffect = function(t, i) {
                            var r;
                            return this.computeTransformedInformation() ? (this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent, i), r = e.Vector3.Normalize(this.transformedDirection)) : (this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, this.exponent, i), r = e.Vector3.Normalize(this.direction)), this._uniformBuffer.updateFloat4("vLightDirection", r.x, r.y, r.z, this._cosHalfAngle, i), this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, this._lightAngleScale, this._lightAngleOffset, i), this.projectionTexture && this.projectionTexture.isReady() && (this._projectionTextureViewLightDirty && this._computeProjectionTextureViewLightMatrix(), this._projectionTextureProjectionLightDirty && this._computeProjectionTextureProjectionLightMatrix(), this._projectionTextureDirty && this._computeProjectionTextureMatrix(), t.setMatrix("textureProjectionMatrix" + i, this._projectionTextureMatrix), t.setTexture("projectionLightSampler" + i, this.projectionTexture)), this
                        }, i.prototype.dispose = function() {
                            t.prototype.dispose.call(this), this._projectionTexture && this._projectionTexture.dispose()
                        }, i.prototype.prepareLightSpecificDefines = function(e, t) {
                            e["SPOTLIGHT" + t] = !0, e["PROJECTEDLIGHTTEXTURE" + t] = !!this.projectionTexture
                        }, y([e.serialize()], i.prototype, "angle", null), y([e.serialize()], i.prototype, "innerAngle", null), y([e.serialize()], i.prototype, "shadowAngleScale", null), y([e.serialize()], i.prototype, "exponent", void 0), y([e.serialize()], i.prototype, "projectionTextureLightNear", null), y([e.serialize()], i.prototype, "projectionTextureLightFar", null), y([e.serialize()], i.prototype, "projectionTextureUpDirection", null), y([e.serializeAsTexture("projectedLightTexture")], i.prototype, "_projectionTexture", void 0), i
                    }(e.ShadowLight);
                    e.SpotLight = t
                }($a || ($a = {})), qe = $a || ($a = {}), Ke = function() {
                    this.enableBlending = !1, this.blendingSpeed = .01, this.loopMode = qe.Animation.ANIMATIONLOOPMODE_CYCLE
                }, qe.AnimationPropertiesOverride = Ke,
                function(e) {
                    var t = function() {
                        function e(e, t, i) {
                            this.name = e, this.from = t, this.to = i
                        }
                        return e.prototype.clone = function() {
                            return new e(this.name, this.from, this.to)
                        }, e
                    }();
                    e.AnimationRange = t;
                    var i = function() {
                        function e(e, t, i) {
                            this.frame = e, this.action = t, this.onlyOnce = i, this.isDone = !1
                        }
                        return e.prototype._clone = function() {
                            return new e(this.frame, this.action, this.onlyOnce)
                        }, e
                    }();
                    e.AnimationEvent = i;
                    var r, n, o = function() {
                        function t(e) {
                            this.path = e, this._onchange = new Array, this.value = 0, this.animations = new Array
                        }
                        return t.prototype.getPoint = function() {
                            var t = this.path.getPointAtLengthPosition(this.value);
                            return new e.Vector3(t.x, 0, t.y)
                        }, t.prototype.moveAhead = function(e) {
                            return void 0 === e && (e = .002), this.move(e), this
                        }, t.prototype.moveBack = function(e) {
                            return void 0 === e && (e = .002), this.move(-e), this
                        }, t.prototype.move = function(e) {
                            if (1 < Math.abs(e)) throw "step size should be less than 1.";
                            return this.value += e, this.ensureLimits(), this.raiseOnChange(), this
                        }, t.prototype.ensureLimits = function() {
                            for (; 1 < this.value;) this.value -= 1;
                            for (; this.value < 0;) this.value += 1;
                            return this
                        }, t.prototype.raiseOnChange = function() {
                            var e = this;
                            return this._onchange.forEach(function(t) {
                                return t(e)
                            }), this
                        }, t.prototype.onchange = function(e) {
                            return this._onchange.push(e), this
                        }, t
                    }();
                    e.PathCursor = o, (n = r = e.AnimationKeyInterpolation || (e.AnimationKeyInterpolation = {}))[n.STEP = 1] = "STEP";
                    var s = function() {
                        function i(e, t, r, n, o, s) {
                            this.name = e, this.targetProperty = t, this.framePerSecond = r, this.dataType = n, this.loopMode = o, this.enableBlending = s, this._runtimeAnimations = new Array, this._events = new Array, this.blendingSpeed = .01, this._ranges = {}, this.targetPropertyPath = t.split("."), this.dataType = n, this.loopMode = void 0 === o ? i.ANIMATIONLOOPMODE_CYCLE : o
                        }
                        return i._PrepareAnimation = function(t, r, n, o, s, a, l, u) {
                            var c = void 0;
                            if (!isNaN(parseFloat(s)) && isFinite(s) ? c = i.ANIMATIONTYPE_FLOAT : s instanceof e.Quaternion ? c = i.ANIMATIONTYPE_QUATERNION : s instanceof e.Vector3 ? c = i.ANIMATIONTYPE_VECTOR3 : s instanceof e.Vector2 ? c = i.ANIMATIONTYPE_VECTOR2 : s instanceof e.Color3 ? c = i.ANIMATIONTYPE_COLOR3 : s instanceof e.Size && (c = i.ANIMATIONTYPE_SIZE), null == c) return null;
                            var h = new i(t, r, n, c, l),
                                d = [{
                                    frame: 0,
                                    value: s
                                }, {
                                    frame: o,
                                    value: a
                                }];
                            return h.setKeys(d), void 0 !== u && h.setEasingFunction(u), h
                        }, i.CreateAnimation = function(e, t, r, n) {
                            var o = new i(e + "Animation", e, r, t, i.ANIMATIONLOOPMODE_CONSTANT);
                            return o.setEasingFunction(n), o
                        }, i.CreateAndStartAnimation = function(e, t, r, n, o, s, a, l, u, c) {
                            var h = i._PrepareAnimation(e, r, n, o, s, a, l, u);
                            return h ? t.getScene().beginDirectAnimation(t, [h], 0, o, 1 === h.loopMode, 1, c) : null
                        }, i.CreateAndStartHierarchyAnimation = function(e, t, r, n, o, s, a, l, u, c, h) {
                            var d = i._PrepareAnimation(e, n, o, s, a, l, u, c);
                            return d ? t.getScene().beginDirectHierarchyAnimation(t, r, [d], 0, s, 1 === d.loopMode, 1, h) : null
                        }, i.CreateMergeAndStartAnimation = function(e, t, r, n, o, s, a, l, u, c) {
                            var h = i._PrepareAnimation(e, r, n, o, s, a, l, u);
                            return h ? (t.animations.push(h), t.getScene().beginAnimation(t, 0, o, 1 === h.loopMode, 1, c)) : null
                        }, i.TransitionTo = function(e, t, i, r, n, o, s, a) {
                            if (void 0 === a && (a = null), s <= 0) return i[e] = t, a && a(), null;
                            var l = n * (s / 1e3);
                            o.setKeys([{
                                frame: 0,
                                value: i[e].clone ? i[e].clone() : i[e]
                            }, {
                                frame: l,
                                value: t
                            }]), i.animations || (i.animations = []), i.animations.push(o);
                            var u = r.beginAnimation(i, 0, l, !1);
                            return u.onAnimationEnd = a, u
                        }, Object.defineProperty(i.prototype, "runtimeAnimations", {
                            get: function() {
                                return this._runtimeAnimations
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "hasRunningRuntimeAnimations", {
                            get: function() {
                                for (var e = 0, t = this._runtimeAnimations; e < t.length; e++)
                                    if (!t[e].isStopped) return !0;
                                return !1
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i.prototype.toString = function(e) {
                            var t = "Name: " + this.name + ", property: " + this.targetProperty;
                            if (t += ", datatype: " + ["Float", "Vector3", "Quaternion", "Matrix", "Color3", "Vector2"][this.dataType], t += ", nKeys: " + (this._keys ? this._keys.length : "none"), t += ", nRanges: " + (this._ranges ? Object.keys(this._ranges).length : "none"), e) {
                                t += ", Ranges: {";
                                var i = !0;
                                for (var r in this._ranges) i && (t += ", ", i = !1), t += r;
                                t += "}"
                            }
                            return t
                        }, i.prototype.addEvent = function(e) {
                            this._events.push(e)
                        }, i.prototype.removeEvents = function(e) {
                            for (var t = 0; t < this._events.length; t++) this._events[t].frame === e && (this._events.splice(t, 1), t--)
                        }, i.prototype.getEvents = function() {
                            return this._events
                        }, i.prototype.createRange = function(e, i, r) {
                            this._ranges[e] || (this._ranges[e] = new t(e, i, r))
                        }, i.prototype.deleteRange = function(e, t) {
                            void 0 === t && (t = !0);
                            var i = this._ranges[e];
                            if (i) {
                                if (t)
                                    for (var r = i.from, n = i.to, o = this._keys.length - 1; 0 <= o; o--) this._keys[o].frame >= r && this._keys[o].frame <= n && this._keys.splice(o, 1);
                                this._ranges[e] = null
                            }
                        }, i.prototype.getRange = function(e) {
                            return this._ranges[e]
                        }, i.prototype.getKeys = function() {
                            return this._keys
                        }, i.prototype.getHighestFrame = function() {
                            for (var e = 0, t = 0, i = this._keys.length; t < i; t++) e < this._keys[t].frame && (e = this._keys[t].frame);
                            return e
                        }, i.prototype.getEasingFunction = function() {
                            return this._easingFunction
                        }, i.prototype.setEasingFunction = function(e) {
                            this._easingFunction = e
                        }, i.prototype.floatInterpolateFunction = function(t, i, r) {
                            return e.Scalar.Lerp(t, i, r)
                        }, i.prototype.floatInterpolateFunctionWithTangents = function(t, i, r, n, o) {
                            return e.Scalar.Hermite(t, i, r, n, o)
                        }, i.prototype.quaternionInterpolateFunction = function(t, i, r) {
                            return e.Quaternion.Slerp(t, i, r)
                        }, i.prototype.quaternionInterpolateFunctionWithTangents = function(t, i, r, n, o) {
                            return e.Quaternion.Hermite(t, i, r, n, o).normalize()
                        }, i.prototype.vector3InterpolateFunction = function(t, i, r) {
                            return e.Vector3.Lerp(t, i, r)
                        }, i.prototype.vector3InterpolateFunctionWithTangents = function(t, i, r, n, o) {
                            return e.Vector3.Hermite(t, i, r, n, o)
                        }, i.prototype.vector2InterpolateFunction = function(t, i, r) {
                            return e.Vector2.Lerp(t, i, r)
                        }, i.prototype.vector2InterpolateFunctionWithTangents = function(t, i, r, n, o) {
                            return e.Vector2.Hermite(t, i, r, n, o)
                        }, i.prototype.sizeInterpolateFunction = function(t, i, r) {
                            return e.Size.Lerp(t, i, r)
                        }, i.prototype.color3InterpolateFunction = function(t, i, r) {
                            return e.Color3.Lerp(t, i, r)
                        }, i.prototype._getKeyValue = function(e) {
                            return "function" == typeof e ? e() : e
                        }, i.prototype._interpolate = function(e, t, n, o, s, a) {
                            if (o === i.ANIMATIONLOOPMODE_CONSTANT && 0 < t) return a.clone ? a.clone() : a;
                            var l = this.getKeys(),
                                u = Math.max(0, Math.min(l.length - 1, Math.floor(l.length * (e - l[0].frame) / (l[l.length - 1].frame - l[0].frame)) - 1));
                            if (l[u].frame >= e)
                                for (; 0 <= u - 1 && l[u].frame >= e;) u--;
                            for (var c = u; c < l.length; c++) {
                                var h = l[c + 1];
                                if (h.frame >= e) {
                                    var d = l[c],
                                        p = this._getKeyValue(d.value);
                                    if (d.interpolation === r.STEP) return p;
                                    var f = this._getKeyValue(h.value),
                                        _ = void 0 !== d.outTangent && void 0 !== h.inTangent,
                                        m = h.frame - d.frame,
                                        g = (e - d.frame) / m,
                                        v = this.getEasingFunction();
                                    switch (null != v && (g = v.ease(g)), this.dataType) {
                                        case i.ANIMATIONTYPE_FLOAT:
                                            var y = _ ? this.floatInterpolateFunctionWithTangents(p, d.outTangent * m, f, h.inTangent * m, g) : this.floatInterpolateFunction(p, f, g);
                                            switch (o) {
                                                case i.ANIMATIONLOOPMODE_CYCLE:
                                                case i.ANIMATIONLOOPMODE_CONSTANT:
                                                    return y;
                                                case i.ANIMATIONLOOPMODE_RELATIVE:
                                                    return s * t + y
                                            }
                                            break;
                                        case i.ANIMATIONTYPE_QUATERNION:
                                            var b = _ ? this.quaternionInterpolateFunctionWithTangents(p, d.outTangent.scale(m), f, h.inTangent.scale(m), g) : this.quaternionInterpolateFunction(p, f, g);
                                            switch (o) {
                                                case i.ANIMATIONLOOPMODE_CYCLE:
                                                case i.ANIMATIONLOOPMODE_CONSTANT:
                                                    return b;
                                                case i.ANIMATIONLOOPMODE_RELATIVE:
                                                    return b.addInPlace(s.scale(t))
                                            }
                                            return b;
                                        case i.ANIMATIONTYPE_VECTOR3:
                                            var x = _ ? this.vector3InterpolateFunctionWithTangents(p, d.outTangent.scale(m), f, h.inTangent.scale(m), g) : this.vector3InterpolateFunction(p, f, g);
                                            switch (o) {
                                                case i.ANIMATIONLOOPMODE_CYCLE:
                                                case i.ANIMATIONLOOPMODE_CONSTANT:
                                                    return x;
                                                case i.ANIMATIONLOOPMODE_RELATIVE:
                                                    return x.add(s.scale(t))
                                            }
                                        case i.ANIMATIONTYPE_VECTOR2:
                                            var T = _ ? this.vector2InterpolateFunctionWithTangents(p, d.outTangent.scale(m), f, h.inTangent.scale(m), g) : this.vector2InterpolateFunction(p, f, g);
                                            switch (o) {
                                                case i.ANIMATIONLOOPMODE_CYCLE:
                                                case i.ANIMATIONLOOPMODE_CONSTANT:
                                                    return T;
                                                case i.ANIMATIONLOOPMODE_RELATIVE:
                                                    return T.add(s.scale(t))
                                            }
                                        case i.ANIMATIONTYPE_SIZE:
                                            switch (o) {
                                                case i.ANIMATIONLOOPMODE_CYCLE:
                                                case i.ANIMATIONLOOPMODE_CONSTANT:
                                                    return this.sizeInterpolateFunction(p, f, g);
                                                case i.ANIMATIONLOOPMODE_RELATIVE:
                                                    return this.sizeInterpolateFunction(p, f, g).add(s.scale(t))
                                            }
                                        case i.ANIMATIONTYPE_COLOR3:
                                            switch (o) {
                                                case i.ANIMATIONLOOPMODE_CYCLE:
                                                case i.ANIMATIONLOOPMODE_CONSTANT:
                                                    return this.color3InterpolateFunction(p, f, g);
                                                case i.ANIMATIONLOOPMODE_RELATIVE:
                                                    return this.color3InterpolateFunction(p, f, g).add(s.scale(t))
                                            }
                                        case i.ANIMATIONTYPE_MATRIX:
                                            switch (o) {
                                                case i.ANIMATIONLOOPMODE_CYCLE:
                                                case i.ANIMATIONLOOPMODE_CONSTANT:
                                                    if (i.AllowMatricesInterpolation) return this.matrixInterpolateFunction(p, f, g, n);
                                                case i.ANIMATIONLOOPMODE_RELATIVE:
                                                    return p
                                            }
                                    }
                                    break
                                }
                            }
                            return this._getKeyValue(l[l.length - 1].value)
                        }, i.prototype.matrixInterpolateFunction = function(t, r, n, o) {
                            return i.AllowMatrixDecomposeForInterpolation ? o ? (e.Matrix.DecomposeLerpToRef(t, r, n, o), o) : e.Matrix.DecomposeLerp(t, r, n) : o ? (e.Matrix.LerpToRef(t, r, n, o), o) : e.Matrix.Lerp(t, r, n)
                        }, i.prototype.clone = function() {
                            var e = new i(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode);
                            if (e.enableBlending = this.enableBlending, e.blendingSpeed = this.blendingSpeed, this._keys && e.setKeys(this._keys), this._ranges)
                                for (var t in e._ranges = {}, this._ranges) {
                                    var r = this._ranges[t];
                                    r && (e._ranges[t] = r.clone())
                                }
                            return e
                        }, i.prototype.setKeys = function(e) {
                            this._keys = e.slice(0)
                        }, i.prototype.serialize = function() {
                            var e = {};
                            e.name = this.name, e.property = this.targetProperty, e.framePerSecond = this.framePerSecond, e.dataType = this.dataType, e.loopBehavior = this.loopMode, e.enableBlending = this.enableBlending, e.blendingSpeed = this.blendingSpeed;
                            var t = this.dataType;
                            e.keys = [];
                            for (var r = this.getKeys(), n = 0; n < r.length; n++) {
                                var o = r[n],
                                    s = {};
                                switch (s.frame = o.frame, t) {
                                    case i.ANIMATIONTYPE_FLOAT:
                                        s.values = [o.value];
                                        break;
                                    case i.ANIMATIONTYPE_QUATERNION:
                                    case i.ANIMATIONTYPE_MATRIX:
                                    case i.ANIMATIONTYPE_VECTOR3:
                                    case i.ANIMATIONTYPE_COLOR3:
                                        s.values = o.value.asArray()
                                }
                                e.keys.push(s)
                            }
                            for (var a in e.ranges = [], this._ranges) {
                                var l = this._ranges[a];
                                if (l) {
                                    var u = {};
                                    u.name = a, u.from = l.from, u.to = l.to, e.ranges.push(u)
                                }
                            }
                            return e
                        }, Object.defineProperty(i, "ANIMATIONTYPE_FLOAT", {
                            get: function() {
                                return i._ANIMATIONTYPE_FLOAT
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "ANIMATIONTYPE_VECTOR3", {
                            get: function() {
                                return i._ANIMATIONTYPE_VECTOR3
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "ANIMATIONTYPE_VECTOR2", {
                            get: function() {
                                return i._ANIMATIONTYPE_VECTOR2
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "ANIMATIONTYPE_SIZE", {
                            get: function() {
                                return i._ANIMATIONTYPE_SIZE
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "ANIMATIONTYPE_QUATERNION", {
                            get: function() {
                                return i._ANIMATIONTYPE_QUATERNION
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "ANIMATIONTYPE_MATRIX", {
                            get: function() {
                                return i._ANIMATIONTYPE_MATRIX
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "ANIMATIONTYPE_COLOR3", {
                            get: function() {
                                return i._ANIMATIONTYPE_COLOR3
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "ANIMATIONLOOPMODE_RELATIVE", {
                            get: function() {
                                return i._ANIMATIONLOOPMODE_RELATIVE
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "ANIMATIONLOOPMODE_CYCLE", {
                            get: function() {
                                return i._ANIMATIONLOOPMODE_CYCLE
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "ANIMATIONLOOPMODE_CONSTANT", {
                            get: function() {
                                return i._ANIMATIONLOOPMODE_CONSTANT
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i._UniversalLerp = function(e, t, i) {
                            var r = e.constructor;
                            return r.Lerp ? r.Lerp(e, t, i) : r.Slerp ? r.Slerp(e, t, i) : e.toFixed ? e * (1 - i) + i * t : t
                        }, i.Parse = function(t) {
                            var r, n, o = new i(t.name, t.property, t.framePerSecond, t.dataType, t.loopBehavior),
                                s = t.dataType,
                                a = [];
                            for (t.enableBlending && (o.enableBlending = t.enableBlending), t.blendingSpeed && (o.blendingSpeed = t.blendingSpeed), n = 0; n < t.keys.length; n++) {
                                var l, u, c = t.keys[n];
                                switch (s) {
                                    case i.ANIMATIONTYPE_FLOAT:
                                        r = c.values[0], 1 <= c.values.length && (l = c.values[1]), 2 <= c.values.length && (u = c.values[2]);
                                        break;
                                    case i.ANIMATIONTYPE_QUATERNION:
                                        if (r = e.Quaternion.FromArray(c.values), 8 <= c.values.length) {
                                            var h = e.Quaternion.FromArray(c.values.slice(4, 8));
                                            h.equals(e.Quaternion.Zero()) || (l = h)
                                        }
                                        if (12 <= c.values.length) {
                                            var d = e.Quaternion.FromArray(c.values.slice(8, 12));
                                            d.equals(e.Quaternion.Zero()) || (u = d)
                                        }
                                        break;
                                    case i.ANIMATIONTYPE_MATRIX:
                                        r = e.Matrix.FromArray(c.values);
                                        break;
                                    case i.ANIMATIONTYPE_COLOR3:
                                        r = e.Color3.FromArray(c.values);
                                        break;
                                    case i.ANIMATIONTYPE_VECTOR3:
                                    default:
                                        r = e.Vector3.FromArray(c.values)
                                }
                                var p = {};
                                p.frame = c.frame, p.value = r, null != l && (p.inTangent = l), null != u && (p.outTangent = u), a.push(p)
                            }
                            if (o.setKeys(a), t.ranges)
                                for (n = 0; n < t.ranges.length; n++) r = t.ranges[n], o.createRange(r.name, r.from, r.to);
                            return o
                        }, i.AppendSerializedAnimations = function(e, t) {
                            if (e.animations) {
                                t.animations = [];
                                for (var i = 0; i < e.animations.length; i++) {
                                    var r = e.animations[i];
                                    t.animations.push(r.serialize())
                                }
                            }
                        }, i.AllowMatricesInterpolation = !1, i.AllowMatrixDecomposeForInterpolation = !0, i._ANIMATIONTYPE_FLOAT = 0, i._ANIMATIONTYPE_VECTOR3 = 1, i._ANIMATIONTYPE_QUATERNION = 2, i._ANIMATIONTYPE_MATRIX = 3, i._ANIMATIONTYPE_COLOR3 = 4, i._ANIMATIONTYPE_VECTOR2 = 5, i._ANIMATIONTYPE_SIZE = 6, i._ANIMATIONLOOPMODE_RELATIVE = 0, i._ANIMATIONLOOPMODE_CYCLE = 1, i._ANIMATIONLOOPMODE_CONSTANT = 2, i
                    }();
                    e.Animation = s
                }($a || ($a = {})),
                function(e) {
                    var t = function() {};
                    e.TargetedAnimation = t;
                    var i = function() {
                        function t(t, i) {
                            void 0 === i && (i = null), this.name = t, this._targetedAnimations = new Array, this._animatables = new Array, this._from = Number.MAX_VALUE, this._to = -Number.MAX_VALUE, this._speedRatio = 1, this.onAnimationEndObservable = new e.Observable, this.onAnimationGroupEndObservable = new e.Observable, this.onAnimationGroupPauseObservable = new e.Observable, this._scene = i || e.Engine.LastCreatedScene, this._scene.animationGroups.push(this)
                        }
                        return Object.defineProperty(t.prototype, "from", {
                            get: function() {
                                return this._from
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "to", {
                            get: function() {
                                return this._to
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "isStarted", {
                            get: function() {
                                return this._isStarted
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "speedRatio", {
                            get: function() {
                                return this._speedRatio
                            },
                            set: function(e) {
                                if (this._speedRatio !== e) {
                                    this._speedRatio = e;
                                    for (var t = 0; t < this._animatables.length; t++) this._animatables[t].speedRatio = this._speedRatio
                                }
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "targetedAnimations", {
                            get: function() {
                                return this._targetedAnimations
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "animatables", {
                            get: function() {
                                return this._animatables
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.addTargetedAnimation = function(e, t) {
                            var i = {
                                    animation: e,
                                    target: t
                                },
                                r = e.getKeys();
                            return this._from > r[0].frame && (this._from = r[0].frame), this._to < r[r.length - 1].frame && (this._to = r[r.length - 1].frame), this._targetedAnimations.push(i), i
                        }, t.prototype.normalize = function(e, t) {
                            void 0 === e && (e = null), void 0 === t && (t = null), null == e && (e = this._from), null == t && (t = this._to);
                            for (var i = 0; i < this._targetedAnimations.length; i++) {
                                var r = this._targetedAnimations[i].animation.getKeys(),
                                    n = r[0],
                                    o = r[r.length - 1];
                                if (n.frame > e) {
                                    var s = {
                                        frame: e,
                                        value: n.value,
                                        inTangent: n.inTangent,
                                        outTangent: n.outTangent,
                                        interpolation: n.interpolation
                                    };
                                    r.splice(0, 0, s)
                                }
                                o.frame < t && (s = {
                                    frame: t,
                                    value: o.value,
                                    inTangent: o.outTangent,
                                    outTangent: o.outTangent,
                                    interpolation: o.interpolation
                                }, r.push(s))
                            }
                            return this._from = e, this._to = t, this
                        }, t.prototype.start = function(e, t, i, r) {
                            var n = this;
                            if (void 0 === e && (e = !1), void 0 === t && (t = 1), this._isStarted || 0 === this._targetedAnimations.length) return this;
                            for (var o = this, s = 0, a = this._targetedAnimations; s < a.length; s++) ! function(s) {
                                var a = o._scene.beginDirectAnimation(s.target, [s.animation], void 0 !== i ? i : o._from, void 0 !== r ? r : o._to, e, t);
                                a.onAnimationEnd = function() {
                                    n.onAnimationEndObservable.notifyObservers(s), n._checkAnimationGroupEnded(a)
                                }, o._animatables.push(a)
                            }(a[s]);
                            return this._speedRatio = t, this._isStarted = !0, this
                        }, t.prototype.pause = function() {
                            if (!this._isStarted) return this;
                            for (var e = 0; e < this._animatables.length; e++) this._animatables[e].pause();
                            return this.onAnimationGroupPauseObservable.notifyObservers(this), this
                        }, t.prototype.play = function(e) {
                            if (this.isStarted && this._animatables.length === this._targetedAnimations.length) {
                                if (void 0 !== e)
                                    for (var t = 0; t < this._animatables.length; t++) this._animatables[t].loopAnimation = e;
                                this.restart()
                            } else this.stop(), this.start(e, this._speedRatio);
                            return this
                        }, t.prototype.reset = function() {
                            if (!this._isStarted) return this;
                            for (var e = 0; e < this._animatables.length; e++) this._animatables[e].reset();
                            return this
                        }, t.prototype.restart = function() {
                            if (!this._isStarted) return this;
                            for (var e = 0; e < this._animatables.length; e++) this._animatables[e].restart();
                            return this
                        }, t.prototype.stop = function() {
                            if (!this._isStarted) return this;
                            for (var e = this._animatables.slice(), t = 0; t < e.length; t++) e[t].stop();
                            return this._isStarted = !1, this
                        }, t.prototype.setWeightForAllAnimatables = function(e) {
                            for (var t = 0; t < this._animatables.length; t++) this._animatables[t].weight = e;
                            return this
                        }, t.prototype.syncAllAnimationsWith = function(e) {
                            for (var t = 0; t < this._animatables.length; t++) this._animatables[t].syncWith(e);
                            return this
                        }, t.prototype.goToFrame = function(e) {
                            if (!this._isStarted) return this;
                            for (var t = 0; t < this._animatables.length; t++) this._animatables[t].goToFrame(e);
                            return this
                        }, t.prototype.dispose = function() {
                            this._targetedAnimations = [], this._animatables = [];
                            var e = this._scene.animationGroups.indexOf(this); - 1 < e && this._scene.animationGroups.splice(e, 1)
                        }, t.prototype._checkAnimationGroupEnded = function(e) {
                            var t = this._animatables.indexOf(e); - 1 < t && this._animatables.splice(t, 1), 0 === this._animatables.length && (this._isStarted = !1, this.onAnimationGroupEndObservable.notifyObservers(this))
                        }, t.Parse = function(t, i) {
                            for (var r = new e.AnimationGroup(t.name, i), n = 0; n < t.targetedAnimations.length; n++) {
                                var o = t.targetedAnimations[n],
                                    s = e.Animation.Parse(o.animation),
                                    a = o.targetId,
                                    l = i.getNodeByID(a);
                                null != l && r.addTargetedAnimation(s, l)
                            }
                            return null !== t.from && null !== t.from && r.normalize(t.from, t.to), r
                        }, t.prototype.getClassName = function() {
                            return "AnimationGroup"
                        }, t.prototype.toString = function(e) {
                            var t = "Name: " + this.name;
                            return t += ", type: " + this.getClassName(), e && (t += ", from: " + this._from, t += ", to: " + this._to, t += ", isStarted: " + this._isStarted, t += ", speedRatio: " + this._speedRatio, t += ", targetedAnimations length: " + this._targetedAnimations.length, t += ", animatables length: " + this._animatables), t
                        }, t
                    }();
                    e.AnimationGroup = i
                }($a || ($a = {})), Qe = $a || ($a = {}), Ze = Object.freeze(new Qe.Quaternion(0, 0, 0, 0)), Je = Object.freeze(Qe.Vector3.Zero()), $e = Object.freeze(Qe.Vector2.Zero()), et = Object.freeze(Qe.Size.Zero()), tt = Object.freeze(Qe.Color3.Black()), it = function() {
                    function e(e, t, i, r) {
                        var n = this;
                        this._events = new Array, this._currentFrame = 0, this._originalValue = new Array, this._offsetsCache = {}, this._highLimitsCache = {}, this._stopped = !1, this._blendingFactor = 0, this._targetPath = "", this._weight = 1, this._ratioOffset = 0, this._previousDelay = 0, this._previousRatio = 0, this._animation = t, this._target = e, this._scene = i, this._host = r, t._runtimeAnimations.push(this);
                        var o = t.getEvents();
                        o && 0 < o.length && o.forEach(function(e) {
                            n._events.push(e._clone())
                        })
                    }
                    return Object.defineProperty(e.prototype, "currentFrame", {
                        get: function() {
                            return this._currentFrame
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "weight", {
                        get: function() {
                            return this._weight
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "currentValue", {
                        get: function() {
                            return this._currentValue
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "targetPath", {
                        get: function() {
                            return this._targetPath
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "target", {
                        get: function() {
                            return this._activeTarget
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "animation", {
                        get: function() {
                            return this._animation
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.reset = function(e) {
                        if (void 0 === e && (e = !1), e)
                            if (this._target instanceof Array)
                                for (var t = 0, i = 0, r = this._target; i < r.length; i++) {
                                    var n = r[i];
                                    void 0 !== this._originalValue[t] && this._setValue(n, this._originalValue[t], -1), t++
                                } else void 0 !== this._originalValue[0] && this._setValue(this._target, this._originalValue[0], -1);
                        for (this._offsetsCache = {}, this._highLimitsCache = {}, this._currentFrame = 0, this._blendingFactor = 0, this._originalValue = new Array, t = 0; t < this._events.length; t++) this._events[t].isDone = !1
                    }, e.prototype.isStopped = function() {
                        return this._stopped
                    }, e.prototype.dispose = function() {
                        var e = this._animation.runtimeAnimations.indexOf(this); - 1 < e && this._animation.runtimeAnimations.splice(e, 1)
                    }, e.prototype._interpolate = function(e, t, i, r, n) {
                        return this._currentFrame = e, this._animation.dataType !== Qe.Animation.ANIMATIONTYPE_MATRIX || this._workValue || (this._workValue = Qe.Matrix.Zero()), this._animation._interpolate(e, t, this._workValue, i, r, n)
                    }, e.prototype.setValue = function(e, t) {
                        if (void 0 === t && (t = 1), this._target instanceof Array)
                            for (var i = 0, r = 0, n = this._target; r < n.length; r++) {
                                var o = n[r];
                                this._setValue(o, e, t, i), i++
                            } else this._setValue(this._target, e, t)
                    }, e.prototype._setValue = function(e, t, i, r) {
                        var n, o;
                        void 0 === r && (r = 0);
                        var s = this._animation.targetPropertyPath;
                        if (1 < s.length) {
                            for (var a = e[s[0]], l = 1; l < s.length - 1; l++) a = a[s[l]];
                            n = s[s.length - 1], o = a
                        } else n = s[0], o = e;
                        if (this._targetPath = n, this._activeTarget = o, this._weight = i, void 0 === this._originalValue[r]) {
                            var u = void 0;
                            (u = o.getRestPose && "_matrix" === n ? o.getRestPose() : o[n]) && u.clone ? this._originalValue[r] = u.clone() : this._originalValue[r] = u
                        }
                        if ((e && e.animationPropertiesOverride ? e.animationPropertiesOverride.enableBlending : this._animation.enableBlending) && this._blendingFactor <= 1) {
                            this._originalBlendValue || ((u = o[n]).clone ? this._originalBlendValue = u.clone() : this._originalBlendValue = u), this._originalBlendValue.m ? Qe.Animation.AllowMatrixDecomposeForInterpolation ? this._currentValue ? Qe.Matrix.DecomposeLerpToRef(this._originalBlendValue, t, this._blendingFactor, this._currentValue) : this._currentValue = Qe.Matrix.DecomposeLerp(this._originalBlendValue, t, this._blendingFactor) : this._currentValue ? Qe.Matrix.LerpToRef(this._originalBlendValue, t, this._blendingFactor, this._currentValue) : this._currentValue = Qe.Matrix.Lerp(this._originalBlendValue, t, this._blendingFactor) : this._currentValue = Qe.Animation._UniversalLerp(this._originalBlendValue, t, this._blendingFactor);
                            var c = e && e.animationPropertiesOverride ? e.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
                            this._blendingFactor += c
                        } else this._currentValue = t; - 1 !== i ? this._scene._registerTargetForLateAnimationBinding(this, this._originalValue[r]) : o[n] = this._currentValue, e.markAsDirty && e.markAsDirty(this._animation.targetProperty)
                    }, e.prototype._getCorrectLoopMode = function() {
                        return this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.loopMode : this._animation.loopMode
                    }, e.prototype.goToFrame = function(e) {
                        var t = this._animation.getKeys();
                        e < t[0].frame ? e = t[0].frame : e > t[t.length - 1].frame && (e = t[t.length - 1].frame);
                        var i = this._interpolate(e, 0, this._getCorrectLoopMode());
                        this.setValue(i, -1)
                    }, e.prototype._prepareForSpeedRatioChange = function(e) {
                        var t = this._previousDelay * (this._animation.framePerSecond * e) / 1e3;
                        this._ratioOffset = this._previousRatio - t
                    }, e.prototype.animate = function(e, t, i, r, n, o) {
                        void 0 === o && (o = -1);
                        var s = this._animation.targetPropertyPath;
                        if (!s || s.length < 1) return !(this._stopped = !0);
                        var a = !0,
                            l = this._animation.getKeys();
                        if (0 !== l[0].frame) {
                            var u = {
                                frame: 0,
                                value: l[0].value
                            };
                            l.splice(0, 0, u)
                        } else 1 === l.length && (u = {
                            frame: .001,
                            value: l[0].value
                        }, l.push(u));
                        (t < l[0].frame || t > l[l.length - 1].frame) && (t = l[0].frame), (i < l[0].frame || i > l[l.length - 1].frame) && (i = l[l.length - 1].frame), t === i && (t > l[0].frame ? t-- : i < l[l.length - 1].frame && i++);
                        var c, h = i - t,
                            d = e * (this._animation.framePerSecond * n) / 1e3 + this._ratioOffset,
                            p = 0;
                        if (this._previousDelay = e, this._previousRatio = d, (t < i && h <= d || i < t && d <= h) && !r) a = !1, p = this._animation._getKeyValue(l[l.length - 1].value);
                        else if (this._getCorrectLoopMode() !== Qe.Animation.ANIMATIONLOOPMODE_CYCLE) {
                            var f = i.toString() + t.toString();
                            if (!this._offsetsCache[f]) {
                                var _ = this._interpolate(t, 0, Qe.Animation.ANIMATIONLOOPMODE_CYCLE),
                                    m = this._interpolate(i, 0, Qe.Animation.ANIMATIONLOOPMODE_CYCLE);
                                switch (this._animation.dataType) {
                                    case Qe.Animation.ANIMATIONTYPE_FLOAT:
                                        this._offsetsCache[f] = m - _;
                                        break;
                                    case Qe.Animation.ANIMATIONTYPE_QUATERNION:
                                        this._offsetsCache[f] = m.subtract(_);
                                        break;
                                    case Qe.Animation.ANIMATIONTYPE_VECTOR3:
                                        this._offsetsCache[f] = m.subtract(_);
                                    case Qe.Animation.ANIMATIONTYPE_VECTOR2:
                                        this._offsetsCache[f] = m.subtract(_);
                                    case Qe.Animation.ANIMATIONTYPE_SIZE:
                                        this._offsetsCache[f] = m.subtract(_);
                                    case Qe.Animation.ANIMATIONTYPE_COLOR3:
                                        this._offsetsCache[f] = m.subtract(_)
                                }
                                this._highLimitsCache[f] = m
                            }
                            p = this._highLimitsCache[f], c = this._offsetsCache[f]
                        }
                        if (void 0 === c) switch (this._animation.dataType) {
                            case Qe.Animation.ANIMATIONTYPE_FLOAT:
                                c = 0;
                                break;
                            case Qe.Animation.ANIMATIONTYPE_QUATERNION:
                                c = Ze;
                                break;
                            case Qe.Animation.ANIMATIONTYPE_VECTOR3:
                                c = Je;
                                break;
                            case Qe.Animation.ANIMATIONTYPE_VECTOR2:
                                c = $e;
                                break;
                            case Qe.Animation.ANIMATIONTYPE_SIZE:
                                c = et;
                                break;
                            case Qe.Animation.ANIMATIONTYPE_COLOR3:
                                c = tt
                        }
                        var g = d / h >> 0,
                            v = a ? t + d % h : i;
                        if (this._host && this._host.syncRoot) {
                            var y = this._host.syncRoot;
                            v = t + (i - t) * ((y.masterFrame - y.fromFrame) / (y.toFrame - y.fromFrame))
                        }
                        var b = this._events;
                        if (0 < h && this.currentFrame > v || h < 0 && this.currentFrame < v)
                            for (var x = 0; x < b.length; x++) b[x].onlyOnce || (b[x].isDone = !1);
                        var T = this._interpolate(v, g, this._getCorrectLoopMode(), c, p);
                        for (this.setValue(T, o), x = 0; x < b.length; x++)
                            if (0 < h && v >= b[x].frame && b[x].frame >= t || h < 0 && v <= b[x].frame && b[x].frame <= t) {
                                var E = b[x];
                                E.isDone || (E.onlyOnce && (b.splice(x, 1), x--), E.isDone = !0, E.action(v))
                            }
                        return a || (this._stopped = !0), a
                    }, e
                }(), Qe.RuntimeAnimation = it, rt = $a || ($a = {}), nt = function() {
                    function e(e, t, i, r, n, o, s, a) {
                        void 0 === i && (i = 0), void 0 === r && (r = 100), void 0 === n && (n = !1), void 0 === o && (o = 1), this.target = t, this.fromFrame = i, this.toFrame = r, this.loopAnimation = n, this.onAnimationEnd = s, this._localDelayOffset = null, this._pausedDelay = null, this._runtimeAnimations = new Array, this._paused = !1, this._speedRatio = 1, this._weight = -1, this.disposeOnEnd = !0, this.animationStarted = !1, this.onAnimationEndObservable = new rt.Observable, this._scene = e, a && this.appendAnimations(t, a), this._speedRatio = o, e._activeAnimatables.push(this)
                    }
                    return Object.defineProperty(e.prototype, "syncRoot", {
                        get: function() {
                            return this._syncRoot
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "masterFrame", {
                        get: function() {
                            return 0 === this._runtimeAnimations.length ? 0 : this._runtimeAnimations[0].currentFrame
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "weight", {
                        get: function() {
                            return this._weight
                        },
                        set: function(e) {
                            this._weight = -1 !== e ? Math.min(Math.max(e, 0), 1) : -1
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "speedRatio", {
                        get: function() {
                            return this._speedRatio
                        },
                        set: function(e) {
                            for (var t = 0; t < this._runtimeAnimations.length; t++) this._runtimeAnimations[t]._prepareForSpeedRatioChange(e);
                            this._speedRatio = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.syncWith = function(e) {
                        if (this._syncRoot = e) {
                            var t = this._scene._activeAnimatables.indexOf(this); - 1 < t && (this._scene._activeAnimatables.splice(t, 1), this._scene._activeAnimatables.push(this))
                        }
                        return this
                    }, e.prototype.getAnimations = function() {
                        return this._runtimeAnimations
                    }, e.prototype.appendAnimations = function(e, t) {
                        for (var i = 0; i < t.length; i++) {
                            var r = t[i];
                            this._runtimeAnimations.push(new rt.RuntimeAnimation(e, r, this._scene, this))
                        }
                    }, e.prototype.getAnimationByTargetProperty = function(e) {
                        for (var t = this._runtimeAnimations, i = 0; i < t.length; i++)
                            if (t[i].animation.targetProperty === e) return t[i].animation;
                        return null
                    }, e.prototype.getRuntimeAnimationByTargetProperty = function(e) {
                        for (var t = this._runtimeAnimations, i = 0; i < t.length; i++)
                            if (t[i].animation.targetProperty === e) return t[i];
                        return null
                    }, e.prototype.reset = function() {
                        for (var e = this._runtimeAnimations, t = 0; t < e.length; t++) e[t].reset(!0);
                        this._localDelayOffset = null, this._pausedDelay = null
                    }, e.prototype.enableBlending = function(e) {
                        for (var t = this._runtimeAnimations, i = 0; i < t.length; i++) t[i].animation.enableBlending = !0, t[i].animation.blendingSpeed = e
                    }, e.prototype.disableBlending = function() {
                        for (var e = this._runtimeAnimations, t = 0; t < e.length; t++) e[t].animation.enableBlending = !1
                    }, e.prototype.goToFrame = function(e) {
                        var t = this._runtimeAnimations;
                        if (t[0]) {
                            var i = t[0].animation.framePerSecond,
                                r = 1e3 * (e - t[0].currentFrame) / (i * this.speedRatio);
                            null === this._localDelayOffset && (this._localDelayOffset = 0), this._localDelayOffset -= r
                        }
                        for (var n = 0; n < t.length; n++) t[n].goToFrame(e)
                    }, e.prototype.pause = function() {
                        this._paused || (this._paused = !0)
                    }, e.prototype.restart = function() {
                        this._paused = !1
                    }, e.prototype._raiseOnAnimationEnd = function() {
                        this.onAnimationEnd && this.onAnimationEnd(), this.onAnimationEndObservable.notifyObservers(this)
                    }, e.prototype.stop = function(e, t) {
                        if (e || t) {
                            var i = this._scene._activeAnimatables.indexOf(this);
                            if (-1 < i) {
                                for (var r = (o = this._runtimeAnimations).length - 1; 0 <= r; r--) {
                                    var n = o[r];
                                    e && n.animation.name != e || t && !t(n.target) || (n.dispose(), o.splice(r, 1))
                                }
                                0 == o.length && (this._scene._activeAnimatables.splice(i, 1), this._raiseOnAnimationEnd())
                            }
                        } else if (-1 < (r = this._scene._activeAnimatables.indexOf(this))) {
                            this._scene._activeAnimatables.splice(r, 1);
                            var o = this._runtimeAnimations;
                            for (r = 0; r < o.length; r++) o[r].dispose();
                            this._raiseOnAnimationEnd()
                        }
                    }, e.prototype.waitAsync = function() {
                        var e = this;
                        return new Promise(function(t, i) {
                            e.onAnimationEndObservable.add(function() {
                                t(e)
                            }, void 0, void 0, e, !0)
                        })
                    }, e.prototype._animate = function(e) {
                        if (this._paused) return this.animationStarted = !1, null === this._pausedDelay && (this._pausedDelay = e), !0;
                        if (null === this._localDelayOffset ? (this._localDelayOffset = e, this._pausedDelay = null) : null !== this._pausedDelay && (this._localDelayOffset += e - this._pausedDelay, this._pausedDelay = null), 0 === this._weight) return !0;
                        var t, i = !1,
                            r = this._runtimeAnimations;
                        for (t = 0; t < r.length; t++) {
                            var n = r[t].animate(e - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this._speedRatio, this._weight);
                            i = i || n
                        }
                        if (!(this.animationStarted = i)) {
                            if (this.disposeOnEnd)
                                for (t = this._scene._activeAnimatables.indexOf(this), this._scene._activeAnimatables.splice(t, 1), t = 0; t < r.length; t++) r[t].dispose();
                            this._raiseOnAnimationEnd(), this.disposeOnEnd && (this.onAnimationEnd = null, this.onAnimationEndObservable.clear())
                        }
                        return i
                    }, e
                }(), rt.Animatable = nt,
                function(e) {
                    var t = function() {
                            function e() {
                                this._easingMode = e.EASINGMODE_EASEIN
                            }
                            return e.prototype.setEasingMode = function(e) {
                                var t = Math.min(Math.max(e, 0), 2);
                                this._easingMode = t
                            }, e.prototype.getEasingMode = function() {
                                return this._easingMode
                            }, e.prototype.easeInCore = function(e) {
                                throw new Error("You must implement this method")
                            }, e.prototype.ease = function(t) {
                                switch (this._easingMode) {
                                    case e.EASINGMODE_EASEIN:
                                        return this.easeInCore(t);
                                    case e.EASINGMODE_EASEOUT:
                                        return 1 - this.easeInCore(1 - t)
                                }
                                return .5 <= t ? .5 * (1 - this.easeInCore(2 * (1 - t))) + .5 : .5 * this.easeInCore(2 * t)
                            }, e.EASINGMODE_EASEIN = 0, e.EASINGMODE_EASEOUT = 1, e.EASINGMODE_EASEINOUT = 2, e
                        }(),
                        i = function(e) {
                            function t() {
                                return null !== e && e.apply(this, arguments) || this
                            }
                            return b(t, e), t.prototype.easeInCore = function(e) {
                                return e = Math.max(0, Math.min(1, e)), 1 - Math.sqrt(1 - e * e)
                            }, t
                        }(e.EasingFunction = t);
                    e.CircleEase = i;
                    var r = function(e) {
                        function t(t) {
                            void 0 === t && (t = 1);
                            var i = e.call(this) || this;
                            return i.amplitude = t, i
                        }
                        return b(t, e), t.prototype.easeInCore = function(e) {
                            var t = Math.max(0, this.amplitude);
                            return Math.pow(e, 3) - e * t * Math.sin(3.141592653589793 * e)
                        }, t
                    }(t);
                    e.BackEase = r;
                    var n = function(e) {
                        function t(t, i) {
                            void 0 === t && (t = 3), void 0 === i && (i = 2);
                            var r = e.call(this) || this;
                            return r.bounces = t, r.bounciness = i, r
                        }
                        return b(t, e), t.prototype.easeInCore = function(e) {
                            var t = Math.max(0, this.bounces),
                                i = this.bounciness;
                            i <= 1 && (i = 1.001);
                            var r = Math.pow(i, t),
                                n = 1 - i,
                                o = (1 - r) / n + .5 * r,
                                s = e * o,
                                a = Math.log(-s * (1 - i) + 1) / Math.log(i),
                                l = Math.floor(a),
                                u = l + 1,
                                c = (1 - Math.pow(i, l)) / (n * o),
                                h = .5 * (c + (1 - Math.pow(i, u)) / (n * o)),
                                d = e - h,
                                p = h - c;
                            return -Math.pow(1 / i, t - l) / (p * p) * (d - p) * (d + p)
                        }, t
                    }(t);
                    e.BounceEase = n;
                    var o = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t.prototype.easeInCore = function(e) {
                            return e * e * e
                        }, t
                    }(t);
                    e.CubicEase = o;
                    var s = function(e) {
                        function t(t, i) {
                            void 0 === t && (t = 3), void 0 === i && (i = 3);
                            var r = e.call(this) || this;
                            return r.oscillations = t, r.springiness = i, r
                        }
                        return b(t, e), t.prototype.easeInCore = function(e) {
                            var t = Math.max(0, this.oscillations),
                                i = Math.max(0, this.springiness);
                            return (0 == i ? e : (Math.exp(i * e) - 1) / (Math.exp(i) - 1)) * Math.sin((6.283185307179586 * t + 1.5707963267948966) * e)
                        }, t
                    }(t);
                    e.ElasticEase = s;
                    var a = function(e) {
                        function t(t) {
                            void 0 === t && (t = 2);
                            var i = e.call(this) || this;
                            return i.exponent = t, i
                        }
                        return b(t, e), t.prototype.easeInCore = function(e) {
                            return this.exponent <= 0 ? e : (Math.exp(this.exponent * e) - 1) / (Math.exp(this.exponent) - 1)
                        }, t
                    }(t);
                    e.ExponentialEase = a;
                    var l = function(e) {
                        function t(t) {
                            void 0 === t && (t = 2);
                            var i = e.call(this) || this;
                            return i.power = t, i
                        }
                        return b(t, e), t.prototype.easeInCore = function(e) {
                            var t = Math.max(0, this.power);
                            return Math.pow(e, t)
                        }, t
                    }(t);
                    e.PowerEase = l;
                    var u = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t.prototype.easeInCore = function(e) {
                            return e * e
                        }, t
                    }(t);
                    e.QuadraticEase = u;
                    var c = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t.prototype.easeInCore = function(e) {
                            return e * e * e * e
                        }, t
                    }(t);
                    e.QuarticEase = c;
                    var h = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t.prototype.easeInCore = function(e) {
                            return e * e * e * e * e
                        }, t
                    }(t);
                    e.QuinticEase = h;
                    var d = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t.prototype.easeInCore = function(e) {
                            return 1 - Math.sin(1.5707963267948966 * (1 - e))
                        }, t
                    }(t);
                    e.SineEase = d;
                    var p = function(t) {
                        function i(e, i, r, n) {
                            void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === r && (r = 1), void 0 === n && (n = 1);
                            var o = t.call(this) || this;
                            return o.x1 = e, o.y1 = i, o.x2 = r, o.y2 = n, o
                        }
                        return b(i, t), i.prototype.easeInCore = function(t) {
                            return e.BezierCurve.Interpolate(t, this.x1, this.y1, this.x2, this.y2)
                        }, i
                    }(t);
                    e.BezierCurveEase = p
                }($a || ($a = {})),
                function(e) {
                    var t = function() {
                            function e(e) {
                                this._actionManager = e
                            }
                            return e.prototype.isValid = function() {
                                return !0
                            }, e.prototype._getProperty = function(e) {
                                return this._actionManager._getProperty(e)
                            }, e.prototype._getEffectiveTarget = function(e, t) {
                                return this._actionManager._getEffectiveTarget(e, t)
                            }, e.prototype.serialize = function() {}, e.prototype._serialize = function(e) {
                                return {
                                    type: 2,
                                    children: [],
                                    name: e.name,
                                    properties: e.properties
                                }
                            }, e
                        }(),
                        i = function(t) {
                            function i(e, r, n, o, s) {
                                void 0 === s && (s = i.IsEqual);
                                var a = t.call(this, e) || this;
                                return a.propertyPath = n, a.value = o, a.operator = s, a._target = r, a._effectiveTarget = a._getEffectiveTarget(r, a.propertyPath), a._property = a._getProperty(a.propertyPath), a
                            }
                            return b(i, t), Object.defineProperty(i, "IsEqual", {
                                get: function() {
                                    return i._IsEqual
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(i, "IsDifferent", {
                                get: function() {
                                    return i._IsDifferent
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(i, "IsGreater", {
                                get: function() {
                                    return i._IsGreater
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(i, "IsLesser", {
                                get: function() {
                                    return i._IsLesser
                                },
                                enumerable: !0,
                                configurable: !0
                            }), i.prototype.isValid = function() {
                                switch (this.operator) {
                                    case i.IsGreater:
                                        return this._effectiveTarget[this._property] > this.value;
                                    case i.IsLesser:
                                        return this._effectiveTarget[this._property] < this.value;
                                    case i.IsEqual:
                                    case i.IsDifferent:
                                        var e;
                                        return e = this.value.equals ? this.value.equals(this._effectiveTarget[this._property]) : this.value === this._effectiveTarget[this._property], this.operator === i.IsEqual ? e : !e
                                }
                                return !1
                            }, i.prototype.serialize = function() {
                                return this._serialize({
                                    name: "ValueCondition",
                                    properties: [e.Action._GetTargetProperty(this._target), {
                                        name: "propertyPath",
                                        value: this.propertyPath
                                    }, {
                                        name: "value",
                                        value: e.Action._SerializeValueAsString(this.value)
                                    }, {
                                        name: "operator",
                                        value: i.GetOperatorName(this.operator)
                                    }]
                                })
                            }, i.GetOperatorName = function(e) {
                                switch (e) {
                                    case i._IsEqual:
                                        return "IsEqual";
                                    case i._IsDifferent:
                                        return "IsDifferent";
                                    case i._IsGreater:
                                        return "IsGreater";
                                    case i._IsLesser:
                                        return "IsLesser";
                                    default:
                                        return ""
                                }
                            }, i._IsEqual = 0, i._IsDifferent = 1, i._IsGreater = 2, i._IsLesser = 3, i
                        }(e.Condition = t);
                    e.ValueCondition = i;
                    var r = function(e) {
                        function t(t, i) {
                            var r = e.call(this, t) || this;
                            return r.predicate = i, r
                        }
                        return b(t, e), t.prototype.isValid = function() {
                            return this.predicate()
                        }, t
                    }(t);
                    e.PredicateCondition = r;
                    var n = function(t) {
                        function i(e, i, r) {
                            var n = t.call(this, e) || this;
                            return n.value = r, n._target = i, n
                        }
                        return b(i, t), i.prototype.isValid = function() {
                            return this._target.state === this.value
                        }, i.prototype.serialize = function() {
                            return this._serialize({
                                name: "StateCondition",
                                properties: [e.Action._GetTargetProperty(this._target), {
                                    name: "value",
                                    value: this.value
                                }]
                            })
                        }, i
                    }(t);
                    e.StateCondition = n
                }($a || ($a = {})), ot = $a || ($a = {}), st = function() {
                    function e(e, t) {
                        this.triggerOptions = e, this.onBeforeExecuteObservable = new ot.Observable, e.parameter ? (this.trigger = e.trigger, this._triggerParameter = e.parameter) : e.trigger ? this.trigger = e.trigger : this.trigger = e, (this._nextActiveAction = this)._condition = t
                    }
                    return e.prototype._prepare = function() {}, e.prototype.getTriggerParameter = function() {
                        return this._triggerParameter
                    }, e.prototype._executeCurrent = function(e) {
                        if (this._nextActiveAction._condition) {
                            var t = this._nextActiveAction._condition,
                                i = this._actionManager.getScene().getRenderId();
                            if (t._evaluationId === i) {
                                if (!t._currentResult) return
                            } else {
                                if (t._evaluationId = i, !t.isValid()) return void(t._currentResult = !1);
                                t._currentResult = !0
                            }
                        }
                        this.onBeforeExecuteObservable.notifyObservers(this), this._nextActiveAction.execute(e), this.skipToNextActiveAction()
                    }, e.prototype.execute = function(e) {}, e.prototype.skipToNextActiveAction = function() {
                        this._nextActiveAction._child ? (this._nextActiveAction._child._actionManager || (this._nextActiveAction._child._actionManager = this._actionManager), this._nextActiveAction = this._nextActiveAction._child) : this._nextActiveAction = this
                    }, e.prototype.then = function(e) {
                        return (this._child = e)._actionManager = this._actionManager, e._prepare(), e
                    }, e.prototype._getProperty = function(e) {
                        return this._actionManager._getProperty(e)
                    }, e.prototype._getEffectiveTarget = function(e, t) {
                        return this._actionManager._getEffectiveTarget(e, t)
                    }, e.prototype.serialize = function(e) {}, e.prototype._serialize = function(e, t) {
                        var i = {
                            type: 1,
                            children: [],
                            name: e.name,
                            properties: e.properties || []
                        };
                        if (this._child && this._child.serialize(i), this._condition) {
                            var r = this._condition.serialize();
                            return r.children.push(i), t && t.children.push(r), r
                        }
                        return t && t.children.push(i), i
                    }, e._SerializeValueAsString = function(e) {
                        return "number" == typeof e ? e.toString() : "boolean" == typeof e ? e ? "true" : "false" : e instanceof ot.Vector2 ? e.x + ", " + e.y : e instanceof ot.Vector3 ? e.x + ", " + e.y + ", " + e.z : e instanceof ot.Color3 ? e.r + ", " + e.g + ", " + e.b : e instanceof ot.Color4 ? e.r + ", " + e.g + ", " + e.b + ", " + e.a : e
                    }, e._GetTargetProperty = function(e) {
                        return {
                            name: "target",
                            targetType: e instanceof ot.Mesh ? "MeshProperties" : e instanceof ot.Light ? "LightProperties" : e instanceof ot.Camera ? "CameraProperties" : "SceneProperties",
                            value: e instanceof ot.Scene ? "Scene" : e.name
                        }
                    }, e
                }(), ot.Action = st,
                function(e) {
                    var t = function() {
                        function e(e, t, i, r, n, o) {
                            this.source = e, this.pointerX = t, this.pointerY = i, this.meshUnderPointer = r, this.sourceEvent = n, this.additionalData = o
                        }
                        return e.CreateNew = function(t, i, r) {
                            var n = t.getScene();
                            return new e(t, n.pointerX, n.pointerY, n.meshUnderPointer, i, r)
                        }, e.CreateNewFromSprite = function(t, i, r, n) {
                            return new e(t, i.pointerX, i.pointerY, i.meshUnderPointer, r, n)
                        }, e.CreateNewFromScene = function(t, i) {
                            return new e(null, t.pointerX, t.pointerY, t.meshUnderPointer, i)
                        }, e.CreateNewFromPrimitive = function(t, i, r, n) {
                            return new e(t, i.x, i.y, null, r, n)
                        }, e
                    }();
                    e.ActionEvent = t;
                    var i = function() {
                        function t(t) {
                            this.actions = new Array, this.hoverCursor = "", this._scene = t || e.Engine.LastCreatedScene, t.actionManagers.push(this)
                        }
                        return t.prototype.dispose = function() {
                            for (var e = this._scene.actionManagers.indexOf(this), i = 0; i < this.actions.length; i++) {
                                var r = this.actions[i];
                                0 === --t.Triggers[r.trigger] && delete t.Triggers[r.trigger]
                            } - 1 < e && this._scene.actionManagers.splice(e, 1)
                        }, t.prototype.getScene = function() {
                            return this._scene
                        }, t.prototype.hasSpecificTriggers = function(e) {
                            for (var t = 0; t < this.actions.length; t++) {
                                var i = this.actions[t];
                                if (-1 < e.indexOf(i.trigger)) return !0
                            }
                            return !1
                        }, t.prototype.hasSpecificTriggers2 = function(e, t) {
                            for (var i = 0; i < this.actions.length; i++) {
                                var r = this.actions[i];
                                if (e == r.trigger || t == r.trigger) return !0
                            }
                            return !1
                        }, t.prototype.hasSpecificTrigger = function(e, t) {
                            for (var i = 0; i < this.actions.length; i++) {
                                var r = this.actions[i];
                                if (r.trigger === e) {
                                    if (!t) return !0;
                                    if (t(r.getTriggerParameter())) return !0
                                }
                            }
                            return !1
                        }, Object.defineProperty(t.prototype, "hasPointerTriggers", {
                            get: function() {
                                for (var e = 0; e < this.actions.length; e++) {
                                    var i = this.actions[e];
                                    if (i.trigger >= t.OnPickTrigger && i.trigger <= t.OnPointerOutTrigger) return !0
                                }
                                return !1
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "hasPickTriggers", {
                            get: function() {
                                for (var e = 0; e < this.actions.length; e++) {
                                    var i = this.actions[e];
                                    if (i.trigger >= t.OnPickTrigger && i.trigger <= t.OnPickUpTrigger) return !0
                                }
                                return !1
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "HasTriggers", {
                            get: function() {
                                for (var e in t.Triggers)
                                    if (t.Triggers.hasOwnProperty(e)) return !0;
                                return !1
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "HasPickTriggers", {
                            get: function() {
                                for (var e in t.Triggers)
                                    if (t.Triggers.hasOwnProperty(e)) {
                                        var i = parseInt(e);
                                        if (t.OnPickTrigger <= i && i <= t.OnPickUpTrigger) return !0
                                    }
                                return !1
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.HasSpecificTrigger = function(e) {
                            for (var i in t.Triggers)
                                if (t.Triggers.hasOwnProperty(i) && parseInt(i) === e) return !0;
                            return !1
                        }, t.prototype.registerAction = function(i) {
                            return i.trigger === t.OnEveryFrameTrigger && this.getScene().actionManager !== this ? (e.Tools.Warn("OnEveryFrameTrigger can only be used with scene.actionManager"), null) : (this.actions.push(i), t.Triggers[i.trigger] ? t.Triggers[i.trigger]++ : t.Triggers[i.trigger] = 1, i._actionManager = this, i._prepare(), i)
                        }, t.prototype.unregisterAction = function(e) {
                            var i = this.actions.indexOf(e);
                            return -1 !== i && (this.actions.splice(i, 1), t.Triggers[e.trigger] -= 1, 0 === t.Triggers[e.trigger] && delete t.Triggers[e.trigger], delete e._actionManager, !0)
                        }, t.prototype.processTrigger = function(e, i) {
                            for (var r = 0; r < this.actions.length; r++) {
                                var n = this.actions[r];
                                if (n.trigger === e) {
                                    if (i && (e === t.OnKeyUpTrigger || e === t.OnKeyDownTrigger)) {
                                        var o = n.getTriggerParameter();
                                        if (o && o !== i.sourceEvent.keyCode) {
                                            if (!o.toLowerCase) continue;
                                            var s = o.toLowerCase();
                                            if (s !== i.sourceEvent.key) {
                                                var a = i.sourceEvent.charCode ? i.sourceEvent.charCode : i.sourceEvent.keyCode;
                                                if (String.fromCharCode(a).toLowerCase() !== s) continue
                                            }
                                        }
                                    }
                                    n._executeCurrent(i)
                                }
                            }
                        }, t.prototype._getEffectiveTarget = function(e, t) {
                            for (var i = t.split("."), r = 0; r < i.length - 1; r++) e = e[i[r]];
                            return e
                        }, t.prototype._getProperty = function(e) {
                            var t = e.split(".");
                            return t[t.length - 1]
                        }, t.prototype.serialize = function(i) {
                            for (var r = {
                                    children: new Array,
                                    name: i,
                                    type: 3,
                                    properties: new Array
                                }, n = 0; n < this.actions.length; n++) {
                                var o = {
                                        type: 0,
                                        children: new Array,
                                        name: t.GetTriggerName(this.actions[n].trigger),
                                        properties: new Array
                                    },
                                    s = this.actions[n].triggerOptions;
                                if (s && "number" != typeof s)
                                    if (s.parameter instanceof e.Node) o.properties.push(e.Action._GetTargetProperty(s.parameter));
                                    else {
                                        var a = {};
                                        e.Tools.DeepCopy(s.parameter, a, ["mesh"]), s.parameter && s.parameter.mesh && (a._meshId = s.parameter.mesh.id), o.properties.push({
                                            name: "parameter",
                                            targetType: null,
                                            value: a
                                        })
                                    }
                                this.actions[n].serialize(o), r.children.push(o)
                            }
                            return r
                        }, t.Parse = function(i, r, n) {
                            var o = new t(n);
                            null === r ? n.actionManager = o : r.actionManager = o;
                            for (var s = function(t, i, r, n) {
                                    if (null === n) {
                                        var o = parseFloat(i);
                                        return "true" === i || "false" === i ? "true" === i : isNaN(o) ? i : o
                                    }
                                    for (var s = n.split("."), a = i.split(","), l = 0; l < s.length; l++) r = r[s[l]];
                                    if ("boolean" == typeof r) return "true" === a[0];
                                    if ("string" == typeof r) return a[0];
                                    var u = new Array;
                                    for (l = 0; l < a.length; l++) u.push(parseFloat(a[l]));
                                    return r instanceof e.Vector3 ? e.Vector3.FromArray(u) : r instanceof e.Vector4 ? e.Vector4.FromArray(u) : r instanceof e.Color3 ? e.Color3.FromArray(u) : r instanceof e.Color4 ? e.Color4.FromArray(u) : parseFloat(a[0])
                                }, a = function(i, r, l, u, c) {
                                    if (void 0 === c && (c = null), !i.detached) {
                                        var h = new Array,
                                            d = null,
                                            p = null,
                                            f = i.combine && 0 < i.combine.length;
                                        if (2 === i.type ? h.push(o) : h.push(r), f) {
                                            for (var _ = new Array, m = 0; m < i.combine.length; m++) a(i.combine[m], t.NothingTrigger, l, u, _);
                                            h.push(_)
                                        } else
                                            for (var g = 0; g < i.properties.length; g++) {
                                                var v = i.properties[g].value,
                                                    y = i.properties[g].name,
                                                    b = i.properties[g].targetType;
                                                "target" === y ? v = d = null !== b && "SceneProperties" === b ? n : n.getNodeByName(v) : "parent" === y ? v = n.getNodeByName(v) : "sound" === y ? n.getSoundByName && (v = n.getSoundByName(v)) : "propertyPath" !== y ? v = 2 === i.type && "operator" === y ? e.ValueCondition[v] : s(0, v, d, "value" === y ? p : null) : p = v, h.push(v)
                                            }
                                        if (null === c ? h.push(l) : h.push(null), "InterpolateValueAction" === i.name) {
                                            var x = h[h.length - 2];
                                            h[h.length - 1] = x, h[h.length - 2] = l
                                        }
                                        var T, E, S, P = (T = i.name, E = h, (S = Object.create(e.Tools.Instantiate("BABYLON." + T).prototype)).constructor.apply(S, E), S);
                                        if (P instanceof e.Condition && null !== l) {
                                            var A = new e.DoNothingAction(r, l);
                                            u ? u.then(A) : o.registerAction(A), u = A
                                        }
                                        for (null === c ? P instanceof e.Condition ? (l = P, P = u) : (l = null, u ? u.then(P) : o.registerAction(P)) : c.push(P), g = 0; g < i.children.length; g++) a(i.children[g], r, l, P, null)
                                    }
                                }, l = 0; l < i.children.length; l++) {
                                var u, c = i.children[l];
                                if (0 < c.properties.length) {
                                    var h = c.properties[0].value,
                                        d = null === c.properties[0].targetType ? h : n.getMeshByName(h);
                                    d._meshId && (d.mesh = n.getMeshByID(d._meshId)), u = {
                                        trigger: t[c.name],
                                        parameter: d
                                    }
                                } else u = t[c.name];
                                for (var p = 0; p < c.children.length; p++) c.detached || a(c.children[p], u, null, null)
                            }
                        }, t.GetTriggerName = function(e) {
                            switch (e) {
                                case 0:
                                    return "NothingTrigger";
                                case 1:
                                    return "OnPickTrigger";
                                case 2:
                                    return "OnLeftPickTrigger";
                                case 3:
                                    return "OnRightPickTrigger";
                                case 4:
                                    return "OnCenterPickTrigger";
                                case 5:
                                    return "OnPickDownTrigger";
                                case 6:
                                    return "OnPickUpTrigger";
                                case 7:
                                    return "OnLongPressTrigger";
                                case 8:
                                    return "OnPointerOverTrigger";
                                case 9:
                                    return "OnPointerOutTrigger";
                                case 10:
                                    return "OnEveryFrameTrigger";
                                case 11:
                                    return "OnIntersectionEnterTrigger";
                                case 12:
                                    return "OnIntersectionExitTrigger";
                                case 13:
                                    return "OnKeyDownTrigger";
                                case 14:
                                    return "OnKeyUpTrigger";
                                case 15:
                                    return "OnPickOutTrigger";
                                default:
                                    return ""
                            }
                        }, t.NothingTrigger = 0, t.OnPickTrigger = 1, t.OnLeftPickTrigger = 2, t.OnRightPickTrigger = 3, t.OnCenterPickTrigger = 4, t.OnPickDownTrigger = 5, t.OnDoublePickTrigger = 6, t.OnPickUpTrigger = 7, t.OnPickOutTrigger = 16, t.OnLongPressTrigger = 8, t.OnPointerOverTrigger = 9, t.OnPointerOutTrigger = 10, t.OnEveryFrameTrigger = 11, t.OnIntersectionEnterTrigger = 12, t.OnIntersectionExitTrigger = 13, t.OnKeyDownTrigger = 14, t.OnKeyUpTrigger = 15, t.Triggers = {}, t
                    }();
                    e.ActionManager = i
                }($a || ($a = {})), at = $a || ($a = {}), lt = function(e) {
                    function t(t, i, r, n, o, s, a, l) {
                        void 0 === o && (o = 1e3);
                        var u = e.call(this, t, s) || this;
                        return u.duration = 1e3, u.onInterpolationDoneObservable = new at.Observable, u.propertyPath = r, u.value = n, u.duration = o, u.stopOtherAnimations = a, u.onInterpolationDone = l, u._target = u._effectiveTarget = i, u
                    }
                    return b(t, e), t.prototype._prepare = function() {
                        this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath)
                    }, t.prototype.execute = function() {
                        var e, t = this,
                            i = this._actionManager.getScene(),
                            r = [{
                                frame: 0,
                                value: this._effectiveTarget[this._property]
                            }, {
                                frame: 100,
                                value: this.value
                            }];
                        if ("number" == typeof this.value) e = at.Animation.ANIMATIONTYPE_FLOAT;
                        else if (this.value instanceof at.Color3) e = at.Animation.ANIMATIONTYPE_COLOR3;
                        else if (this.value instanceof at.Vector3) e = at.Animation.ANIMATIONTYPE_VECTOR3;
                        else if (this.value instanceof at.Matrix) e = at.Animation.ANIMATIONTYPE_MATRIX;
                        else {
                            if (!(this.value instanceof at.Quaternion)) return void at.Tools.Warn("InterpolateValueAction: Unsupported type (" + typeof this.value + ")");
                            e = at.Animation.ANIMATIONTYPE_QUATERNION
                        }
                        var n = new at.Animation("InterpolateValueAction", this._property, 1e3 / this.duration * 100, e, at.Animation.ANIMATIONLOOPMODE_CONSTANT);
                        n.setKeys(r), this.stopOtherAnimations && i.stopAnimation(this._effectiveTarget), i.beginDirectAnimation(this._effectiveTarget, [n], 0, 100, !1, 1, function() {
                            t.onInterpolationDoneObservable.notifyObservers(t), t.onInterpolationDone && t.onInterpolationDone()
                        })
                    }, t.prototype.serialize = function(t) {
                        return e.prototype._serialize.call(this, {
                            name: "InterpolateValueAction",
                            properties: [at.Action._GetTargetProperty(this._target), {
                                name: "propertyPath",
                                value: this.propertyPath
                            }, {
                                name: "value",
                                value: at.Action._SerializeValueAsString(this.value)
                            }, {
                                name: "duration",
                                value: at.Action._SerializeValueAsString(this.duration)
                            }, {
                                name: "stopOtherAnimations",
                                value: at.Action._SerializeValueAsString(this.stopOtherAnimations) || !1
                            }]
                        }, t)
                    }, t
                }(at.Action), at.InterpolateValueAction = lt,
                function(e) {
                    var t = function(t) {
                        function i(e, i, r, n) {
                            var o = t.call(this, e, n) || this;
                            return o.propertyPath = r, o._target = o._effectiveTarget = i, o
                        }
                        return b(i, t), i.prototype._prepare = function() {
                            this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath)
                        }, i.prototype.execute = function() {
                            this._effectiveTarget[this._property] = !this._effectiveTarget[this._property]
                        }, i.prototype.serialize = function(i) {
                            return t.prototype._serialize.call(this, {
                                name: "SwitchBooleanAction",
                                properties: [e.Action._GetTargetProperty(this._target), {
                                    name: "propertyPath",
                                    value: this.propertyPath
                                }]
                            }, i)
                        }, i
                    }(e.Action);
                    e.SwitchBooleanAction = t;
                    var i = function(t) {
                        function i(e, i, r, n) {
                            var o = t.call(this, e, n) || this;
                            return o.value = r, o._target = i, o
                        }
                        return b(i, t), i.prototype.execute = function() {
                            this._target.state = this.value
                        }, i.prototype.serialize = function(i) {
                            return t.prototype._serialize.call(this, {
                                name: "SetStateAction",
                                properties: [e.Action._GetTargetProperty(this._target), {
                                    name: "value",
                                    value: this.value
                                }]
                            }, i)
                        }, i
                    }(e.Action);
                    e.SetStateAction = i;
                    var r = function(t) {
                        function i(e, i, r, n, o) {
                            var s = t.call(this, e, o) || this;
                            return s.propertyPath = r, s.value = n, s._target = s._effectiveTarget = i, s
                        }
                        return b(i, t), i.prototype._prepare = function() {
                            this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath)
                        }, i.prototype.execute = function() {
                            this._effectiveTarget[this._property] = this.value, this._target.markAsDirty && this._target.markAsDirty(this._property)
                        }, i.prototype.serialize = function(i) {
                            return t.prototype._serialize.call(this, {
                                name: "SetValueAction",
                                properties: [e.Action._GetTargetProperty(this._target), {
                                    name: "propertyPath",
                                    value: this.propertyPath
                                }, {
                                    name: "value",
                                    value: e.Action._SerializeValueAsString(this.value)
                                }]
                            }, i)
                        }, i
                    }(e.Action);
                    e.SetValueAction = r;
                    var n = function(t) {
                        function i(e, i, r, n, o) {
                            var s = t.call(this, e, o) || this;
                            return s.propertyPath = r, s.value = n, s._target = s._effectiveTarget = i, s
                        }
                        return b(i, t), i.prototype._prepare = function() {
                            this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath), "number" != typeof this._effectiveTarget[this._property] && e.Tools.Warn("Warning: IncrementValueAction can only be used with number values")
                        }, i.prototype.execute = function() {
                            this._effectiveTarget[this._property] += this.value, this._target.markAsDirty && this._target.markAsDirty(this._property)
                        }, i.prototype.serialize = function(i) {
                            return t.prototype._serialize.call(this, {
                                name: "IncrementValueAction",
                                properties: [e.Action._GetTargetProperty(this._target), {
                                    name: "propertyPath",
                                    value: this.propertyPath
                                }, {
                                    name: "value",
                                    value: e.Action._SerializeValueAsString(this.value)
                                }]
                            }, i)
                        }, i
                    }(e.Action);
                    e.IncrementValueAction = n;
                    var o = function(t) {
                        function i(e, i, r, n, o, s) {
                            var a = t.call(this, e, s) || this;
                            return a.from = r, a.to = n, a.loop = o, a._target = i, a
                        }
                        return b(i, t), i.prototype._prepare = function() {}, i.prototype.execute = function() {
                            this._actionManager.getScene().beginAnimation(this._target, this.from, this.to, this.loop)
                        }, i.prototype.serialize = function(i) {
                            return t.prototype._serialize.call(this, {
                                name: "PlayAnimationAction",
                                properties: [e.Action._GetTargetProperty(this._target), {
                                    name: "from",
                                    value: String(this.from)
                                }, {
                                    name: "to",
                                    value: String(this.to)
                                }, {
                                    name: "loop",
                                    value: e.Action._SerializeValueAsString(this.loop) || !1
                                }]
                            }, i)
                        }, i
                    }(e.Action);
                    e.PlayAnimationAction = o;
                    var s = function(t) {
                        function i(e, i, r) {
                            var n = t.call(this, e, r) || this;
                            return n._target = i, n
                        }
                        return b(i, t), i.prototype._prepare = function() {}, i.prototype.execute = function() {
                            this._actionManager.getScene().stopAnimation(this._target)
                        }, i.prototype.serialize = function(i) {
                            return t.prototype._serialize.call(this, {
                                name: "StopAnimationAction",
                                properties: [e.Action._GetTargetProperty(this._target)]
                            }, i)
                        }, i
                    }(e.Action);
                    e.StopAnimationAction = s;
                    var a = function(t) {
                        function i(i, r) {
                            return void 0 === i && (i = e.ActionManager.NothingTrigger), t.call(this, i, r) || this
                        }
                        return b(i, t), i.prototype.execute = function() {}, i.prototype.serialize = function(e) {
                            return t.prototype._serialize.call(this, {
                                name: "DoNothingAction",
                                properties: []
                            }, e)
                        }, i
                    }(e.Action);
                    e.DoNothingAction = a;
                    var l = function(e) {
                        function t(t, i, r) {
                            var n = e.call(this, t, r) || this;
                            return n.children = i, n
                        }
                        return b(t, e), t.prototype._prepare = function() {
                            for (var e = 0; e < this.children.length; e++) this.children[e]._actionManager = this._actionManager, this.children[e]._prepare()
                        }, t.prototype.execute = function(e) {
                            for (var t = 0; t < this.children.length; t++) this.children[t].execute(e)
                        }, t.prototype.serialize = function(t) {
                            for (var i = e.prototype._serialize.call(this, {
                                    name: "CombineAction",
                                    properties: [],
                                    combine: []
                                }, t), r = 0; r < this.children.length; r++) i.combine.push(this.children[r].serialize(null));
                            return i
                        }, t
                    }(e.Action);
                    e.CombineAction = l;
                    var u = function(e) {
                        function t(t, i, r) {
                            var n = e.call(this, t, r) || this;
                            return n.func = i, n
                        }
                        return b(t, e), t.prototype.execute = function(e) {
                            this.func(e)
                        }, t
                    }(e.Action);
                    e.ExecuteCodeAction = u;
                    var c = function(t) {
                        function i(e, i, r, n) {
                            var o = t.call(this, e, n) || this;
                            return o._target = i, o._parent = r, o
                        }
                        return b(i, t), i.prototype._prepare = function() {}, i.prototype.execute = function() {
                            if (this._target.parent !== this._parent) {
                                var t = this._parent.getWorldMatrix().clone();
                                t.invert(), this._target.position = e.Vector3.TransformCoordinates(this._target.position, t), this._target.parent = this._parent
                            }
                        }, i.prototype.serialize = function(i) {
                            return t.prototype._serialize.call(this, {
                                name: "SetParentAction",
                                properties: [e.Action._GetTargetProperty(this._target), e.Action._GetTargetProperty(this._parent)]
                            }, i)
                        }, i
                    }(e.Action);
                    e.SetParentAction = c
                }($a || ($a = {})), ut = $a || ($a = {}), ct = function() {
                    function e(e, t, i, r, n, o, s) {
                        if (void 0 === o && (o = .01), void 0 === s && (s = ut.Texture.TRILINEAR_SAMPLINGMODE), this.name = e, this.sprites = new Array, this.renderingGroupId = 0, this.layerMask = 268435455, this.fogEnabled = !0, this.isPickable = !1, this.onDisposeObservable = new ut.Observable, this._vertexBuffers = {}, n._getComponent(ut.SceneComponentConstants.NAME_SPRITE) || n._addComponent(new ut.SpriteSceneComponent(n)), this._capacity = i, this._spriteTexture = new ut.Texture(t, n, !0, !1, s), this._spriteTexture.wrapU = ut.Texture.CLAMP_ADDRESSMODE, this._spriteTexture.wrapV = ut.Texture.CLAMP_ADDRESSMODE, r.width && r.height) this.cellWidth = r.width, this.cellHeight = r.height;
                        else {
                            if (void 0 === r) return;
                            this.cellWidth = r, this.cellHeight = r
                        }
                        this._epsilon = o, this._scene = n, this._scene.spriteManagers.push(this);
                        for (var a = [], l = 0, u = 0; u < i; u++) a.push(l), a.push(l + 1), a.push(l + 2), a.push(l), a.push(l + 2), a.push(l + 3), l += 4;
                        this._indexBuffer = n.getEngine().createIndexBuffer(a), this._vertexData = new Float32Array(16 * i * 4), this._buffer = new ut.Buffer(n.getEngine(), this._vertexData, !0, 16);
                        var c = this._buffer.createVertexBuffer(ut.VertexBuffer.PositionKind, 0, 4),
                            h = this._buffer.createVertexBuffer("options", 4, 4),
                            d = this._buffer.createVertexBuffer("cellInfo", 8, 4),
                            p = this._buffer.createVertexBuffer(ut.VertexBuffer.ColorKind, 12, 4);
                        this._vertexBuffers[ut.VertexBuffer.PositionKind] = c, this._vertexBuffers.options = h, this._vertexBuffers.cellInfo = d, this._vertexBuffers[ut.VertexBuffer.ColorKind] = p, this._effectBase = this._scene.getEngine().createEffect("sprites", [ut.VertexBuffer.PositionKind, "options", "cellInfo", ut.VertexBuffer.ColorKind], ["view", "projection", "textureInfos", "alphaTest"], ["diffuseSampler"], ""), this._effectFog = this._scene.getEngine().createEffect("sprites", [ut.VertexBuffer.PositionKind, "options", "cellInfo", ut.VertexBuffer.ColorKind], ["view", "projection", "textureInfos", "alphaTest", "vFogInfos", "vFogColor"], ["diffuseSampler"], "#define FOG")
                    }
                    return Object.defineProperty(e.prototype, "onDispose", {
                        set: function(e) {
                            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "texture", {
                        get: function() {
                            return this._spriteTexture
                        },
                        set: function(e) {
                            this._spriteTexture = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._appendSpriteVertex = function(e, t, i, r, n) {
                        var o = 16 * e;
                        0 === i ? i = this._epsilon : 1 === i && (i = 1 - this._epsilon), 0 === r ? r = this._epsilon : 1 === r && (r = 1 - this._epsilon), this._vertexData[o] = t.position.x, this._vertexData[o + 1] = t.position.y, this._vertexData[o + 2] = t.position.z, this._vertexData[o + 3] = t.angle, this._vertexData[o + 4] = t.width, this._vertexData[o + 5] = t.height, this._vertexData[o + 6] = i, this._vertexData[o + 7] = r, this._vertexData[o + 8] = t.invertU ? 1 : 0, this._vertexData[o + 9] = t.invertV ? 1 : 0;
                        var s = t.cellIndex / n >> 0;
                        this._vertexData[o + 10] = t.cellIndex - s * n, this._vertexData[o + 11] = s, this._vertexData[o + 12] = t.color.r, this._vertexData[o + 13] = t.color.g, this._vertexData[o + 14] = t.color.b, this._vertexData[o + 15] = t.color.a
                    }, e.prototype.intersects = function(e, t, i, r) {
                        for (var n = Math.min(this._capacity, this.sprites.length), o = ut.Vector3.Zero(), s = ut.Vector3.Zero(), a = Number.MAX_VALUE, l = null, u = ut.Vector3.Zero(), c = t.getViewMatrix(), h = 0; h < n; h++) {
                            var d = this.sprites[h];
                            if (d) {
                                if (i) {
                                    if (!i(d)) continue
                                } else if (!d.isPickable) continue;
                                if (ut.Vector3.TransformCoordinatesToRef(d.position, c, u), o.copyFromFloats(u.x - d.width / 2, u.y - d.height / 2, u.z), s.copyFromFloats(u.x + d.width / 2, u.y + d.height / 2, u.z),
                                    e.intersectsBoxMinMax(o, s)) {
                                    var p = ut.Vector3.Distance(u, e.origin);
                                    if (p < a && (a = p, l = d, r)) break
                                }
                            }
                        }
                        if (l) {
                            var f = new ut.PickingInfo;
                            return f.hit = !0, f.pickedSprite = l, f.distance = a, f
                        }
                        return null
                    }, e.prototype.render = function() {
                        if (this._effectBase.isReady() && this._effectFog.isReady() && this._spriteTexture && this._spriteTexture.isReady()) {
                            for (var e = this._scene.getEngine(), t = this._spriteTexture.getBaseSize(), i = e.getDeltaTime(), r = Math.min(this._capacity, this.sprites.length), n = t.width / this.cellWidth, o = 0, s = 0; s < r; s++) {
                                var a = this.sprites[s];
                                a && a.isVisible && (a._animate(i), this._appendSpriteVertex(o++, a, 0, 0, n), this._appendSpriteVertex(o++, a, 1, 0, n), this._appendSpriteVertex(o++, a, 1, 1, n), this._appendSpriteVertex(o++, a, 0, 1, n))
                            }
                            this._buffer.update(this._vertexData);
                            var l = this._effectBase;
                            this._scene.fogEnabled && this._scene.fogMode !== ut.Scene.FOGMODE_NONE && this.fogEnabled && (l = this._effectFog), e.enableEffect(l);
                            var u = this._scene.getViewMatrix();
                            l.setTexture("diffuseSampler", this._spriteTexture), l.setMatrix("view", u), l.setMatrix("projection", this._scene.getProjectionMatrix()), l.setFloat2("textureInfos", this.cellWidth / t.width, this.cellHeight / t.height), this._scene.fogEnabled && this._scene.fogMode !== ut.Scene.FOGMODE_NONE && this.fogEnabled && (l.setFloat4("vFogInfos", this._scene.fogMode, this._scene.fogStart, this._scene.fogEnd, this._scene.fogDensity), l.setColor3("vFogColor", this._scene.fogColor)), e.bindBuffers(this._vertexBuffers, this._indexBuffer, l), e.setDepthFunctionToLessOrEqual(), l.setBool("alphaTest", !0), e.setColorWrite(!1), e.drawElementsType(ut.Material.TriangleFillMode, 0, o / 4 * 6), e.setColorWrite(!0), l.setBool("alphaTest", !1), e.setAlphaMode(ut.Engine.ALPHA_COMBINE), e.drawElementsType(ut.Material.TriangleFillMode, 0, o / 4 * 6), e.setAlphaMode(ut.Engine.ALPHA_DISABLE)
                        }
                    }, e.prototype.dispose = function() {
                        this._buffer && (this._buffer.dispose(), this._buffer = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._spriteTexture && (this._spriteTexture.dispose(), this._spriteTexture = null);
                        var e = this._scene.spriteManagers.indexOf(this);
                        this._scene.spriteManagers.splice(e, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear()
                    }, e
                }(), ut.SpriteManager = ct, ht = $a || ($a = {}), dt = function() {
                    function e(e, t) {
                        this.name = e, this.color = new ht.Color4(1, 1, 1, 1), this.width = 1, this.height = 1, this.angle = 0, this.cellIndex = 0, this.invertU = 0, this.invertV = 0, this.animations = new Array, this.isPickable = !1, this._animationStarted = !1, this._loopAnimation = !1, this._fromIndex = 0, this._toIndex = 0, this._delay = 0, this._direction = 1, this._time = 0, this.isVisible = !0, this._manager = t, this._manager.sprites.push(this), this.position = ht.Vector3.Zero()
                    }
                    return Object.defineProperty(e.prototype, "size", {
                        get: function() {
                            return this.width
                        },
                        set: function(e) {
                            this.width = e, this.height = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.playAnimation = function(e, t, i, r, n) {
                        this._fromIndex = e, this._toIndex = t, this._loopAnimation = i, this._delay = r, this._animationStarted = !0, this._direction = e < t ? 1 : -1, this.cellIndex = e, this._time = 0, this._onAnimationEnd = n
                    }, e.prototype.stopAnimation = function() {
                        this._animationStarted = !1
                    }, e.prototype._animate = function(e) {
                        this._animationStarted && (this._time += e, this._time > this._delay && (this._time = this._time % this._delay, this.cellIndex += this._direction, this.cellIndex > this._toIndex && (this._loopAnimation ? this.cellIndex = this._fromIndex : (this.cellIndex = this._toIndex, this._animationStarted = !1, this._onAnimationEnd && this._onAnimationEnd(), this.disposeWhenFinishedAnimating && this.dispose()))))
                    }, e.prototype.dispose = function() {
                        for (var e = 0; e < this._manager.sprites.length; e++) this._manager.sprites[e] == this && this._manager.sprites.splice(e, 1)
                    }, e
                }(), ht.Sprite = dt,
                function(e) {
                    e.Scene.prototype._internalPickSprites = function(t, i, r, n) {
                        if (!e.PickingInfo) return null;
                        var o = null;
                        if (!n) {
                            if (!this.activeCamera) return null;
                            n = this.activeCamera
                        }
                        if (0 < this.spriteManagers.length)
                            for (var s = 0; s < this.spriteManagers.length; s++) {
                                var a = this.spriteManagers[s];
                                if (a.isPickable) {
                                    var l = a.intersects(t, n, i, r);
                                    if (l && l.hit && (r || null == o || !(l.distance >= o.distance)) && (o = l, r)) break
                                }
                            }
                        return o || new e.PickingInfo
                    }, e.Scene.prototype.pickSprite = function(e, t, i, r, n) {
                        return this.createPickingRayInCameraSpaceToRef(e, t, this._tempSpritePickingRay, n), this._internalPickSprites(this._tempSpritePickingRay, i, r, n)
                    }, e.Scene.prototype.pickSpriteWithRay = function(t, i, r, n) {
                        if (!this._tempSpritePickingRay) return null;
                        if (!n) {
                            if (!this.activeCamera) return null;
                            n = this.activeCamera
                        }
                        return e.Ray.TransformToRef(t, n.getViewMatrix(), this._tempSpritePickingRay), this._internalPickSprites(this._tempSpritePickingRay, i, r, n)
                    }, e.Scene.prototype.setPointerOverSprite = function(t) {
                        this._pointerOverSprite !== t && (this._pointerOverSprite && this._pointerOverSprite.actionManager && this._pointerOverSprite.actionManager.processTrigger(e.ActionManager.OnPointerOutTrigger, e.ActionEvent.CreateNewFromSprite(this._pointerOverSprite, this)), this._pointerOverSprite = t, this._pointerOverSprite && this._pointerOverSprite.actionManager && this._pointerOverSprite.actionManager.processTrigger(e.ActionManager.OnPointerOverTrigger, e.ActionEvent.CreateNewFromSprite(this._pointerOverSprite, this)))
                    }, e.Scene.prototype.getPointerOverSprite = function() {
                        return this._pointerOverSprite
                    };
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_SPRITE, this.scene = t, this.scene.spriteManagers = new Array, this.scene._tempSpritePickingRay = e.Ray ? e.Ray.Zero() : null, this.scene.onBeforeSpritesRenderingObservable = new e.Observable, this.scene.onAfterSpritesRenderingObservable = new e.Observable, this._spritePredicate = function(e) {
                                return !!e.actionManager && e.isPickable && e.actionManager.hasPointerTriggers
                            }
                        }
                        return t.prototype.register = function() {
                            this.scene._pointerMoveStage.registerStep(e.SceneComponentConstants.STEP_POINTERMOVE_SPRITE, this, this._pointerMove), this.scene._pointerDownStage.registerStep(e.SceneComponentConstants.STEP_POINTERDOWN_SPRITE, this, this._pointerDown), this.scene._pointerUpStage.registerStep(e.SceneComponentConstants.STEP_POINTERUP_SPRITE, this, this._pointerUp)
                        }, t.prototype.rebuild = function() {}, t.prototype.dispose = function() {
                            this.scene.onBeforeSpritesRenderingObservable.clear(), this.scene.onAfterSpritesRenderingObservable.clear();
                            for (var e = this.scene.spriteManagers; e.length;) e[0].dispose()
                        }, t.prototype._pickSpriteButKeepRay = function(e, t, i, r, n) {
                            var o = this.scene.pickSprite(t, i, this._spritePredicate, r, n);
                            return o && (o.ray = e ? e.ray : null), o
                        }, t.prototype._pointerMove = function(e, t, i, r, n) {
                            var o = this.scene;
                            return r ? o.setPointerOverSprite(null) : (i = this._pickSpriteButKeepRay(i, e, t, !1, o.cameraToUseForPointers || void 0)) && i.hit && i.pickedSprite ? (o.setPointerOverSprite(i.pickedSprite), o._pointerOverSprite && o._pointerOverSprite.actionManager && o._pointerOverSprite.actionManager.hoverCursor ? n.style.cursor = o._pointerOverSprite.actionManager.hoverCursor : n.style.cursor = o.hoverCursor) : o.setPointerOverSprite(null), i
                        }, t.prototype._pointerDown = function(t, i, r, n) {
                            var o = this.scene;
                            if (o._pickedDownSprite = null, 0 < o.spriteManagers.length && (r = o.pickSprite(t, i, this._spritePredicate, !1, o.cameraToUseForPointers || void 0)) && r.hit && r.pickedSprite && r.pickedSprite.actionManager) {
                                switch (o._pickedDownSprite = r.pickedSprite, n.button) {
                                    case 0:
                                        r.pickedSprite.actionManager.processTrigger(e.ActionManager.OnLeftPickTrigger, e.ActionEvent.CreateNewFromSprite(r.pickedSprite, o, n));
                                        break;
                                    case 1:
                                        r.pickedSprite.actionManager.processTrigger(e.ActionManager.OnCenterPickTrigger, e.ActionEvent.CreateNewFromSprite(r.pickedSprite, o, n));
                                        break;
                                    case 2:
                                        r.pickedSprite.actionManager.processTrigger(e.ActionManager.OnRightPickTrigger, e.ActionEvent.CreateNewFromSprite(r.pickedSprite, o, n))
                                }
                                r.pickedSprite.actionManager && r.pickedSprite.actionManager.processTrigger(e.ActionManager.OnPickDownTrigger, e.ActionEvent.CreateNewFromSprite(r.pickedSprite, o, n))
                            }
                            return r
                        }, t.prototype._pointerUp = function(t, i, r, n) {
                            var o = this.scene;
                            if (0 < o.spriteManagers.length) {
                                var s = o.pickSprite(t, i, this._spritePredicate, !1, o.cameraToUseForPointers || void 0);
                                s && (s.hit && s.pickedSprite && s.pickedSprite.actionManager && (s.pickedSprite.actionManager.processTrigger(e.ActionManager.OnPickUpTrigger, e.ActionEvent.CreateNewFromSprite(s.pickedSprite, o, n)), s.pickedSprite.actionManager && (this.scene._isPointerSwiping() || s.pickedSprite.actionManager.processTrigger(e.ActionManager.OnPickTrigger, e.ActionEvent.CreateNewFromSprite(s.pickedSprite, o, n)))), o._pickedDownSprite && o._pickedDownSprite.actionManager && o._pickedDownSprite !== s.pickedSprite && o._pickedDownSprite.actionManager.processTrigger(e.ActionManager.OnPickOutTrigger, e.ActionEvent.CreateNewFromSprite(o._pickedDownSprite, o, n)))
                            }
                            return r
                        }, t
                    }();
                    e.SpriteSceneComponent = t
                }($a || ($a = {})),
                function(e) {
                    var t = function(e, t, i) {
                        this.bu = e, this.bv = t, this.distance = i, this.faceId = 0, this.subMeshId = 0
                    };
                    e.IntersectionInfo = t;
                    var i = function() {
                        function t() {
                            this.hit = !1, this.distance = 0, this.pickedPoint = null, this.pickedMesh = null, this.bu = 0, this.bv = 0, this.faceId = -1, this.subMeshId = 0, this.pickedSprite = null, this.originMesh = null, this.ray = null
                        }
                        return t.prototype.getNormal = function(t, i) {
                            if (void 0 === t && (t = !1), void 0 === i && (i = !0), !this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(e.VertexBuffer.NormalKind)) return null;
                            var r, n = this.pickedMesh.getIndices();
                            if (!n) return null;
                            if (i) {
                                var o = this.pickedMesh.getVerticesData(e.VertexBuffer.NormalKind),
                                    s = e.Vector3.FromArray(o, 3 * n[3 * this.faceId]),
                                    a = e.Vector3.FromArray(o, 3 * n[3 * this.faceId + 1]),
                                    l = e.Vector3.FromArray(o, 3 * n[3 * this.faceId + 2]);
                                s = s.scale(this.bu), a = a.scale(this.bv), l = l.scale(1 - this.bu - this.bv), r = new e.Vector3(s.x + a.x + l.x, s.y + a.y + l.y, s.z + a.z + l.z)
                            } else {
                                var u = this.pickedMesh.getVerticesData(e.VertexBuffer.PositionKind),
                                    c = e.Vector3.FromArray(u, 3 * n[3 * this.faceId]),
                                    h = e.Vector3.FromArray(u, 3 * n[3 * this.faceId + 1]),
                                    d = e.Vector3.FromArray(u, 3 * n[3 * this.faceId + 2]),
                                    p = c.subtract(h),
                                    f = d.subtract(h);
                                r = e.Vector3.Cross(p, f)
                            }
                            if (t) {
                                var _ = this.pickedMesh.getWorldMatrix();
                                this.pickedMesh.nonUniformScaling && (e.Tmp.Matrix[0].copyFrom(_), (_ = e.Tmp.Matrix[0]).setTranslationFromFloats(0, 0, 0), _.invert(), _.transposeToRef(e.Tmp.Matrix[1]), _ = e.Tmp.Matrix[1]), r = e.Vector3.TransformNormal(r, _)
                            }
                            return r.normalize(), r
                        }, t.prototype.getTextureCoordinates = function() {
                            if (!this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(e.VertexBuffer.UVKind)) return null;
                            var t = this.pickedMesh.getIndices();
                            if (!t) return null;
                            var i = this.pickedMesh.getVerticesData(e.VertexBuffer.UVKind);
                            if (!i) return null;
                            var r = e.Vector2.FromArray(i, 2 * t[3 * this.faceId]),
                                n = e.Vector2.FromArray(i, 2 * t[3 * this.faceId + 1]),
                                o = e.Vector2.FromArray(i, 2 * t[3 * this.faceId + 2]);
                            return r = r.scale(1 - this.bu - this.bv), n = n.scale(this.bu), o = o.scale(this.bv), new e.Vector2(r.x + n.x + o.x, r.y + n.y + o.y)
                        }, t
                    }();
                    e.PickingInfo = i
                }($a || ($a = {})), pt = $a || ($a = {}), ft = function() {
                    function e(e, t, i) {
                        void 0 === i && (i = Number.MAX_VALUE), this.origin = e, this.direction = t, this.length = i
                    }
                    return e.prototype.intersectsBoxMinMax = function(e, t) {
                        var i, r, n, o, s = 0,
                            a = Number.MAX_VALUE;
                        if (Math.abs(this.direction.x) < 1e-7) {
                            if (this.origin.x < e.x || this.origin.x > t.x) return !1
                        } else if (i = 1 / this.direction.x, r = (e.x - this.origin.x) * i, (n = (t.x - this.origin.x) * i) == -1 / 0 && (n = 1 / 0), n < r && (o = r, r = n, n = o), s = Math.max(r, s), (a = Math.min(n, a)) < s) return !1;
                        if (Math.abs(this.direction.y) < 1e-7) {
                            if (this.origin.y < e.y || this.origin.y > t.y) return !1
                        } else if (i = 1 / this.direction.y, r = (e.y - this.origin.y) * i, (n = (t.y - this.origin.y) * i) == -1 / 0 && (n = 1 / 0), n < r && (o = r, r = n, n = o), s = Math.max(r, s), (a = Math.min(n, a)) < s) return !1;
                        if (Math.abs(this.direction.z) < 1e-7) {
                            if (this.origin.z < e.z || this.origin.z > t.z) return !1
                        } else if (i = 1 / this.direction.z, r = (e.z - this.origin.z) * i, (n = (t.z - this.origin.z) * i) == -1 / 0 && (n = 1 / 0), n < r && (o = r, r = n, n = o), s = Math.max(r, s), (a = Math.min(n, a)) < s) return !1;
                        return !0
                    }, e.prototype.intersectsBox = function(e) {
                        return this.intersectsBoxMinMax(e.minimum, e.maximum)
                    }, e.prototype.intersectsSphere = function(e) {
                        var t = e.center.x - this.origin.x,
                            i = e.center.y - this.origin.y,
                            r = e.center.z - this.origin.z,
                            n = t * t + i * i + r * r,
                            o = e.radius * e.radius;
                        if (n <= o) return !0;
                        var s = t * this.direction.x + i * this.direction.y + r * this.direction.z;
                        return !(s < 0) && n - s * s <= o
                    }, e.prototype.intersectsTriangle = function(e, t, i) {
                        this._edge1 || (this._edge1 = pt.Vector3.Zero(), this._edge2 = pt.Vector3.Zero(), this._pvec = pt.Vector3.Zero(), this._tvec = pt.Vector3.Zero(), this._qvec = pt.Vector3.Zero()), t.subtractToRef(e, this._edge1), i.subtractToRef(e, this._edge2), pt.Vector3.CrossToRef(this.direction, this._edge2, this._pvec);
                        var r = pt.Vector3.Dot(this._edge1, this._pvec);
                        if (0 === r) return null;
                        var n = 1 / r;
                        this.origin.subtractToRef(e, this._tvec);
                        var o = pt.Vector3.Dot(this._tvec, this._pvec) * n;
                        if (o < 0 || 1 < o) return null;
                        pt.Vector3.CrossToRef(this._tvec, this._edge1, this._qvec);
                        var s = pt.Vector3.Dot(this.direction, this._qvec) * n;
                        if (s < 0 || 1 < o + s) return null;
                        var a = pt.Vector3.Dot(this._edge2, this._qvec) * n;
                        return a > this.length ? null : new pt.IntersectionInfo(o, s, a)
                    }, e.prototype.intersectsPlane = function(e) {
                        var t, i = pt.Vector3.Dot(e.normal, this.direction);
                        if (Math.abs(i) < 9.99999997475243e-7) return null;
                        var r = pt.Vector3.Dot(e.normal, this.origin);
                        return (t = (-e.d - r) / i) < 0 ? t < -9.99999997475243e-7 ? null : 0 : t
                    }, e.prototype.intersectsMesh = function(t, i) {
                        var r = pt.Tmp.Matrix[0];
                        return t.getWorldMatrix().invertToRef(r), this._tmpRay ? e.TransformToRef(this, r, this._tmpRay) : this._tmpRay = e.Transform(this, r), t.intersects(this._tmpRay, i)
                    }, e.prototype.intersectsMeshes = function(e, t, i) {
                        i ? i.length = 0 : i = [];
                        for (var r = 0; r < e.length; r++) {
                            var n = this.intersectsMesh(e[r], t);
                            n.hit && i.push(n)
                        }
                        return i.sort(this._comparePickingInfo), i
                    }, e.prototype._comparePickingInfo = function(e, t) {
                        return e.distance < t.distance ? -1 : e.distance > t.distance ? 1 : 0
                    }, e.prototype.intersectionSegment = function(t, i, r) {
                        var n, o, s, a, l = this.origin.add(this.direction.multiplyByFloats(e.rayl, e.rayl, e.rayl)),
                            u = i.subtract(t),
                            c = l.subtract(this.origin),
                            h = t.subtract(this.origin),
                            d = pt.Vector3.Dot(u, u),
                            p = pt.Vector3.Dot(u, c),
                            f = pt.Vector3.Dot(c, c),
                            _ = pt.Vector3.Dot(u, h),
                            m = pt.Vector3.Dot(c, h),
                            g = d * f - p * p,
                            v = g,
                            y = g;
                        g < e.smallnum ? (o = 0, v = 1, a = m, y = f) : (a = d * m - p * _, (o = p * m - f * _) < 0 ? (o = 0, a = m, y = f) : v < o && (o = v, a = m + p, y = f)), a < 0 ? -_ < (a = 0) ? o = 0 : d < -_ ? o = v : (o = -_, v = d) : y < a && (a = y, -_ + p < 0 ? o = 0 : d < -_ + p ? o = v : (o = -_ + p, v = d)), n = Math.abs(o) < e.smallnum ? 0 : o / v, s = Math.abs(a) < e.smallnum ? 0 : a / y;
                        var b = c.multiplyByFloats(s, s, s),
                            x = h.add(u.multiplyByFloats(n, n, n)).subtract(b);
                        return 0 < s && s <= this.length && x.lengthSquared() < r * r ? b.length() : -1
                    }, e.prototype.update = function(e, t, i, r, n, o, s) {
                        return pt.Vector3.UnprojectFloatsToRef(e, t, 0, i, r, n, o, s, this.origin), pt.Vector3.UnprojectFloatsToRef(e, t, 1, i, r, n, o, s, pt.Tmp.Vector3[0]), pt.Tmp.Vector3[0].subtractToRef(this.origin, this.direction), this.direction.normalize(), this
                    }, e.Zero = function() {
                        return new e(pt.Vector3.Zero(), pt.Vector3.Zero())
                    }, e.CreateNew = function(t, i, r, n, o, s, a) {
                        return e.Zero().update(t, i, r, n, o, s, a)
                    }, e.CreateNewFromTo = function(t, i, r) {
                        void 0 === r && (r = pt.Matrix.Identity());
                        var n = i.subtract(t),
                            o = Math.sqrt(n.x * n.x + n.y * n.y + n.z * n.z);
                        return n.normalize(), e.Transform(new e(t, n, o), r)
                    }, e.Transform = function(t, i) {
                        var r = new e(new pt.Vector3(0, 0, 0), new pt.Vector3(0, 0, 0));
                        return e.TransformToRef(t, i, r), r
                    }, e.TransformToRef = function(e, t, i) {
                        pt.Vector3.TransformCoordinatesToRef(e.origin, t, i.origin), pt.Vector3.TransformNormalToRef(e.direction, t, i.direction), i.length = e.length;
                        var r = i.direction,
                            n = r.length();
                        if (0 !== n && 1 !== n) {
                            var o = 1 / n;
                            r.x *= o, r.y *= o, r.z *= o, i.length *= n
                        }
                    }, e.smallnum = 1e-8, e.rayl = 1e9, e
                }(), pt.Ray = ft, _t = $a || ($a = {}), mt = {
                    root: 0,
                    found: !1
                }, gt = function(e, t, i, r) {
                    mt.root = 0, mt.found = !1;
                    var n = t * t - 4 * e * i;
                    if (n < 0) return mt;
                    var o = Math.sqrt(n),
                        s = (-t - o) / (2 * e),
                        a = (-t + o) / (2 * e);
                    if (a < s) {
                        var l = a;
                        a = s, s = l
                    }
                    return 0 < s && s < r ? (mt.root = s, mt.found = !0) : 0 < a && a < r && (mt.root = a, mt.found = !0), mt
                }, vt = function() {
                    function e() {
                        this._collisionPoint = _t.Vector3.Zero(), this._planeIntersectionPoint = _t.Vector3.Zero(), this._tempVector = _t.Vector3.Zero(), this._tempVector2 = _t.Vector3.Zero(), this._tempVector3 = _t.Vector3.Zero(), this._tempVector4 = _t.Vector3.Zero(), this._edge = _t.Vector3.Zero(), this._baseToVertex = _t.Vector3.Zero(), this._destinationPoint = _t.Vector3.Zero(), this._slidePlaneNormal = _t.Vector3.Zero(), this._displacementVector = _t.Vector3.Zero(), this._radius = _t.Vector3.One(), this._retry = 0, this._basePointWorld = _t.Vector3.Zero(), this._velocityWorld = _t.Vector3.Zero(), this._normalizedVelocity = _t.Vector3.Zero(), this._collisionMask = -1
                    }
                    return Object.defineProperty(e.prototype, "collisionMask", {
                        get: function() {
                            return this._collisionMask
                        },
                        set: function(e) {
                            this._collisionMask = isNaN(e) ? -1 : e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "slidePlaneNormal", {
                        get: function() {
                            return this._slidePlaneNormal
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._initialize = function(e, t, i) {
                        this._velocity = t, _t.Vector3.NormalizeToRef(t, this._normalizedVelocity), (this._basePoint = e).multiplyToRef(this._radius, this._basePointWorld), t.multiplyToRef(this._radius, this._velocityWorld), this._velocityWorldLength = this._velocityWorld.length(), this._epsilon = i, this.collisionFound = !1
                    }, e.prototype._checkPointInTriangle = function(e, t, i, r, n) {
                        t.subtractToRef(e, this._tempVector), i.subtractToRef(e, this._tempVector2), _t.Vector3.CrossToRef(this._tempVector, this._tempVector2, this._tempVector4);
                        var o = _t.Vector3.Dot(this._tempVector4, n);
                        return !(o < 0) && (r.subtractToRef(e, this._tempVector3), _t.Vector3.CrossToRef(this._tempVector2, this._tempVector3, this._tempVector4), !((o = _t.Vector3.Dot(this._tempVector4, n)) < 0) && (_t.Vector3.CrossToRef(this._tempVector3, this._tempVector, this._tempVector4), 0 <= (o = _t.Vector3.Dot(this._tempVector4, n))))
                    }, e.prototype._canDoCollision = function(e, t, i, r) {
                        var n, o, s, a, l = _t.Vector3.Distance(this._basePointWorld, e),
                            u = Math.max(this._radius.x, this._radius.y, this._radius.z);
                        return !(l > this._velocityWorldLength + u + t || (n = i, o = r, s = this._basePointWorld, a = this._velocityWorldLength + u, n.x > s.x + a || s.x - a > o.x || n.y > s.y + a || s.y - a > o.y || n.z > s.z + a || s.z - a > o.z))
                    }, e.prototype._testTriangle = function(e, t, i, r, n, o) {
                        var s, a = !1;
                        t || (t = []), t[e] || (t[e] = new _t.Plane(0, 0, 0, 0), t[e].copyFromPoints(i, r, n));
                        var l = t[e];
                        if (o || l.isFrontFacingTo(this._normalizedVelocity, 0)) {
                            var u = l.signedDistanceTo(this._basePoint),
                                c = _t.Vector3.Dot(l.normal, this._velocity);
                            if (0 == c) {
                                if (1 <= Math.abs(u)) return;
                                a = !0, s = 0
                            } else {
                                var h = (1 - u) / c;
                                if (h < (s = (-1 - u) / c)) {
                                    var d = h;
                                    h = s, s = d
                                }
                                if (1 < s || h < 0) return;
                                s < 0 && (s = 0), 1 < s && (s = 1)
                            }
                            this._collisionPoint.copyFromFloats(0, 0, 0);
                            var p = !1,
                                f = 1;
                            if (a || (this._basePoint.subtractToRef(l.normal, this._planeIntersectionPoint), this._velocity.scaleToRef(s, this._tempVector), this._planeIntersectionPoint.addInPlace(this._tempVector), this._checkPointInTriangle(this._planeIntersectionPoint, i, r, n, l.normal) && (p = !0, f = s, this._collisionPoint.copyFrom(this._planeIntersectionPoint))), !p) {
                                var _ = this._velocity.lengthSquared(),
                                    m = _;
                                this._basePoint.subtractToRef(i, this._tempVector);
                                var g = 2 * _t.Vector3.Dot(this._velocity, this._tempVector),
                                    v = this._tempVector.lengthSquared() - 1,
                                    y = gt(m, g, v, f);
                                y.found && (f = y.root, p = !0, this._collisionPoint.copyFrom(i)), this._basePoint.subtractToRef(r, this._tempVector), g = 2 * _t.Vector3.Dot(this._velocity, this._tempVector), v = this._tempVector.lengthSquared() - 1, (y = gt(m, g, v, f)).found && (f = y.root, p = !0, this._collisionPoint.copyFrom(r)), this._basePoint.subtractToRef(n, this._tempVector), g = 2 * _t.Vector3.Dot(this._velocity, this._tempVector), v = this._tempVector.lengthSquared() - 1, (y = gt(m, g, v, f)).found && (f = y.root, p = !0, this._collisionPoint.copyFrom(n)), r.subtractToRef(i, this._edge), i.subtractToRef(this._basePoint, this._baseToVertex);
                                var b = this._edge.lengthSquared(),
                                    x = _t.Vector3.Dot(this._edge, this._velocity),
                                    T = _t.Vector3.Dot(this._edge, this._baseToVertex);
                                if (m = b * -_ + x * x, g = b * (2 * _t.Vector3.Dot(this._velocity, this._baseToVertex)) - 2 * x * T, v = b * (1 - this._baseToVertex.lengthSquared()) + T * T, (y = gt(m, g, v, f)).found) {
                                    var E = (x * y.root - T) / b;
                                    0 <= E && E <= 1 && (f = y.root, p = !0, this._edge.scaleInPlace(E), i.addToRef(this._edge, this._collisionPoint))
                                }
                                n.subtractToRef(r, this._edge), r.subtractToRef(this._basePoint, this._baseToVertex), b = this._edge.lengthSquared(), x = _t.Vector3.Dot(this._edge, this._velocity), T = _t.Vector3.Dot(this._edge, this._baseToVertex), m = b * -_ + x * x, g = b * (2 * _t.Vector3.Dot(this._velocity, this._baseToVertex)) - 2 * x * T, v = b * (1 - this._baseToVertex.lengthSquared()) + T * T, (y = gt(m, g, v, f)).found && 0 <= (E = (x * y.root - T) / b) && E <= 1 && (f = y.root, p = !0, this._edge.scaleInPlace(E), r.addToRef(this._edge, this._collisionPoint)), i.subtractToRef(n, this._edge), n.subtractToRef(this._basePoint, this._baseToVertex), b = this._edge.lengthSquared(), x = _t.Vector3.Dot(this._edge, this._velocity), T = _t.Vector3.Dot(this._edge, this._baseToVertex), m = b * -_ + x * x, g = b * (2 * _t.Vector3.Dot(this._velocity, this._baseToVertex)) - 2 * x * T, v = b * (1 - this._baseToVertex.lengthSquared()) + T * T, (y = gt(m, g, v, f)).found && 0 <= (E = (x * y.root - T) / b) && E <= 1 && (f = y.root, p = !0, this._edge.scaleInPlace(E), n.addToRef(this._edge, this._collisionPoint))
                            }
                            if (p) {
                                var S = f * this._velocity.length();
                                (!this.collisionFound || S < this._nearestDistance) && (this.intersectionPoint ? this.intersectionPoint.copyFrom(this._collisionPoint) : this.intersectionPoint = this._collisionPoint.clone(), this._nearestDistance = S, this.collisionFound = !0)
                            }
                        }
                    }, e.prototype._collide = function(e, t, i, r, n, o, s) {
                        for (var a = r; a < n; a += 3) {
                            var l = t[i[a] - o],
                                u = t[i[a + 1] - o],
                                c = t[i[a + 2] - o];
                            this._testTriangle(a, e, c, u, l, s)
                        }
                    }, e.prototype._getResponse = function(e, t) {
                        e.addToRef(t, this._destinationPoint), t.scaleInPlace(this._nearestDistance / t.length()), this._basePoint.addToRef(t, e), e.subtractToRef(this.intersectionPoint, this._slidePlaneNormal), this._slidePlaneNormal.normalize(), this._slidePlaneNormal.scaleToRef(this._epsilon, this._displacementVector), e.addInPlace(this._displacementVector), this.intersectionPoint.addInPlace(this._displacementVector), this._slidePlaneNormal.scaleInPlace(_t.Plane.SignedDistanceToPlaneFromPositionAndNormal(this.intersectionPoint, this._slidePlaneNormal, this._destinationPoint)), this._destinationPoint.subtractInPlace(this._slidePlaneNormal), this._destinationPoint.subtractToRef(this.intersectionPoint, t)
                    }, e
                }(), _t.Collider = vt,
                function(e) {
                    var t, i, r, n;
                    e.CollisionWorker = "", (i = t = e.WorkerTaskType || (e.WorkerTaskType = {}))[i.INIT = 0] = "INIT", i[i.UPDATE = 1] = "UPDATE", i[i.COLLIDE = 2] = "COLLIDE", (n = r = e.WorkerReplyType || (e.WorkerReplyType = {}))[n.SUCCESS = 0] = "SUCCESS", n[n.UNKNOWN_ERROR = 1] = "UNKNOWN_ERROR";
                    var o = function() {
                        function i() {
                            var n = this;
                            this._scaledPosition = e.Vector3.Zero(), this._scaledVelocity = e.Vector3.Zero(), this.onMeshUpdated = function(e) {
                                n._addUpdateMeshesList[e.uniqueId] = i.SerializeMesh(e)
                            }, this.onGeometryUpdated = function(e) {
                                n._addUpdateGeometriesList[e.id] = i.SerializeGeometry(e)
                            }, this._afterRender = function() {
                                if (n._init && !(0 == n._toRemoveGeometryArray.length && 0 == n._toRemoveMeshesArray.length && 0 == Object.keys(n._addUpdateGeometriesList).length && 0 == Object.keys(n._addUpdateMeshesList).length || 4 < n._runningUpdated)) {
                                    ++n._runningUpdated;
                                    var e = {
                                            updatedMeshes: n._addUpdateMeshesList,
                                            updatedGeometries: n._addUpdateGeometriesList,
                                            removedGeometries: n._toRemoveGeometryArray,
                                            removedMeshes: n._toRemoveMeshesArray
                                        },
                                        i = {
                                            payload: e,
                                            taskType: t.UPDATE
                                        },
                                        r = [];
                                    for (var o in e.updatedGeometries) e.updatedGeometries.hasOwnProperty(o) && (r.push(i.payload.updatedGeometries[o].indices.buffer), r.push(i.payload.updatedGeometries[o].normals.buffer), r.push(i.payload.updatedGeometries[o].positions.buffer));
                                    n._worker.postMessage(i, r), n._addUpdateMeshesList = {}, n._addUpdateGeometriesList = {}, n._toRemoveGeometryArray = [], n._toRemoveMeshesArray = []
                                }
                            }, this._onMessageFromWorker = function(i) {
                                var o = i.data;
                                if (o.error == r.SUCCESS) switch (o.taskType) {
                                    case t.INIT:
                                        n._init = !0, n._scene.meshes.forEach(function(e) {
                                            n.onMeshAdded(e)
                                        }), n._scene.getGeometries().forEach(function(e) {
                                            n.onGeometryAdded(e)
                                        });
                                        break;
                                    case t.UPDATE:
                                        n._runningUpdated--;
                                        break;
                                    case t.COLLIDE:
                                        var s = o.payload;
                                        if (!n._collisionsCallbackArray[s.collisionId]) return;
                                        var a = n._collisionsCallbackArray[s.collisionId];
                                        if (a) {
                                            var l = n._scene.getMeshByUniqueID(s.collidedMeshUniqueId);
                                            l && a(s.collisionId, e.Vector3.FromArray(s.newPosition), l)
                                        }
                                        n._collisionsCallbackArray[s.collisionId] = null
                                } else e.Tools.Warn("error returned from worker!")
                            }, this._collisionsCallbackArray = [], this._init = !1, this._runningUpdated = 0, this._addUpdateMeshesList = {}, this._addUpdateGeometriesList = {}, this._toRemoveGeometryArray = [], this._toRemoveMeshesArray = []
                        }
                        return i.prototype.getNewPosition = function(e, i, r, n, o, s, a) {
                            if (this._init && !this._collisionsCallbackArray[a] && !this._collisionsCallbackArray[a + 1e5]) {
                                e.divideToRef(r._radius, this._scaledPosition), i.divideToRef(r._radius, this._scaledVelocity), this._collisionsCallbackArray[a] = s;
                                var l = {
                                    payload: {
                                        collider: {
                                            position: this._scaledPosition.asArray(),
                                            velocity: this._scaledVelocity.asArray(),
                                            radius: r._radius.asArray()
                                        },
                                        collisionId: a,
                                        excludedMeshUniqueId: o ? o.uniqueId : null,
                                        maximumRetry: n
                                    },
                                    taskType: t.COLLIDE
                                };
                                this._worker.postMessage(l)
                            }
                        }, i.prototype.init = function(i) {
                            this._scene = i, this._scene.registerAfterRender(this._afterRender);
                            var r = e.WorkerIncluded ? e.Engine.CodeRepository + "Collisions/babylon.collisionWorker.js" : URL.createObjectURL(new Blob([e.CollisionWorker], {
                                type: "application/javascript"
                            }));
                            this._worker = new Worker(r), this._worker.onmessage = this._onMessageFromWorker;
                            var n = {
                                payload: {},
                                taskType: t.INIT
                            };
                            this._worker.postMessage(n)
                        }, i.prototype.destroy = function() {
                            this._scene.unregisterAfterRender(this._afterRender), this._worker.terminate()
                        }, i.prototype.onMeshAdded = function(e) {
                            e.registerAfterWorldMatrixUpdate(this.onMeshUpdated), this.onMeshUpdated(e)
                        }, i.prototype.onMeshRemoved = function(e) {
                            this._toRemoveMeshesArray.push(e.uniqueId)
                        }, i.prototype.onGeometryAdded = function(e) {
                            e.onGeometryUpdated = this.onGeometryUpdated, this.onGeometryUpdated(e)
                        }, i.prototype.onGeometryDeleted = function(e) {
                            this._toRemoveGeometryArray.push(e.id)
                        }, i.SerializeMesh = function(t) {
                            var i = [];
                            t.subMeshes && (i = t.subMeshes.map(function(e, t) {
                                var i = e.getBoundingInfo();
                                return {
                                    position: t,
                                    verticesStart: e.verticesStart,
                                    verticesCount: e.verticesCount,
                                    indexStart: e.indexStart,
                                    indexCount: e.indexCount,
                                    hasMaterial: !!e.getMaterial(),
                                    sphereCenter: i.boundingSphere.centerWorld.asArray(),
                                    sphereRadius: i.boundingSphere.radiusWorld,
                                    boxMinimum: i.boundingBox.minimumWorld.asArray(),
                                    boxMaximum: i.boundingBox.maximumWorld.asArray()
                                }
                            }));
                            var r = null;
                            if (t instanceof e.Mesh) r = (n = t.geometry) ? n.id : null;
                            else if (t instanceof e.InstancedMesh) {
                                var n;
                                r = (n = t.sourceMesh && t.sourceMesh.geometry) ? n.id : null
                            }
                            var o = t.getBoundingInfo();
                            return {
                                uniqueId: t.uniqueId,
                                id: t.id,
                                name: t.name,
                                geometryId: r,
                                sphereCenter: o.boundingSphere.centerWorld.asArray(),
                                sphereRadius: o.boundingSphere.radiusWorld,
                                boxMinimum: o.boundingBox.minimumWorld.asArray(),
                                boxMaximum: o.boundingBox.maximumWorld.asArray(),
                                worldMatrixFromCache: t.worldMatrixFromCache.asArray(),
                                subMeshes: i,
                                checkCollisions: t.checkCollisions
                            }
                        }, i.SerializeGeometry = function(t) {
                            return {
                                id: t.id,
                                positions: new Float32Array(t.getVerticesData(e.VertexBuffer.PositionKind) || []),
                                normals: new Float32Array(t.getVerticesData(e.VertexBuffer.NormalKind) || []),
                                indices: new Uint32Array(t.getIndices() || [])
                            }
                        }, i
                    }();
                    e.CollisionCoordinatorWorker = o;
                    var s = function() {
                        function t() {
                            this._scaledPosition = e.Vector3.Zero(), this._scaledVelocity = e.Vector3.Zero(), this._finalPosition = e.Vector3.Zero()
                        }
                        return t.prototype.getNewPosition = function(e, t, i, r, n, o, s) {
                            e.divideToRef(i._radius, this._scaledPosition), t.divideToRef(i._radius, this._scaledVelocity), i.collidedMesh = null, i._retry = 0, i._initialVelocity = this._scaledVelocity, i._initialPosition = this._scaledPosition, this._collideWithWorld(this._scaledPosition, this._scaledVelocity, i, r, this._finalPosition, n), this._finalPosition.multiplyInPlace(i._radius), o(s, this._finalPosition, i.collidedMesh)
                        }, t.prototype.init = function(e) {
                            this._scene = e
                        }, t.prototype.destroy = function() {}, t.prototype.onMeshAdded = function(e) {}, t.prototype.onMeshUpdated = function(e) {}, t.prototype.onMeshRemoved = function(e) {}, t.prototype.onGeometryAdded = function(e) {}, t.prototype.onGeometryUpdated = function(e) {}, t.prototype.onGeometryDeleted = function(e) {}, t.prototype._collideWithWorld = function(t, i, r, n, o, s) {
                            void 0 === s && (s = null);
                            var a = 10 * e.Engine.CollisionsEpsilon;
                            if (r._retry >= n) o.copyFrom(t);
                            else {
                                var l = s ? s.collisionMask : r.collisionMask;
                                r._initialize(t, i, a);
                                for (var u = 0; u < this._scene.meshes.length; u++) {
                                    var c = this._scene.meshes[u];
                                    c.isEnabled() && c.checkCollisions && c.subMeshes && c !== s && 0 != (l & c.collisionGroup) && c._checkCollision(r)
                                }
                                r.collisionFound ? (0 === i.x && 0 === i.y && 0 === i.z || r._getResponse(t, i), i.length() <= a ? o.copyFrom(t) : (r._retry++, this._collideWithWorld(t, i, r, n, o, s))) : t.addToRef(i, o)
                            }
                        }, t
                    }();
                    e.CollisionCoordinatorLegacy = s
                }($a || ($a = {})), yt = $a || ($a = {}), bt = function() {
                    function e(t) {
                        this.particleSystem = t, this.position = yt.Vector3.Zero(), this.direction = yt.Vector3.Zero(), this.color = new yt.Color4(0, 0, 0, 0), this.colorStep = new yt.Color4(0, 0, 0, 0), this.lifeTime = 1, this.age = 0, this.size = 0, this.scale = new yt.Vector2(1, 1), this.angle = 0, this.angularSpeed = 0, this.cellIndex = 0, this._attachedSubEmitters = null, this._currentColor1 = new yt.Color4(0, 0, 0, 0), this._currentColor2 = new yt.Color4(0, 0, 0, 0), this._currentSize1 = 0, this._currentSize2 = 0, this._currentAngularSpeed1 = 0, this._currentAngularSpeed2 = 0, this._currentVelocity1 = 0, this._currentVelocity2 = 0, this._currentLimitVelocity1 = 0, this._currentLimitVelocity2 = 0, this._currentDrag1 = 0, this._currentDrag2 = 0, this.id = e._Count++, this.particleSystem.isAnimationSheetEnabled && this.updateCellInfoFromSystem()
                    }
                    return e.prototype.updateCellInfoFromSystem = function() {
                        this.cellIndex = this.particleSystem.startSpriteCellID
                    }, e.prototype.updateCellIndex = function() {
                        var e = this.age,
                            t = this.particleSystem.spriteCellChangeSpeed;
                        this.particleSystem.spriteRandomStartCell && (void 0 === this._randomCellOffset && (this._randomCellOffset = Math.random() * this.lifeTime), 0 === t ? (t = 1, e = this._randomCellOffset) : e += this._randomCellOffset);
                        var i = this._initialEndSpriteCellID - this._initialStartSpriteCellID,
                            r = yt.Scalar.Clamp(e * t % this.lifeTime / this.lifeTime);
                        this.cellIndex = this._initialStartSpriteCellID + r * i | 0
                    }, e.prototype._inheritParticleInfoToSubEmitter = function(e) {
                        if (e.particleSystem.emitter.position) {
                            var t = e.particleSystem.emitter;
                            t.position.copyFrom(this.position), e.inheritDirection && (t.position.subtractToRef(this.direction, yt.Tmp.Vector3[0]), t.lookAt(yt.Tmp.Vector3[0], 0, Math.PI / 2))
                        } else e.particleSystem.emitter.copyFrom(this.position);
                        this.direction.scaleToRef(e.inheritedVelocityAmount / 2, yt.Tmp.Vector3[0]), e.particleSystem._inheritedVelocityOffset.copyFrom(yt.Tmp.Vector3[0])
                    }, e.prototype._inheritParticleInfoToSubEmitters = function() {
                        var e = this;
                        this._attachedSubEmitters && 0 < this._attachedSubEmitters.length && this._attachedSubEmitters.forEach(function(t) {
                            e._inheritParticleInfoToSubEmitter(t)
                        })
                    }, e.prototype._reset = function() {
                        this.age = 0, this._currentColorGradient = null, this._currentSizeGradient = null, this._currentAngularSpeedGradient = null, this._currentVelocityGradient = null, this._currentLimitVelocityGradient = null, this._currentDragGradient = null, this.cellIndex = this.particleSystem.startSpriteCellID, this._randomCellOffset = void 0
                    }, e.prototype.copyTo = function(e) {
                        e.position.copyFrom(this.position), this._initialDirection ? e._initialDirection ? e._initialDirection.copyFrom(this._initialDirection) : e._initialDirection = this._initialDirection.clone() : e._initialDirection = null, e.direction.copyFrom(this.direction), e.color.copyFrom(this.color), e.colorStep.copyFrom(this.colorStep), e.lifeTime = this.lifeTime, e.age = this.age, e._randomCellOffset = this._randomCellOffset, e.size = this.size, e.scale.copyFrom(this.scale), e.angle = this.angle, e.angularSpeed = this.angularSpeed, e.particleSystem = this.particleSystem, e.cellIndex = this.cellIndex, e.id = this.id, e._attachedSubEmitters = this._attachedSubEmitters, this._currentColorGradient && (e._currentColorGradient = this._currentColorGradient, e._currentColor1.copyFrom(this._currentColor1), e._currentColor2.copyFrom(this._currentColor2)), this._currentSizeGradient && (e._currentSizeGradient = this._currentSizeGradient, e._currentSize1 = this._currentSize1, e._currentSize2 = this._currentSize2), this._currentAngularSpeedGradient && (e._currentAngularSpeedGradient = this._currentAngularSpeedGradient, e._currentAngularSpeed1 = this._currentAngularSpeed1, e._currentAngularSpeed2 = this._currentAngularSpeed2), this._currentVelocityGradient && (e._currentVelocityGradient = this._currentVelocityGradient, e._currentVelocity1 = this._currentVelocity1, e._currentVelocity2 = this._currentVelocity2), this._currentLimitVelocityGradient && (e._currentLimitVelocityGradient = this._currentLimitVelocityGradient, e._currentLimitVelocity1 = this._currentLimitVelocity1, e._currentLimitVelocity2 = this._currentLimitVelocity2),
                            this._currentDragGradient && (e._currentDragGradient = this._currentDragGradient, e._currentDrag1 = this._currentDrag1, e._currentDrag2 = this._currentDrag2), this.particleSystem.isAnimationSheetEnabled && (e._initialStartSpriteCellID = this._initialStartSpriteCellID, e._initialEndSpriteCellID = this._initialEndSpriteCellID), this.particleSystem.useRampGradients && e.remapData.copyFrom(this.remapData), this._randomNoiseCoordinates1 && (e._randomNoiseCoordinates1 ? (e._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1), e._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2)) : (e._randomNoiseCoordinates1 = this._randomNoiseCoordinates1.clone(), e._randomNoiseCoordinates2 = this._randomNoiseCoordinates2.clone()))
                    }, e._Count = 0, e
                }(), yt.Particle = bt, xt = $a || ($a = {}), Tt = function() {
                    function e(e) {
                        this.animations = [], this.renderingGroupId = 0, this.emitter = null, this.emitRate = 10, this.manualEmitCount = -1, this.updateSpeed = .01, this.targetStopDuration = 0, this.disposeOnStop = !1, this.minEmitPower = 1, this.maxEmitPower = 1, this.minLifeTime = 1, this.maxLifeTime = 1, this.minSize = 1, this.maxSize = 1, this.minScaleX = 1, this.maxScaleX = 1, this.minScaleY = 1, this.maxScaleY = 1, this.minInitialRotation = 0, this.maxInitialRotation = 0, this.minAngularSpeed = 0, this.maxAngularSpeed = 0, this.layerMask = 268435455, this.customShader = null, this.preventAutoStart = !1, this.noiseStrength = new xt.Vector3(10, 10, 10), this.onAnimationEnd = null, this.blendMode = xt.ParticleSystem.BLENDMODE_ONEONE, this.forceDepthWrite = !1, this.preWarmCycles = 0, this.preWarmStepOffset = 1, this.spriteCellChangeSpeed = 1, this.startSpriteCellID = 0, this.endSpriteCellID = 0, this.spriteCellWidth = 0, this.spriteCellHeight = 0, this.spriteRandomStartCell = !1, this.translationPivot = new xt.Vector2(0, 0), this.beginAnimationOnStart = !1, this.beginAnimationFrom = 0, this.beginAnimationTo = 60, this.beginAnimationLoop = !1, this.gravity = xt.Vector3.Zero(), this._colorGradients = null, this._sizeGradients = null, this._lifeTimeGradients = null, this._angularSpeedGradients = null, this._velocityGradients = null, this._limitVelocityGradients = null, this._dragGradients = null, this._emitRateGradients = null, this._startSizeGradients = null, this._rampGradients = null, this._colorRemapGradients = null, this._alphaRemapGradients = null, this.startDelay = 0, this.limitVelocityDamping = .4, this.color1 = new xt.Color4(1, 1, 1, 1), this.color2 = new xt.Color4(1, 1, 1, 1), this.colorDead = new xt.Color4(0, 0, 0, 1), this.textureMask = new xt.Color4(1, 1, 1, 1), this._isSubEmitter = !1, this.billboardMode = xt.ParticleSystem.BILLBOARDMODE_ALL, this._isBillboardBased = !0, this._imageProcessingConfigurationDefines = new xt.ImageProcessingConfigurationDefines, this.id = e, this.name = e
                    }
                    return Object.defineProperty(e.prototype, "isAnimationSheetEnabled", {
                        get: function() {
                            return this._isAnimationSheetEnabled
                        },
                        set: function(e) {
                            this._isAnimationSheetEnabled != e && (this._isAnimationSheetEnabled = e, this._reset())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getScene = function() {
                        return this._scene
                    }, e.prototype._hasTargetStopDurationDependantGradient = function() {
                        return this._startSizeGradients && 0 < this._startSizeGradients.length || this._emitRateGradients && 0 < this._emitRateGradients.length || this._lifeTimeGradients && 0 < this._lifeTimeGradients.length
                    }, e.prototype.getDragGradients = function() {
                        return this._dragGradients
                    }, e.prototype.getLimitVelocityGradients = function() {
                        return this._limitVelocityGradients
                    }, e.prototype.getColorGradients = function() {
                        return this._colorGradients
                    }, e.prototype.getSizeGradients = function() {
                        return this._sizeGradients
                    }, e.prototype.getColorRemapGradients = function() {
                        return this._colorRemapGradients
                    }, e.prototype.getAlphaRemapGradients = function() {
                        return this._alphaRemapGradients
                    }, e.prototype.getLifeTimeGradients = function() {
                        return this._lifeTimeGradients
                    }, e.prototype.getAngularSpeedGradients = function() {
                        return this._angularSpeedGradients
                    }, e.prototype.getVelocityGradients = function() {
                        return this._velocityGradients
                    }, e.prototype.getStartSizeGradients = function() {
                        return this._startSizeGradients
                    }, e.prototype.getEmitRateGradients = function() {
                        return this._emitRateGradients
                    }, Object.defineProperty(e.prototype, "direction1", {
                        get: function() {
                            return this.particleEmitterType.direction1 ? this.particleEmitterType.direction1 : xt.Vector3.Zero()
                        },
                        set: function(e) {
                            this.particleEmitterType.direction1 && (this.particleEmitterType.direction1 = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "direction2", {
                        get: function() {
                            return this.particleEmitterType.direction2 ? this.particleEmitterType.direction2 : xt.Vector3.Zero()
                        },
                        set: function(e) {
                            this.particleEmitterType.direction2 && (this.particleEmitterType.direction2 = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "minEmitBox", {
                        get: function() {
                            return this.particleEmitterType.minEmitBox ? this.particleEmitterType.minEmitBox : xt.Vector3.Zero()
                        },
                        set: function(e) {
                            this.particleEmitterType.minEmitBox && (this.particleEmitterType.minEmitBox = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "maxEmitBox", {
                        get: function() {
                            return this.particleEmitterType.maxEmitBox ? this.particleEmitterType.maxEmitBox : xt.Vector3.Zero()
                        },
                        set: function(e) {
                            this.particleEmitterType.maxEmitBox && (this.particleEmitterType.maxEmitBox = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "isBillboardBased", {
                        get: function() {
                            return this._isBillboardBased
                        },
                        set: function(e) {
                            this._isBillboardBased !== e && (this._isBillboardBased = e, this._reset())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "imageProcessingConfiguration", {
                        get: function() {
                            return this._imageProcessingConfiguration
                        },
                        set: function(e) {
                            this._attachImageProcessingConfiguration(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._attachImageProcessingConfiguration = function(e) {
                        e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration = e || this._scene.imageProcessingConfiguration)
                    }, e.prototype._reset = function() {}, e.prototype._removeGradientAndTexture = function(e, t, i) {
                        if (!t) return this;
                        for (var r = 0, n = 0, o = t; n < o.length; n++) {
                            if (o[n].gradient === e) {
                                t.splice(r, 1);
                                break
                            }
                            r++
                        }
                        return i && i.dispose(), this
                    }, e.prototype.createPointEmitter = function(e, t) {
                        var i = new xt.PointParticleEmitter;
                        return i.direction1 = e, i.direction2 = t, this.particleEmitterType = i
                    }, e.prototype.createHemisphericEmitter = function(e, t) {
                        void 0 === e && (e = 1), void 0 === t && (t = 1);
                        var i = new xt.HemisphericParticleEmitter(e, t);
                        return this.particleEmitterType = i
                    }, e.prototype.createSphereEmitter = function(e, t) {
                        void 0 === e && (e = 1), void 0 === t && (t = 1);
                        var i = new xt.SphereParticleEmitter(e, t);
                        return this.particleEmitterType = i
                    }, e.prototype.createDirectedSphereEmitter = function(e, t, i) {
                        void 0 === e && (e = 1), void 0 === t && (t = new xt.Vector3(0, 1, 0)), void 0 === i && (i = new xt.Vector3(0, 1, 0));
                        var r = new xt.SphereDirectedParticleEmitter(e, t, i);
                        return this.particleEmitterType = r
                    }, e.prototype.createCylinderEmitter = function(e, t, i, r) {
                        void 0 === e && (e = 1), void 0 === t && (t = 1), void 0 === i && (i = 1), void 0 === r && (r = 0);
                        var n = new xt.CylinderParticleEmitter(e, t, i, r);
                        return this.particleEmitterType = n
                    }, e.prototype.createDirectedCylinderEmitter = function(e, t, i, r, n) {
                        void 0 === e && (e = 1), void 0 === t && (t = 1), void 0 === i && (i = 1), void 0 === r && (r = new xt.Vector3(0, 1, 0)), void 0 === n && (n = new xt.Vector3(0, 1, 0));
                        var o = new xt.CylinderDirectedParticleEmitter(e, t, i, r, n);
                        return this.particleEmitterType = o
                    }, e.prototype.createConeEmitter = function(e, t) {
                        void 0 === e && (e = 1), void 0 === t && (t = Math.PI / 4);
                        var i = new xt.ConeParticleEmitter(e, t);
                        return this.particleEmitterType = i
                    }, e.prototype.createBoxEmitter = function(e, t, i, r) {
                        var n = new xt.BoxParticleEmitter;
                        return this.particleEmitterType = n, this.direction1 = e, this.direction2 = t, this.minEmitBox = i, this.maxEmitBox = r, n
                    }, e.BLENDMODE_ONEONE = 0, e.BLENDMODE_STANDARD = 1, e.BLENDMODE_ADD = 2, e.BLENDMODE_MULTIPLY = 3, e.BLENDMODE_MULTIPLYADD = 4, e
                }(), xt.BaseParticleSystem = Tt, Et = $a || ($a = {}), St = function(e) {
                    function t(t, i, r, n, o, s) {
                        void 0 === n && (n = null), void 0 === o && (o = !1), void 0 === s && (s = .01);
                        var a = e.call(this, t) || this;
                        return a._inheritedVelocityOffset = new Et.Vector3, a.onDisposeObservable = new Et.Observable, a._particles = new Array, a._stockParticles = new Array, a._newPartsExcess = 0, a._vertexBuffers = {}, a._scaledColorStep = new Et.Color4(0, 0, 0, 0), a._colorDiff = new Et.Color4(0, 0, 0, 0), a._scaledDirection = Et.Vector3.Zero(), a._scaledGravity = Et.Vector3.Zero(), a._currentRenderId = -1, a._useInstancing = !1, a._started = !1, a._stopped = !1, a._actualFrame = 0, a._currentEmitRate1 = 0, a._currentEmitRate2 = 0, a._currentStartSize1 = 0, a._currentStartSize2 = 0, a._rawTextureWidth = 256, a._useRampGradients = !1, a._disposeEmitterOnDispose = !1, a.recycleParticle = function(e) {
                            var t = a._particles.pop();
                            t !== e && t.copyTo(e), a._stockParticles.push(t)
                        }, a._createParticle = function() {
                            var e;
                            if (0 !== a._stockParticles.length ? (e = a._stockParticles.pop())._reset() : e = new Et.Particle(a), a._subEmitters && 0 < a._subEmitters.length) {
                                var t = a._subEmitters[Math.floor(Math.random() * a._subEmitters.length)];
                                e._attachedSubEmitters = [], t.forEach(function(t) {
                                    if (t.type === Et.SubEmitterType.ATTACHED) {
                                        var i = t.clone();
                                        e._attachedSubEmitters.push(i), i.particleSystem.start()
                                    }
                                })
                            }
                            return e
                        }, a._emitFromParticle = function(e) {
                            if (a._subEmitters && 0 !== a._subEmitters.length) {
                                var t = Math.floor(Math.random() * a._subEmitters.length);
                                a._subEmitters[t].forEach(function(t) {
                                    if (t.type === Et.SubEmitterType.END) {
                                        var i = t.clone();
                                        e._inheritParticleInfoToSubEmitter(i), (i.particleSystem._rootParticleSystem = a).activeSubSystems.push(i.particleSystem), i.particleSystem.start()
                                    }
                                })
                            }
                        }, a._capacity = i, a._epsilon = s, a._isAnimationSheetEnabled = o, a._scene = r || Et.Engine.LastCreatedScene, a._attachImageProcessingConfiguration(null), a._customEffect = n, a._scene.particleSystems.push(a), a._useInstancing = a._scene.getEngine().getCaps().instancedArrays, a._createIndexBuffer(), a._createVertexBuffers(), a.particleEmitterType = new Et.BoxParticleEmitter, a.updateFunction = function(e) {
                            var t = null,
                                i = null;
                            a.noiseTexture && (t = a.noiseTexture.getSize(), i = a.noiseTexture.getContent());
                            for (var r, n = 0; n < e.length; n++) ! function() {
                                r = e[n];
                                var o = a._scaledUpdateSpeed,
                                    s = r.age;
                                if (r.age += o, r.age > r.lifeTime) {
                                    var l = r.age - s;
                                    o = (r.lifeTime - s) * o / l, r.age = r.lifeTime
                                }
                                var u = r.age / r.lifeTime;
                                a._colorGradients && 0 < a._colorGradients.length ? Et.Tools.GetCurrentGradient(u, a._colorGradients, function(e, t, i) {
                                    e !== r._currentColorGradient && (r._currentColor1.copyFrom(r._currentColor2), t.getColorToRef(r._currentColor2), r._currentColorGradient = e), Et.Color4.LerpToRef(r._currentColor1, r._currentColor2, i, r.color)
                                }) : (r.colorStep.scaleToRef(o, a._scaledColorStep), r.color.addInPlace(a._scaledColorStep), r.color.a < 0 && (r.color.a = 0)), a._angularSpeedGradients && 0 < a._angularSpeedGradients.length && Et.Tools.GetCurrentGradient(u, a._angularSpeedGradients, function(e, t, i) {
                                    e !== r._currentAngularSpeedGradient && (r._currentAngularSpeed1 = r._currentAngularSpeed2, r._currentAngularSpeed2 = t.getFactor(), r._currentAngularSpeedGradient = e), r.angularSpeed = Et.Scalar.Lerp(r._currentAngularSpeed1, r._currentAngularSpeed2, i)
                                }), r.angle += r.angularSpeed * o;
                                var c = o;
                                if (a._velocityGradients && 0 < a._velocityGradients.length && Et.Tools.GetCurrentGradient(u, a._velocityGradients, function(e, t, i) {
                                        e !== r._currentVelocityGradient && (r._currentVelocity1 = r._currentVelocity2, r._currentVelocity2 = t.getFactor(), r._currentVelocityGradient = e), c *= Et.Scalar.Lerp(r._currentVelocity1, r._currentVelocity2, i)
                                    }), r.direction.scaleToRef(c, a._scaledDirection), a._limitVelocityGradients && 0 < a._limitVelocityGradients.length && Et.Tools.GetCurrentGradient(u, a._limitVelocityGradients, function(e, t, i) {
                                        e !== r._currentLimitVelocityGradient && (r._currentLimitVelocity1 = r._currentLimitVelocity2, r._currentLimitVelocity2 = t.getFactor(), r._currentLimitVelocityGradient = e), Et.Scalar.Lerp(r._currentLimitVelocity1, r._currentLimitVelocity2, i) < r.direction.length() && r.direction.scaleInPlace(a.limitVelocityDamping)
                                    }), a._dragGradients && 0 < a._dragGradients.length && Et.Tools.GetCurrentGradient(u, a._dragGradients, function(e, t, i) {
                                        e !== r._currentDragGradient && (r._currentDrag1 = r._currentDrag2, r._currentDrag2 = t.getFactor(), r._currentDragGradient = e);
                                        var n = Et.Scalar.Lerp(r._currentDrag1, r._currentDrag2, i);
                                        a._scaledDirection.scaleInPlace(1 - n)
                                    }), r.position.addInPlace(a._scaledDirection), i && t) {
                                    var h = a._fetchR(r._randomNoiseCoordinates1.x, r._randomNoiseCoordinates1.y, t.width, t.height, i),
                                        d = a._fetchR(r._randomNoiseCoordinates1.z, r._randomNoiseCoordinates2.x, t.width, t.height, i),
                                        p = a._fetchR(r._randomNoiseCoordinates2.y, r._randomNoiseCoordinates2.z, t.width, t.height, i),
                                        f = Et.Tmp.Vector3[0],
                                        _ = Et.Tmp.Vector3[1];
                                    f.copyFromFloats((2 * h - 1) * a.noiseStrength.x, (2 * d - 1) * a.noiseStrength.y, (2 * p - 1) * a.noiseStrength.z), f.scaleToRef(o, _), r.direction.addInPlace(_)
                                }
                                if (a.gravity.scaleToRef(o, a._scaledGravity), r.direction.addInPlace(a._scaledGravity), a._sizeGradients && 0 < a._sizeGradients.length && Et.Tools.GetCurrentGradient(u, a._sizeGradients, function(e, t, i) {
                                        e !== r._currentSizeGradient && (r._currentSize1 = r._currentSize2, r._currentSize2 = t.getFactor(), r._currentSizeGradient = e), r.size = Et.Scalar.Lerp(r._currentSize1, r._currentSize2, i)
                                    }), a._useRampGradients && (a._colorRemapGradients && 0 < a._colorRemapGradients.length && Et.Tools.GetCurrentGradient(u, a._colorRemapGradients, function(e, t, i) {
                                        var n = Et.Scalar.Lerp(e.factor1, t.factor1, i),
                                            o = Et.Scalar.Lerp(e.factor2, t.factor2, i);
                                        r.remapData.x = n, r.remapData.y = o - n
                                    }), a._alphaRemapGradients && 0 < a._alphaRemapGradients.length && Et.Tools.GetCurrentGradient(u, a._alphaRemapGradients, function(e, t, i) {
                                        var n = Et.Scalar.Lerp(e.factor1, t.factor1, i),
                                            o = Et.Scalar.Lerp(e.factor2, t.factor2, i);
                                        r.remapData.z = n, r.remapData.w = o - n
                                    })), a._isAnimationSheetEnabled && r.updateCellIndex(), r._inheritParticleInfoToSubEmitters(), r.age >= r.lifeTime) a._emitFromParticle(r), r._attachedSubEmitters && (r._attachedSubEmitters.forEach(function(e) {
                                    e.particleSystem.disposeOnStop = !0, e.particleSystem.stop()
                                }), r._attachedSubEmitters = null), a.recycleParticle(r), n--
                            }()
                        }, a
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "onDispose", {
                        set: function(e) {
                            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "useRampGradients", {
                        get: function() {
                            return this._useRampGradients
                        },
                        set: function(e) {
                            this._useRampGradients !== e && (this._useRampGradients = e, this._resetEffect())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "particles", {
                        get: function() {
                            return this._particles
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getClassName = function() {
                        return "ParticleSystem"
                    }, t.prototype._addFactorGradient = function(e, t, i, r) {
                        var n = new Et.FactorGradient;
                        n.gradient = t, n.factor1 = i, n.factor2 = r, e.push(n), e.sort(function(e, t) {
                            return e.gradient < t.gradient ? -1 : e.gradient > t.gradient ? 1 : 0
                        })
                    }, t.prototype._removeFactorGradient = function(e, t) {
                        if (e)
                            for (var i = 0, r = 0, n = e; r < n.length; r++) {
                                if (n[r].gradient === t) {
                                    e.splice(i, 1);
                                    break
                                }
                                i++
                            }
                    }, t.prototype.addLifeTimeGradient = function(e, t, i) {
                        return this._lifeTimeGradients || (this._lifeTimeGradients = []), this._addFactorGradient(this._lifeTimeGradients, e, t, i), this
                    }, t.prototype.removeLifeTimeGradient = function(e) {
                        return this._removeFactorGradient(this._lifeTimeGradients, e), this
                    }, t.prototype.addSizeGradient = function(e, t, i) {
                        return this._sizeGradients || (this._sizeGradients = []), this._addFactorGradient(this._sizeGradients, e, t, i), this
                    }, t.prototype.removeSizeGradient = function(e) {
                        return this._removeFactorGradient(this._sizeGradients, e), this
                    }, t.prototype.addColorRemapGradient = function(e, t, i) {
                        return this._colorRemapGradients || (this._colorRemapGradients = []), this._addFactorGradient(this._colorRemapGradients, e, t, i), this
                    }, t.prototype.removeColorRemapGradient = function(e) {
                        return this._removeFactorGradient(this._colorRemapGradients, e), this
                    }, t.prototype.addAlphaRemapGradient = function(e, t, i) {
                        return this._alphaRemapGradients || (this._alphaRemapGradients = []), this._addFactorGradient(this._alphaRemapGradients, e, t, i), this
                    }, t.prototype.removeAlphaRemapGradient = function(e) {
                        return this._removeFactorGradient(this._alphaRemapGradients, e), this
                    }, t.prototype.addAngularSpeedGradient = function(e, t, i) {
                        return this._angularSpeedGradients || (this._angularSpeedGradients = []), this._addFactorGradient(this._angularSpeedGradients, e, t, i), this
                    }, t.prototype.removeAngularSpeedGradient = function(e) {
                        return this._removeFactorGradient(this._angularSpeedGradients, e), this
                    }, t.prototype.addVelocityGradient = function(e, t, i) {
                        return this._velocityGradients || (this._velocityGradients = []), this._addFactorGradient(this._velocityGradients, e, t, i), this
                    }, t.prototype.removeVelocityGradient = function(e) {
                        return this._removeFactorGradient(this._velocityGradients, e), this
                    }, t.prototype.addLimitVelocityGradient = function(e, t, i) {
                        return this._limitVelocityGradients || (this._limitVelocityGradients = []), this._addFactorGradient(this._limitVelocityGradients, e, t, i), this
                    }, t.prototype.removeLimitVelocityGradient = function(e) {
                        return this._removeFactorGradient(this._limitVelocityGradients, e), this
                    }, t.prototype.addDragGradient = function(e, t, i) {
                        return this._dragGradients || (this._dragGradients = []), this._addFactorGradient(this._dragGradients, e, t, i), this
                    }, t.prototype.removeDragGradient = function(e) {
                        return this._removeFactorGradient(this._dragGradients, e), this
                    }, t.prototype.addEmitRateGradient = function(e, t, i) {
                        return this._emitRateGradients || (this._emitRateGradients = []), this._addFactorGradient(this._emitRateGradients, e, t, i), this
                    }, t.prototype.removeEmitRateGradient = function(e) {
                        return this._removeFactorGradient(this._emitRateGradients, e), this
                    }, t.prototype.addStartSizeGradient = function(e, t, i) {
                        return this._startSizeGradients || (this._startSizeGradients = []), this._addFactorGradient(this._startSizeGradients, e, t, i), this
                    }, t.prototype.removeStartSizeGradient = function(e) {
                        return this._removeFactorGradient(this._emitRateGradients, e), this
                    }, t.prototype._createRampGradientTexture = function() {
                        if (this._rampGradients && this._rampGradients.length && !this._rampGradientsTexture) {
                            for (var e = new Uint8Array(4 * this._rawTextureWidth), t = Et.Tmp.Color3[0], i = 0; i < this._rawTextureWidth; i++) {
                                var r = i / this._rawTextureWidth;
                                Et.Tools.GetCurrentGradient(r, this._rampGradients, function(r, n, o) {
                                    Et.Color3.LerpToRef(r.color, n.color, o, t), e[4 * i] = 255 * t.r, e[4 * i + 1] = 255 * t.g, e[4 * i + 2] = 255 * t.b, e[4 * i + 3] = 255
                                })
                            }
                            this._rampGradientsTexture = Et.RawTexture.CreateRGBATexture(e, this._rawTextureWidth, 1, this._scene, !1, !1, Et.Texture.NEAREST_SAMPLINGMODE)
                        }
                    }, t.prototype.getRampGradients = function() {
                        return this._rampGradients
                    }, t.prototype.addRampGradient = function(e, t) {
                        this._rampGradients || (this._rampGradients = []);
                        var i = new Et.Color3Gradient;
                        return i.gradient = e, i.color = t, this._rampGradients.push(i), this._rampGradients.sort(function(e, t) {
                            return e.gradient < t.gradient ? -1 : e.gradient > t.gradient ? 1 : 0
                        }), this._rampGradientsTexture && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), this._createRampGradientTexture(), this
                    }, t.prototype.removeRampGradient = function(e) {
                        return this._removeGradientAndTexture(e, this._rampGradients, this._rampGradientsTexture), this._rampGradientsTexture = null, this._rampGradients && 0 < this._rampGradients.length && this._createRampGradientTexture(), this
                    }, t.prototype.addColorGradient = function(e, t, i) {
                        this._colorGradients || (this._colorGradients = []);
                        var r = new Et.ColorGradient;
                        return r.gradient = e, r.color1 = t, r.color2 = i, this._colorGradients.push(r), this._colorGradients.sort(function(e, t) {
                            return e.gradient < t.gradient ? -1 : e.gradient > t.gradient ? 1 : 0
                        }), this
                    }, t.prototype.removeColorGradient = function(e) {
                        if (!this._colorGradients) return this;
                        for (var t = 0, i = 0, r = this._colorGradients; i < r.length; i++) {
                            if (r[i].gradient === e) {
                                this._colorGradients.splice(t, 1);
                                break
                            }
                            t++
                        }
                        return this
                    }, t.prototype._fetchR = function(e, t, i, r, n) {
                        return n[4 * (((e = .5 * Math.abs(e) + .5) * i % i | 0) + ((t = .5 * Math.abs(t) + .5) * r % r | 0) * i)] / 255
                    }, t.prototype._reset = function() {
                        this._resetEffect()
                    }, t.prototype._resetEffect = function() {
                        this._vertexBuffer && (this._vertexBuffer.dispose(), this._vertexBuffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._createVertexBuffers()
                    }, t.prototype._createVertexBuffers = function() {
                        this._vertexBufferSize = this._useInstancing ? 10 : 12, this._isAnimationSheetEnabled && (this._vertexBufferSize += 1), this._isBillboardBased && this.billboardMode !== t.BILLBOARDMODE_STRETCHED || (this._vertexBufferSize += 3), this._useRampGradients && (this._vertexBufferSize += 4);
                        var e = this._scene.getEngine();
                        this._vertexData = new Float32Array(this._capacity * this._vertexBufferSize * (this._useInstancing ? 1 : 4)), this._vertexBuffer = new Et.Buffer(e, this._vertexData, !0, this._vertexBufferSize);
                        var i = 0,
                            r = this._vertexBuffer.createVertexBuffer(Et.VertexBuffer.PositionKind, i, 3, this._vertexBufferSize, this._useInstancing);
                        this._vertexBuffers[Et.VertexBuffer.PositionKind] = r, i += 3;
                        var n = this._vertexBuffer.createVertexBuffer(Et.VertexBuffer.ColorKind, i, 4, this._vertexBufferSize, this._useInstancing);
                        this._vertexBuffers[Et.VertexBuffer.ColorKind] = n, i += 4;
                        var o = this._vertexBuffer.createVertexBuffer("angle", i, 1, this._vertexBufferSize, this._useInstancing);
                        this._vertexBuffers.angle = o, i += 1;
                        var s, a = this._vertexBuffer.createVertexBuffer("size", i, 2, this._vertexBufferSize, this._useInstancing);
                        if (this._vertexBuffers.size = a, i += 2, this._isAnimationSheetEnabled) {
                            var l = this._vertexBuffer.createVertexBuffer("cellIndex", i, 1, this._vertexBufferSize, this._useInstancing);
                            this._vertexBuffers.cellIndex = l, i += 1
                        }
                        if (!this._isBillboardBased || this.billboardMode === t.BILLBOARDMODE_STRETCHED) {
                            var u = this._vertexBuffer.createVertexBuffer("direction", i, 3, this._vertexBufferSize, this._useInstancing);
                            this._vertexBuffers.direction = u, i += 3
                        }
                        if (this._useRampGradients) {
                            var c = this._vertexBuffer.createVertexBuffer("remapData", i, 4, this._vertexBufferSize, this._useInstancing);
                            this._vertexBuffers.remapData = c, i += 4
                        }
                        if (this._useInstancing) {
                            var h = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);
                            this._spriteBuffer = new Et.Buffer(e, h, !1, 2), s = this._spriteBuffer.createVertexBuffer("offset", 0, 2)
                        } else s = this._vertexBuffer.createVertexBuffer("offset", i, 2, this._vertexBufferSize, this._useInstancing), i += 2;
                        this._vertexBuffers.offset = s
                    }, t.prototype._createIndexBuffer = function() {
                        if (!this._useInstancing) {
                            for (var e = [], t = 0, i = 0; i < this._capacity; i++) e.push(t), e.push(t + 1), e.push(t + 2), e.push(t), e.push(t + 2), e.push(t + 3), t += 4;
                            this._indexBuffer = this._scene.getEngine().createIndexBuffer(e)
                        }
                    }, t.prototype.getCapacity = function() {
                        return this._capacity
                    }, t.prototype.isAlive = function() {
                        return this._alive
                    }, t.prototype.isStarted = function() {
                        return this._started
                    }, t.prototype._prepareSubEmitterInternalArray = function() {
                        var e = this;
                        this._subEmitters = new Array, this.subEmitters && this.subEmitters.forEach(function(i) {
                            i instanceof t ? e._subEmitters.push([new Et.SubEmitter(i)]) : i instanceof Et.SubEmitter ? e._subEmitters.push([i]) : i instanceof Array && e._subEmitters.push(i)
                        })
                    }, t.prototype.start = function(e) {
                        var t = this;
                        if (void 0 === e && (e = this.startDelay), !this.targetStopDuration && this._hasTargetStopDurationDependantGradient()) throw "Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";
                        if (e) setTimeout(function() {
                            t.start(0)
                        }, e);
                        else {
                            if (this._prepareSubEmitterInternalArray(), this._started = !0, this._stopped = !1, this._actualFrame = 0, this._subEmitters && 0 != this._subEmitters.length && (this.activeSubSystems = new Array), this._emitRateGradients && (0 < this._emitRateGradients.length && (this._currentEmitRateGradient = this._emitRateGradients[0], this._currentEmitRate1 = this._currentEmitRateGradient.getFactor(), this._currentEmitRate2 = this._currentEmitRate1), 1 < this._emitRateGradients.length && (this._currentEmitRate2 = this._emitRateGradients[1].getFactor())), this._startSizeGradients && (0 < this._startSizeGradients.length && (this._currentStartSizeGradient = this._startSizeGradients[0], this._currentStartSize1 = this._currentStartSizeGradient.getFactor(), this._currentStartSize2 = this._currentStartSize1), 1 < this._startSizeGradients.length && (this._currentStartSize2 = this._startSizeGradients[1].getFactor())), this.preWarmCycles) {
                                this.emitter instanceof Et.AbstractMesh && this.emitter.computeWorldMatrix(!0);
                                var i = this.noiseTexture;
                                if (i && i.onGeneratedObservable) i.onGeneratedObservable.addOnce(function() {
                                    setTimeout(function() {
                                        for (var e = 0; e < t.preWarmCycles; e++) t.animate(!0), i.render()
                                    })
                                });
                                else
                                    for (var r = 0; r < this.preWarmCycles; r++) this.animate(!0)
                            }
                            this.beginAnimationOnStart && this.animations && 0 < this.animations.length && this.getScene().beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop)
                        }
                    }, t.prototype.stop = function(e) {
                        void 0 === e && (e = !0), this._stopped = !0, e && this._stopSubEmitters()
                    }, t.prototype.reset = function() {
                        this._stockParticles = [], this._particles = []
                    }, t.prototype._appendParticleVertex = function(e, i, r, n) {
                        var o = e * this._vertexBufferSize;
                        this._vertexData[o++] = i.position.x, this._vertexData[o++] = i.position.y, this._vertexData[o++] = i.position.z, this._vertexData[o++] = i.color.r, this._vertexData[o++] = i.color.g, this._vertexData[o++] = i.color.b, this._vertexData[o++] = i.color.a, this._vertexData[o++] = i.angle, this._vertexData[o++] = i.scale.x * i.size, this._vertexData[o++] = i.scale.y * i.size, this._isAnimationSheetEnabled && (this._vertexData[o++] = i.cellIndex), this._isBillboardBased ? this.billboardMode === t.BILLBOARDMODE_STRETCHED && (this._vertexData[o++] = i.direction.x, this._vertexData[o++] = i.direction.y, this._vertexData[o++] = i.direction.z) : i._initialDirection ? (this._vertexData[o++] = i._initialDirection.x, this._vertexData[o++] = i._initialDirection.y, this._vertexData[o++] = i._initialDirection.z) : (this._vertexData[o++] = i.direction.x, this._vertexData[o++] = i.direction.y, this._vertexData[o++] = i.direction.z), this._useRampGradients && (this._vertexData[o++] = i.remapData.x, this._vertexData[o++] = i.remapData.y, this._vertexData[o++] = i.remapData.z, this._vertexData[o++] = i.remapData.w), this._useInstancing || (this._isAnimationSheetEnabled && (0 === r ? r = this._epsilon : 1 === r && (r = 1 - this._epsilon), 0 === n ? n = this._epsilon : 1 === n && (n = 1 - this._epsilon)), this._vertexData[o++] = r, this._vertexData[o++] = n)
                    }, t.prototype._stopSubEmitters = function() {
                        this.activeSubSystems && (this.activeSubSystems.forEach(function(e) {
                            e.stop(!0)
                        }), this.activeSubSystems = new Array)
                    }, t.prototype._removeFromRoot = function() {
                        if (this._rootParticleSystem) {
                            var e = this._rootParticleSystem.activeSubSystems.indexOf(this); - 1 !== e && this._rootParticleSystem.activeSubSystems.splice(e, 1), this._rootParticleSystem = null
                        }
                    }, t.prototype._update = function(e) {
                        var t, i = this;
                        if (this._alive = 0 < this._particles.length, this.emitter.position) {
                            var r = this.emitter;
                            this._emitterWorldMatrix = r.getWorldMatrix()
                        } else {
                            var n = this.emitter;
                            this._emitterWorldMatrix = Et.Matrix.Translation(n.x, n.y, n.z)
                        }
                        this.updateFunction(this._particles);
                        for (var o, s = this, a = 0; a < e && "break" !== function() {
                                if (s._particles.length === s._capacity) return "break";
                                t = s._createParticle(), s._particles.push(t);
                                var e = Et.Scalar.RandomRange(s.minEmitPower, s.maxEmitPower);
                                if (s.startPositionFunction ? s.startPositionFunction(s._emitterWorldMatrix, t.position, t) : s.particleEmitterType.startPositionFunction(s._emitterWorldMatrix, t.position, t), s.startDirectionFunction ? s.startDirectionFunction(s._emitterWorldMatrix, t.direction, t) : s.particleEmitterType.startDirectionFunction(s._emitterWorldMatrix, t.direction, t), 0 === e ? t._initialDirection ? t._initialDirection.copyFrom(t.direction) : t._initialDirection = t.direction.clone() : t._initialDirection = null, t.direction.scaleInPlace(e), s.targetStopDuration && s._lifeTimeGradients && 0 < s._lifeTimeGradients.length) {
                                    var r = Et.Scalar.Clamp(s._actualFrame / s.targetStopDuration);
                                    Et.Tools.GetCurrentGradient(r, s._lifeTimeGradients, function(e, i, n) {
                                        var o = e,
                                            s = i,
                                            a = o.getFactor(),
                                            l = s.getFactor(),
                                            u = (r - o.gradient) / (s.gradient - o.gradient);
                                        t.lifeTime = Et.Scalar.Lerp(a, l, u)
                                    })
                                } else t.lifeTime = Et.Scalar.RandomRange(s.minLifeTime, s.maxLifeTime);
                                if (s._sizeGradients && 0 !== s._sizeGradients.length ? (t._currentSizeGradient = s._sizeGradients[0], t._currentSize1 = t._currentSizeGradient.getFactor(), t.size = t._currentSize1, 1 < s._sizeGradients.length ? t._currentSize2 = s._sizeGradients[1].getFactor() : t._currentSize2 = t._currentSize1) : t.size = Et.Scalar.RandomRange(s.minSize, s.maxSize), t.scale.copyFromFloats(Et.Scalar.RandomRange(s.minScaleX, s.maxScaleX), Et.Scalar.RandomRange(s.minScaleY, s.maxScaleY)), s._startSizeGradients && s._startSizeGradients[0] && s.targetStopDuration) {
                                    var n = s._actualFrame / s.targetStopDuration;
                                    Et.Tools.GetCurrentGradient(n, s._startSizeGradients, function(e, r, n) {
                                        e !== i._currentStartSizeGradient && (i._currentStartSize1 = i._currentStartSize2, i._currentStartSize2 = r.getFactor(), i._currentStartSizeGradient = e);
                                        var o = Et.Scalar.Lerp(i._currentStartSize1, i._currentStartSize2, n);
                                        t.scale.scaleInPlace(o)
                                    })
                                }
                                s._angularSpeedGradients && 0 !== s._angularSpeedGradients.length ? (t._currentAngularSpeedGradient = s._angularSpeedGradients[0], t.angularSpeed = t._currentAngularSpeedGradient.getFactor(), t._currentAngularSpeed1 = t.angularSpeed, 1 < s._angularSpeedGradients.length ? t._currentAngularSpeed2 = s._angularSpeedGradients[1].getFactor() : t._currentAngularSpeed2 = t._currentAngularSpeed1) : t.angularSpeed = Et.Scalar.RandomRange(s.minAngularSpeed, s.maxAngularSpeed), t.angle = Et.Scalar.RandomRange(s.minInitialRotation, s.maxInitialRotation), s._velocityGradients && 0 < s._velocityGradients.length && (t._currentVelocityGradient = s._velocityGradients[0], t._currentVelocity1 = t._currentVelocityGradient.getFactor(), 1 < s._velocityGradients.length ? t._currentVelocity2 = s._velocityGradients[1].getFactor() : t._currentVelocity2 = t._currentVelocity1), s._limitVelocityGradients && 0 < s._limitVelocityGradients.length && (t._currentLimitVelocityGradient = s._limitVelocityGradients[0], t._currentLimitVelocity1 = t._currentLimitVelocityGradient.getFactor(), 1 < s._limitVelocityGradients.length ? t._currentLimitVelocity2 = s._limitVelocityGradients[1].getFactor() : t._currentLimitVelocity2 = t._currentLimitVelocity1), s._dragGradients && 0 < s._dragGradients.length && (t._currentDragGradient = s._dragGradients[0], t._currentDrag1 = t._currentDragGradient.getFactor(), 1 < s._dragGradients.length ? t._currentDrag2 = s._dragGradients[1].getFactor() : t._currentDrag2 = t._currentDrag1), s._colorGradients && 0 !== s._colorGradients.length ? (t._currentColorGradient = s._colorGradients[0], t._currentColorGradient.getColorToRef(t.color), t._currentColor1.copyFrom(t.color), 1 < s._colorGradients.length ? s._colorGradients[1].getColorToRef(t._currentColor2) : t._currentColor2.copyFrom(t.color)) : (o = Et.Scalar.RandomRange(0, 1), Et.Color4.LerpToRef(s.color1, s.color2, o, t.color), s.colorDead.subtractToRef(t.color, s._colorDiff), s._colorDiff.scaleToRef(1 / t.lifeTime, t.colorStep)), s._isAnimationSheetEnabled && (t._initialStartSpriteCellID = s.startSpriteCellID, t._initialEndSpriteCellID = s.endSpriteCellID), t.direction.addInPlace(s._inheritedVelocityOffset), s._useRampGradients && (t.remapData = new Et.Vector4(0, 1, 0, 1)), s.noiseTexture && (t._randomNoiseCoordinates1 ? (t._randomNoiseCoordinates1.copyFromFloats(Math.random(), Math.random(), Math.random()), t._randomNoiseCoordinates2.copyFromFloats(Math.random(), Math.random(), Math.random())) : (t._randomNoiseCoordinates1 = new Et.Vector3(Math.random(), Math.random(), Math.random()), t._randomNoiseCoordinates2 = new Et.Vector3(Math.random(), Math.random(), Math.random()))), t._inheritParticleInfoToSubEmitters()
                            }(); a++);
                    }, t._GetAttributeNamesOrOptions = function(e, t, i) {
                        void 0 === e && (e = !1), void 0 === t && (t = !1), void 0 === i && (i = !1);
                        var r = [Et.VertexBuffer.PositionKind, Et.VertexBuffer.ColorKind, "angle", "offset", "size"];
                        return e && r.push("cellIndex"), t || r.push("direction"), i && r.push("remapData"), r
                    }, t._GetEffectCreationOptions = function(e) {
                        void 0 === e && (e = !1);
                        var t = ["invView", "view", "projection", "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "textureMask", "translationPivot", "eyePosition"];
                        return e && t.push("particlesInfos"), t
                    }, t.prototype._getEffect = function(e) {
                        if (this._customEffect) return this._customEffect;
                        var i = [];
                        if (this._scene.clipPlane && i.push("#define CLIPPLANE"), this._scene.clipPlane2 && i.push("#define CLIPPLANE2"), this._scene.clipPlane3 && i.push("#define CLIPPLANE3"), this._scene.clipPlane4 && i.push("#define CLIPPLANE4"), this._isAnimationSheetEnabled && i.push("#define ANIMATESHEET"), e === t.BLENDMODE_MULTIPLY && i.push("#define BLENDMULTIPLYMODE"), this._useRampGradients && i.push("#define RAMPGRADIENT"), this._isBillboardBased) switch (i.push("#define BILLBOARD"), this.billboardMode) {
                            case t.BILLBOARDMODE_Y:
                                i.push("#define BILLBOARDY");
                                break;
                            case t.BILLBOARDMODE_STRETCHED:
                                i.push("#define BILLBOARDSTRETCHED")
                        }
                        this._imageProcessingConfiguration && (this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines),
                            i.push(this._imageProcessingConfigurationDefines.toString()));
                        var r = i.join("\n");
                        if (this._cachedDefines !== r) {
                            this._cachedDefines = r;
                            var n = t._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled, this._isBillboardBased && this.billboardMode !== t.BILLBOARDMODE_STRETCHED, this._useRampGradients),
                                o = t._GetEffectCreationOptions(this._isAnimationSheetEnabled),
                                s = ["diffuseSampler", "rampSampler"];
                            Et.ImageProcessingConfiguration && (Et.ImageProcessingConfiguration.PrepareUniforms(o, this._imageProcessingConfigurationDefines), Et.ImageProcessingConfiguration.PrepareSamplers(s, this._imageProcessingConfigurationDefines)), this._effect = this._scene.getEngine().createEffect("particles", n, o, s, r)
                        }
                        return this._effect
                    }, t.prototype.animate = function(e) {
                        var t = this;
                        if (void 0 === e && (e = !1), this._started) {
                            if (!e) {
                                if (!this.isReady()) return;
                                if (this._currentRenderId === this._scene.getRenderId()) return;
                                this._currentRenderId = this._scene.getRenderId()
                            }
                            var i;
                            if (this._scaledUpdateSpeed = this.updateSpeed * (e ? this.preWarmStepOffset : this._scene.getAnimationRatio()), -1 < this.manualEmitCount) i = this.manualEmitCount, this._newPartsExcess = 0, this.manualEmitCount = 0;
                            else {
                                var r = this.emitRate;
                                if (this._emitRateGradients && 0 < this._emitRateGradients.length && this.targetStopDuration) {
                                    var n = this._actualFrame / this.targetStopDuration;
                                    Et.Tools.GetCurrentGradient(n, this._emitRateGradients, function(e, i, n) {
                                        e !== t._currentEmitRateGradient && (t._currentEmitRate1 = t._currentEmitRate2, t._currentEmitRate2 = i.getFactor(), t._currentEmitRateGradient = e), r = Et.Scalar.Lerp(t._currentEmitRate1, t._currentEmitRate2, n)
                                    })
                                }
                                i = r * this._scaledUpdateSpeed >> 0, this._newPartsExcess += r * this._scaledUpdateSpeed - i
                            }
                            if (1 < this._newPartsExcess && (i += this._newPartsExcess >> 0, this._newPartsExcess -= this._newPartsExcess >> 0), this._alive = !1, this._stopped ? i = 0 : (this._actualFrame += this._scaledUpdateSpeed, this.targetStopDuration && this._actualFrame >= this.targetStopDuration && this.stop()), this._update(i), this._stopped && (this._alive || (this._started = !1, this.onAnimationEnd && this.onAnimationEnd(), this.disposeOnStop && this._scene._toBeDisposed.push(this))), !e) {
                                for (var o = 0, s = 0; s < this._particles.length; s++) {
                                    var a = this._particles[s];
                                    this._appendParticleVertices(o, a), o += this._useInstancing ? 1 : 4
                                }
                                this._vertexBuffer && this._vertexBuffer.update(this._vertexData)
                            }
                            0 === this.manualEmitCount && this.disposeOnStop && this.stop()
                        }
                    }, t.prototype._appendParticleVertices = function(e, t) {
                        this._appendParticleVertex(e++, t, 0, 0), this._useInstancing || (this._appendParticleVertex(e++, t, 1, 0), this._appendParticleVertex(e++, t, 1, 1), this._appendParticleVertex(e++, t, 0, 1))
                    }, t.prototype.rebuild = function() {
                        this._createIndexBuffer(), this._vertexBuffer && this._vertexBuffer._rebuild()
                    }, t.prototype.isReady = function() {
                        if (!(this.emitter && this._imageProcessingConfiguration.isReady() && this.particleTexture && this.particleTexture.isReady())) return !1;
                        if (this.blendMode !== t.BLENDMODE_MULTIPLYADD) {
                            if (!this._getEffect(this.blendMode).isReady()) return !1
                        } else {
                            if (!this._getEffect(t.BLENDMODE_MULTIPLY).isReady()) return !1;
                            if (!this._getEffect(t.BLENDMODE_ADD).isReady()) return !1
                        }
                        return !0
                    }, t.prototype._render = function(e) {
                        var i = this._getEffect(e),
                            r = this._scene.getEngine();
                        r.enableEffect(i);
                        var n = this._scene.getViewMatrix();
                        if (i.setTexture("diffuseSampler", this.particleTexture), i.setMatrix("view", n), i.setMatrix("projection", this._scene.getProjectionMatrix()), this._isAnimationSheetEnabled && this.particleTexture) {
                            var o = this.particleTexture.getBaseSize();
                            i.setFloat3("particlesInfos", this.spriteCellWidth / o.width, this.spriteCellHeight / o.height, o.width / this.spriteCellWidth)
                        }
                        if (i.setVector2("translationPivot", this.translationPivot), i.setFloat4("textureMask", this.textureMask.r, this.textureMask.g, this.textureMask.b, this.textureMask.a), this._isBillboardBased) {
                            var s = this._scene.activeCamera;
                            i.setVector3("eyePosition", s.globalPosition)
                        }
                        if (this._rampGradientsTexture && i.setTexture("rampSampler", this._rampGradientsTexture), this._scene.clipPlane || this._scene.clipPlane2 || this._scene.clipPlane3 || this._scene.clipPlane4) {
                            var a = n.clone();
                            a.invert(), i.setMatrix("invView", a), Et.MaterialHelper.BindClipPlane(i, this._scene)
                        }
                        switch (r.bindBuffers(this._vertexBuffers, this._indexBuffer, i), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(i), e) {
                            case t.BLENDMODE_ADD:
                                r.setAlphaMode(Et.Engine.ALPHA_ADD);
                                break;
                            case t.BLENDMODE_ONEONE:
                                r.setAlphaMode(Et.Engine.ALPHA_ONEONE);
                                break;
                            case t.BLENDMODE_STANDARD:
                                r.setAlphaMode(Et.Engine.ALPHA_COMBINE);
                                break;
                            case t.BLENDMODE_MULTIPLY:
                                r.setAlphaMode(Et.Engine.ALPHA_MULTIPLY)
                        }
                        return this._useInstancing ? r.drawArraysType(Et.Material.TriangleFanDrawMode, 0, 4, this._particles.length) : r.drawElementsType(Et.Material.TriangleFillMode, 0, 6 * this._particles.length), this._particles.length
                    }, t.prototype.render = function() {
                        if (!this.isReady() || !this._particles.length) return 0;
                        var e = this._scene.getEngine();
                        e.setState(!1), this.forceDepthWrite && e.setDepthWrite(!0);
                        var i = 0;
                        return this.blendMode === t.BLENDMODE_MULTIPLYADD && (i = this._render(t.BLENDMODE_MULTIPLY) + this._render(t.BLENDMODE_ADD)), i = this._render(this.blendMode), e.unbindInstanceAttributes(), e.setAlphaMode(Et.Engine.ALPHA_DISABLE), i
                    }, t.prototype.dispose = function(e) {
                        if (void 0 === e && (e = !0), this._vertexBuffer && (this._vertexBuffer.dispose(), this._vertexBuffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null), e && this.particleTexture && (this.particleTexture.dispose(), this.particleTexture = null), e && this.noiseTexture && (this.noiseTexture.dispose(), this.noiseTexture = null), this._rampGradientsTexture && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), this._removeFromRoot(), this._subEmitters && this._subEmitters.length) {
                            for (var t = 0; t < this._subEmitters.length; t++)
                                for (var i = 0, r = this._subEmitters[t]; i < r.length; i++) r[i].dispose();
                            this._subEmitters = [], this.subEmitters = []
                        }
                        this._disposeEmitterOnDispose && this.emitter && this.emitter.dispose && this.emitter.dispose(!0), -1 < (t = this._scene.particleSystems.indexOf(this)) && this._scene.particleSystems.splice(t, 1), this._scene._activeParticleSystems.dispose(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.reset()
                    }, t.prototype.clone = function(e, i) {
                        var r = null,
                            n = null;
                        if (null != this.customShader) {
                            var o = 0 < (n = this.customShader).shaderOptions.defines.length ? n.shaderOptions.defines.join("\n") : "";
                            r = this._scene.getEngine().createEffectForParticles(n.shaderPath.fragmentElement, n.shaderOptions.uniforms, n.shaderOptions.samplers, o)
                        } else this._customEffect && (r = this._customEffect);
                        var s = new t(e, this._capacity, this._scene, r);
                        return s.customShader = n, Et.Tools.DeepCopy(this, s, ["particles", "customShader", "noiseTexture"]), void 0 === i && (i = this.emitter), s.noiseTexture = this.noiseTexture, s.emitter = i, this.particleTexture && (s.particleTexture = new Et.Texture(this.particleTexture.url, this._scene)), this._colorGradients && this._colorGradients.forEach(function(e) {
                            s.addColorGradient(e.gradient, e.color1, e.color2)
                        }), this._dragGradients && this._dragGradients.forEach(function(e) {
                            s.addDragGradient(e.gradient, e.factor1, e.factor2)
                        }), this._angularSpeedGradients && this._angularSpeedGradients.forEach(function(e) {
                            s.addAngularSpeedGradient(e.gradient, e.factor1, e.factor2)
                        }), this._emitRateGradients && this._emitRateGradients.forEach(function(e) {
                            s.addEmitRateGradient(e.gradient, e.factor1, e.factor2)
                        }), this._lifeTimeGradients && this._lifeTimeGradients.forEach(function(e) {
                            s.addLifeTimeGradient(e.gradient, e.factor1, e.factor2)
                        }), this._limitVelocityGradients && this._limitVelocityGradients.forEach(function(e) {
                            s.addLimitVelocityGradient(e.gradient, e.factor1, e.factor2)
                        }), this._sizeGradients && this._sizeGradients.forEach(function(e) {
                            s.addSizeGradient(e.gradient, e.factor1, e.factor2)
                        }), this._startSizeGradients && this._startSizeGradients.forEach(function(e) {
                            s.addStartSizeGradient(e.gradient, e.factor1, e.factor2)
                        }), this._velocityGradients && this._velocityGradients.forEach(function(e) {
                            s.addVelocityGradient(e.gradient, e.factor1, e.factor2)
                        }), this._rampGradients && this._rampGradients.forEach(function(e) {
                            s.addRampGradient(e.gradient, e.color)
                        }), this._colorRemapGradients && this._colorRemapGradients.forEach(function(e) {
                            s.addColorRemapGradient(e.gradient, e.factor1, e.factor2)
                        }), this._alphaRemapGradients && this._alphaRemapGradients.forEach(function(e) {
                            s.addAlphaRemapGradient(e.gradient, e.factor1, e.factor2)
                        }), this.preventAutoStart || s.start(), s
                    }, t.prototype.serialize = function() {
                        var e = {};
                        if (t._Serialize(e, this), e.textureMask = this.textureMask.asArray(), e.customShader = this.customShader, e.preventAutoStart = this.preventAutoStart, this.subEmitters) {
                            e.subEmitters = [], this._subEmitters || this._prepareSubEmitterInternalArray();
                            for (var i = 0, r = this._subEmitters; i < r.length; i++) {
                                for (var n = [], o = 0, s = r[i]; o < s.length; o++) {
                                    var a = s[o];
                                    n.push(a.serialize())
                                }
                                e.subEmitters.push(n)
                            }
                        }
                        return e
                    }, t._Serialize = function(e, t) {
                        if (e.name = t.name, e.id = t.id, e.capacity = t.getCapacity(), t.emitter.position) {
                            var i = t.emitter;
                            e.emitterId = i.id
                        } else {
                            var r = t.emitter;
                            e.emitter = r.asArray()
                        }
                        t.particleEmitterType && (e.particleEmitterType = t.particleEmitterType.serialize()), t.particleTexture && (e.textureName = t.particleTexture.name, e.invertY = t.particleTexture._invertY), Et.Animation.AppendSerializedAnimations(t, e), e.beginAnimationOnStart = t.beginAnimationOnStart, e.beginAnimationFrom = t.beginAnimationFrom, e.beginAnimationTo = t.beginAnimationTo, e.beginAnimationLoop = t.beginAnimationLoop, e.startDelay = t.startDelay, e.renderingGroupId = t.renderingGroupId, e.isBillboardBased = t.isBillboardBased, e.billboardMode = t.billboardMode, e.minAngularSpeed = t.minAngularSpeed, e.maxAngularSpeed = t.maxAngularSpeed, e.minSize = t.minSize, e.maxSize = t.maxSize, e.minScaleX = t.minScaleX, e.maxScaleX = t.maxScaleX, e.minScaleY = t.minScaleY, e.maxScaleY = t.maxScaleY, e.minEmitPower = t.minEmitPower, e.maxEmitPower = t.maxEmitPower, e.minLifeTime = t.minLifeTime, e.maxLifeTime = t.maxLifeTime, e.emitRate = t.emitRate, e.gravity = t.gravity.asArray(), e.noiseStrength = t.noiseStrength.asArray(), e.color1 = t.color1.asArray(), e.color2 = t.color2.asArray(), e.colorDead = t.colorDead.asArray(), e.updateSpeed = t.updateSpeed, e.targetStopDuration = t.targetStopDuration, e.blendMode = t.blendMode, e.preWarmCycles = t.preWarmCycles, e.preWarmStepOffset = t.preWarmStepOffset, e.minInitialRotation = t.minInitialRotation, e.maxInitialRotation = t.maxInitialRotation, e.startSpriteCellID = t.startSpriteCellID, e.endSpriteCellID = t.endSpriteCellID, e.spriteCellChangeSpeed = t.spriteCellChangeSpeed, e.spriteCellWidth = t.spriteCellWidth, e.spriteCellHeight = t.spriteCellHeight, e.spriteRandomStartCell = t.spriteRandomStartCell, e.isAnimationSheetEnabled = t.isAnimationSheetEnabled;
                        var n = t.getColorGradients();
                        if (n) {
                            e.colorGradients = [];
                            for (var o = 0, s = n; o < s.length; o++) {
                                var a = s[o],
                                    l = {
                                        gradient: a.gradient,
                                        color1: a.color1.asArray()
                                    };
                                a.color2 && (l.color2 = a.color2.asArray()), e.colorGradients.push(l)
                            }
                        }
                        var u = t.getRampGradients();
                        if (u) {
                            e.rampGradients = [];
                            for (var c = 0, h = u; c < h.length; c++) {
                                var d = h[c];
                                l = {
                                    gradient: d.gradient,
                                    color: d.color.asArray()
                                }, e.rampGradients.push(l)
                            }
                            e.useRampGradients = t.useRampGradients
                        }
                        var p = t.getColorRemapGradients();
                        if (p) {
                            e.colorRemapGradients = [];
                            for (var f = 0, _ = p; f < _.length; f++) {
                                var m = _[f];
                                l = {
                                    gradient: m.gradient,
                                    factor1: m.factor1
                                }, void 0 !== m.factor2 && (l.factor2 = m.factor2), e.colorRemapGradients.push(l)
                            }
                        }
                        var g = t.getAlphaRemapGradients();
                        if (g) {
                            e.alphaRemapGradients = [];
                            for (var v = 0, y = g; v < y.length; v++) {
                                var b = y[v];
                                l = {
                                    gradient: b.gradient,
                                    factor1: b.factor1
                                }, void 0 !== b.factor2 && (l.factor2 = b.factor2), e.alphaRemapGradients.push(l)
                            }
                        }
                        var x = t.getSizeGradients();
                        if (x) {
                            e.sizeGradients = [];
                            for (var T = 0, E = x; T < E.length; T++) {
                                var S = E[T];
                                l = {
                                    gradient: S.gradient,
                                    factor1: S.factor1
                                }, void 0 !== S.factor2 && (l.factor2 = S.factor2), e.sizeGradients.push(l)
                            }
                        }
                        var P = t.getAngularSpeedGradients();
                        if (P) {
                            e.angularSpeedGradients = [];
                            for (var A = 0, C = P; A < C.length; A++) {
                                var M = C[A];
                                l = {
                                    gradient: M.gradient,
                                    factor1: M.factor1
                                }, void 0 !== M.factor2 && (l.factor2 = M.factor2), e.angularSpeedGradients.push(l)
                            }
                        }
                        var R = t.getVelocityGradients();
                        if (R) {
                            e.velocityGradients = [];
                            for (var O = 0, w = R; O < w.length; O++) {
                                var I = w[O];
                                l = {
                                    gradient: I.gradient,
                                    factor1: I.factor1
                                }, void 0 !== I.factor2 && (l.factor2 = I.factor2), e.velocityGradients.push(l)
                            }
                        }
                        var D = t.getDragGradients();
                        if (D) {
                            e.dragyGradients = [];
                            for (var L = 0, B = D; L < B.length; L++) {
                                var F = B[L];
                                l = {
                                    gradient: F.gradient,
                                    factor1: F.factor1
                                }, void 0 !== F.factor2 && (l.factor2 = F.factor2), e.dragGradients.push(l)
                            }
                        }
                        var N = t.getEmitRateGradients();
                        if (N) {
                            e.emitRateGradients = [];
                            for (var V = 0, k = N; V < k.length; V++) {
                                var U = k[V];
                                l = {
                                    gradient: U.gradient,
                                    factor1: U.factor1
                                }, void 0 !== U.factor2 && (l.factor2 = U.factor2), e.emitRateGradients.push(l)
                            }
                        }
                        var G = t.getStartSizeGradients();
                        if (G) {
                            e.startSizeGradients = [];
                            for (var z = 0, j = G; z < j.length; z++) {
                                var H = j[z];
                                l = {
                                    gradient: H.gradient,
                                    factor1: H.factor1
                                }, void 0 !== H.factor2 && (l.factor2 = H.factor2), e.startSizeGradients.push(l)
                            }
                        }
                        var W = t.getLifeTimeGradients();
                        if (W) {
                            e.lifeTimeGradients = [];
                            for (var X = 0, Y = W; X < Y.length; X++) {
                                var q = Y[X];
                                l = {
                                    gradient: q.gradient,
                                    factor1: q.factor1
                                }, void 0 !== q.factor2 && (l.factor2 = q.factor2), e.lifeTimeGradients.push(l)
                            }
                        }
                        var K = t.getLimitVelocityGradients();
                        if (K) {
                            e.limitVelocityGradients = [];
                            for (var Q = 0, Z = K; Q < Z.length; Q++) {
                                var J = Z[Q];
                                l = {
                                    gradient: J.gradient,
                                    factor1: J.factor1
                                }, void 0 !== J.factor2 && (l.factor2 = J.factor2), e.limitVelocityGradients.push(l)
                            }
                            e.limitVelocityDamping = t.limitVelocityDamping
                        }
                        t.noiseTexture && (e.noiseTexture = t.noiseTexture.serialize())
                    }, t._Parse = function(e, t, i, r) {
                        if (e.textureName && (t.particleTexture = new Et.Texture(r + e.textureName, i, !1, void 0 === e.invertY || e.invertY), t.particleTexture.name = e.textureName), e.emitterId || 0 === e.emitterId || void 0 !== e.emitter ? e.emitterId ? t.emitter = i.getLastMeshByID(e.emitterId) : t.emitter = Et.Vector3.FromArray(e.emitter) : t.emitter = Et.Vector3.Zero(), void 0 !== e.renderingGroupId && (t.renderingGroupId = e.renderingGroupId), void 0 !== e.isBillboardBased && (t.isBillboardBased = e.isBillboardBased), void 0 !== e.billboardMode && (t.billboardMode = e.billboardMode), e.animations) {
                            for (var n = 0; n < e.animations.length; n++) {
                                var o = e.animations[n];
                                t.animations.push(Et.Animation.Parse(o))
                            }
                            t.beginAnimationOnStart = e.beginAnimationOnStart, t.beginAnimationFrom = e.beginAnimationFrom, t.beginAnimationTo = e.beginAnimationTo, t.beginAnimationLoop = e.beginAnimationLoop
                        }
                        if (e.autoAnimate && i.beginAnimation(t, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1), t.startDelay = 0 | e.startDelay, t.minAngularSpeed = e.minAngularSpeed, t.maxAngularSpeed = e.maxAngularSpeed, t.minSize = e.minSize, t.maxSize = e.maxSize, e.minScaleX && (t.minScaleX = e.minScaleX, t.maxScaleX = e.maxScaleX, t.minScaleY = e.minScaleY, t.maxScaleY = e.maxScaleY), void 0 !== e.preWarmCycles && (t.preWarmCycles = e.preWarmCycles, t.preWarmStepOffset = e.preWarmStepOffset), void 0 !== e.minInitialRotation && (t.minInitialRotation = e.minInitialRotation, t.maxInitialRotation = e.maxInitialRotation), t.minLifeTime = e.minLifeTime, t.maxLifeTime = e.maxLifeTime, t.minEmitPower = e.minEmitPower, t.maxEmitPower = e.maxEmitPower, t.emitRate = e.emitRate, t.gravity = Et.Vector3.FromArray(e.gravity), e.noiseStrength && (t.noiseStrength = Et.Vector3.FromArray(e.noiseStrength)), t.color1 = Et.Color4.FromArray(e.color1), t.color2 = Et.Color4.FromArray(e.color2), t.colorDead = Et.Color4.FromArray(e.colorDead), t.updateSpeed = e.updateSpeed, t.targetStopDuration = e.targetStopDuration, t.blendMode = e.blendMode, e.colorGradients)
                            for (var s = 0, a = e.colorGradients; s < a.length; s++) {
                                var l = a[s];
                                t.addColorGradient(l.gradient, Et.Color4.FromArray(l.color1), l.color2 ? Et.Color4.FromArray(l.color2) : void 0)
                            }
                        if (e.rampGradients) {
                            for (var u = 0, c = e.rampGradients; u < c.length; u++) {
                                var h = c[u];
                                t.addRampGradient(h.gradient, Et.Color3.FromArray(h.color))
                            }
                            t.useRampGradients = e.useRampGradients
                        }
                        if (e.colorRemapGradients)
                            for (var d = 0, p = e.colorRemapGradients; d < p.length; d++) {
                                var f = p[d];
                                t.addColorRemapGradient(f.gradient, void 0 !== f.factor1 ? f.factor1 : f.factor, f.factor2)
                            }
                        if (e.alphaRemapGradients)
                            for (var _ = 0, m = e.alphaRemapGradients; _ < m.length; _++) {
                                var g = m[_];
                                t.addAlphaRemapGradient(g.gradient, void 0 !== g.factor1 ? g.factor1 : g.factor, g.factor2)
                            }
                        if (e.sizeGradients)
                            for (var v = 0, y = e.sizeGradients; v < y.length; v++) {
                                var b = y[v];
                                t.addSizeGradient(b.gradient, void 0 !== b.factor1 ? b.factor1 : b.factor, b.factor2)
                            }
                        if (e.sizeGradients)
                            for (var x = 0, T = e.sizeGradients; x < T.length; x++) b = T[x], t.addSizeGradient(b.gradient, void 0 !== b.factor1 ? b.factor1 : b.factor, b.factor2);
                        if (e.angularSpeedGradients)
                            for (var E = 0, S = e.angularSpeedGradients; E < S.length; E++) {
                                var P = S[E];
                                t.addAngularSpeedGradient(P.gradient, void 0 !== P.factor1 ? P.factor1 : P.factor, P.factor2)
                            }
                        if (e.velocityGradients)
                            for (var A = 0, C = e.velocityGradients; A < C.length; A++) {
                                var M = C[A];
                                t.addVelocityGradient(M.gradient, void 0 !== M.factor1 ? M.factor1 : M.factor, M.factor2)
                            }
                        if (e.dragGradients)
                            for (var R = 0, O = e.dragGradients; R < O.length; R++) {
                                var w = O[R];
                                t.addDragGradient(w.gradient, void 0 !== w.factor1 ? w.factor1 : w.factor, w.factor2)
                            }
                        if (e.emitRateGradients)
                            for (var I = 0, D = e.emitRateGradients; I < D.length; I++) {
                                var L = D[I];
                                t.addEmitRateGradient(L.gradient, void 0 !== L.factor1 ? L.factor1 : L.factor, L.factor2)
                            }
                        if (e.startSizeGradients)
                            for (var B = 0, F = e.startSizeGradients; B < F.length; B++) {
                                var N = F[B];
                                t.addStartSizeGradient(N.gradient, void 0 !== N.factor1 ? N.factor1 : N.factor, N.factor2)
                            }
                        if (e.lifeTimeGradients)
                            for (var V = 0, k = e.lifeTimeGradients; V < k.length; V++) {
                                var U = k[V];
                                t.addLifeTimeGradient(U.gradient, void 0 !== U.factor1 ? U.factor1 : U.factor, U.factor2)
                            }
                        if (e.limitVelocityGradients) {
                            for (var G = 0, z = e.limitVelocityGradients; G < z.length; G++) {
                                var j = z[G];
                                t.addLimitVelocityGradient(j.gradient, void 0 !== j.factor1 ? j.factor1 : j.factor, j.factor2)
                            }
                            t.limitVelocityDamping = e.limitVelocityDamping
                        }
                        var H;
                        if (e.noiseTexture && (t.noiseTexture = Et.ProceduralTexture.Parse(e.noiseTexture, i, r)), e.particleEmitterType) {
                            switch (e.particleEmitterType.type) {
                                case "SphereParticleEmitter":
                                    H = new Et.SphereParticleEmitter;
                                    break;
                                case "SphereDirectedParticleEmitter":
                                    H = new Et.SphereDirectedParticleEmitter;
                                    break;
                                case "ConeEmitter":
                                case "ConeParticleEmitter":
                                    H = new Et.ConeParticleEmitter;
                                    break;
                                case "CylinderParticleEmitter":
                                    H = new Et.CylinderParticleEmitter;
                                    break;
                                case "HemisphericParticleEmitter":
                                    H = new Et.HemisphericParticleEmitter;
                                    break;
                                case "BoxEmitter":
                                case "BoxParticleEmitter":
                                default:
                                    H = new Et.BoxParticleEmitter
                            }
                            H.parse(e.particleEmitterType)
                        } else(H = new Et.BoxParticleEmitter).parse(e);
                        t.particleEmitterType = H, t.startSpriteCellID = e.startSpriteCellID, t.endSpriteCellID = e.endSpriteCellID, t.spriteCellWidth = e.spriteCellWidth, t.spriteCellHeight = e.spriteCellHeight, t.spriteCellChangeSpeed = e.spriteCellChangeSpeed, t.spriteRandomStartCell = e.spriteRandomStartCell
                    }, t.Parse = function(e, i, r, n) {
                        void 0 === n && (n = !1);
                        var o = e.name,
                            s = null,
                            a = null;
                        if (e.customShader) {
                            var l = 0 < (a = e.customShader).shaderOptions.defines.length ? a.shaderOptions.defines.join("\n") : "";
                            s = i.getEngine().createEffectForParticles(a.shaderPath.fragmentElement, a.shaderOptions.uniforms, a.shaderOptions.samplers, l)
                        }
                        var u = new t(o, e.capacity, i, s, e.isAnimationSheetEnabled);
                        if (u.customShader = a, e.id && (u.id = e.id), e.subEmitters) {
                            u.subEmitters = [];
                            for (var c = 0, h = e.subEmitters; c < h.length; c++) {
                                for (var d = [], p = 0, f = h[c]; p < f.length; p++) {
                                    var _ = f[p];
                                    d.push(Et.SubEmitter.Parse(_, i, r))
                                }
                                u.subEmitters.push(d)
                            }
                        }
                        return t._Parse(e, u, i, r), u.textureMask = Et.Color4.FromArray(e.textureMask), e.preventAutoStart && (u.preventAutoStart = e.preventAutoStart), n || u.preventAutoStart || u.start(), u
                    }, t.BILLBOARDMODE_Y = 2, t.BILLBOARDMODE_ALL = 7, t.BILLBOARDMODE_STRETCHED = 8, t
                }(Et.BaseParticleSystem), Et.ParticleSystem = St, Pt = $a || ($a = {}), At = function() {
                    function e() {
                        this.direction1 = new Pt.Vector3(0, 1, 0), this.direction2 = new Pt.Vector3(0, 1, 0), this.minEmitBox = new Pt.Vector3(-.5, -.5, -.5), this.maxEmitBox = new Pt.Vector3(.5, .5, .5)
                    }
                    return e.prototype.startDirectionFunction = function(e, t, i) {
                        var r = Pt.Scalar.RandomRange(this.direction1.x, this.direction2.x),
                            n = Pt.Scalar.RandomRange(this.direction1.y, this.direction2.y),
                            o = Pt.Scalar.RandomRange(this.direction1.z, this.direction2.z);
                        Pt.Vector3.TransformNormalFromFloatsToRef(r, n, o, e, t)
                    }, e.prototype.startPositionFunction = function(e, t, i) {
                        var r = Pt.Scalar.RandomRange(this.minEmitBox.x, this.maxEmitBox.x),
                            n = Pt.Scalar.RandomRange(this.minEmitBox.y, this.maxEmitBox.y),
                            o = Pt.Scalar.RandomRange(this.minEmitBox.z, this.maxEmitBox.z);
                        Pt.Vector3.TransformCoordinatesFromFloatsToRef(r, n, o, e, t)
                    }, e.prototype.clone = function() {
                        var t = new e;
                        return Pt.Tools.DeepCopy(this, t), t
                    }, e.prototype.applyToShader = function(e) {
                        e.setVector3("direction1", this.direction1), e.setVector3("direction2", this.direction2), e.setVector3("minEmitBox", this.minEmitBox), e.setVector3("maxEmitBox", this.maxEmitBox)
                    }, e.prototype.getEffectDefines = function() {
                        return "#define BOXEMITTER"
                    }, e.prototype.getClassName = function() {
                        return "BoxParticleEmitter"
                    }, e.prototype.serialize = function() {
                        var e = {};
                        return e.type = this.getClassName(), e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e.minEmitBox = this.minEmitBox.asArray(), e.maxEmitBox = this.maxEmitBox.asArray(), e
                    }, e.prototype.parse = function(e) {
                        Pt.Vector3.FromArrayToRef(e.direction1, 0, this.direction1), Pt.Vector3.FromArrayToRef(e.direction2, 0, this.direction2), Pt.Vector3.FromArrayToRef(e.minEmitBox, 0, this.minEmitBox), Pt.Vector3.FromArrayToRef(e.maxEmitBox, 0, this.maxEmitBox)
                    }, e
                }(), Pt.BoxParticleEmitter = At, Ct = $a || ($a = {}), Mt = function() {
                    function e(e, t, i, r) {
                        void 0 === e && (e = 1), void 0 === t && (t = 1), void 0 === i && (i = 1), void 0 === r && (r = 0), this.radius = e, this.height = t, this.radiusRange = i, this.directionRandomizer = r
                    }
                    return e.prototype.startDirectionFunction = function(e, t, i) {
                        var r = i.position.subtract(e.getTranslation()).normalize(),
                            n = Ct.Scalar.RandomRange(-this.directionRandomizer / 2, this.directionRandomizer / 2),
                            o = Math.atan2(r.x, r.z);
                        o += Ct.Scalar.RandomRange(-Math.PI / 2, Math.PI / 2) * this.directionRandomizer, r.y = n, r.x = Math.sin(o), r.z = Math.cos(o), r.normalize(), Ct.Vector3.TransformNormalFromFloatsToRef(r.x, r.y, r.z, e, t)
                    }, e.prototype.startPositionFunction = function(e, t, i) {
                        var r = Ct.Scalar.RandomRange(-this.height / 2, this.height / 2),
                            n = Ct.Scalar.RandomRange(0, 2 * Math.PI),
                            o = Ct.Scalar.RandomRange((1 - this.radiusRange) * (1 - this.radiusRange), 1),
                            s = Math.sqrt(o) * this.radius,
                            a = s * Math.cos(n),
                            l = s * Math.sin(n);
                        Ct.Vector3.TransformCoordinatesFromFloatsToRef(a, r, l, e, t)
                    }, e.prototype.clone = function() {
                        var t = new e(this.radius, this.directionRandomizer);
                        return Ct.Tools.DeepCopy(this, t), t
                    }, e.prototype.applyToShader = function(e) {
                        e.setFloat("radius", this.radius), e.setFloat("height", this.height), e.setFloat("radiusRange", this.radiusRange), e.setFloat("directionRandomizer", this.directionRandomizer)
                    }, e.prototype.getEffectDefines = function() {
                        return "#define CYLINDEREMITTER"
                    }, e.prototype.getClassName = function() {
                        return "CylinderParticleEmitter"
                    }, e.prototype.serialize = function() {
                        var e = {};
                        return e.type = this.getClassName(), e.radius = this.radius, e.height = this.height, e.radiusRange = this.radiusRange, e.directionRandomizer = this.directionRandomizer, e
                    }, e.prototype.parse = function(e) {
                        this.radius = e.radius, this.height = e.height, this.radiusRange = e.radiusRange, this.directionRandomizer = e.directionRandomizer
                    }, e
                }(), Rt = function(e) {
                    function t(t, i, r, n, o) {
                        void 0 === t && (t = 1), void 0 === i && (i = 1), void 0 === r && (r = 1), void 0 === n && (n = new Ct.Vector3(0, 1, 0)), void 0 === o && (o = new Ct.Vector3(0, 1, 0));
                        var s = e.call(this, t, i, r) || this;
                        return s.direction1 = n, s.direction2 = o, s
                    }
                    return b(t, e), t.prototype.startDirectionFunction = function(e, t, i) {
                        var r = Ct.Scalar.RandomRange(this.direction1.x, this.direction2.x),
                            n = Ct.Scalar.RandomRange(this.direction1.y, this.direction2.y),
                            o = Ct.Scalar.RandomRange(this.direction1.z, this.direction2.z);
                        Ct.Vector3.TransformNormalFromFloatsToRef(r, n, o, e, t)
                    }, t.prototype.clone = function() {
                        var e = new t(this.radius, this.height, this.radiusRange, this.direction1, this.direction2);
                        return Ct.Tools.DeepCopy(this, e), e
                    }, t.prototype.applyToShader = function(e) {
                        e.setFloat("radius", this.radius), e.setFloat("height", this.height), e.setFloat("radiusRange", this.radiusRange), e.setVector3("direction1", this.direction1), e.setVector3("direction2", this.direction2)
                    }, t.prototype.getEffectDefines = function() {
                        return "#define CYLINDEREMITTER\n#define DIRECTEDCYLINDEREMITTER"
                    }, t.prototype.getClassName = function() {
                        return "CylinderDirectedParticleEmitter"
                    }, t.prototype.serialize = function() {
                        var t = e.prototype.serialize.call(this);
                        return t.direction1 = this.direction1.asArray(), t.direction2 = this.direction2.asArray(), t
                    }, t.prototype.parse = function(t) {
                        e.prototype.parse.call(this, t), this.direction1.copyFrom(t.direction1), this.direction2.copyFrom(t.direction2)
                    }, t
                }(Ct.CylinderParticleEmitter = Mt), Ct.CylinderDirectedParticleEmitter = Rt, Ot = $a || ($a = {}), wt = function() {
                    function e(e, t, i) {
                        void 0 === e && (e = 1), void 0 === t && (t = Math.PI), void 0 === i && (i = 0), this.directionRandomizer = i, this.radiusRange = 1, this.heightRange = 1, this.emitFromSpawnPointOnly = !1, this.angle = t, this.radius = e
                    }
                    return Object.defineProperty(e.prototype, "radius", {
                        get: function() {
                            return this._radius
                        },
                        set: function(e) {
                            this._radius = e, this._buildHeight()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "angle", {
                        get: function() {
                            return this._angle
                        },
                        set: function(e) {
                            this._angle = e, this._buildHeight()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._buildHeight = function() {
                        0 !== this._angle ? this._height = this._radius / Math.tan(this._angle / 2) : this._height = 1
                    }, e.prototype.startDirectionFunction = function(e, t, i) {
                        if (1 === Math.abs(Math.cos(this._angle))) Ot.Vector3.TransformNormalFromFloatsToRef(0, 1, 0, e, t);
                        else {
                            var r = i.position.subtract(e.getTranslation()).normalize(),
                                n = Ot.Scalar.RandomRange(0, this.directionRandomizer),
                                o = Ot.Scalar.RandomRange(0, this.directionRandomizer),
                                s = Ot.Scalar.RandomRange(0, this.directionRandomizer);
                            r.x += n, r.y += o, r.z += s, r.normalize(), Ot.Vector3.TransformNormalFromFloatsToRef(r.x, r.y, r.z, e, t)
                        }
                    }, e.prototype.startPositionFunction = function(e, t, i) {
                        var r, n = Ot.Scalar.RandomRange(0, 2 * Math.PI);
                        r = this.emitFromSpawnPointOnly ? 1e-4 : 1 - (r = Ot.Scalar.RandomRange(0, this.heightRange)) * r;
                        var o = this._radius - Ot.Scalar.RandomRange(0, this._radius * this.radiusRange),
                            s = (o *= r) * Math.sin(n),
                            a = o * Math.cos(n),
                            l = r * this._height;
                        Ot.Vector3.TransformCoordinatesFromFloatsToRef(s, l, a, e, t)
                    }, e.prototype.clone = function() {
                        var t = new e(this._radius, this._angle, this.directionRandomizer);
                        return Ot.Tools.DeepCopy(this, t), t
                    }, e.prototype.applyToShader = function(e) {
                        e.setFloat2("radius", this._radius, this.radiusRange), e.setFloat("coneAngle", this._angle), e.setFloat2("height", this._height, this.heightRange), e.setFloat("directionRandomizer", this.directionRandomizer)
                    }, e.prototype.getEffectDefines = function() {
                        var e = "#define CONEEMITTER";
                        return this.emitFromSpawnPointOnly && (e += "\n#define CONEEMITTERSPAWNPOINT"), e
                    }, e.prototype.getClassName = function() {
                        return "ConeParticleEmitter"
                    }, e.prototype.serialize = function() {
                        var e = {};
                        return e.type = this.getClassName(), e.radius = this._radius, e.angle = this._angle, e.directionRandomizer = this.directionRandomizer, e
                    }, e.prototype.parse = function(e) {
                        this.radius = e.radius, this.angle = e.angle, this.directionRandomizer = e.directionRandomizer
                    }, e
                }(), Ot.ConeParticleEmitter = wt, It = $a || ($a = {}), Dt = function() {
                    function e(e, t, i) {
                        void 0 === e && (e = 1), void 0 === t && (t = 1), void 0 === i && (i = 0), this.radius = e, this.radiusRange = t, this.directionRandomizer = i
                    }
                    return e.prototype.startDirectionFunction = function(e, t, i) {
                        var r = i.position.subtract(e.getTranslation()).normalize(),
                            n = It.Scalar.RandomRange(0, this.directionRandomizer),
                            o = It.Scalar.RandomRange(0, this.directionRandomizer),
                            s = It.Scalar.RandomRange(0, this.directionRandomizer);
                        r.x += n, r.y += o, r.z += s, r.normalize(), It.Vector3.TransformNormalFromFloatsToRef(r.x, r.y, r.z, e, t)
                    }, e.prototype.startPositionFunction = function(e, t, i) {
                        var r = this.radius - It.Scalar.RandomRange(0, this.radius * this.radiusRange),
                            n = It.Scalar.RandomRange(0, 1),
                            o = It.Scalar.RandomRange(0, 2 * Math.PI),
                            s = Math.acos(2 * n - 1),
                            a = r * Math.cos(o) * Math.sin(s),
                            l = r * Math.cos(s),
                            u = r * Math.sin(o) * Math.sin(s);
                        It.Vector3.TransformCoordinatesFromFloatsToRef(a, l, u, e, t)
                    }, e.prototype.clone = function() {
                        var t = new e(this.radius, this.directionRandomizer);
                        return It.Tools.DeepCopy(this, t), t
                    }, e.prototype.applyToShader = function(e) {
                        e.setFloat("radius", this.radius), e.setFloat("radiusRange", this.radiusRange), e.setFloat("directionRandomizer", this.directionRandomizer)
                    }, e.prototype.getEffectDefines = function() {
                        return "#define SPHEREEMITTER"
                    }, e.prototype.getClassName = function() {
                        return "SphereParticleEmitter"
                    }, e.prototype.serialize = function() {
                        var e = {};
                        return e.type = this.getClassName(), e.radius = this.radius, e.radiusRange = this.radiusRange, e.directionRandomizer = this.directionRandomizer, e
                    }, e.prototype.parse = function(e) {
                        this.radius = e.radius, this.radiusRange = e.radiusRange, this.directionRandomizer = e.directionRandomizer
                    }, e
                }(), Lt = function(e) {
                    function t(t, i, r) {
                        void 0 === t && (t = 1), void 0 === i && (i = new It.Vector3(0, 1, 0)), void 0 === r && (r = new It.Vector3(0, 1, 0));
                        var n = e.call(this, t) || this;
                        return n.direction1 = i, n.direction2 = r, n
                    }
                    return b(t, e), t.prototype.startDirectionFunction = function(e, t, i) {
                        var r = It.Scalar.RandomRange(this.direction1.x, this.direction2.x),
                            n = It.Scalar.RandomRange(this.direction1.y, this.direction2.y),
                            o = It.Scalar.RandomRange(this.direction1.z, this.direction2.z);
                        It.Vector3.TransformNormalFromFloatsToRef(r, n, o, e, t)
                    }, t.prototype.clone = function() {
                        var e = new t(this.radius, this.direction1, this.direction2);
                        return It.Tools.DeepCopy(this, e), e
                    }, t.prototype.applyToShader = function(e) {
                        e.setFloat("radius", this.radius), e.setFloat("radiusRange", this.radiusRange), e.setVector3("direction1", this.direction1), e.setVector3("direction2", this.direction2)
                    }, t.prototype.getEffectDefines = function() {
                        return "#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER"
                    }, t.prototype.getClassName = function() {
                        return "SphereDirectedParticleEmitter"
                    }, t.prototype.serialize = function() {
                        var t = e.prototype.serialize.call(this);
                        return t.direction1 = this.direction1.asArray(), t.direction2 = this.direction2.asArray(), t
                    }, t.prototype.parse = function(t) {
                        e.prototype.parse.call(this, t), this.direction1.copyFrom(t.direction1), this.direction2.copyFrom(t.direction2)
                    }, t
                }(It.SphereParticleEmitter = Dt), It.SphereDirectedParticleEmitter = Lt, Bt = $a || ($a = {}), Ft = function() {
                    function e(e, t, i) {
                        void 0 === e && (e = 1), void 0 === t && (t = 1), void 0 === i && (i = 0), this.radius = e, this.radiusRange = t, this.directionRandomizer = i
                    }
                    return e.prototype.startDirectionFunction = function(e, t, i) {
                        var r = i.position.subtract(e.getTranslation()).normalize(),
                            n = Bt.Scalar.RandomRange(0, this.directionRandomizer),
                            o = Bt.Scalar.RandomRange(0, this.directionRandomizer),
                            s = Bt.Scalar.RandomRange(0, this.directionRandomizer);
                        r.x += n, r.y += o, r.z += s, r.normalize(), Bt.Vector3.TransformNormalFromFloatsToRef(r.x, r.y, r.z, e, t)
                    }, e.prototype.startPositionFunction = function(e, t, i) {
                        var r = this.radius - Bt.Scalar.RandomRange(0, this.radius * this.radiusRange),
                            n = Bt.Scalar.RandomRange(0, 1),
                            o = Bt.Scalar.RandomRange(0, 2 * Math.PI),
                            s = Math.acos(2 * n - 1),
                            a = r * Math.cos(o) * Math.sin(s),
                            l = r * Math.cos(s),
                            u = r * Math.sin(o) * Math.sin(s);
                        Bt.Vector3.TransformCoordinatesFromFloatsToRef(a, Math.abs(l), u, e, t)
                    }, e.prototype.clone = function() {
                        var t = new e(this.radius, this.directionRandomizer);
                        return Bt.Tools.DeepCopy(this, t), t
                    }, e.prototype.applyToShader = function(e) {
                        e.setFloat("radius", this.radius), e.setFloat("radiusRange", this.radiusRange), e.setFloat("directionRandomizer", this.directionRandomizer)
                    }, e.prototype.getEffectDefines = function() {
                        return "#define HEMISPHERICEMITTER"
                    }, e.prototype.getClassName = function() {
                        return "HemisphericParticleEmitter"
                    }, e.prototype.serialize = function() {
                        var e = {};
                        return e.type = this.getClassName(), e.radius = this.radius, e.radiusRange = this.radiusRange, e.directionRandomizer = this.directionRandomizer, e
                    }, e.prototype.parse = function(e) {
                        this.radius = e.radius, this.radiusRange = e.radiusRange, this.directionRandomizer = e.directionRandomizer
                    }, e
                }(), Bt.HemisphericParticleEmitter = Ft, Nt = $a || ($a = {}), Vt = function() {
                    function e() {
                        this.direction1 = new Nt.Vector3(0, 1, 0), this.direction2 = new Nt.Vector3(0, 1, 0)
                    }
                    return e.prototype.startDirectionFunction = function(e, t, i) {
                            var r = Nt.Scalar.RandomRange(this.direction1.x, this.direction2.x),
                                n = Nt.Scalar.RandomRange(this.direction1.y, this.direction2.y),
                                o = Nt.Scalar.RandomRange(this.direction1.z, this.direction2.z);
                            Nt.Vector3.TransformNormalFromFloatsToRef(r, n, o, e, t)
                        }, e.prototype.startPositionFunction = function(e, t, i) {
                            Nt.Vector3.TransformCoordinatesFromFloatsToRef(0, 0, 0, e, t)
                        }, e.prototype.clone = function() {
                            var t = new e;
                            return Nt.Tools.DeepCopy(this, t), t
                        }, e.prototype.applyToShader = function(e) {
                            e.setVector3("direction1", this.direction1), e.setVector3("direction2", this.direction2)
                        },
                        e.prototype.getEffectDefines = function() {
                            return "#define POINTEMITTER"
                        }, e.prototype.getClassName = function() {
                            return "PointParticleEmitter"
                        }, e.prototype.serialize = function() {
                            var e = {};
                            return e.type = this.getClassName(), e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e
                        }, e.prototype.parse = function(e) {
                            Nt.Vector3.FromArrayToRef(e.direction1, 0, this.direction1), Nt.Vector3.FromArrayToRef(e.direction2, 0, this.direction2)
                        }, e
                }(), Nt.PointParticleEmitter = Vt, (kt = $a || ($a = {})).AbstractScene.AddParser(kt.SceneComponentConstants.NAME_PARTICLESYSTEM, function(e, t, i, r) {
                    var n = kt.AbstractScene.GetIndividualParser(kt.SceneComponentConstants.NAME_PARTICLESYSTEM);
                    if (n && void 0 !== e.particleSystems && null !== e.particleSystems)
                        for (var o = 0, s = e.particleSystems.length; o < s; o++) {
                            var a = e.particleSystems[o];
                            i.particleSystems.push(n(a, t, r))
                        }
                }), kt.AbstractScene.AddIndividualParser(kt.SceneComponentConstants.NAME_PARTICLESYSTEM, function(e, t, i) {
                    return e.activeParticleCount ? kt.GPUParticleSystem.Parse(e, t, i) : kt.ParticleSystem.Parse(e, t, i)
                }), kt.Engine.prototype.createEffectForParticles = function(e, t, i, r, n, o, s) {
                    void 0 === t && (t = []), void 0 === i && (i = []), void 0 === r && (r = "");
                    var a = kt.ParticleSystem._GetAttributeNamesOrOptions(),
                        l = kt.ParticleSystem._GetEffectCreationOptions();
                    return -1 === r.indexOf(" BILLBOARD") && (r += "\n#define BILLBOARD\n"), -1 === i.indexOf("diffuseSampler") && i.push("diffuseSampler"), this.createEffect({
                        vertex: "particles",
                        fragmentElement: e
                    }, a, l.concat(t), i, r, n, o, s)
                }, kt.Mesh.prototype.getEmittedParticleSystems = function() {
                    for (var e = new Array, t = 0; t < this.getScene().particleSystems.length; t++) {
                        var i = this.getScene().particleSystems[t];
                        i.emitter === this && e.push(i)
                    }
                    return e
                }, kt.Mesh.prototype.getHierarchyEmittedParticleSystems = function() {
                    var e = new Array,
                        t = this.getDescendants();
                    t.push(this);
                    for (var i = 0; i < this.getScene().particleSystems.length; i++) {
                        var r = this.getScene().particleSystems[i],
                            n = r.emitter;
                        n.position && -1 !== t.indexOf(n) && e.push(r)
                    }
                    return e
                },
                function(e) {
                    var t, i;
                    (i = t = e.SubEmitterType || (e.SubEmitterType = {}))[i.ATTACHED = 0] = "ATTACHED", i[i.END = 1] = "END";
                    var r = function() {
                        function i(i) {
                            this.particleSystem = i, this.type = t.END, this.inheritDirection = !1, this.inheritedVelocityAmount = 0, i.emitter && i.emitter.dispose || (i.emitter = new e.AbstractMesh("SubemitterSystemEmitter", i.getScene())), i.onDisposeObservable.add(function() {
                                i.emitter && i.emitter.dispose && i.emitter.dispose()
                            })
                        }
                        return i.prototype.clone = function() {
                            var t = this.particleSystem.emitter;
                            t ? t instanceof e.Vector3 ? t = t.clone() : t instanceof e.AbstractMesh && ((t = new e.Mesh("", t.getScene())).isVisible = !1) : t = new e.Vector3;
                            var r = new i(this.particleSystem.clone("", t));
                            return r.type = this.type, r.inheritDirection = this.inheritDirection, r.inheritedVelocityAmount = this.inheritedVelocityAmount, r.particleSystem._disposeEmitterOnDispose = !0, r.particleSystem.disposeOnStop = !0, r
                        }, i.prototype.serialize = function() {
                            var e = {};
                            return e.type = this.type, e.inheritDirection = this.inheritDirection, e.inheritedVelocityAmount = this.inheritedVelocityAmount, e.particleSystem = this.particleSystem.serialize(), e
                        }, i.Parse = function(t, r, n) {
                            var o = t.particleSystem,
                                s = new i(e.ParticleSystem.Parse(o, r, n));
                            return s.type = t.type, s.inheritDirection = t.inheritDirection, s.inheritedVelocityAmount = t.inheritedVelocityAmount, s.particleSystem._isSubEmitter = !0, s
                        }, i.prototype.dispose = function() {
                            this.particleSystem.dispose()
                        }, i
                    }();
                    e.SubEmitter = r
                }($a || ($a = {})), Ut = $a || ($a = {}), Gt = function(e) {
                    function t(t, i, r, n) {
                        void 0 === n && (n = {});
                        var o = e.call(this, t, i) || this;
                        return o._textures = {}, o._textureArrays = {}, o._floats = {}, o._ints = {}, o._floatsArrays = {}, o._colors3 = {}, o._colors3Arrays = {}, o._colors4 = {}, o._vectors2 = {}, o._vectors3 = {}, o._vectors4 = {}, o._matrices = {}, o._matrices3x3 = {}, o._matrices2x2 = {}, o._vectors2Arrays = {}, o._vectors3Arrays = {}, o._cachedWorldViewMatrix = new Ut.Matrix, o._shaderPath = r, o._options = ae({
                            needAlphaBlending: !1,
                            needAlphaTesting: !1,
                            attributes: ["position", "normal", "uv"],
                            uniforms: ["worldViewProjection"],
                            uniformBuffers: [],
                            samplers: [],
                            defines: []
                        }, n), o
                    }
                    return b(t, e), t.prototype.getClassName = function() {
                        return "ShaderMaterial"
                    }, t.prototype.needAlphaBlending = function() {
                        return this.alpha < 1 || this._options.needAlphaBlending
                    }, t.prototype.needAlphaTesting = function() {
                        return this._options.needAlphaTesting
                    }, t.prototype._checkUniform = function(e) {
                        -1 === this._options.uniforms.indexOf(e) && this._options.uniforms.push(e)
                    }, t.prototype.setTexture = function(e, t) {
                        return -1 === this._options.samplers.indexOf(e) && this._options.samplers.push(e), this._textures[e] = t, this
                    }, t.prototype.setTextureArray = function(e, t) {
                        return -1 === this._options.samplers.indexOf(e) && this._options.samplers.push(e), this._checkUniform(e), this._textureArrays[e] = t, this
                    }, t.prototype.setFloat = function(e, t) {
                        return this._checkUniform(e), this._floats[e] = t, this
                    }, t.prototype.setInt = function(e, t) {
                        return this._checkUniform(e), this._ints[e] = t, this
                    }, t.prototype.setFloats = function(e, t) {
                        return this._checkUniform(e), this._floatsArrays[e] = t, this
                    }, t.prototype.setColor3 = function(e, t) {
                        return this._checkUniform(e), this._colors3[e] = t, this
                    }, t.prototype.setColor3Array = function(e, t) {
                        return this._checkUniform(e), this._colors3Arrays[e] = t.reduce(function(e, t) {
                            return t.toArray(e, e.length), e
                        }, []), this
                    }, t.prototype.setColor4 = function(e, t) {
                        return this._checkUniform(e), this._colors4[e] = t, this
                    }, t.prototype.setVector2 = function(e, t) {
                        return this._checkUniform(e), this._vectors2[e] = t, this
                    }, t.prototype.setVector3 = function(e, t) {
                        return this._checkUniform(e), this._vectors3[e] = t, this
                    }, t.prototype.setVector4 = function(e, t) {
                        return this._checkUniform(e), this._vectors4[e] = t, this
                    }, t.prototype.setMatrix = function(e, t) {
                        return this._checkUniform(e), this._matrices[e] = t, this
                    }, t.prototype.setMatrix3x3 = function(e, t) {
                        return this._checkUniform(e), this._matrices3x3[e] = t, this
                    }, t.prototype.setMatrix2x2 = function(e, t) {
                        return this._checkUniform(e), this._matrices2x2[e] = t, this
                    }, t.prototype.setArray2 = function(e, t) {
                        return this._checkUniform(e), this._vectors2Arrays[e] = t, this
                    }, t.prototype.setArray3 = function(e, t) {
                        return this._checkUniform(e), this._vectors3Arrays[e] = t, this
                    }, t.prototype._checkCache = function(e, t, i) {
                        return !t || (this._effect && this._effect.defines.indexOf("#define INSTANCES"), !1)
                    }, t.prototype.isReady = function(e, t) {
                        var i = this.getScene(),
                            r = i.getEngine();
                        if (!this.checkReadyOnEveryCall && this._renderId === i.getRenderId() && this._checkCache(i, e, t)) return !0;
                        for (var n = [], o = [], s = new Ut.EffectFallbacks, a = 0; a < this._options.defines.length; a++) n.push(this._options.defines[a]);
                        for (a = 0; a < this._options.attributes.length; a++) o.push(this._options.attributes[a]);
                        for (var l in e && e.isVerticesDataPresent(Ut.VertexBuffer.ColorKind) && (o.push(Ut.VertexBuffer.ColorKind), n.push("#define VERTEXCOLOR")), t && (n.push("#define INSTANCES"), Ut.MaterialHelper.PrepareAttributesForInstances(o, n)), e && e.useBones && e.computeBonesUsingShaders && e.skeleton ? (o.push(Ut.VertexBuffer.MatricesIndicesKind), o.push(Ut.VertexBuffer.MatricesWeightsKind), 4 < e.numBoneInfluencers && (o.push(Ut.VertexBuffer.MatricesIndicesExtraKind), o.push(Ut.VertexBuffer.MatricesWeightsExtraKind)), n.push("#define NUM_BONE_INFLUENCERS " + e.numBoneInfluencers), n.push("#define BonesPerMesh " + (e.skeleton.bones.length + 1)), s.addCPUSkinningFallback(0, e), -1 === this._options.uniforms.indexOf("mBones") && this._options.uniforms.push("mBones")) : n.push("#define NUM_BONE_INFLUENCERS 0"), this._textures)
                            if (!this._textures[l].isReady()) return !1;
                        e && this._shouldTurnAlphaTestOn(e) && n.push("#define ALPHATEST");
                        var u = this._effect,
                            c = n.join("\n");
                        return this._effect = r.createEffect(this._shaderPath, {
                            attributes: o,
                            uniformsNames: this._options.uniforms,
                            uniformBuffersNames: this._options.uniformBuffers,
                            samplers: this._options.samplers,
                            defines: c,
                            fallbacks: s,
                            onCompiled: this.onCompiled,
                            onError: this.onError
                        }, r), !!this._effect.isReady() && (u !== this._effect && i.resetCachedMaterial(), this._renderId = i.getRenderId(), !0)
                    }, t.prototype.bindOnlyWorldMatrix = function(e) {
                        var t = this.getScene();
                        this._effect && (-1 !== this._options.uniforms.indexOf("world") && this._effect.setMatrix("world", e), -1 !== this._options.uniforms.indexOf("worldView") && (e.multiplyToRef(t.getViewMatrix(), this._cachedWorldViewMatrix), this._effect.setMatrix("worldView", this._cachedWorldViewMatrix)), -1 !== this._options.uniforms.indexOf("worldViewProjection") && this._effect.setMatrix("worldViewProjection", e.multiply(t.getTransformMatrix())))
                    }, t.prototype.bind = function(e, t) {
                        if (this.bindOnlyWorldMatrix(e), this._effect && this.getScene().getCachedMaterial() !== this) {
                            var i;
                            for (i in -1 !== this._options.uniforms.indexOf("view") && this._effect.setMatrix("view", this.getScene().getViewMatrix()), -1 !== this._options.uniforms.indexOf("projection") && this._effect.setMatrix("projection", this.getScene().getProjectionMatrix()), -1 !== this._options.uniforms.indexOf("viewProjection") && this._effect.setMatrix("viewProjection", this.getScene().getTransformMatrix()), Ut.MaterialHelper.BindBonesParameters(t, this._effect), this._textures) this._effect.setTexture(i, this._textures[i]);
                            for (i in this._textureArrays) this._effect.setTextureArray(i, this._textureArrays[i]);
                            for (i in this._ints) this._effect.setInt(i, this._ints[i]);
                            for (i in this._floats) this._effect.setFloat(i, this._floats[i]);
                            for (i in this._floatsArrays) this._effect.setArray(i, this._floatsArrays[i]);
                            for (i in this._colors3) this._effect.setColor3(i, this._colors3[i]);
                            for (i in this._colors3Arrays) this._effect.setArray3(i, this._colors3Arrays[i]);
                            for (i in this._colors4) {
                                var r = this._colors4[i];
                                this._effect.setFloat4(i, r.r, r.g, r.b, r.a)
                            }
                            for (i in this._vectors2) this._effect.setVector2(i, this._vectors2[i]);
                            for (i in this._vectors3) this._effect.setVector3(i, this._vectors3[i]);
                            for (i in this._vectors4) this._effect.setVector4(i, this._vectors4[i]);
                            for (i in this._matrices) this._effect.setMatrix(i, this._matrices[i]);
                            for (i in this._matrices3x3) this._effect.setMatrix3x3(i, this._matrices3x3[i]);
                            for (i in this._matrices2x2) this._effect.setMatrix2x2(i, this._matrices2x2[i]);
                            for (i in this._vectors2Arrays) this._effect.setArray2(i, this._vectors2Arrays[i]);
                            for (i in this._vectors3Arrays) this._effect.setArray3(i, this._vectors3Arrays[i])
                        }
                        this._afterBind(t)
                    }, t.prototype.getActiveTextures = function() {
                        var t = e.prototype.getActiveTextures.call(this);
                        for (var i in this._textures) t.push(this._textures[i]);
                        for (var i in this._textureArrays)
                            for (var r = this._textureArrays[i], n = 0; n < r.length; n++) t.push(r[n]);
                        return t
                    }, t.prototype.hasTexture = function(t) {
                        if (e.prototype.hasTexture.call(this, t)) return !0;
                        for (var i in this._textures)
                            if (this._textures[i] === t) return !0;
                        for (var i in this._textureArrays)
                            for (var r = this._textureArrays[i], n = 0; n < r.length; n++)
                                if (r[n] === t) return !0;
                        return !1
                    }, t.prototype.clone = function(e) {
                        return new t(e, this.getScene(), this._shaderPath, this._options)
                    }, t.prototype.dispose = function(t, i) {
                        if (i) {
                            var r;
                            for (r in this._textures) this._textures[r].dispose();
                            for (r in this._textureArrays)
                                for (var n = this._textureArrays[r], o = 0; o < n.length; o++) n[o].dispose()
                        }
                        this._textures = {}, e.prototype.dispose.call(this, t, i)
                    }, t.prototype.serialize = function() {
                        var e, t = Ut.SerializationHelper.Serialize(this);
                        for (e in t.customType = "BABYLON.ShaderMaterial", t.options = this._options, t.shaderPath = this._shaderPath, t.textures = {}, this._textures) t.textures[e] = this._textures[e].serialize();
                        for (e in t.textureArrays = {}, this._textureArrays) {
                            t.textureArrays[e] = [];
                            for (var i = this._textureArrays[e], r = 0; r < i.length; r++) t.textureArrays[e].push(i[r].serialize())
                        }
                        for (e in t.floats = {}, this._floats) t.floats[e] = this._floats[e];
                        for (e in t.FloatArrays = {}, this._floatsArrays) t.FloatArrays[e] = this._floatsArrays[e];
                        for (e in t.colors3 = {}, this._colors3) t.colors3[e] = this._colors3[e].asArray();
                        for (e in t.colors3Arrays = {}, this._colors3Arrays) t.colors3Arrays[e] = this._colors3Arrays[e];
                        for (e in t.colors4 = {}, this._colors4) t.colors4[e] = this._colors4[e].asArray();
                        for (e in t.vectors2 = {}, this._vectors2) t.vectors2[e] = this._vectors2[e].asArray();
                        for (e in t.vectors3 = {}, this._vectors3) t.vectors3[e] = this._vectors3[e].asArray();
                        for (e in t.vectors4 = {}, this._vectors4) t.vectors4[e] = this._vectors4[e].asArray();
                        for (e in t.matrices = {}, this._matrices) t.matrices[e] = this._matrices[e].asArray();
                        for (e in t.matrices3x3 = {}, this._matrices3x3) t.matrices3x3[e] = this._matrices3x3[e];
                        for (e in t.matrices2x2 = {}, this._matrices2x2) t.matrices2x2[e] = this._matrices2x2[e];
                        for (e in t.vectors2Arrays = {}, this._vectors2Arrays) t.vectors2Arrays[e] = this._vectors2Arrays[e];
                        for (e in t.vectors3Arrays = {}, this._vectors3Arrays) t.vectors3Arrays[e] = this._vectors3Arrays[e];
                        return t
                    }, t.Parse = function(e, i, r) {
                        var n, o = Ut.SerializationHelper.Parse(function() {
                            return new t(e.name, i, e.shaderPath, e.options)
                        }, e, i, r);
                        for (n in e.textures) o.setTexture(n, Ut.Texture.Parse(e.textures[n], i, r));
                        for (n in e.textureArrays) {
                            for (var s = e.textureArrays[n], a = new Array, l = 0; l < s.length; l++) a.push(Ut.Texture.Parse(s[l], i, r));
                            o.setTextureArray(n, a)
                        }
                        for (n in e.floats) o.setFloat(n, e.floats[n]);
                        for (n in e.floatsArrays) o.setFloats(n, e.floatsArrays[n]);
                        for (n in e.colors3) o.setColor3(n, Ut.Color3.FromArray(e.colors3[n]));
                        for (n in e.colors3Arrays) {
                            var u = e.colors3Arrays[n].reduce(function(e, t, i) {
                                return i % 3 == 0 ? e.push([t]) : e[e.length - 1].push(t), e
                            }, []).map(function(e) {
                                return Ut.Color3.FromArray(e)
                            });
                            o.setColor3Array(n, u)
                        }
                        for (n in e.colors4) o.setColor4(n, Ut.Color4.FromArray(e.colors4[n]));
                        for (n in e.vectors2) o.setVector2(n, Ut.Vector2.FromArray(e.vectors2[n]));
                        for (n in e.vectors3) o.setVector3(n, Ut.Vector3.FromArray(e.vectors3[n]));
                        for (n in e.vectors4) o.setVector4(n, Ut.Vector4.FromArray(e.vectors4[n]));
                        for (n in e.matrices) o.setMatrix(n, Ut.Matrix.FromArray(e.matrices[n]));
                        for (n in e.matrices3x3) o.setMatrix3x3(n, e.matrices3x3[n]);
                        for (n in e.matrices2x2) o.setMatrix2x2(n, e.matrices2x2[n]);
                        for (n in e.vectors2Arrays) o.setArray2(n, e.vectors2Arrays[n]);
                        for (n in e.vectors3Arrays) o.setArray3(n, e.vectors3Arrays[n]);
                        return o
                    }, t
                }(Ut.Material), Ut.ShaderMaterial = Gt, zt = $a || ($a = {}), jt = function(e) {
                    function t(t, i) {
                        var r = e.call(this, t, i) || this;
                        return r.generateOctree = !1, r
                    }
                    return b(t, e), t.prototype.getClassName = function() {
                        return "GroundMesh"
                    }, Object.defineProperty(t.prototype, "subdivisions", {
                        get: function() {
                            return Math.min(this._subdivisionsX, this._subdivisionsY)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "subdivisionsX", {
                        get: function() {
                            return this._subdivisionsX
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "subdivisionsY", {
                        get: function() {
                            return this._subdivisionsY
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.optimize = function(e, t) {
                        void 0 === t && (t = 32), this._subdivisionsX = e, this._subdivisionsY = e, this.subdivide(e), this.createOrUpdateSubmeshesOctree && this.createOrUpdateSubmeshesOctree(t)
                    }, t.prototype.getHeightAtCoordinates = function(e, t) {
                        var i = this.getWorldMatrix(),
                            r = zt.Tmp.Matrix[5];
                        i.invertToRef(r);
                        var n = zt.Tmp.Vector3[8];
                        if (zt.Vector3.TransformCoordinatesFromFloatsToRef(e, 0, t, r, n), e = n.x, t = n.z, e < this._minX || e > this._maxX || t < this._minZ || t > this._maxZ) return this.position.y;
                        this._heightQuads && 0 != this._heightQuads.length || (this._initHeightQuads(), this._computeHeightQuads());
                        var o = this._getFacetAt(e, t),
                            s = -(o.x * e + o.z * t + o.w) / o.y;
                        return zt.Vector3.TransformCoordinatesFromFloatsToRef(0, s, 0, i, n), n.y
                    }, t.prototype.getNormalAtCoordinates = function(e, t) {
                        var i = new zt.Vector3(0, 1, 0);
                        return this.getNormalAtCoordinatesToRef(e, t, i), i
                    }, t.prototype.getNormalAtCoordinatesToRef = function(e, t, i) {
                        var r = this.getWorldMatrix(),
                            n = zt.Tmp.Matrix[5];
                        r.invertToRef(n);
                        var o = zt.Tmp.Vector3[8];
                        if (zt.Vector3.TransformCoordinatesFromFloatsToRef(e, 0, t, n, o), e = o.x, t = o.z, e < this._minX || e > this._maxX || t < this._minZ || t > this._maxZ) return this;
                        this._heightQuads && 0 != this._heightQuads.length || (this._initHeightQuads(), this._computeHeightQuads());
                        var s = this._getFacetAt(e, t);
                        return zt.Vector3.TransformNormalFromFloatsToRef(s.x, s.y, s.z, r, i), this
                    }, t.prototype.updateCoordinateHeights = function() {
                        return this._heightQuads && 0 != this._heightQuads.length || this._initHeightQuads(), this._computeHeightQuads(), this
                    }, t.prototype._getFacetAt = function(e, t) {
                        var i = Math.floor((e + this._maxX) * this._subdivisionsX / this._width),
                            r = Math.floor(-(t + this._maxZ) * this._subdivisionsY / this._height + this._subdivisionsY),
                            n = this._heightQuads[r * this._subdivisionsX + i];
                        return t < n.slope.x * e + n.slope.y ? n.facet1 : n.facet2
                    }, t.prototype._initHeightQuads = function() {
                        var e = this._subdivisionsX,
                            t = this._subdivisionsY;
                        this._heightQuads = new Array;
                        for (var i = 0; i < t; i++)
                            for (var r = 0; r < e; r++) {
                                var n = {
                                    slope: zt.Vector2.Zero(),
                                    facet1: new zt.Vector4(0, 0, 0, 0),
                                    facet2: new zt.Vector4(0, 0, 0, 0)
                                };
                                this._heightQuads[i * e + r] = n
                            }
                        return this
                    }, t.prototype._computeHeightQuads = function() {
                        var e = this.getVerticesData(zt.VertexBuffer.PositionKind);
                        if (!e) return this;
                        for (var t = zt.Tmp.Vector3[3], i = zt.Tmp.Vector3[2], r = zt.Tmp.Vector3[1], n = zt.Tmp.Vector3[0], o = zt.Tmp.Vector3[4], s = zt.Tmp.Vector3[5], a = zt.Tmp.Vector3[6], l = zt.Tmp.Vector3[7], u = zt.Tmp.Vector3[8], c = 0, h = 0, d = 0, p = 0, f = 0, _ = 0, m = 0, g = this._subdivisionsX, v = this._subdivisionsY, y = 0; y < v; y++)
                            for (var b = 0; b < g; b++) {
                                c = 3 * b, h = y * (g + 1) * 3, d = (y + 1) * (g + 1) * 3, t.x = e[h + c], t.y = e[h + c + 1], t.z = e[h + c + 2], i.x = e[h + c + 3], i.y = e[h + c + 4], i.z = e[h + c + 5], r.x = e[d + c], r.y = e[d + c + 1], r.z = e[d + c + 2], n.x = e[d + c + 3], n.y = e[d + c + 4], n.z = e[d + c + 5], p = (n.z - t.z) / (n.x - t.x), f = t.z - p * t.x, i.subtractToRef(t, o), r.subtractToRef(t, s), n.subtractToRef(t, a), zt.Vector3.CrossToRef(a, s, l), zt.Vector3.CrossToRef(o, a, u), l.normalize(), u.normalize(), _ = -(l.x * t.x + l.y * t.y + l.z * t.z), m = -(u.x * i.x + u.y * i.y + u.z * i.z);
                                var x = this._heightQuads[y * g + b];
                                x.slope.copyFromFloats(p, f), x.facet1.copyFromFloats(l.x, l.y, l.z, _), x.facet2.copyFromFloats(u.x, u.y, u.z, m)
                            }
                        return this
                    }, t.prototype.serialize = function(t) {
                        e.prototype.serialize.call(this, t), t.subdivisionsX = this._subdivisionsX, t.subdivisionsY = this._subdivisionsY, t.minX = this._minX, t.maxX = this._maxX, t.minZ = this._minZ, t.maxZ = this._maxZ, t.width = this._width, t.height = this._height
                    }, t.Parse = function(e, i) {
                        var r = new t(e.name, i);
                        return r._subdivisionsX = e.subdivisionsX || 1, r._subdivisionsY = e.subdivisionsY || 1, r._minX = e.minX, r._maxX = e.maxX, r._minZ = e.minZ, r._maxZ = e.maxZ, r._width = e.width, r._height = e.height, r
                    }, t
                }(zt.Mesh), zt.GroundMesh = jt, Ht = $a || ($a = {}), Wt = function(e) {
                    function t(t, i) {
                        var r = e.call(this, t, i.getScene()) || this;
                        return i.instances.push(r), r._sourceMesh = i, r.position.copyFrom(i.position), r.rotation.copyFrom(i.rotation), r.scaling.copyFrom(i.scaling), i.rotationQuaternion && (r.rotationQuaternion = i.rotationQuaternion.clone()), r.infiniteDistance = i.infiniteDistance, r.setPivotMatrix(i.getPivotMatrix()), r.refreshBoundingInfo(), r._syncSubMeshes(), r
                    }
                    return b(t, e), t.prototype.getClassName = function() {
                        return "InstancedMesh"
                    }, Object.defineProperty(t.prototype, "receiveShadows", {
                        get: function() {
                            return this._sourceMesh.receiveShadows
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "material", {
                        get: function() {
                            return this._sourceMesh.material
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "visibility", {
                        get: function() {
                            return this._sourceMesh.visibility
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "skeleton", {
                        get: function() {
                            return this._sourceMesh.skeleton
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "renderingGroupId", {
                        get: function() {
                            return this._sourceMesh.renderingGroupId
                        },
                        set: function(e) {
                            this._sourceMesh && e !== this._sourceMesh.renderingGroupId && Ht.Tools.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getTotalVertices = function() {
                        return this._sourceMesh.getTotalVertices()
                    }, Object.defineProperty(t.prototype, "sourceMesh", {
                        get: function() {
                            return this._sourceMesh
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.isReady = function(e) {
                        return void 0 === e && (e = !1), this._sourceMesh.isReady(e, !0)
                    }, t.prototype.getVerticesData = function(e, t) {
                        return this._sourceMesh.getVerticesData(e, t)
                    }, t.prototype.setVerticesData = function(e, t, i, r) {
                        return this.sourceMesh && this.sourceMesh.setVerticesData(e, t, i, r), this.sourceMesh
                    }, t.prototype.updateVerticesData = function(e, t, i, r) {
                        return this.sourceMesh && this.sourceMesh.updateVerticesData(e, t, i, r), this.sourceMesh
                    }, t.prototype.setIndices = function(e, t) {
                        return void 0 === t && (t = null), this.sourceMesh && this.sourceMesh.setIndices(e, t), this.sourceMesh
                    }, t.prototype.isVerticesDataPresent = function(e) {
                        return this._sourceMesh.isVerticesDataPresent(e)
                    }, t.prototype.getIndices = function() {
                        return this._sourceMesh.getIndices()
                    }, Object.defineProperty(t.prototype, "_positions", {
                        get: function() {
                            return this._sourceMesh._positions
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.refreshBoundingInfo = function() {
                        var e = this._sourceMesh.getBoundingInfo();
                        return this._boundingInfo = new Ht.BoundingInfo(e.minimum.clone(), e.maximum.clone()), this._updateBoundingInfo(), this
                    }, t.prototype._preActivate = function() {
                        return this._currentLOD && this._currentLOD._preActivate(), this
                    }, t.prototype._activate = function(e) {
                        return this._currentLOD && this._currentLOD._registerInstanceForRenderId(this, e), this
                    }, t.prototype.getLOD = function(e) {
                        if (!e) return this;
                        var t = this.getBoundingInfo();
                        return this._currentLOD = this.sourceMesh.getLOD(e, t.boundingSphere), this._currentLOD === this.sourceMesh ? this : this._currentLOD
                    }, t.prototype._syncSubMeshes = function() {
                        if (this.releaseSubMeshes(), this._sourceMesh.subMeshes)
                            for (var e = 0; e < this._sourceMesh.subMeshes.length; e++) this._sourceMesh.subMeshes[e].clone(this, this._sourceMesh);
                        return this
                    }, t.prototype._generatePointsArray = function() {
                        return this._sourceMesh._generatePointsArray()
                    }, t.prototype.clone = function(e, t, i) {
                        var r = this._sourceMesh.createInstance(e);
                        if (Ht.Tools.DeepCopy(this, r, ["name", "subMeshes", "uniqueId"], []), this.refreshBoundingInfo(), t && (r.parent = t), !i)
                            for (var n = 0; n < this.getScene().meshes.length; n++) {
                                var o = this.getScene().meshes[n];
                                o.parent === this && o.clone(o.name, r)
                            }
                        return r.computeWorldMatrix(!0), r
                    }, t.prototype.dispose = function(t, i) {
                        void 0 === i && (i = !1);
                        var r = this._sourceMesh.instances.indexOf(this);
                        this._sourceMesh.instances.splice(r, 1), e.prototype.dispose.call(this, t, i)
                    }, t
                }(Ht.AbstractMesh), Ht.InstancedMesh = Wt, Xt = $a || ($a = {}), Yt = function(e) {
                    function t(t, i, r, n, o, s, a) {
                        void 0 === i && (i = null), void 0 === r && (r = null);
                        var l = e.call(this, t, i, r, n, o) || this;
                        l.useVertexColor = s, l.useVertexAlpha = a, l.color = new Xt.Color3(1, 1, 1), l.alpha = 1, n && (l.color = n.color.clone(), l.alpha = n.alpha, l.useVertexColor = n.useVertexColor, l.useVertexAlpha = n.useVertexAlpha), l._intersectionThreshold = .1;
                        var u = {
                            attributes: [Xt.VertexBuffer.PositionKind, "world0", "world1", "world2", "world3"],
                            uniforms: ["world", "viewProjection"],
                            needAlphaBlending: !0,
                            defines: []
                        };
                        return !1 === a && (u.needAlphaBlending = !1), s ? (u.defines.push("#define VERTEXCOLOR"), u.attributes.push(Xt.VertexBuffer.ColorKind)) : u.uniforms.push("color"), l._colorShader = new Xt.ShaderMaterial("colorShader", l.getScene(), "color", u), l
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "intersectionThreshold", {
                        get: function() {
                            return this._intersectionThreshold
                        },
                        set: function(e) {
                            this._intersectionThreshold !== e && (this._intersectionThreshold = e, this.geometry && (this.geometry.boundingBias = new Xt.Vector2(0, e)))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getClassName = function() {
                        return "LinesMesh"
                    }, Object.defineProperty(t.prototype, "material", {
                        get: function() {
                            return this._colorShader
                        },
                        set: function(e) {},
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "checkCollisions", {
                        get: function() {
                            return !1
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._bind = function(e, t, i) {
                        return this._geometry && (this._geometry._bind(this._colorShader.getEffect()), this.useVertexColor || this._colorShader.setColor4("color", this.color.toColor4(this.alpha))), this
                    }, t.prototype._draw = function(e, t, i) {
                        return this._geometry && this._geometry.getVertexBuffers() && (this._unIndexed || this._geometry.getIndexBuffer()) && this.getScene().getEngine().drawElementsType(Xt.Material.LineListDrawMode, e.indexStart, e.indexCount, i), this
                    }, t.prototype.dispose = function(t) {
                        this._colorShader.dispose(), e.prototype.dispose.call(this, t)
                    }, t.prototype.clone = function(e, i, r) {
                        return new t(e, this.getScene(), i, this, r)
                    }, t
                }(Xt.Mesh), Xt.LinesMesh = Yt, qt = $a || ($a = {}), Kt = function() {
                    function e() {
                        this._count = 0, this._data = {}
                    }
                    return e.prototype.copyFrom = function(e) {
                        var t = this;
                        this.clear(), e.forEach(function(e, i) {
                            return t.add(e, i)
                        })
                    }, e.prototype.get = function(e) {
                        var t = this._data[e];
                        if (void 0 !== t) return t
                    }, e.prototype.getOrAddWithFactory = function(e, t) {
                        var i = this.get(e);
                        return void 0 !== i || (i = t(e)) && this.add(e, i), i
                    }, e.prototype.getOrAdd = function(e, t) {
                        var i = this.get(e);
                        return void 0 !== i ? i : (this.add(e, t), t)
                    }, e.prototype.contains = function(e) {
                        return void 0 !== this._data[e]
                    }, e.prototype.add = function(e, t) {
                        return void 0 === this._data[e] && (this._data[e] = t, ++this._count, !0)
                    }, e.prototype.set = function(e, t) {
                        return void 0 !== this._data[e] && (this._data[e] = t, !0)
                    }, e.prototype.getAndRemove = function(e) {
                        var t = this.get(e);
                        return void 0 !== t ? (delete this._data[e], --this._count, t) : null
                    }, e.prototype.remove = function(e) {
                        return !!this.contains(e) && (delete this._data[e], --this._count, !0)
                    }, e.prototype.clear = function() {
                        this._data = {}, this._count = 0
                    }, Object.defineProperty(e.prototype, "count", {
                        get: function() {
                            return this._count
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.forEach = function(e) {
                        for (var t in this._data) e(t, this._data[t])
                    }, e.prototype.first = function(e) {
                        for (var t in this._data) {
                            var i = e(t, this._data[t]);
                            if (i) return i
                        }
                        return null
                    }, e
                }(), qt.StringDictionary = Kt, Qt = $a || ($a = {}), Zt = Qt.Debug || (Qt.Debug = {}), Jt = function() {
                    function e(e, t, i, r, n) {
                        void 0 === r && (r = !0), void 0 === n && (n = 1), this.skeleton = e, this.mesh = t, this.autoUpdateBonesMatrices = r, this.renderingGroupId = n, this.color = Qt.Color3.White(), this._debugLines = new Array, this._isEnabled = !1, this._scene = i, this.update(), this._renderFunction = this.update.bind(this)
                    }
                    return Object.defineProperty(e.prototype, "isEnabled", {
                        get: function() {
                            return this._isEnabled
                        },
                        set: function(e) {
                            this._isEnabled !== e && ((this._isEnabled = e) ? this._scene.registerBeforeRender(this._renderFunction) : this._scene.unregisterBeforeRender(this._renderFunction))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._getBonePosition = function(e, t, i, r, n, o) {
                        void 0 === r && (r = 0), void 0 === n && (n = 0), void 0 === o && (o = 0);
                        var s = Qt.Tmp.Matrix[0],
                            a = t.getParent();
                        if (s.copyFrom(t.getLocalMatrix()), 0 !== r || 0 !== n || 0 !== o) {
                            var l = Qt.Tmp.Matrix[1];
                            Qt.Matrix.IdentityToRef(l), l.m[12] = r, l.m[13] = n, l.m[14] = o, l.multiplyToRef(s, s)
                        }
                        a && s.multiplyToRef(a.getAbsoluteTransform(), s), s.multiplyToRef(i, s), e.x = s.m[12], e.y = s.m[13], e.z = s.m[14]
                    }, e.prototype._getLinesForBonesWithLength = function(e, t) {
                        for (var i = e.length, r = this.mesh.position, n = 0; n < i; n++) {
                            var o = e[n],
                                s = this._debugLines[n];
                            s || (s = [Qt.Vector3.Zero(), Qt.Vector3.Zero()], this._debugLines[n] = s), this._getBonePosition(s[0], o, t), this._getBonePosition(s[1], o, t, 0, o.length, 0), s[0].subtractInPlace(r), s[1].subtractInPlace(r)
                        }
                    }, e.prototype._getLinesForBonesNoLength = function(e, t) {
                        for (var i = e.length, r = 0, n = this.mesh.position, o = i - 1; 0 <= o; o--) {
                            var s = e[o],
                                a = s.getParent();
                            if (a) {
                                var l = this._debugLines[r];
                                l || (l = [Qt.Vector3.Zero(), Qt.Vector3.Zero()], this._debugLines[r] = l), s.getAbsolutePositionToRef(this.mesh, l[0]), a.getAbsolutePositionToRef(this.mesh, l[1]), l[0].subtractInPlace(n), l[1].subtractInPlace(n), r++
                            }
                        }
                    }, e.prototype.update = function() {
                        this.autoUpdateBonesMatrices && this.skeleton.computeAbsoluteTransforms(), void 0 === this.skeleton.bones[0].length ? this._getLinesForBonesNoLength(this.skeleton.bones, this.mesh.getWorldMatrix()) : this._getLinesForBonesWithLength(this.skeleton.bones, this.mesh.getWorldMatrix()), this._debugMesh ? Qt.MeshBuilder.CreateLineSystem("", {
                            lines: this._debugLines,
                            updatable: !0,
                            instance: this._debugMesh
                        }, this._scene) : (this._debugMesh = Qt.MeshBuilder.CreateLineSystem("", {
                            lines: this._debugLines,
                            updatable: !0,
                            instance: null
                        }, this._scene), this._debugMesh.renderingGroupId = this.renderingGroupId), this._debugMesh.position.copyFrom(this.mesh.position), this._debugMesh.color = this.color
                    }, e.prototype.dispose = function() {
                        this._debugMesh && (this.isEnabled = !1, this._debugMesh.dispose(), this._debugMesh = null)
                    }, e
                }(), Zt.SkeletonViewer = Jt, $t = $a || ($a = {}), ei = $t.Debug || ($t.Debug = {}), ti = function() {
                    function e(e, t) {
                        void 0 === t && (t = 1), this._xline = [$t.Vector3.Zero(), $t.Vector3.Zero()], this._yline = [$t.Vector3.Zero(), $t.Vector3.Zero()], this._zline = [$t.Vector3.Zero(), $t.Vector3.Zero()], this.scaleLines = 1, this.scaleLines = t, this._xmesh = $t.Mesh.CreateLines("xline", this._xline, e, !0), this._ymesh = $t.Mesh.CreateLines("yline", this._yline, e, !0), this._zmesh = $t.Mesh.CreateLines("zline", this._zline, e, !0), this._xmesh.renderingGroupId = 2, this._ymesh.renderingGroupId = 2, this._zmesh.renderingGroupId = 2, this._xmesh.material.checkReadyOnlyOnce = !0, this._xmesh.color = new $t.Color3(1, 0, 0), this._ymesh.material.checkReadyOnlyOnce = !0, this._ymesh.color = new $t.Color3(0, 1, 0), this._zmesh.material.checkReadyOnlyOnce = !0, this._zmesh.color = new $t.Color3(0, 0, 1), this.scene = e
                    }
                    return e.prototype.update = function(e, t, i, r) {
                        var n = this.scaleLines;
                        this._xmesh && this._xmesh.position.copyFrom(e), this._ymesh && this._ymesh.position.copyFrom(e), this._zmesh && this._zmesh.position.copyFrom(e);
                        var o = this._xline[1];
                        o.x = t.x * n, o.y = t.y * n, o.z = t.z * n, $t.Mesh.CreateLines("", this._xline, null, !1, this._xmesh), (o = this._yline[1]).x = i.x * n, o.y = i.y * n, o.z = i.z * n, $t.Mesh.CreateLines("", this._yline, null, !1, this._ymesh), (o = this._zline[1]).x = r.x * n, o.y = r.y * n, o.z = r.z * n, $t.Mesh.CreateLines("", this._zline, null, !1, this._zmesh)
                    }, e.prototype.dispose = function() {
                        this._xmesh && this._xmesh.dispose(), this._ymesh && this._ymesh.dispose(), this._zmesh && this._zmesh.dispose(), this._xmesh = null, this._ymesh = null, this._zmesh = null, this.scene = null
                    }, e
                }(), ei.AxesViewer = ti, ii = $a || ($a = {}), ri = ii.Debug || (ii.Debug = {}), ni = function(e) {
                    function t(t, i, r, n) {
                        void 0 === n && (n = 1);
                        var o = e.call(this, t, n) || this;
                        return o.pos = ii.Vector3.Zero(), o.xaxis = ii.Vector3.Zero(), o.yaxis = ii.Vector3.Zero(), o.zaxis = ii.Vector3.Zero(), o.mesh = r, o.bone = i, o
                    }
                    return b(t, e), t.prototype.update = function() {
                        if (this.mesh && this.bone) {
                            var t = this.bone;
                            t.getAbsolutePositionToRef(this.mesh, this.pos), t.getDirectionToRef(ii.Axis.X, this.mesh, this.xaxis), t.getDirectionToRef(ii.Axis.Y, this.mesh, this.yaxis), t.getDirectionToRef(ii.Axis.Z, this.mesh, this.zaxis), e.prototype.update.call(this, this.pos, this.xaxis, this.yaxis, this.zaxis)
                        }
                    }, t.prototype.dispose = function() {
                        this.mesh && (this.mesh = null, this.bone = null, e.prototype.dispose.call(this))
                    }, t
                }(ri.AxesViewer), ri.BoneAxesViewer = ni, oi = $a || ($a = {}), si = function() {
                    function e(e) {
                        this.ray = e
                    }
                    return e.CreateAndShow = function(t, i, r) {
                        var n = new e(t);
                        return n.show(i, r), n
                    }, e.prototype.show = function(e, t) {
                        if (!this._renderFunction && this.ray) {
                            var i = this.ray;
                            this._renderFunction = this._render.bind(this), this._scene = e, this._renderPoints = [i.origin, i.origin.add(i.direction.scale(i.length))], this._renderLine = oi.Mesh.CreateLines("ray", this._renderPoints, e, !0), this._renderFunction && this._scene.registerBeforeRender(this._renderFunction)
                        }
                        t && this._renderLine && this._renderLine.color.copyFrom(t)
                    }, e.prototype.hide = function() {
                        this._renderFunction && this._scene && (this._scene.unregisterBeforeRender(this._renderFunction), this._scene = null, this._renderFunction = null, this._renderLine && (this._renderLine.dispose(), this._renderLine = null), this._renderPoints = [])
                    }, e.prototype._render = function() {
                        var e = this.ray;
                        if (e) {
                            var t = this._renderPoints[1],
                                i = Math.min(e.length, 1e6);
                            t.copyFrom(e.direction), t.scaleInPlace(i), t.addInPlace(e.origin), oi.Mesh.CreateLines("ray", this._renderPoints, this._scene, !0, this._renderLine)
                        }
                    }, e.prototype.attachToMesh = function(e, t, i, r) {
                        this._attachedToMesh = e;
                        var n = this.ray;
                        n && (n.direction || (n.direction = oi.Vector3.Zero()), n.origin || (n.origin = oi.Vector3.Zero()), r && (n.length = r), i || (i = oi.Vector3.Zero()), t || (t = new oi.Vector3(0, 0, -1)), this._meshSpaceDirection ? (this._meshSpaceDirection.copyFrom(t), this._meshSpaceOrigin.copyFrom(i)) : (this._meshSpaceDirection = t.clone(), this._meshSpaceOrigin = i.clone()), this._updateToMeshFunction || (this._updateToMeshFunction = this._updateToMesh.bind(this), this._attachedToMesh.getScene().registerBeforeRender(this._updateToMeshFunction)), this._updateToMesh())
                    }, e.prototype.detachFromMesh = function() {
                        this._attachedToMesh && (this._updateToMeshFunction && this._attachedToMesh.getScene().unregisterBeforeRender(this._updateToMeshFunction), this._attachedToMesh = null, this._updateToMeshFunction = null)
                    }, e.prototype._updateToMesh = function() {
                        var e = this.ray;
                        this._attachedToMesh && e && (this._attachedToMesh._isDisposed ? this.detachFromMesh() : (this._attachedToMesh.getDirectionToRef(this._meshSpaceDirection, e.direction),
                            oi.Vector3.TransformCoordinatesToRef(this._meshSpaceOrigin, this._attachedToMesh.getWorldMatrix(), e.origin)))
                    }, e.prototype.dispose = function() {
                        this.hide(), this.detachFromMesh(), this.ray = null
                    }, e
                }(), oi.RayHelper = si,
                function(e) {
                    Object.defineProperty(e.Scene.prototype, "debugLayer", {
                        get: function() {
                            return this._debugLayer || (this._debugLayer = new t(this)), this._debugLayer
                        },
                        enumerable: !0,
                        configurable: !0
                    });
                    var t = function() {
                        function t(t) {
                            var i = this;
                            this.BJSINSPECTOR = "undefined" != typeof INSPECTOR ? INSPECTOR : void 0, this.onPropertyChangedObservable = new e.Observable, this._scene = t, this._scene.onDisposeObservable.add(function() {
                                i._scene._debugLayer && i._scene._debugLayer.hide()
                            })
                        }
                        return t.prototype._createInspector = function(e) {
                            void 0 === e && (e = {});
                            var t = e.popup || !1,
                                i = e.initialTab || 0,
                                r = e.parentElement || null;
                            this._inspector || (this.BJSINSPECTOR = this.BJSINSPECTOR || "undefined" != typeof INSPECTOR ? INSPECTOR : void 0, this._inspector = new this.BJSINSPECTOR.Inspector(this._scene, t, i, r, e.newColors))
                        }, t.prototype.isVisible = function() {
                            return !!this._inspector
                        }, t.prototype.hide = function() {
                            if (this._inspector) {
                                try {
                                    this._inspector.dispose()
                                } catch (e) {}
                                this.onPropertyChangedObservable.clear(), this._inspector = null
                            }
                        }, t.prototype.show = function(i) {
                            void 0 === i && (i = {}), void 0 === this.BJSINSPECTOR ? e.Tools.LoadScript(t.InspectorURL, this._createInspector.bind(this, i)) : this._createInspector(i)
                        }, t.prototype.getActiveTab = function() {
                            return this._inspector ? this._inspector.getActiveTabIndex() : -1
                        }, t.InspectorURL = "https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js", t
                    }();
                    e.DebugLayer = t
                }($a || ($a = {})), ai = $a || ($a = {}), li = ai.Debug || (ai.Debug = {}), ui = function() {
                    function e(e) {
                        this._impostors = [], this._meshes = [], this._numMeshes = 0, this._scene = e || ai.Engine.LastCreatedScene;
                        var t = this._scene.getPhysicsEngine();
                        t && (this._physicsEnginePlugin = t.getPhysicsPlugin())
                    }
                    return e.prototype._updateDebugMeshes = function() {
                        for (var e = this._physicsEnginePlugin, t = 0; t < this._numMeshes; t++) {
                            var i = this._impostors[t];
                            if (i)
                                if (i.isDisposed) this.hideImpostor(this._impostors[t--]);
                                else {
                                    var r = this._meshes[t];
                                    r && e && e.syncMeshWithImpostor(r, i)
                                }
                        }
                    }, e.prototype.showImpostor = function(e) {
                        if (this._scene) {
                            for (var t = 0; t < this._numMeshes; t++)
                                if (this._impostors[t] == e) return;
                            var i = this._getDebugMesh(e, this._scene);
                            i && (this._impostors[this._numMeshes] = e, this._meshes[this._numMeshes] = i, 0 === this._numMeshes && (this._renderFunction = this._updateDebugMeshes.bind(this), this._scene.registerBeforeRender(this._renderFunction)), this._numMeshes++)
                        }
                    }, e.prototype.hideImpostor = function(e) {
                        if (e && this._scene) {
                            for (var t = !1, i = 0; i < this._numMeshes; i++)
                                if (this._impostors[i] == e) {
                                    var r = this._meshes[i];
                                    if (!r) continue;
                                    this._scene.removeMesh(r), r.dispose(), this._numMeshes--, 0 < this._numMeshes ? (this._meshes[i] = this._meshes[this._numMeshes], this._impostors[i] = this._impostors[this._numMeshes], this._meshes[this._numMeshes] = null, this._impostors[this._numMeshes] = null) : (this._meshes[0] = null, this._impostors[0] = null), t = !0;
                                    break
                                }
                            t && 0 === this._numMeshes && this._scene.unregisterBeforeRender(this._renderFunction)
                        }
                    }, e.prototype._getDebugMaterial = function(e) {
                        return this._debugMaterial || (this._debugMaterial = new ai.StandardMaterial("", e), this._debugMaterial.wireframe = !0), this._debugMaterial
                    }, e.prototype._getDebugBoxMesh = function(e) {
                        return this._debugBoxMesh || (this._debugBoxMesh = ai.MeshBuilder.CreateBox("physicsBodyBoxViewMesh", {
                            size: 1
                        }, e), this._debugBoxMesh.renderingGroupId = 1, this._debugBoxMesh.rotationQuaternion = ai.Quaternion.Identity(), this._debugBoxMesh.material = this._getDebugMaterial(e), e.removeMesh(this._debugBoxMesh)), this._debugBoxMesh.createInstance("physicsBodyBoxViewInstance")
                    }, e.prototype._getDebugSphereMesh = function(e) {
                        return this._debugSphereMesh || (this._debugSphereMesh = ai.MeshBuilder.CreateSphere("physicsBodySphereViewMesh", {
                            diameter: 1
                        }, e), this._debugSphereMesh.renderingGroupId = 1, this._debugSphereMesh.rotationQuaternion = ai.Quaternion.Identity(), this._debugSphereMesh.material = this._getDebugMaterial(e), e.removeMesh(this._debugSphereMesh)), this._debugSphereMesh.createInstance("physicsBodyBoxViewInstance")
                    }, e.prototype._getDebugMesh = function(e, t) {
                        var i = null;
                        if (e.type == ai.PhysicsImpostor.BoxImpostor) i = this._getDebugBoxMesh(t), e.getBoxSizeToRef(i.scaling);
                        else if (e.type == ai.PhysicsImpostor.SphereImpostor) {
                            i = this._getDebugSphereMesh(t);
                            var r = e.getRadius();
                            i.scaling.x = 2 * r, i.scaling.y = 2 * r, i.scaling.z = 2 * r
                        }
                        return i
                    }, e.prototype.dispose = function() {
                        for (var e = 0; e < this._numMeshes; e++) this.hideImpostor(this._impostors[e]);
                        this._debugBoxMesh && this._debugBoxMesh.dispose(), this._debugSphereMesh && this._debugSphereMesh.dispose(), this._debugMaterial && this._debugMaterial.dispose(), this._impostors.length = 0, this._scene = null, this._physicsEnginePlugin = null
                    }, e
                }(), li.PhysicsViewer = ui,
                function(e) {
                    Object.defineProperty(e.Scene.prototype, "forceShowBoundingBoxes", {
                        get: function() {
                            return this._forceShowBoundingBoxes || !1
                        },
                        set: function(e) {
                            (this._forceShowBoundingBoxes = e) && this.getBoundingBoxRenderer()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.Scene.prototype.getBoundingBoxRenderer = function() {
                        return this._boundingBoxRenderer || (this._boundingBoxRenderer = new t(this)), this._boundingBoxRenderer
                    }, Object.defineProperty(e.AbstractMesh.prototype, "showBoundingBox", {
                        get: function() {
                            return this._showBoundingBox || !1
                        },
                        set: function(e) {
                            (this._showBoundingBox = e) && this.getScene().getBoundingBoxRenderer()
                        },
                        enumerable: !0,
                        configurable: !0
                    });
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_BOUNDINGBOXRENDERER, this.frontColor = new e.Color3(1, 1, 1), this.backColor = new e.Color3(.1, .1, .1), this.showBackLines = !0, this.renderList = new e.SmartArray(32), this._vertexBuffers = {}, (this.scene = t)._addComponent(this)
                        }
                        return t.prototype.register = function() {
                            this.scene._beforeEvaluateActiveMeshStage.registerStep(e.SceneComponentConstants.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER, this, this.reset), this.scene._activeMeshStage.registerStep(e.SceneComponentConstants.STEP_ACTIVEMESH_BOUNDINGBOXRENDERER, this, this._activeMesh), this.scene._evaluateSubMeshStage.registerStep(e.SceneComponentConstants.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER, this, this._evaluateSubMesh), this.scene._afterRenderingGroupDrawStage.registerStep(e.SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER, this, this.render)
                        }, t.prototype._evaluateSubMesh = function(e, t) {
                            if (e.showSubMeshesBoundingBox) {
                                var i = t.getBoundingInfo();
                                null != i && (i.boundingBox._tag = e.renderingGroupId, this.renderList.push(i.boundingBox))
                            }
                        }, t.prototype._activeMesh = function(e, t) {
                            if (e.showBoundingBox || this.scene.forceShowBoundingBoxes) {
                                var i = e.getBoundingInfo();
                                i.boundingBox._tag = t.renderingGroupId, this.renderList.push(i.boundingBox)
                            }
                        }, t.prototype._prepareRessources = function() {
                            if (!this._colorShader) {
                                this._colorShader = new e.ShaderMaterial("colorShader", this.scene, "color", {
                                    attributes: [e.VertexBuffer.PositionKind],
                                    uniforms: ["world", "viewProjection", "color"]
                                });
                                var t = this.scene.getEngine(),
                                    i = e.VertexData.CreateBox({
                                        size: 1
                                    });
                                this._vertexBuffers[e.VertexBuffer.PositionKind] = new e.VertexBuffer(t, i.positions, e.VertexBuffer.PositionKind, !1), this._createIndexBuffer()
                            }
                        }, t.prototype._createIndexBuffer = function() {
                            var e = this.scene.getEngine();
                            this._indexBuffer = e.createIndexBuffer([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 7, 1, 6, 2, 5, 3, 4])
                        }, t.prototype.rebuild = function() {
                            var t = this._vertexBuffers[e.VertexBuffer.PositionKind];
                            t && t._rebuild(), this._createIndexBuffer()
                        }, t.prototype.reset = function() {
                            this.renderList.reset()
                        }, t.prototype.render = function(t) {
                            if (0 !== this.renderList.length && (this._prepareRessources(), this._colorShader.isReady())) {
                                var i = this.scene.getEngine();
                                i.setDepthWrite(!1), this._colorShader._preBind();
                                for (var r = 0; r < this.renderList.length; r++) {
                                    var n = this.renderList.data[r];
                                    if (n._tag === t) {
                                        var o = n.minimum,
                                            s = n.maximum.subtract(o),
                                            a = o.add(s.scale(.5)),
                                            l = e.Matrix.Scaling(s.x, s.y, s.z).multiply(e.Matrix.Translation(a.x, a.y, a.z)).multiply(n.getWorldMatrix());
                                        i.bindBuffers(this._vertexBuffers, this._indexBuffer, this._colorShader.getEffect()), this.showBackLines && (i.setDepthFunctionToGreaterOrEqual(), this.scene.resetCachedMaterial(), this._colorShader.setColor4("color", this.backColor.toColor4()), this._colorShader.bind(l), i.drawElementsType(e.Material.LineListDrawMode, 0, 24)), i.setDepthFunctionToLess(), this.scene.resetCachedMaterial(), this._colorShader.setColor4("color", this.frontColor.toColor4()), this._colorShader.bind(l), i.drawElementsType(e.Material.LineListDrawMode, 0, 24)
                                    }
                                }
                                this._colorShader.unbind(), i.setDepthFunctionToLessOrEqual(), i.setDepthWrite(!0)
                            }
                        }, t.prototype.renderOcclusionBoundingBox = function(t) {
                            if (this._prepareRessources(), this._colorShader.isReady() && t._boundingInfo) {
                                var i = this.scene.getEngine();
                                i.setDepthWrite(!1), i.setColorWrite(!1), this._colorShader._preBind();
                                var r = t._boundingInfo.boundingBox,
                                    n = r.minimum,
                                    o = r.maximum.subtract(n),
                                    s = n.add(o.scale(.5)),
                                    a = e.Matrix.Scaling(o.x, o.y, o.z).multiply(e.Matrix.Translation(s.x, s.y, s.z)).multiply(r.getWorldMatrix());
                                i.bindBuffers(this._vertexBuffers, this._indexBuffer, this._colorShader.getEffect()), i.setDepthFunctionToLess(), this.scene.resetCachedMaterial(), this._colorShader.bind(a), i.drawElementsType(e.Material.LineListDrawMode, 0, 24), this._colorShader.unbind(), i.setDepthFunctionToLessOrEqual(), i.setDepthWrite(!0), i.setColorWrite(!0)
                            }
                        }, t.prototype.dispose = function() {
                            if (this._colorShader) {
                                this.renderList.dispose(), this._colorShader.dispose();
                                var t = this._vertexBuffers[e.VertexBuffer.PositionKind];
                                t && (t.dispose(), this._vertexBuffers[e.VertexBuffer.PositionKind] = null), this.scene.getEngine()._releaseBuffer(this._indexBuffer)
                            }
                        }, t
                    }();
                    e.BoundingBoxRenderer = t
                }($a || ($a = {})), (ci = $a || ($a = {})).Engine.prototype.createTransformFeedback = function() {
                    return this._gl.createTransformFeedback()
                }, ci.Engine.prototype.deleteTransformFeedback = function(e) {
                    this._gl.deleteTransformFeedback(e)
                }, ci.Engine.prototype.bindTransformFeedback = function(e) {
                    this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK, e)
                }, ci.Engine.prototype.beginTransformFeedback = function(e) {
                    void 0 === e && (e = !0), this._gl.beginTransformFeedback(e ? this._gl.POINTS : this._gl.TRIANGLES)
                }, ci.Engine.prototype.endTransformFeedback = function() {
                    this._gl.endTransformFeedback()
                }, ci.Engine.prototype.setTranformFeedbackVaryings = function(e, t) {
                    this._gl.transformFeedbackVaryings(e, t, this._gl.INTERLEAVED_ATTRIBS)
                }, ci.Engine.prototype.bindTransformFeedbackBuffer = function(e) {
                    this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER, 0, e)
                }, hi = $a || ($a = {}), di = function(e) {
                    function t(t, i, r, n) {
                        void 0 === n && (n = !1);
                        var o = e.call(this, t) || this;
                        o.layerMask = 268435455, o._accumulatedCount = 0, o._targetIndex = 0, o._currentRenderId = -1, o._started = !1, o._stopped = !1, o._timeDelta = 0, o._attributesStrideSize = 21, o._actualFrame = 0, o._rawTextureWidth = 256, o.onDisposeObservable = new hi.Observable, o.forceDepthWrite = !1, o._preWarmDone = !1, o._scene = r || hi.Engine.LastCreatedScene, o._attachImageProcessingConfiguration(null), o._engine = o._scene.getEngine(), i.randomTextureSize || delete i.randomTextureSize;
                        var s = ae({
                                capacity: 5e4,
                                randomTextureSize: o._engine.getCaps().maxTextureSize
                            }, i),
                            a = i;
                        isFinite(a) && (s.capacity = a), o._capacity = s.capacity, o._activeCount = s.capacity, o._currentActiveCount = 0, o._isAnimationSheetEnabled = n, o._scene.particleSystems.push(o), o._updateEffectOptions = {
                            attributes: ["position", "age", "life", "seed", "size", "color", "direction", "initialDirection", "angle", "cellIndex", "cellStartOffset", "noiseCoordinates1", "noiseCoordinates2"],
                            uniformsNames: ["currentCount", "timeDelta", "emitterWM", "lifeTime", "color1", "color2", "sizeRange", "scaleRange", "gravity", "emitPower", "direction1", "direction2", "minEmitBox", "maxEmitBox", "radius", "directionRandomizer", "height", "coneAngle", "stopFactor", "angleRange", "radiusRange", "cellInfos", "noiseStrength", "limitVelocityDamping"],
                            uniformBuffersNames: [],
                            samplers: ["randomSampler", "randomSampler2", "sizeGradientSampler", "angularSpeedGradientSampler", "velocityGradientSampler", "limitVelocityGradientSampler", "noiseSampler", "dragGradientSampler"],
                            defines: "",
                            fallbacks: null,
                            onCompiled: null,
                            onError: null,
                            indexParameters: null,
                            maxSimultaneousLights: 0,
                            transformFeedbackVaryings: []
                        }, o.particleEmitterType = new hi.BoxParticleEmitter;
                        for (var l = Math.min(o._engine.getCaps().maxTextureSize, s.randomTextureSize), u = [], c = 0; c < l; ++c) u.push(Math.random()), u.push(Math.random()), u.push(Math.random()), u.push(Math.random());
                        for (o._randomTexture = new hi.RawTexture(new Float32Array(u), l, 1, hi.Engine.TEXTUREFORMAT_RGBA, o._scene, !1, !1, hi.Texture.NEAREST_SAMPLINGMODE, hi.Engine.TEXTURETYPE_FLOAT), o._randomTexture.wrapU = hi.Texture.WRAP_ADDRESSMODE, o._randomTexture.wrapV = hi.Texture.WRAP_ADDRESSMODE, u = [], c = 0; c < l; ++c) u.push(Math.random()), u.push(Math.random()), u.push(Math.random()), u.push(Math.random());
                        return o._randomTexture2 = new hi.RawTexture(new Float32Array(u), l, 1, hi.Engine.TEXTUREFORMAT_RGBA, o._scene, !1, !1, hi.Texture.NEAREST_SAMPLINGMODE, hi.Engine.TEXTURETYPE_FLOAT), o._randomTexture2.wrapU = hi.Texture.WRAP_ADDRESSMODE, o._randomTexture2.wrapV = hi.Texture.WRAP_ADDRESSMODE, o._randomTextureSize = l, o
                    }
                    return b(t, e), Object.defineProperty(t, "IsSupported", {
                        get: function() {
                            return !!hi.Engine.LastCreatedEngine && 1 < hi.Engine.LastCreatedEngine.webGLVersion
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getCapacity = function() {
                        return this._capacity
                    }, Object.defineProperty(t.prototype, "activeParticleCount", {
                        get: function() {
                            return this._activeCount
                        },
                        set: function(e) {
                            this._activeCount = Math.min(e, this._capacity)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.isReady = function() {
                        return this._updateEffect ? !!(this.emitter && this._updateEffect.isReady() && this._imageProcessingConfiguration.isReady() && this._renderEffect.isReady() && this.particleTexture && this.particleTexture.isReady()) : (this._recreateUpdateEffect(), this._recreateRenderEffect(), !1)
                    }, t.prototype.isStarted = function() {
                        return this._started
                    }, t.prototype.start = function(e) {
                        var t = this;
                        if (void 0 === e && (e = this.startDelay), !this.targetStopDuration && this._hasTargetStopDurationDependantGradient()) throw "Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";
                        e ? setTimeout(function() {
                            t.start(0)
                        }, e) : (this._started = !0, this._stopped = !1, this._preWarmDone = !1, this.beginAnimationOnStart && this.animations && 0 < this.animations.length && this.getScene().beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop))
                    }, t.prototype.stop = function() {
                        this._stopped = !0
                    }, t.prototype.reset = function() {
                        this._releaseBuffers(), this._releaseVAOs(), this._currentActiveCount = 0, this._targetIndex = 0
                    }, t.prototype.getClassName = function() {
                        return "GPUParticleSystem"
                    }, t.prototype._removeGradientAndTexture = function(t, i, r) {
                        return e.prototype._removeGradientAndTexture.call(this, t, i, r), this._releaseBuffers(), this
                    }, t.prototype.addColorGradient = function(e, t, i) {
                        this._colorGradients || (this._colorGradients = []);
                        var r = new hi.ColorGradient;
                        return r.gradient = e, r.color1 = t, this._colorGradients.push(r), this._colorGradients.sort(function(e, t) {
                            return e.gradient < t.gradient ? -1 : e.gradient > t.gradient ? 1 : 0
                        }), this._colorGradientsTexture && (this._colorGradientsTexture.dispose(), this._colorGradientsTexture = null), this._releaseBuffers(), this
                    }, t.prototype.removeColorGradient = function(e) {
                        return this._removeGradientAndTexture(e, this._colorGradients, this._colorGradientsTexture), this._colorGradientsTexture = null, this
                    }, t.prototype._addFactorGradient = function(e, t, i) {
                        var r = new hi.FactorGradient;
                        r.gradient = t, r.factor1 = i, e.push(r), e.sort(function(e, t) {
                            return e.gradient < t.gradient ? -1 : e.gradient > t.gradient ? 1 : 0
                        }), this._releaseBuffers()
                    }, t.prototype.addSizeGradient = function(e, t) {
                        return this._sizeGradients || (this._sizeGradients = []), this._addFactorGradient(this._sizeGradients, e, t), this._sizeGradientsTexture && (this._sizeGradientsTexture.dispose(), this._sizeGradientsTexture = null), this._releaseBuffers(), this
                    }, t.prototype.removeSizeGradient = function(e) {
                        return this._removeGradientAndTexture(e, this._sizeGradients, this._sizeGradientsTexture), this._sizeGradientsTexture = null, this
                    }, t.prototype.addAngularSpeedGradient = function(e, t) {
                        return this._angularSpeedGradients || (this._angularSpeedGradients = []), this._addFactorGradient(this._angularSpeedGradients, e, t), this._angularSpeedGradientsTexture && (this._angularSpeedGradientsTexture.dispose(), this._angularSpeedGradientsTexture = null), this._releaseBuffers(), this
                    }, t.prototype.removeAngularSpeedGradient = function(e) {
                        return this._removeGradientAndTexture(e, this._angularSpeedGradients, this._angularSpeedGradientsTexture), this._angularSpeedGradientsTexture = null, this
                    }, t.prototype.addVelocityGradient = function(e, t) {
                        return this._velocityGradients || (this._velocityGradients = []), this._addFactorGradient(this._velocityGradients, e, t), this._velocityGradientsTexture && (this._velocityGradientsTexture.dispose(), this._velocityGradientsTexture = null), this._releaseBuffers(), this
                    }, t.prototype.removeVelocityGradient = function(e) {
                        return this._removeGradientAndTexture(e, this._velocityGradients, this._velocityGradientsTexture), this._velocityGradientsTexture = null, this
                    }, t.prototype.addLimitVelocityGradient = function(e, t) {
                        return this._limitVelocityGradients || (this._limitVelocityGradients = []), this._addFactorGradient(this._limitVelocityGradients, e, t), this._limitVelocityGradientsTexture && (this._limitVelocityGradientsTexture.dispose(), this._limitVelocityGradientsTexture = null), this._releaseBuffers(), this
                    }, t.prototype.removeLimitVelocityGradient = function(e) {
                        return this._removeGradientAndTexture(e, this._limitVelocityGradients, this._limitVelocityGradientsTexture), this._limitVelocityGradientsTexture = null, this
                    }, t.prototype.addDragGradient = function(e, t) {
                        return this._dragGradients || (this._dragGradients = []), this._addFactorGradient(this._dragGradients, e, t), this._dragGradientsTexture && (this._dragGradientsTexture.dispose(), this._dragGradientsTexture = null), this._releaseBuffers(), this
                    }, t.prototype.removeDragGradient = function(e) {
                        return this._removeGradientAndTexture(e, this._dragGradients, this._dragGradientsTexture), this._dragGradientsTexture = null, this
                    }, t.prototype.addEmitRateGradient = function(e, t, i) {
                        return this
                    }, t.prototype.removeEmitRateGradient = function(e) {
                        return this
                    }, t.prototype.addStartSizeGradient = function(e, t, i) {
                        return this
                    }, t.prototype.removeStartSizeGradient = function(e) {
                        return this
                    }, t.prototype.addColorRemapGradient = function(e, t, i) {
                        return this
                    }, t.prototype.removeColorRemapGradient = function(e) {
                        return this
                    }, t.prototype.addAlphaRemapGradient = function(e, t, i) {
                        return this
                    }, t.prototype.removeAlphaRemapGradient = function(e) {
                        return this
                    }, t.prototype.addRampGradient = function(e, t) {
                        return this
                    }, t.prototype.removeRampGradient = function(e) {
                        return this
                    }, t.prototype.getRampGradients = function() {
                        return null
                    }, Object.defineProperty(t.prototype, "useRampGradients", {
                        get: function() {
                            return !1
                        },
                        set: function(e) {},
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.addLifeTimeGradient = function(e, t, i) {
                        return this
                    }, t.prototype.removeLifeTimeGradient = function(e) {
                        return this
                    }, t.prototype._reset = function() {
                        this._releaseBuffers()
                    }, t.prototype._createUpdateVAO = function(e) {
                        var t = {};
                        t.position = e.createVertexBuffer("position", 0, 3), t.age = e.createVertexBuffer("age", 3, 1), t.life = e.createVertexBuffer("life", 4, 1), t.seed = e.createVertexBuffer("seed", 5, 4), t.size = e.createVertexBuffer("size", 9, 3);
                        var i = 12;
                        this._colorGradientsTexture || (t.color = e.createVertexBuffer("color", i, 4), i += 4), t.direction = e.createVertexBuffer("direction", i, 3), i += 3, this._isBillboardBased || (t.initialDirection = e.createVertexBuffer("initialDirection", i, 3), i += 3), this._angularSpeedGradientsTexture ? (t.angle = e.createVertexBuffer("angle", i, 1), i += 1) : (t.angle = e.createVertexBuffer("angle", i, 2), i += 2), this._isAnimationSheetEnabled && (t.cellIndex = e.createVertexBuffer("cellIndex", i, 1), i += 1, this.spriteRandomStartCell && (t.cellStartOffset = e.createVertexBuffer("cellStartOffset", i, 1), i += 1)), this.noiseTexture && (t.noiseCoordinates1 = e.createVertexBuffer("noiseCoordinates1", i, 3), i += 3, t.noiseCoordinates2 = e.createVertexBuffer("noiseCoordinates2", i, 3), i += 3);
                        var r = this._engine.recordVertexArrayObject(t, null, this._updateEffect);
                        return this._engine.bindArrayBuffer(null), r
                    }, t.prototype._createRenderVAO = function(e, t) {
                        var i = {};
                        i.position = e.createVertexBuffer("position", 0, 3, this._attributesStrideSize, !0), i.age = e.createVertexBuffer("age", 3, 1, this._attributesStrideSize, !0), i.life = e.createVertexBuffer("life", 4, 1, this._attributesStrideSize, !0), i.size = e.createVertexBuffer("size", 9, 3, this._attributesStrideSize, !0);
                        var r = 12;
                        this._colorGradientsTexture || (i.color = e.createVertexBuffer("color", r, 4, this._attributesStrideSize, !0), r += 4), this.billboardMode === hi.ParticleSystem.BILLBOARDMODE_STRETCHED && (i.direction = e.createVertexBuffer("direction", r, 3, this._attributesStrideSize, !0)), r += 3, this._isBillboardBased || (i.initialDirection = e.createVertexBuffer("initialDirection", r, 3, this._attributesStrideSize, !0), r += 3), i.angle = e.createVertexBuffer("angle", r, 1, this._attributesStrideSize, !0), this._angularSpeedGradientsTexture ? r++ : r += 2, this._isAnimationSheetEnabled && (i.cellIndex = e.createVertexBuffer("cellIndex", r, 1, this._attributesStrideSize, !0), r += 1, this.spriteRandomStartCell && (i.cellStartOffset = e.createVertexBuffer("cellStartOffset", r, 1, this._attributesStrideSize, !0), r += 1)), this.noiseTexture && (i.noiseCoordinates1 = e.createVertexBuffer("noiseCoordinates1", r, 3, this._attributesStrideSize, !0), r += 3, i.noiseCoordinates2 = e.createVertexBuffer("noiseCoordinates2", r, 3, this._attributesStrideSize, !0), r += 3), i.offset = t.createVertexBuffer("offset", 0, 2), i.uv = t.createVertexBuffer("uv", 2, 2);
                        var n = this._engine.recordVertexArrayObject(i, null, this._renderEffect);
                        return this._engine.bindArrayBuffer(null), n
                    }, t.prototype._initialize = function(e) {
                        if (void 0 === e && (e = !1), !this._buffer0 || e) {
                            var t = this._scene.getEngine(),
                                i = new Array;
                            this.isBillboardBased || (this._attributesStrideSize += 3), this._colorGradientsTexture && (this._attributesStrideSize -= 4), this._angularSpeedGradientsTexture && (this._attributesStrideSize -= 1), this._isAnimationSheetEnabled && (this._attributesStrideSize += 1, this.spriteRandomStartCell && (this._attributesStrideSize += 1)), this.noiseTexture && (this._attributesStrideSize += 6);
                            for (var r = 0; r < this._capacity; r++) i.push(0), i.push(0), i.push(0), i.push(0), i.push(0), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(0), i.push(0), i.push(0), this._colorGradientsTexture || (i.push(0), i.push(0), i.push(0), i.push(0)), i.push(0), i.push(0), i.push(0), this.isBillboardBased || (i.push(0), i.push(0), i.push(0)), i.push(0), this._angularSpeedGradientsTexture || i.push(0), this._isAnimationSheetEnabled && (i.push(0), this.spriteRandomStartCell && i.push(0)), this.noiseTexture && (i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()));
                            var n = new Float32Array([.5, .5, 1, 1, -.5, .5, 0, 1, -.5, -.5, 0, 0, .5, -.5, 1, 0]);
                            this._buffer0 = new hi.Buffer(t, i, !1, this._attributesStrideSize), this._buffer1 = new hi.Buffer(t, i, !1, this._attributesStrideSize), this._spriteBuffer = new hi.Buffer(t, n, !1, 4), this._updateVAO = [], this._updateVAO.push(this._createUpdateVAO(this._buffer0)), this._updateVAO.push(this._createUpdateVAO(this._buffer1)), this._renderVAO = [], this._renderVAO.push(this._createRenderVAO(this._buffer1, this._spriteBuffer)), this._renderVAO.push(this._createRenderVAO(this._buffer0, this._spriteBuffer)), this._sourceBuffer = this._buffer0, this._targetBuffer = this._buffer1
                        }
                    }, t.prototype._recreateUpdateEffect = function() {
                        var e = this.particleEmitterType ? this.particleEmitterType.getEffectDefines() : "";
                        this._isBillboardBased && (e += "\n#define BILLBOARD"), this._colorGradientsTexture && (e += "\n#define COLORGRADIENTS"), this._sizeGradientsTexture && (e += "\n#define SIZEGRADIENTS"), this._angularSpeedGradientsTexture && (e += "\n#define ANGULARSPEEDGRADIENTS"), this._velocityGradientsTexture && (e += "\n#define VELOCITYGRADIENTS"), this._limitVelocityGradientsTexture && (e += "\n#define LIMITVELOCITYGRADIENTS"), this._dragGradientsTexture && (e += "\n#define DRAGGRADIENTS"), this.isAnimationSheetEnabled && (e += "\n#define ANIMATESHEET", this.spriteRandomStartCell && (e += "\n#define ANIMATESHEETRANDOMSTART")), this.noiseTexture && (e += "\n#define NOISE"), this._updateEffect && this._updateEffectOptions.defines === e || (this._updateEffectOptions.transformFeedbackVaryings = ["outPosition", "outAge", "outLife", "outSeed", "outSize"], this._colorGradientsTexture || this._updateEffectOptions.transformFeedbackVaryings.push("outColor"), this._updateEffectOptions.transformFeedbackVaryings.push("outDirection"), this._isBillboardBased || this._updateEffectOptions.transformFeedbackVaryings.push("outInitialDirection"), this._updateEffectOptions.transformFeedbackVaryings.push("outAngle"), this.isAnimationSheetEnabled && (this._updateEffectOptions.transformFeedbackVaryings.push("outCellIndex"), this.spriteRandomStartCell && this._updateEffectOptions.transformFeedbackVaryings.push("outCellStartOffset")), this.noiseTexture && (this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates1"), this._updateEffectOptions.transformFeedbackVaryings.push("outNoiseCoordinates2")), this._updateEffectOptions.defines = e, this._updateEffect = new hi.Effect("gpuUpdateParticles", this._updateEffectOptions, this._scene.getEngine()))
                    }, t.prototype._recreateRenderEffect = function() {
                        var e = "";
                        if (this._scene.clipPlane && (e = "\n#define CLIPPLANE"), this._scene.clipPlane2 && (e = "\n#define CLIPPLANE2"), this._scene.clipPlane3 && (e = "\n#define CLIPPLANE3"), this._scene.clipPlane4 && (e = "\n#define CLIPPLANE4"), this.blendMode === hi.ParticleSystem.BLENDMODE_MULTIPLY && (e = "\n#define BLENDMULTIPLYMODE"), this._isBillboardBased) switch (e += "\n#define BILLBOARD", this.billboardMode) {
                            case hi.ParticleSystem.BILLBOARDMODE_Y:
                                e += "\n#define BILLBOARDY";
                                break;
                            case hi.ParticleSystem.BILLBOARDMODE_STRETCHED:
                                e += "\n#define BILLBOARDSTRETCHED";
                                break;
                            case hi.ParticleSystem.BILLBOARDMODE_ALL:
                        }
                        if (this._colorGradientsTexture && (e += "\n#define COLORGRADIENTS"), this.isAnimationSheetEnabled && (e += "\n#define ANIMATESHEET"), this._imageProcessingConfiguration && (this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines), e += "\n" + this._imageProcessingConfigurationDefines.toString()), !this._renderEffect || this._renderEffect.defines !== e) {
                            var t = ["view", "projection", "colorDead", "invView", "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "sheetInfos", "translationPivot", "eyePosition"],
                                i = ["textureSampler", "colorGradientSampler"];
                            hi.ImageProcessingConfiguration && (hi.ImageProcessingConfiguration.PrepareUniforms(t, this._imageProcessingConfigurationDefines), hi.ImageProcessingConfiguration.PrepareSamplers(i, this._imageProcessingConfigurationDefines)), this._renderEffect = new hi.Effect("gpuRenderParticles", ["position", "age", "life", "size", "color", "offset", "uv", "direction", "initialDirection", "angle", "cellIndex"], t, i, this._scene.getEngine(), e)
                        }
                    }, t.prototype.animate = function(e) {
                        void 0 === e && (e = !1), this._timeDelta = this.updateSpeed * (e ? this.preWarmStepOffset : this._scene.getAnimationRatio()), this._actualFrame += this._timeDelta, this._stopped || this.targetStopDuration && this._actualFrame >= this.targetStopDuration && this.stop()
                    }, t.prototype._createFactorGradientTexture = function(e, t) {
                        var i = this[t];
                        if (e && e.length && !i) {
                            for (var r = new Float32Array(this._rawTextureWidth), n = 0; n < this._rawTextureWidth; n++) {
                                var o = n / this._rawTextureWidth;
                                hi.Tools.GetCurrentGradient(o, e, function(e, t, i) {
                                    r[n] = hi.Scalar.Lerp(e.factor1, t.factor1, i)
                                })
                            }
                            this[t] = hi.RawTexture.CreateRTexture(r, this._rawTextureWidth, 1, this._scene, !1, !1, hi.Texture.NEAREST_SAMPLINGMODE)
                        }
                    }, t.prototype._createSizeGradientTexture = function() {
                        this._createFactorGradientTexture(this._sizeGradients, "_sizeGradientsTexture")
                    }, t.prototype._createAngularSpeedGradientTexture = function() {
                        this._createFactorGradientTexture(this._angularSpeedGradients, "_angularSpeedGradientsTexture")
                    }, t.prototype._createVelocityGradientTexture = function() {
                        this._createFactorGradientTexture(this._velocityGradients, "_velocityGradientsTexture")
                    }, t.prototype._createLimitVelocityGradientTexture = function() {
                        this._createFactorGradientTexture(this._limitVelocityGradients, "_limitVelocityGradientsTexture")
                    }, t.prototype._createDragGradientTexture = function() {
                        this._createFactorGradientTexture(this._dragGradients, "_dragGradientsTexture")
                    }, t.prototype._createColorGradientTexture = function() {
                        if (this._colorGradients && this._colorGradients.length && !this._colorGradientsTexture) {
                            for (var e = new Uint8Array(4 * this._rawTextureWidth), t = hi.Tmp.Color4[0], i = 0; i < this._rawTextureWidth; i++) {
                                var r = i / this._rawTextureWidth;
                                hi.Tools.GetCurrentGradient(r, this._colorGradients, function(r, n, o) {
                                    hi.Color4.LerpToRef(r.color1, n.color1, o, t), e[4 * i] = 255 * t.r, e[4 * i + 1] = 255 * t.g, e[4 * i + 2] = 255 * t.b, e[4 * i + 3] = 255 * t.a
                                })
                            }
                            this._colorGradientsTexture = hi.RawTexture.CreateRGBATexture(e, this._rawTextureWidth, 1, this._scene, !1, !1, hi.Texture.NEAREST_SAMPLINGMODE)
                        }
                    }, t.prototype.render = function(e) {
                        if (void 0 === e && (e = !1), !this._started) return 0;
                        if (this._createColorGradientTexture(), this._createSizeGradientTexture(), this._createAngularSpeedGradientTexture(), this._createVelocityGradientTexture(), this._createLimitVelocityGradientTexture(), this._createDragGradientTexture(), this._recreateUpdateEffect(), this._recreateRenderEffect(), !this.isReady()) return 0;
                        if (!e) {
                            if (!this._preWarmDone && this.preWarmCycles) {
                                for (var t = 0; t < this.preWarmCycles; t++) this.animate(!0), this.render(!0);
                                this._preWarmDone = !0
                            }
                            if (this._currentRenderId === this._scene.getRenderId()) return 0;
                            this._currentRenderId = this._scene.getRenderId()
                        }
                        if (this._initialize(), this._accumulatedCount += this.emitRate * this._timeDelta, 1 < this._accumulatedCount) {
                            var i = 0 | this._accumulatedCount;
                            this._accumulatedCount -= i, this._currentActiveCount = Math.min(this._activeCount, this._currentActiveCount + i)
                        }
                        if (!this._currentActiveCount) return 0;
                        var r;
                        if (this._engine.enableEffect(this._updateEffect), this._engine.setState(!1), this._updateEffect.setFloat("currentCount", this._currentActiveCount), this._updateEffect.setFloat("timeDelta", this._timeDelta), this._updateEffect.setFloat("stopFactor", this._stopped ? 0 : 1), this._updateEffect.setTexture("randomSampler", this._randomTexture), this._updateEffect.setTexture("randomSampler2", this._randomTexture2), this._updateEffect.setFloat2("lifeTime", this.minLifeTime, this.maxLifeTime), this._updateEffect.setFloat2("emitPower", this.minEmitPower, this.maxEmitPower), this._colorGradientsTexture || (this._updateEffect.setDirectColor4("color1", this.color1), this._updateEffect.setDirectColor4("color2", this.color2)), this._updateEffect.setFloat2("sizeRange", this.minSize, this.maxSize), this._updateEffect.setFloat4("scaleRange", this.minScaleX, this.maxScaleX, this.minScaleY, this.maxScaleY), this._updateEffect.setFloat4("angleRange", this.minAngularSpeed, this.maxAngularSpeed, this.minInitialRotation, this.maxInitialRotation), this._updateEffect.setVector3("gravity", this.gravity), this._sizeGradientsTexture && this._updateEffect.setTexture("sizeGradientSampler", this._sizeGradientsTexture), this._angularSpeedGradientsTexture && this._updateEffect.setTexture("angularSpeedGradientSampler", this._angularSpeedGradientsTexture), this._velocityGradientsTexture && this._updateEffect.setTexture("velocityGradientSampler", this._velocityGradientsTexture), this._limitVelocityGradientsTexture && (this._updateEffect.setTexture("limitVelocityGradientSampler", this._limitVelocityGradientsTexture), this._updateEffect.setFloat("limitVelocityDamping", this.limitVelocityDamping)), this._dragGradientsTexture && this._updateEffect.setTexture("dragGradientSampler", this._dragGradientsTexture), this.particleEmitterType && this.particleEmitterType.applyToShader(this._updateEffect), this._isAnimationSheetEnabled && this._updateEffect.setFloat3("cellInfos", this.startSpriteCellID, this.endSpriteCellID, this.spriteCellChangeSpeed), this.noiseTexture && (this._updateEffect.setTexture("noiseSampler", this.noiseTexture), this._updateEffect.setVector3("noiseStrength", this.noiseStrength)), this.emitter.position) r = this.emitter.getWorldMatrix();
                        else {
                            var n = this.emitter;
                            r = hi.Matrix.Translation(n.x, n.y, n.z)
                        }
                        if (this._updateEffect.setMatrix("emitterWM", r), this._engine.bindVertexArrayObject(this._updateVAO[this._targetIndex], null), this._engine.bindTransformFeedbackBuffer(this._targetBuffer.getBuffer()), this._engine.setRasterizerState(!1), this._engine.beginTransformFeedback(!0),
                            this._engine.drawArraysType(hi.Material.PointListDrawMode, 0, this._currentActiveCount), this._engine.endTransformFeedback(), this._engine.setRasterizerState(!0), this._engine.bindTransformFeedbackBuffer(null), !e) {
                            this._engine.enableEffect(this._renderEffect);
                            var o = this._scene.getViewMatrix();
                            if (this._renderEffect.setMatrix("view", o), this._renderEffect.setMatrix("projection", this._scene.getProjectionMatrix()), this._renderEffect.setTexture("textureSampler", this.particleTexture), this._renderEffect.setVector2("translationPivot", this.translationPivot), this._colorGradientsTexture ? this._renderEffect.setTexture("colorGradientSampler", this._colorGradientsTexture) : this._renderEffect.setDirectColor4("colorDead", this.colorDead), this._isAnimationSheetEnabled && this.particleTexture) {
                                var s = this.particleTexture.getBaseSize();
                                this._renderEffect.setFloat3("sheetInfos", this.spriteCellWidth / s.width, this.spriteCellHeight / s.height, s.width / this.spriteCellWidth)
                            }
                            if (this._isBillboardBased) {
                                var a = this._scene.activeCamera;
                                this._renderEffect.setVector3("eyePosition", a.globalPosition)
                            }
                            if (this._scene.clipPlane || this._scene.clipPlane2 || this._scene.clipPlane3 || this._scene.clipPlane4) {
                                var l = o.clone();
                                l.invert(), this._renderEffect.setMatrix("invView", l), hi.MaterialHelper.BindClipPlane(this._renderEffect, this._scene)
                            }
                            switch (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(this._renderEffect), this.blendMode) {
                                case hi.ParticleSystem.BLENDMODE_ADD:
                                    this._engine.setAlphaMode(hi.Engine.ALPHA_ADD);
                                    break;
                                case hi.ParticleSystem.BLENDMODE_ONEONE:
                                    this._engine.setAlphaMode(hi.Engine.ALPHA_ONEONE);
                                    break;
                                case hi.ParticleSystem.BLENDMODE_STANDARD:
                                    this._engine.setAlphaMode(hi.Engine.ALPHA_COMBINE);
                                    break;
                                case hi.ParticleSystem.BLENDMODE_MULTIPLY:
                                    this._engine.setAlphaMode(hi.Engine.ALPHA_MULTIPLY)
                            }
                            this.forceDepthWrite && this._engine.setDepthWrite(!0), this._engine.bindVertexArrayObject(this._renderVAO[this._targetIndex], null), this._engine.drawArraysType(hi.Material.TriangleFanDrawMode, 0, 4, this._currentActiveCount), this._engine.setAlphaMode(hi.Engine.ALPHA_DISABLE)
                        }
                        2 === ++this._targetIndex && (this._targetIndex = 0);
                        var u = this._sourceBuffer;
                        return this._sourceBuffer = this._targetBuffer, this._targetBuffer = u, this._currentActiveCount
                    }, t.prototype.rebuild = function() {
                        this._initialize(!0)
                    }, t.prototype._releaseBuffers = function() {
                        this._buffer0 && (this._buffer0.dispose(), this._buffer0 = null), this._buffer1 && (this._buffer1.dispose(), this._buffer1 = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null)
                    }, t.prototype._releaseVAOs = function() {
                        if (this._updateVAO) {
                            for (var e = 0; e < this._updateVAO.length; e++) this._engine.releaseVertexArrayObject(this._updateVAO[e]);
                            for (this._updateVAO = [], e = 0; e < this._renderVAO.length; e++) this._engine.releaseVertexArrayObject(this._renderVAO[e]);
                            this._renderVAO = []
                        }
                    }, t.prototype.dispose = function(e) {
                        void 0 === e && (e = !0);
                        var t = this._scene.particleSystems.indexOf(this); - 1 < t && this._scene.particleSystems.splice(t, 1), this._releaseBuffers(), this._releaseVAOs(), this._colorGradientsTexture && (this._colorGradientsTexture.dispose(), this._colorGradientsTexture = null), this._sizeGradientsTexture && (this._sizeGradientsTexture.dispose(), this._sizeGradientsTexture = null), this._angularSpeedGradientsTexture && (this._angularSpeedGradientsTexture.dispose(), this._angularSpeedGradientsTexture = null), this._velocityGradientsTexture && (this._velocityGradientsTexture.dispose(), this._velocityGradientsTexture = null), this._limitVelocityGradientsTexture && (this._limitVelocityGradientsTexture.dispose(), this._limitVelocityGradientsTexture = null), this._dragGradientsTexture && (this._dragGradientsTexture.dispose(), this._dragGradientsTexture = null), this._randomTexture && (this._randomTexture.dispose(), this._randomTexture = null), this._randomTexture2 && (this._randomTexture2.dispose(), this._randomTexture2 = null), e && this.particleTexture && (this.particleTexture.dispose(), this.particleTexture = null), e && this.noiseTexture && (this.noiseTexture.dispose(), this.noiseTexture = null), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear()
                    }, t.prototype.clone = function(e, i) {
                        var r = new t(e, {
                            capacity: this._capacity,
                            randomTextureSize: this._randomTextureSize
                        }, this._scene);
                        return hi.Tools.DeepCopy(this, r), void 0 === i && (i = this.emitter), r.emitter = i, this.particleTexture && (r.particleTexture = new hi.Texture(this.particleTexture.url, this._scene)), r
                    }, t.prototype.serialize = function() {
                        var e = {};
                        return hi.ParticleSystem._Serialize(e, this), e.activeParticleCount = this.activeParticleCount, e
                    }, t.Parse = function(e, i, r, n) {
                        void 0 === n && (n = !1);
                        var o = new t(e.name, {
                            capacity: e.capacity,
                            randomTextureSize: e.randomTextureSize
                        }, i);
                        return e.activeParticleCount && (o.activeParticleCount = e.activeParticleCount), hi.ParticleSystem._Parse(e, o, i, r), e.preventAutoStart && (o.preventAutoStart = e.preventAutoStart), n || o.preventAutoStart || o.start(), o
                    }, t
                }(hi.BaseParticleSystem), hi.GPUParticleSystem = di,
                function(e) {
                    var t = function() {
                        function t(t, i, r, n, o, s, a, l) {
                            void 0 === l && (l = null), this.idx = 0, this.color = new e.Color4(1, 1, 1, 1), this.position = e.Vector3.Zero(), this.rotation = e.Vector3.Zero(), this.scaling = e.Vector3.One(), this.uvs = new e.Vector4(0, 0, 1, 1), this.velocity = e.Vector3.Zero(), this.pivot = e.Vector3.Zero(), this.translateFromPivot = !1, this.alive = !0, this.isVisible = !0, this._pos = 0, this._ind = 0, this.shapeId = 0, this.idxInShape = 0, this._stillInvisible = !1, this._rotationMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1], this.parentId = null, this._globalPosition = e.Vector3.Zero(), this.idx = t, this._pos = i, this._ind = r, this._model = n, this.shapeId = o, this.idxInShape = s, this._sps = a, l && (this._modelBoundingInfo = l, this._boundingInfo = new e.BoundingInfo(l.minimum, l.maximum))
                        }
                        return Object.defineProperty(t.prototype, "scale", {
                            get: function() {
                                return this.scaling
                            },
                            set: function(e) {
                                this.scaling = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "quaternion", {
                            get: function() {
                                return this.rotationQuaternion
                            },
                            set: function(e) {
                                this.rotationQuaternion = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.intersectsMesh = function(t) {
                            return !(!this._boundingInfo || !t._boundingInfo) && (this._sps._bSphereOnly ? e.BoundingSphere.Intersects(this._boundingInfo.boundingSphere, t._boundingInfo.boundingSphere) : this._boundingInfo.intersects(t._boundingInfo, !1))
                        }, t
                    }();
                    e.SolidParticle = t;
                    var i = function(e, t, i, r, n, o) {
                        this._indicesLength = 0, this.shapeID = e, this._shape = t, this._indicesLength = i, this._shapeUV = r, this._positionFunction = n, this._vertexFunction = o
                    };
                    e.ModelShape = i;
                    var r = function() {
                        this.ind = 0, this.indicesLength = 0, this.sqDistance = 0
                    };
                    e.DepthSortedParticle = r
                }($a || ($a = {})), pi = $a || ($a = {}), fi = function() {
                    function e(e, t, i) {
                        this.particles = new Array, this.nbParticles = 0, this.billboard = !1, this.recomputeNormals = !0, this.counter = 0, this.vars = {}, this._bSphereOnly = !1, this._bSphereRadiusFactor = 1, this._positions = new Array, this._indices = new Array, this._normals = new Array, this._colors = new Array, this._uvs = new Array, this._index = 0, this._updatable = !0, this._pickable = !1, this._isVisibilityBoxLocked = !1, this._alwaysVisible = !1, this._depthSort = !1, this._shapeCounter = 0, this._copy = new pi.SolidParticle(0, 0, 0, null, 0, 0, this), this._color = new pi.Color4(0, 0, 0, 0), this._computeParticleColor = !0, this._computeParticleTexture = !0, this._computeParticleRotation = !0, this._computeParticleVertex = !1, this._computeBoundingBox = !1, this._depthSortParticles = !0, this._cam_axisZ = pi.Vector3.Zero(), this._cam_axisY = pi.Vector3.Zero(), this._cam_axisX = pi.Vector3.Zero(), this._axisZ = pi.Axis.Z, this._camDir = pi.Vector3.Zero(), this._camInvertedPosition = pi.Vector3.Zero(), this._rotMatrix = new pi.Matrix, this._invertMatrix = new pi.Matrix, this._rotated = pi.Vector3.Zero(), this._quaternion = new pi.Quaternion, this._vertex = pi.Vector3.Zero(), this._normal = pi.Vector3.Zero(), this._yaw = 0, this._pitch = 0, this._roll = 0, this._halfroll = 0, this._halfpitch = 0, this._halfyaw = 0, this._sinRoll = 0, this._cosRoll = 0, this._sinPitch = 0, this._cosPitch = 0, this._sinYaw = 0, this._cosYaw = 0, this._mustUnrotateFixedNormals = !1, this._minimum = pi.Vector3.Zero(), this._maximum = pi.Vector3.Zero(), this._minBbox = pi.Vector3.Zero(), this._maxBbox = pi.Vector3.Zero(), this._particlesIntersect = !1, this._depthSortFunction = function(e, t) {
                            return t.sqDistance - e.sqDistance
                        }, this._needs32Bits = !1, this._pivotBackTranslation = pi.Vector3.Zero(), this._scaledPivot = pi.Vector3.Zero(), this._particleHasParent = !1, this.name = e, this._scene = t || pi.Engine.LastCreatedScene, this._camera = t.activeCamera, this._pickable = !!i && i.isPickable, this._depthSort = !!i && i.enableDepthSort, this._particlesIntersect = !!i && i.particleIntersection, this._bSphereOnly = !!i && i.boundingSphereOnly, this._bSphereRadiusFactor = i && i.bSphereRadiusFactor ? i.bSphereRadiusFactor : 1, i && void 0 !== i.updatable ? this._updatable = i.updatable : this._updatable = !0, this._pickable && (this.pickedParticles = []), this._depthSort && (this.depthSortedParticles = [])
                    }
                    return e.prototype.buildMesh = function() {
                        if (0 === this.nbParticles) {
                            var e = pi.MeshBuilder.CreateDisc("", {
                                radius: 1,
                                tessellation: 3
                            }, this._scene);
                            this.addShape(e, 1), e.dispose()
                        }
                        this._indices32 = this._needs32Bits ? new Uint32Array(this._indices) : new Uint16Array(this._indices), this._positions32 = new Float32Array(this._positions), this._uvs32 = new Float32Array(this._uvs), this._colors32 = new Float32Array(this._colors), this.recomputeNormals && pi.VertexData.ComputeNormals(this._positions32, this._indices32, this._normals), this._normals32 = new Float32Array(this._normals), this._fixedNormal32 = new Float32Array(this._normals), this._mustUnrotateFixedNormals && this._unrotateFixedNormals();
                        var t = new pi.VertexData;
                        t.indices = this._depthSort ? this._indices : this._indices32, t.set(this._positions32, pi.VertexBuffer.PositionKind), t.set(this._normals32, pi.VertexBuffer.NormalKind), 0 < this._uvs32.length && t.set(this._uvs32, pi.VertexBuffer.UVKind), 0 < this._colors32.length && t.set(this._colors32, pi.VertexBuffer.ColorKind);
                        var i = new pi.Mesh(this.name, this._scene);
                        return t.applyToMesh(i, this._updatable), this.mesh = i, this.mesh.isPickable = this._pickable, this._depthSort || (this._indices = null), this._positions = null, this._normals = null, this._uvs = null, this._colors = null, this._updatable || (this.particles.length = 0), i
                    }, e.prototype.digest = function(e, t) {
                        var i = t && t.facetNb || 1,
                            r = t && t.number || 0,
                            n = t && t.delta || 0,
                            o = e.getVerticesData(pi.VertexBuffer.PositionKind),
                            s = e.getIndices(),
                            a = e.getVerticesData(pi.VertexBuffer.UVKind),
                            l = e.getVerticesData(pi.VertexBuffer.ColorKind),
                            u = e.getVerticesData(pi.VertexBuffer.NormalKind),
                            c = 0,
                            h = s.length / 3;
                        r ? (r = h < r ? h : r, i = Math.round(h / r), n = 0) : i = h < i ? h : i;
                        for (var d = [], p = [], f = [], _ = [], m = pi.Vector3.Zero(), g = i; c < h;) {
                            h - (i = g + Math.floor((1 + n) * Math.random())) < c && (i = h - c), d.length = 0, p.length = 0, f.length = 0;
                            for (var v = _.length = 0, y = 3 * c; y < 3 * (c + i); y++) {
                                p.push(v);
                                var b = s[y];
                                d.push(o[3 * b], o[3 * b + 1], o[3 * b + 2]), a && f.push(a[2 * b], a[2 * b + 1]), l && _.push(l[4 * b], l[4 * b + 1], l[4 * b + 2], l[4 * b + 3]), v++
                            }
                            var x, T, E = this.nbParticles,
                                S = this._posToShape(d),
                                P = this._uvsToShapeUV(f);
                            for (x = 0; x < S.length; x++) m.addInPlace(S[x]);
                            for (m.scaleInPlace(1 / S.length), x = 0; x < S.length; x++) S[x].subtractInPlace(m);
                            this._particlesIntersect && (T = new pi.BoundingInfo(m, m));
                            var A = new pi.ModelShape(this._shapeCounter, S, 3 * i, P, null, null),
                                C = this._positions.length,
                                M = this._indices.length;
                            this._meshBuilder(this._index, S, this._positions, p, this._indices, f, this._uvs, _, this._colors, u, this._normals, E, 0, null), this._addParticle(E, C, M, A, this._shapeCounter, 0, T), this.particles[this.nbParticles].position.addInPlace(m), this._index += S.length, E++, this.nbParticles++, this._shapeCounter++, c += i
                        }
                        return this
                    }, e.prototype._unrotateFixedNormals = function() {
                        for (var e = 0, t = 0, i = 0; i < this.particles.length; i++) {
                            this._particle = this.particles[i], this._shape = this._particle._model._shape, this._particle.rotationQuaternion ? this._quaternion.copyFrom(this._particle.rotationQuaternion) : (this._yaw = this._particle.rotation.y, this._pitch = this._particle.rotation.x, this._roll = this._particle.rotation.z, this._quaternionRotationYPR()), this._quaternionToRotationMatrix(), this._rotMatrix.invertToRef(this._invertMatrix);
                            for (var r = 0; r < this._shape.length; r++) t = e + 3 * r, pi.Vector3.TransformNormalFromFloatsToRef(this._normals32[t], this._normals32[t + 1], this._normals32[t + 2], this._invertMatrix, this._normal), this._fixedNormal32[t] = this._normal.x, this._fixedNormal32[t + 1] = this._normal.y, this._fixedNormal32[t + 2] = this._normal.z;
                            e = t + 3
                        }
                    }, e.prototype._resetCopy = function() {
                        this._copy.position.x = 0, this._copy.position.y = 0, this._copy.position.z = 0, this._copy.rotation.x = 0, this._copy.rotation.y = 0, this._copy.rotation.z = 0, this._copy.rotationQuaternion = null, this._copy.scaling.x = 1, this._copy.scaling.y = 1, this._copy.scaling.z = 1, this._copy.uvs.x = 0, this._copy.uvs.y = 0, this._copy.uvs.z = 1, this._copy.uvs.w = 1, this._copy.color = null, this._copy.translateFromPivot = !1
                    }, e.prototype._meshBuilder = function(e, t, i, r, n, o, s, a, l, u, c, h, d, p) {
                        var f, _ = 0,
                            m = 0,
                            g = 0;
                        for (this._resetCopy(), p && p.positionFunction && (p.positionFunction(this._copy, h, d), this._mustUnrotateFixedNormals = !0), this._copy.rotationQuaternion ? this._quaternion.copyFrom(this._copy.rotationQuaternion) : (this._yaw = this._copy.rotation.y, this._pitch = this._copy.rotation.x, this._roll = this._copy.rotation.z, this._quaternionRotationYPR()), this._quaternionToRotationMatrix(), this._scaledPivot.x = this._copy.pivot.x * this._copy.scaling.x, this._scaledPivot.y = this._copy.pivot.y * this._copy.scaling.y, this._scaledPivot.z = this._copy.pivot.z * this._copy.scaling.z, this._copy.translateFromPivot ? this._pivotBackTranslation.copyFromFloats(0, 0, 0) : this._pivotBackTranslation.copyFrom(this._scaledPivot), f = 0; f < t.length; f++) this._vertex.x = t[f].x, this._vertex.y = t[f].y, this._vertex.z = t[f].z, p && p.vertexFunction && p.vertexFunction(this._copy, this._vertex, f), this._vertex.x *= this._copy.scaling.x, this._vertex.y *= this._copy.scaling.y, this._vertex.z *= this._copy.scaling.z, this._vertex.x -= this._scaledPivot.x, this._vertex.y -= this._scaledPivot.y, this._vertex.z -= this._scaledPivot.z, pi.Vector3.TransformCoordinatesToRef(this._vertex, this._rotMatrix, this._rotated), this._rotated.addInPlace(this._pivotBackTranslation), i.push(this._copy.position.x + this._rotated.x, this._copy.position.y + this._rotated.y, this._copy.position.z + this._rotated.z), o && (s.push((this._copy.uvs.z - this._copy.uvs.x) * o[_] + this._copy.uvs.x, (this._copy.uvs.w - this._copy.uvs.y) * o[_ + 1] + this._copy.uvs.y), _ += 2), this._copy.color ? this._color = this._copy.color : a && void 0 !== a[m] ? (this._color.r = a[m], this._color.g = a[m + 1], this._color.b = a[m + 2], this._color.a = a[m + 3]) : (this._color.r = 1, this._color.g = 1, this._color.b = 1, this._color.a = 1), l.push(this._color.r, this._color.g, this._color.b, this._color.a), m += 4, !this.recomputeNormals && u && (this._normal.x = u[g], this._normal.y = u[g + 1], this._normal.z = u[g + 2], pi.Vector3.TransformNormalToRef(this._normal, this._rotMatrix, this._normal), c.push(this._normal.x, this._normal.y, this._normal.z), g += 3);
                        for (f = 0; f < r.length; f++) {
                            var v = e + r[f];
                            n.push(v), 65535 < v && (this._needs32Bits = !0)
                        }
                        if (this._pickable) {
                            var y = r.length / 3;
                            for (f = 0; f < y; f++) this.pickedParticles.push({
                                idx: h,
                                faceId: f
                            })
                        }
                        return this._depthSort && this.depthSortedParticles.push(new pi.DepthSortedParticle), this._copy
                    }, e.prototype._posToShape = function(e) {
                        for (var t = [], i = 0; i < e.length; i += 3) t.push(new pi.Vector3(e[i], e[i + 1], e[i + 2]));
                        return t
                    }, e.prototype._uvsToShapeUV = function(e) {
                        var t = [];
                        if (e)
                            for (var i = 0; i < e.length; i++) t.push(e[i]);
                        return t
                    }, e.prototype._addParticle = function(e, t, i, r, n, o, s) {
                        void 0 === s && (s = null);
                        var a = new pi.SolidParticle(e, t, i, r, n, o, this, s);
                        return this.particles.push(a), a
                    }, e.prototype.addShape = function(e, t, i) {
                        var r, n = e.getVerticesData(pi.VertexBuffer.PositionKind),
                            o = e.getIndices(),
                            s = e.getVerticesData(pi.VertexBuffer.UVKind),
                            a = e.getVerticesData(pi.VertexBuffer.ColorKind),
                            l = e.getVerticesData(pi.VertexBuffer.NormalKind);
                        this._particlesIntersect && (r = e.getBoundingInfo());
                        for (var u, c, h = this._posToShape(n), d = this._uvsToShapeUV(s), p = i ? i.positionFunction : null, f = i ? i.vertexFunction : null, _ = new pi.ModelShape(this._shapeCounter, h, o.length, d, p, f), m = this.nbParticles, g = 0; g < t; g++) {
                            var v = this._positions.length,
                                y = this._indices.length;
                            c = this._meshBuilder(this._index, h, this._positions, o, this._indices, s, this._uvs, a, this._colors, l, this._normals, m, g, i), this._updatable && ((u = this._addParticle(m, v, y, _, this._shapeCounter, g, r)).position.copyFrom(c.position), u.rotation.copyFrom(c.rotation), c.rotationQuaternion && u.rotationQuaternion && u.rotationQuaternion.copyFrom(c.rotationQuaternion), c.color && u.color && u.color.copyFrom(c.color), u.scaling.copyFrom(c.scaling), u.uvs.copyFrom(c.uvs)), this._index += h.length, m++
                        }
                        return this.nbParticles += t, ++this._shapeCounter - 1
                    }, e.prototype._rebuildParticle = function(e) {
                        this._resetCopy(), e._model._positionFunction && e._model._positionFunction(this._copy, e.idx, e.idxInShape), this._copy.rotationQuaternion ? this._quaternion.copyFrom(this._copy.rotationQuaternion) : (this._yaw = this._copy.rotation.y, this._pitch = this._copy.rotation.x, this._roll = this._copy.rotation.z, this._quaternionRotationYPR()), this._quaternionToRotationMatrix(), this._scaledPivot.x = this._particle.pivot.x * this._particle.scaling.x, this._scaledPivot.y = this._particle.pivot.y * this._particle.scaling.y, this._scaledPivot.z = this._particle.pivot.z * this._particle.scaling.z, this._copy.translateFromPivot ? this._pivotBackTranslation.copyFromFloats(0, 0, 0) : this._pivotBackTranslation.copyFrom(this._scaledPivot), this._shape = e._model._shape;
                        for (var t = 0; t < this._shape.length; t++) this._vertex.x = this._shape[t].x, this._vertex.y = this._shape[t].y, this._vertex.z = this._shape[t].z, e._model._vertexFunction && e._model._vertexFunction(this._copy, this._vertex, t), this._vertex.x *= this._copy.scaling.x, this._vertex.y *= this._copy.scaling.y, this._vertex.z *= this._copy.scaling.z, this._vertex.x -= this._scaledPivot.x, this._vertex.y -= this._scaledPivot.y, this._vertex.z -= this._scaledPivot.z, pi.Vector3.TransformCoordinatesToRef(this._vertex, this._rotMatrix, this._rotated), this._rotated.addInPlace(this._pivotBackTranslation), this._positions32[e._pos + 3 * t] = this._copy.position.x + this._rotated.x, this._positions32[e._pos + 3 * t + 1] = this._copy.position.y + this._rotated.y, this._positions32[e._pos + 3 * t + 2] = this._copy.position.z + this._rotated.z;
                        e.position.x = 0, e.position.y = 0, e.position.z = 0, e.rotation.x = 0, e.rotation.y = 0, e.rotation.z = 0, e.rotationQuaternion = null, e.scaling.x = 1, e.scaling.y = 1, e.scaling.z = 1, e.uvs.x = 0, e.uvs.y = 0, e.uvs.z = 1, e.uvs.w = 1, e.pivot.x = 0, e.pivot.y = 0, e.pivot.z = 0, e.translateFromPivot = !1, e.parentId = null
                    }, e.prototype.rebuildMesh = function() {
                        for (var e = 0; e < this.particles.length; e++) this._rebuildParticle(this.particles[e]);
                        return this.mesh.updateVerticesData(pi.VertexBuffer.PositionKind, this._positions32, !1, !1), this
                    }, e.prototype.setParticles = function(e, t, i) {
                        if (void 0 === e && (e = 0), void 0 === t && (t = this.nbParticles - 1), void 0 === i && (i = !0), !this._updatable) return this;
                        if (this.beforeUpdateParticles(e, t, i), this._cam_axisX.x = 1, this._cam_axisX.y = 0, this._cam_axisX.z = 0, this._cam_axisY.x = 0, this._cam_axisY.y = 1, this._cam_axisY.z = 0, this._cam_axisZ.x = 0, this._cam_axisZ.y = 0, this._cam_axisZ.z = 1, (this.billboard || this._depthSort) && (this.mesh.computeWorldMatrix(!0), this.mesh._worldMatrix.invertToRef(this._invertMatrix)), this.billboard) {
                            this._camera.getDirectionToRef(this._axisZ, this._camDir), pi.Vector3.TransformNormalToRef(this._camDir, this._invertMatrix, this._cam_axisZ), this._cam_axisZ.normalize();
                            var r = this._camera.getViewMatrix(!0);
                            pi.Vector3.TransformNormalFromFloatsToRef(r.m[1], r.m[5], r.m[9], this._invertMatrix, this._cam_axisY), pi.Vector3.CrossToRef(this._cam_axisY, this._cam_axisZ, this._cam_axisX), this._cam_axisY.normalize(), this._cam_axisX.normalize()
                        }
                        this._depthSort && pi.Vector3.TransformCoordinatesToRef(this._camera.globalPosition, this._invertMatrix, this._camInvertedPosition), pi.Matrix.IdentityToRef(this._rotMatrix);
                        var n = 0,
                            o = 0,
                            s = 0,
                            a = 0,
                            l = 0,
                            u = 0,
                            c = 0;
                        this.mesh.isFacetDataEnabled && (this._computeBoundingBox = !0), t = t >= this.nbParticles ? this.nbParticles - 1 : t, this._computeBoundingBox && (0 == e && t == this.nbParticles - 1 ? (pi.Vector3.FromFloatsToRef(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, this._minimum), pi.Vector3.FromFloatsToRef(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, this._maximum)) : this.mesh._boundingInfo && (this._minimum.copyFrom(this.mesh._boundingInfo.boundingBox.minimum), this._maximum.copyFrom(this.mesh._boundingInfo.boundingBox.maximum)));
                        var h = (o = this.particles[e]._pos) / 3 | 0;
                        a = 4 * h, u = 2 * h;
                        for (var d = e; d <= t; d++) {
                            if (this._particle = this.particles[d], this._shape = this._particle._model._shape, this._shapeUV = this._particle._model._shapeUV, this.updateParticle(this._particle), this._depthSort && this._depthSortParticles) {
                                var p = this.depthSortedParticles[d];
                                p.ind = this._particle._ind, p.indicesLength = this._particle._model._indicesLength, p.sqDistance = pi.Vector3.DistanceSquared(this._particle.position, this._camInvertedPosition)
                            }
                            if (!this._particle.alive || this._particle._stillInvisible && !this._particle.isVisible) o += 3 * (c = this._shape.length), a += 4 * c, u += 2 * c;
                            else {
                                if (this._particle.isVisible)
                                    for (this._particle._stillInvisible = !1, this._particleHasParent = null !== this._particle.parentId, this._scaledPivot.x = this._particle.pivot.x * this._particle.scaling.x, this._scaledPivot.y = this._particle.pivot.y * this._particle.scaling.y, this._scaledPivot.z = this._particle.pivot.z * this._particle.scaling.z, this.billboard && (this._particle.rotation.x = 0, this._particle.rotation.y = 0), (this._computeParticleRotation || this.billboard) && (this._particle.rotationQuaternion ? this._quaternion.copyFrom(this._particle.rotationQuaternion) : (this._yaw = this._particle.rotation.y, this._pitch = this._particle.rotation.x, this._roll = this._particle.rotation.z, this._quaternionRotationYPR()), this._quaternionToRotationMatrix()), this._particleHasParent ? (this._parent = this.particles[this._particle.parentId], this._rotated.x = this._particle.position.x * this._parent._rotationMatrix[0] + this._particle.position.y * this._parent._rotationMatrix[3] + this._particle.position.z * this._parent._rotationMatrix[6], this._rotated.y = this._particle.position.x * this._parent._rotationMatrix[1] + this._particle.position.y * this._parent._rotationMatrix[4] + this._particle.position.z * this._parent._rotationMatrix[7], this._rotated.z = this._particle.position.x * this._parent._rotationMatrix[2] + this._particle.position.y * this._parent._rotationMatrix[5] + this._particle.position.z * this._parent._rotationMatrix[8], this._particle._globalPosition.x = this._parent._globalPosition.x + this._rotated.x, this._particle._globalPosition.y = this._parent._globalPosition.y + this._rotated.y, this._particle._globalPosition.z = this._parent._globalPosition.z + this._rotated.z, (this._computeParticleRotation || this.billboard) && (this._particle._rotationMatrix[0] = this._rotMatrix.m[0] * this._parent._rotationMatrix[0] + this._rotMatrix.m[1] * this._parent._rotationMatrix[3] + this._rotMatrix.m[2] * this._parent._rotationMatrix[6], this._particle._rotationMatrix[1] = this._rotMatrix.m[0] * this._parent._rotationMatrix[1] + this._rotMatrix.m[1] * this._parent._rotationMatrix[4] + this._rotMatrix.m[2] * this._parent._rotationMatrix[7], this._particle._rotationMatrix[2] = this._rotMatrix.m[0] * this._parent._rotationMatrix[2] + this._rotMatrix.m[1] * this._parent._rotationMatrix[5] + this._rotMatrix.m[2] * this._parent._rotationMatrix[8], this._particle._rotationMatrix[3] = this._rotMatrix.m[4] * this._parent._rotationMatrix[0] + this._rotMatrix.m[5] * this._parent._rotationMatrix[3] + this._rotMatrix.m[6] * this._parent._rotationMatrix[6], this._particle._rotationMatrix[4] = this._rotMatrix.m[4] * this._parent._rotationMatrix[1] + this._rotMatrix.m[5] * this._parent._rotationMatrix[4] + this._rotMatrix.m[6] * this._parent._rotationMatrix[7], this._particle._rotationMatrix[5] = this._rotMatrix.m[4] * this._parent._rotationMatrix[2] + this._rotMatrix.m[5] * this._parent._rotationMatrix[5] + this._rotMatrix.m[6] * this._parent._rotationMatrix[8], this._particle._rotationMatrix[6] = this._rotMatrix.m[8] * this._parent._rotationMatrix[0] + this._rotMatrix.m[9] * this._parent._rotationMatrix[3] + this._rotMatrix.m[10] * this._parent._rotationMatrix[6], this._particle._rotationMatrix[7] = this._rotMatrix.m[8] * this._parent._rotationMatrix[1] + this._rotMatrix.m[9] * this._parent._rotationMatrix[4] + this._rotMatrix.m[10] * this._parent._rotationMatrix[7], this._particle._rotationMatrix[8] = this._rotMatrix.m[8] * this._parent._rotationMatrix[2] + this._rotMatrix.m[9] * this._parent._rotationMatrix[5] + this._rotMatrix.m[10] * this._parent._rotationMatrix[8])) : (this._particle._globalPosition.x = this._particle.position.x, this._particle._globalPosition.y = this._particle.position.y, this._particle._globalPosition.z = this._particle.position.z, (this._computeParticleRotation || this.billboard) && (this._particle._rotationMatrix[0] = this._rotMatrix.m[0], this._particle._rotationMatrix[1] = this._rotMatrix.m[1], this._particle._rotationMatrix[2] = this._rotMatrix.m[2], this._particle._rotationMatrix[3] = this._rotMatrix.m[4], this._particle._rotationMatrix[4] = this._rotMatrix.m[5], this._particle._rotationMatrix[5] = this._rotMatrix.m[6], this._particle._rotationMatrix[6] = this._rotMatrix.m[8], this._particle._rotationMatrix[7] = this._rotMatrix.m[9], this._particle._rotationMatrix[8] = this._rotMatrix.m[10])), this._particle.translateFromPivot ? (this._pivotBackTranslation.x = 0, this._pivotBackTranslation.y = 0, this._pivotBackTranslation.z = 0) : (this._pivotBackTranslation.x = this._scaledPivot.x, this._pivotBackTranslation.y = this._scaledPivot.y, this._pivotBackTranslation.z = this._scaledPivot.z), c = 0; c < this._shape.length; c++) n = o + 3 * c, s = a + 4 * c, l = u + 2 * c, this._vertex.x = this._shape[c].x, this._vertex.y = this._shape[c].y, this._vertex.z = this._shape[c].z, this._computeParticleVertex && this.updateParticleVertex(this._particle, this._vertex, c), this._vertex.x *= this._particle.scaling.x, this._vertex.y *= this._particle.scaling.y, this._vertex.z *= this._particle.scaling.z, this._vertex.x -= this._scaledPivot.x, this._vertex.y -= this._scaledPivot.y, this._vertex.z -= this._scaledPivot.z, this._rotated.x = this._vertex.x * this._particle._rotationMatrix[0] + this._vertex.y * this._particle._rotationMatrix[3] + this._vertex.z * this._particle._rotationMatrix[6], this._rotated.y = this._vertex.x * this._particle._rotationMatrix[1] + this._vertex.y * this._particle._rotationMatrix[4] + this._vertex.z * this._particle._rotationMatrix[7], this._rotated.z = this._vertex.x * this._particle._rotationMatrix[2] + this._vertex.y * this._particle._rotationMatrix[5] + this._vertex.z * this._particle._rotationMatrix[8], this._rotated.x += this._pivotBackTranslation.x, this._rotated.y += this._pivotBackTranslation.y, this._rotated.z += this._pivotBackTranslation.z, this._positions32[n] = this._particle._globalPosition.x + this._cam_axisX.x * this._rotated.x + this._cam_axisY.x * this._rotated.y + this._cam_axisZ.x * this._rotated.z, this._positions32[n + 1] = this._particle._globalPosition.y + this._cam_axisX.y * this._rotated.x + this._cam_axisY.y * this._rotated.y + this._cam_axisZ.y * this._rotated.z, this._positions32[n + 2] = this._particle._globalPosition.z + this._cam_axisX.z * this._rotated.x + this._cam_axisY.z * this._rotated.y + this._cam_axisZ.z * this._rotated.z, this._computeBoundingBox && (this._positions32[n] < this._minimum.x && (this._minimum.x = this._positions32[n]), this._positions32[n] > this._maximum.x && (this._maximum.x = this._positions32[n]), this._positions32[n + 1] < this._minimum.y && (this._minimum.y = this._positions32[n + 1]), this._positions32[n + 1] > this._maximum.y && (this._maximum.y = this._positions32[n + 1]), this._positions32[n + 2] < this._minimum.z && (this._minimum.z = this._positions32[n + 2]), this._positions32[n + 2] > this._maximum.z && (this._maximum.z = this._positions32[n + 2])), this._computeParticleVertex || (this._normal.x = this._fixedNormal32[n], this._normal.y = this._fixedNormal32[n + 1], this._normal.z = this._fixedNormal32[n + 2], this._rotated.x = this._normal.x * this._particle._rotationMatrix[0] + this._normal.y * this._particle._rotationMatrix[3] + this._normal.z * this._particle._rotationMatrix[6], this._rotated.y = this._normal.x * this._particle._rotationMatrix[1] + this._normal.y * this._particle._rotationMatrix[4] + this._normal.z * this._particle._rotationMatrix[7], this._rotated.z = this._normal.x * this._particle._rotationMatrix[2] + this._normal.y * this._particle._rotationMatrix[5] + this._normal.z * this._particle._rotationMatrix[8], this._normals32[n] = this._cam_axisX.x * this._rotated.x + this._cam_axisY.x * this._rotated.y + this._cam_axisZ.x * this._rotated.z, this._normals32[n + 1] = this._cam_axisX.y * this._rotated.x + this._cam_axisY.y * this._rotated.y + this._cam_axisZ.y * this._rotated.z, this._normals32[n + 2] = this._cam_axisX.z * this._rotated.x + this._cam_axisY.z * this._rotated.y + this._cam_axisZ.z * this._rotated.z), this._computeParticleColor && this._particle.color && (this._colors32[s] = this._particle.color.r, this._colors32[s + 1] = this._particle.color.g, this._colors32[s + 2] = this._particle.color.b, this._colors32[s + 3] = this._particle.color.a), this._computeParticleTexture && (this._uvs32[l] = this._shapeUV[2 * c] * (this._particle.uvs.z - this._particle.uvs.x) + this._particle.uvs.x, this._uvs32[l + 1] = this._shapeUV[2 * c + 1] * (this._particle.uvs.w - this._particle.uvs.y) + this._particle.uvs.y);
                                else
                                    for (this._particle._stillInvisible = !0, c = 0; c < this._shape.length; c++) n = o + 3 * c, s = a + 4 * c, l = u + 2 * c, this._positions32[n] = 0, this._positions32[n + 1] = 0, this._positions32[n + 2] = 0, this._normals32[n] = 0, this._normals32[n + 1] = 0, this._normals32[n + 2] = 0, this._computeParticleColor && this._particle.color && (this._colors32[s] = this._particle.color.r, this._colors32[s + 1] = this._particle.color.g, this._colors32[s + 2] = this._particle.color.b, this._colors32[s + 3] = this._particle.color.a), this._computeParticleTexture && (this._uvs32[l] = this._shapeUV[2 * c] * (this._particle.uvs.z - this._particle.uvs.x) + this._particle.uvs.x, this._uvs32[l + 1] = this._shapeUV[2 * c + 1] * (this._particle.uvs.w - this._particle.uvs.y) + this._particle.uvs.y);
                                if (this._particlesIntersect) {
                                    var f = this._particle._boundingInfo,
                                        _ = f.boundingBox,
                                        m = f.boundingSphere;
                                    if (!this._bSphereOnly) {
                                        for (var g = 0; g < _.vectors.length; g++) this._vertex.x = this._particle._modelBoundingInfo.boundingBox.vectors[g].x * this._particle.scaling.x, this._vertex.y = this._particle._modelBoundingInfo.boundingBox.vectors[g].y * this._particle.scaling.y, this._vertex.z = this._particle._modelBoundingInfo.boundingBox.vectors[g].z * this._particle.scaling.z, this._rotated.x = this._vertex.x * this._particle._rotationMatrix[0] + this._vertex.y * this._particle._rotationMatrix[3] + this._vertex.z * this._particle._rotationMatrix[6], this._rotated.y = this._vertex.x * this._particle._rotationMatrix[1] + this._vertex.y * this._particle._rotationMatrix[4] + this._vertex.z * this._particle._rotationMatrix[7], this._rotated.z = this._vertex.x * this._particle._rotationMatrix[2] + this._vertex.y * this._particle._rotationMatrix[5] + this._vertex.z * this._particle._rotationMatrix[8], _.vectors[g].x = this._particle.position.x + this._cam_axisX.x * this._rotated.x + this._cam_axisY.x * this._rotated.y + this._cam_axisZ.x * this._rotated.z, _.vectors[g].y = this._particle.position.y + this._cam_axisX.y * this._rotated.x + this._cam_axisY.y * this._rotated.y + this._cam_axisZ.y * this._rotated.z, _.vectors[g].z = this._particle.position.z + this._cam_axisX.z * this._rotated.x + this._cam_axisY.z * this._rotated.y + this._cam_axisZ.z * this._rotated.z;
                                        _._update(this.mesh._worldMatrix)
                                    }
                                    this._minBbox.x = this._particle._modelBoundingInfo.minimum.x * this._particle.scaling.x, this._minBbox.y = this._particle._modelBoundingInfo.minimum.y * this._particle.scaling.y, this._minBbox.z = this._particle._modelBoundingInfo.minimum.z * this._particle.scaling.z, this._maxBbox.x = this._particle._modelBoundingInfo.maximum.x * this._particle.scaling.x, this._maxBbox.y = this._particle._modelBoundingInfo.maximum.y * this._particle.scaling.y, this._maxBbox.z = this._particle._modelBoundingInfo.maximum.z * this._particle.scaling.z, m.center.x = this._particle._globalPosition.x + .5 * (this._minBbox.x + this._maxBbox.x), m.center.y = this._particle._globalPosition.y + .5 * (this._minBbox.y + this._maxBbox.y), m.center.z = this._particle._globalPosition.z + .5 * (this._minBbox.z + this._maxBbox.z), m.radius = .5 * this._bSphereRadiusFactor * Math.sqrt((this._maxBbox.x - this._minBbox.x) * (this._maxBbox.x - this._minBbox.x) + (this._maxBbox.y - this._minBbox.y) * (this._maxBbox.y - this._minBbox.y) + (this._maxBbox.z - this._minBbox.z) * (this._maxBbox.z - this._minBbox.z)), m._update(this.mesh._worldMatrix)
                                }
                                o = n + 3, a = s + 4, u = l + 2
                            }
                        }
                        if (i) {
                            if (this._computeParticleColor && this.mesh.updateVerticesData(pi.VertexBuffer.ColorKind, this._colors32, !1, !1), this._computeParticleTexture && this.mesh.updateVerticesData(pi.VertexBuffer.UVKind, this._uvs32, !1, !1), this.mesh.updateVerticesData(pi.VertexBuffer.PositionKind, this._positions32, !1, !1), !this.mesh.areNormalsFrozen || this.mesh.isFacetDataEnabled) {
                                if (this._computeParticleVertex || this.mesh.isFacetDataEnabled) {
                                    var v = this.mesh.isFacetDataEnabled ? this.mesh.getFacetDataParameters() : null;
                                    pi.VertexData.ComputeNormals(this._positions32, this._indices32, this._normals32, v);
                                    for (var y = 0; y < this._normals32.length; y++) this._fixedNormal32[y] = this._normals32[y]
                                }
                                this.mesh.areNormalsFrozen || this.mesh.updateVerticesData(pi.VertexBuffer.NormalKind, this._normals32, !1, !1)
                            }
                            if (this._depthSort && this._depthSortParticles) {
                                this.depthSortedParticles.sort(this._depthSortFunction);
                                var b = this.depthSortedParticles.length,
                                    x = 0,
                                    T = 0,
                                    E = 0,
                                    S = 0;
                                for (x = 0; x < b; x++)
                                    for (T = this.depthSortedParticles[x].indicesLength, E = this.depthSortedParticles[x].ind, y = 0; y < T; y++) this._indices32[S] = this._indices[E + y], S++;
                                this.mesh.updateIndices(this._indices32)
                            }
                        }
                        return this._computeBoundingBox && (this.mesh._boundingInfo = new pi.BoundingInfo(this._minimum, this._maximum), this.mesh._boundingInfo.update(this.mesh._worldMatrix)), this.afterUpdateParticles(e, t, i), this
                    }, e.prototype._quaternionRotationYPR = function() {
                        this._halfroll = .5 * this._roll, this._halfpitch = .5 * this._pitch, this._halfyaw = .5 * this._yaw, this._sinRoll = Math.sin(this._halfroll), this._cosRoll = Math.cos(this._halfroll), this._sinPitch = Math.sin(this._halfpitch), this._cosPitch = Math.cos(this._halfpitch), this._sinYaw = Math.sin(this._halfyaw), this._cosYaw = Math.cos(this._halfyaw), this._quaternion.x = this._cosYaw * this._sinPitch * this._cosRoll + this._sinYaw * this._cosPitch * this._sinRoll, this._quaternion.y = this._sinYaw * this._cosPitch * this._cosRoll - this._cosYaw * this._sinPitch * this._sinRoll, this._quaternion.z = this._cosYaw * this._cosPitch * this._sinRoll - this._sinYaw * this._sinPitch * this._cosRoll, this._quaternion.w = this._cosYaw * this._cosPitch * this._cosRoll + this._sinYaw * this._sinPitch * this._sinRoll
                    }, e.prototype._quaternionToRotationMatrix = function() {
                        this._rotMatrix.m[0] = 1 - 2 * (this._quaternion.y * this._quaternion.y + this._quaternion.z * this._quaternion.z), this._rotMatrix.m[1] = 2 * (this._quaternion.x * this._quaternion.y + this._quaternion.z * this._quaternion.w), this._rotMatrix.m[2] = 2 * (this._quaternion.z * this._quaternion.x - this._quaternion.y * this._quaternion.w), this._rotMatrix.m[3] = 0, this._rotMatrix.m[4] = 2 * (this._quaternion.x * this._quaternion.y - this._quaternion.z * this._quaternion.w), this._rotMatrix.m[5] = 1 - 2 * (this._quaternion.z * this._quaternion.z + this._quaternion.x * this._quaternion.x), this._rotMatrix.m[6] = 2 * (this._quaternion.y * this._quaternion.z + this._quaternion.x * this._quaternion.w), this._rotMatrix.m[7] = 0, this._rotMatrix.m[8] = 2 * (this._quaternion.z * this._quaternion.x + this._quaternion.y * this._quaternion.w), this._rotMatrix.m[9] = 2 * (this._quaternion.y * this._quaternion.z - this._quaternion.x * this._quaternion.w), this._rotMatrix.m[10] = 1 - 2 * (this._quaternion.y * this._quaternion.y + this._quaternion.x * this._quaternion.x), this._rotMatrix.m[11] = 0, this._rotMatrix.m[12] = 0, this._rotMatrix.m[13] = 0, this._rotMatrix.m[14] = 0, this._rotMatrix.m[15] = 1
                    }, e.prototype.dispose = function() {
                        this.mesh.dispose(), this.vars = null, this._positions = null, this._indices = null, this._normals = null, this._uvs = null, this._colors = null, this._indices32 = null, this._positions32 = null, this._normals32 = null, this._fixedNormal32 = null, this._uvs32 = null, this._colors32 = null, this.pickedParticles = null
                    }, e.prototype.refreshVisibleSize = function() {
                        return this._isVisibilityBoxLocked || this.mesh.refreshBoundingInfo(), this
                    }, e.prototype.setVisibilityBox = function(e) {
                        var t = e / 2;
                        this.mesh._boundingInfo = new pi.BoundingInfo(new pi.Vector3(-t, -t, -t), new pi.Vector3(t, t, t))
                    }, Object.defineProperty(e.prototype, "isAlwaysVisible", {
                        get: function() {
                            return this._alwaysVisible
                        },
                        set: function(e) {
                            this._alwaysVisible = e, this.mesh.alwaysSelectAsActiveMesh = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "isVisibilityBoxLocked", {
                        get: function() {
                            return this._isVisibilityBoxLocked
                        },
                        set: function(e) {
                            this._isVisibilityBoxLocked = e, this.mesh.getBoundingInfo().isLocked = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "computeParticleRotation", {
                        get: function() {
                            return this._computeParticleRotation
                        },
                        set: function(e) {
                            this._computeParticleRotation = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "computeParticleColor", {
                        get: function() {
                            return this._computeParticleColor
                        },
                        set: function(e) {
                            this._computeParticleColor = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "computeParticleTexture", {
                        get: function() {
                            return this._computeParticleTexture
                        },
                        set: function(e) {
                            this._computeParticleTexture = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "computeParticleVertex", {
                        get: function() {
                            return this._computeParticleVertex
                        },
                        set: function(e) {
                            this._computeParticleVertex = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "computeBoundingBox", {
                        get: function() {
                            return this._computeBoundingBox
                        },
                        set: function(e) {
                            this._computeBoundingBox = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "depthSortParticles", {
                        get: function() {
                            return this._depthSortParticles
                        },
                        set: function(e) {
                            this._depthSortParticles = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.initParticles = function() {}, e.prototype.recycleParticle = function(e) {
                        return e
                    }, e.prototype.updateParticle = function(e) {
                        return e
                    }, e.prototype.updateParticleVertex = function(e, t, i) {
                        return t
                    }, e.prototype.beforeUpdateParticles = function(e, t, i) {}, e.prototype.afterUpdateParticles = function(e, t, i) {}, e
                }(), pi.SolidParticleSystem = fi, _i = $a || ($a = {}), mi = function() {
                    function e() {}
                    return e.updateSideOrientation = function(e) {
                        return e == _i.Mesh.DOUBLESIDE ? _i.Mesh.DOUBLESIDE : null == e ? _i.Mesh.FRONTSIDE : e
                    }, e.CreateBox = function(t, i, r) {
                        void 0 === r && (r = null);
                        var n = new _i.Mesh(t, r);
                        return i.sideOrientation = e.updateSideOrientation(i.sideOrientation), n._originalBuilderSideOrientation = i.sideOrientation, _i.VertexData.CreateBox(i).applyToMesh(n, i.updatable), n
                    }, e.CreateSphere = function(t, i, r) {
                        var n = new _i.Mesh(t, r);
                        return i.sideOrientation = e.updateSideOrientation(i.sideOrientation), n._originalBuilderSideOrientation = i.sideOrientation, _i.VertexData.CreateSphere(i).applyToMesh(n, i.updatable), n
                    }, e.CreateDisc = function(t, i, r) {
                        void 0 === r && (r = null);
                        var n = new _i.Mesh(t, r);
                        return i.sideOrientation = e.updateSideOrientation(i.sideOrientation), n._originalBuilderSideOrientation = i.sideOrientation, _i.VertexData.CreateDisc(i).applyToMesh(n, i.updatable), n
                    }, e.CreateIcoSphere = function(t, i, r) {
                        var n = new _i.Mesh(t, r);
                        return i.sideOrientation = e.updateSideOrientation(i.sideOrientation), n._originalBuilderSideOrientation = i.sideOrientation, _i.VertexData.CreateIcoSphere(i).applyToMesh(n, i.updatable), n
                    }, e.CreateRibbon = function(t, i, r) {
                        void 0 === r && (r = null);
                        var n = i.pathArray,
                            o = i.closeArray,
                            s = i.closePath,
                            a = e.updateSideOrientation(i.sideOrientation),
                            l = i.instance,
                            u = i.updatable;
                        if (l) {
                            _i.Vector3.FromFloatsToRef(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, _i.Tmp.Vector3[0]), _i.Vector3.FromFloatsToRef(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, _i.Tmp.Vector3[1]);
                            var c = l.getVerticesData(_i.VertexBuffer.PositionKind);
                            if (function(e) {
                                    for (var t = n[0].length, i = l, r = 0, o = i._originalBuilderSideOrientation === _i.Mesh.DOUBLESIDE ? 2 : 1, s = 1; s <= o; s++)
                                        for (var a = 0; a < n.length; a++) {
                                            var u = n[a],
                                                c = u.length;
                                            t = t < c ? t : c;
                                            for (var h = 0; h < t;) e[r] = u[h].x, e[r + 1] = u[h].y, e[r + 2] = u[h].z, u[h].x < _i.Tmp.Vector3[0].x && (_i.Tmp.Vector3[0].x = u[h].x), u[h].x > _i.Tmp.Vector3[1].x && (_i.Tmp.Vector3[1].x = u[h].x), u[h].y < _i.Tmp.Vector3[0].y && (_i.Tmp.Vector3[0].y = u[h].y), u[h].y > _i.Tmp.Vector3[1].y && (_i.Tmp.Vector3[1].y = u[h].y), u[h].z < _i.Tmp.Vector3[0].z && (_i.Tmp.Vector3[0].z = u[h].z), u[h].z > _i.Tmp.Vector3[1].z && (_i.Tmp.Vector3[1].z = u[h].z), h++, r += 3;
                                            i._creationDataStorage && i._creationDataStorage.closePath && (e[r] = u[0].x, e[r + 1] = u[0].y, e[r + 2] = u[0].z, r += 3)
                                        }
                                }(c), l._boundingInfo = new _i.BoundingInfo(_i.Tmp.Vector3[2], _i.Tmp.Vector3[3]), l._boundingInfo.update(l._worldMatrix), l.updateVerticesData(_i.VertexBuffer.PositionKind, c, !1, !1), i.colors) {
                                for (var h = l.getVerticesData(_i.VertexBuffer.ColorKind), d = 0; d < i.colors.length; d++) h[4 * d] = i.colors[d].r, h[4 * d + 1] = i.colors[d].g, h[4 * d + 2] = i.colors[d].b, h[4 * d + 3] = i.colors[d].a;
                                l.updateVerticesData(_i.VertexBuffer.ColorKind, h, !1, !1)
                            }
                            if (i.uvs) {
                                for (var p = l.getVerticesData(_i.VertexBuffer.UVKind), f = 0; f < i.uvs.length; f++) p[2 * f] = i.uvs[f].x, p[2 * f + 1] = i.uvs[f].y;
                                l.updateVerticesData(_i.VertexBuffer.UVKind, p, !1, !1)
                            }
                            if (!l.areNormalsFrozen || l.isFacetDataEnabled) {
                                var _ = l.getIndices(),
                                    m = l.getVerticesData(_i.VertexBuffer.NormalKind),
                                    g = l.isFacetDataEnabled ? l.getFacetDataParameters() : null;
                                if (_i.VertexData.ComputeNormals(c, _, m, g), l._creationDataStorage && l._creationDataStorage.closePath)
                                    for (var v = 0, y = 0, b = 0; b < n.length; b++) v = 3 * l._creationDataStorage.idx[b], y = b + 1 < n.length ? 3 * (l._creationDataStorage.idx[b + 1] - 1) : m.length - 3, m[v] = .5 * (m[v] + m[y]), m[v + 1] = .5 * (m[v + 1] + m[y + 1]), m[v + 2] = .5 * (m[v + 2] + m[y + 2]), m[y] = m[v], m[y + 1] = m[v + 1], m[y + 2] = m[v + 2];
                                l.areNormalsFrozen || l.updateVerticesData(_i.VertexBuffer.NormalKind, m, !1, !1)
                            }
                            return l
                        }
                        var x = new _i.Mesh(t, r);
                        x._originalBuilderSideOrientation = a, x._creationDataStorage = new _i._CreationDataStorage;
                        var T = _i.VertexData.CreateRibbon(i);
                        return s && (x._creationDataStorage.idx = T._idx), x._creationDataStorage.closePath = s, x._creationDataStorage.closeArray = o, T.applyToMesh(x, u), x
                    }, e.CreateCylinder = function(t, i, r) {
                        var n = new _i.Mesh(t, r);
                        return i.sideOrientation = e.updateSideOrientation(i.sideOrientation), n._originalBuilderSideOrientation = i.sideOrientation, _i.VertexData.CreateCylinder(i).applyToMesh(n, i.updatable), n
                    }, e.CreateTorus = function(t, i, r) {
                        var n = new _i.Mesh(t, r);
                        return i.sideOrientation = e.updateSideOrientation(i.sideOrientation), n._originalBuilderSideOrientation = i.sideOrientation, _i.VertexData.CreateTorus(i).applyToMesh(n, i.updatable), n
                    }, e.CreateTorusKnot = function(t, i, r) {
                        var n = new _i.Mesh(t, r);
                        return i.sideOrientation = e.updateSideOrientation(i.sideOrientation), n._originalBuilderSideOrientation = i.sideOrientation, _i.VertexData.CreateTorusKnot(i).applyToMesh(n, i.updatable), n
                    }, e.CreateLineSystem = function(e, t, i) {
                        var r = t.instance,
                            n = t.lines,
                            o = t.colors;
                        if (r) {
                            var s, a, l = r.getVerticesData(_i.VertexBuffer.PositionKind);
                            o && (s = r.getVerticesData(_i.VertexBuffer.ColorKind));
                            for (var u = 0, c = 0, h = 0; h < n.length; h++)
                                for (var d = n[h], p = 0; p < d.length; p++) l[u] = d[p].x, l[u + 1] = d[p].y, l[u + 2] = d[p].z, o && s && (a = o[h], s[c] = a[p].r, s[c + 1] = a[p].g, s[c + 2] = a[p].b, s[c + 3] = a[p].a, c += 4), u += 3;
                            return r.updateVerticesData(_i.VertexBuffer.PositionKind, l, !1, !1), o && s && r.updateVerticesData(_i.VertexBuffer.ColorKind, s, !1, !1), r
                        }
                        var f = !!o,
                            _ = new _i.LinesMesh(e, i, null, void 0, void 0, f, t.useVertexAlpha);
                        return _i.VertexData.CreateLineSystem(t).applyToMesh(_, t.updatable), _
                    }, e.CreateLines = function(t, i, r) {
                        void 0 === r && (r = null);
                        var n = i.colors ? [i.colors] : null;
                        return e.CreateLineSystem(t, {
                            lines: [i.points],
                            updatable: i.updatable,
                            instance: i.instance,
                            colors: n,
                            useVertexAlpha: i.useVertexAlpha
                        }, r)
                    }, e.CreateDashedLines = function(e, t, i) {
                        void 0 === i && (i = null);
                        var r = t.points,
                            n = t.instance,
                            o = t.gapSize || 1,
                            s = t.dashSize || 3;
                        if (n) return n.updateMeshPositions(function(e) {
                            var t, i, o = _i.Vector3.Zero(),
                                s = e.length / 6,
                                a = 0,
                                l = 0,
                                u = 0,
                                c = 0,
                                h = 0,
                                d = 0;
                            for (h = 0; h < r.length - 1; h++) r[h + 1].subtractToRef(r[h], o), a += o.length();
                            t = a / s;
                            var p = n._creationDataStorage.dashSize;
                            for (i = p * t / (p + n._creationDataStorage.gapSize), h = 0; h < r.length - 1; h++)
                                for (r[h + 1].subtractToRef(r[h], o), l = Math.floor(o.length() / t), o.normalize(), d = 0; d < l && c < e.length;) u = t * d, e[c] = r[h].x + u * o.x, e[c + 1] = r[h].y + u * o.y, e[c + 2] = r[h].z + u * o.z, e[c + 3] = r[h].x + (u + i) * o.x, e[c + 4] = r[h].y + (u + i) * o.y, e[c + 5] = r[h].z + (u + i) * o.z, c += 6, d++;
                            for (; c < e.length;) e[c] = r[h].x, e[c + 1] = r[h].y, e[c + 2] = r[h].z, c += 3
                        }, !1), n;
                        var a = new _i.LinesMesh(e, i);
                        return _i.VertexData.CreateDashedLines(t).applyToMesh(a, t.updatable), a._creationDataStorage = new _i._CreationDataStorage, a._creationDataStorage.dashSize = s, a._creationDataStorage.gapSize = o, a
                    }, e.ExtrudeShape = function(t, i, r) {
                        void 0 === r && (r = null);
                        var n = i.path,
                            o = i.shape,
                            s = i.scale || 1,
                            a = i.rotation || 0,
                            l = 0 === i.cap ? 0 : i.cap || _i.Mesh.NO_CAP,
                            u = i.updatable,
                            c = e.updateSideOrientation(i.sideOrientation),
                            h = i.instance || null,
                            d = i.invertUV || !1;
                        return e._ExtrudeShapeGeneric(t, o, n, s, a, null, null, !1, !1, l, !1, r, !!u, c, h, d, i.frontUVs || null, i.backUVs || null)
                    }, e.ExtrudeShapeCustom = function(t, i, r) {
                        var n = i.path,
                            o = i.shape,
                            s = i.scaleFunction || function() {
                                return 1
                            },
                            a = i.rotationFunction || function() {
                                return 0
                            },
                            l = i.ribbonCloseArray || !1,
                            u = i.ribbonClosePath || !1,
                            c = 0 === i.cap ? 0 : i.cap || _i.Mesh.NO_CAP,
                            h = i.updatable,
                            d = e.updateSideOrientation(i.sideOrientation),
                            p = i.instance,
                            f = i.invertUV || !1;
                        return e._ExtrudeShapeGeneric(t, o, n, null, null, s, a, l, u, c, !0, r, !!h, d, p || null, f, i.frontUVs || null, i.backUVs || null)
                    }, e.CreateLathe = function(t, i, r) {
                        var n, o = i.arc ? i.arc <= 0 || 1 < i.arc ? 1 : i.arc : 1,
                            s = void 0 === i.closed || i.closed,
                            a = i.shape,
                            l = i.radius || 1,
                            u = i.tessellation || 64,
                            c = i.clip || 0,
                            h = i.updatable,
                            d = e.updateSideOrientation(i.sideOrientation),
                            p = i.cap || _i.Mesh.NO_CAP,
                            f = 2 * Math.PI,
                            _ = new Array,
                            m = i.invertUV || !1,
                            g = 0,
                            v = 0,
                            y = f / u * o,
                            b = new Array;
                        for (g = 0; g <= u - c; g++) {
                            for (b = [], p != _i.Mesh.CAP_START && p != _i.Mesh.CAP_ALL || (b.push(new _i.Vector3(0, a[0].y, 0)), b.push(new _i.Vector3(Math.cos(g * y) * a[0].x * l, a[0].y, Math.sin(g * y) * a[0].x * l))), v = 0; v < a.length; v++) n = new _i.Vector3(Math.cos(g * y) * a[v].x * l, a[v].y, Math.sin(g * y) * a[v].x * l), b.push(n);
                            p != _i.Mesh.CAP_END && p != _i.Mesh.CAP_ALL || (b.push(new _i.Vector3(Math.cos(g * y) * a[a.length - 1].x * l, a[a.length - 1].y, Math.sin(g * y) * a[a.length - 1].x * l)), b.push(new _i.Vector3(0, a[a.length - 1].y, 0))), _.push(b)
                        }
                        return e.CreateRibbon(t, {
                            pathArray: _,
                            closeArray: s,
                            sideOrientation: d,
                            updatable: h,
                            invertUV: m,
                            frontUVs: i.frontUVs,
                            backUVs: i.backUVs
                        }, r)
                    }, e.CreatePlane = function(t, i, r) {
                        var n = new _i.Mesh(t, r);
                        if (i.sideOrientation = e.updateSideOrientation(i.sideOrientation), n._originalBuilderSideOrientation = i.sideOrientation, _i.VertexData.CreatePlane(i).applyToMesh(n, i.updatable), i.sourcePlane) {
                            n.translate(i.sourcePlane.normal, i.sourcePlane.d);
                            var o = Math.acos(_i.Vector3.Dot(i.sourcePlane.normal, _i.Axis.Z)),
                                s = _i.Vector3.Cross(_i.Axis.Z, i.sourcePlane.normal);
                            s.lengthSquared() > _i.Epsilon && n.rotate(s, o)
                        }
                        return n
                    }, e.CreateGround = function(e, t, i) {
                        var r = new _i.GroundMesh(e, i);
                        return r._setReady(!1), r._subdivisionsX = t.subdivisionsX || t.subdivisions || 1, r._subdivisionsY = t.subdivisionsY || t.subdivisions || 1, r._width = t.width || 1, r._height = t.height || 1, r._maxX = r._width / 2, r._maxZ = r._height / 2, r._minX = -r._maxX, r._minZ = -r._maxZ, _i.VertexData.CreateGround(t).applyToMesh(r, t.updatable), r._setReady(!0), r
                    }, e.CreateTiledGround = function(e, t, i) {
                        var r = new _i.Mesh(e, i);
                        return _i.VertexData.CreateTiledGround(t).applyToMesh(r, t.updatable), r
                    }, e.CreateGroundFromHeightMap = function(e, t, i, r) {
                        var n = i.width || 10,
                            o = i.height || 10,
                            s = i.subdivisions || 1,
                            a = i.minHeight || 0,
                            l = i.maxHeight || 1,
                            u = i.colorFilter || new _i.Color3(.3, .59, .11),
                            c = i.alphaFilter || 0,
                            h = i.updatable,
                            d = i.onReady,
                            p = new _i.GroundMesh(e, r);
                        return p._subdivisionsX = s, p._subdivisionsY = s, p._width = n, p._height = o, p._maxX = p._width / 2, p._maxZ = p._height / 2, p._minX = -p._maxX, p._minZ = -p._maxZ, p._setReady(!1), _i.Tools.LoadImage(t, function(e) {
                            var t = document.createElement("canvas"),
                                i = t.getContext("2d");
                            if (!i) throw new Error("Unable to get 2d context for CreateGroundFromHeightMap");
                            if (!r.isDisposed) {
                                var f = e.width,
                                    _ = e.height;
                                t.width = f, t.height = _, i.drawImage(e, 0, 0);
                                var m = i.getImageData(0, 0, f, _).data;
                                _i.VertexData.CreateGroundFromHeightMap({
                                    width: n,
                                    height: o,
                                    subdivisions: s,
                                    minHeight: a,
                                    maxHeight: l,
                                    colorFilter: u,
                                    buffer: m,
                                    bufferWidth: f,
                                    bufferHeight: _,
                                    alphaFilter: c
                                }).applyToMesh(p, h), d && d(p), p._setReady(!0)
                            }
                        }, function() {}, r.database), p
                    }, e.CreatePolygon = function(t, i, r) {
                        i.sideOrientation = e.updateSideOrientation(i.sideOrientation);
                        for (var n = i.shape, o = i.holes || [], s = i.depth || 0, a = [], l = [], u = 0; u < n.length; u++) a[u] = new _i.Vector2(n[u].x, n[u].z);
                        a[0].equalsWithEpsilon(a[a.length - 1], 1e-8) && a.pop();
                        for (var c = new _i.PolygonMeshBuilder(t, a, r), h = 0; h < o.length; h++) {
                            l = [];
                            for (var d = 0; d < o[h].length; d++) l.push(new _i.Vector2(o[h][d].x, o[h][d].z));
                            c.addHole(l)
                        }
                        var p = c.build(i.updatable, s);
                        return p._originalBuilderSideOrientation = i.sideOrientation, _i.VertexData.CreatePolygon(p, i.sideOrientation, i.faceUV, i.faceColors, i.frontUVs, i.backUVs).applyToMesh(p, i.updatable), p
                    }, e.ExtrudePolygon = function(t, i, r) {
                        return e.CreatePolygon(t, i, r)
                    }, e.CreateTube = function(t, i, r) {
                        var n = i.path,
                            o = i.instance,
                            s = 1;
                        void 0 !== i.radius ? s = i.radius : o && (s = o._creationDataStorage.radius);
                        var a = i.tessellation || 64,
                            l = i.radiusFunction || null,
                            u = i.cap || _i.Mesh.NO_CAP,
                            c = i.invertUV || !1,
                            h = i.updatable,
                            d = e.updateSideOrientation(i.sideOrientation);
                        i.arc = i.arc && (i.arc <= 0 || 1 < i.arc) ? 1 : i.arc || 1;
                        var p, f, _ = function(e, t, i, r, n, o, s, a) {
                            for (var l, u, c, h, d = t.getTangents(), p = t.getNormals(), f = t.getDistances(), _ = 2 * Math.PI / n * a, m = o || function() {
                                    return r
                                }, g = _i.Tmp.Matrix[0], v = s === _i.Mesh.NO_CAP || s === _i.Mesh.CAP_END ? 0 : 2, y = 0; y < e.length; y++) {
                                u = m(y, f[y]), l = Array(), c = p[y];
                                for (var b = 0; b < n; b++) _i.Matrix.RotationAxisToRef(d[y], _ * b, g), h = l[b] ? l[b] : _i.Vector3.Zero(), _i.Vector3.TransformCoordinatesToRef(c, g, h), h.scaleInPlace(u).addInPlace(e[y]), l[b] = h;
                                i[v] = l, v++
                            }
                            var x = function(t, i) {
                                for (var r = Array(), n = 0; n < t; n++) r.push(e[i]);
                                return r
                            };
                            switch (s) {
                                case _i.Mesh.NO_CAP:
                                    break;
                                case _i.Mesh.CAP_START:
                                    i[0] = x(n, 0), i[1] = i[2].slice(0);
                                    break;
                                case _i.Mesh.CAP_END:
                                    i[v] = i[v - 1].slice(0), i[v + 1] = x(n, e.length - 1);
                                    break;
                                case _i.Mesh.CAP_ALL:
                                    i[0] = x(n, 0), i[1] = i[2].slice(0), i[v] = i[v - 1].slice(0), i[v + 1] = x(n, e.length - 1)
                            }
                            return i
                        };
                        if (o) {
                            var m = o._creationDataStorage,
                                g = i.arc || m.arc;
                            return f = _(n, p = m.path3D.update(n), m.pathArray, s, m.tessellation, l, m.cap, g), o = e.CreateRibbon("", {
                                pathArray: f,
                                instance: o
                            }), m.path3D = p, m.pathArray = f, m.arc = g, m.radius = s, o
                        }
                        f = _(n, p = new _i.Path3D(n), new Array, s, a, l, u = u < 0 || 3 < u ? 0 : u, i.arc);
                        var v = e.CreateRibbon(t, {
                            pathArray: f,
                            closePath: !0,
                            closeArray: !1,
                            updatable: h,
                            sideOrientation: d,
                            invertUV: c,
                            frontUVs: i.frontUVs,
                            backUVs: i.backUVs
                        }, r);
                        return v._creationDataStorage.pathArray = f, v._creationDataStorage.path3D = p, v._creationDataStorage.tessellation = a, v._creationDataStorage.cap = u, v._creationDataStorage.arc = i.arc, v._creationDataStorage.radius = s, v
                    }, e.CreatePolyhedron = function(t, i, r) {
                        var n = new _i.Mesh(t, r);
                        return i.sideOrientation = e.updateSideOrientation(i.sideOrientation), n._originalBuilderSideOrientation = i.sideOrientation, _i.VertexData.CreatePolyhedron(i).applyToMesh(n, i.updatable), n
                    }, e.CreateDecal = function(e, t, i) {
                        var r = t.getIndices(),
                            n = t.getVerticesData(_i.VertexBuffer.PositionKind),
                            o = t.getVerticesData(_i.VertexBuffer.NormalKind),
                            s = i.position || _i.Vector3.Zero(),
                            a = i.normal || _i.Vector3.Up(),
                            l = i.size || _i.Vector3.One(),
                            u = i.angle || 0;
                        if (!a) {
                            var c = new _i.Vector3(0, 0, 1),
                                h = t.getScene().activeCamera,
                                d = _i.Vector3.TransformCoordinates(c, h.getWorldMatrix());
                            a = h.globalPosition.subtract(d)
                        }
                        var p = -Math.atan2(a.z, a.x) - Math.PI / 2,
                            f = Math.sqrt(a.x * a.x + a.z * a.z),
                            _ = Math.atan2(a.y, f),
                            m = _i.Matrix.RotationYawPitchRoll(p, _, u).multiply(_i.Matrix.Translation(s.x, s.y, s.z)),
                            g = _i.Matrix.Invert(m),
                            v = t.getWorldMatrix().multiply(g),
                            y = new _i.VertexData;
                        y.indices = [], y.positions = [], y.normals = [], y.uvs = [];
                        for (var b = 0, x = function(e) {
                                var t = new _i.PositionNormalVertex;
                                if (!r || !n || !o) return t;
                                var i = r[e];
                                return t.position = new _i.Vector3(n[3 * i], n[3 * i + 1], n[3 * i + 2]), t.position = _i.Vector3.TransformCoordinates(t.position, v), t.normal = new _i.Vector3(o[3 * i], o[3 * i + 1], o[3 * i + 2]), t.normal = _i.Vector3.TransformNormal(t.normal, v), t
                            }, T = function(e, t) {
                                if (0 === e.length) return e;
                                for (var i = .5 * Math.abs(_i.Vector3.Dot(l, t)), r = function(e, r) {
                                        var n = _i.Vector3.GetClipFactor(e.position, r.position, t, i);
                                        return new _i.PositionNormalVertex(_i.Vector3.Lerp(e.position, r.position, n), _i.Vector3.Lerp(e.normal, r.normal, n))
                                    }, n = new Array, o = 0; o < e.length; o += 3) {
                                    var s, a, u, c = null,
                                        h = null,
                                        d = null,
                                        p = null;
                                    switch (((s = 0 < _i.Vector3.Dot(e[o].position, t) - i) ? 1 : 0) + ((a = 0 < _i.Vector3.Dot(e[o + 1].position, t) - i) ? 1 : 0) + ((u = 0 < _i.Vector3.Dot(e[o + 2].position, t) - i) ? 1 : 0)) {
                                        case 0:
                                            n.push(e[o]), n.push(e[o + 1]), n.push(e[o + 2]);
                                            break;
                                        case 1:
                                            if (s && (c = e[o + 1], h = e[o + 2], d = r(e[o], c), p = r(e[o], h)), a) {
                                                c = e[o], h = e[o + 2], d = r(e[o + 1], c), p = r(e[o + 1], h), n.push(d), n.push(h.clone()), n.push(c.clone()), n.push(h.clone()), n.push(d.clone()), n.push(p);
                                                break
                                            }
                                            u && (c = e[o], h = e[o + 1], d = r(e[o + 2], c), p = r(e[o + 2], h)), c && h && d && p && (n.push(c.clone()), n.push(h.clone()), n.push(d), n.push(p), n.push(d.clone()), n.push(h.clone()));
                                            break;
                                        case 2:
                                            s || (h = r(c = e[o].clone(), e[o + 1]), d = r(c, e[o + 2]), n.push(c), n.push(h), n.push(d)), a || (h = r(c = e[o + 1].clone(), e[o + 2]), d = r(c, e[o]), n.push(c), n.push(h), n.push(d)), u || (h = r(c = e[o + 2].clone(), e[o]), d = r(c, e[o + 1]), n.push(c), n.push(h), n.push(d))
                                    }
                                }
                                return n
                            }, E = 0; E < r.length; E += 3) {
                            var S = new Array;
                            if (S.push(x(E)), S.push(x(E + 1)), S.push(x(E + 2)), 0 !== (S = T(S = T(S = T(S = T(S = T(S = T(S, new _i.Vector3(1, 0, 0)), new _i.Vector3(-1, 0, 0)), new _i.Vector3(0, 1, 0)), new _i.Vector3(0, -1, 0)), new _i.Vector3(0, 0, 1)), new _i.Vector3(0, 0, -1))).length)
                                for (var P = 0; P < S.length; P++) {
                                    var A = S[P];
                                    y.indices.push(b), A.position.toArray(y.positions, 3 * b), A.normal.toArray(y.normals, 3 * b), y.uvs.push(.5 + A.position.x / l.x), y.uvs.push(.5 + A.position.y / l.y), b++
                                }
                        }
                        var C = new _i.Mesh(e, t.getScene());
                        return y.applyToMesh(C), C.position = s.clone(), C.rotation = new _i.Vector3(_, p, u), C
                    }, e._ExtrudeShapeGeneric = function(t, i, r, n, o, s, a, l, u, c, h, d, p, f, _, m, g, v) {
                        var y, b, x = function(e, t, i, r, n, o, s, a, l, u) {
                            for (var c = i.getTangents(), h = i.getNormals(), d = i.getBinormals(), p = i.getDistances(), f = 0, _ = u && a ? a : function() {
                                    return null !== o ? o : 0
                                }, m = u && s ? s : function() {
                                    return null !== n ? n : 1
                                }, g = l === _i.Mesh.NO_CAP || l === _i.Mesh.CAP_END ? 0 : 2, v = _i.Tmp.Matrix[0], y = 0; y < t.length; y++) {
                                for (var b = new Array, x = _(y, p[y]), T = m(y, p[y]), E = 0; E < e.length; E++) {
                                    _i.Matrix.RotationAxisToRef(c[y], f, v);
                                    var S = c[y].scale(e[E].z).add(h[y].scale(e[E].x)).add(d[y].scale(e[E].y)),
                                        P = b[E] ? b[E] : _i.Vector3.Zero();
                                    _i.Vector3.TransformCoordinatesToRef(S, v, P), P.scaleInPlace(T).addInPlace(t[y]), b[E] = P
                                }
                                r[g] = b, f += x, g++
                            }
                            var A = function(e) {
                                var t, i = Array(),
                                    r = _i.Vector3.Zero();
                                for (t = 0; t < e.length; t++) r.addInPlace(e[t]);
                                for (r.scaleInPlace(1 / e.length), t = 0; t < e.length; t++) i.push(r);
                                return i
                            };
                            switch (l) {
                                case _i.Mesh.NO_CAP:
                                    break;
                                case _i.Mesh.CAP_START:
                                    r[0] = A(r[2]), r[1] = r[2];
                                    break;
                                case _i.Mesh.CAP_END:
                                    r[g] = r[g - 1], r[g + 1] = A(r[g - 1]);
                                    break;
                                case _i.Mesh.CAP_ALL:
                                    r[0] = A(r[2]), r[1] = r[2], r[g] = r[g - 1], r[g + 1] = A(r[g - 1])
                            }
                            return r
                        };
                        if (_) {
                            var T = _._creationDataStorage;
                            return y = T.path3D.update(r), b = x(i, r, T.path3D, T.pathArray, n, o, s, a, T.cap, h), _ = _i.Mesh.CreateRibbon("", b, !1, !1, 0, d || void 0, !1, 0, _)
                        }
                        b = x(i, r, y = new _i.Path3D(r), new Array, n, o, s, a, c = c < 0 || 3 < c ? 0 : c, h);
                        var E = e.CreateRibbon(t, {
                            pathArray: b,
                            closeArray: l,
                            closePath: u,
                            updatable: p,
                            sideOrientation: f,
                            invertUV: m,
                            frontUVs: g || void 0,
                            backUVs: v || void 0
                        }, d);
                        return E._creationDataStorage.pathArray = b, E._creationDataStorage.path3D = y, E._creationDataStorage.cap = c, E
                    }, e
                }(), _i.MeshBuilder = mi, gi = $a || ($a = {}), vi = function() {
                    function e() {}
                    return Object.defineProperty(e, "DecoderAvailable", {
                        get: function() {
                            if ("undefined" != typeof DracoDecoderModule) return !0;
                            var t = e.Configuration.decoder;
                            if (t) {
                                if (t.wasmUrl && t.wasmBinaryUrl && "object" == typeof WebAssembly) return !0;
                                if (t.fallbackUrl) return !0
                            }
                            return !1
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.dispose = function() {}, e.prototype.decodeMeshAsync = function(t, i) {
                        var r = t instanceof ArrayBuffer ? new Uint8Array(t) : t;
                        return e._GetDecoderModule().then(function(e) {
                            var t = e.module,
                                n = new gi.VertexData,
                                o = new t.DecoderBuffer;
                            o.Init(r, r.byteLength);
                            var s, a, l = new t.Decoder;
                            try {
                                var u = l.GetEncodedGeometryType(o);
                                switch (u) {
                                    case t.TRIANGULAR_MESH:
                                        s = new t.Mesh, a = l.DecodeBufferToMesh(o, s);
                                        break;
                                    case t.POINT_CLOUD:
                                        s = new t.PointCloud, a = l.DecodeBufferToPointCloud(o, s);
                                        break;
                                    default:
                                        throw new Error("Invalid geometry type " + u)
                                }
                                if (!a.ok() || !s.ptr) throw new Error(a.error_msg());
                                var c = s.num_points();
                                if (u === t.TRIANGULAR_MESH) {
                                    var h = s.num_faces(),
                                        d = new t.DracoInt32Array;
                                    try {
                                        for (var p = new Uint32Array(3 * h), f = 0; f < h; f++) {
                                            l.GetFaceFromMesh(s, f, d);
                                            var _ = 3 * f;
                                            p[_ + 0] = d.GetValue(0), p[_ + 1] = d.GetValue(1), p[_ + 2] = d.GetValue(2)
                                        }
                                        n.indices = p
                                    } finally {
                                        t.destroy(d)
                                    }
                                }
                                for (var m in i) {
                                    var g = i[m],
                                        v = l.GetAttributeByUniqueId(s, g),
                                        y = new t.DracoFloat32Array;
                                    try {
                                        l.GetAttributeFloatForAllPoints(s, v, y);
                                        var b = new Float32Array(c * v.num_components());
                                        for (f = 0; f < b.length; f++) b[f] = y.GetValue(f);
                                        n.set(b, m)
                                    } finally {
                                        t.destroy(y)
                                    }
                                }
                            } finally {
                                s && t.destroy(s), t.destroy(l), t.destroy(o)
                            }
                            return n
                        })
                    }, e._GetDecoderModule = function() {
                        if (!e._DecoderModulePromise) {
                            var t = null,
                                i = {};
                            if ("undefined" != typeof DracoDecoderModule) t = Promise.resolve();
                            else {
                                var r = e.Configuration.decoder;
                                r && (r.wasmUrl && r.wasmBinaryUrl && "object" == typeof WebAssembly ? t = Promise.all([e._LoadScriptAsync(r.wasmUrl), e._LoadFileAsync(r.wasmBinaryUrl).then(function(e) {
                                    i.wasmBinary = e
                                })]) : r.fallbackUrl && (t = e._LoadScriptAsync(r.fallbackUrl)))
                            }
                            if (!t) throw new Error("Draco decoder module is not available");
                            e._DecoderModulePromise = t.then(function() {
                                return new Promise(function(e) {
                                    i.onModuleLoaded = function(t) {
                                        e({
                                            module: t
                                        })
                                    }, DracoDecoderModule(i)
                                })
                            })
                        }
                        return e._DecoderModulePromise
                    }, e._LoadScriptAsync = function(e) {
                        return new Promise(function(t, i) {
                            gi.Tools.LoadScript(e, function() {
                                t()
                            }, function(e) {
                                i(new Error(e))
                            })
                        })
                    }, e._LoadFileAsync = function(e) {
                        return new Promise(function(t, i) {
                            gi.Tools.LoadFile(e, function(e) {
                                t(e)
                            }, void 0, void 0, !0, function(e, t) {
                                i(t)
                            })
                        })
                    }, e.Configuration = {
                        decoder: {
                            wasmUrl: "https://preview.babylonjs.com/draco_wasm_wrapper_gltf.js",
                            wasmBinaryUrl: "https://preview.babylonjs.com/draco_decoder_gltf.wasm",
                            fallbackUrl: "https://preview.babylonjs.com/draco_decoder_gltf.js"
                        }
                    }, e
                }(), gi.DracoCompression = vi,
                function(e) {
                    e.Engine.AudioEngineFactory = function(e) {
                        return new t(e)
                    };
                    var t = function() {
                        function t(t) {
                            void 0 === t && (t = null);
                            var i = this;
                            this._audioContext = null, this._audioContextInitialized = !1, this._muteButton = null, this.canUseWebAudio = !1, this.WarnedWebAudioUnsupported = !1, this.isMP3supported = !1, this.isOGGsupported = !1, this.unlocked = !0, this.useCustomUnlockedButton = !1, this.onAudioUnlockedObservable = new e.Observable, this.onAudioLockedObservable = new e.Observable, this._tryToRun = !1, this._onResize = function() {
                                i._moveButtonToTopLeft()
                            }, void 0 === window.AudioContext && void 0 === window.webkitAudioContext || (window.AudioContext = window.AudioContext || window.webkitAudioContext, this.canUseWebAudio = !0);
                            var r = document.createElement("audio");
                            this._hostElement = t;
                            try {
                                r && r.canPlayType && r.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/, "") && (this.isMP3supported = !0)
                            } catch (t) {}
                            try {
                                r && r.canPlayType && r.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, "") && (this.isOGGsupported = !0)
                            } catch (t) {}
                        }
                        return Object.defineProperty(t.prototype, "audioContext", {
                            get: function() {
                                return this._audioContextInitialized ? this.unlocked || this._muteButton || this._displayMuteButton() : this._initializeAudioContext(), this._audioContext
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.lock = function() {
                            this._triggerSuspendedState()
                        }, t.prototype.unlock = function() {
                            this._triggerRunningState()
                        }, t.prototype._resumeAudioContext = function() {
                            var e;
                            return this._audioContext.resume && (e = this._audioContext.resume()), e || Promise.resolve()
                        }, t.prototype._initializeAudioContext = function() {
                            try {
                                this.canUseWebAudio && (this._audioContext = new AudioContext, this.masterGain = this._audioContext.createGain(), this.masterGain.gain.value = 1, this.masterGain.connect(this._audioContext.destination), this._audioContextInitialized = !0, "running" === this._audioContext.state && this._triggerRunningState())
                            } catch (t) {
                                this.canUseWebAudio = !1, e.Tools.Error("Web Audio: " + t.message)
                            }
                        }, t.prototype._triggerRunningState = function() {
                            var e = this;
                            this._tryToRun || (this._tryToRun = !0, this._resumeAudioContext().then(function() {
                                e._tryToRun = !1, e._muteButton && e._hideMuteButton()
                            }).catch(function() {
                                e._tryToRun = !1, e.unlocked = !1
                            }), this.unlocked = !0, this.onAudioUnlockedObservable.notifyObservers(this))
                        }, t.prototype._triggerSuspendedState = function() {
                            this.unlocked = !1, this.onAudioLockedObservable.notifyObservers(this), this._displayMuteButton()
                        }, t.prototype._displayMuteButton = function() {
                            var e = this;
                            if (!this.useCustomUnlockedButton) {
                                this._muteButton = document.createElement("BUTTON"), this._muteButton.className = "babylonUnmuteIcon", this._muteButton.id = "babylonUnmuteIconBtn", this._muteButton.title = "Unmute";
                                var t = document.createElement("style");
                                t.appendChild(document.createTextNode(".babylonUnmuteIcon { position: absolute; left: 20px; top: 20px; height: 40px; width: 60px; background-color: rgba(51,51,51,0.7); background-image: url(data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E);  background-size: 80%; background-repeat:no-repeat; background-position: center; background-position-y: 4px; border: none; outline: none; transition: transform 0.125s ease-out; cursor: pointer; z-index: 9999; } .babylonUnmuteIcon:hover { transform: scale(1.05) } .babylonUnmuteIcon:active { background-color: rgba(51,51,51,1) }")), document.getElementsByTagName("head")[0].appendChild(t), document.body.appendChild(this._muteButton), this._moveButtonToTopLeft(), this._muteButton.addEventListener("touchend", function() {
                                    e._triggerRunningState()
                                }, !0), this._muteButton.addEventListener("click", function() {
                                    e._triggerRunningState()
                                }, !0), window.addEventListener("resize", this._onResize)
                            }
                        }, t.prototype._moveButtonToTopLeft = function() {
                            this._hostElement && this._muteButton && (this._muteButton.style.top = this._hostElement.offsetTop + 20 + "px", this._muteButton.style.left = this._hostElement.offsetLeft + 20 + "px")
                        }, t.prototype._hideMuteButton = function() {
                            this._muteButton && (document.body.removeChild(this._muteButton), this._muteButton = null)
                        }, t.prototype.dispose = function() {
                            this.canUseWebAudio && this._audioContextInitialized && (this._connectedAnalyser && this._audioContext && (this._connectedAnalyser.stopDebugCanvas(), this._connectedAnalyser.dispose(), this.masterGain.disconnect(), this.masterGain.connect(this._audioContext.destination), this._connectedAnalyser = null), this.masterGain.gain.value = 1), this.WarnedWebAudioUnsupported = !1, this._hideMuteButton(), window.removeEventListener("resize", this._onResize), this.onAudioUnlockedObservable.clear(), this.onAudioLockedObservable.clear()
                        }, t.prototype.getGlobalVolume = function() {
                            return this.canUseWebAudio && this._audioContextInitialized ? this.masterGain.gain.value : -1
                        }, t.prototype.setGlobalVolume = function(e) {
                            this.canUseWebAudio && this._audioContextInitialized && (this.masterGain.gain.value = e)
                        }, t.prototype.connectToAnalyser = function(e) {
                            this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(), this.canUseWebAudio && this._audioContextInitialized && this._audioContext && (this._connectedAnalyser = e, this.masterGain.disconnect(), this._connectedAnalyser.connectAudioNodes(this.masterGain, this._audioContext.destination))
                        }, t
                    }();
                    e.AudioEngine = t
                }($a || ($a = {})), yi = $a || ($a = {}), bi = function() {
                    function e(e, t, i, r, n) {
                        void 0 === r && (r = null);
                        var o = this;
                        this.autoplay = !1, this.loop = !1, this.useCustomAttenuation = !1, this.isPlaying = !1, this.isPaused = !1, this.spatialSound = !1, this.refDistance = 1, this.rolloffFactor = 1, this.maxDistance = 100, this.distanceModel = "linear", this.onEndedObservable = new yi.Observable, this._panningModel = "equalpower", this._playbackRate = 1, this._streaming = !1, this._startTime = 0, this._startOffset = 0, this._position = yi.Vector3.Zero(), this._positionInEmitterSpace = !1, this._localDirection = new yi.Vector3(1, 0, 0), this._volume = 1, this._isReadyToPlay = !1, this._isDirectional = !1, this._coneInnerAngle = 360, this._coneOuterAngle = 360, this._coneOuterGain = 0, this._isOutputConnected = !1, this._urlType = "Unknown", this.name = e;
                        var s = (this._scene = i)._getComponent(yi.SceneComponentConstants.NAME_AUDIO);
                        if (s || (s = new yi.AudioSceneComponent(i), i._addComponent(s)), this._readyToPlayCallback = r, this._customAttenuationFunction = function(e, t, i, r, n) {
                                return t < i ? e * (1 - t / i) : 0
                            }, n && (this.autoplay = n.autoplay || !1, this.loop = n.loop || !1, void 0 !== n.volume && (this._volume = n.volume), this.spatialSound = n.spatialSound || !1, this.maxDistance = n.maxDistance || 100, this.useCustomAttenuation = n.useCustomAttenuation || !1, this.rolloffFactor = n.rolloffFactor || 1, this.refDistance = n.refDistance || 1, this.distanceModel = n.distanceModel || "linear", this._playbackRate = n.playbackRate || 1, this._streaming = n.streaming || !1), yi.Engine.audioEngine.canUseWebAudio && yi.Engine.audioEngine.audioContext) {
                            this._soundGain = yi.Engine.audioEngine.audioContext.createGain(), this._soundGain.gain.value = this._volume, this._inputAudioNode = this._soundGain, this._outputAudioNode = this._soundGain, this.spatialSound && this._createSpatialParameters(), this._scene.mainSoundTrack.AddSound(this);
                            var a = !0;
                            if (t) try {
                                "string" == typeof t ? this._urlType = "String" : t instanceof ArrayBuffer ? this._urlType = "ArrayBuffer" : t instanceof MediaStream ? this._urlType = "MediaStream" : Array.isArray(t) && (this._urlType = "Array");
                                var l = [],
                                    u = !1;
                                switch (this._urlType) {
                                    case "MediaStream":
                                        this._streaming = !0, this._isReadyToPlay = !0, this._streamingSource = yi.Engine.audioEngine.audioContext.createMediaElementSource(t), this.autoplay && this.play(), this._readyToPlayCallback && this._readyToPlayCallback();
                                        break;
                                    case "ArrayBuffer":
                                        0 < t.byteLength && (u = !0, this._soundLoaded(t));
                                        break;
                                    case "String":
                                        l.push(t);
                                    case "Array":
                                        0 === l.length && (l = t);
                                        for (var c = 0; c < l.length; c++) {
                                            var h = l[c];
                                            if (-1 !== h.indexOf(".mp3", h.length - 4) && yi.Engine.audioEngine.isMP3supported && (u = !0), -1 !== h.indexOf(".ogg", h.length - 4) && yi.Engine.audioEngine.isOGGsupported && (u = !0), -1 !== h.indexOf(".wav", h.length - 4) && (u = !0), -1 !== h.indexOf("blob:") && (u = !0), u) {
                                                this._streaming ? (this._htmlAudioElement = new Audio(h), this._htmlAudioElement.controls = !1, this._htmlAudioElement.loop = this.loop, yi.Tools.SetCorsBehavior(h, this._htmlAudioElement), this._htmlAudioElement.preload = "auto", this._htmlAudioElement.addEventListener("canplaythrough", function() {
                                                    o._isReadyToPlay = !0, o.autoplay && o.play(), o._readyToPlayCallback && o._readyToPlayCallback()
                                                }), document.body.appendChild(this._htmlAudioElement), this._htmlAudioElement.load()) : this._scene._loadFile(h, function(e) {
                                                    o._soundLoaded(e)
                                                }, void 0, !0, !0, function(e) {
                                                    e && yi.Tools.Error("XHR " + e.status + " error on: " + h + "."), yi.Tools.Error("Sound creation aborted."), o._scene.mainSoundTrack.RemoveSound(o)
                                                });
                                                break
                                            }
                                        }
                                        break;
                                    default:
                                        a = !1
                                }
                                a ? u || (this._isReadyToPlay = !0, this._readyToPlayCallback && window.setTimeout(function() {
                                    o._readyToPlayCallback && o._readyToPlayCallback()
                                }, 1e3)) : yi.Tools.Error("Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.")
                            } catch (e) {
                                yi.Tools.Error("Unexpected error. Sound creation aborted."), this._scene.mainSoundTrack.RemoveSound(this)
                            }
                        } else this._scene.mainSoundTrack.AddSound(this), yi.Engine.audioEngine.WarnedWebAudioUnsupported || (yi.Tools.Error("Web Audio is not supported by your browser."), yi.Engine.audioEngine.WarnedWebAudioUnsupported = !0), this._readyToPlayCallback && window.setTimeout(function() {
                            o._readyToPlayCallback && o._readyToPlayCallback()
                        }, 1e3)
                    }
                    return e.prototype.dispose = function() {
                        yi.Engine.audioEngine.canUseWebAudio && (this.isPlaying && this.stop(), this._isReadyToPlay = !1, -1 === this.soundTrackId ? this._scene.mainSoundTrack.RemoveSound(this) : this._scene.soundTracks && this._scene.soundTracks[this.soundTrackId].RemoveSound(this), this._soundGain && (this._soundGain.disconnect(), this._soundGain = null), this._soundPanner && (this._soundPanner.disconnect(), this._soundPanner = null), this._soundSource && (this._soundSource.disconnect(), this._soundSource = null), this._audioBuffer = null, this._htmlAudioElement && (this._htmlAudioElement.pause(), this._htmlAudioElement.src = "", document.body.removeChild(this._htmlAudioElement)), this._streamingSource && this._streamingSource.disconnect(), this._connectedMesh && this._registerFunc && (this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._connectedMesh = null))
                    }, e.prototype.isReady = function() {
                        return this._isReadyToPlay
                    }, e.prototype._soundLoaded = function(e) {
                        var t = this;
                        yi.Engine.audioEngine.audioContext && yi.Engine.audioEngine.audioContext.decodeAudioData(e, function(e) {
                            t._audioBuffer = e, t._isReadyToPlay = !0, t.autoplay && t.play(), t._readyToPlayCallback && t._readyToPlayCallback()
                        }, function(e) {
                            yi.Tools.Error("Error while decoding audio data for: " + t.name + " / Error: " + e)
                        })
                    }, e.prototype.setAudioBuffer = function(e) {
                        yi.Engine.audioEngine.canUseWebAudio && (this._audioBuffer = e, this._isReadyToPlay = !0)
                    }, e.prototype.updateOptions = function(e) {
                        e && (this.loop = e.loop || this.loop, this.maxDistance = e.maxDistance || this.maxDistance, this.useCustomAttenuation = e.useCustomAttenuation || this.useCustomAttenuation, this.rolloffFactor = e.rolloffFactor || this.rolloffFactor, this.refDistance = e.refDistance || this.refDistance, this.distanceModel = e.distanceModel || this.distanceModel, this._playbackRate = e.playbackRate || this._playbackRate, this._updateSpatialParameters(), this.isPlaying && (this._streaming && this._htmlAudioElement ? this._htmlAudioElement.playbackRate = this._playbackRate : this._soundSource && (this._soundSource.playbackRate.value = this._playbackRate)))
                    }, e.prototype._createSpatialParameters = function() {
                        yi.Engine.audioEngine.canUseWebAudio && yi.Engine.audioEngine.audioContext && (this._scene.headphone && (this._panningModel = "HRTF"), this._soundPanner = yi.Engine.audioEngine.audioContext.createPanner(), this._updateSpatialParameters(), this._soundPanner.connect(this._outputAudioNode), this._inputAudioNode = this._soundPanner)
                    }, e.prototype._updateSpatialParameters = function() {
                        this.spatialSound && this._soundPanner && (this.useCustomAttenuation ? (this._soundPanner.distanceModel = "linear", this._soundPanner.maxDistance = Number.MAX_VALUE, this._soundPanner.refDistance = 1, this._soundPanner.rolloffFactor = 1) : (this._soundPanner.distanceModel = this.distanceModel, this._soundPanner.maxDistance = this.maxDistance, this._soundPanner.refDistance = this.refDistance, this._soundPanner.rolloffFactor = this.rolloffFactor), this._soundPanner.panningModel = this._panningModel)
                    }, e.prototype.switchPanningModelToHRTF = function() {
                        this._panningModel = "HRTF", this._switchPanningModel()
                    }, e.prototype.switchPanningModelToEqualPower = function() {
                        this._panningModel = "equalpower", this._switchPanningModel()
                    }, e.prototype._switchPanningModel = function() {
                        yi.Engine.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && (this._soundPanner.panningModel = this._panningModel)
                    }, e.prototype.connectToSoundTrackAudioNode = function(e) {
                        yi.Engine.audioEngine.canUseWebAudio && (this._isOutputConnected && this._outputAudioNode.disconnect(), this._outputAudioNode.connect(e), this._isOutputConnected = !0)
                    }, e.prototype.setDirectionalCone = function(e, t, i) {
                        t < e ? yi.Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.") : (this._coneInnerAngle = e, this._coneOuterAngle = t, this._coneOuterGain = i, this._isDirectional = !0, this.isPlaying && this.loop && (this.stop(), this.play()))
                    }, Object.defineProperty(e.prototype, "directionalConeInnerAngle", {
                        get: function() {
                            return this._coneInnerAngle
                        },
                        set: function(e) {
                            if (e != this._coneInnerAngle) {
                                if (this._coneOuterAngle < e) return void yi.Tools.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");
                                this._coneInnerAngle = e, yi.Engine.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && (this._soundPanner.coneInnerAngle = this._coneInnerAngle)
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "directionalConeOuterAngle", {
                        get: function() {
                            return this._coneOuterAngle
                        },
                        set: function(e) {
                            if (e != this._coneOuterAngle) {
                                if (e < this._coneInnerAngle) return void yi.Tools.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");
                                this._coneOuterAngle = e, yi.Engine.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && (this._soundPanner.coneOuterAngle = this._coneOuterAngle)
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.setPosition = function(e) {
                        this._position = e, yi.Engine.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && !isNaN(this._position.x) && !isNaN(this._position.y) && !isNaN(this._position.z) && this._soundPanner.setPosition(this._position.x, this._position.y, this._position.z)
                    }, e.prototype.setLocalDirectionToMesh = function(e) {
                        this._localDirection = e, yi.Engine.audioEngine.canUseWebAudio && this._connectedMesh && this.isPlaying && this._updateDirection()
                    }, e.prototype._updateDirection = function() {
                        if (this._connectedMesh && this._soundPanner) {
                            var e = this._connectedMesh.getWorldMatrix(),
                                t = yi.Vector3.TransformNormal(this._localDirection, e);
                            t.normalize(), this._soundPanner.setOrientation(t.x, t.y, t.z)
                        }
                    }, e.prototype.updateDistanceFromListener = function() {
                        if (yi.Engine.audioEngine.canUseWebAudio && this._connectedMesh && this.useCustomAttenuation && this._soundGain && this._scene.activeCamera) {
                            var e = this._connectedMesh.getDistanceToCamera(this._scene.activeCamera);
                            this._soundGain.gain.value = this._customAttenuationFunction(this._volume, e, this.maxDistance, this.refDistance, this.rolloffFactor)
                        }
                    }, e.prototype.setAttenuationFunction = function(e) {
                        this._customAttenuationFunction = e
                    }, e.prototype.play = function(e, t) {
                        var i = this;
                        if (this._isReadyToPlay && this._scene.audioEnabled && yi.Engine.audioEngine.audioContext) try {
                            this._startOffset < 0 && (e = -this._startOffset, this._startOffset = 0);
                            var r = e ? yi.Engine.audioEngine.audioContext.currentTime + e : yi.Engine.audioEngine.audioContext.currentTime;
                            if (this._soundSource && this._streamingSource || this.spatialSound && this._soundPanner && (isNaN(this._position.x) || isNaN(this._position.y) || isNaN(this._position.z) || this._soundPanner.setPosition(this._position.x, this._position.y, this._position.z), this._isDirectional && (this._soundPanner.coneInnerAngle = this._coneInnerAngle, this._soundPanner.coneOuterAngle = this._coneOuterAngle, this._soundPanner.coneOuterGain = this._coneOuterGain, this._connectedMesh ? this._updateDirection() : this._soundPanner.setOrientation(this._localDirection.x, this._localDirection.y, this._localDirection.z))), this._streaming) {
                                if (this._streamingSource || (this._streamingSource = yi.Engine.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement), this._htmlAudioElement.onended = function() {
                                        i._onended()
                                    }, this._htmlAudioElement.playbackRate = this._playbackRate), this._streamingSource.disconnect(), this._streamingSource.connect(this._inputAudioNode), this._htmlAudioElement) {
                                    var n = function() {
                                        if (yi.Engine.audioEngine.unlocked) {
                                            var e = i._htmlAudioElement.play();
                                            void 0 !== e && e.catch(function(e) {
                                                yi.Engine.audioEngine.lock(), yi.Engine.audioEngine.onAudioUnlockedObservable.addOnce(function() {
                                                    n()
                                                })
                                            })
                                        } else yi.Engine.audioEngine.onAudioUnlockedObservable.addOnce(function() {
                                            n()
                                        })
                                    };
                                    n()
                                }
                            } else this._soundSource = yi.Engine.audioEngine.audioContext.createBufferSource(), this._soundSource.buffer = this._audioBuffer, this._soundSource.connect(this._inputAudioNode), this._soundSource.loop = this.loop, this._soundSource.playbackRate.value = this._playbackRate, this._soundSource.onended = function() {
                                i._onended()
                            }, this._soundSource.buffer && this._soundSource.start(r, this.isPaused ? this._startOffset % this._soundSource.buffer.duration : t || 0);
                            this._startTime = r, this.isPlaying = !0, this.isPaused = !1
                        } catch (e) {
                            yi.Tools.Error("Error while trying to play audio: " + this.name + ", " + e.message)
                        }
                    }, e.prototype._onended = function() {
                        this.isPlaying = !1, this.onended && this.onended(), this.onEndedObservable.notifyObservers(this)
                    }, e.prototype.stop = function(e) {
                        if (this.isPlaying) {
                            if (this._streaming) this._htmlAudioElement ? (this._htmlAudioElement.pause(), 0 < this._htmlAudioElement.currentTime && (this._htmlAudioElement.currentTime = 0)) : this._streamingSource.disconnect();
                            else if (yi.Engine.audioEngine.audioContext && this._soundSource) {
                                var t = e ? yi.Engine.audioEngine.audioContext.currentTime + e : yi.Engine.audioEngine.audioContext.currentTime;
                                this._soundSource.stop(t), this._soundSource.onended = function() {}, this.isPaused || (this._startOffset = 0)
                            }
                            this.isPlaying = !1
                        }
                    }, e.prototype.pause = function() {
                        this.isPlaying && (this.isPaused = !0, this._streaming ? this._htmlAudioElement ? this._htmlAudioElement.pause() : this._streamingSource.disconnect() : yi.Engine.audioEngine.audioContext && (this.stop(0), this._startOffset += yi.Engine.audioEngine.audioContext.currentTime - this._startTime))
                    }, e.prototype.setVolume = function(e, t) {
                        yi.Engine.audioEngine.canUseWebAudio && this._soundGain && (t && yi.Engine.audioEngine.audioContext ? (this._soundGain.gain.cancelScheduledValues(yi.Engine.audioEngine.audioContext.currentTime), this._soundGain.gain.setValueAtTime(this._soundGain.gain.value, yi.Engine.audioEngine.audioContext.currentTime), this._soundGain.gain.linearRampToValueAtTime(e, yi.Engine.audioEngine.audioContext.currentTime + t)) : this._soundGain.gain.value = e), this._volume = e
                    }, e.prototype.setPlaybackRate = function(e) {
                        this._playbackRate = e, this.isPlaying && (this._streaming && this._htmlAudioElement ? this._htmlAudioElement.playbackRate = this._playbackRate : this._soundSource && (this._soundSource.playbackRate.value = this._playbackRate))
                    }, e.prototype.getVolume = function() {
                        return this._volume
                    }, e.prototype.attachToMesh = function(e) {
                        var t = this;
                        this._connectedMesh && this._registerFunc && (this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._registerFunc = null), this._connectedMesh = e, this.spatialSound || (this.spatialSound = !0, this._createSpatialParameters(), this.isPlaying && this.loop && (this.stop(), this.play())), this._onRegisterAfterWorldMatrixUpdate(this._connectedMesh), this._registerFunc = function(e) {
                            return t._onRegisterAfterWorldMatrixUpdate(e)
                        }, e.registerAfterWorldMatrixUpdate(this._registerFunc)
                    }, e.prototype.detachFromMesh = function() {
                        this._connectedMesh && this._registerFunc && (this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._registerFunc = null, this._connectedMesh = null)
                    }, e.prototype._onRegisterAfterWorldMatrixUpdate = function(e) {
                        if (e.getBoundingInfo) {
                            var t = e;
                            if (this._positionInEmitterSpace) t.worldMatrixFromCache.invertToRef(yi.Tmp.Matrix[0]), this.setPosition(yi.Tmp.Matrix[0].getTranslation());
                            else {
                                var i = t.getBoundingInfo();
                                this.setPosition(i.boundingSphere.centerWorld)
                            }
                            yi.Engine.audioEngine.canUseWebAudio && this._isDirectional && this.isPlaying && this._updateDirection()
                        }
                    }, e.prototype.clone = function() {
                        var t = this;
                        if (this._streaming) return null;
                        var i = function() {
                                t._isReadyToPlay ? (n._audioBuffer = t.getAudioBuffer(), n._isReadyToPlay = !0, n.autoplay && n.play()) : window.setTimeout(i, 300)
                            },
                            r = {
                                autoplay: this.autoplay,
                                loop: this.loop,
                                volume: this._volume,
                                spatialSound: this.spatialSound,
                                maxDistance: this.maxDistance,
                                useCustomAttenuation: this.useCustomAttenuation,
                                rolloffFactor: this.rolloffFactor,
                                refDistance: this.refDistance,
                                distanceModel: this.distanceModel
                            },
                            n = new e(this.name + "_cloned", new ArrayBuffer(0), this._scene, null, r);
                        return this.useCustomAttenuation && n.setAttenuationFunction(this._customAttenuationFunction), n.setPosition(this._position), n.setPlaybackRate(this._playbackRate), i(), n
                    }, e.prototype.getAudioBuffer = function() {
                        return this._audioBuffer
                    }, e.prototype.serialize = function() {
                        var e = {
                            name: this.name,
                            url: this.name,
                            autoplay: this.autoplay,
                            loop: this.loop,
                            volume: this._volume,
                            spatialSound: this.spatialSound,
                            maxDistance: this.maxDistance,
                            rolloffFactor: this.rolloffFactor,
                            refDistance: this.refDistance,
                            distanceModel: this.distanceModel,
                            playbackRate: this._playbackRate,
                            panningModel: this._panningModel,
                            soundTrackId: this.soundTrackId
                        };
                        return this.spatialSound && (this._connectedMesh && (e.connectedMeshId = this._connectedMesh.id), e.position = this._position.asArray(), e.refDistance = this.refDistance, e.distanceModel = this.distanceModel, e.isDirectional = this._isDirectional, e.localDirectionToMesh = this._localDirection.asArray(), e.coneInnerAngle = this._coneInnerAngle, e.coneOuterAngle = this._coneOuterAngle, e.coneOuterGain = this._coneOuterGain), e
                    }, e.Parse = function(t, i, r, n) {
                        var o, s = t.name;
                        o = t.url ? r + t.url : r + s;
                        var a, l = {
                            autoplay: t.autoplay,
                            loop: t.loop,
                            volume: t.volume,
                            spatialSound: t.spatialSound,
                            maxDistance: t.maxDistance,
                            rolloffFactor: t.rolloffFactor,
                            refDistance: t.refDistance,
                            distanceModel: t.distanceModel,
                            playbackRate: t.playbackRate
                        };
                        if (n) {
                            var u = function() {
                                n._isReadyToPlay ? (a._audioBuffer = n.getAudioBuffer(), a._isReadyToPlay = !0, a.autoplay && a.play()) : window.setTimeout(u, 300)
                            };
                            a = new e(s, new ArrayBuffer(0), i, null, l), u()
                        } else a = new e(s, o, i, function() {
                            i._removePendingData(a)
                        }, l), i._addPendingData(a);
                        if (t.position) {
                            var c = yi.Vector3.FromArray(t.position);
                            a.setPosition(c)
                        }
                        if (t.isDirectional && (a.setDirectionalCone(t.coneInnerAngle || 360, t.coneOuterAngle || 360, t.coneOuterGain || 0), t.localDirectionToMesh)) {
                            var h = yi.Vector3.FromArray(t.localDirectionToMesh);
                            a.setLocalDirectionToMesh(h)
                        }
                        if (t.connectedMeshId) {
                            var d = i.getMeshByID(t.connectedMeshId);
                            d && a.attachToMesh(d)
                        }
                        return a
                    }, e
                }(), yi.Sound = bi, xi = $a || ($a = {}), Ti = function() {
                    function e(e, t) {
                        void 0 === t && (t = {}), this.id = -1, this._isMainTrack = !1, this._isInitialized = !1, this._scene = e, this.soundCollection = new Array, this._options = t, !this._isMainTrack && this._scene.soundTracks && (this._scene.soundTracks.push(this), this.id = this._scene.soundTracks.length - 1)
                    }
                    return e.prototype._initializeSoundTrackAudioGraph = function() {
                        xi.Engine.audioEngine.canUseWebAudio && xi.Engine.audioEngine.audioContext && (this._outputAudioNode = xi.Engine.audioEngine.audioContext.createGain(), this._outputAudioNode.connect(xi.Engine.audioEngine.masterGain), this._options && (this._options.volume && (this._outputAudioNode.gain.value = this._options.volume), this._options.mainTrack && (this._isMainTrack = this._options.mainTrack)), this._isInitialized = !0)
                    }, e.prototype.dispose = function() {
                        if (xi.Engine.audioEngine && xi.Engine.audioEngine.canUseWebAudio) {
                            for (this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(); this.soundCollection.length;) this.soundCollection[0].dispose();
                            this._outputAudioNode && this._outputAudioNode.disconnect(), this._outputAudioNode = null
                        }
                    }, e.prototype.AddSound = function(e) {
                        this._isInitialized || this._initializeSoundTrackAudioGraph(), xi.Engine.audioEngine.canUseWebAudio && this._outputAudioNode && e.connectToSoundTrackAudioNode(this._outputAudioNode), e.soundTrackId && (-1 === e.soundTrackId ? this._scene.mainSoundTrack.RemoveSound(e) : this._scene.soundTracks && this._scene.soundTracks[e.soundTrackId].RemoveSound(e)), this.soundCollection.push(e), e.soundTrackId = this.id
                    }, e.prototype.RemoveSound = function(e) {
                        var t = this.soundCollection.indexOf(e); - 1 !== t && this.soundCollection.splice(t, 1)
                    }, e.prototype.setVolume = function(e) {
                        xi.Engine.audioEngine.canUseWebAudio && this._outputAudioNode && (this._outputAudioNode.gain.value = e)
                    }, e.prototype.switchPanningModelToHRTF = function() {
                        if (xi.Engine.audioEngine.canUseWebAudio)
                            for (var e = 0; e < this.soundCollection.length; e++) this.soundCollection[e].switchPanningModelToHRTF()
                    }, e.prototype.switchPanningModelToEqualPower = function() {
                        if (xi.Engine.audioEngine.canUseWebAudio)
                            for (var e = 0; e < this.soundCollection.length; e++) this.soundCollection[e].switchPanningModelToEqualPower()
                    }, e.prototype.connectToAnalyser = function(e) {
                        this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(), this._connectedAnalyser = e, xi.Engine.audioEngine.canUseWebAudio && this._outputAudioNode && (this._outputAudioNode.disconnect(), this._connectedAnalyser.connectAudioNodes(this._outputAudioNode, xi.Engine.audioEngine.masterGain))
                    }, e
                }(), xi.SoundTrack = Ti, Ei = $a || ($a = {}), Si = function() {
                    function e(e) {
                        this.SMOOTHING = .75, this.FFT_SIZE = 512, this.BARGRAPHAMPLITUDE = 256, this.DEBUGCANVASPOS = {
                            x: 20,
                            y: 20
                        }, this.DEBUGCANVASSIZE = {
                            width: 320,
                            height: 200
                        }, this._scene = e, this._audioEngine = Ei.Engine.audioEngine, this._audioEngine.canUseWebAudio && this._audioEngine.audioContext && (this._webAudioAnalyser = this._audioEngine.audioContext.createAnalyser(), this._webAudioAnalyser.minDecibels = -140, this._webAudioAnalyser.maxDecibels = 0, this._byteFreqs = new Uint8Array(this._webAudioAnalyser.frequencyBinCount), this._byteTime = new Uint8Array(this._webAudioAnalyser.frequencyBinCount), this._floatFreqs = new Float32Array(this._webAudioAnalyser.frequencyBinCount))
                    }
                    return e.prototype.getFrequencyBinCount = function() {
                        return this._audioEngine.canUseWebAudio ? this._webAudioAnalyser.frequencyBinCount : 0
                    }, e.prototype.getByteFrequencyData = function() {
                        return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs)), this._byteFreqs
                    }, e.prototype.getByteTimeDomainData = function() {
                        return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getByteTimeDomainData(this._byteTime)), this._byteTime
                    }, e.prototype.getFloatFrequencyData = function() {
                        return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs)), this._floatFreqs
                    }, e.prototype.drawDebugCanvas = function() {
                        var e = this;
                        if (this._audioEngine.canUseWebAudio && (this._debugCanvas || (this._debugCanvas = document.createElement("canvas"), this._debugCanvas.width = this.DEBUGCANVASSIZE.width, this._debugCanvas.height = this.DEBUGCANVASSIZE.height, this._debugCanvas.style.position = "absolute", this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + "px", this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + "px", this._debugCanvasContext = this._debugCanvas.getContext("2d"), document.body.appendChild(this._debugCanvas), this._registerFunc = function() {
                                e.drawDebugCanvas()
                            }, this._scene.registerBeforeRender(this._registerFunc)), this._registerFunc && this._debugCanvasContext)) {
                            var t = this.getByteFrequencyData();
                            this._debugCanvasContext.fillStyle = "rgb(0, 0, 0)", this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height);
                            for (var i = 0; i < this.getFrequencyBinCount(); i++) {
                                var r = t[i] / this.BARGRAPHAMPLITUDE,
                                    n = this.DEBUGCANVASSIZE.height * r,
                                    o = this.DEBUGCANVASSIZE.height - n - 1,
                                    s = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount(),
                                    a = i / this.getFrequencyBinCount() * 360;
                                this._debugCanvasContext.fillStyle = "hsl(" + a + ", 100%, 50%)", this._debugCanvasContext.fillRect(i * s, o, s, n)
                            }
                        }
                    }, e.prototype.stopDebugCanvas = function() {
                        this._debugCanvas && (this._registerFunc && (this._scene.unregisterBeforeRender(this._registerFunc), this._registerFunc = null), document.body.removeChild(this._debugCanvas), this._debugCanvas = null, this._debugCanvasContext = null)
                    }, e.prototype.connectAudioNodes = function(e, t) {
                        this._audioEngine.canUseWebAudio && (e.connect(this._webAudioAnalyser), this._webAudioAnalyser.connect(t))
                    }, e.prototype.dispose = function() {
                        this._audioEngine.canUseWebAudio && this._webAudioAnalyser.disconnect()
                    }, e
                }(), Ei.Analyser = Si, Pi = $a || ($a = {}), Ai = function() {
                    function e(e, t, i) {
                        var r = this;
                        if (this.loop = !1, this._coneInnerAngle = 360, this._coneOuterAngle = 360, this._volume = 1, this.isPlaying = !1, this.isPaused = !1, this._sounds = [], this._weights = [], t.length !== i.length) throw new Error("Sounds length does not equal weights length");
                        this.loop = e;
                        for (var n = 0, o = 0, s = this._weights = i; o < s.length; o++) n += s[o];
                        for (var a = 0 < n ? 1 / n : 0, l = 0; l < this._weights.length; l++) this._weights[l] *= a;
                        this._sounds = t;
                        for (var u = 0, c = this._sounds; u < c.length; u++) c[u].onEndedObservable.add(function() {
                            r._onended()
                        })
                    }
                    return Object.defineProperty(e.prototype, "directionalConeInnerAngle", {
                        get: function() {
                            return this._coneInnerAngle
                        },
                        set: function(e) {
                            if (e !== this._coneInnerAngle) {
                                if (this._coneOuterAngle < e) return void Pi.Tools.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");
                                this._coneInnerAngle = e;
                                for (var t = 0, i = this._sounds; t < i.length; t++) i[t].directionalConeInnerAngle = e
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "directionalConeOuterAngle", {
                        get: function() {
                            return this._coneOuterAngle
                        },
                        set: function(e) {
                            if (e !== this._coneOuterAngle) {
                                if (e < this._coneInnerAngle) return void Pi.Tools.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");
                                this._coneOuterAngle = e;
                                for (var t = 0, i = this._sounds; t < i.length; t++) i[t].directionalConeOuterAngle = e
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "volume", {
                        get: function() {
                            return this._volume
                        },
                        set: function(e) {
                            if (e !== this._volume)
                                for (var t = 0, i = this._sounds; t < i.length; t++) i[t].setVolume(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._onended = function() {
                        void 0 !== this._currentIndex && (this._sounds[this._currentIndex].autoplay = !1), this.loop && this.isPlaying ? this.play() : this.isPlaying = !1
                    }, e.prototype.pause = function() {
                        this.isPaused = !0, void 0 !== this._currentIndex && this._sounds[this._currentIndex].pause()
                    }, e.prototype.stop = function() {
                        this.isPlaying = !1, void 0 !== this._currentIndex && this._sounds[this._currentIndex].stop()
                    }, e.prototype.play = function(e) {
                        if (!this.isPaused) {
                            this.stop();
                            for (var t = Math.random(), i = 0, r = 0; r < this._weights.length; r++)
                                if (t <= (i += this._weights[r])) {
                                    this._currentIndex = r;
                                    break
                                }
                        }
                        var n = this._sounds[this._currentIndex];
                        n.isReady() ? n.play(0, this.isPaused ? void 0 : e) : n.autoplay = !0, this.isPlaying = !0, this.isPaused = !1
                    }, e
                }(), Pi.WeightedSound = Ai,
                function(e) {
                    e.AbstractScene.AddParser(e.SceneComponentConstants.NAME_AUDIO, function(t, i, r, n) {
                        var o, s = [];
                        if (r.sounds = r.sounds || [], void 0 !== t.sounds && null !== t.sounds)
                            for (var a = 0, l = t.sounds.length; a < l; a++) {
                                var u = t.sounds[a];
                                e.Engine.audioEngine.canUseWebAudio ? (u.url || (u.url = u.name), s[u.url] ? r.sounds.push(e.Sound.Parse(u, i, n, s[u.url])) : (o = e.Sound.Parse(u, i, n), s[u.url] = o, r.sounds.push(o))) : r.sounds.push(new e.Sound(u.name, null, i))
                            }
                        s = []
                    }), Object.defineProperty(e.Scene.prototype, "mainSoundTrack", {
                        get: function() {
                            var i = this._getComponent(e.SceneComponentConstants.NAME_AUDIO);
                            return i || (i = new t(this), this._addComponent(i)), this._mainSoundTrack || (this._mainSoundTrack = new e.SoundTrack(this, {
                                mainTrack: !0
                            })), this._mainSoundTrack
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.Scene.prototype.getSoundByName = function(e) {
                        var t;
                        for (t = 0; t < this.mainSoundTrack.soundCollection.length; t++)
                            if (this.mainSoundTrack.soundCollection[t].name === e) return this.mainSoundTrack.soundCollection[t];
                        if (this.soundTracks)
                            for (var i = 0; i < this.soundTracks.length; i++)
                                for (t = 0; t < this.soundTracks[i].soundCollection.length; t++)
                                    if (this.soundTracks[i].soundCollection[t].name === e) return this.soundTracks[i].soundCollection[t];
                        return null
                    }, Object.defineProperty(e.Scene.prototype, "audioEnabled", {
                        get: function() {
                            var i = this._getComponent(e.SceneComponentConstants.NAME_AUDIO);
                            return i || (i = new t(this), this._addComponent(i)), i.audioEnabled
                        },
                        set: function(i) {
                            var r = this._getComponent(e.SceneComponentConstants.NAME_AUDIO);
                            r || (r = new t(this), this._addComponent(r)), i ? r.enableAudio() : r.disableAudio()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.Scene.prototype, "headphone", {
                        get: function() {
                            var i = this._getComponent(e.SceneComponentConstants.NAME_AUDIO);
                            return i || (i = new t(this), this._addComponent(i)), i.headphone
                        },
                        set: function(i) {
                            var r = this._getComponent(e.SceneComponentConstants.NAME_AUDIO);
                            r || (r = new t(this), this._addComponent(r)), i ? r.switchAudioModeForHeadphones() : r.switchAudioModeForNormalSpeakers()
                        },
                        enumerable: !0,
                        configurable: !0
                    });
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_AUDIO, this._audioEnabled = !0, this._headphone = !1, (this.scene = t).soundTracks = new Array, t.sounds = new Array
                        }
                        return Object.defineProperty(t.prototype, "audioEnabled", {
                            get: function() {
                                return this._audioEnabled
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "headphone", {
                            get: function() {
                                return this._headphone
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.register = function() {
                            this.scene._afterRenderStage.registerStep(e.SceneComponentConstants.STEP_AFTERRENDER_AUDIO, this, this._afterRender)
                        }, t.prototype.rebuild = function() {}, t.prototype.serialize = function(e) {
                            if (e.sounds = [], this.scene.soundTracks)
                                for (var t = 0; t < this.scene.soundTracks.length; t++)
                                    for (var i = this.scene.soundTracks[t], r = 0; r < i.soundCollection.length; r++) e.sounds.push(i.soundCollection[r].serialize())
                        }, t.prototype.addFromContainer = function(e) {
                            var t = this;
                            e.sounds && e.sounds.forEach(function(e) {
                                e.play(), e.autoplay = !0, t.scene.mainSoundTrack.AddSound(e)
                            })
                        }, t.prototype.removeFromContainer = function(e) {
                            var t = this;
                            e.sounds && e.sounds.forEach(function(e) {
                                e.stop(), e.autoplay = !1, t.scene.mainSoundTrack.RemoveSound(e)
                            })
                        }, t.prototype.dispose = function() {
                            var e = this.scene;
                            if (e._mainSoundTrack && e.mainSoundTrack.dispose(), e.soundTracks)
                                for (var t = 0; t < e.soundTracks.length; t++) e.soundTracks[t].dispose()
                        }, t.prototype.disableAudio = function() {
                            var e, t = this.scene;
                            for (this._audioEnabled = !1, e = 0; e < t.mainSoundTrack.soundCollection.length; e++) t.mainSoundTrack.soundCollection[e].pause();
                            if (t.soundTracks)
                                for (e = 0; e < t.soundTracks.length; e++)
                                    for (var i = 0; i < t.soundTracks[e].soundCollection.length; i++) t.soundTracks[e].soundCollection[i].pause()
                        }, t.prototype.enableAudio = function() {
                            var e, t = this.scene;
                            for (this._audioEnabled = !0, e = 0; e < t.mainSoundTrack.soundCollection.length; e++) t.mainSoundTrack.soundCollection[e].isPaused && t.mainSoundTrack.soundCollection[e].play();
                            if (t.soundTracks)
                                for (e = 0; e < t.soundTracks.length; e++)
                                    for (var i = 0; i < t.soundTracks[e].soundCollection.length; i++) t.soundTracks[e].soundCollection[i].isPaused && t.soundTracks[e].soundCollection[i].play()
                        }, t.prototype.switchAudioModeForHeadphones = function() {
                            var e = this.scene;
                            if (this._headphone = !0, e.mainSoundTrack.switchPanningModelToHRTF(), e.soundTracks)
                                for (var t = 0; t < e.soundTracks.length; t++) e.soundTracks[t].switchPanningModelToHRTF()
                        }, t.prototype.switchAudioModeForNormalSpeakers = function() {
                            var e = this.scene;
                            if (this._headphone = !1, e.mainSoundTrack.switchPanningModelToEqualPower(), e.soundTracks)
                                for (var t = 0; t < e.soundTracks.length; t++) e.soundTracks[t].switchPanningModelToEqualPower()
                        }, t.prototype._afterRender = function() {
                            var t = this.scene;
                            if (this._audioEnabled && t._mainSoundTrack && t.soundTracks && (0 !== t._mainSoundTrack.soundCollection.length || 1 !== t.soundTracks.length)) {
                                var i, r = e.Engine.audioEngine;
                                if ((i = 0 < t.activeCameras.length ? t.activeCameras[0] : t.activeCamera) && r.audioContext) {
                                    r.audioContext.listener.setPosition(i.position.x, i.position.y, i.position.z), i.rigCameras && 0 < i.rigCameras.length && (i = i.rigCameras[0]);
                                    var n, o = e.Matrix.Invert(i.getViewMatrix()),
                                        s = e.Vector3.TransformNormal(new e.Vector3(0, 0, -1), o);
                                    for (s.normalize(), isNaN(s.x) || isNaN(s.y) || isNaN(s.z) || r.audioContext.listener.setOrientation(s.x, s.y, s.z, 0, 1, 0), n = 0; n < t.mainSoundTrack.soundCollection.length; n++) {
                                        var a = t.mainSoundTrack.soundCollection[n];
                                        a.useCustomAttenuation && a.updateDistanceFromListener()
                                    }
                                    if (t.soundTracks)
                                        for (n = 0; n < t.soundTracks.length; n++)
                                            for (var l = 0; l < t.soundTracks[n].soundCollection.length; l++)(a = t.soundTracks[n].soundCollection[l]).useCustomAttenuation && a.updateDistanceFromListener()
                                }
                            }
                        }, t
                    }();
                    e.AudioSceneComponent = t
                }($a || ($a = {})),
                function(e) {
                    var t = function(e) {
                        function t(t, i, r) {
                            var n = e.call(this, t, r) || this;
                            return n._sound = i, n
                        }
                        return b(t, e), t.prototype._prepare = function() {}, t.prototype.execute = function() {
                            void 0 !== this._sound && this._sound.play()
                        }, t.prototype.serialize = function(t) {
                            return e.prototype._serialize.call(this, {
                                name: "PlaySoundAction",
                                properties: [{
                                    name: "sound",
                                    value: this._sound.name
                                }]
                            }, t)
                        }, t
                    }(e.Action);
                    e.PlaySoundAction = t;
                    var i = function(e) {
                        function t(t, i, r) {
                            var n = e.call(this, t, r) || this;
                            return n._sound = i, n
                        }
                        return b(t, e), t.prototype._prepare = function() {}, t.prototype.execute = function() {
                            void 0 !== this._sound && this._sound.stop()
                        }, t.prototype.serialize = function(t) {
                            return e.prototype._serialize.call(this, {
                                name: "StopSoundAction",
                                properties: [{
                                    name: "sound",
                                    value: this._sound.name
                                }]
                            }, t)
                        }, t
                    }(e.Action);
                    e.StopSoundAction = i
                }($a || ($a = {})), Ci = $a || ($a = {}), Mi = function(e) {
                    function t(t, i, r, n, o, s, a, l, u, c, h, d, p) {
                        void 0 === r && (r = null), void 0 === n && (n = !1), void 0 === o && (o = null), void 0 === s && (s = null), void 0 === a && (a = null), void 0 === l && (l = Ci.Engine.TEXTUREFORMAT_RGBA), void 0 === u && (u = !1), void 0 === c && (c = null), void 0 === h && (h = !1), void 0 === d && (d = .8), void 0 === p && (p = 0);
                        var f = e.call(this, i) || this;
                        if (f.boundingBoxPosition = Ci.Vector3.Zero(), f._rotationY = 0, f._prefiltered = !1, f.name = t, f.url = t, f._noMipmap = n, f.hasAlpha = !1, f._format = l, f.isCube = !0, f._textureMatrix = Ci.Matrix.Identity(), f._createPolynomials = h, f.coordinatesMode = Ci.Texture.CUBIC_MODE, !t && !o) return f;
                        var _ = t.lastIndexOf("."),
                            m = c || (-1 < _ ? t.substring(_).toLowerCase() : ""),
                            g = ".dds" === m,
                            v = ".env" === m;
                        if (v ? (f.gammaSpace = !1, f._prefiltered = !1) : (f._prefiltered = u) && (f.gammaSpace = !1), f._texture = f._getFromCache(t, n), !o && (v || g || r || (r = ["_px.jpg", "_py.jpg", "_pz.jpg", "_nx.jpg", "_ny.jpg", "_nz.jpg"]), o = [], r))
                            for (var y = 0; y < r.length; y++) o.push(t + r[y]);
                        return f._files = o, f._texture ? s && (f._texture.isReady ? Ci.Tools.SetImmediate(function() {
                            return s()
                        }) : f._texture.onLoadedObservable.add(s)) : i.useDelayedTextureLoading ? f.delayLoadState = Ci.Engine.DELAYLOADSTATE_NOTLOADED : f._texture = u ? i.getEngine().createPrefilteredCubeTexture(t, i, d, p, s, a, l, c, f._createPolynomials) : i.getEngine().createCubeTexture(t, i, o, n, s, a, f._format, c, !1, d, p), f
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "boundingBoxSize", {
                        get: function() {
                            return this._boundingBoxSize
                        },
                        set: function(e) {
                            if (!this._boundingBoxSize || !this._boundingBoxSize.equals(e)) {
                                this._boundingBoxSize = e;
                                var t = this.getScene();
                                t && t.markAllMaterialsAsDirty(Ci.Material.TextureDirtyFlag)
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "rotationY", {
                        get: function() {
                            return this._rotationY
                        },
                        set: function(e) {
                            this._rotationY = e, this.setReflectionTextureMatrix(Ci.Matrix.RotationY(this._rotationY))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.CreateFromImages = function(e, i, r) {
                        var n = "";
                        return e.forEach(function(e) {
                            return n += e
                        }), new t(n, i, null, r, e)
                    }, t.CreateFromPrefilteredData = function(e, i, r, n) {
                        return void 0 === r && (r = null), void 0 === n && (n = !0), new t(e, i, null, !1, null, null, null, void 0, !0, r, n)
                    }, t.prototype.delayLoad = function() {
                        if (this.delayLoadState === Ci.Engine.DELAYLOADSTATE_NOTLOADED) {
                            var e = this.getScene();
                            e && (this.delayLoadState = Ci.Engine.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, this._noMipmap), this._texture || (this._prefiltered ? this._texture = e.getEngine().createPrefilteredCubeTexture(this.url, e, this.lodGenerationScale, this.lodGenerationOffset, void 0, void 0, this._format, void 0, this._createPolynomials) : this._texture = e.getEngine().createCubeTexture(this.url, e, this._files, this._noMipmap, void 0, void 0, this._format)))
                        }
                    }, t.prototype.getReflectionTextureMatrix = function() {
                        return this._textureMatrix
                    }, t.prototype.setReflectionTextureMatrix = function(e) {
                        this._textureMatrix = e
                    }, t.Parse = function(e, i, r) {
                        var n = Ci.SerializationHelper.Parse(function() {
                            var n = !1;
                            return e.prefiltered && (n = e.prefiltered), new t(r + e.name, i, e.extensions, !1, null, null, null, void 0, n)
                        }, e, i);
                        if (e.boundingBoxPosition && (n.boundingBoxPosition = Ci.Vector3.FromArray(e.boundingBoxPosition)), e.boundingBoxSize && (n.boundingBoxSize = Ci.Vector3.FromArray(e.boundingBoxSize)), e.animations)
                            for (var o = 0; o < e.animations.length; o++) {
                                var s = e.animations[o];
                                n.animations.push(Ci.Animation.Parse(s))
                            }
                        return n
                    }, t.prototype.clone = function() {
                        var e = this;
                        return Ci.SerializationHelper.Clone(function() {
                            var i = e.getScene();
                            return i ? new t(e.url, i, e._extensions, e._noMipmap, e._files) : e
                        }, this)
                    }, y([Ci.serialize("rotationY")], t.prototype, "rotationY", null), t
                }(Ci.BaseTexture), Ci.CubeTexture = Mi, Ri = $a || ($a = {}), Oi = function(e) {
                    function t(t, i, r, n, o, s, a, l, u) {
                        void 0 === n && (n = Ri.Engine.TEXTUREFORMAT_RGBA), void 0 === o && (o = Ri.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === s && (s = !1), void 0 === a && (a = !1), void 0 === l && (l = Ri.Texture.TRILINEAR_SAMPLINGMODE), void 0 === u && (u = null);
                        var c = e.call(this, "", t) || this;
                        return c._texture = t.getEngine().createRawCubeTexture(i, r, n, o, s, a, l, u), c
                    }
                    return b(t, e), t.prototype.update = function(e, t, i, r, n, o) {
                        void 0 === n && (n = null), void 0 === o && (o = 0), this._texture.getEngine().updateRawCubeTexture(this._texture, e, t, i, r, n)
                    }, t.prototype.updateRGBDAsync = function(e, i, r, n) {
                        return void 0 === i && (i = null), void 0 === r && (r = .8), void 0 === n && (n = 0), t._UpdateRGBDAsync(this._texture, e, i, r, n)
                    }, t.prototype.clone = function() {
                        var e = this;
                        return Ri.SerializationHelper.Clone(function() {
                            var i = e.getScene(),
                                r = e._texture,
                                n = new t(i, r._bufferViewArray, r.width, r.format, r.type, r.generateMipMaps, r.invertY, r.samplingMode, r._compression);
                            return r.dataSource === Ri.InternalTexture.DATASOURCE_CUBERAW_RGBD && n.updateRGBDAsync(r._bufferViewArrayArray, r._sphericalPolynomial, r._lodGenerationScale, r._lodGenerationOffset), n
                        }, this)
                    }, t._UpdateRGBDAsync = function(e, t, i, r, n) {
                        return e._dataSource = Ri.InternalTexture.DATASOURCE_CUBERAW_RGBD, e._bufferViewArrayArray = t, e._lodGenerationScale = r, e._lodGenerationOffset = n, e._sphericalPolynomial = i, Ri.EnvironmentTextureTools.UploadLevelsAsync(e, t).then(function() {
                            e.isReady = !0
                        })
                    }, t
                }(Ri.CubeTexture), Ri.RawCubeTexture = Oi, wi = $a || ($a = {}), Ii = function(e) {
                    function t(t, i, r, n, o, s, a, l, u, c, h, d) {
                        void 0 === o && (o = !0), void 0 === s && (s = wi.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === a && (a = !1), void 0 === l && (l = wi.Texture.TRILINEAR_SAMPLINGMODE), void 0 === u && (u = !0), void 0 === c && (c = !1), void 0 === h && (h = !1), void 0 === d && (d = wi.Engine.TEXTUREFORMAT_RGBA);
                        var p = e.call(this, null, r, !n) || this;
                        return p.isCube = a, p.renderParticles = !0, p.renderSprites = !1, p.coordinatesMode = wi.Texture.PROJECTION_MODE, p.ignoreCameraViewport = !1, p.onBeforeBindObservable = new wi.Observable, p.onAfterUnbindObservable = new wi.Observable, p.onBeforeRenderObservable = new wi.Observable, p.onAfterRenderObservable = new wi.Observable, p.onClearObservable = new wi.Observable, p._currentRefreshId = -1, p._refreshRate = 1, p._samples = 1, p.boundingBoxPosition = wi.Vector3.Zero(), (r = p.getScene()) ? (p.renderList = new Array, p._engine = r.getEngine(), p.name = t, p.isRenderTarget = !0, p._initialSizeParameter = i, p._processSizeParameter(i), p._resizeObserver = p.getScene().getEngine().onResizeObservable.add(function() {}), p._generateMipMaps = !!n, p._doNotChangeAspectRatio = o, p._renderingManager = new wi.RenderingManager(r), p._renderingManager._useSceneAutoClearSetup = !0, h || (p._renderTargetOptions = {
                            generateMipMaps: n,
                            type: s,
                            format: d,
                            samplingMode: l,
                            generateDepthBuffer: u,
                            generateStencilBuffer: c
                        }, l === wi.Texture.NEAREST_SAMPLINGMODE && (p.wrapU = wi.Texture.CLAMP_ADDRESSMODE, p.wrapV = wi.Texture.CLAMP_ADDRESSMODE), a ? (p._texture = r.getEngine().createRenderTargetCubeTexture(p.getRenderSize(), p._renderTargetOptions), p.coordinatesMode = wi.Texture.INVCUBIC_MODE, p._textureMatrix = wi.Matrix.Identity()) : p._texture = r.getEngine().createRenderTargetTexture(p._size, p._renderTargetOptions)), p) : p
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "renderList", {
                        get: function() {
                            return this._renderList
                        },
                        set: function(e) {
                            this._renderList = e, this._renderList && this._hookArray(this._renderList)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._hookArray = function(e) {
                        var t = this,
                            i = e.push;
                        e.push = function() {
                            for (var r = [], n = 0; n < arguments.length; n++) r[n] = arguments[n];
                            var o = 0 === e.length,
                                s = i.apply(e, r);
                            return o && t.getScene().meshes.forEach(function(e) {
                                e._markSubMeshesAsLightDirty()
                            }), s
                        };
                        var r = e.splice;
                        e.splice = function(i, n) {
                            var o = r.apply(e, [i, n]);
                            return 0 === e.length && t.getScene().meshes.forEach(function(e) {
                                e._markSubMeshesAsLightDirty()
                            }), o
                        }
                    }, Object.defineProperty(t.prototype, "onAfterUnbind", {
                        set: function(e) {
                            this._onAfterUnbindObserver && this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver), this._onAfterUnbindObserver = this.onAfterUnbindObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onBeforeRender", {
                        set: function(e) {
                            this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onAfterRender", {
                        set: function(e) {
                            this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onClear", {
                        set: function(e) {
                            this._onClearObserver && this.onClearObservable.remove(this._onClearObserver), this._onClearObserver = this.onClearObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "renderTargetOptions", {
                        get: function() {
                            return this._renderTargetOptions
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._onRatioRescale = function() {
                        this._sizeRatio && this.resize(this._initialSizeParameter)
                    }, Object.defineProperty(t.prototype, "boundingBoxSize", {
                        get: function() {
                            return this._boundingBoxSize
                        },
                        set: function(e) {
                            if (!this._boundingBoxSize || !this._boundingBoxSize.equals(e)) {
                                this._boundingBoxSize = e;
                                var t = this.getScene();
                                t && t.markAllMaterialsAsDirty(wi.Material.TextureDirtyFlag)
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.createDepthStencilTexture = function(e, t, i) {
                        if (void 0 === e && (e = 0), void 0 === t && (t = !0), void 0 === i && (i = !1), this.getScene()) {
                            var r = this.getScene().getEngine();
                            this.depthStencilTexture = r.createDepthStencilTexture(this._size, {
                                bilinearFiltering: t,
                                comparisonFunction: e,
                                generateStencil: i,
                                isCube: this.isCube
                            }), r.setFrameBufferDepthStencilTexture(this)
                        }
                    }, t.prototype._processSizeParameter = function(e) {
                        e.ratio ? (this._sizeRatio = e.ratio, this._size = {
                            width: this._bestReflectionRenderTargetDimension(this._engine.getRenderWidth(), this._sizeRatio),
                            height: this._bestReflectionRenderTargetDimension(this._engine.getRenderHeight(), this._sizeRatio)
                        }) : this._size = e
                    }, Object.defineProperty(t.prototype, "samples", {
                        get: function() {
                            return this._samples
                        },
                        set: function(e) {
                            if (this._samples !== e) {
                                var t = this.getScene();
                                t && (this._samples = t.getEngine().updateRenderTargetTextureSampleCount(this._texture, e))
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.resetRefreshCounter = function() {
                        this._currentRefreshId = -1
                    }, Object.defineProperty(t.prototype, "refreshRate", {
                        get: function() {
                            return this._refreshRate
                        },
                        set: function(e) {
                            this._refreshRate = e, this.resetRefreshCounter()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.addPostProcess = function(e) {
                        if (!this._postProcessManager) {
                            var t = this.getScene();
                            if (!t) return;
                            this._postProcessManager = new wi.PostProcessManager(t), this._postProcesses = new Array
                        }
                        this._postProcesses.push(e), this._postProcesses[0].autoClear = !1
                    }, t.prototype.clearPostProcesses = function(e) {
                        if (void 0 === e && (e = !1), this._postProcesses) {
                            if (e)
                                for (var t = 0, i = this._postProcesses; t < i.length; t++) i[t].dispose();
                            this._postProcesses = []
                        }
                    }, t.prototype.removePostProcess = function(e) {
                        if (this._postProcesses) {
                            var t = this._postProcesses.indexOf(e); - 1 !== t && (this._postProcesses.splice(t, 1), 0 < this._postProcesses.length && (this._postProcesses[0].autoClear = !1))
                        }
                    }, t.prototype._shouldRender = function() {
                        return -1 === this._currentRefreshId ? (this._currentRefreshId = 1, !0) : this.refreshRate === this._currentRefreshId ? (this._currentRefreshId = 1, !0) : (this._currentRefreshId++, !1)
                    }, t.prototype.getRenderSize = function() {
                        return this.getRenderWidth()
                    }, t.prototype.getRenderWidth = function() {
                        return this._size.width ? this._size.width : this._size
                    }, t.prototype.getRenderHeight = function() {
                        return this._size.width ? this._size.height : this._size
                    }, Object.defineProperty(t.prototype, "canRescale", {
                        get: function() {
                            return !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.scale = function(e) {
                        var t = this.getRenderSize() * e;
                        this.resize(t)
                    }, t.prototype.getReflectionTextureMatrix = function() {
                        return this.isCube ? this._textureMatrix : e.prototype.getReflectionTextureMatrix.call(this)
                    }, t.prototype.resize = function(e) {
                        this.releaseInternalTexture();
                        var t = this.getScene();
                        t && (this._processSizeParameter(e), this.isCube ? this._texture = t.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions) : this._texture = t.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions))
                    }, t.prototype.render = function(e, t) {
                        if (void 0 === e && (e = !1), void 0 === t && (t = !1), a = this.getScene()) {
                            var i, r = a.getEngine();
                            if (void 0 !== this.useCameraPostProcesses && (e = this.useCameraPostProcesses), this._waitingRenderList) {
                                this.renderList = [];
                                for (var n = 0; n < this._waitingRenderList.length; n++) {
                                    var o = this._waitingRenderList[n],
                                        s = a.getMeshByID(o);
                                    s && this.renderList.push(s)
                                }
                                delete this._waitingRenderList
                            }
                            if (this.renderListPredicate) {
                                var a;
                                if (this.renderList ? this.renderList.splice(0) : this.renderList = [], !(a = this.getScene())) return;
                                var l = a.meshes;
                                for (n = 0; n < l.length; n++) {
                                    var u = l[n];
                                    this.renderListPredicate(u) && this.renderList.push(u)
                                }
                            }
                            this.onBeforeBindObservable.notifyObservers(this), this.activeCamera ? (i = this.activeCamera, r.setViewport(this.activeCamera.viewport, this.getRenderWidth(), this.getRenderHeight()), this.activeCamera !== a.activeCamera && a.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(!0))) : (i = a.activeCamera) && r.setViewport(i.viewport, this.getRenderWidth(), this.getRenderHeight()), this._renderingManager.reset();
                            for (var c = this.renderList ? this.renderList : a.getActiveMeshes().data, h = this.renderList ? this.renderList.length : a.getActiveMeshes().length, d = a.getRenderId(), p = 0; p < h; p++)
                                if (u = c[p]) {
                                    if (!u.isReady(0 === this.refreshRate)) {
                                        this.resetRefreshCounter();
                                        continue
                                    }
                                    u._preActivateForIntermediateRendering(d);
                                    var f = void 0;
                                    if (f = !(this.renderList || !i) && 0 == (u.layerMask & i.layerMask), u.isEnabled() && u.isVisible && u.subMeshes && !f) {
                                        u._activate(d);
                                        for (var _ = 0; _ < u.subMeshes.length; _++) {
                                            var m = u.subMeshes[_];
                                            a._activeIndices.addCount(m.indexCount, !1), this._renderingManager.dispatch(m, u)
                                        }
                                    }
                                }
                            for (var g = 0; g < a.particleSystems.length; g++) {
                                var v = a.particleSystems[g],
                                    y = v.emitter;
                                v.isStarted() && y && y.position && y.isEnabled() && 0 <= c.indexOf(y) && this._renderingManager.dispatchParticles(v)
                            }
                            if (this.isCube)
                                for (var b = 0; b < 6; b++) this.renderToTarget(b, c, h, e, t), a.incrementRenderId(), a.resetCachedMaterial();
                            else this.renderToTarget(0, c, h, e, t);
                            this.onAfterUnbindObservable.notifyObservers(this), a.activeCamera && (this.activeCamera && this.activeCamera !== a.activeCamera && a.setTransformMatrix(a.activeCamera.getViewMatrix(), a.activeCamera.getProjectionMatrix(!0)), r.setViewport(a.activeCamera.viewport)), a.resetCachedMaterial()
                        }
                    }, t.prototype._bestReflectionRenderTargetDimension = function(e, t) {
                        var i = e * t,
                            r = wi.Tools.NearestPOT(i + 16384 / (128 + i));
                        return Math.min(wi.Tools.FloorPOT(e), r)
                    }, t.prototype.unbindFrameBuffer = function(e, t) {
                        var i = this;
                        this._texture && e.unBindFramebuffer(this._texture, this.isCube, function() {
                            i.onAfterRenderObservable.notifyObservers(t)
                        })
                    }, t.prototype.renderToTarget = function(e, t, i, r, n) {
                        var o = this.getScene();
                        if (o) {
                            var s = o.getEngine();
                            this._texture && (this._postProcessManager ? this._postProcessManager._prepareFrame(this._texture, this._postProcesses) : r && o.postProcessManager._prepareFrame(this._texture) || this._texture && s.bindFramebuffer(this._texture, this.isCube ? e : void 0, void 0, void 0, this.ignoreCameraViewport, this.depthStencilTexture ? this.depthStencilTexture : void 0), this.onBeforeRenderObservable.notifyObservers(e), this.onClearObservable.hasObservers() ? this.onClearObservable.notifyObservers(s) : s.clear(this.clearColor || o.clearColor, !0, !0, !0), this._doNotChangeAspectRatio || o.updateTransformMatrix(!0), this._renderingManager.render(this.customRenderFunction, t, this.renderParticles, this.renderSprites), this._postProcessManager ? this._postProcessManager._finalizeFrame(!1, this._texture, e, this._postProcesses, this.ignoreCameraViewport) : r && o.postProcessManager._finalizeFrame(!1, this._texture, e), this._doNotChangeAspectRatio || o.updateTransformMatrix(!0), n && wi.Tools.DumpFramebuffer(this.getRenderWidth(), this.getRenderHeight(), s), this.isCube && 5 !== e ? this.onAfterRenderObservable.notifyObservers(e) : (this.isCube && 5 === e && s.generateMipMapsForCubemap(this._texture), this.unbindFrameBuffer(s, e)))
                        }
                    }, t.prototype.setRenderingOrder = function(e, t, i, r) {
                        void 0 === t && (t = null), void 0 === i && (i = null), void 0 === r && (r = null), this._renderingManager.setRenderingOrder(e, t, i, r)
                    }, t.prototype.setRenderingAutoClearDepthStencil = function(e, t) {
                        this._renderingManager.setRenderingAutoClearDepthStencil(e, t), this._renderingManager._useSceneAutoClearSetup = !1
                    }, t.prototype.clone = function() {
                        var e = this.getSize(),
                            i = new t(this.name, e, this.getScene(), this._renderTargetOptions.generateMipMaps, this._doNotChangeAspectRatio, this._renderTargetOptions.type, this.isCube, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer, this._renderTargetOptions.generateStencilBuffer);
                        return i.hasAlpha = this.hasAlpha, i.level = this.level, i.coordinatesMode = this.coordinatesMode, this.renderList && (i.renderList = this.renderList.slice(0)), i
                    }, t.prototype.serialize = function() {
                        if (!this.name) return null;
                        var t = e.prototype.serialize.call(this);
                        if (t.renderTargetSize = this.getRenderSize(), t.renderList = [], this.renderList)
                            for (var i = 0; i < this.renderList.length; i++) t.renderList.push(this.renderList[i].id);
                        return t
                    }, t.prototype.disposeFramebufferObjects = function() {
                        var e = this.getInternalTexture(),
                            t = this.getScene();
                        e && t && t.getEngine()._releaseFramebufferObjects(e)
                    }, t.prototype.dispose = function() {
                        this._postProcessManager && (this._postProcessManager.dispose(), this._postProcessManager = null), this.clearPostProcesses(!0), this._resizeObserver && (this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this.renderList = null;
                        var t = this.getScene();
                        if (t) {
                            var i = t.customRenderTargets.indexOf(this);
                            0 <= i && t.customRenderTargets.splice(i, 1);
                            for (var r = 0, n = t.cameras; r < n.length; r++) {
                                var o = n[r];
                                0 <= (i = o.customRenderTargets.indexOf(this)) && o.customRenderTargets.splice(i, 1)
                            }
                            e.prototype.dispose.call(this)
                        }
                    }, t.prototype._rebuild = function() {
                        this.refreshRate === t.REFRESHRATE_RENDER_ONCE && (this.refreshRate = t.REFRESHRATE_RENDER_ONCE), this._postProcessManager && this._postProcessManager._rebuild()
                    }, t.prototype.freeRenderingGroups = function() {
                        this._renderingManager && this._renderingManager.freeRenderingGroups()
                    }, t.REFRESHRATE_RENDER_ONCE = 0, t.REFRESHRATE_RENDER_ONEVERYFRAME = 1, t.REFRESHRATE_RENDER_ONEVERYTWOFRAMES = 2, t
                }(wi.Texture), wi.RenderTargetTexture = Ii, Di = $a || ($a = {}), Li = function(e) {
                    function t(t, i, r, n, o) {
                        var s = this,
                            a = !(!o || !o.generateMipMaps) && o.generateMipMaps,
                            l = !(!o || !o.generateDepthTexture) && o.generateDepthTexture,
                            u = !o || void 0 === o.doNotChangeAspectRatio || o.doNotChangeAspectRatio;
                        if ((s = e.call(this, t, i, n, a, u) || this)._engine = n.getEngine(), s.isSupported) {
                            for (var c = [], h = [], d = 0; d < r; d++) o && o.types && void 0 !== o.types[d] ? c.push(o.types[d]) : c.push(o && o.defaultType ? o.defaultType : Di.Engine.TEXTURETYPE_UNSIGNED_INT), o && o.samplingModes && void 0 !== o.samplingModes[d] ? h.push(o.samplingModes[d]) : h.push(Di.Texture.BILINEAR_SAMPLINGMODE);
                            var p = !o || void 0 === o.generateDepthBuffer || o.generateDepthBuffer,
                                f = !(!o || void 0 === o.generateStencilBuffer) && o.generateStencilBuffer;
                            return s._size = i, s._multiRenderTargetOptions = {
                                samplingModes: h,
                                generateMipMaps: a,
                                generateDepthBuffer: p,
                                generateStencilBuffer: f,
                                generateDepthTexture: l,
                                types: c,
                                textureCount: r
                            }, s._createInternalTextures(), s._createTextures(), s
                        }
                        s.dispose()
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "isSupported", {
                        get: function() {
                            return 1 < this._engine.webGLVersion || this._engine.getCaps().drawBuffersExtension
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "textures", {
                        get: function() {
                            return this._textures
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "depthTexture", {
                        get: function() {
                            return this._textures[this._textures.length - 1]
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "wrapU", {
                        set: function(e) {
                            if (this._textures)
                                for (var t = 0; t < this._textures.length; t++) this._textures[t].wrapU = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "wrapV", {
                        set: function(e) {
                            if (this._textures)
                                for (var t = 0; t < this._textures.length; t++) this._textures[t].wrapV = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._rebuild = function() {
                        this.releaseInternalTextures(), this._createInternalTextures();
                        for (var e = 0; e < this._internalTextures.length; e++) this._textures[e]._texture = this._internalTextures[e];
                        this._texture = this._internalTextures[0]
                    }, t.prototype._createInternalTextures = function() {
                        this._internalTextures = this._engine.createMultipleRenderTarget(this._size, this._multiRenderTargetOptions)
                    }, t.prototype._createTextures = function() {
                        this._textures = [];
                        for (var e = 0; e < this._internalTextures.length; e++) {
                            var t = new Di.Texture(null, this.getScene());
                            t._texture = this._internalTextures[e], this._textures.push(t)
                        }
                        this._texture = this._internalTextures[0]
                    }, Object.defineProperty(t.prototype, "samples", {
                        get: function() {
                            return this._samples
                        },
                        set: function(e) {
                            this._samples !== e && (this._samples = this._engine.updateMultipleRenderTargetTextureSampleCount(this._internalTextures, e))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.resize = function(e) {
                        this.releaseInternalTextures(), this._internalTextures = this._engine.createMultipleRenderTarget(e, this._multiRenderTargetOptions), this._createInternalTextures()
                    }, t.prototype.unbindFrameBuffer = function(e, t) {
                        var i = this;
                        e.unBindMultiColorAttachmentFramebuffer(this._internalTextures, this.isCube, function() {
                            i.onAfterRenderObservable.notifyObservers(t)
                        })
                    }, t.prototype.dispose = function() {
                        this.releaseInternalTextures(), e.prototype.dispose.call(this)
                    }, t.prototype.releaseInternalTextures = function() {
                        if (this._internalTextures)
                            for (var e = this._internalTextures.length - 1; 0 <= e; e--) void 0 !== this._internalTextures[e] && (this._internalTextures[e].dispose(), this._internalTextures.splice(e, 1))
                    }, t
                }(Di.RenderTargetTexture), Di.MultiRenderTarget = Li, Bi = $a || ($a = {}), Fi = function(e) {
                    function t(t, i, r, n, o, s, a) {
                        void 0 === o && (o = Bi.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === s && (s = Bi.Texture.BILINEAR_SAMPLINGMODE), void 0 === a && (a = !0);
                        var l = e.call(this, t, i, r, n, !0, o, !1, s, a) || this;
                        return l.scene = r, l.mirrorPlane = new Bi.Plane(0, 1, 0, 1), l._transformMatrix = Bi.Matrix.Zero(), l._mirrorMatrix = Bi.Matrix.Zero(), l._adaptiveBlurKernel = 0, l._blurKernelX = 0, l._blurKernelY = 0, l._blurRatio = 1, l.ignoreCameraViewport = !0, l._updateGammaSpace(), l._imageProcessingConfigChangeObserver = r.imageProcessingConfiguration.onUpdateParameters.add(function() {
                            l._updateGammaSpace
                        }), l.onBeforeRenderObservable.add(function() {
                            Bi.Matrix.ReflectionToRef(l.mirrorPlane, l._mirrorMatrix), l._savedViewMatrix = r.getViewMatrix(), l._mirrorMatrix.multiplyToRef(l._savedViewMatrix, l._transformMatrix), r.setTransformMatrix(l._transformMatrix, r.getProjectionMatrix()), r.clipPlane = l.mirrorPlane, r.getEngine().cullBackFaces = !1, r._mirroredCameraPosition = Bi.Vector3.TransformCoordinates(r.activeCamera.globalPosition, l._mirrorMatrix)
                        }), l.onAfterRenderObservable.add(function() {
                            r.setTransformMatrix(l._savedViewMatrix, r.getProjectionMatrix()), r.getEngine().cullBackFaces = !0, r._mirroredCameraPosition = null, delete r.clipPlane
                        }), l
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "blurRatio", {
                        get: function() {
                            return this._blurRatio
                        },
                        set: function(e) {
                            this._blurRatio !== e && (this._blurRatio = e, this._preparePostProcesses())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "adaptiveBlurKernel", {
                        set: function(e) {
                            this._adaptiveBlurKernel = e, this._autoComputeBlurKernel()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "blurKernel", {
                        set: function(e) {
                            this.blurKernelX = e, this.blurKernelY = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "blurKernelX", {
                        get: function() {
                            return this._blurKernelX
                        },
                        set: function(e) {
                            this._blurKernelX !== e && (this._blurKernelX = e, this._preparePostProcesses())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "blurKernelY", {
                        get: function() {
                            return this._blurKernelY
                        },
                        set: function(e) {
                            this._blurKernelY !== e && (this._blurKernelY = e, this._preparePostProcesses())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._autoComputeBlurKernel = function() {
                        var e = this.getScene().getEngine(),
                            t = this.getRenderWidth() / e.getRenderWidth(),
                            i = this.getRenderHeight() / e.getRenderHeight();
                        this.blurKernelX = this._adaptiveBlurKernel * t, this.blurKernelY = this._adaptiveBlurKernel * i
                    }, t.prototype._onRatioRescale = function() {
                        this._sizeRatio && (this.resize(this._initialSizeParameter), this._adaptiveBlurKernel || this._preparePostProcesses()), this._adaptiveBlurKernel && this._autoComputeBlurKernel()
                    }, t.prototype._updateGammaSpace = function() {
                        this.gammaSpace = !this.scene.imageProcessingConfiguration.isEnabled || !this.scene.imageProcessingConfiguration.applyByPostProcess
                    }, t.prototype._preparePostProcesses = function() {
                        if (this.clearPostProcesses(!0), this._blurKernelX && this._blurKernelY) {
                            var e = this.getScene().getEngine(),
                                t = e.getCaps().textureFloatRender ? Bi.Engine.TEXTURETYPE_FLOAT : Bi.Engine.TEXTURETYPE_HALF_FLOAT;
                            this._blurX = new Bi.BlurPostProcess("horizontal blur", new Bi.Vector2(1, 0), this._blurKernelX, this._blurRatio, null, Bi.Texture.BILINEAR_SAMPLINGMODE, e, !1, t), this._blurX.autoClear = !1, 1 === this._blurRatio && this.samples < 2 && this._texture ? this._blurX.inputTexture = this._texture : this._blurX.alwaysForcePOT = !0, this._blurY = new Bi.BlurPostProcess("vertical blur", new Bi.Vector2(0, 1), this._blurKernelY, this._blurRatio, null, Bi.Texture.BILINEAR_SAMPLINGMODE, e, !1, t), this._blurY.autoClear = !1, this._blurY.alwaysForcePOT = 1 !== this._blurRatio, this.addPostProcess(this._blurX), this.addPostProcess(this._blurY)
                        } else this._blurY && (this.removePostProcess(this._blurY), this._blurY.dispose(), this._blurY = null), this._blurX && (this.removePostProcess(this._blurX), this._blurX.dispose(), this._blurX = null)
                    }, t.prototype.clone = function() {
                        var e = this.getScene();
                        if (!e) return this;
                        var i = this.getSize(),
                            r = new t(this.name, i.width, e, this._renderTargetOptions.generateMipMaps, this._renderTargetOptions.type, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer);
                        return r.hasAlpha = this.hasAlpha, r.level = this.level, r.mirrorPlane = this.mirrorPlane.clone(), this.renderList && (r.renderList = this.renderList.slice(0)), r
                    }, t.prototype.serialize = function() {
                        if (!this.name) return null;
                        var t = e.prototype.serialize.call(this);
                        return t.mirrorPlane = this.mirrorPlane.asArray(), t
                    }, t.prototype.dispose = function() {
                        e.prototype.dispose.call(this), this.scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver)
                    }, t
                }(Bi.RenderTargetTexture), Bi.MirrorTexture = Fi, Ni = $a || ($a = {}), Vi = function(e) {
                    function t(t, i, r, n) {
                        var o = e.call(this, t, i, r, n, !0) || this;
                        return o.refractionPlane = new Ni.Plane(0, 1, 0, 1), o.depth = 2, o.onBeforeRenderObservable.add(function() {
                            r.clipPlane = o.refractionPlane
                        }), o.onAfterRenderObservable.add(function() {
                            delete r.clipPlane
                        }), o
                    }
                    return b(t, e), t.prototype.clone = function() {
                        var e = this.getScene();
                        if (!e) return this;
                        var i = this.getSize(),
                            r = new t(this.name, i.width, e, this._generateMipMaps);
                        return r.hasAlpha = this.hasAlpha, r.level = this.level, r.refractionPlane = this.refractionPlane.clone(), this.renderList && (r.renderList = this.renderList.slice(0)), r.depth = this.depth, r
                    }, t.prototype.serialize = function() {
                        if (!this.name) return null;
                        var t = e.prototype.serialize.call(this);
                        return t.mirrorPlane = this.refractionPlane.asArray(), t.depth = this.depth, t
                    }, t
                }(Ni.RenderTargetTexture), Ni.RefractionTexture = Vi, ki = $a || ($a = {}), Ui = function(e) {
                    function t(t, i, r, n, o, s) {
                        void 0 === r && (r = null), void 0 === o && (o = ki.Texture.TRILINEAR_SAMPLINGMODE), void 0 === s && (s = ki.Engine.TEXTUREFORMAT_RGBA);
                        var a = e.call(this, null, r, !n, void 0, o, void 0, void 0, void 0, void 0, s) || this;
                        a.name = t, a._engine = a.getScene().getEngine(), a.wrapU = ki.Texture.CLAMP_ADDRESSMODE, a.wrapV = ki.Texture.CLAMP_ADDRESSMODE, a._generateMipMaps = n, i.getContext ? (a._canvas = i, a._texture = a._engine.createDynamicTexture(i.width, i.height, n, o)) : (a._canvas = document.createElement("canvas"), i.width || 0 === i.width ? a._texture = a._engine.createDynamicTexture(i.width, i.height, n, o) : a._texture = a._engine.createDynamicTexture(i, i, n, o));
                        var l = a.getSize();
                        return a._canvas.width = l.width, a._canvas.height = l.height, a._context = a._canvas.getContext("2d"), a
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "canRescale", {
                        get: function() {
                            return !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._recreate = function(e) {
                        this._canvas.width = e.width, this._canvas.height = e.height, this.releaseInternalTexture(), this._texture = this._engine.createDynamicTexture(e.width, e.height, this._generateMipMaps, this._samplingMode)
                    }, t.prototype.scale = function(e) {
                        var t = this.getSize();
                        t.width *= e, t.height *= e, this._recreate(t)
                    }, t.prototype.scaleTo = function(e, t) {
                        var i = this.getSize();
                        i.width = e, i.height = t, this._recreate(i)
                    }, t.prototype.getContext = function() {
                        return this._context
                    }, t.prototype.clear = function() {
                        var e = this.getSize();
                        this._context.fillRect(0, 0, e.width, e.height)
                    }, t.prototype.update = function(e, t) {
                        void 0 === t && (t = !1), this._engine.updateDynamicTexture(this._texture, this._canvas, void 0 === e || e, t, this._format || void 0)
                    }, t.prototype.drawText = function(e, t, i, r, n, o, s, a) {
                        void 0 === a && (a = !0);
                        var l = this.getSize();
                        if (o && (this._context.fillStyle = o, this._context.fillRect(0, 0, l.width, l.height)), this._context.font = r, null == t) {
                            var u = this._context.measureText(e);
                            t = (l.width - u.width) / 2
                        }
                        if (null == i) {
                            var c = parseInt(r.replace(/\D/g, ""));
                            i = l.height / 2 + c / 3.65
                        }
                        this._context.fillStyle = n, this._context.fillText(e, t, i), a && this.update(s)
                    }, t.prototype.clone = function() {
                        var e = this.getScene();
                        if (!e) return this;
                        var i = this.getSize(),
                            r = new t(this.name, i, e, this._generateMipMaps);
                        return r.hasAlpha = this.hasAlpha, r.level = this.level, r.wrapU = this.wrapU, r.wrapV = this.wrapV, r
                    }, t.prototype.serialize = function() {
                        var t = this.getScene();
                        t && !t.isReady() && ki.Tools.Warn("The scene must be ready before serializing the dynamic texture");
                        var i = e.prototype.serialize.call(this);
                        return i.base64String = this._canvas.toDataURL(), i.invertY = this._invertY, i.samplingMode = this.samplingMode, i
                    }, t.prototype._rebuild = function() {
                        this.update()
                    }, t
                }(ki.Texture), ki.DynamicTexture = Ui, Gi = $a || ($a = {}), zi = function(e) {
                    function t(t, i, r, n, o, s, a) {
                        void 0 === n && (n = !1), void 0 === o && (o = !1), void 0 === s && (s = Gi.Texture.TRILINEAR_SAMPLINGMODE), void 0 === a && (a = {
                            autoPlay: !0,
                            loop: !0,
                            autoUpdateTexture: !0
                        });
                        var l = e.call(this, null, r, !n, o) || this;
                        return l._onUserActionRequestedObservable = null, l._stillImageCaptured = !1, l._poster = !1, l._createInternalTexture = function() {
                            if (null != l._texture) {
                                if (!l._poster) return;
                                l._texture.dispose(), l._poster = !1
                            }
                            if (!l._engine.needPOTTextures || Gi.Tools.IsExponentOfTwo(l.video.videoWidth) && Gi.Tools.IsExponentOfTwo(l.video.videoHeight) ? (l.wrapU = Gi.Texture.WRAP_ADDRESSMODE, l.wrapV = Gi.Texture.WRAP_ADDRESSMODE) : (l.wrapU = Gi.Texture.CLAMP_ADDRESSMODE, l.wrapV = Gi.Texture.CLAMP_ADDRESSMODE, l._generateMipMaps = !1), l._texture = l._engine.createDynamicTexture(l.video.videoWidth, l.video.videoHeight, l._generateMipMaps, l._samplingMode), l.video.autoplay) l._texture.isReady = !0, l._updateInternalTexture(), l.onLoadObservable.hasObservers() && l.onLoadObservable.notifyObservers(l);
                            else {
                                var e = l.video.onplaying,
                                    t = !1;
                                l.video.onplaying = function() {
                                    l.video.onplaying = e, l._texture.isReady = !0, l._updateInternalTexture(), t || l.video.pause(), l.onLoadObservable.hasObservers() && l.onLoadObservable.notifyObservers(l)
                                };
                                var i = l.video.play();
                                i ? i.then(function() {}).catch(function() {
                                    t = !0, l._onUserActionRequestedObservable && l._onUserActionRequestedObservable.hasObservers() && l._onUserActionRequestedObservable.notifyObservers(l)
                                }) : (l.video.onplaying = e, l._texture.isReady = !0, l._updateInternalTexture(), l.onLoadObservable.hasObservers() && l.onLoadObservable.notifyObservers(l))
                            }
                        }, l.reset = function() {
                            null != l._texture && (l._poster || (l._texture.dispose(), l._texture = null))
                        }, l._updateInternalTexture = function(e) {
                            null != l._texture && l._texture.isReady && (l.video.readyState < l.video.HAVE_CURRENT_DATA || l._engine.updateVideoTexture(l._texture, l.video, l._invertY))
                        }, l._engine = l.getScene().getEngine(), l._generateMipMaps = n, l._samplingMode = s, l.autoUpdateTexture = a.autoUpdateTexture, l.name = t || l._getName(i), l.video = l._getVideo(i), a.poster && (l.video.poster = a.poster), void 0 !== a.autoPlay && (l.video.autoplay = a.autoPlay), void 0 !== a.loop && (l.video.loop = a.loop), l.video.setAttribute("playsinline", ""), l.video.addEventListener("canplay", l._createInternalTexture), l.video.addEventListener("paused", l._updateInternalTexture), l.video.addEventListener("seeked", l._updateInternalTexture), l.video.addEventListener("emptied", l.reset), l.video.readyState >= l.video.HAVE_CURRENT_DATA && l._createInternalTexture(), a.poster && (l._texture = l._engine.createTexture(a.poster, !1, !0, r), l._poster = !0), l
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "onUserActionRequestedObservable", {
                            get: function() {
                                return this._onUserActionRequestedObservable || (this._onUserActionRequestedObservable = new Gi.Observable), this._onUserActionRequestedObservable
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype._getName = function(e) {
                            return e instanceof HTMLVideoElement ? e.currentSrc : "object" == typeof e ? e.toString() : e
                        }, t.prototype._getVideo = function(e) {
                            if (e instanceof HTMLVideoElement) return Gi.Tools.SetCorsBehavior(e.currentSrc, e), e;
                            var t = document.createElement("video");
                            return "string" == typeof e ? (Gi.Tools.SetCorsBehavior(e, t), t.src = e) : (Gi.Tools.SetCorsBehavior(e[0], t), e.forEach(function(e) {
                                var i = document.createElement("source");
                                i.src = e, t.appendChild(i)
                            })), t
                        }, t.prototype._rebuild = function() {
                            this.update()
                        }, t.prototype.update = function() {
                            this.autoUpdateTexture && this.updateTexture(!0)
                        }, t.prototype.updateTexture = function(e) {
                            e && (this.video.paused && this._stillImageCaptured || (this._stillImageCaptured = !0, this._updateInternalTexture()))
                        }, t.prototype.updateURL = function(e) {
                            this.video.src = e
                        }, t.prototype.dispose = function() {
                            e.prototype.dispose.call(this), this._onUserActionRequestedObservable && (this._onUserActionRequestedObservable.clear(), this._onUserActionRequestedObservable = null), this.video.removeEventListener("canplay", this._createInternalTexture), this.video.removeEventListener("paused", this._updateInternalTexture), this.video.removeEventListener("seeked", this._updateInternalTexture), this.video.removeEventListener("emptied", this.reset), this.video.pause()
                        },
                        t.CreateFromWebCam = function(e, i, r) {
                            var n, o = document.createElement("video");
                            o.setAttribute("autoplay", ""), o.setAttribute("muted", ""), o.setAttribute("playsinline", ""), r && r.deviceId && (n = {
                                exact: r.deviceId
                            }), window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL, navigator.mediaDevices ? navigator.mediaDevices.getUserMedia({
                                video: r
                            }).then(function(r) {
                                void 0 !== o.mozSrcObject ? o.mozSrcObject = r : o.srcObject = r;
                                var n = function() {
                                    i && i(new t("video", o, e, !0, !0)), o.removeEventListener("playing", n)
                                };
                                o.addEventListener("playing", n), o.play()
                            }).catch(function(e) {
                                Gi.Tools.Error(e.name)
                            }) : (navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia, navigator.getUserMedia && navigator.getUserMedia({
                                video: {
                                    deviceId: n,
                                    width: {
                                        min: r && r.minWidth || 256,
                                        max: r && r.maxWidth || 640
                                    },
                                    height: {
                                        min: r && r.minHeight || 256,
                                        max: r && r.maxHeight || 480
                                    }
                                }
                            }, function(r) {
                                void 0 !== o.mozSrcObject ? o.mozSrcObject = r : o.src = window.URL && window.URL.createObjectURL(r) || r, o.play(), i && i(new t("video", o, e, !0, !0))
                            }, function(e) {
                                Gi.Tools.Error(e.name)
                            }))
                        }, t
                }(Gi.Texture), Gi.VideoTexture = zi, ji = $a || ($a = {}), Hi = function(e) {
                    function t(t, i, r, n, o, s, a, l, u) {
                        void 0 === s && (s = !0), void 0 === a && (a = !1), void 0 === l && (l = ji.Texture.TRILINEAR_SAMPLINGMODE), void 0 === u && (u = ji.Engine.TEXTURETYPE_UNSIGNED_INT);
                        var c = e.call(this, null, o, !s, a) || this;
                        return c.format = n, c._engine = o.getEngine(), c._texture = o.getEngine().createRawTexture(t, i, r, n, s, a, l, null, u), c.wrapU = ji.Texture.CLAMP_ADDRESSMODE, c.wrapV = ji.Texture.CLAMP_ADDRESSMODE, c
                    }
                    return b(t, e), t.prototype.update = function(e) {
                        this._engine.updateRawTexture(this._texture, e, this._texture.format, this._texture.invertY, void 0, this._texture.type)
                    }, t.CreateLuminanceTexture = function(e, i, r, n, o, s, a) {
                        return void 0 === o && (o = !0), void 0 === s && (s = !1), void 0 === a && (a = ji.Texture.TRILINEAR_SAMPLINGMODE), new t(e, i, r, ji.Engine.TEXTUREFORMAT_LUMINANCE, n, o, s, a)
                    }, t.CreateLuminanceAlphaTexture = function(e, i, r, n, o, s, a) {
                        return void 0 === o && (o = !0), void 0 === s && (s = !1), void 0 === a && (a = ji.Texture.TRILINEAR_SAMPLINGMODE), new t(e, i, r, ji.Engine.TEXTUREFORMAT_LUMINANCE_ALPHA, n, o, s, a)
                    }, t.CreateAlphaTexture = function(e, i, r, n, o, s, a) {
                        return void 0 === o && (o = !0), void 0 === s && (s = !1), void 0 === a && (a = ji.Texture.TRILINEAR_SAMPLINGMODE), new t(e, i, r, ji.Engine.TEXTUREFORMAT_ALPHA, n, o, s, a)
                    }, t.CreateRGBTexture = function(e, i, r, n, o, s, a, l) {
                        return void 0 === o && (o = !0), void 0 === s && (s = !1), void 0 === a && (a = ji.Texture.TRILINEAR_SAMPLINGMODE), void 0 === l && (l = ji.Engine.TEXTURETYPE_UNSIGNED_INT), new t(e, i, r, ji.Engine.TEXTUREFORMAT_RGB, n, o, s, a, l)
                    }, t.CreateRGBATexture = function(e, i, r, n, o, s, a, l) {
                        return void 0 === o && (o = !0), void 0 === s && (s = !1), void 0 === a && (a = ji.Texture.TRILINEAR_SAMPLINGMODE), void 0 === l && (l = ji.Engine.TEXTURETYPE_UNSIGNED_INT), new t(e, i, r, ji.Engine.TEXTUREFORMAT_RGBA, n, o, s, a, l)
                    }, t.CreateRTexture = function(e, i, r, n, o, s, a, l) {
                        return void 0 === o && (o = !0), void 0 === s && (s = !1), void 0 === a && (a = ji.Texture.TRILINEAR_SAMPLINGMODE), void 0 === l && (l = ji.Engine.TEXTURETYPE_FLOAT), new t(e, i, r, ji.Engine.TEXTUREFORMAT_R, n, o, s, a, l)
                    }, t
                }(ji.Texture), ji.RawTexture = Hi, Wi = $a || ($a = {}), Xi = function(e) {
                    function t(t, i, r, n, o, s, a, l, u, c) {
                        void 0 === a && (a = !0), void 0 === l && (l = !1), void 0 === u && (u = Wi.Texture.TRILINEAR_SAMPLINGMODE), void 0 === c && (c = Wi.Engine.TEXTURETYPE_UNSIGNED_INT);
                        var h = e.call(this, null, s, !a, l) || this;
                        return h.format = o, h._engine = s.getEngine(), h._texture = s.getEngine().createRawTexture3D(t, i, r, n, o, a, l, u, void 0, c), h.is3D = !0, h
                    }
                    return b(t, e), t.prototype.update = function(e) {
                        this._texture && this._engine.updateRawTexture3D(this._texture, e, this._texture.format, this._texture.invertY, void 0, this._texture.type)
                    }, t
                }(Wi.Texture), Wi.RawTexture3D = Xi, Yi = $a || ($a = {}), qi = function() {
                    function e(e) {
                        this._vertexBuffers = {}, this._scene = e
                    }
                    return e.prototype._prepareBuffers = function() {
                        if (!this._vertexBuffers[Yi.VertexBuffer.PositionKind]) {
                            var e = [];
                            e.push(1, 1), e.push(-1, 1), e.push(-1, -1), e.push(1, -1), this._vertexBuffers[Yi.VertexBuffer.PositionKind] = new Yi.VertexBuffer(this._scene.getEngine(), e, Yi.VertexBuffer.PositionKind, !1, !1, 2), this._buildIndexBuffer()
                        }
                    }, e.prototype._buildIndexBuffer = function() {
                        var e = [];
                        e.push(0), e.push(1), e.push(2), e.push(0), e.push(2), e.push(3), this._indexBuffer = this._scene.getEngine().createIndexBuffer(e)
                    }, e.prototype._rebuild = function() {
                        var e = this._vertexBuffers[Yi.VertexBuffer.PositionKind];
                        e && (e._rebuild(), this._buildIndexBuffer())
                    }, e.prototype._prepareFrame = function(e, t) {
                        void 0 === e && (e = null), void 0 === t && (t = null);
                        var i = this._scene.activeCamera;
                        return !(!i || !(t = t || i._postProcesses.filter(function(e) {
                            return null != e
                        })) || 0 === t.length || !this._scene.postProcessesEnabled || (t[0].activate(i, e, null != t), 0))
                    }, e.prototype.directRender = function(e, t, i, r, n) {
                        void 0 === t && (t = null), void 0 === i && (i = !1), void 0 === r && (r = 0), void 0 === n && (n = 0);
                        for (var o = this._scene.getEngine(), s = 0; s < e.length; s++) {
                            s < e.length - 1 ? e[s + 1].activate(this._scene.activeCamera, t) : t ? o.bindFramebuffer(t, r, void 0, void 0, i, void 0, n) : o.restoreDefaultFramebuffer();
                            var a = e[s],
                                l = a.apply();
                            l && (a.onBeforeRenderObservable.notifyObservers(l), this._prepareBuffers(), o.bindBuffers(this._vertexBuffers, this._indexBuffer, l), o.drawElementsType(Yi.Material.TriangleFillMode, 0, 6), a.onAfterRenderObservable.notifyObservers(l))
                        }
                        o.setDepthBuffer(!0), o.setDepthWrite(!0)
                    }, e.prototype._finalizeFrame = function(e, t, i, r, n) {
                        void 0 === n && (n = !1);
                        var o = this._scene.activeCamera;
                        if (o && 0 !== (r = r || o._postProcesses.filter(function(e) {
                                return null != e
                            })).length && this._scene.postProcessesEnabled) {
                            for (var s = this._scene.getEngine(), a = 0, l = r.length; a < l; a++) {
                                var u = r[a];
                                if (a < l - 1 ? u._outputTexture = r[a + 1].activate(o, t) : t ? (s.bindFramebuffer(t, i, void 0, void 0, n), u._outputTexture = t) : (s.restoreDefaultFramebuffer(), u._outputTexture = null), e) break;
                                var c = u.apply();
                                c && (u.onBeforeRenderObservable.notifyObservers(c), this._prepareBuffers(), s.bindBuffers(this._vertexBuffers, this._indexBuffer, c), s.drawElementsType(Yi.Material.TriangleFillMode, 0, 6), u.onAfterRenderObservable.notifyObservers(c))
                            }
                            s.setDepthBuffer(!0), s.setDepthWrite(!0), s.setAlphaMode(Yi.Engine.ALPHA_DISABLE)
                        }
                    }, e.prototype.dispose = function() {
                        var e = this._vertexBuffers[Yi.VertexBuffer.PositionKind];
                        e && (e.dispose(), this._vertexBuffers[Yi.VertexBuffer.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null)
                    }, e
                }(), Yi.PostProcessManager = qi, Ki = $a || ($a = {}), Qi = function() {
                    function e(e, t, i, r, n, o, s, a, l, u, c, h, d, p) {
                        void 0 === s && (s = Ki.Texture.NEAREST_SAMPLINGMODE), void 0 === u && (u = null), void 0 === c && (c = Ki.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === h && (h = "postprocess"), void 0 === p && (p = !1), this.name = e, this.width = -1, this.height = -1, this._outputTexture = null, this.autoClear = !0, this.alphaMode = Ki.Engine.ALPHA_DISABLE, this.animations = new Array, this.enablePixelPerfectMode = !1, this.forceFullscreenViewport = !0, this.scaleMode = Ki.Engine.SCALEMODE_FLOOR, this.alwaysForcePOT = !1, this._samples = 1, this.adaptScaleToCurrentViewport = !1, this._reusable = !1, this._textures = new Ki.SmartArray(2), this._currentRenderTextureInd = 0, this._scaleRatio = new Ki.Vector2(1, 1), this._texelSize = Ki.Vector2.Zero(), this.onActivateObservable = new Ki.Observable, this.onSizeChangedObservable = new Ki.Observable, this.onApplyObservable = new Ki.Observable, this.onBeforeRenderObservable = new Ki.Observable, this.onAfterRenderObservable = new Ki.Observable, null != o ? (this._camera = o, this._scene = o.getScene(), o.attachPostProcess(this), this._engine = this._scene.getEngine(), this._scene.postProcesses.push(this)) : a && (this._engine = a, this._engine.postProcesses.push(this)), this._options = n, this.renderTargetSamplingMode = s || Ki.Texture.NEAREST_SAMPLINGMODE, this._reusable = l || !1, this._textureType = c, this._samplers = r || [], this._samplers.push("textureSampler"), this._fragmentUrl = t, this._vertexUrl = h, this._parameters = i || [], this._parameters.push("scale"), this._indexParameters = d, p || this.updateEffect(u)
                    }
                    return Object.defineProperty(e.prototype, "samples", {
                        get: function() {
                            return this._samples
                        },
                        set: function(e) {
                            var t = this;
                            this._samples = e, this._textures.forEach(function(e) {
                                e.samples !== t._samples && t._engine.updateRenderTargetTextureSampleCount(e, t._samples)
                            })
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "onActivate", {
                        set: function(e) {
                            this._onActivateObserver && this.onActivateObservable.remove(this._onActivateObserver), e && (this._onActivateObserver = this.onActivateObservable.add(e))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "onSizeChanged", {
                        set: function(e) {
                            this._onSizeChangedObserver && this.onSizeChangedObservable.remove(this._onSizeChangedObserver), this._onSizeChangedObserver = this.onSizeChangedObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "onApply", {
                        set: function(e) {
                            this._onApplyObserver && this.onApplyObservable.remove(this._onApplyObserver), this._onApplyObserver = this.onApplyObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "onBeforeRender", {
                        set: function(e) {
                            this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "onAfterRender", {
                        set: function(e) {
                            this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "inputTexture", {
                        get: function() {
                            return this._textures.data[this._currentRenderTextureInd]
                        },
                        set: function(e) {
                            this._forcedOutputTexture = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getCamera = function() {
                        return this._camera
                    }, Object.defineProperty(e.prototype, "texelSize", {
                        get: function() {
                            return this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.texelSize : (this._forcedOutputTexture && this._texelSize.copyFromFloats(1 / this._forcedOutputTexture.width, 1 / this._forcedOutputTexture.height), this._texelSize)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getEngine = function() {
                        return this._engine
                    }, e.prototype.getEffect = function() {
                        return this._effect
                    }, e.prototype.shareOutputWith = function(e) {
                        return this._disposeTextures(), this._shareOutputWithPostProcess = e, this
                    }, e.prototype.useOwnOutput = function() {
                        0 == this._textures.length && (this._textures = new Ki.SmartArray(2)), this._shareOutputWithPostProcess = null
                    }, e.prototype.updateEffect = function(e, t, i, r, n, o) {
                        void 0 === e && (e = null), void 0 === t && (t = null), void 0 === i && (i = null), this._effect = this._engine.createEffect({
                            vertex: this._vertexUrl,
                            fragment: this._fragmentUrl
                        }, ["position"], t || this._parameters, i || this._samplers, null !== e ? e : "", void 0, n, o, r || this._indexParameters)
                    }, e.prototype.isReusable = function() {
                        return this._reusable
                    }, e.prototype.markTextureDirty = function() {
                        this.width = -1
                    }, e.prototype.activate = function(e, t, i) {
                        var r = this;
                        void 0 === t && (t = null);
                        var n = (e = e || this._camera).getScene(),
                            o = n.getEngine(),
                            s = o.getCaps().maxTextureSize,
                            a = (t ? t.width : this._engine.getRenderWidth(!0)) * this._options | 0,
                            l = (t ? t.height : this._engine.getRenderHeight(!0)) * this._options | 0,
                            u = e.parent;
                        !u || u.leftCamera != e && u.rightCamera != e || (a /= 2);
                        var c, h = this._options.width || a,
                            d = this._options.height || l;
                        if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {
                            if (this.adaptScaleToCurrentViewport) {
                                var p = o.currentViewport;
                                p && (h *= p.width, d *= p.height)
                            }
                            if ((this.renderTargetSamplingMode === Ki.Texture.TRILINEAR_SAMPLINGMODE || this.alwaysForcePOT) && (this._options.width || (h = o.needPOTTextures ? Ki.Tools.GetExponentOfTwo(h, s, this.scaleMode) : h), this._options.height || (d = o.needPOTTextures ? Ki.Tools.GetExponentOfTwo(d, s, this.scaleMode) : d)), this.width !== h || this.height !== d) {
                                if (0 < this._textures.length) {
                                    for (var f = 0; f < this._textures.length; f++) this._engine._releaseTexture(this._textures.data[f]);
                                    this._textures.reset()
                                }
                                this.width = h, this.height = d;
                                var _ = {
                                        width: this.width,
                                        height: this.height
                                    },
                                    m = {
                                        generateMipMaps: !1,
                                        generateDepthBuffer: i || 0 === e._postProcesses.indexOf(this),
                                        generateStencilBuffer: (i || 0 === e._postProcesses.indexOf(this)) && this._engine.isStencilEnable,
                                        samplingMode: this.renderTargetSamplingMode,
                                        type: this._textureType
                                    };
                                this._textures.push(this._engine.createRenderTargetTexture(_, m)), this._reusable && this._textures.push(this._engine.createRenderTargetTexture(_, m)), this._texelSize.copyFromFloats(1 / this.width, 1 / this.height), this.onSizeChangedObservable.notifyObservers(this)
                            }
                            this._textures.forEach(function(e) {
                                e.samples !== r.samples && r._engine.updateRenderTargetTextureSampleCount(e, r.samples)
                            })
                        }
                        return this._shareOutputWithPostProcess ? c = this._shareOutputWithPostProcess.inputTexture : this._forcedOutputTexture ? (c = this._forcedOutputTexture, this.width = this._forcedOutputTexture.width, this.height = this._forcedOutputTexture.height) : c = this.inputTexture, this.enablePixelPerfectMode ? (this._scaleRatio.copyFromFloats(a / h, l / d), this._engine.bindFramebuffer(c, 0, a, l, this.forceFullscreenViewport)) : (this._scaleRatio.copyFromFloats(1, 1), this._engine.bindFramebuffer(c, 0, void 0, void 0, this.forceFullscreenViewport)), this.onActivateObservable.notifyObservers(e), this.autoClear && this.alphaMode === Ki.Engine.ALPHA_DISABLE && this._engine.clear(this.clearColor ? this.clearColor : n.clearColor, n._allowPostProcessClearColor, !0, !0), this._reusable && (this._currentRenderTextureInd = (this._currentRenderTextureInd + 1) % 2), c
                    }, Object.defineProperty(e.prototype, "isSupported", {
                        get: function() {
                            return this._effect.isSupported
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "aspectRatio", {
                        get: function() {
                            return this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.aspectRatio : this._forcedOutputTexture ? this._forcedOutputTexture.width / this._forcedOutputTexture.height : this.width / this.height
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.isReady = function() {
                        return this._effect && this._effect.isReady()
                    }, e.prototype.apply = function() {
                        return this._effect && this._effect.isReady() ? (this._engine.enableEffect(this._effect), this._engine.setState(!1), this._engine.setDepthBuffer(!1), this._engine.setDepthWrite(!1), this._engine.setAlphaMode(this.alphaMode), this.alphaConstants && this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a), e = this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.inputTexture : this._forcedOutputTexture ? this._forcedOutputTexture : this.inputTexture, this._effect._bindTexture("textureSampler", e), this._effect.setVector2("scale", this._scaleRatio), this.onApplyObservable.notifyObservers(this._effect), this._effect) : null;
                        var e
                    }, e.prototype._disposeTextures = function() {
                        if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {
                            if (0 < this._textures.length)
                                for (var e = 0; e < this._textures.length; e++) this._engine._releaseTexture(this._textures.data[e]);
                            this._textures.dispose()
                        }
                    }, e.prototype.dispose = function(e) {
                        if (e = e || this._camera, this._disposeTextures(), this._scene) {
                            var t = this._scene.postProcesses.indexOf(this); - 1 !== t && this._scene.postProcesses.splice(t, 1)
                        } else {
                            var i = this._engine.postProcesses.indexOf(this); - 1 !== i && this._engine.postProcesses.splice(i, 1)
                        }
                        if (e) {
                            if (e.detachPostProcess(this), 0 === e._postProcesses.indexOf(this) && 0 < e._postProcesses.length) {
                                var r = this._camera._getFirstPostProcess();
                                r && r.markTextureDirty()
                            }
                            this.onActivateObservable.clear(), this.onAfterRenderObservable.clear(), this.onApplyObservable.clear(), this.onBeforeRenderObservable.clear(), this.onSizeChangedObservable.clear()
                        }
                    }, e
                }(), Ki.PostProcess = Qi, Zi = $a || ($a = {}), Ji = function(e) {
                    function t(t, i, r, n, o, s, a, l) {
                        return void 0 === r && (r = null), void 0 === a && (a = Zi.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === l && (l = !1), e.call(this, t, "pass", null, null, i, r, n, o, s, void 0, a, void 0, null, l) || this
                    }
                    return b(t, e), t
                }(Zi.PostProcess), Zi.PassPostProcess = Ji;
            var $i, er, tr, ir, rr, nr, or, sr, ar, lr, ur, cr, hr, dr, pr, fr, _r, mr, gr, vr, yr, br, xr, Tr, Er, Sr, Pr, Ar, Cr, Mr, Rr, Or, wr, Ir, Dr, Lr, Br, Fr, Nr, Vr, kr, Ur, Gr, zr, jr, Hr, Wr, Xr, Yr, qr, Kr, Qr, Zr, Jr, $r, en, tn, rn, nn, on, sn, an, ln, un, cn, hn, dn, pn, fn, _n, mn, gn, vn, yn, bn, xn, Tn, En, Sn, Pn, An, Cn, Mn, Rn, On, wn, In, Dn, Ln, Bn, Fn, Nn, Vn, kn, Un, Gn, zn, jn, Hn, Wn, Xn, Yn, qn, Kn, Qn, Zn, Jn, $n, eo, to, io, ro, no, oo, so, ao, lo, uo, co, ho, po, fo, _o, mo, go, vo, yo, bo, xo, To, Eo, So, Po, Ao, Co, Mo, Ro, Oo, wo, Io, Do, Lo, Bo, Fo, No, Vo, ko, Uo, Go, zo, jo, Ho, Wo, Xo, Yo, qo, Ko, Qo, Zo, Jo, $o, es, ts, is, rs, ns, os, ss, as, ls, us, cs, hs, ds, ps, fs, _s, ms, gs, vs, ys, bs, xs, Ts, Es, Ss, Ps, As, Cs, Ms, Rs, Os, ws, Is, Ds, Ls, Bs, Fs, Ns, Vs, ks, Us, Gs, zs, js, Hs, Ws, Xs, Ys, qs, Ks, Qs, Zs, Js, $s, ea, ta, ia, ra, na, oa, sa, aa;
            ae = this && this.__assign || function() {
                    return (ae = Object.assign || function(e) {
                        for (var t, i = 1, r = arguments.length; i < r; i++)
                            for (var n in t = arguments[i]) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
                        return e
                    }).apply(this, arguments)
                }, $i = $a || ($a = {}), er = function() {
                    function e(t, i, r) {
                        this._bias = 5e-5, this._normalBias = 0, this._blurBoxOffset = 1, this._blurScale = 2, this._blurKernel = 1, this._useKernelBlur = !1, this._filter = e.FILTER_NONE, this._filteringQuality = e.QUALITY_HIGH, this._contactHardeningLightSizeUVRatio = .1, this._darkness = 0, this._transparencyShadow = !1, this.frustumEdgeFalloff = 0, this.forceBackFacesOnly = !1, this._lightDirection = $i.Vector3.Zero(), this._viewMatrix = $i.Matrix.Zero(), this._projectionMatrix = $i.Matrix.Zero(), this._transformMatrix = $i.Matrix.Zero(), this._cachedPosition = new $i.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cachedDirection = new $i.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._currentFaceIndex = 0, this._currentFaceIndexCache = 0, this._defaultTextureMatrix = $i.Matrix.Identity(), this._mapSize = t, this._light = i, this._scene = i.getScene();
                        var n = (i._shadowGenerator = this)._scene._getComponent($i.SceneComponentConstants.NAME_SHADOWGENERATOR);
                        n || (n = new $i.ShadowGeneratorSceneComponent(this._scene), this._scene._addComponent(n));
                        var o = this._scene.getEngine().getCaps();
                        r ? o.textureFloatRender && o.textureFloatLinearFiltering ? this._textureType = $i.Engine.TEXTURETYPE_FLOAT : o.textureHalfFloatRender && o.textureHalfFloatLinearFiltering ? this._textureType = $i.Engine.TEXTURETYPE_HALF_FLOAT : this._textureType = $i.Engine.TEXTURETYPE_UNSIGNED_INT : o.textureHalfFloatRender && o.textureHalfFloatLinearFiltering ? this._textureType = $i.Engine.TEXTURETYPE_HALF_FLOAT : o.textureFloatRender && o.textureFloatLinearFiltering ? this._textureType = $i.Engine.TEXTURETYPE_FLOAT : this._textureType = $i.Engine.TEXTURETYPE_UNSIGNED_INT, this._initializeGenerator(), this._applyFilterValues()
                    }
                    return Object.defineProperty(e.prototype, "bias", {
                        get: function() {
                            return this._bias
                        },
                        set: function(e) {
                            this._bias = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "normalBias", {
                        get: function() {
                            return this._normalBias
                        },
                        set: function(e) {
                            this._normalBias = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "blurBoxOffset", {
                        get: function() {
                            return this._blurBoxOffset
                        },
                        set: function(e) {
                            this._blurBoxOffset !== e && (this._blurBoxOffset = e, this._disposeBlurPostProcesses())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "blurScale", {
                        get: function() {
                            return this._blurScale
                        },
                        set: function(e) {
                            this._blurScale !== e && (this._blurScale = e, this._disposeBlurPostProcesses())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "blurKernel", {
                        get: function() {
                            return this._blurKernel
                        },
                        set: function(e) {
                            this._blurKernel !== e && (this._blurKernel = e, this._disposeBlurPostProcesses())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "useKernelBlur", {
                        get: function() {
                            return this._useKernelBlur
                        },
                        set: function(e) {
                            this._useKernelBlur !== e && (this._useKernelBlur = e, this._disposeBlurPostProcesses())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "depthScale", {
                        get: function() {
                            return void 0 !== this._depthScale ? this._depthScale : this._light.getDepthScale()
                        },
                        set: function(e) {
                            this._depthScale = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "filter", {
                        get: function() {
                            return this._filter
                        },
                        set: function(t) {
                            if (this._light.needCube()) {
                                if (t === e.FILTER_BLUREXPONENTIALSHADOWMAP) return void(this.useExponentialShadowMap = !0);
                                if (t === e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) return void(this.useCloseExponentialShadowMap = !0);
                                if (t === e.FILTER_PCF || t === e.FILTER_PCSS) return void(this.usePoissonSampling = !0)
                            }
                            t !== e.FILTER_PCF && t !== e.FILTER_PCSS || 1 !== this._scene.getEngine().webGLVersion ? this._filter !== t && (this._filter = t, this._disposeBlurPostProcesses(), this._applyFilterValues(), this._light._markMeshesAsLightDirty()) : this.usePoissonSampling = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "usePoissonSampling", {
                        get: function() {
                            return this.filter === e.FILTER_POISSONSAMPLING
                        },
                        set: function(t) {
                            (t || this.filter === e.FILTER_POISSONSAMPLING) && (this.filter = t ? e.FILTER_POISSONSAMPLING : e.FILTER_NONE)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "useVarianceShadowMap", {
                        get: function() {
                            return $i.Tools.Warn("VSM are now replaced by ESM. Please use useExponentialShadowMap instead."), this.useExponentialShadowMap
                        },
                        set: function(e) {
                            $i.Tools.Warn("VSM are now replaced by ESM. Please use useExponentialShadowMap instead."), this.useExponentialShadowMap = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "useBlurVarianceShadowMap", {
                        get: function() {
                            return $i.Tools.Warn("VSM are now replaced by ESM. Please use useBlurExponentialShadowMap instead."), this.useBlurExponentialShadowMap
                        },
                        set: function(e) {
                            $i.Tools.Warn("VSM are now replaced by ESM. Please use useBlurExponentialShadowMap instead."), this.useBlurExponentialShadowMap = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "useExponentialShadowMap", {
                        get: function() {
                            return this.filter === e.FILTER_EXPONENTIALSHADOWMAP
                        },
                        set: function(t) {
                            (t || this.filter === e.FILTER_EXPONENTIALSHADOWMAP) && (this.filter = t ? e.FILTER_EXPONENTIALSHADOWMAP : e.FILTER_NONE)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "useBlurExponentialShadowMap", {
                        get: function() {
                            return this.filter === e.FILTER_BLUREXPONENTIALSHADOWMAP
                        },
                        set: function(t) {
                            (t || this.filter === e.FILTER_BLUREXPONENTIALSHADOWMAP) && (this.filter = t ? e.FILTER_BLUREXPONENTIALSHADOWMAP : e.FILTER_NONE)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "useCloseExponentialShadowMap", {
                        get: function() {
                            return this.filter === e.FILTER_CLOSEEXPONENTIALSHADOWMAP
                        },
                        set: function(t) {
                            (t || this.filter === e.FILTER_CLOSEEXPONENTIALSHADOWMAP) && (this.filter = t ? e.FILTER_CLOSEEXPONENTIALSHADOWMAP : e.FILTER_NONE)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "useBlurCloseExponentialShadowMap", {
                        get: function() {
                            return this.filter === e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP
                        },
                        set: function(t) {
                            (t || this.filter === e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) && (this.filter = t ? e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP : e.FILTER_NONE)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "usePercentageCloserFiltering", {
                        get: function() {
                            return this.filter === e.FILTER_PCF
                        },
                        set: function(t) {
                            (t || this.filter === e.FILTER_PCF) && (this.filter = t ? e.FILTER_PCF : e.FILTER_NONE)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "filteringQuality", {
                        get: function() {
                            return this._filteringQuality
                        },
                        set: function(e) {
                            this._filteringQuality = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "useContactHardeningShadow", {
                        get: function() {
                            return this.filter === e.FILTER_PCSS
                        },
                        set: function(t) {
                            (t || this.filter === e.FILTER_PCSS) && (this.filter = t ? e.FILTER_PCSS : e.FILTER_NONE)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "contactHardeningLightSizeUVRatio", {
                        get: function() {
                            return this._contactHardeningLightSizeUVRatio
                        },
                        set: function(e) {
                            this._contactHardeningLightSizeUVRatio = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getDarkness = function() {
                        return this._darkness
                    }, e.prototype.setDarkness = function(e) {
                        return this._darkness = 1 <= e ? 1 : e <= 0 ? 0 : e, this
                    }, e.prototype.setTransparencyShadow = function(e) {
                        return this._transparencyShadow = e, this
                    }, e.prototype.getShadowMap = function() {
                        return this._shadowMap
                    }, e.prototype.getShadowMapForRendering = function() {
                        return this._shadowMap2 ? this._shadowMap2 : this._shadowMap
                    }, e.prototype.addShadowCaster = function(e, t) {
                        var i;
                        return void 0 === t && (t = !0), this._shadowMap && (this._shadowMap.renderList || (this._shadowMap.renderList = []), this._shadowMap.renderList.push(e), t && (i = this._shadowMap.renderList).push.apply(i, e.getChildMeshes())), this
                    }, e.prototype.removeShadowCaster = function(e, t) {
                        if (void 0 === t && (t = !0), !this._shadowMap || !this._shadowMap.renderList) return this;
                        var i = this._shadowMap.renderList.indexOf(e);
                        if (-1 !== i && this._shadowMap.renderList.splice(i, 1), t)
                            for (var r = 0, n = e.getChildren(); r < n.length; r++) {
                                var o = n[r];
                                this.removeShadowCaster(o)
                            }
                        return this
                    }, e.prototype.getLight = function() {
                        return this._light
                    }, e.prototype._initializeGenerator = function() {
                        this._light._markMeshesAsLightDirty(), this._initializeShadowMap()
                    }, e.prototype._initializeShadowMap = function() {
                        var t = this,
                            i = this._scene.getEngine();
                        1 < i.webGLVersion ? (this._shadowMap = new $i.RenderTargetTexture(this._light.name + "_shadowMap", this._mapSize, this._scene, !1, !0, this._textureType, this._light.needCube(), void 0, !1, !1), this._shadowMap.createDepthStencilTexture($i.Engine.LESS, !0)) : this._shadowMap = new $i.RenderTargetTexture(this._light.name + "_shadowMap", this._mapSize, this._scene, !1, !0, this._textureType, this._light.needCube()), this._shadowMap.wrapU = $i.Texture.CLAMP_ADDRESSMODE, this._shadowMap.wrapV = $i.Texture.CLAMP_ADDRESSMODE, this._shadowMap.anisotropicFilteringLevel = 1, this._shadowMap.updateSamplingMode($i.Texture.BILINEAR_SAMPLINGMODE), this._shadowMap.renderParticles = !1, this._shadowMap.ignoreCameraViewport = !0, this._shadowMap.onBeforeRenderObservable.add(function(r) {
                            t._currentFaceIndex = r, t._filter === e.FILTER_PCF && i.setColorWrite(!1)
                        }), this._shadowMap.customRenderFunction = this._renderForShadowMap.bind(this), this._shadowMap.onAfterUnbindObservable.add(function() {
                            if (t._filter === e.FILTER_PCF && i.setColorWrite(!0), t.useBlurExponentialShadowMap || t.useBlurCloseExponentialShadowMap) {
                                var r = t.getShadowMapForRendering();
                                r && t._scene.postProcessManager.directRender(t._blurPostProcesses, r.getInternalTexture(), !0)
                            }
                        });
                        var r = new $i.Color4(0, 0, 0, 0),
                            n = new $i.Color4(1, 1, 1, 1);
                        this._shadowMap.onClearObservable.add(function(i) {
                            t._filter === e.FILTER_PCF ? i.clear(n, !1, !0, !1) : t.useExponentialShadowMap || t.useBlurExponentialShadowMap ? i.clear(r, !0, !0, !1) : i.clear(n, !0, !0, !1)
                        })
                    }, e.prototype._initializeBlurRTTAndPostProcesses = function() {
                        var e = this,
                            t = this._scene.getEngine(),
                            i = this._mapSize / this.blurScale;
                        this.useKernelBlur && 1 === this.blurScale || (this._shadowMap2 = new $i.RenderTargetTexture(this._light.name + "_shadowMap2", i, this._scene, !1, !0, this._textureType), this._shadowMap2.wrapU = $i.Texture.CLAMP_ADDRESSMODE, this._shadowMap2.wrapV = $i.Texture.CLAMP_ADDRESSMODE, this._shadowMap2.updateSamplingMode($i.Texture.BILINEAR_SAMPLINGMODE)), this.useKernelBlur ? (this._kernelBlurXPostprocess = new $i.BlurPostProcess(this._light.name + "KernelBlurX", new $i.Vector2(1, 0), this.blurKernel, 1, null, $i.Texture.BILINEAR_SAMPLINGMODE, t, !1, this._textureType), this._kernelBlurXPostprocess.width = i, this._kernelBlurXPostprocess.height = i, this._kernelBlurXPostprocess.onApplyObservable.add(function(t) {
                            t.setTexture("textureSampler", e._shadowMap)
                        }), this._kernelBlurYPostprocess = new $i.BlurPostProcess(this._light.name + "KernelBlurY", new $i.Vector2(0, 1), this.blurKernel, 1, null, $i.Texture.BILINEAR_SAMPLINGMODE, t, !1, this._textureType), this._kernelBlurXPostprocess.autoClear = !1, this._kernelBlurYPostprocess.autoClear = !1, this._textureType === $i.Engine.TEXTURETYPE_UNSIGNED_INT && (this._kernelBlurXPostprocess.packedFloat = !0, this._kernelBlurYPostprocess.packedFloat = !0), this._blurPostProcesses = [this._kernelBlurXPostprocess, this._kernelBlurYPostprocess]) : (this._boxBlurPostprocess = new $i.PostProcess(this._light.name + "DepthBoxBlur", "depthBoxBlur", ["screenSize", "boxOffset"], [], 1, null, $i.Texture.BILINEAR_SAMPLINGMODE, t, !1, "#define OFFSET " + this._blurBoxOffset, this._textureType), this._boxBlurPostprocess.onApplyObservable.add(function(t) {
                            t.setFloat2("screenSize", i, i), t.setTexture("textureSampler", e._shadowMap)
                        }), this._boxBlurPostprocess.autoClear = !1, this._blurPostProcesses = [this._boxBlurPostprocess])
                    }, e.prototype._renderForShadowMap = function(e, t, i, r) {
                        var n, o = this._scene.getEngine();
                        if (r.length) {
                            for (o.setColorWrite(!1), n = 0; n < r.length; n++) this._renderSubMeshForShadowMap(r.data[n]);
                            o.setColorWrite(!0)
                        }
                        for (n = 0; n < e.length; n++) this._renderSubMeshForShadowMap(e.data[n]);
                        for (n = 0; n < t.length; n++) this._renderSubMeshForShadowMap(t.data[n]);
                        if (this._transparencyShadow)
                            for (n = 0; n < i.length; n++) this._renderSubMeshForShadowMap(i.data[n])
                    }, e.prototype._renderSubMeshForShadowMap = function(e) {
                        var t = this,
                            i = e.getRenderingMesh(),
                            r = this._scene,
                            n = r.getEngine(),
                            o = e.getMaterial();
                        if (o) {
                            n.setState(o.backFaceCulling);
                            var s = i._getInstancesRenderList(e._id);
                            if (!s.mustReturn) {
                                var a = n.getCaps().instancedArrays && null !== s.visibleInstances[e._id] && void 0 !== s.visibleInstances[e._id];
                                if (this.isReady(e, a)) {
                                    if (n.enableEffect(this._effect), i._bind(e, this._effect, $i.Material.TriangleFillMode), this._effect.setFloat3("biasAndScale", this.bias, this.normalBias, this.depthScale), this._effect.setMatrix("viewProjection", this.getTransformMatrix()), this.getLight().getTypeID() === $i.Light.LIGHTTYPEID_DIRECTIONALLIGHT ? this._effect.setVector3("lightData", this._cachedDirection) : this._effect.setVector3("lightData", this._cachedPosition), r.activeCamera && this._effect.setFloat2("depthValues", this.getLight().getDepthMinZ(r.activeCamera), this.getLight().getDepthMinZ(r.activeCamera) + this.getLight().getDepthMaxZ(r.activeCamera)), o && o.needAlphaTesting()) {
                                        var l = o.getAlphaTestTexture();
                                        l && (this._effect.setTexture("diffuseSampler", l), this._effect.setMatrix("diffuseMatrix", l.getTextureMatrix() || this._defaultTextureMatrix))
                                    }
                                    i.useBones && i.computeBonesUsingShaders && this._effect.setMatrices("mBones", i.skeleton.getTransformMatrices(i)), $i.MaterialHelper.BindMorphTargetParameters(i, this._effect), this.forceBackFacesOnly && n.setState(!0, 0, !1, !0), i._processRendering(e, this._effect, $i.Material.TriangleFillMode, s, a, function(e, i) {
                                        return t._effect.setMatrix("world", i)
                                    }), this.forceBackFacesOnly && n.setState(!0, 0, !1, !1)
                                } else this._shadowMap && this._shadowMap.resetRefreshCounter()
                            }
                        }
                    }, e.prototype._applyFilterValues = function() {
                        this._shadowMap && (this.filter === e.FILTER_NONE || this.filter === e.FILTER_PCSS ? this._shadowMap.updateSamplingMode($i.Texture.NEAREST_SAMPLINGMODE) : this._shadowMap.updateSamplingMode($i.Texture.BILINEAR_SAMPLINGMODE))
                    }, e.prototype.forceCompilation = function(e, t) {
                        var i = this,
                            r = ae({
                                useInstances: !1
                            }, t),
                            n = this.getShadowMap();
                        if (n) {
                            var o = n.renderList;
                            if (o) {
                                for (var s = new Array, a = 0, l = o; a < l.length; a++) {
                                    var u = l[a];
                                    s.push.apply(s, u.subMeshes)
                                }
                                if (0 !== s.length) {
                                    var c = 0,
                                        h = function() {
                                            if (i._scene && i._scene.getEngine()) {
                                                for (; i.isReady(s[c], r.useInstances);)
                                                    if (++c >= s.length) return void(e && e(i));
                                                setTimeout(h, 16)
                                            }
                                        };
                                    h()
                                } else e && e(this)
                            } else e && e(this)
                        } else e && e(this)
                    }, e.prototype.forceCompilationAsync = function(e) {
                        var t = this;
                        return new Promise(function(i) {
                            t.forceCompilation(function() {
                                i()
                            }, e)
                        })
                    }, e.prototype.isReady = function(e, t) {
                        var i = [];
                        this._textureType !== $i.Engine.TEXTURETYPE_UNSIGNED_INT && i.push("#define FLOAT"), this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? i.push("#define ESM") : (this.usePercentageCloserFiltering || this.useContactHardeningShadow) && i.push("#define DEPTHTEXTURE");
                        var r = [$i.VertexBuffer.PositionKind],
                            n = e.getMesh(),
                            o = e.getMaterial();
                        if (this.normalBias && n.isVerticesDataPresent($i.VertexBuffer.NormalKind) && (r.push($i.VertexBuffer.NormalKind), i.push("#define NORMAL"), n.nonUniformScaling && i.push("#define NONUNIFORMSCALING"), this.getLight().getTypeID() === $i.Light.LIGHTTYPEID_DIRECTIONALLIGHT && i.push("#define DIRECTIONINLIGHTDATA")), o && o.needAlphaTesting()) {
                            var s = o.getAlphaTestTexture();
                            s && (i.push("#define ALPHATEST"), n.isVerticesDataPresent($i.VertexBuffer.UVKind) && (r.push($i.VertexBuffer.UVKind), i.push("#define UV1")), n.isVerticesDataPresent($i.VertexBuffer.UV2Kind) && 1 === s.coordinatesIndex && (r.push($i.VertexBuffer.UV2Kind), i.push("#define UV2")))
                        }
                        n.useBones && n.computeBonesUsingShaders ? (r.push($i.VertexBuffer.MatricesIndicesKind), r.push($i.VertexBuffer.MatricesWeightsKind), 4 < n.numBoneInfluencers && (r.push($i.VertexBuffer.MatricesIndicesExtraKind), r.push($i.VertexBuffer.MatricesWeightsExtraKind)), i.push("#define NUM_BONE_INFLUENCERS " + n.numBoneInfluencers), i.push("#define BonesPerMesh " + (n.skeleton.bones.length + 1))) : i.push("#define NUM_BONE_INFLUENCERS 0");
                        var a = n.morphTargetManager,
                            l = 0;
                        a && 0 < a.numInfluencers && (i.push("#define MORPHTARGETS"), l = a.numInfluencers, i.push("#define NUM_MORPH_INFLUENCERS " + l), $i.MaterialHelper.PrepareAttributesForMorphTargets(r, n, {
                            NUM_MORPH_INFLUENCERS: l
                        })), t && (i.push("#define INSTANCES"), r.push("world0"), r.push("world1"), r.push("world2"), r.push("world3"));
                        var u = i.join("\n");
                        return this._cachedDefines !== u && (this._cachedDefines = u, this._effect = this._scene.getEngine().createEffect("shadowMap", r, ["world", "mBones", "viewProjection", "diffuseMatrix", "lightData", "depthValues", "biasAndScale", "morphTargetInfluences"], ["diffuseSampler"], u, void 0, void 0, void 0, {
                            maxSimultaneousMorphTargets: l
                        })), !(!this._effect.isReady() || ((this.useBlurExponentialShadowMap || this.useBlurCloseExponentialShadowMap) && (this._blurPostProcesses && this._blurPostProcesses.length || this._initializeBlurRTTAndPostProcesses()), this._kernelBlurXPostprocess && !this._kernelBlurXPostprocess.isReady() || this._kernelBlurYPostprocess && !this._kernelBlurYPostprocess.isReady() || this._boxBlurPostprocess && !this._boxBlurPostprocess.isReady()))
                    }, e.prototype.prepareDefines = function(t, i) {
                        var r = this._scene,
                            n = this._light;
                        r.shadowsEnabled && n.shadowEnabled && (t["SHADOW" + i] = !0, this.useContactHardeningShadow && (t["SHADOWPCSS" + i] = !0, this._filteringQuality === e.QUALITY_LOW ? t["SHADOWLOWQUALITY" + i] = !0 : this._filteringQuality === e.QUALITY_MEDIUM && (t["SHADOWMEDIUMQUALITY" + i] = !0)), this.usePercentageCloserFiltering ? (t["SHADOWPCF" + i] = !0, this._filteringQuality === e.QUALITY_LOW ? t["SHADOWLOWQUALITY" + i] = !0 : this._filteringQuality === e.QUALITY_MEDIUM && (t["SHADOWMEDIUMQUALITY" + i] = !0)) : this.usePoissonSampling ? t["SHADOWPOISSON" + i] = !0 : this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? t["SHADOWESM" + i] = !0 : (this.useCloseExponentialShadowMap || this.useBlurCloseExponentialShadowMap) && (t["SHADOWCLOSEESM" + i] = !0), n.needCube() && (t["SHADOWCUBE" + i] = !0))
                    }, e.prototype.bindShadowLight = function(t, i) {
                        var r = this._light,
                            n = this._scene;
                        if (n.shadowsEnabled && r.shadowEnabled) {
                            var o = n.activeCamera;
                            if (o) {
                                var s = this.getShadowMap();
                                s && (r.needCube() || i.setMatrix("lightMatrix" + t, this.getTransformMatrix()), this._filter === e.FILTER_PCF ? (i.setDepthStencilTexture("shadowSampler" + t, this.getShadowMapForRendering()), r._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), s.getSize().width, 1 / s.getSize().width, this.frustumEdgeFalloff, t)) : this._filter === e.FILTER_PCSS ? (i.setDepthStencilTexture("shadowSampler" + t, this.getShadowMapForRendering()), i.setTexture("depthSampler" + t, this.getShadowMapForRendering()), r._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), 1 / s.getSize().width, this._contactHardeningLightSizeUVRatio * s.getSize().width, this.frustumEdgeFalloff, t)) : (i.setTexture("shadowSampler" + t, this.getShadowMapForRendering()), r._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), this.blurScale / s.getSize().width, this.depthScale, this.frustumEdgeFalloff, t)), r._uniformBuffer.updateFloat2("depthValues", this.getLight().getDepthMinZ(o), this.getLight().getDepthMinZ(o) + this.getLight().getDepthMaxZ(o), t))
                            }
                        }
                    }, e.prototype.getTransformMatrix = function() {
                        var e = this._scene;
                        if (this._currentRenderID === e.getRenderId() && this._currentFaceIndexCache === this._currentFaceIndex) return this._transformMatrix;
                        this._currentRenderID = e.getRenderId(), this._currentFaceIndexCache = this._currentFaceIndex;
                        var t = this._light.position;
                        if (this._light.computeTransformedInformation() && (t = this._light.transformedPosition), $i.Vector3.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex), this._lightDirection), 1 === Math.abs($i.Vector3.Dot(this._lightDirection, $i.Vector3.Up())) && (this._lightDirection.z = 1e-13), this._light.needProjectionMatrixCompute() || !this._cachedPosition || !this._cachedDirection || !t.equals(this._cachedPosition) || !this._lightDirection.equals(this._cachedDirection)) {
                            this._cachedPosition.copyFrom(t), this._cachedDirection.copyFrom(this._lightDirection), $i.Matrix.LookAtLHToRef(t, t.add(this._lightDirection), $i.Vector3.Up(), this._viewMatrix);
                            var i = this.getShadowMap();
                            if (i) {
                                var r = i.renderList;
                                r && this._light.setShadowProjectionMatrix(this._projectionMatrix, this._viewMatrix, r)
                            }
                            this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix)
                        }
                        return this._transformMatrix
                    }, e.prototype.recreateShadowMap = function() {
                        var e = this._shadowMap;
                        if (e) {
                            var t = e.renderList;
                            this._disposeRTTandPostProcesses(), this._initializeGenerator(), this.filter = this.filter, this._applyFilterValues(), this._shadowMap.renderList = t
                        }
                    }, e.prototype._disposeBlurPostProcesses = function() {
                        this._shadowMap2 && (this._shadowMap2.dispose(), this._shadowMap2 = null), this._boxBlurPostprocess && (this._boxBlurPostprocess.dispose(), this._boxBlurPostprocess = null), this._kernelBlurXPostprocess && (this._kernelBlurXPostprocess.dispose(), this._kernelBlurXPostprocess = null), this._kernelBlurYPostprocess && (this._kernelBlurYPostprocess.dispose(), this._kernelBlurYPostprocess = null), this._blurPostProcesses = []
                    }, e.prototype._disposeRTTandPostProcesses = function() {
                        this._shadowMap && (this._shadowMap.dispose(), this._shadowMap = null), this._disposeBlurPostProcesses()
                    }, e.prototype.dispose = function() {
                        this._disposeRTTandPostProcesses(), this._light && (this._light._shadowGenerator = null, this._light._markMeshesAsLightDirty())
                    }, e.prototype.serialize = function() {
                        var e = {},
                            t = this.getShadowMap();
                        if (!t) return e;
                        if (e.lightId = this._light.id, e.mapSize = t.getRenderSize(), e.useExponentialShadowMap = this.useExponentialShadowMap, e.useBlurExponentialShadowMap = this.useBlurExponentialShadowMap, e.useCloseExponentialShadowMap = this.useBlurExponentialShadowMap, e.useBlurCloseExponentialShadowMap = this.useBlurExponentialShadowMap, e.usePoissonSampling = this.usePoissonSampling, e.forceBackFacesOnly = this.forceBackFacesOnly, e.depthScale = this.depthScale, e.darkness = this.getDarkness(), e.blurBoxOffset = this.blurBoxOffset, e.blurKernel = this.blurKernel, e.blurScale = this.blurScale, e.useKernelBlur = this.useKernelBlur, e.transparencyShadow = this._transparencyShadow, e.frustumEdgeFalloff = this.frustumEdgeFalloff, e.bias = this.bias, e.normalBias = this.normalBias, e.usePercentageCloserFiltering = this.usePercentageCloserFiltering, e.useContactHardeningShadow = this.useContactHardeningShadow, e.filteringQuality = this.filteringQuality, e.contactHardeningLightSizeUVRatio = this.contactHardeningLightSizeUVRatio, e.renderList = [], t.renderList)
                            for (var i = 0; i < t.renderList.length; i++) {
                                var r = t.renderList[i];
                                e.renderList.push(r.id)
                            }
                        return e
                    }, e.Parse = function(t, i) {
                        for (var r = i.getLightByID(t.lightId), n = new e(t.mapSize, r), o = n.getShadowMap(), s = 0; s < t.renderList.length; s++) i.getMeshesByID(t.renderList[s]).forEach(function(e) {
                            o && (o.renderList || (o.renderList = []), o.renderList.push(e))
                        });
                        return t.usePoissonSampling ? n.usePoissonSampling = !0 : t.useExponentialShadowMap ? n.useExponentialShadowMap = !0 : t.useBlurExponentialShadowMap ? n.useBlurExponentialShadowMap = !0 : t.useCloseExponentialShadowMap ? n.useCloseExponentialShadowMap = !0 : t.useBlurCloseExponentialShadowMap ? n.useBlurCloseExponentialShadowMap = !0 : t.usePercentageCloserFiltering ? n.usePercentageCloserFiltering = !0 : t.useContactHardeningShadow && (n.useContactHardeningShadow = !0), t.filteringQuality && (n.filteringQuality = t.filteringQuality), t.contactHardeningLightSizeUVRatio ? n.contactHardeningLightSizeUVRatio = t.contactHardeningLightSizeUVRatio : t.useVarianceShadowMap ? n.useExponentialShadowMap = !0 : t.useBlurVarianceShadowMap && (n.useBlurExponentialShadowMap = !0), t.depthScale && (n.depthScale = t.depthScale), t.blurScale && (n.blurScale = t.blurScale), t.blurBoxOffset && (n.blurBoxOffset = t.blurBoxOffset), t.useKernelBlur && (n.useKernelBlur = t.useKernelBlur), t.blurKernel && (n.blurKernel = t.blurKernel), void 0 !== t.bias && (n.bias = t.bias), void 0 !== t.normalBias && (n.normalBias = t.normalBias), void 0 !== t.frustumEdgeFalloff && (n.frustumEdgeFalloff = t.frustumEdgeFalloff), t.darkness && n.setDarkness(t.darkness), t.transparencyShadow && n.setTransparencyShadow(!0), n.forceBackFacesOnly = t.forceBackFacesOnly, n
                    }, e.FILTER_NONE = 0, e.FILTER_EXPONENTIALSHADOWMAP = 1, e.FILTER_POISSONSAMPLING = 2, e.FILTER_BLUREXPONENTIALSHADOWMAP = 3, e.FILTER_CLOSEEXPONENTIALSHADOWMAP = 4, e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP = 5, e.FILTER_PCF = 6, e.FILTER_PCSS = 7, e.QUALITY_HIGH = 0, e.QUALITY_MEDIUM = 1, e.QUALITY_LOW = 2, e
                }(), $i.ShadowGenerator = er,
                function(e) {
                    e.AbstractScene.AddParser(e.SceneComponentConstants.NAME_SHADOWGENERATOR, function(t, i, r, n) {
                        if (void 0 !== t.shadowGenerators && null !== t.shadowGenerators)
                            for (var o = 0, s = t.shadowGenerators.length; o < s; o++) {
                                var a = t.shadowGenerators[o];
                                e.ShadowGenerator.Parse(a, i)
                            }
                    });
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_SHADOWGENERATOR, this.scene = t
                        }
                        return t.prototype.register = function() {
                            this.scene._gatherRenderTargetsStage.registerStep(e.SceneComponentConstants.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR, this, this._gatherRenderTargets)
                        }, t.prototype.rebuild = function() {}, t.prototype.serialize = function(e) {
                            e.shadowGenerators = [];
                            for (var t = 0, i = this.scene.lights; t < i.length; t++) {
                                var r = i[t].getShadowGenerator();
                                r && e.shadowGenerators.push(r.serialize())
                            }
                        }, t.prototype.addFromContainer = function(e) {}, t.prototype.removeFromContainer = function(e) {}, t.prototype.dispose = function() {}, t.prototype._gatherRenderTargets = function(e) {
                            var t = this.scene;
                            if (this.scene.shadowsEnabled)
                                for (var i = 0; i < t.lights.length; i++) {
                                    var r = t.lights[i],
                                        n = r.getShadowGenerator();
                                    if (r.isEnabled() && r.shadowEnabled && n) {
                                        var o = n.getShadowMap(); - 1 !== t.textures.indexOf(o) && e.push(o)
                                    }
                                }
                        }, t
                    }();
                    e.ShadowGeneratorSceneComponent = t
                }($a || ($a = {})), tr = $a || ($a = {}), ir = function() {
                    function e(e, t, i) {
                        void 0 === t && (t = ""), void 0 === i && (i = "black");
                        var r = this;
                        this._renderingCanvas = e, this._loadingText = t, this._loadingDivBackgroundColor = i, this._resizeLoadingUI = function() {
                            var e = r._renderingCanvas.getBoundingClientRect(),
                                t = window.getComputedStyle(r._renderingCanvas).position;
                            r._loadingDiv && (r._loadingDiv.style.position = "fixed" === t ? "fixed" : "absolute", r._loadingDiv.style.left = e.left + "px", r._loadingDiv.style.top = e.top + "px", r._loadingDiv.style.width = e.width + "px", r._loadingDiv.style.height = e.height + "px")
                        }
                    }
                    return e.prototype.displayLoadingUI = function() {
                        if (!this._loadingDiv) {
                            this._loadingDiv = document.createElement("div"), this._loadingDiv.id = "babylonjsLoadingDiv", this._loadingDiv.style.opacity = "0", this._loadingDiv.style.transition = "opacity 1.5s ease", this._loadingDiv.style.pointerEvents = "none", this._loadingTextDiv = document.createElement("div"), this._loadingTextDiv.style.position = "absolute", this._loadingTextDiv.style.left = "0", this._loadingTextDiv.style.top = "50%", this._loadingTextDiv.style.marginTop = "80px", this._loadingTextDiv.style.width = "100%", this._loadingTextDiv.style.height = "20px", this._loadingTextDiv.style.fontFamily = "Arial", this._loadingTextDiv.style.fontSize = "14px", this._loadingTextDiv.style.color = "white", this._loadingTextDiv.style.textAlign = "center", this._loadingTextDiv.innerHTML = "Loading", this._loadingDiv.appendChild(this._loadingTextDiv), this._loadingTextDiv.innerHTML = this._loadingText;
                            var e = document.createElement("style");
                            e.type = "text/css", e.innerHTML = "@-webkit-keyframes spin1 {                    0% { -webkit-transform: rotate(0deg);}\n                    100% { -webkit-transform: rotate(360deg);}\n                }                @keyframes spin1 {                    0% { transform: rotate(0deg);}\n                    100% { transform: rotate(360deg);}\n                }", document.getElementsByTagName("head")[0].appendChild(e);
                            var t = new Image;
                            t.src = "data:image/png;base64, ", t.style.position = "absolute", t.style.left = "50%", t.style.top = "50%", t.style.marginLeft = "-60px", t.style.marginTop = "-60px", t.style.animation = "spin1 2s infinite ease-in-out", t.style.webkitAnimation = "spin1 2s infinite ease-in-out", t.style.transformOrigin = "50% 50%", t.style.webkitTransformOrigin = "50% 50%", this._loadingDiv.appendChild(t), this._resizeLoadingUI(), window.addEventListener("resize", this._resizeLoadingUI), this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor, document.body.appendChild(this._loadingDiv), this._loadingDiv.style.opacity = "1"
                        }
                    }, e.prototype.hideLoadingUI = function() {
                        var e = this;
                        this._loadingDiv && (this._loadingDiv.style.opacity = "0", this._loadingDiv.addEventListener("transitionend", function() {
                            e._loadingDiv && (document.body.removeChild(e._loadingDiv), window.removeEventListener("resize", e._resizeLoadingUI), e._loadingDiv = null)
                        }))
                    }, Object.defineProperty(e.prototype, "loadingUIText", {
                        get: function() {
                            return this._loadingText
                        },
                        set: function(e) {
                            this._loadingText = e, this._loadingTextDiv && (this._loadingTextDiv.innerHTML = this._loadingText)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "loadingUIBackgroundColor", {
                        get: function() {
                            return this._loadingDivBackgroundColor
                        },
                        set: function(e) {
                            this._loadingDivBackgroundColor = e, this._loadingDiv && (this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e
                }(), tr.DefaultLoadingScreen = ir,
                function(e) {
                    var t = function() {
                        function e(e, t, i) {
                            this.lengthComputable = e, this.loaded = t, this.total = i
                        }
                        return e.FromProgressEvent = function(t) {
                            return new e(t.lengthComputable, t.loaded, t.total)
                        }, e
                    }();
                    e.SceneLoaderProgressEvent = t;
                    var i = function() {
                        function i() {}
                        return Object.defineProperty(i, "ForceFullSceneLoadingForIncremental", {
                            get: function() {
                                return i._ForceFullSceneLoadingForIncremental
                            },
                            set: function(e) {
                                i._ForceFullSceneLoadingForIncremental = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "ShowLoadingScreen", {
                            get: function() {
                                return i._ShowLoadingScreen
                            },
                            set: function(e) {
                                i._ShowLoadingScreen = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "loggingLevel", {
                            get: function() {
                                return i._loggingLevel
                            },
                            set: function(e) {
                                i._loggingLevel = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i, "CleanBoneMatrixWeights", {
                            get: function() {
                                return i._CleanBoneMatrixWeights
                            },
                            set: function(e) {
                                i._CleanBoneMatrixWeights = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i._getDefaultPlugin = function() {
                            return i._registeredPlugins[".babylon"]
                        }, i._getPluginForExtension = function(t) {
                            return i._registeredPlugins[t] || (e.Tools.Warn("Unable to find a plugin to load " + t + " files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: http://doc.babylonjs.com/how_to/load_from_any_file_type"), i._getDefaultPlugin())
                        }, i._getPluginForDirectLoad = function(e) {
                            for (var t in i._registeredPlugins) {
                                var r = i._registeredPlugins[t].plugin;
                                if (r.canDirectLoad && r.canDirectLoad(e)) return i._registeredPlugins[t]
                            }
                            return i._getDefaultPlugin()
                        }, i._getPluginForFilename = function(e) {
                            var t = e.indexOf("?"); - 1 !== t && (e = e.substring(0, t));
                            var r = e.lastIndexOf("."),
                                n = e.substring(r, e.length).toLowerCase();
                            return i._getPluginForExtension(n)
                        }, i._getDirectLoad = function(e) {
                            return "data:" === e.substr(0, 5) ? e.substr(5) : null
                        }, i._loadData = function(r, n, o, s, a, l, u) {
                            var c, h = i._getDirectLoad(r.name),
                                d = u ? i._getPluginForExtension(u) : h ? i._getPluginForDirectLoad(r.name) : i._getPluginForFilename(r.name);
                            c = d.plugin.createPlugin ? d.plugin.createPlugin() : d.plugin;
                            var p, f = d.isBinary;
                            i.OnPluginActivatedObservable.notifyObservers(c);
                            var _ = function(e, t) {
                                    n.isDisposed ? a("Scene has been disposed") : (n.database = p, o(c, e, t))
                                },
                                m = null,
                                g = !1,
                                v = c.onDisposeObservable;
                            v && v.add(function() {
                                g = !0, m && (m.abort(), m = null), l()
                            });
                            var y = function() {
                                g || (m = e.Tools.LoadFile(r.url, _, s ? function(e) {
                                    s(t.FromProgressEvent(e))
                                } : void 0, p, f, function(e, t) {
                                    a("Failed to load scene." + (t ? " " + t.message : ""), t)
                                }))
                            };
                            if (h) return _(h), c;
                            if (-1 === r.rootUrl.indexOf("file:")) {
                                var b = n.getEngine(),
                                    x = b.enableOfflineSupport;
                                if (x) {
                                    for (var T = !1, E = 0, S = n.disableOfflineSupportExceptionRules; E < S.length; E++)
                                        if (S[E].test(r.url)) {
                                            T = !0;
                                            break
                                        }
                                    x = !T
                                }
                                x ? p = new e.Database(r.url, y, b.disableManifestCheck) : y()
                            } else {
                                var P = e.FilesInput.FilesToLoad[r.name.toLowerCase()];
                                P ? m = e.Tools.ReadFile(P, _, s, f) : a("Unable to find file named " + r.name)
                            }
                            return c
                        }, i._getFileInfo = function(t, i) {
                            var r, n;
                            if (i) {
                                if ("/" === i.substr(0, 1)) return e.Tools.Error("Wrong sceneFilename parameter"), null;
                                r = t + i, n = i
                            } else r = t, n = e.Tools.GetFilename(t), t = e.Tools.GetFolderPath(t);
                            return {
                                url: r,
                                rootUrl: t,
                                name: n
                            }
                        }, i.GetPluginForExtension = function(e) {
                            return i._getPluginForExtension(e).plugin
                        }, i.IsPluginForExtensionAvailable = function(e) {
                            return !!i._registeredPlugins[e]
                        }, i.RegisterPlugin = function(e) {
                            if ("string" == typeof e.extensions) {
                                var t = e.extensions;
                                i._registeredPlugins[t.toLowerCase()] = {
                                    plugin: e,
                                    isBinary: !1
                                }
                            } else {
                                var r = e.extensions;
                                Object.keys(r).forEach(function(t) {
                                    i._registeredPlugins[t.toLowerCase()] = {
                                        plugin: e,
                                        isBinary: r[t].isBinary
                                    }
                                })
                            }
                        }, i.ImportMesh = function(t, r, n, o, s, a, l, u) {
                            if (void 0 === n && (n = ""), void 0 === o && (o = e.Engine.LastCreatedScene), void 0 === s && (s = null), void 0 === a && (a = null), void 0 === l && (l = null), void 0 === u && (u = null), !o) return e.Tools.Error("No scene available to import mesh to"), null;
                            var c = i._getFileInfo(r, n);
                            if (!c) return null;
                            var h = {};
                            o._addPendingData(h);
                            var d = function() {
                                    o._removePendingData(h)
                                },
                                p = function(t, i) {
                                    var r = "Unable to import meshes from " + c.url + ": " + t;
                                    l ? l(o, r, i) : e.Tools.Error(r), d()
                                },
                                f = a ? function(e) {
                                    try {
                                        a(e)
                                    } catch (e) {
                                        p("Error in onProgress callback", e)
                                    }
                                } : void 0,
                                _ = function(e, t, i, r) {
                                    if (o.importedMeshesFiles.push(c.url), s) try {
                                        s(e, t, i, r)
                                    } catch (e) {
                                        p("Error in onSuccess callback", e)
                                    }
                                    o._removePendingData(h)
                                };
                            return i._loadData(c, o, function(e, i, r) {
                                if (e.rewriteRootURL && (c.rootUrl = e.rewriteRootURL(c.rootUrl, r)), e.importMesh) {
                                    var n = e,
                                        s = new Array,
                                        a = new Array,
                                        l = new Array;
                                    if (!n.importMesh(t, o, i, c.rootUrl, s, a, l, p)) return;
                                    o.loadingPluginName = e.name, _(s, a, l, [])
                                } else e.importMeshAsync(t, o, i, c.rootUrl, f, c.name).then(function(t) {
                                    o.loadingPluginName = e.name, _(t.meshes, t.particleSystems, t.skeletons, t.animationGroups)
                                }).catch(function(e) {
                                    p(e.message, e)
                                })
                            }, f, p, d, u)
                        }, i.ImportMeshAsync = function(t, r, n, o, s, a) {
                            return void 0 === n && (n = ""), void 0 === o && (o = e.Engine.LastCreatedScene), void 0 === s && (s = null), void 0 === a && (a = null), new Promise(function(e, l) {
                                i.ImportMesh(t, r, n, o, function(t, i, r, n) {
                                    e({
                                        meshes: t,
                                        particleSystems: i,
                                        skeletons: r,
                                        animationGroups: n
                                    })
                                }, s, function(e, t, i) {
                                    l(i || new Error(t))
                                }, a)
                            })
                        }, i.Load = function(t, r, n, o, s, a, l) {
                            return void 0 === o && (o = null), void 0 === s && (s = null), void 0 === a && (a = null), void 0 === l && (l = null), i.Append(t, r, new e.Scene(n), o, s, a, l)
                        }, i.LoadAsync = function(e, t, r, n, o) {
                            return void 0 === n && (n = null), void 0 === o && (o = null), new Promise(function(s, a) {
                                i.Load(e, t, r, function(e) {
                                    s(e)
                                }, n, function(e, t, i) {
                                    a(i || new Error(t))
                                }, o)
                            })
                        }, i.Append = function(t, r, n, o, s, a, l) {
                            if (void 0 === r && (r = ""), void 0 === n && (n = e.Engine.LastCreatedScene), void 0 === o && (o = null), void 0 === s && (s = null), void 0 === a && (a = null), void 0 === l && (l = null), !n) return e.Tools.Error("No scene available to append to"), null;
                            var u = i._getFileInfo(t, r);
                            if (!u) return null;
                            i.ShowLoadingScreen && n.getEngine().displayLoadingUI();
                            var c = {};
                            n._addPendingData(c);
                            var h = function() {
                                    n._removePendingData(c), n.getEngine().hideLoadingUI()
                                },
                                d = function(t, i) {
                                    var r = "Unable to load from " + u.url + (t ? ": " + t : "");
                                    a ? a(n, r, i) : e.Tools.Error(r), h()
                                },
                                p = s ? function(e) {
                                    try {
                                        s(e)
                                    } catch (e) {
                                        d("Error in onProgress callback", e)
                                    }
                                } : void 0,
                                f = function() {
                                    if (o) try {
                                        o(n)
                                    } catch (e) {
                                        d("Error in onSuccess callback", e)
                                    }
                                    n._removePendingData(c)
                                };
                            return i._loadData(u, n, function(e, t, r) {
                                if (e.load) {
                                    if (!e.load(n, t, u.rootUrl, d)) return;
                                    n.loadingPluginName = e.name, f()
                                } else e.loadAsync(n, t, u.rootUrl, p, u.name).then(function() {
                                    n.loadingPluginName = e.name, f()
                                }).catch(function(e) {
                                    d(e.message, e)
                                });
                                i.ShowLoadingScreen && n.executeWhenReady(function() {
                                    n.getEngine().hideLoadingUI()
                                })
                            }, p, d, h, l)
                        }, i.AppendAsync = function(t, r, n, o, s) {
                            return void 0 === r && (r = ""), void 0 === n && (n = e.Engine.LastCreatedScene), void 0 === o && (o = null), void 0 === s && (s = null), new Promise(function(e, a) {
                                i.Append(t, r, n, function(t) {
                                    e(t)
                                }, o, function(e, t, i) {
                                    a(i || new Error(t))
                                }, s)
                            })
                        }, i.LoadAssetContainer = function(t, r, n, o, s, a, l) {
                            if (void 0 === r && (r = ""), void 0 === n && (n = e.Engine.LastCreatedScene), void 0 === o && (o = null), void 0 === s && (s = null), void 0 === a && (a = null), void 0 === l && (l = null), !n) return e.Tools.Error("No scene available to load asset container to"), null;
                            var u = i._getFileInfo(t, r);
                            if (!u) return null;
                            var c = {};
                            n._addPendingData(c);
                            var h = function() {
                                    n._removePendingData(c)
                                },
                                d = function(t, i) {
                                    var r = "Unable to load assets from " + u.url + (t ? ": " + t : "");
                                    a ? a(n, r, i) : e.Tools.Error(r), h()
                                },
                                p = s ? function(e) {
                                    try {
                                        s(e)
                                    } catch (e) {
                                        d("Error in onProgress callback", e)
                                    }
                                } : void 0,
                                f = function(e) {
                                    if (o) try {
                                        o(e)
                                    } catch (e) {
                                        d("Error in onSuccess callback", e)
                                    }
                                    n._removePendingData(c)
                                };
                            return i._loadData(u, n, function(e, t, r) {
                                if (e.loadAssetContainer) {
                                    var o = e.loadAssetContainer(n, t, u.rootUrl, d);
                                    if (!o) return;
                                    n.loadingPluginName = e.name, f(o)
                                } else e.loadAssetContainerAsync ? e.loadAssetContainerAsync(n, t, u.rootUrl, p, u.name).then(function(t) {
                                    n.loadingPluginName = e.name, f(t)
                                }).catch(function(e) {
                                    d(e.message, e)
                                }) : d("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.");
                                i.ShowLoadingScreen && n.executeWhenReady(function() {
                                    n.getEngine().hideLoadingUI()
                                })
                            }, p, d, h, l)
                        }, i.LoadAssetContainerAsync = function(t, r, n, o, s) {
                            return void 0 === r && (r = ""), void 0 === n && (n = e.Engine.LastCreatedScene), void 0 === o && (o = null), void 0 === s && (s = null), new Promise(function(e, a) {
                                i.LoadAssetContainer(t, r, n, function(t) {
                                    e(t)
                                }, o, function(e, t, i) {
                                    a(i || new Error(t))
                                }, s)
                            })
                        }, i._ForceFullSceneLoadingForIncremental = !1, i._ShowLoadingScreen = !0, i._CleanBoneMatrixWeights = !1, i.NO_LOGGING = 0, i.MINIMAL_LOGGING = 1, i.SUMMARY_LOGGING = 2, i.DETAILED_LOGGING = 3, i._loggingLevel = i.NO_LOGGING, i.OnPluginActivatedObservable = new e.Observable, i._registeredPlugins = {}, i
                    }();
                    e.SceneLoader = i
                }($a || ($a = {})), rr = $a || ($a = {}), nr = function(e, t, i, r) {
                    for (var n = 0, o = t.materials.length; n < o; n++) {
                        var s = t.materials[n];
                        if (s.id === e) return rr.Material.Parse(s, i, r)
                    }
                    return null
                }, or = function(e, t, i) {
                    for (var r in t)
                        if (e.name === t[r]) return i.push(e.id), !0;
                    return !(!e.parentId || -1 === i.indexOf(e.parentId) || (i.push(e.id), 0))
                }, sr = function(e, t) {
                    return e + " of " + (t ? t.file + " from " + t.name + " version: " + t.version + ", exporter version: " + t.exporter_version : "unknown")
                }, ar = function(e, t, i, r, n) {
                    void 0 === n && (n = !1);
                    var o = new rr.AssetContainer(e),
                        s = "importScene has failed JSON parse";
                    try {
                        var a = JSON.parse(t);
                        s = "";
                        var l, u, c = rr.SceneLoader.loggingLevel === rr.SceneLoader.DETAILED_LOGGING;
                        if (void 0 !== a.lights && null !== a.lights)
                            for (l = 0, u = a.lights.length; l < u; l++) {
                                var h = a.lights[l],
                                    d = rr.Light.Parse(h, e);
                                d && (o.lights.push(d), s += 0 === l ? "\n\tLights:" : "", s += "\n\t\t" + d.toString(c))
                            }
                        if (void 0 !== a.animations && null !== a.animations)
                            for (l = 0, u = a.animations.length; l < u; l++) {
                                var p = a.animations[l],
                                    f = rr.Animation.Parse(p);
                                e.animations.push(f), o.animations.push(f), s += 0 === l ? "\n\tAnimations:" : "", s += "\n\t\t" + f.toString(c)
                            }
                        if (void 0 !== a.materials && null !== a.materials)
                            for (l = 0, u = a.materials.length; l < u; l++) {
                                var _ = a.materials[l],
                                    m = rr.Material.Parse(_, e, i);
                                o.materials.push(m), s += 0 === l ? "\n\tMaterials:" : "", s += "\n\t\t" + m.toString(c)
                            }
                        if (void 0 !== a.multiMaterials && null !== a.multiMaterials)
                            for (l = 0, u = a.multiMaterials.length; l < u; l++) {
                                var g = a.multiMaterials[l],
                                    v = rr.Material.ParseMultiMaterial(g, e);
                                o.multiMaterials.push(v), s += 0 === l ? "\n\tMultiMaterials:" : "", s += "\n\t\t" + v.toString(c)
                            }
                        if (void 0 !== a.morphTargetManagers && null !== a.morphTargetManagers)
                            for (var y = 0, b = a.morphTargetManagers; y < b.length; y++) {
                                var x = b[y];
                                o.morphTargetManagers.push(rr.MorphTargetManager.Parse(x, e))
                            }
                        if (void 0 !== a.skeletons && null !== a.skeletons)
                            for (l = 0, u = a.skeletons.length; l < u; l++) {
                                var T = a.skeletons[l],
                                    E = rr.Skeleton.Parse(T, e);
                                o.skeletons.push(E), s += 0 === l ? "\n\tSkeletons:" : "", s += "\n\t\t" + E.toString(c)
                            }
                        var S = a.geometries;
                        if (null != S) {
                            var P = new Array,
                                A = S.boxes;
                            if (null != A)
                                for (l = 0, u = A.length; l < u; l++) {
                                    var C = A[l];
                                    P.push(rr.BoxGeometry.Parse(C, e))
                                }
                            var M = S.spheres;
                            if (null != M)
                                for (l = 0, u = M.length; l < u; l++) {
                                    var R = M[l];
                                    P.push(rr.SphereGeometry.Parse(R, e))
                                }
                            var O = S.cylinders;
                            if (null != O)
                                for (l = 0, u = O.length; l < u; l++) {
                                    var w = O[l];
                                    P.push(rr.CylinderGeometry.Parse(w, e))
                                }
                            var I = S.toruses;
                            if (null != I)
                                for (l = 0,
                                    u = I.length; l < u; l++) {
                                    var D = I[l];
                                    P.push(rr.TorusGeometry.Parse(D, e))
                                }
                            var L = S.grounds;
                            if (null != L)
                                for (l = 0, u = L.length; l < u; l++) {
                                    var B = L[l];
                                    P.push(rr.GroundGeometry.Parse(B, e))
                                }
                            var F = S.planes;
                            if (null != F)
                                for (l = 0, u = F.length; l < u; l++) {
                                    var N = F[l];
                                    P.push(rr.PlaneGeometry.Parse(N, e))
                                }
                            var V = S.torusKnots;
                            if (null != V)
                                for (l = 0, u = V.length; l < u; l++) {
                                    var k = V[l];
                                    P.push(rr.TorusKnotGeometry.Parse(k, e))
                                }
                            var U = S.vertexData;
                            if (null != U)
                                for (l = 0, u = U.length; l < u; l++) {
                                    var G = U[l];
                                    P.push(rr.Geometry.Parse(G, e, i))
                                }
                            P.forEach(function(e) {
                                e && o.geometries.push(e)
                            })
                        }
                        if (void 0 !== a.transformNodes && null !== a.transformNodes)
                            for (l = 0, u = a.transformNodes.length; l < u; l++) {
                                var z = a.transformNodes[l],
                                    j = rr.TransformNode.Parse(z, e, i);
                                o.transformNodes.push(j)
                            }
                        if (void 0 !== a.meshes && null !== a.meshes)
                            for (l = 0, u = a.meshes.length; l < u; l++) {
                                var H = a.meshes[l],
                                    W = rr.Mesh.Parse(H, e, i);
                                o.meshes.push(W), s += 0 === l ? "\n\tMeshes:" : "", s += "\n\t\t" + W.toString(c)
                            }
                        if (void 0 !== a.cameras && null !== a.cameras)
                            for (l = 0, u = a.cameras.length; l < u; l++) {
                                var X = a.cameras[l],
                                    Y = rr.Camera.Parse(X, e);
                                o.cameras.push(Y), s += 0 === l ? "\n\tCameras:" : "", s += "\n\t\t" + Y.toString(c)
                            }
                        if (void 0 !== a.animationGroups && null !== a.animationGroups)
                            for (l = 0, u = a.animationGroups.length; l < u; l++) {
                                var q = a.animationGroups[l],
                                    K = rr.AnimationGroup.Parse(q, e);
                                o.animationGroups.push(K), s += 0 === l ? "\n\tAnimationGroups:" : "", s += "\n\t\t" + K.toString(c)
                            }
                        for (l = 0, u = e.cameras.length; l < u; l++)(Y = e.cameras[l])._waitingParentId && (Y.parent = e.getLastEntryByID(Y._waitingParentId), Y._waitingParentId = null);
                        for (l = 0, u = e.lights.length; l < u; l++) {
                            var Q = e.lights[l];
                            Q && Q._waitingParentId && (Q.parent = e.getLastEntryByID(Q._waitingParentId), Q._waitingParentId = null)
                        }
                        for (l = 0, u = e.transformNodes.length; l < u; l++) {
                            var Z = e.transformNodes[l];
                            Z._waitingParentId && (Z.parent = e.getLastEntryByID(Z._waitingParentId), Z._waitingParentId = null)
                        }
                        for (l = 0, u = e.meshes.length; l < u; l++)(W = e.meshes[l])._waitingParentId && (W.parent = e.getLastEntryByID(W._waitingParentId), W._waitingParentId = null);
                        for (l = 0, u = e.meshes.length; l < u; l++) {
                            var J = e.meshes[l];
                            J._waitingFreezeWorldMatrix ? (J.freezeWorldMatrix(), J._waitingFreezeWorldMatrix = null) : J.computeWorldMatrix(!0)
                        }
                        for (l = 0, u = e.lights.length; l < u; l++) {
                            var $ = e.lights[l];
                            if (0 < $._excludedMeshesIds.length) {
                                for (var ee = 0; ee < $._excludedMeshesIds.length; ee++) {
                                    var te = e.getMeshByID($._excludedMeshesIds[ee]);
                                    te && $.excludedMeshes.push(te)
                                }
                                $._excludedMeshesIds = []
                            }
                            if (0 < $._includedOnlyMeshesIds.length) {
                                for (var ie = 0; ie < $._includedOnlyMeshesIds.length; ie++) {
                                    var re = e.getMeshByID($._includedOnlyMeshesIds[ie]);
                                    re && $.includedOnlyMeshes.push(re)
                                }
                                $._includedOnlyMeshesIds = []
                            }
                        }
                        for (rr.AbstractScene.Parse(a, e, o, i), l = 0, u = e.meshes.length; l < u; l++)(W = e.meshes[l])._waitingActions && (rr.ActionManager.Parse(W._waitingActions, W, e), W._waitingActions = null);
                        void 0 !== a.actions && null !== a.actions && rr.ActionManager.Parse(a.actions, null, e), n || o.removeAllFromScene()
                    } catch (e) {
                        var ne = sr("loadAssets", a ? a.producer : "Unknown") + s;
                        if (!r) throw rr.Tools.Log(ne), e;
                        r(ne, e)
                    } finally {
                        null !== s && rr.SceneLoader.loggingLevel !== rr.SceneLoader.NO_LOGGING && rr.Tools.Log(sr("loadAssets", a ? a.producer : "Unknown") + (rr.SceneLoader.loggingLevel !== rr.SceneLoader.MINIMAL_LOGGING ? s : ""))
                    }
                    return o
                }, rr.SceneLoader.RegisterPlugin({
                    name: "babylon.js",
                    extensions: ".babylon",
                    canDirectLoad: function(e) {
                        return -1 !== e.indexOf("babylon")
                    },
                    importMesh: function(e, t, i, r, n, o, s, a) {
                        var l = "importMesh has failed JSON parse";
                        try {
                            var u = JSON.parse(i);
                            l = "";
                            var c = rr.SceneLoader.loggingLevel === rr.SceneLoader.DETAILED_LOGGING;
                            e ? Array.isArray(e) || (e = [e]) : e = null;
                            var h = new Array;
                            if (void 0 !== u.meshes && null !== u.meshes) {
                                var d, p, f, _ = [],
                                    m = [];
                                for (d = 0, p = u.meshes.length; d < p; d++) {
                                    var g = u.meshes[d];
                                    if (null === e || or(g, e, h)) {
                                        if (null !== e && delete e[e.indexOf(g.name)], void 0 !== g.geometryId && null !== g.geometryId && void 0 !== u.geometries && null !== u.geometries) {
                                            var v = !1;
                                            ["boxes", "spheres", "cylinders", "toruses", "grounds", "planes", "torusKnots", "vertexData"].forEach(function(e) {
                                                !0 !== v && u.geometries[e] && Array.isArray(u.geometries[e]) && u.geometries[e].forEach(function(i) {
                                                    if (i.id === g.geometryId) {
                                                        switch (e) {
                                                            case "boxes":
                                                                rr.BoxGeometry.Parse(i, t);
                                                                break;
                                                            case "spheres":
                                                                rr.SphereGeometry.Parse(i, t);
                                                                break;
                                                            case "cylinders":
                                                                rr.CylinderGeometry.Parse(i, t);
                                                                break;
                                                            case "toruses":
                                                                rr.TorusGeometry.Parse(i, t);
                                                                break;
                                                            case "grounds":
                                                                rr.GroundGeometry.Parse(i, t);
                                                                break;
                                                            case "planes":
                                                                rr.PlaneGeometry.Parse(i, t);
                                                                break;
                                                            case "torusKnots":
                                                                rr.TorusKnotGeometry.Parse(i, t);
                                                                break;
                                                            case "vertexData":
                                                                rr.Geometry.Parse(i, t, r)
                                                        }
                                                        v = !0
                                                    }
                                                })
                                            }), !1 === v && rr.Tools.Warn("Geometry not found for mesh " + g.id)
                                        }
                                        if (g.materialId) {
                                            var y = -1 !== m.indexOf(g.materialId);
                                            if (!1 === y && void 0 !== u.multiMaterials && null !== u.multiMaterials)
                                                for (var b = 0, x = u.multiMaterials.length; b < x; b++) {
                                                    var T = u.multiMaterials[b];
                                                    if (T.id === g.materialId) {
                                                        for (var E = 0, S = T.materials.length; E < S; E++) {
                                                            var P, A = T.materials[E];
                                                            m.push(A), (P = nr(A, u, t, r)) && (l += "\n\tMaterial " + P.toString(c))
                                                        }
                                                        m.push(T.id);
                                                        var C = rr.Material.ParseMultiMaterial(T, t);
                                                        C && (y = !0, l += "\n\tMulti-Material " + C.toString(c));
                                                        break
                                                    }
                                                }!1 === y && (m.push(g.materialId), (P = nr(g.materialId, u, t, r)) ? l += "\n\tMaterial " + P.toString(c) : rr.Tools.Warn("Material not found for mesh " + g.id))
                                        }
                                        if (-1 < g.skeletonId && void 0 !== u.skeletons && null !== u.skeletons && 0 == -1 < _.indexOf(g.skeletonId))
                                            for (var M = 0, R = u.skeletons.length; M < R; M++) {
                                                var O = u.skeletons[M];
                                                if (O.id === g.skeletonId) {
                                                    var w = rr.Skeleton.Parse(O, t);
                                                    s.push(w), _.push(O.id), l += "\n\tSkeleton " + w.toString(c)
                                                }
                                            }
                                        if (void 0 !== u.morphTargetManagers && null !== u.morphTargetManagers)
                                            for (var I = 0, D = u.morphTargetManagers; I < D.length; I++) {
                                                var L = D[I];
                                                rr.MorphTargetManager.Parse(L, t)
                                            }
                                        var B = rr.Mesh.Parse(g, t, r);
                                        n.push(B), l += "\n\tMesh " + B.toString(c)
                                    }
                                }
                                for (d = 0, p = t.meshes.length; d < p; d++)(f = t.meshes[d])._waitingParentId && (f.parent = t.getLastEntryByID(f._waitingParentId), f._waitingParentId = null);
                                for (d = 0, p = t.meshes.length; d < p; d++)(f = t.meshes[d])._waitingFreezeWorldMatrix ? (f.freezeWorldMatrix(), f._waitingFreezeWorldMatrix = null) : f.computeWorldMatrix(!0)
                            }
                            if (void 0 !== u.particleSystems && null !== u.particleSystems) {
                                var F = rr.AbstractScene.GetIndividualParser(rr.SceneComponentConstants.NAME_PARTICLESYSTEM);
                                if (F)
                                    for (d = 0, p = u.particleSystems.length; d < p; d++) {
                                        var N = u.particleSystems[d]; - 1 !== h.indexOf(N.emitterId) && o.push(F(N, t, r))
                                    }
                            }
                            return !0
                        } catch (e) {
                            var V = sr("importMesh", u ? u.producer : "Unknown") + l;
                            if (!a) throw rr.Tools.Log(V), e;
                            a(V, e)
                        } finally {
                            null !== l && rr.SceneLoader.loggingLevel !== rr.SceneLoader.NO_LOGGING && rr.Tools.Log(sr("importMesh", u ? u.producer : "Unknown") + (rr.SceneLoader.loggingLevel !== rr.SceneLoader.MINIMAL_LOGGING ? l : ""))
                        }
                        return !1
                    },
                    load: function(e, t, i, r) {
                        var n = "importScene has failed JSON parse";
                        try {
                            var o = JSON.parse(t);
                            if (n = "", void 0 !== o.useDelayedTextureLoading && null !== o.useDelayedTextureLoading && (e.useDelayedTextureLoading = o.useDelayedTextureLoading && !rr.SceneLoader.ForceFullSceneLoadingForIncremental), void 0 !== o.autoClear && null !== o.autoClear && (e.autoClear = o.autoClear), void 0 !== o.clearColor && null !== o.clearColor && (e.clearColor = rr.Color4.FromArray(o.clearColor)), void 0 !== o.ambientColor && null !== o.ambientColor && (e.ambientColor = rr.Color3.FromArray(o.ambientColor)), void 0 !== o.gravity && null !== o.gravity && (e.gravity = rr.Vector3.FromArray(o.gravity)), o.fogMode && 0 !== o.fogMode) switch (e.fogMode = o.fogMode, e.fogColor = rr.Color3.FromArray(o.fogColor), e.fogStart = o.fogStart, e.fogEnd = o.fogEnd, e.fogDensity = o.fogDensity, n += "\tFog mode for scene:  ", e.fogMode) {
                                case 1:
                                    n += "exp\n";
                                    break;
                                case 2:
                                    n += "exp2\n";
                                    break;
                                case 3:
                                    n += "linear\n"
                            }
                            if (o.physicsEnabled) {
                                var s;
                                "cannon" === o.physicsEngine ? s = new rr.CannonJSPlugin : "oimo" === o.physicsEngine && (s = new rr.OimoJSPlugin), n = "\tPhysics engine " + (o.physicsEngine ? o.physicsEngine : "oimo") + " enabled\n";
                                var a = o.physicsGravity ? rr.Vector3.FromArray(o.physicsGravity) : null;
                                e.enablePhysics(a, s)
                            }
                            if (void 0 !== o.metadata && null !== o.metadata && (e.metadata = o.metadata), void 0 !== o.collisionsEnabled && null !== o.collisionsEnabled && (e.collisionsEnabled = o.collisionsEnabled), e.workerCollisions = !!o.workerCollisions, !ar(e, t, i, r, !0)) return !1;
                            if (o.autoAnimate && e.beginAnimation(e, o.autoAnimateFrom, o.autoAnimateTo, o.autoAnimateLoop, o.autoAnimateSpeed || 1), void 0 !== o.activeCameraID && null !== o.activeCameraID && e.setActiveCameraByID(o.activeCameraID), void 0 !== o.environmentTexture && null !== o.environmentTexture) {
                                if (o.environmentTextureType && "BABYLON.HDRCubeTexture" === o.environmentTextureType) {
                                    var l = o.environmentTextureSize ? o.environmentTextureSize : 128,
                                        u = new rr.HDRCubeTexture(i + o.environmentTexture, e, l);
                                    o.environmentTextureRotationY && (u.rotationY = o.environmentTextureRotationY), e.environmentTexture = u
                                } else {
                                    var c = rr.CubeTexture.CreateFromPrefilteredData(i + o.environmentTexture, e);
                                    o.environmentTextureRotationY && (c.rotationY = o.environmentTextureRotationY), e.environmentTexture = c
                                }
                                if (!0 === o.createDefaultSkybox) {
                                    var h = void 0 !== e.activeCamera && null !== e.activeCamera ? (e.activeCamera.maxZ - e.activeCamera.minZ) / 2 : 1e3,
                                        d = o.skyboxBlurLevel || 0;
                                    e.createDefaultSkybox(void 0, !0, h, d)
                                }
                            }
                            return !0
                        } catch (e) {
                            var p = sr("importScene", o ? o.producer : "Unknown") + n;
                            if (!r) throw rr.Tools.Log(p), e;
                            r(p, e)
                        } finally {
                            null !== n && rr.SceneLoader.loggingLevel !== rr.SceneLoader.NO_LOGGING && rr.Tools.Log(sr("importScene", o ? o.producer : "Unknown") + (rr.SceneLoader.loggingLevel !== rr.SceneLoader.MINIMAL_LOGGING ? n : ""))
                        }
                        return !1
                    },
                    loadAssetContainer: function(e, t, i, r) {
                        return ar(e, t, i, r)
                    }
                }), lr = $a || ($a = {}), ur = function() {
                    function e(e, t, i, r, n, o, s, a, l) {
                        this.onProcessFileCallback = function() {
                            return !0
                        }, this._engine = e, this._currentScene = t, this._sceneLoadedCallback = i, this._progressCallback = r, this._additionalRenderLoopLogicCallback = n, this._textureLoadingCallback = o, this._startingProcessingFilesCallback = s, this._onReloadCallback = a, this._errorCallback = l
                    }
                    return e.prototype.monitorElementForDragNDrop = function(e) {
                        var t = this;
                        e && (this._elementToMonitor = e, this._dragEnterHandler = function(e) {
                            t.drag(e)
                        }, this._dragOverHandler = function(e) {
                            t.drag(e)
                        }, this._dropHandler = function(e) {
                            t.drop(e)
                        }, this._elementToMonitor.addEventListener("dragenter", this._dragEnterHandler, !1), this._elementToMonitor.addEventListener("dragover", this._dragOverHandler, !1), this._elementToMonitor.addEventListener("drop", this._dropHandler, !1))
                    }, e.prototype.dispose = function() {
                        this._elementToMonitor && (this._elementToMonitor.removeEventListener("dragenter", this._dragEnterHandler), this._elementToMonitor.removeEventListener("dragover", this._dragOverHandler), this._elementToMonitor.removeEventListener("drop", this._dropHandler))
                    }, e.prototype.renderFunction = function() {
                        if (this._additionalRenderLoopLogicCallback && this._additionalRenderLoopLogicCallback(), this._currentScene) {
                            if (this._textureLoadingCallback) {
                                var e = this._currentScene.getWaitingItemsCount();
                                0 < e && this._textureLoadingCallback(e)
                            }
                            this._currentScene.render()
                        }
                    }, e.prototype.drag = function(e) {
                        e.stopPropagation(), e.preventDefault()
                    }, e.prototype.drop = function(e) {
                        e.stopPropagation(), e.preventDefault(), this.loadFiles(e)
                    }, e.prototype._traverseFolder = function(e, t, i, r) {
                        var n = this,
                            o = e.createReader(),
                            s = e.fullPath.replace(/^\//, "").replace(/(.+?)\/?$/, "$1/");
                        o.readEntries(function(e) {
                            i.count += e.length;
                            for (var o = 0, a = e; o < a.length; o++) {
                                var l = a[o];
                                l.isFile ? l.file(function(e) {
                                    e.correctName = s + e.name, t.push(e), 0 == --i.count && r()
                                }) : l.isDirectory && n._traverseFolder(l, t, i, r)
                            }--i.count && r()
                        })
                    }, e.prototype._processFiles = function(t) {
                        for (var i = 0; i < t.length; i++) {
                            var r = t[i].correctName.toLowerCase(),
                                n = r.split(".").pop();
                            this.onProcessFileCallback(t[i], r, n) && ("babylon" !== n && "stl" !== n && "obj" !== n && "gltf" !== n && "glb" !== n || -1 !== r.indexOf(".binary.babylon") || -1 !== r.indexOf(".incremental.babylon") || (this._sceneFileToLoad = t[i]), e.FilesToLoad[r] = t[i])
                        }
                    }, e.prototype.loadFiles = function(e) {
                        var t = this;
                        if (e && e.dataTransfer && e.dataTransfer.files && (this._filesToLoad = e.dataTransfer.files), e && e.target && e.target.files && (this._filesToLoad = e.target.files), this._filesToLoad && 0 !== this._filesToLoad.length && (this._startingProcessingFilesCallback && this._startingProcessingFilesCallback(this._filesToLoad), this._filesToLoad && 0 < this._filesToLoad.length)) {
                            for (var i = new Array, r = [], n = e.dataTransfer ? e.dataTransfer.items : null, o = 0; o < this._filesToLoad.length; o++) {
                                var s = this._filesToLoad[o],
                                    a = s.name.toLowerCase(),
                                    l = void 0;
                                if (s.correctName = a, n) {
                                    var u = n[o];
                                    u.getAsEntry ? l = u.getAsEntry() : u.webkitGetAsEntry && (l = u.webkitGetAsEntry())
                                }
                                l && l.isDirectory ? r.push(l) : i.push(s)
                            }
                            if (0 === r.length) this._processFiles(i), this._processReload();
                            else
                                for (var c = {
                                        count: r.length
                                    }, h = 0, d = r; h < d.length; h++) {
                                    var p = d[h];
                                    this._traverseFolder(p, i, c, function() {
                                        t._processFiles(i), 0 === c.count && t._processReload()
                                    })
                                }
                        }
                    }, e.prototype._processReload = function() {
                        this._onReloadCallback ? this._onReloadCallback(this._sceneFileToLoad) : this.reload()
                    }, e.prototype.reload = function() {
                        var e = this;
                        this._sceneFileToLoad ? (this._currentScene && (0 < lr.Tools.errorsCount && lr.Tools.ClearLogCache(), this._engine.stopRenderLoop()), lr.SceneLoader.LoadAsync("file:", this._sceneFileToLoad.name, this._engine, function(t) {
                            e._progressCallback && e._progressCallback(t)
                        }).then(function(t) {
                            e._currentScene && e._currentScene.dispose(), e._currentScene = t, e._sceneLoadedCallback && e._sceneLoadedCallback(e._sceneFileToLoad, e._currentScene), e._currentScene.executeWhenReady(function() {
                                e._engine.runRenderLoop(function() {
                                    e.renderFunction()
                                })
                            })
                        }).catch(function(t) {
                            e._errorCallback && e._errorCallback(e._sceneFileToLoad, e._currentScene, t.message)
                        })) : lr.Tools.Error("Please provide a valid .babylon file.")
                    }, e.FilesToLoad = {}, e
                }(), lr.FilesInput = ur, cr = $a || ($a = {}), hr = function() {
                    function e() {}
                    return e.EnableFor = function(t) {
                        t._tags = t._tags || {}, t.hasTags = function() {
                            return e.HasTags(t)
                        }, t.addTags = function(i) {
                            return e.AddTagsTo(t, i)
                        }, t.removeTags = function(i) {
                            return e.RemoveTagsFrom(t, i)
                        }, t.matchesTagsQuery = function(i) {
                            return e.MatchesQuery(t, i)
                        }
                    }, e.DisableFor = function(e) {
                        delete e._tags, delete e.hasTags, delete e.addTags, delete e.removeTags, delete e.matchesTagsQuery
                    }, e.HasTags = function(e) {
                        return !!e._tags && !cr.Tools.IsEmpty(e._tags)
                    }, e.GetTags = function(e, t) {
                        if (void 0 === t && (t = !0), !e._tags) return null;
                        if (t) {
                            var i = [];
                            for (var r in e._tags) e._tags.hasOwnProperty(r) && !0 === e._tags[r] && i.push(r);
                            return i.join(" ")
                        }
                        return e._tags
                    }, e.AddTagsTo = function(t, i) {
                        i && "string" == typeof i && i.split(" ").forEach(function(i, r, n) {
                            e._AddTagTo(t, i)
                        })
                    }, e._AddTagTo = function(t, i) {
                        "" !== (i = i.trim()) && "true" !== i && "false" !== i && (i.match(/[\s]/) || i.match(/^([!]|([|]|[&]){2})/) || (e.EnableFor(t), t._tags[i] = !0))
                    }, e.RemoveTagsFrom = function(t, i) {
                        if (e.HasTags(t)) {
                            var r = i.split(" ");
                            for (var n in r) e._RemoveTagFrom(t, r[n])
                        }
                    }, e._RemoveTagFrom = function(e, t) {
                        delete e._tags[t]
                    }, e.MatchesQuery = function(t, i) {
                        return void 0 === i || ("" === i ? e.HasTags(t) : cr.AndOrNotEvaluator.Eval(i, function(i) {
                            return e.HasTags(t) && t._tags[i]
                        }))
                    }, e
                }(), cr.Tags = hr, dr = $a || ($a = {}), pr = function() {
                    function e() {}
                    return e.Eval = function(t, i) {
                        return "true" === (t = t.match(/\([^\(\)]*\)/g) ? t.replace(/\([^\(\)]*\)/g, function(t) {
                            return t = t.slice(1, t.length - 1), e._HandleParenthesisContent(t, i)
                        }) : e._HandleParenthesisContent(t, i)) || "false" !== t && e.Eval(t, i)
                    }, e._HandleParenthesisContent = function(t, i) {
                        var r;
                        i = i || function(e) {
                            return "true" === e
                        };
                        var n = t.split("||");
                        for (var o in n)
                            if (n.hasOwnProperty(o)) {
                                var s = e._SimplifyNegation(n[o].trim()),
                                    a = s.split("&&");
                                if (1 < a.length)
                                    for (var l = 0; l < a.length; ++l) {
                                        var u = e._SimplifyNegation(a[l].trim());
                                        if (!(r = "true" !== u && "false" !== u ? "!" === u[0] ? !i(u.substring(1)) : i(u) : "true" === u)) {
                                            s = "false";
                                            break
                                        }
                                    }
                                if (r || "true" === s) {
                                    r = !0;
                                    break
                                }
                                r = "true" !== s && "false" !== s ? "!" === s[0] ? !i(s.substring(1)) : i(s) : "true" === s
                            }
                        return r ? "true" : "false"
                    }, e._SimplifyNegation = function(e) {
                        return "!true" === (e = (e = e.replace(/^[\s!]+/, function(e) {
                            return (e = e.replace(/[\s]/g, function() {
                                return ""
                            })).length % 2 ? "!" : ""
                        })).trim()) ? e = "false" : "!false" === e && (e = "true"), e
                    }, e
                }(), dr.AndOrNotEvaluator = pr, fr = $a || ($a = {}), _r = function() {
                    function e(t, i, r) {
                        void 0 === r && (r = !1);
                        var n = this;
                        this.idbFactory = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB, this.callbackManifestChecked = i, this.currentSceneUrl = e._ReturnFullUrlLocation(t), this.db = null, this._enableSceneOffline = !1, this._enableTexturesOffline = !1, this.manifestVersionFound = 0, this.mustUpdateRessources = !1, this.hasReachedQuota = !1, e.IDBStorageEnabled ? r ? (this._enableSceneOffline = !0, this._enableTexturesOffline = !0, this.manifestVersionFound = 1, fr.Tools.SetImmediate(function() {
                            n.callbackManifestChecked(!0)
                        })) : this._checkManifestFile() : this.callbackManifestChecked(!0)
                    }
                    return Object.defineProperty(e.prototype, "enableSceneOffline", {
                        get: function() {
                            return this._enableSceneOffline
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "enableTexturesOffline", {
                        get: function() {
                            return this._enableTexturesOffline
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._checkManifestFile = function() {
                        var e = this,
                            t = function() {
                                e._enableSceneOffline = !1, e._enableTexturesOffline = !1, e.callbackManifestChecked(!1)
                            },
                            i = !1,
                            r = this.currentSceneUrl + ".manifest",
                            n = new XMLHttpRequest;
                        navigator.onLine && (i = !0, r = r + (null == r.match(/\?/) ? "?" : "&") + Date.now()), n.open("GET", r, !0), n.addEventListener("load", function() {
                            if (200 === n.status || fr.Tools.ValidateXHRData(n, 1)) try {
                                var i = JSON.parse(n.response);
                                e._enableSceneOffline = i.enableSceneOffline, e._enableTexturesOffline = i.enableTexturesOffline, i.version && !isNaN(parseInt(i.version)) && (e.manifestVersionFound = i.version), e.callbackManifestChecked && e.callbackManifestChecked(!0)
                            } catch (i) {
                                t()
                            } else t()
                        }, !1), n.addEventListener("error", function(r) {
                            if (i) {
                                i = !1;
                                var o = e.currentSceneUrl + ".manifest";
                                n.open("GET", o, !0), n.send()
                            } else t()
                        }, !1);
                        try {
                            n.send()
                        } catch (r) {
                            fr.Tools.Error("Error on XHR send request."), this.callbackManifestChecked(!1)
                        }
                    }, e.prototype.openAsync = function(e, t) {
                        var i = this,
                            r = function() {
                                i.isSupported = !1, t && t()
                            };
                        if (this.idbFactory && (this._enableSceneOffline || this._enableTexturesOffline))
                            if (this.db) e && e();
                            else {
                                this.hasReachedQuota = !1, this.isSupported = !0;
                                var n = this.idbFactory.open("babylonjs", 1);
                                n.onerror = function(e) {
                                    r()
                                }, n.onblocked = function(e) {
                                    fr.Tools.Error("IDB request blocked. Please reload the page."), r()
                                }, n.onsuccess = function(t) {
                                    i.db = n.result, e()
                                }, n.onupgradeneeded = function(e) {
                                    if (i.db = e.target.result, i.db) try {
                                        i.db.createObjectStore("scenes", {
                                            keyPath: "sceneUrl"
                                        }), i.db.createObjectStore("versions", {
                                            keyPath: "sceneUrl"
                                        }), i.db.createObjectStore("textures", {
                                            keyPath: "textureUrl"
                                        })
                                    } catch (e) {
                                        fr.Tools.Error("Error while creating object stores. Exception: " + e.message), r()
                                    }
                                }
                            }
                        else this.isSupported = !1, t && t()
                    }, e.prototype.loadImageFromDB = function(t, i) {
                        var r = this,
                            n = e._ReturnFullUrlLocation(t),
                            o = function() {
                                r.hasReachedQuota || null === r.db ? i.src = t : r._saveImageIntoDBAsync(n, i)
                            };
                        this.mustUpdateRessources ? o() : this._loadImageFromDBAsync(n, i, o)
                    }, e.prototype._loadImageFromDBAsync = function(e, t, i) {
                        if (this.isSupported && null !== this.db) {
                            var r, n = this.db.transaction(["textures"]);
                            n.onabort = function(i) {
                                t.src = e
                            }, n.oncomplete = function(n) {
                                var o;
                                if (r) {
                                    var s = window.URL || window.webkitURL;
                                    o = s.createObjectURL(r.data), t.onerror = function() {
                                        fr.Tools.Error("Error loading image from blob URL: " + o + " switching back to web url: " + e), t.src = e
                                    }, t.src = o
                                } else i()
                            };
                            var o = n.objectStore("textures").get(e);
                            o.onsuccess = function(e) {
                                r = e.target.result
                            }, o.onerror = function(i) {
                                fr.Tools.Error("Error loading texture " + e + " from DB."), t.src = e
                            }
                        } else fr.Tools.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."), t.src = e
                    }, e.prototype._saveImageIntoDBAsync = function(t, i) {
                        var r = this;
                        if (this.isSupported) {
                            var n = function() {
                                var e;
                                if (o) {
                                    var t = window.URL || window.webkitURL;
                                    try {
                                        e = t.createObjectURL(o)
                                    } catch (i) {
                                        e = t.createObjectURL(o)
                                    }
                                }
                                e && (i.src = e)
                            };
                            if (e.IsUASupportingBlobStorage) {
                                var o, s = new XMLHttpRequest;
                                s.open("GET", t, !0), s.responseType = "blob", s.addEventListener("load", function() {
                                    if (200 === s.status && r.db) {
                                        o = s.response;
                                        var a = r.db.transaction(["textures"], "readwrite");
                                        a.onabort = function(e) {
                                            try {
                                                var t = (e.srcElement || e.target).error;
                                                t && "QuotaExceededError" === t.name && (r.hasReachedQuota = !0)
                                            } catch (e) {}
                                            n()
                                        }, a.oncomplete = function(e) {
                                            n()
                                        };
                                        var l = {
                                            textureUrl: t,
                                            data: o
                                        };
                                        try {
                                            var u = a.objectStore("textures").put(l);
                                            u.onsuccess = function(e) {}, u.onerror = function(e) {
                                                n()
                                            }
                                        } catch (a) {
                                            25 === a.code && (e.IsUASupportingBlobStorage = !1), i.src = t
                                        }
                                    } else i.src = t
                                }, !1), s.addEventListener("error", function(e) {
                                    fr.Tools.Error("Error in XHR request in BABYLON.Database."), i.src = t
                                }, !1), s.send()
                            } else i.src = t
                        } else fr.Tools.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."), i.src = t
                    }, e.prototype._checkVersionFromDB = function(e, t) {
                        var i = this;
                        this._loadVersionFromDBAsync(e, t, function() {
                            i._saveVersionIntoDBAsync(e, t)
                        })
                    }, e.prototype._loadVersionFromDBAsync = function(e, t, i) {
                        var r, n = this;
                        if (this.isSupported && this.db) try {
                            var o = this.db.transaction(["versions"]);
                            o.oncomplete = function(e) {
                                r ? n.manifestVersionFound !== r.data ? (n.mustUpdateRessources = !0, i()) : t(r.data) : (n.mustUpdateRessources = !0, i())
                            }, o.onabort = function(e) {
                                t(-1)
                            };
                            var s = o.objectStore("versions").get(e);
                            s.onsuccess = function(e) {
                                r = e.target.result
                            }, s.onerror = function(i) {
                                fr.Tools.Error("Error loading version for scene " + e + " from DB."), t(-1)
                            }
                        } catch (o) {
                            fr.Tools.Error("Error while accessing 'versions' object store (READ OP). Exception: " + o.message), t(-1)
                        } else fr.Tools.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."), t(-1)
                    }, e.prototype._saveVersionIntoDBAsync = function(e, t) {
                        var i = this;
                        if (this.isSupported && !this.hasReachedQuota && this.db) try {
                            var r = this.db.transaction(["versions"], "readwrite");
                            r.onabort = function(e) {
                                try {
                                    var r = e.srcElement.error;
                                    r && "QuotaExceededError" === r.name && (i.hasReachedQuota = !0)
                                } catch (e) {}
                                t(-1)
                            }, r.oncomplete = function(e) {
                                t(i.manifestVersionFound)
                            };
                            var n = {
                                    sceneUrl: e,
                                    data: this.manifestVersionFound
                                },
                                o = r.objectStore("versions").put(n);
                            o.onsuccess = function(e) {}, o.onerror = function(e) {
                                fr.Tools.Error("Error in DB add version request in BABYLON.Database.")
                            }
                        } catch (e) {
                            fr.Tools.Error("Error while accessing 'versions' object store (WRITE OP). Exception: " + e.message), t(-1)
                        } else t(-1)
                    }, e.prototype.loadFileFromDB = function(t, i, r, n, o) {
                        var s = this,
                            a = e._ReturnFullUrlLocation(t),
                            l = function() {
                                s._saveFileIntoDBAsync(a, i, r, o, n)
                            };
                        this._checkVersionFromDB(a, function(e) {
                            -1 !== e ? s.mustUpdateRessources ? s._saveFileIntoDBAsync(a, i, r, o, n) : s._loadFileFromDBAsync(a, i, l, o) : n && n()
                        })
                    }, e.prototype._loadFileFromDBAsync = function(e, t, i, r) {
                        if (this.isSupported && this.db) {
                            var n, o;
                            n = -1 !== e.indexOf(".babylon") ? "scenes" : "textures";
                            var s = this.db.transaction([n]);
                            s.oncomplete = function(e) {
                                o ? t(o.data) : i()
                            }, s.onabort = function(e) {
                                i()
                            };
                            var a = s.objectStore(n).get(e);
                            a.onsuccess = function(e) {
                                o = e.target.result
                            }, a.onerror = function(t) {
                                fr.Tools.Error("Error loading file " + e + " from DB."), i()
                            }
                        } else fr.Tools.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."), t()
                    }, e.prototype._saveFileIntoDBAsync = function(e, t, i, r, n) {
                        var o = this;
                        if (this.isSupported) {
                            var s;
                            s = -1 !== e.indexOf(".babylon") ? "scenes" : "textures";
                            var a, l = new XMLHttpRequest;
                            l.open("GET", e + "?" + Date.now(), !0), r && (l.responseType = "arraybuffer"), i && (l.onprogress = i), l.addEventListener("load", function() {
                                if (200 === l.status || l.status < 400 && fr.Tools.ValidateXHRData(l, r ? 6 : 1))
                                    if (a = r ? l.response : l.responseText, !o.hasReachedQuota && o.db) {
                                        var i, u = o.db.transaction([s], "readwrite");
                                        u.onabort = function(e) {
                                            try {
                                                var i = e.srcElement.error;
                                                i && "QuotaExceededError" === i.name && (o.hasReachedQuota = !0)
                                            } catch (e) {}
                                            t(a)
                                        }, u.oncomplete = function(e) {
                                            t(a)
                                        }, i = "scenes" === s ? {
                                            sceneUrl: e,
                                            data: a,
                                            version: o.manifestVersionFound
                                        } : {
                                            textureUrl: e,
                                            data: a
                                        };
                                        try {
                                            var c = u.objectStore(s).put(i);
                                            c.onsuccess = function(e) {}, c.onerror = function(e) {
                                                fr.Tools.Error("Error in DB add file request in BABYLON.Database.")
                                            }
                                        } catch (i) {
                                            t(a)
                                        }
                                    } else t(a);
                                else 400 <= l.status && n ? n(l) : t()
                            }, !1), l.addEventListener("error", function(e) {
                                fr.Tools.Error("error on XHR request."), t()
                            }, !1), l.send()
                        } else fr.Tools.Error("Error: IndexedDB not supported by your browser or BabylonJS Database is not open."), t()
                    }, e.IsUASupportingBlobStorage = !0, e.IDBStorageEnabled = !0, e._ParseURL = function(e) {
                        var t = (document.createElement("a").href = e).substring(0, e.lastIndexOf("#")),
                            i = e.substring(t.lastIndexOf("/") + 1, e.length);
                        return e.substring(0, e.indexOf(i, 0))
                    }, e._ReturnFullUrlLocation = function(t) {
                        return -1 === t.indexOf("http:/") && -1 === t.indexOf("https:/") ? e._ParseURL(window.location.href) + t : t
                    }, e
                }(), fr.Database = _r, mr = $a || ($a = {}), gr = function() {
                    function e() {
                        this._isEnabled = !0, this.leftColor = mr.Color3.White(), this.rightColor = mr.Color3.Black(), this.bias = 0, this.power = 1
                    }
                    return Object.defineProperty(e.prototype, "isEnabled", {
                        get: function() {
                            return this._isEnabled
                        },
                        set: function(e) {
                            this._isEnabled !== e && (this._isEnabled = e, mr.Engine.MarkAllMaterialsAsDirty(mr.Material.FresnelDirtyFlag | mr.Material.MiscDirtyFlag))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.clone = function() {
                        var t = new e;
                        return mr.Tools.DeepCopy(this, t), t
                    }, e.prototype.serialize = function() {
                        var e = {};
                        return e.isEnabled = this.isEnabled, e.leftColor = this.leftColor.asArray(), e.rightColor = this.rightColor.asArray(), e.bias = this.bias, e.power = this.power, e
                    }, e.Parse = function(t) {
                        var i = new e;
                        return i.isEnabled = t.isEnabled, i.leftColor = mr.Color3.FromArray(t.leftColor), i.rightColor = mr.Color3.FromArray(t.rightColor), i.bias = t.bias, i.power = t.power || 1, i
                    }, e
                }(), mr.FresnelParameters = gr, vr = $a || ($a = {}), yr = function(e) {
                    function t(t, i) {
                        var r = e.call(this, t, i, !0) || this;
                        return i.multiMaterials.push(r), r.subMaterials = new Array, r.storeEffectOnSubMeshes = !0, r
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "subMaterials", {
                        get: function() {
                            return this._subMaterials
                        },
                        set: function(e) {
                            this._subMaterials = e, this._hookArray(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._hookArray = function(e) {
                        var t = this,
                            i = e.push;
                        e.push = function() {
                            for (var r = [], n = 0; n < arguments.length; n++) r[n] = arguments[n];
                            var o = i.apply(e, r);
                            return t._markAllSubMeshesAsTexturesDirty(), o
                        };
                        var r = e.splice;
                        e.splice = function(i, n) {
                            var o = r.apply(e, [i, n]);
                            return t._markAllSubMeshesAsTexturesDirty(), o
                        }
                    }, t.prototype.getSubMaterial = function(e) {
                        return e < 0 || e >= this.subMaterials.length ? this.getScene().defaultMaterial : this.subMaterials[e]
                    }, t.prototype.getActiveTextures = function() {
                        var t;
                        return (t = e.prototype.getActiveTextures.call(this)).concat.apply(t, this.subMaterials.map(function(e) {
                            return e ? e.getActiveTextures() : []
                        }))
                    }, t.prototype.getClassName = function() {
                        return "MultiMaterial"
                    }, t.prototype.isReadyForSubMesh = function(e, t, i) {
                        for (var r = 0; r < this.subMaterials.length; r++) {
                            var n = this.subMaterials[r];
                            if (n) {
                                if (n.storeEffectOnSubMeshes) {
                                    if (!n.isReadyForSubMesh(e, t, i)) return !1;
                                    continue
                                }
                                if (!n.isReady(e)) return !1
                            }
                        }
                        return !0
                    }, t.prototype.clone = function(e, i) {
                        for (var r = new t(e, this.getScene()), n = 0; n < this.subMaterials.length; n++) {
                            var o = null,
                                s = this.subMaterials[n];
                            o = i && s ? s.clone(e + "-" + s.name) : this.subMaterials[n], r.subMaterials.push(o)
                        }
                        return r
                    }, t.prototype.serialize = function() {
                        var e = {};
                        e.name = this.name, e.id = this.id, vr.Tags && (e.tags = vr.Tags.GetTags(this)), e.materials = [];
                        for (var t = 0; t < this.subMaterials.length; t++) {
                            var i = this.subMaterials[t];
                            i ? e.materials.push(i.id) : e.materials.push(null)
                        }
                        return e
                    }, t.prototype.dispose = function(t, i) {
                        var r = this.getScene();
                        if (r) {
                            var n = r.multiMaterials.indexOf(this);
                            0 <= n && r.multiMaterials.splice(n, 1), e.prototype.dispose.call(this, t, i)
                        }
                    }, t
                }(vr.Material), vr.MultiMaterial = yr, br = $a || ($a = {}), xr = function() {
                    function e() {
                        this.touchAngularSensibility = 2e5, this.touchMoveSensibility = 250, this._offsetX = null, this._offsetY = null, this._pointerPressed = new Array
                    }
                    return e.prototype.attachControl = function(e, t) {
                        var i = this,
                            r = null;
                        void 0 === this._pointerInput && (this._onLostFocus = function(e) {
                            i._offsetX = null, i._offsetY = null
                        }, this._pointerInput = function(e, n) {
                            var o = e.event;
                            if ("mouse" !== o.pointerType)
                                if (e.type === br.PointerEventTypes.POINTERDOWN) {
                                    if (t || o.preventDefault(), i._pointerPressed.push(o.pointerId), 1 !== i._pointerPressed.length) return;
                                    r = {
                                        x: o.clientX,
                                        y: o.clientY
                                    }
                                } else if (e.type === br.PointerEventTypes.POINTERUP) {
                                if (t || o.preventDefault(), -1 === (s = i._pointerPressed.indexOf(o.pointerId))) return;
                                if (i._pointerPressed.splice(s, 1), 0 != s) return;
                                r = null, i._offsetX = null, i._offsetY = null
                            } else if (e.type === br.PointerEventTypes.POINTERMOVE) {
                                if (t || o.preventDefault(), !r) return;
                                var s;
                                if (0 != (s = i._pointerPressed.indexOf(o.pointerId))) return;
                                i._offsetX = o.clientX - r.x, i._offsetY = -(o.clientY - r.y)
                            }
                        }), this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, br.PointerEventTypes.POINTERDOWN | br.PointerEventTypes.POINTERUP | br.PointerEventTypes.POINTERMOVE), this._onLostFocus && e.addEventListener("blur", this._onLostFocus)
                    }, e.prototype.detachControl = function(e) {
                        this._pointerInput && e && (this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null), this._onLostFocus && (e.removeEventListener("blur", this._onLostFocus), this._onLostFocus = null), this._pointerPressed = [], this._offsetX = null, this._offsetY = null)
                    }, e.prototype.checkInputs = function() {
                        if (this._offsetX && this._offsetY) {
                            var e = this.camera;
                            if (e.cameraRotation.y += this._offsetX / this.touchAngularSensibility, 1 < this._pointerPressed.length) e.cameraRotation.x += -this._offsetY / this.touchAngularSensibility;
                            else {
                                var t = e._computeLocalCameraSpeed(),
                                    i = new br.Vector3(0, 0, t * this._offsetY / this.touchMoveSensibility);
                                br.Matrix.RotationYawPitchRollToRef(e.rotation.y, e.rotation.x, 0, e._cameraRotationMatrix), e.cameraDirection.addInPlace(br.Vector3.TransformCoordinates(i, e._cameraRotationMatrix))
                            }
                        }
                    }, e.prototype.getClassName = function() {
                        return "FreeCameraTouchInput"
                    }, e.prototype.getSimpleName = function() {
                        return "touch"
                    }, y([br.serialize()], e.prototype, "touchAngularSensibility", void 0), y([br.serialize()], e.prototype, "touchMoveSensibility", void 0), e
                }(), br.FreeCameraTouchInput = xr, br.CameraInputTypes.FreeCameraTouchInput = xr,
                function(e) {
                    e.Node.AddNodeConstructor("TouchCamera", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(e) {
                        function t(t, i, r) {
                            var n = e.call(this, t, i, r) || this;
                            return n.inputs.addTouch(), n._setupInputs(), n
                        }
                        return b(t, e), Object.defineProperty(t.prototype, "touchAngularSensibility", {
                            get: function() {
                                var e = this.inputs.attached.touch;
                                return e ? e.touchAngularSensibility : 0
                            },
                            set: function(e) {
                                var t = this.inputs.attached.touch;
                                t && (t.touchAngularSensibility = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "touchMoveSensibility", {
                            get: function() {
                                var e = this.inputs.attached.touch;
                                return e ? e.touchMoveSensibility : 0
                            },
                            set: function(e) {
                                var t = this.inputs.attached.touch;
                                t && (t.touchMoveSensibility = e)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.getClassName = function() {
                            return "TouchCamera"
                        }, t.prototype._setupInputs = function() {
                            var e = this.inputs.attached.mouse;
                            e && (e.touchEnabled = !1)
                        }, t
                    }(e.FreeCamera);
                    e.TouchCamera = t
                }($a || ($a = {})), Tr = $a || ($a = {}), Er = function(e) {
                    function t(t, i, r, n, o, s, a) {
                        void 0 === o && (o = null), void 0 === s && (s = !0), void 0 === a && (a = !1);
                        var l = e.call(this, null, n, !s) || this;
                        l.isCube = a, l.isEnabled = !0, l.autoClear = !0, l.onGeneratedObservable = new Tr.Observable, l._textures = {}, l._currentRefreshId = -1, l._refreshRate = 1, l._vertexBuffers = {}, l._uniforms = new Array, l._samplers = new Array, l._floats = {}, l._ints = {}, l._floatsArrays = {}, l._colors3 = {}, l._colors4 = {}, l._vectors2 = {}, l._vectors3 = {}, l._matrices = {}, l._fallbackTextureUsed = !1, l._cachedDefines = "", l._contentUpdateId = -1;
                        var u = (n = l.getScene())._getComponent(Tr.SceneComponentConstants.NAME_PROCEDURALTEXTURE);
                        u || (u = new Tr.ProceduralTextureSceneComponent(n), n._addComponent(u)), n.proceduralTextures.push(l), l._engine = n.getEngine(), l.name = t, l.isRenderTarget = !0, l._size = i, l._generateMipMaps = s, l.setFragment(r), l._fallbackTexture = o, a ? (l._texture = l._engine.createRenderTargetCubeTexture(i, {
                            generateMipMaps: s,
                            generateDepthBuffer: !1,
                            generateStencilBuffer: !1
                        }), l.setFloat("face", 0)) : l._texture = l._engine.createRenderTargetTexture(i, {
                            generateMipMaps: s,
                            generateDepthBuffer: !1,
                            generateStencilBuffer: !1
                        });
                        var c = [];
                        return c.push(1, 1), c.push(-1, 1), c.push(-1, -1), c.push(1, -1), l._vertexBuffers[Tr.VertexBuffer.PositionKind] = new Tr.VertexBuffer(l._engine, c, Tr.VertexBuffer.PositionKind, !1, !1, 2), l._createIndexBuffer(), l
                    }
                    return b(t, e), t.prototype.getContent = function() {
                        return this._contentData && this._currentRefreshId == this._contentUpdateId || (this._contentData = this.readPixels(0, 0, this._contentData), this._contentUpdateId = this._currentRefreshId), this._contentData
                    }, t.prototype._createIndexBuffer = function() {
                        var e = this._engine,
                            t = [];
                        t.push(0), t.push(1), t.push(2), t.push(0), t.push(2), t.push(3), this._indexBuffer = e.createIndexBuffer(t)
                    }, t.prototype._rebuild = function() {
                        var e = this._vertexBuffers[Tr.VertexBuffer.PositionKind];
                        e && e._rebuild(), this._createIndexBuffer(),
                            this.refreshRate === Tr.RenderTargetTexture.REFRESHRATE_RENDER_ONCE && (this.refreshRate = Tr.RenderTargetTexture.REFRESHRATE_RENDER_ONCE)
                    }, t.prototype.reset = function() {
                        void 0 !== this._effect && this._engine._releaseEffect(this._effect)
                    }, t.prototype._getDefines = function() {
                        return ""
                    }, t.prototype.isReady = function() {
                        var e, t = this,
                            i = this._engine;
                        if (!this._fragment) return !1;
                        if (this._fallbackTextureUsed) return !0;
                        var r = this._getDefines();
                        return !(!this._effect || r !== this._cachedDefines || !this._effect.isReady()) || (e = void 0 !== this._fragment.fragmentElement ? {
                            vertex: "procedural",
                            fragmentElement: this._fragment.fragmentElement
                        } : {
                            vertex: "procedural",
                            fragment: this._fragment
                        }, this._cachedDefines = r, this._effect = i.createEffect(e, [Tr.VertexBuffer.PositionKind], this._uniforms, this._samplers, r, void 0, void 0, function() {
                            t.releaseInternalTexture(), t._fallbackTexture && (t._texture = t._fallbackTexture._texture, t._texture && t._texture.incrementReferences()), t._fallbackTextureUsed = !0
                        }), this._effect.isReady())
                    }, t.prototype.resetRefreshCounter = function() {
                        this._currentRefreshId = -1
                    }, t.prototype.setFragment = function(e) {
                        this._fragment = e
                    }, Object.defineProperty(t.prototype, "refreshRate", {
                        get: function() {
                            return this._refreshRate
                        },
                        set: function(e) {
                            this._refreshRate = e, this.resetRefreshCounter()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._shouldRender = function() {
                        return this.isEnabled && this.isReady() && this._texture ? !(this._fallbackTextureUsed || (-1 === this._currentRefreshId ? (this._currentRefreshId = 1, 0) : this.refreshRate === this._currentRefreshId ? (this._currentRefreshId = 1, 0) : (this._currentRefreshId++, 1))) : (this._texture && (this._texture.isReady = !1), !1)
                    }, t.prototype.getRenderSize = function() {
                        return this._size
                    }, t.prototype.resize = function(e, t) {
                        this._fallbackTextureUsed || (this.releaseInternalTexture(), this._texture = this._engine.createRenderTargetTexture(e, t), this._size = e, this._generateMipMaps = t)
                    }, t.prototype._checkUniform = function(e) {
                        -1 === this._uniforms.indexOf(e) && this._uniforms.push(e)
                    }, t.prototype.setTexture = function(e, t) {
                        return -1 === this._samplers.indexOf(e) && this._samplers.push(e), this._textures[e] = t, this
                    }, t.prototype.setFloat = function(e, t) {
                        return this._checkUniform(e), this._floats[e] = t, this
                    }, t.prototype.setInt = function(e, t) {
                        return this._checkUniform(e), this._ints[e] = t, this
                    }, t.prototype.setFloats = function(e, t) {
                        return this._checkUniform(e), this._floatsArrays[e] = t, this
                    }, t.prototype.setColor3 = function(e, t) {
                        return this._checkUniform(e), this._colors3[e] = t, this
                    }, t.prototype.setColor4 = function(e, t) {
                        return this._checkUniform(e), this._colors4[e] = t, this
                    }, t.prototype.setVector2 = function(e, t) {
                        return this._checkUniform(e), this._vectors2[e] = t, this
                    }, t.prototype.setVector3 = function(e, t) {
                        return this._checkUniform(e), this._vectors3[e] = t, this
                    }, t.prototype.setMatrix = function(e, t) {
                        return this._checkUniform(e), this._matrices[e] = t, this
                    }, t.prototype.render = function(e) {
                        var t = this.getScene();
                        if (t) {
                            var i = this._engine;
                            for (var r in i.enableEffect(this._effect), i.setState(!1), this._textures) this._effect.setTexture(r, this._textures[r]);
                            for (r in this._ints) this._effect.setInt(r, this._ints[r]);
                            for (r in this._floats) this._effect.setFloat(r, this._floats[r]);
                            for (r in this._floatsArrays) this._effect.setArray(r, this._floatsArrays[r]);
                            for (r in this._colors3) this._effect.setColor3(r, this._colors3[r]);
                            for (r in this._colors4) {
                                var n = this._colors4[r];
                                this._effect.setFloat4(r, n.r, n.g, n.b, n.a)
                            }
                            for (r in this._vectors2) this._effect.setVector2(r, this._vectors2[r]);
                            for (r in this._vectors3) this._effect.setVector3(r, this._vectors3[r]);
                            for (r in this._matrices) this._effect.setMatrix(r, this._matrices[r]);
                            if (this._texture) {
                                if (this.isCube)
                                    for (var o = 0; o < 6; o++) i.bindFramebuffer(this._texture, o, void 0, void 0, !0), i.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect), this._effect.setFloat("face", o), this.autoClear && i.clear(t.clearColor, !0, !1, !1), i.drawElementsType(Tr.Material.TriangleFillMode, 0, 6), 5 === o && i.generateMipMapsForCubemap(this._texture);
                                else i.bindFramebuffer(this._texture, 0, void 0, void 0, !0), i.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect), this.autoClear && i.clear(t.clearColor, !0, !1, !1), i.drawElementsType(Tr.Material.TriangleFillMode, 0, 6);
                                i.unBindFramebuffer(this._texture, this.isCube), this.onGenerated && this.onGenerated(), this.onGeneratedObservable.notifyObservers(this)
                            }
                        }
                    }, t.prototype.clone = function() {
                        var e = this.getSize(),
                            i = new t(this.name, e.width, this._fragment, this.getScene(), this._fallbackTexture, this._generateMipMaps);
                        return i.hasAlpha = this.hasAlpha, i.level = this.level, i.coordinatesMode = this.coordinatesMode, i
                    }, t.prototype.dispose = function() {
                        var t = this.getScene();
                        if (t) {
                            var i = t.proceduralTextures.indexOf(this);
                            0 <= i && t.proceduralTextures.splice(i, 1);
                            var r = this._vertexBuffers[Tr.VertexBuffer.PositionKind];
                            r && (r.dispose(), this._vertexBuffers[Tr.VertexBuffer.PositionKind] = null), this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer) && (this._indexBuffer = null), e.prototype.dispose.call(this)
                        }
                    }, y([Tr.serialize()], t.prototype, "isEnabled", void 0), y([Tr.serialize()], t.prototype, "autoClear", void 0), y([Tr.serialize()], t.prototype, "_generateMipMaps", void 0), y([Tr.serialize()], t.prototype, "_size", void 0), y([Tr.serialize()], t.prototype, "refreshRate", null), t
                }(Tr.Texture), Tr.ProceduralTexture = Er, Sr = $a || ($a = {}), Pr = function() {
                    function e(e) {
                        this.name = Sr.SceneComponentConstants.NAME_PROCEDURALTEXTURE, this.scene = e, this.scene.proceduralTextures = new Array, e.layers = new Array
                    }
                    return e.prototype.register = function() {
                        this.scene._beforeClearStage.registerStep(Sr.SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE, this, this._beforeClear)
                    }, e.prototype.rebuild = function() {}, e.prototype.dispose = function() {}, e.prototype._beforeClear = function() {
                        if (this.scene.proceduralTexturesEnabled) {
                            Sr.Tools.StartPerformanceCounter("Procedural textures", 0 < this.scene.proceduralTextures.length);
                            for (var e = 0; e < this.scene.proceduralTextures.length; e++) {
                                var t = this.scene.proceduralTextures[e];
                                t._shouldRender() && t.render()
                            }
                            Sr.Tools.EndPerformanceCounter("Procedural textures", 0 < this.scene.proceduralTextures.length)
                        }
                    }, e
                }(), Sr.ProceduralTextureSceneComponent = Pr, Ar = $a || ($a = {}), Cr = function(e) {
                    function t(t, i, r, n, o, s) {
                        var a = e.call(this, t, r, null, n, o, s) || this;
                        return a._animate = !0, a._time = 0, a._texturePath = i, a._loadJson(i), a.refreshRate = 1, a
                    }
                    return b(t, e), t.prototype._loadJson = function(e) {
                        var t = this,
                            i = function() {
                                Ar.Tools.Log("No config file found in " + e + " trying to use ShadersStore or DOM element");
                                try {
                                    t.setFragment(t._texturePath)
                                } catch (e) {
                                    Ar.Tools.Error("No json or ShaderStore or DOM element found for CustomProceduralTexture")
                                }
                            },
                            r = e + "/config.json",
                            n = new XMLHttpRequest;
                        n.open("GET", r, !0), n.addEventListener("load", function() {
                            if (200 === n.status || Ar.Tools.ValidateXHRData(n, 1)) try {
                                t._config = JSON.parse(n.response), t.updateShaderUniforms(), t.updateTextures(), t.setFragment(t._texturePath + "/custom"), t._animate = t._config.animate, t.refreshRate = t._config.refreshrate
                            } catch (e) {
                                i()
                            } else i()
                        }, !1), n.addEventListener("error", function() {
                            i()
                        }, !1);
                        try {
                            n.send()
                        } catch (e) {
                            Ar.Tools.Error("CustomProceduralTexture: Error on XHR send request.")
                        }
                    }, t.prototype.isReady = function() {
                        if (!e.prototype.isReady.call(this)) return !1;
                        for (var t in this._textures)
                            if (!this._textures[t].isReady()) return !1;
                        return !0
                    }, t.prototype.render = function(t) {
                        var i = this.getScene();
                        this._animate && i && (this._time += .03 * i.getAnimationRatio(), this.updateShaderUniforms()), e.prototype.render.call(this, t)
                    }, t.prototype.updateTextures = function() {
                        for (var e = 0; e < this._config.sampler2Ds.length; e++) this.setTexture(this._config.sampler2Ds[e].sample2Dname, new Ar.Texture(this._texturePath + "/" + this._config.sampler2Ds[e].textureRelativeUrl, this.getScene()))
                    }, t.prototype.updateShaderUniforms = function() {
                        if (this._config)
                            for (var e = 0; e < this._config.uniforms.length; e++) {
                                var t = this._config.uniforms[e];
                                switch (t.type) {
                                    case "float":
                                        this.setFloat(t.name, t.value);
                                        break;
                                    case "color3":
                                        this.setColor3(t.name, new Ar.Color3(t.r, t.g, t.b));
                                        break;
                                    case "color4":
                                        this.setColor4(t.name, new Ar.Color4(t.r, t.g, t.b, t.a));
                                        break;
                                    case "vector2":
                                        this.setVector2(t.name, new Ar.Vector2(t.x, t.y));
                                        break;
                                    case "vector3":
                                        this.setVector3(t.name, new Ar.Vector3(t.x, t.y, t.z))
                                }
                            }
                        this.setFloat("time", this._time)
                    }, Object.defineProperty(t.prototype, "animate", {
                        get: function() {
                            return this._animate
                        },
                        set: function(e) {
                            this._animate = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t
                }(Ar.ProceduralTexture), Ar.CustomProceduralTexture = Cr, Mr = $a || ($a = {}), Rr = function() {
                    function e() {
                        this.gamepadAngularSensibility = 200, this.gamepadMoveSensibility = 40, this._cameraTransform = Mr.Matrix.Identity(), this._deltaTransform = Mr.Vector3.Zero(), this._vector3 = Mr.Vector3.Zero(), this._vector2 = Mr.Vector2.Zero()
                    }
                    return e.prototype.attachControl = function(e, t) {
                        var i = this,
                            r = this.camera.getScene().gamepadManager;
                        this._onGamepadConnectedObserver = r.onGamepadConnectedObservable.add(function(e) {
                            e.type !== Mr.Gamepad.POSE_ENABLED && (i.gamepad && e.type !== Mr.Gamepad.XBOX || (i.gamepad = e))
                        }), this._onGamepadDisconnectedObserver = r.onGamepadDisconnectedObservable.add(function(e) {
                            i.gamepad === e && (i.gamepad = null)
                        }), this.gamepad = r.getGamepadByType(Mr.Gamepad.XBOX)
                    }, e.prototype.detachControl = function(e) {
                        this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), this.gamepad = null
                    }, e.prototype.checkInputs = function() {
                        if (this.gamepad && this.gamepad.leftStick) {
                            var e = this.camera,
                                t = this.gamepad.leftStick,
                                i = t.x / this.gamepadMoveSensibility,
                                r = t.y / this.gamepadMoveSensibility;
                            t.x = .005 < Math.abs(i) ? 0 + i : 0, t.y = .005 < Math.abs(r) ? 0 + r : 0;
                            var n = this.gamepad.rightStick;
                            if (n) {
                                var o = n.x / this.gamepadAngularSensibility,
                                    s = n.y / this.gamepadAngularSensibility;
                                n.x = .001 < Math.abs(o) ? 0 + o : 0, n.y = .001 < Math.abs(s) ? 0 + s : 0
                            } else n = {
                                x: 0,
                                y: 0
                            };
                            e.rotationQuaternion ? e.rotationQuaternion.toRotationMatrix(this._cameraTransform) : Mr.Matrix.RotationYawPitchRollToRef(e.rotation.y, e.rotation.x, 0, this._cameraTransform);
                            var a = 50 * e._computeLocalCameraSpeed();
                            this._vector3.copyFromFloats(t.x * a, 0, -t.y * a), Mr.Vector3.TransformCoordinatesToRef(this._vector3, this._cameraTransform, this._deltaTransform), e.cameraDirection.addInPlace(this._deltaTransform), this._vector2.copyFromFloats(n.y, n.x), e.cameraRotation.addInPlace(this._vector2)
                        }
                    }, e.prototype.getClassName = function() {
                        return "FreeCameraGamepadInput"
                    }, e.prototype.getSimpleName = function() {
                        return "gamepad"
                    }, y([Mr.serialize()], e.prototype, "gamepadAngularSensibility", void 0), y([Mr.serialize()], e.prototype, "gamepadMoveSensibility", void 0), e
                }(), Mr.FreeCameraGamepadInput = Rr, Mr.CameraInputTypes.FreeCameraGamepadInput = Rr, Or = $a || ($a = {}), wr = function() {
                    function e() {
                        this.gamepadRotationSensibility = 80, this.gamepadMoveSensibility = 40
                    }
                    return e.prototype.attachControl = function(e, t) {
                        var i = this,
                            r = this.camera.getScene().gamepadManager;
                        this._onGamepadConnectedObserver = r.onGamepadConnectedObservable.add(function(e) {
                            e.type !== Or.Gamepad.POSE_ENABLED && (i.gamepad && e.type !== Or.Gamepad.XBOX || (i.gamepad = e))
                        }), this._onGamepadDisconnectedObserver = r.onGamepadDisconnectedObservable.add(function(e) {
                            i.gamepad === e && (i.gamepad = null)
                        }), this.gamepad = r.getGamepadByType(Or.Gamepad.XBOX)
                    }, e.prototype.detachControl = function(e) {
                        this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), this.gamepad = null
                    }, e.prototype.checkInputs = function() {
                        if (this.gamepad) {
                            var e = this.camera,
                                t = this.gamepad.rightStick;
                            if (t) {
                                if (0 != t.x) {
                                    var i = t.x / this.gamepadRotationSensibility;
                                    0 != i && .005 < Math.abs(i) && (e.inertialAlphaOffset += i)
                                }
                                if (0 != t.y) {
                                    var r = t.y / this.gamepadRotationSensibility;
                                    0 != r && .005 < Math.abs(r) && (e.inertialBetaOffset += r)
                                }
                            }
                            var n = this.gamepad.leftStick;
                            if (n && 0 != n.y) {
                                var o = n.y / this.gamepadMoveSensibility;
                                0 != o && .005 < Math.abs(o) && (this.camera.inertialRadiusOffset -= o)
                            }
                        }
                    }, e.prototype.getClassName = function() {
                        return "ArcRotateCameraGamepadInput"
                    }, e.prototype.getSimpleName = function() {
                        return "gamepad"
                    }, y([Or.serialize()], e.prototype, "gamepadRotationSensibility", void 0), y([Or.serialize()], e.prototype, "gamepadMoveSensibility", void 0), e
                }(), Or.ArcRotateCameraGamepadInput = wr, Or.CameraInputTypes.ArcRotateCameraGamepadInput = wr, Ir = $a || ($a = {}), Dr = function() {
                    function e(e) {
                        var t = this;
                        this._scene = e, this._babylonGamepads = [], this._oneGamepadConnected = !1, this._isMonitoring = !1, this.onGamepadDisconnectedObservable = new Ir.Observable, Ir.Tools.IsWindowObjectExist() ? (this._gamepadEventSupported = "GamepadEvent" in window, this._gamepadSupport = navigator.getGamepads || navigator.webkitGetGamepads || navigator.msGetGamepads || navigator.webkitGamepads) : this._gamepadEventSupported = !1, this.onGamepadConnectedObservable = new Ir.Observable(function(e) {
                            for (var i in t._babylonGamepads) {
                                var r = t._babylonGamepads[i];
                                r && r._isConnected && t.onGamepadConnectedObservable.notifyObserver(e, r)
                            }
                        }), this._onGamepadConnectedEvent = function(e) {
                            var i, r = e.gamepad;
                            r.index in t._babylonGamepads && t._babylonGamepads[r.index].isConnected || (t._babylonGamepads[r.index] ? ((i = t._babylonGamepads[r.index]).browserGamepad = r, i._isConnected = !0) : i = t._addNewGamepad(r), t.onGamepadConnectedObservable.notifyObservers(i), t._startMonitoringGamepads())
                        }, this._onGamepadDisconnectedEvent = function(e) {
                            var i = e.gamepad;
                            for (var r in t._babylonGamepads)
                                if (t._babylonGamepads[r].index === i.index) {
                                    var n = t._babylonGamepads[r];
                                    n._isConnected = !1, t.onGamepadDisconnectedObservable.notifyObservers(n);
                                    break
                                }
                        }, this._gamepadSupport && (this._updateGamepadObjects(), this._babylonGamepads.length && this._startMonitoringGamepads(), this._gamepadEventSupported ? (window.addEventListener("gamepadconnected", this._onGamepadConnectedEvent, !1), window.addEventListener("gamepaddisconnected", this._onGamepadDisconnectedEvent, !1)) : this._startMonitoringGamepads())
                    }
                    return Object.defineProperty(e.prototype, "gamepads", {
                        get: function() {
                            return this._babylonGamepads
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getGamepadByType = function(e) {
                        void 0 === e && (e = Ir.Gamepad.XBOX);
                        for (var t = 0, i = this._babylonGamepads; t < i.length; t++) {
                            var r = i[t];
                            if (r && r.type === e) return r
                        }
                        return null
                    }, e.prototype.dispose = function() {
                        this._gamepadEventSupported && (this._onGamepadConnectedEvent && window.removeEventListener("gamepadconnected", this._onGamepadConnectedEvent), this._onGamepadDisconnectedEvent && window.removeEventListener("gamepaddisconnected", this._onGamepadDisconnectedEvent), this._onGamepadConnectedEvent = null, this._onGamepadDisconnectedEvent = null), this._babylonGamepads.forEach(function(e) {
                            e.dispose()
                        }), this.onGamepadConnectedObservable.clear(), this.onGamepadDisconnectedObservable.clear(), this._oneGamepadConnected = !1, this._stopMonitoringGamepads(), this._babylonGamepads = []
                    }, e.prototype._addNewGamepad = function(e) {
                        var t;
                        this._oneGamepadConnected || (this._oneGamepadConnected = !0);
                        var i = -1 !== e.id.search("Xbox One");
                        return t = i || -1 !== e.id.search("Xbox 360") || -1 !== e.id.search("xinput") ? new Ir.Xbox360Pad(e.id, e.index, e, i) : e.pose ? Ir.PoseEnabledControllerHelper.InitiateController(e) : new Ir.GenericPad(e.id, e.index, e), this._babylonGamepads[t.index] = t
                    }, e.prototype._startMonitoringGamepads = function() {
                        this._isMonitoring || (this._isMonitoring = !0, this._scene || this._checkGamepadsStatus())
                    }, e.prototype._stopMonitoringGamepads = function() {
                        this._isMonitoring = !1
                    }, e.prototype._checkGamepadsStatus = function() {
                        var e = this;
                        for (var t in this._updateGamepadObjects(), this._babylonGamepads) {
                            var i = this._babylonGamepads[t];
                            i && i.isConnected && i.update()
                        }
                        this._isMonitoring && !this._scene && Ir.Tools.QueueNewFrame(function() {
                            e._checkGamepadsStatus()
                        })
                    }, e.prototype._updateGamepadObjects = function() {
                        for (var e = navigator.getGamepads ? navigator.getGamepads() : navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : [], t = 0; t < e.length; t++) {
                            var i = e[t];
                            if (i)
                                if (this._babylonGamepads[i.index]) this._babylonGamepads[t].browserGamepad = i, this._babylonGamepads[t].isConnected || (this._babylonGamepads[t]._isConnected = !0, this.onGamepadConnectedObservable.notifyObservers(this._babylonGamepads[t]));
                                else {
                                    var r = this._addNewGamepad(i);
                                    this.onGamepadConnectedObservable.notifyObservers(r)
                                }
                        }
                    }, e
                }(), Ir.GamepadManager = Dr,
                function(e) {
                    var t = function(e, t) {
                        this.x = e, this.y = t
                    };
                    e.StickValues = t;
                    var i = function() {
                            function e(t, i, r, n, o, s, a) {
                                void 0 === n && (n = 0), void 0 === o && (o = 1), void 0 === s && (s = 2), void 0 === a && (a = 3), this.id = t, this.index = i, this.browserGamepad = r, this._leftStick = {
                                    x: 0,
                                    y: 0
                                }, this._rightStick = {
                                    x: 0,
                                    y: 0
                                }, this._isConnected = !0, this._invertLeftStickY = !1, this.type = e.GAMEPAD, this._leftStickAxisX = n, this._leftStickAxisY = o, this._rightStickAxisX = s, this._rightStickAxisY = a, 2 <= this.browserGamepad.axes.length && (this._leftStick = {
                                    x: this.browserGamepad.axes[this._leftStickAxisX],
                                    y: this.browserGamepad.axes[this._leftStickAxisY]
                                }), 4 <= this.browserGamepad.axes.length && (this._rightStick = {
                                    x: this.browserGamepad.axes[this._rightStickAxisX],
                                    y: this.browserGamepad.axes[this._rightStickAxisY]
                                })
                            }
                            return Object.defineProperty(e.prototype, "isConnected", {
                                get: function() {
                                    return this._isConnected
                                },
                                enumerable: !0,
                                configurable: !0
                            }), e.prototype.onleftstickchanged = function(e) {
                                this._onleftstickchanged = e
                            }, e.prototype.onrightstickchanged = function(e) {
                                this._onrightstickchanged = e
                            }, Object.defineProperty(e.prototype, "leftStick", {
                                get: function() {
                                    return this._leftStick
                                },
                                set: function(e) {
                                    !this._onleftstickchanged || this._leftStick.x === e.x && this._leftStick.y === e.y || this._onleftstickchanged(e), this._leftStick = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(e.prototype, "rightStick", {
                                get: function() {
                                    return this._rightStick
                                },
                                set: function(e) {
                                    !this._onrightstickchanged || this._rightStick.x === e.x && this._rightStick.y === e.y || this._onrightstickchanged(e), this._rightStick = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), e.prototype.update = function() {
                                this._leftStick && (this.leftStick = {
                                    x: this.browserGamepad.axes[this._leftStickAxisX],
                                    y: this.browserGamepad.axes[this._leftStickAxisY]
                                }, this._invertLeftStickY && (this.leftStick.y *= -1)), this._rightStick && (this.rightStick = {
                                    x: this.browserGamepad.axes[this._rightStickAxisX],
                                    y: this.browserGamepad.axes[this._rightStickAxisY]
                                })
                            }, e.prototype.dispose = function() {}, e.GAMEPAD = 0, e.GENERIC = 1, e.XBOX = 2, e.POSE_ENABLED = 3, e
                        }(),
                        r = function(t) {
                            function r(r, n, o) {
                                var s = t.call(this, r, n, o) || this;
                                return s.onButtonDownObservable = new e.Observable, s.onButtonUpObservable = new e.Observable, s.type = i.GENERIC, s._buttons = new Array(o.buttons.length), s
                            }
                            return b(r, t), r.prototype.onbuttondown = function(e) {
                                this._onbuttondown = e
                            }, r.prototype.onbuttonup = function(e) {
                                this._onbuttonup = e
                            }, r.prototype._setButtonValue = function(e, t, i) {
                                return e !== t && (1 === e && (this._onbuttondown && this._onbuttondown(i), this.onButtonDownObservable.notifyObservers(i)), 0 === e && (this._onbuttonup && this._onbuttonup(i), this.onButtonUpObservable.notifyObservers(i))), e
                            }, r.prototype.update = function() {
                                t.prototype.update.call(this);
                                for (var e = 0; e < this._buttons.length; e++) this._buttons[e] = this._setButtonValue(this.browserGamepad.buttons[e].value, this._buttons[e], e)
                            }, r.prototype.dispose = function() {
                                t.prototype.dispose.call(this), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear()
                            }, r
                        }(e.Gamepad = i);
                    e.GenericPad = r
                }($a || ($a = {})),
                function(e) {
                    var t, i, r, n;
                    (i = t = e.Xbox360Button || (e.Xbox360Button = {}))[i.A = 0] = "A", i[i.B = 1] = "B", i[i.X = 2] = "X", i[i.Y = 3] = "Y", i[i.Start = 4] = "Start", i[i.Back = 5] = "Back", i[i.LB = 6] = "LB", i[i.RB = 7] = "RB", i[i.LeftStick = 8] = "LeftStick", i[i.RightStick = 9] = "RightStick", (n = r = e.Xbox360Dpad || (e.Xbox360Dpad = {}))[n.Up = 0] = "Up", n[n.Down = 1] = "Down", n[n.Left = 2] = "Left", n[n.Right = 3] = "Right";
                    var o = function(i) {
                        function n(t, r, n, o) {
                            void 0 === o && (o = !1);
                            var s = i.call(this, t, r, n, 0, 1, 2, 3) || this;
                            return s._leftTrigger = 0, s._rightTrigger = 0, s.onButtonDownObservable = new e.Observable, s.onButtonUpObservable = new e.Observable, s.onPadDownObservable = new e.Observable, s.onPadUpObservable = new e.Observable, s._buttonA = 0, s._buttonB = 0, s._buttonX = 0, s._buttonY = 0, s._buttonBack = 0, s._buttonStart = 0, s._buttonLB = 0, s._buttonRB = 0, s._buttonLeftStick = 0, s._buttonRightStick = 0, s._dPadUp = 0, s._dPadDown = 0, s._dPadLeft = 0, s._dPadRight = 0, s._isXboxOnePad = !1, s.type = e.Gamepad.XBOX, s._isXboxOnePad = o, s
                        }
                        return b(n, i), n.prototype.onlefttriggerchanged = function(e) {
                            this._onlefttriggerchanged = e
                        }, n.prototype.onrighttriggerchanged = function(e) {
                            this._onrighttriggerchanged = e
                        }, Object.defineProperty(n.prototype, "leftTrigger", {
                            get: function() {
                                return this._leftTrigger
                            },
                            set: function(e) {
                                this._onlefttriggerchanged && this._leftTrigger !== e && this._onlefttriggerchanged(e), this._leftTrigger = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "rightTrigger", {
                            get: function() {
                                return this._rightTrigger
                            },
                            set: function(e) {
                                this._onrighttriggerchanged && this._rightTrigger !== e && this._onrighttriggerchanged(e), this._rightTrigger = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), n.prototype.onbuttondown = function(e) {
                            this._onbuttondown = e
                        }, n.prototype.onbuttonup = function(e) {
                            this._onbuttonup = e
                        }, n.prototype.ondpaddown = function(e) {
                            this._ondpaddown = e
                        }, n.prototype.ondpadup = function(e) {
                            this._ondpadup = e
                        }, n.prototype._setButtonValue = function(e, t, i) {
                            return e !== t && (1 === e && (this._onbuttondown && this._onbuttondown(i), this.onButtonDownObservable.notifyObservers(i)), 0 === e && (this._onbuttonup && this._onbuttonup(i), this.onButtonUpObservable.notifyObservers(i))), e
                        }, n.prototype._setDPadValue = function(e, t, i) {
                            return e !== t && (1 === e && (this._ondpaddown && this._ondpaddown(i), this.onPadDownObservable.notifyObservers(i)), 0 === e && (this._ondpadup && this._ondpadup(i), this.onPadUpObservable.notifyObservers(i))), e
                        }, Object.defineProperty(n.prototype, "buttonA", {
                            get: function() {
                                return this._buttonA
                            },
                            set: function(e) {
                                this._buttonA = this._setButtonValue(e, this._buttonA, t.A)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "buttonB", {
                            get: function() {
                                return this._buttonB
                            },
                            set: function(e) {
                                this._buttonB = this._setButtonValue(e, this._buttonB, t.B)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "buttonX", {
                            get: function() {
                                return this._buttonX
                            },
                            set: function(e) {
                                this._buttonX = this._setButtonValue(e, this._buttonX, t.X)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "buttonY", {
                            get: function() {
                                return this._buttonY
                            },
                            set: function(e) {
                                this._buttonY = this._setButtonValue(e, this._buttonY, t.Y)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "buttonStart", {
                            get: function() {
                                return this._buttonStart
                            },
                            set: function(e) {
                                this._buttonStart = this._setButtonValue(e, this._buttonStart, t.Start)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "buttonBack", {
                            get: function() {
                                return this._buttonBack
                            },
                            set: function(e) {
                                this._buttonBack = this._setButtonValue(e, this._buttonBack, t.Back)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "buttonLB", {
                            get: function() {
                                return this._buttonLB
                            },
                            set: function(e) {
                                this._buttonLB = this._setButtonValue(e, this._buttonLB, t.LB)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "buttonRB", {
                            get: function() {
                                return this._buttonRB
                            },
                            set: function(e) {
                                this._buttonRB = this._setButtonValue(e, this._buttonRB, t.RB)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "buttonLeftStick", {
                            get: function() {
                                return this._buttonLeftStick
                            },
                            set: function(e) {
                                this._buttonLeftStick = this._setButtonValue(e, this._buttonLeftStick, t.LeftStick)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "buttonRightStick", {
                            get: function() {
                                return this._buttonRightStick
                            },
                            set: function(e) {
                                this._buttonRightStick = this._setButtonValue(e, this._buttonRightStick, t.RightStick)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "dPadUp", {
                            get: function() {
                                return this._dPadUp
                            },
                            set: function(e) {
                                this._dPadUp = this._setDPadValue(e, this._dPadUp, r.Up)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "dPadDown", {
                            get: function() {
                                return this._dPadDown
                            },
                            set: function(e) {
                                this._dPadDown = this._setDPadValue(e, this._dPadDown, r.Down)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "dPadLeft", {
                            get: function() {
                                return this._dPadLeft
                            },
                            set: function(e) {
                                this._dPadLeft = this._setDPadValue(e, this._dPadLeft, r.Left)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(n.prototype, "dPadRight", {
                            get: function() {
                                return this._dPadRight
                            },
                            set: function(e) {
                                this._dPadRight = this._setDPadValue(e, this._dPadRight, r.Right)
                            },
                            enumerable: !0,
                            configurable: !0
                        }), n.prototype.update = function() {
                            i.prototype.update.call(this), this._isXboxOnePad ? (this.buttonA = this.browserGamepad.buttons[0].value, this.buttonB = this.browserGamepad.buttons[1].value, this.buttonX = this.browserGamepad.buttons[2].value, this.buttonY = this.browserGamepad.buttons[3].value, this.buttonLB = this.browserGamepad.buttons[4].value, this.buttonRB = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.axes[2], this.rightTrigger = this.browserGamepad.axes[5], this.buttonBack = this.browserGamepad.buttons[9].value, this.buttonStart = this.browserGamepad.buttons[8].value, this.buttonLeftStick = this.browserGamepad.buttons[6].value, this.buttonRightStick = this.browserGamepad.buttons[7].value, this.dPadUp = this.browserGamepad.buttons[11].value, this.dPadDown = this.browserGamepad.buttons[12].value, this.dPadLeft = this.browserGamepad.buttons[13].value, this.dPadRight = this.browserGamepad.buttons[14].value) : (this.buttonA = this.browserGamepad.buttons[0].value, this.buttonB = this.browserGamepad.buttons[1].value, this.buttonX = this.browserGamepad.buttons[2].value, this.buttonY = this.browserGamepad.buttons[3].value, this.buttonLB = this.browserGamepad.buttons[4].value, this.buttonRB = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.buttons[6].value, this.rightTrigger = this.browserGamepad.buttons[7].value, this.buttonBack = this.browserGamepad.buttons[8].value, this.buttonStart = this.browserGamepad.buttons[9].value, this.buttonLeftStick = this.browserGamepad.buttons[10].value, this.buttonRightStick = this.browserGamepad.buttons[11].value, this.dPadUp = this.browserGamepad.buttons[12].value, this.dPadDown = this.browserGamepad.buttons[13].value, this.dPadLeft = this.browserGamepad.buttons[14].value, this.dPadRight = this.browserGamepad.buttons[15].value)
                        }, n.prototype.dispose = function() {
                            i.prototype.dispose.call(this), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear(), this.onPadDownObservable.clear(), this.onPadUpObservable.clear()
                        }, n
                    }(e.Gamepad);
                    e.Xbox360Pad = o
                }($a || ($a = {})),
                function(e) {
                    var t, i;
                    (i = t = e.PoseEnabledControllerType || (e.PoseEnabledControllerType = {}))[i.VIVE = 0] = "VIVE", i[i.OCULUS = 1] = "OCULUS", i[i.WINDOWS = 2] = "WINDOWS", i[i.GEAR_VR = 3] = "GEAR_VR", i[i.DAYDREAM = 4] = "DAYDREAM", i[i.GENERIC = 5] = "GENERIC";
                    var r = function() {
                        function t() {}
                        return t.InitiateController = function(t) {
                            return -1 !== t.id.indexOf("Oculus Touch") ? new e.OculusTouchController(t) : 0 === t.id.indexOf(e.WindowsMotionController.GAMEPAD_ID_PREFIX) ? new e.WindowsMotionController(t) : -1 !== t.id.toLowerCase().indexOf("openvr") ? new e.ViveController(t) : 0 === t.id.indexOf(e.GearVRController.GAMEPAD_ID_PREFIX) || -1 !== t.id.indexOf("Oculus Go") ? new e.GearVRController(t) : 0 === t.id.indexOf(e.DaydreamController.GAMEPAD_ID_PREFIX) ? new e.DaydreamController(t) : new e.GenericController(t)
                        }, t
                    }();
                    e.PoseEnabledControllerHelper = r;
                    var n = function(i) {
                        function r(r) {
                            var n = i.call(this, r.id, r.index, r) || this;
                            return n._deviceRoomPosition = e.Vector3.Zero(), n._deviceRoomRotationQuaternion = new e.Quaternion, n.devicePosition = e.Vector3.Zero(), n.deviceRotationQuaternion = new e.Quaternion, n.deviceScaleFactor = 1, n._trackPosition = !0, n._maxRotationDistFromHeadset = Math.PI / 5, n._draggedRoomRotation = 0, n._leftHandSystemQuaternion = new e.Quaternion, n._deviceToWorld = e.Matrix.Identity(), n._pointingPoseNode = null, n._workingMatrix = e.Matrix.Identity(), n._meshAttachedObservable = new e.Observable, n.type = e.Gamepad.POSE_ENABLED, n.controllerType = t.GENERIC, n.position = e.Vector3.Zero(), n.rotationQuaternion = new e.Quaternion, n._calculatedPosition = e.Vector3.Zero(), n._calculatedRotation = new e.Quaternion, e.Quaternion.RotationYawPitchRollToRef(Math.PI, 0, 0, n._leftHandSystemQuaternion), n
                        }
                        return b(r, i), r.prototype._disableTrackPosition = function(e) {
                            this._trackPosition && (this._calculatedPosition.copyFrom(e), this._trackPosition = !1)
                        }, r.prototype.update = function() {
                            i.prototype.update.call(this), this._updatePoseAndMesh()
                        }, r.prototype._updatePoseAndMesh = function() {
                            var t = this.browserGamepad.pose;
                            if (this.updateFromDevice(t), !this._trackPosition && e.Engine.LastCreatedScene && e.Engine.LastCreatedScene.activeCamera && e.Engine.LastCreatedScene.activeCamera.devicePosition && ((i = e.Engine.LastCreatedScene.activeCamera)._computeDevicePosition(), this._deviceToWorld.setTranslation(i.devicePosition), i.deviceRotationQuaternion)) {
                                var i;
                                (i = i)._deviceRoomRotationQuaternion.toEulerAnglesToRef(e.Tmp.Vector3[0]);
                                var r = Math.atan2(Math.sin(e.Tmp.Vector3[0].y - this._draggedRoomRotation), Math.cos(e.Tmp.Vector3[0].y - this._draggedRoomRotation));
                                if (Math.abs(r) > this._maxRotationDistFromHeadset) {
                                    var n = r - (r < 0 ? -this._maxRotationDistFromHeadset : this._maxRotationDistFromHeadset);
                                    this._draggedRoomRotation += n;
                                    var o = Math.sin(-n),
                                        s = Math.cos(-n);
                                    this._calculatedPosition.x = this._calculatedPosition.x * s - this._calculatedPosition.z * o, this._calculatedPosition.z = this._calculatedPosition.x * o + this._calculatedPosition.z * s
                                }
                            }
                            e.Vector3.TransformCoordinatesToRef(this._calculatedPosition, this._deviceToWorld, this.devicePosition), this._deviceToWorld.getRotationMatrixToRef(this._workingMatrix), e.Quaternion.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion), this.deviceRotationQuaternion.multiplyInPlace(this._calculatedRotation), this._mesh && (this._mesh.position.copyFrom(this.devicePosition), this._mesh.rotationQuaternion && this._mesh.rotationQuaternion.copyFrom(this.deviceRotationQuaternion))
                        }, r.prototype.updateFromDevice = function(e) {
                            if (e) {
                                (this.rawPose = e).position && (this._deviceRoomPosition.copyFromFloats(e.position[0], e.position[1], -e.position[2]), this._mesh && this._mesh.getScene().useRightHandedSystem && (this._deviceRoomPosition.z *= -1), this._trackPosition && this._deviceRoomPosition.scaleToRef(this.deviceScaleFactor, this._calculatedPosition), this._calculatedPosition.addInPlace(this.position));
                                var t = this.rawPose;
                                e.orientation && t.orientation && (this._deviceRoomRotationQuaternion.copyFromFloats(t.orientation[0], t.orientation[1], -t.orientation[2], -t.orientation[3]), this._mesh && (this._mesh.getScene().useRightHandedSystem ? (this._deviceRoomRotationQuaternion.z *= -1, this._deviceRoomRotationQuaternion.w *= -1) : this._deviceRoomRotationQuaternion.multiplyToRef(this._leftHandSystemQuaternion, this._deviceRoomRotationQuaternion)), this._deviceRoomRotationQuaternion.multiplyToRef(this.rotationQuaternion, this._calculatedRotation))
                            }
                        }, r.prototype.attachToMesh = function(t) {
                            if (this._mesh && (this._mesh.parent = null), this._mesh = t, this._poseControlledCamera && (this._mesh.parent = this._poseControlledCamera), this._mesh.rotationQuaternion || (this._mesh.rotationQuaternion = new e.Quaternion), this._updatePoseAndMesh(), this._pointingPoseNode) {
                                for (var i = [], r = this._pointingPoseNode; r.parent;) i.push(r.parent), r = r.parent;
                                i.reverse().forEach(function(e) {
                                    e.computeWorldMatrix(!0)
                                })
                            }
                            this._meshAttachedObservable.notifyObservers(t)
                        }, r.prototype.attachToPoseControlledCamera = function(e) {
                            this._poseControlledCamera = e, this._mesh && (this._mesh.parent = this._poseControlledCamera)
                        }, r.prototype.dispose = function() {
                            this._mesh && this._mesh.dispose(), this._mesh = null, i.prototype.dispose.call(this)
                        }, Object.defineProperty(r.prototype, "mesh", {
                            get: function() {
                                return this._mesh
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.getForwardRay = function(t) {
                            if (void 0 === t && (t = 100), !this.mesh) return new e.Ray(e.Vector3.Zero(), new e.Vector3(0, 0, 1), t);
                            var i = this._pointingPoseNode ? this._pointingPoseNode.getWorldMatrix() : this.mesh.getWorldMatrix(),
                                r = i.getTranslation(),
                                n = new e.Vector3(0, 0, -1),
                                o = e.Vector3.TransformNormal(n, i),
                                s = e.Vector3.Normalize(o);
                            return new e.Ray(r, s, t)
                        }, r.POINTING_POSE = "POINTING_POSE", r
                    }(e.Gamepad);
                    e.PoseEnabledController = n
                }($a || ($a = {})), Lr = $a || ($a = {}), Br = function(e) {
                    function t(t) {
                        var i = e.call(this, t) || this;
                        return i.onTriggerStateChangedObservable = new Lr.Observable, i.onMainButtonStateChangedObservable = new Lr.Observable, i.onSecondaryButtonStateChangedObservable = new Lr.Observable, i.onPadStateChangedObservable = new Lr.Observable, i.onPadValuesChangedObservable = new Lr.Observable, i.pad = {
                            x: 0,
                            y: 0
                        }, i._changes = {
                            pressChanged: !1,
                            touchChanged: !1,
                            valueChanged: !1,
                            changed: !1
                        }, i._buttons = new Array(t.buttons.length), i.hand = t.hand, i
                    }
                    return b(t, e),
                        t.prototype.onButtonStateChange = function(e) {
                            this._onButtonStateChange = e
                        }, Object.defineProperty(t.prototype, "defaultModel", {
                            get: function() {
                                return this._defaultModel
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.update = function() {
                            e.prototype.update.call(this);
                            for (var t = 0; t < this._buttons.length; t++) this._setButtonValue(this.browserGamepad.buttons[t], this._buttons[t], t);
                            this.leftStick.x === this.pad.x && this.leftStick.y === this.pad.y || (this.pad.x = this.leftStick.x, this.pad.y = this.leftStick.y, this.onPadValuesChangedObservable.notifyObservers(this.pad))
                        }, t.prototype._setButtonValue = function(e, t, i) {
                            e || (e = {
                                pressed: !1,
                                touched: !1,
                                value: 0
                            }), t ? (this._checkChanges(e, t), this._changes.changed && (this._onButtonStateChange && this._onButtonStateChange(this.index, i, e), this._handleButtonChange(i, e, this._changes)), this._buttons[i].pressed = e.pressed, this._buttons[i].touched = e.touched, this._buttons[i].value = e.value < 1e-8 ? 0 : e.value) : this._buttons[i] = {
                                pressed: e.pressed,
                                touched: e.touched,
                                value: e.value
                            }
                        }, t.prototype._checkChanges = function(e, t) {
                            return this._changes.pressChanged = e.pressed !== t.pressed, this._changes.touchChanged = e.touched !== t.touched, this._changes.valueChanged = e.value !== t.value, this._changes.changed = this._changes.pressChanged || this._changes.touchChanged || this._changes.valueChanged, this._changes
                        }, t.prototype.dispose = function() {
                            e.prototype.dispose.call(this), this.onTriggerStateChangedObservable.clear(), this.onMainButtonStateChangedObservable.clear(), this.onSecondaryButtonStateChangedObservable.clear(), this.onPadStateChangedObservable.clear(), this.onPadValuesChangedObservable.clear()
                        }, t
                }(Lr.PoseEnabledController), Lr.WebVRController = Br, Fr = $a || ($a = {}), Nr = function(e) {
                    function t(t) {
                        var i = e.call(this, t) || this;
                        return i.onSecondaryTriggerStateChangedObservable = new Fr.Observable, i.onThumbRestChangedObservable = new Fr.Observable, i.controllerType = Fr.PoseEnabledControllerType.OCULUS, i
                    }
                    return b(t, e), t.prototype.initControllerMesh = function(e, i) {
                        var r, n = this;
                        r = "left" === this.hand ? t.MODEL_LEFT_FILENAME : t.MODEL_RIGHT_FILENAME, Fr.SceneLoader.ImportMesh("", t.MODEL_BASE_URL, r, e, function(e) {
                            n._defaultModel = e[1], n.attachToMesh(n._defaultModel), i && i(n._defaultModel)
                        })
                    }, Object.defineProperty(t.prototype, "onAButtonStateChangedObservable", {
                        get: function() {
                            if ("right" === this.hand) return this.onMainButtonStateChangedObservable;
                            throw new Error("No A button on left hand")
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onBButtonStateChangedObservable", {
                        get: function() {
                            if ("right" === this.hand) return this.onSecondaryButtonStateChangedObservable;
                            throw new Error("No B button on left hand")
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onXButtonStateChangedObservable", {
                        get: function() {
                            if ("left" === this.hand) return this.onMainButtonStateChangedObservable;
                            throw new Error("No X button on right hand")
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onYButtonStateChangedObservable", {
                        get: function() {
                            if ("left" === this.hand) return this.onSecondaryButtonStateChangedObservable;
                            throw new Error("No Y button on right hand")
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._handleButtonChange = function(e, t, i) {
                        var r = t,
                            n = "right" === this.hand ? -1 : 1;
                        switch (e) {
                            case 0:
                                return void this.onPadStateChangedObservable.notifyObservers(r);
                            case 1:
                                return this._defaultModel && (this._defaultModel.getChildren()[3].rotation.x = .2 * -r.value, this._defaultModel.getChildren()[3].position.y = .005 * -r.value, this._defaultModel.getChildren()[3].position.z = .005 * -r.value), void this.onTriggerStateChangedObservable.notifyObservers(r);
                            case 2:
                                return this._defaultModel && (this._defaultModel.getChildren()[4].position.x = n * r.value * .0035), void this.onSecondaryTriggerStateChangedObservable.notifyObservers(r);
                            case 3:
                                return this._defaultModel && (r.pressed ? this._defaultModel.getChildren()[1].position.y = -.001 : this._defaultModel.getChildren()[1].position.y = 0), void this.onMainButtonStateChangedObservable.notifyObservers(r);
                            case 4:
                                return this._defaultModel && (r.pressed ? this._defaultModel.getChildren()[2].position.y = -.001 : this._defaultModel.getChildren()[2].position.y = 0), void this.onSecondaryButtonStateChangedObservable.notifyObservers(r);
                            case 5:
                                return void this.onThumbRestChangedObservable.notifyObservers(r)
                        }
                    }, t.MODEL_BASE_URL = "https://controllers.babylonjs.com/oculus/", t.MODEL_LEFT_FILENAME = "left.babylon", t.MODEL_RIGHT_FILENAME = "right.babylon", t
                }(Fr.WebVRController), Fr.OculusTouchController = Nr, Vr = $a || ($a = {}), kr = function(e) {
                    function t(t) {
                        var i = e.call(this, t) || this;
                        return i.controllerType = Vr.PoseEnabledControllerType.VIVE, i._invertLeftStickY = !0, i
                    }
                    return b(t, e), t.prototype.initControllerMesh = function(e, i) {
                        var r = this;
                        Vr.SceneLoader.ImportMesh("", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(e) {
                            r._defaultModel = e[1], r.attachToMesh(r._defaultModel), i && i(r._defaultModel)
                        })
                    }, Object.defineProperty(t.prototype, "onLeftButtonStateChangedObservable", {
                        get: function() {
                            return this.onMainButtonStateChangedObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onRightButtonStateChangedObservable", {
                        get: function() {
                            return this.onMainButtonStateChangedObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onMenuButtonStateChangedObservable", {
                        get: function() {
                            return this.onSecondaryButtonStateChangedObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._handleButtonChange = function(e, t, i) {
                        var r = t;
                        switch (e) {
                            case 0:
                                return void this.onPadStateChangedObservable.notifyObservers(r);
                            case 1:
                                return this._defaultModel && (this._defaultModel.getChildren()[6].rotation.x = .15 * -r.value), void this.onTriggerStateChangedObservable.notifyObservers(r);
                            case 2:
                                return void this.onMainButtonStateChangedObservable.notifyObservers(r);
                            case 3:
                                return this._defaultModel && (r.pressed ? this._defaultModel.getChildren()[2].position.y = -.001 : this._defaultModel.getChildren()[2].position.y = 0), void this.onSecondaryButtonStateChangedObservable.notifyObservers(r)
                        }
                    }, t.MODEL_BASE_URL = "https://controllers.babylonjs.com/vive/", t.MODEL_FILENAME = "wand.babylon", t
                }(Vr.WebVRController), Vr.ViveController = kr, Ur = $a || ($a = {}), Gr = function(e) {
                    function t(t) {
                        return e.call(this, t) || this
                    }
                    return b(t, e), t.prototype.initControllerMesh = function(e, i) {
                        var r = this;
                        Ur.SceneLoader.ImportMesh("", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(e) {
                            r._defaultModel = e[1], r.attachToMesh(r._defaultModel), i && i(r._defaultModel)
                        })
                    }, t.prototype._handleButtonChange = function(e, t, i) {}, t.MODEL_BASE_URL = "https://controllers.babylonjs.com/generic/", t.MODEL_FILENAME = "generic.babylon", t
                }(Ur.WebVRController), Ur.GenericController = Gr, zr = $a || ($a = {}), jr = function() {
                    this.buttonMeshes = {}, this.axisMeshes = {}
                }, Hr = function(e) {
                    function t(t) {
                        var i = e.call(this, t) || this;
                        return i._mapping = {
                            buttons: ["thumbstick", "trigger", "grip", "menu", "trackpad"],
                            buttonMeshNames: {
                                trigger: "SELECT",
                                menu: "MENU",
                                grip: "GRASP",
                                thumbstick: "THUMBSTICK_PRESS",
                                trackpad: "TOUCHPAD_PRESS"
                            },
                            buttonObservableNames: {
                                trigger: "onTriggerStateChangedObservable",
                                menu: "onSecondaryButtonStateChangedObservable",
                                grip: "onMainButtonStateChangedObservable",
                                thumbstick: "onPadStateChangedObservable",
                                trackpad: "onTrackpadChangedObservable"
                            },
                            axisMeshNames: ["THUMBSTICK_X", "THUMBSTICK_Y", "TOUCHPAD_TOUCH_X", "TOUCHPAD_TOUCH_Y"],
                            pointingPoseMeshName: zr.PoseEnabledController.POINTING_POSE
                        }, i.onTrackpadChangedObservable = new zr.Observable, i.onTrackpadValuesChangedObservable = new zr.Observable, i.trackpad = {
                            x: 0,
                            y: 0
                        }, i.controllerType = zr.PoseEnabledControllerType.WINDOWS, i._loadedMeshInfo = null, i
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "onTriggerButtonStateChangedObservable", {
                        get: function() {
                            return this.onTriggerStateChangedObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onMenuButtonStateChangedObservable", {
                        get: function() {
                            return this.onSecondaryButtonStateChangedObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onGripButtonStateChangedObservable", {
                        get: function() {
                            return this.onMainButtonStateChangedObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onThumbstickButtonStateChangedObservable", {
                        get: function() {
                            return this.onPadStateChangedObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onTouchpadButtonStateChangedObservable", {
                        get: function() {
                            return this.onTrackpadChangedObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "onTouchpadValuesChangedObservable", {
                        get: function() {
                            return this.onTrackpadValuesChangedObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._updateTrackpad = function() {
                        !this.browserGamepad.axes || this.browserGamepad.axes[2] == this.trackpad.x && this.browserGamepad.axes[3] == this.trackpad.y || (this.trackpad.x = this.browserGamepad.axes[2], this.trackpad.y = this.browserGamepad.axes[3], this.onTrackpadValuesChangedObservable.notifyObservers(this.trackpad))
                    }, t.prototype.update = function() {
                        if (e.prototype.update.call(this), this.browserGamepad.axes && (this._updateTrackpad(), this._loadedMeshInfo))
                            for (var t = 0; t < this._mapping.axisMeshNames.length; t++) this._lerpAxisTransform(t, this.browserGamepad.axes[t])
                    }, t.prototype._handleButtonChange = function(e, t, i) {
                        var r = this._mapping.buttons[e];
                        if (r) {
                            this._updateTrackpad();
                            var n = this[this._mapping.buttonObservableNames[r]];
                            n && n.notifyObservers(t), this._lerpButtonTransform(r, t.value)
                        }
                    }, t.prototype._lerpButtonTransform = function(e, t) {
                        if (this._loadedMeshInfo) {
                            var i = this._loadedMeshInfo.buttonMeshes[e];
                            i.unpressed.rotationQuaternion && i.pressed.rotationQuaternion && i.value.rotationQuaternion && (zr.Quaternion.SlerpToRef(i.unpressed.rotationQuaternion, i.pressed.rotationQuaternion, t, i.value.rotationQuaternion), zr.Vector3.LerpToRef(i.unpressed.position, i.pressed.position, t, i.value.position))
                        }
                    }, t.prototype._lerpAxisTransform = function(e, t) {
                        if (this._loadedMeshInfo) {
                            var i = this._loadedMeshInfo.axisMeshes[e];
                            if (i && i.min.rotationQuaternion && i.max.rotationQuaternion && i.value.rotationQuaternion) {
                                var r = .5 * t + .5;
                                zr.Quaternion.SlerpToRef(i.min.rotationQuaternion, i.max.rotationQuaternion, r, i.value.rotationQuaternion), zr.Vector3.LerpToRef(i.min.position, i.max.position, r, i.value.position)
                            }
                        }
                    }, t.prototype.initControllerMesh = function(e, i, r) {
                        var n, o, s = this;
                        if (void 0 === r && (r = !1), zr.SceneLoader.IsPluginForExtensionAvailable(".glb")) {
                            var a = "default";
                            if (this.id && !r) {
                                var l = this.id.match(t.GAMEPAD_ID_PATTERN);
                                a = l && l[0] || a
                            }
                            o = "left" === this.hand ? t.MODEL_LEFT_FILENAME : t.MODEL_RIGHT_FILENAME, n = t.MODEL_BASE_URL + a + "/"
                        } else zr.Tools.Warn("You need to reference GLTF loader to load Windows Motion Controllers model. Falling back to generic models"), n = zr.GenericController.MODEL_BASE_URL, o = zr.GenericController.MODEL_FILENAME;
                        zr.SceneLoader.ImportMesh("", n, o, e, function(t) {
                            s._loadedMeshInfo = s.processModel(e, t), s._loadedMeshInfo && (s._defaultModel = s._loadedMeshInfo.rootNode, s.attachToMesh(s._defaultModel), i && i(s._defaultModel))
                        }, null, function(e, t) {
                            zr.Tools.Log(t), zr.Tools.Warn("Failed to retrieve controller model from the remote server: " + n + o), r || s.initControllerMesh(e, i, !0)
                        })
                    }, t.prototype.processModel = function(e, t) {
                        for (var i = null, r = new zr.Mesh(this.id + " " + this.hand, e), n = null, o = 0; o < t.length; o++) {
                            var s = t[o];
                            if (!s.parent) {
                                s.isPickable = !1, n = s;
                                break
                            }
                        }
                        return n ? (n.setParent(r), i = this.createMeshInfo(r)) : zr.Tools.Warn("Could not find root node in model file."), i
                    }, t.prototype.createMeshInfo = function(e) {
                        function t(e, t) {
                            return e.getChildMeshes(!1, function(e) {
                                return e.name === t
                            })[0]
                        }

                        function i(e, t) {
                            return e.getChildMeshes(!0, function(e) {
                                return e.name == t
                            })[0]
                        }
                        var r, n = new jr;
                        for (n.rootNode = e, n.buttonMeshes = {}, n.axisMeshes = {}, r = 0; r < this._mapping.buttons.length; r++) {
                            var o = this._mapping.buttonMeshNames[this._mapping.buttons[r]];
                            if (o) {
                                var s = t(e, o);
                                if (s) {
                                    var a = {
                                        index: r,
                                        value: i(s, "VALUE"),
                                        pressed: i(s, "PRESSED"),
                                        unpressed: i(s, "UNPRESSED")
                                    };
                                    a.value && a.pressed && a.unpressed ? n.buttonMeshes[this._mapping.buttons[r]] = a : zr.Tools.Warn("Missing button submesh under mesh with name: " + o + "(VALUE: " + !!a.value + ", PRESSED: " + !!a.pressed + ", UNPRESSED:" + !!a.unpressed + ")")
                                } else zr.Tools.Warn("Missing button mesh with name: " + o)
                            } else zr.Tools.Log("Skipping unknown button at index: " + r + " with mapped name: " + this._mapping.buttons[r])
                        }
                        for (r = 0; r < this._mapping.axisMeshNames.length; r++) {
                            var l = this._mapping.axisMeshNames[r];
                            if (l) {
                                var u = t(e, l);
                                if (u) {
                                    var c = {
                                        index: r,
                                        value: i(u, "VALUE"),
                                        min: i(u, "MIN"),
                                        max: i(u, "MAX")
                                    };
                                    c.value && c.min && c.max ? n.axisMeshes[r] = c : zr.Tools.Warn("Missing axis submesh under mesh with name: " + l + "(VALUE: " + !!c.value + ", MIN: " + !!c.min + ", MAX:" + !!c.max + ")")
                                } else zr.Tools.Warn("Missing axis mesh with name: " + l)
                            } else zr.Tools.Log("Skipping unknown axis at index: " + r)
                        }
                        return n.pointingPoseNode = t(e, this._mapping.pointingPoseMeshName), n.pointingPoseNode ? this._pointingPoseNode = n.pointingPoseNode : zr.Tools.Warn("Missing pointing pose mesh with name: " + this._mapping.pointingPoseMeshName), n
                    }, t.prototype.getForwardRay = function(t) {
                        if (void 0 === t && (t = 100), !this._loadedMeshInfo || !this._loadedMeshInfo.pointingPoseNode) return e.prototype.getForwardRay.call(this, t);
                        var i = this._loadedMeshInfo.pointingPoseNode.getWorldMatrix(),
                            r = i.getTranslation(),
                            n = new zr.Vector3(0, 0, -1),
                            o = zr.Vector3.TransformNormal(n, i),
                            s = zr.Vector3.Normalize(o);
                        return new zr.Ray(r, s, t)
                    }, t.prototype.dispose = function() {
                        e.prototype.dispose.call(this), this.onTrackpadChangedObservable.clear()
                    }, t.MODEL_BASE_URL = "https://controllers.babylonjs.com/microsoft/", t.MODEL_LEFT_FILENAME = "left.glb", t.MODEL_RIGHT_FILENAME = "right.glb", t.GAMEPAD_ID_PREFIX = "Spatial Controller (Spatial Interaction Source) ", t.GAMEPAD_ID_PATTERN = /([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/, t
                }(zr.WebVRController), zr.WindowsMotionController = Hr, Wr = $a || ($a = {}), Xr = function(e) {
                    function t(t) {
                        var i = e.call(this, t) || this;
                        return i._buttonIndexToObservableNameMap = ["onTrackpadChangedObservable", "onTriggerStateChangedObservable"], i.controllerType = Wr.PoseEnabledControllerType.GEAR_VR, i._calculatedPosition = new Wr.Vector3("left" == i.hand ? -.15 : .15, -.5, .25), i._disableTrackPosition(i._calculatedPosition), i
                    }
                    return b(t, e), t.prototype.initControllerMesh = function(e, i) {
                        var r = this;
                        Wr.SceneLoader.ImportMesh("", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(t) {
                            var n = new Wr.Mesh("", e);
                            t[1].parent = n, t[1].position.z = -.15, r._defaultModel = n, r.attachToMesh(r._defaultModel), i && i(r._defaultModel)
                        })
                    }, t.prototype._handleButtonChange = function(e, t, i) {
                        if (e < this._buttonIndexToObservableNameMap.length) {
                            var r = this[this._buttonIndexToObservableNameMap[e]];
                            r && r.notifyObservers(t)
                        }
                    }, t.MODEL_BASE_URL = "https://controllers.babylonjs.com/generic/", t.MODEL_FILENAME = "generic.babylon", t.GAMEPAD_ID_PREFIX = "Gear VR", t
                }(Wr.WebVRController), Wr.GearVRController = Xr, Yr = $a || ($a = {}), qr = function(e) {
                    function t(t) {
                        var i = e.call(this, t) || this;
                        return i.controllerType = Yr.PoseEnabledControllerType.DAYDREAM, i
                    }
                    return b(t, e), t.prototype.initControllerMesh = function(e, i) {
                        var r = this;
                        Yr.SceneLoader.ImportMesh("", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(e) {
                            r._defaultModel = e[1], r.attachToMesh(r._defaultModel), i && i(r._defaultModel)
                        })
                    }, t.prototype._handleButtonChange = function(e, t, i) {
                        if (0 === e) {
                            var r = this.onTriggerStateChangedObservable;
                            r && r.notifyObservers(t)
                        } else Yr.Tools.Warn("Unrecognized Daydream button index: " + e)
                    }, t.MODEL_BASE_URL = "https://controllers.babylonjs.com/generic/", t.MODEL_FILENAME = "generic.babylon", t.GAMEPAD_ID_PREFIX = "Daydream", t
                }(Yr.WebVRController), Yr.DaydreamController = qr,
                function(e) {
                    Object.defineProperty(e.Scene.prototype, "gamepadManager", {
                        get: function() {
                            if (!this._gamepadManager) {
                                this._gamepadManager = new e.GamepadManager(this);
                                var i = this._getComponent(e.SceneComponentConstants.NAME_GAMEPAD);
                                i || (i = new t(this), this._addComponent(i))
                            }
                            return this._gamepadManager
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.FreeCameraInputsManager.prototype.addGamepad = function() {
                        return this.add(new e.FreeCameraGamepadInput), this
                    }, e.ArcRotateCameraInputsManager.prototype.addGamepad = function() {
                        return this.add(new e.ArcRotateCameraGamepadInput), this
                    };
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_GAMEPAD, this.scene = t
                        }
                        return t.prototype.register = function() {
                            this.scene._beforeCameraUpdateStage.registerStep(e.SceneComponentConstants.STEP_BEFORECAMERAUPDATE_GAMEPAD, this, this._beforeCameraUpdate)
                        }, t.prototype.rebuild = function() {}, t.prototype.dispose = function() {
                            var e = this.scene._gamepadManager;
                            e && (e.dispose(), this.scene._gamepadManager = null)
                        }, t.prototype._beforeCameraUpdate = function() {
                            var e = this.scene._gamepadManager;
                            e && e._isMonitoring && e._checkGamepadsStatus()
                        }, t
                    }();
                    e.GamepadSystemSceneComponent = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("FollowCamera", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    }), e.Node.AddNodeConstructor("ArcFollowCamera", function(e, t) {
                        return function() {
                            return new i(e, 0, 0, 1, null, t)
                        }
                    });
                    var t = function(t) {
                        function i(e, i, r, n) {
                            void 0 === n && (n = null);
                            var o = t.call(this, e, i, r) || this;
                            return o.radius = 12, o.rotationOffset = 0, o.heightOffset = 4, o.cameraAcceleration = .05, o.maxCameraSpeed = 20, o.lockedTarget = n, o
                        }
                        return b(i, t), i.prototype._follow = function(t) {
                            if (t) {
                                var i;
                                if (t.rotationQuaternion) {
                                    var r = new e.Matrix;
                                    t.rotationQuaternion.toRotationMatrix(r), i = Math.atan2(r.m[8], r.m[10])
                                } else i = t.rotation.y;
                                var n = e.Tools.ToRadians(this.rotationOffset) + i,
                                    o = t.getAbsolutePosition(),
                                    s = o.x + Math.sin(n) * this.radius,
                                    a = o.z + Math.cos(n) * this.radius,
                                    l = s - this.position.x,
                                    u = o.y + this.heightOffset - this.position.y,
                                    c = a - this.position.z,
                                    h = l * this.cameraAcceleration * 2,
                                    d = u * this.cameraAcceleration,
                                    p = c * this.cameraAcceleration * 2;
                                (h > this.maxCameraSpeed || h < -this.maxCameraSpeed) && (h = h < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), (d > this.maxCameraSpeed || d < -this.maxCameraSpeed) && (d = d < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), (p > this.maxCameraSpeed || p < -this.maxCameraSpeed) && (p = p < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), this.position = new e.Vector3(this.position.x + h, this.position.y + d, this.position.z + p), this.setTarget(o)
                            }
                        }, i.prototype._checkInputs = function() {
                            t.prototype._checkInputs.call(this), this.lockedTarget && this._follow(this.lockedTarget)
                        }, i.prototype.getClassName = function() {
                            return "FollowCamera"
                        }, y([e.serialize()], i.prototype, "radius", void 0), y([e.serialize()], i.prototype, "rotationOffset", void 0), y([e.serialize()], i.prototype, "heightOffset", void 0), y([e.serialize()], i.prototype, "cameraAcceleration", void 0), y([e.serialize()], i.prototype, "maxCameraSpeed", void 0), y([e.serializeAsMeshReference("lockedTargetId")], i.prototype, "lockedTarget", void 0), i
                    }(e.TargetCamera);
                    e.FollowCamera = t;
                    var i = function(t) {
                        function i(i, r, n, o, s, a) {
                            var l = t.call(this, i, e.Vector3.Zero(), a) || this;
                            return l.alpha = r, l.beta = n, l.radius = o, l.target = s, l._cartesianCoordinates = e.Vector3.Zero(), l._follow(), l
                        }
                        return b(i, t), i.prototype._follow = function() {
                            if (this.target) {
                                this._cartesianCoordinates.x = this.radius * Math.cos(this.alpha) * Math.cos(this.beta), this._cartesianCoordinates.y = this.radius * Math.sin(this.beta), this._cartesianCoordinates.z = this.radius * Math.sin(this.alpha) * Math.cos(this.beta);
                                var e = this.target.getAbsolutePosition();
                                this.position = e.add(this._cartesianCoordinates), this.setTarget(e)
                            }
                        }, i.prototype._checkInputs = function() {
                            t.prototype._checkInputs.call(this), this._follow()
                        }, i.prototype.getClassName = function() {
                            return "ArcFollowCamera"
                        }, i
                    }(e.TargetCamera);
                    e.ArcFollowCamera = i
                }($a || ($a = {})), Kr = $a || ($a = {}), Qr = function(e) {
                    function t(t, i, r) {
                        var n = e.call(this, t, i, r) || this;
                        return n.inputs.addGamepad(), n
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "gamepadAngularSensibility", {
                        get: function() {
                            var e = this.inputs.attached.gamepad;
                            return e ? e.gamepadAngularSensibility : 0
                        },
                        set: function(e) {
                            var t = this.inputs.attached.gamepad;
                            t && (t.gamepadAngularSensibility = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "gamepadMoveSensibility", {
                        get: function() {
                            var e = this.inputs.attached.gamepad;
                            return e ? e.gamepadMoveSensibility : 0
                        },
                        set: function(e) {
                            var t = this.inputs.attached.gamepad;
                            t && (t.gamepadMoveSensibility = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getClassName = function() {
                        return "UniversalCamera"
                    }, t
                }(Kr.TouchCamera), Kr.UniversalCamera = Qr,
                function(e) {
                    e.Node.AddNodeConstructor("GamepadCamera", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(e) {
                        function t(t, i, r) {
                            return e.call(this, t, i, r) || this
                        }
                        return b(t, e), t.prototype.getClassName = function() {
                            return "GamepadCamera"
                        }, t
                    }(e.UniversalCamera);
                    e.GamepadCamera = t
                }($a || ($a = {})), Zr = $a || ($a = {}), Jr = function() {
                    function e() {
                        this._renderPipelines = {}
                    }
                    return e.prototype.addPipeline = function(e) {
                        this._renderPipelines[e._name] = e
                    }, e.prototype.attachCamerasToRenderPipeline = function(e, t, i) {
                        void 0 === i && (i = !1);
                        var r = this._renderPipelines[e];
                        r && r._attachCameras(t, i)
                    }, e.prototype.detachCamerasFromRenderPipeline = function(e, t) {
                        var i = this._renderPipelines[e];
                        i && i._detachCameras(t)
                    }, e.prototype.enableEffectInPipeline = function(e, t, i) {
                        var r = this._renderPipelines[e];
                        r && r._enableEffect(t, i)
                    }, e.prototype.disableEffectInPipeline = function(e, t, i) {
                        var r = this._renderPipelines[e];
                        r && r._disableEffect(t, i)
                    }, e.prototype.update = function() {
                        for (var e in this._renderPipelines)
                            if (this._renderPipelines.hasOwnProperty(e)) {
                                var t = this._renderPipelines[e];
                                t.isSupported ? t._update() : (t.dispose(), delete this._renderPipelines[e])
                            }
                    }, e.prototype._rebuild = function() {
                        for (var e in this._renderPipelines) this._renderPipelines.hasOwnProperty(e) && this._renderPipelines[e]._rebuild()
                    }, e.prototype.dispose = function() {
                        for (var e in this._renderPipelines) this._renderPipelines.hasOwnProperty(e) && this._renderPipelines[e].dispose()
                    }, e
                }(), Zr.PostProcessRenderPipelineManager = Jr,
                function(e) {
                    Object.defineProperty(e.Scene.prototype, "postProcessRenderPipelineManager", {
                        get: function() {
                            if (!this._postProcessRenderPipelineManager) {
                                var i = this._getComponent(e.SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER);
                                i || (i = new t(this), this._addComponent(i)), this._postProcessRenderPipelineManager = new e.PostProcessRenderPipelineManager
                            }
                            return this._postProcessRenderPipelineManager
                        },
                        enumerable: !0,
                        configurable: !0
                    });
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER, this.scene = t
                        }
                        return t.prototype.register = function() {
                            this.scene._gatherRenderTargetsStage.registerStep(e.SceneComponentConstants.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER, this, this._gatherRenderTargets)
                        }, t.prototype.rebuild = function() {
                            this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager._rebuild()
                        }, t.prototype.dispose = function() {
                            this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager.dispose()
                        }, t.prototype._gatherRenderTargets = function(e) {
                            this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager.update()
                        }, t
                    }();
                    e.PostProcessRenderPipelineManagerSceneComponent = t
                }($a || ($a = {})), $r = $a || ($a = {}), en = function() {
                    function e(e, t, i, r) {
                        this._name = t, this._singleInstance = r || !0, this._getPostProcesses = i, this._cameras = {}, this._indicesForCamera = {}, this._postProcesses = {}
                    }
                    return Object.defineProperty(e.prototype, "isSupported", {
                        get: function() {
                            for (var e in this._postProcesses)
                                if (this._postProcesses.hasOwnProperty(e))
                                    for (var t = this._postProcesses[e], i = 0; i < t.length; i++)
                                        if (!t[i].isSupported) return !1;
                            return !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._update = function() {}, e.prototype._attachCameras = function(e) {
                        var t, i = this,
                            r = $r.Tools.MakeArray(e || this._cameras);
                        if (r)
                            for (var n = 0; n < r.length; n++) {
                                var o = r[n],
                                    s = o.name;
                                if (t = this._singleInstance ? 0 : s, !this._postProcesses[t]) {
                                    var a = this._getPostProcesses();
                                    a && (this._postProcesses[t] = Array.isArray(a) ? a : [a])
                                }
                                this._indicesForCamera[s] || (this._indicesForCamera[s] = []), this._postProcesses[t].forEach(function(e) {
                                    var t = o.attachPostProcess(e);
                                    i._indicesForCamera[s].push(t)
                                }), this._cameras[s] || (this._cameras[s] = o)
                            }
                    }, e.prototype._detachCameras = function(e) {
                        var t = $r.Tools.MakeArray(e || this._cameras);
                        if (t)
                            for (var i = 0; i < t.length; i++) {
                                var r = t[i],
                                    n = r.name;
                                this._postProcesses[this._singleInstance ? 0 : n].forEach(function(e) {
                                    r.detachPostProcess(e)
                                }), this._cameras[n] && (this._cameras[n] = null)
                            }
                    }, e.prototype._enable = function(e) {
                        var t = this,
                            i = $r.Tools.MakeArray(e || this._cameras);
                        if (i)
                            for (var r = 0; r < i.length; r++)
                                for (var n = i[r], o = n.name, s = 0; s < this._indicesForCamera[o].length; s++) void 0 !== n._postProcesses[this._indicesForCamera[o][s]] && null !== n._postProcesses[this._indicesForCamera[o][s]] || this._postProcesses[this._singleInstance ? 0 : o].forEach(function(e) {
                                    i[r].attachPostProcess(e, t._indicesForCamera[o][s])
                                })
                    }, e.prototype._disable = function(e) {
                        var t = $r.Tools.MakeArray(e || this._cameras);
                        if (t)
                            for (var i = 0; i < t.length; i++) {
                                var r = t[i],
                                    n = r.name;
                                this._postProcesses[this._singleInstance ? 0 : n].forEach(function(e) {
                                    r.detachPostProcess(e)
                                })
                            }
                    }, e.prototype.getPostProcesses = function(e) {
                        return this._singleInstance ? this._postProcesses[0] : e ? this._postProcesses[e.name] : null
                    }, e
                }(), $r.PostProcessRenderEffect = en, tn = $a || ($a = {}), rn = function() {
                    function e(e, t) {
                        this.engine = e, this._name = t, this._renderEffects = {}, this._renderEffectsForIsolatedPass = new Array, this._cameras = []
                    }
                    return e.prototype.getClassName = function() {
                        return "PostProcessRenderPipeline"
                    }, Object.defineProperty(e.prototype, "isSupported", {
                        get: function() {
                            for (var e in this._renderEffects)
                                if (this._renderEffects.hasOwnProperty(e) && !this._renderEffects[e].isSupported) return !1;
                            return !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.addEffect = function(e) {
                        this._renderEffects[e._name] = e
                    }, e.prototype._rebuild = function() {}, e.prototype._enableEffect = function(e, t) {
                        var i = this._renderEffects[e];
                        i && i._enable(tn.Tools.MakeArray(t || this._cameras))
                    }, e.prototype._disableEffect = function(e, t) {
                        var i = this._renderEffects[e];
                        i && i._disable(tn.Tools.MakeArray(t || this._cameras))
                    }, e.prototype._attachCameras = function(e, t) {
                        var i = tn.Tools.MakeArray(e || this._cameras);
                        if (i) {
                            var r, n = [];
                            for (r = 0; r < i.length; r++) {
                                var o = i[r],
                                    s = o.name; - 1 === this._cameras.indexOf(o) ? this._cameras[s] = o : t && n.push(r)
                            }
                            for (r = 0; r < n.length; r++) e.splice(n[r], 1);
                            for (var a in this._renderEffects) this._renderEffects.hasOwnProperty(a) && this._renderEffects[a]._attachCameras(i)
                        }
                    }, e.prototype._detachCameras = function(e) {
                        var t = tn.Tools.MakeArray(e || this._cameras);
                        if (t) {
                            for (var i in this._renderEffects) this._renderEffects.hasOwnProperty(i) && this._renderEffects[i]._detachCameras(t);
                            for (var r = 0; r < t.length; r++) this._cameras.splice(this._cameras.indexOf(t[r]), 1)
                        }
                    }, e.prototype._update = function() {
                        for (var e in this._renderEffects) this._renderEffects.hasOwnProperty(e) && this._renderEffects[e]._update();
                        for (var t = 0; t < this._cameras.length; t++) {
                            var i = this._cameras[t].name;
                            this._renderEffectsForIsolatedPass[i] && this._renderEffectsForIsolatedPass[i]._update()
                        }
                    }, e.prototype._reset = function() {
                        this._renderEffects = {}, this._renderEffectsForIsolatedPass = new Array
                    }, e.prototype._enableMSAAOnFirstPostProcess = function(e) {
                        var t = Object.keys(this._renderEffects);
                        if (2 <= this.engine.webGLVersion && 0 < t.length) {
                            var i = this._renderEffects[t[0]].getPostProcesses();
                            if (i) return i[0].samples = e, !0
                        }
                        return !1
                    }, e.prototype.dispose = function() {}, y([tn.serialize()], e.prototype, "_name", void 0), e
                }(), tn.PostProcessRenderPipeline = rn, nn = $a || ($a = {}), on = function() {
                    function e(e, t, i) {
                        void 0 === t && (t = nn.Engine.TEXTURETYPE_FLOAT), void 0 === i && (i = null);
                        var r = this;
                        this.useOnlyInActiveCamera = !1;
                        var n = (this._scene = e)._getComponent(nn.SceneComponentConstants.NAME_DEPTHRENDERER);
                        n || (n = new nn.DepthRendererSceneComponent(e), e._addComponent(n)), this._camera = i;
                        var o = e.getEngine();
                        this._depthMap = new nn.RenderTargetTexture("depthMap", {
                            width: o.getRenderWidth(),
                            height: o.getRenderHeight()
                        }, this._scene, !1, !0, t), this._depthMap.wrapU = nn.Texture.CLAMP_ADDRESSMODE, this._depthMap.wrapV = nn.Texture.CLAMP_ADDRESSMODE, this._depthMap.refreshRate = 1, this._depthMap.renderParticles = !1, this._depthMap.renderList = null, this._depthMap.activeCamera = this._camera, this._depthMap.ignoreCameraViewport = !0, this._depthMap.useCameraPostProcesses = !1, this._depthMap.onClearObservable.add(function(e) {
                            e.clear(new nn.Color4(1, 1, 1, 1), !0, !0, !0)
                        });
                        var s = function(e) {
                            var t = e.getRenderingMesh(),
                                i = r._scene,
                                n = i.getEngine(),
                                o = e.getMaterial();
                            if (o) {
                                n.setState(o.backFaceCulling, 0, !1, i.useRightHandedSystem);
                                var s = t._getInstancesRenderList(e._id);
                                if (!s.mustReturn) {
                                    var a = n.getCaps().instancedArrays && null !== s.visibleInstances[e._id],
                                        l = r._camera || i.activeCamera;
                                    if (r.isReady(e, a) && l) {
                                        if (n.enableEffect(r._effect), t._bind(e, r._effect, nn.Material.TriangleFillMode), r._effect.setMatrix("viewProjection", i.getTransformMatrix()), r._effect.setFloat2("depthValues", l.minZ, l.minZ + l.maxZ), o && o.needAlphaTesting()) {
                                            var u = o.getAlphaTestTexture();
                                            u && (r._effect.setTexture("diffuseSampler", u), r._effect.setMatrix("diffuseMatrix", u.getTextureMatrix()))
                                        }
                                        t.useBones && t.computeBonesUsingShaders && t.skeleton && r._effect.setMatrices("mBones", t.skeleton.getTransformMatrices(t)), t._processRendering(e, r._effect, nn.Material.TriangleFillMode, s, a, function(e, t) {
                                            return r._effect.setMatrix("world", t)
                                        })
                                    }
                                }
                            }
                        };
                        this._depthMap.customRenderFunction = function(e, t, i, r) {
                            var n;
                            if (r.length) {
                                for (o.setColorWrite(!1), n = 0; n < r.length; n++) s(r.data[n]);
                                o.setColorWrite(!0)
                            }
                            for (n = 0; n < e.length; n++) s(e.data[n]);
                            for (n = 0; n < t.length; n++) s(t.data[n])
                        }
                    }
                    return e.prototype.isReady = function(e, t) {
                        var i = e.getMaterial();
                        if (i.disableDepthWrite) return !1;
                        var r = [],
                            n = [nn.VertexBuffer.PositionKind],
                            o = e.getMesh();
                        i && i.needAlphaTesting() && i.getAlphaTestTexture() && (r.push("#define ALPHATEST"), o.isVerticesDataPresent(nn.VertexBuffer.UVKind) && (n.push(nn.VertexBuffer.UVKind), r.push("#define UV1")), o.isVerticesDataPresent(nn.VertexBuffer.UV2Kind) && (n.push(nn.VertexBuffer.UV2Kind), r.push("#define UV2"))), o.useBones && o.computeBonesUsingShaders ? (n.push(nn.VertexBuffer.MatricesIndicesKind), n.push(nn.VertexBuffer.MatricesWeightsKind), 4 < o.numBoneInfluencers && (n.push(nn.VertexBuffer.MatricesIndicesExtraKind), n.push(nn.VertexBuffer.MatricesWeightsExtraKind)), r.push("#define NUM_BONE_INFLUENCERS " + o.numBoneInfluencers), r.push("#define BonesPerMesh " + (o.skeleton ? o.skeleton.bones.length + 1 : 0))) : r.push("#define NUM_BONE_INFLUENCERS 0"), t && (r.push("#define INSTANCES"), n.push("world0"), n.push("world1"), n.push("world2"), n.push("world3"));
                        var s = r.join("\n");
                        return this._cachedDefines !== s && (this._cachedDefines = s, this._effect = this._scene.getEngine().createEffect("depth", n, ["world", "mBones", "viewProjection", "diffuseMatrix", "depthValues"], ["diffuseSampler"], s)), this._effect.isReady()
                    }, e.prototype.getDepthMap = function() {
                        return this._depthMap
                    }, e.prototype.dispose = function() {
                        this._depthMap.dispose()
                    }, e
                }(), nn.DepthRenderer = on,
                function(e) {
                    e.Scene.prototype.enableDepthRenderer = function(t) {
                        if (!(t = t || this.activeCamera)) throw "No camera available to enable depth renderer";
                        if (this._depthRenderer || (this._depthRenderer = {}), !this._depthRenderer[t.id]) {
                            var i = 0;
                            if (this.getEngine().getCaps().textureHalfFloatRender) i = e.Engine.TEXTURETYPE_HALF_FLOAT;
                            else {
                                if (!this.getEngine().getCaps().textureFloatRender) throw "Depth renderer does not support int texture type";
                                i = e.Engine.TEXTURETYPE_FLOAT
                            }
                            this._depthRenderer[t.id] = new e.DepthRenderer(this, i, t)
                        }
                        return this._depthRenderer[t.id]
                    }, e.Scene.prototype.disableDepthRenderer = function(e) {
                        (e = e || this.activeCamera) && this._depthRenderer && this._depthRenderer[e.id] && (this._depthRenderer[e.id].dispose(), delete this._depthRenderer[e.id])
                    };
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_DEPTHRENDERER, this.scene = t
                        }
                        return t.prototype.register = function() {
                            this.scene._gatherRenderTargetsStage.registerStep(e.SceneComponentConstants.STEP_GATHERRENDERTARGETS_DEPTHRENDERER, this, this._gatherRenderTargets), this.scene._gatherActiveCameraRenderTargetsStage.registerStep(e.SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER, this, this._gatherActiveCameraRenderTargets)
                        }, t.prototype.rebuild = function() {}, t.prototype.dispose = function() {
                            for (var e in this.scene._depthRenderer) this.scene._depthRenderer[e].dispose()
                        }, t.prototype._gatherRenderTargets = function(e) {
                            if (this.scene._depthRenderer)
                                for (var t in this.scene._depthRenderer) {
                                    var i = this.scene._depthRenderer[t];
                                    i.useOnlyInActiveCamera || e.push(i.getDepthMap())
                                }
                        }, t.prototype._gatherActiveCameraRenderTargets = function(e) {
                            if (this.scene._depthRenderer)
                                for (var t in this.scene._depthRenderer) {
                                    var i = this.scene._depthRenderer[t];
                                    i.useOnlyInActiveCamera && this.scene.activeCamera.id === t && e.push(i.getDepthMap())
                                }
                        }, t
                    }();
                    e.DepthRendererSceneComponent = t
                }($a || ($a = {})), sn = $a || ($a = {}), an = function() {
                    function e(e, t) {
                        void 0 === t && (t = 1), this._enablePosition = !1,
                            this._scene = e, this._ratio = t;
                        var i = e._getComponent(sn.SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER);
                        i || (i = new sn.GeometryBufferRendererSceneComponent(e), e._addComponent(i)), this._createRenderTargets()
                    }
                    return Object.defineProperty(e.prototype, "renderList", {
                        set: function(e) {
                            this._multiRenderTarget.renderList = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "isSupported", {
                        get: function() {
                            return this._multiRenderTarget.isSupported
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "enablePosition", {
                        get: function() {
                            return this._enablePosition
                        },
                        set: function(e) {
                            this._enablePosition = e, this.dispose(), this._createRenderTargets()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "scene", {
                        get: function() {
                            return this._scene
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "ratio", {
                        get: function() {
                            return this._ratio
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.isReady = function(e, t) {
                        var i = e.getMaterial();
                        if (i && i.disableDepthWrite) return !1;
                        var r = [],
                            n = [sn.VertexBuffer.PositionKind, sn.VertexBuffer.NormalKind],
                            o = e.getMesh();
                        i && i.needAlphaTesting() && (r.push("#define ALPHATEST"), o.isVerticesDataPresent(sn.VertexBuffer.UVKind) && (n.push(sn.VertexBuffer.UVKind), r.push("#define UV1")), o.isVerticesDataPresent(sn.VertexBuffer.UV2Kind) && (n.push(sn.VertexBuffer.UV2Kind), r.push("#define UV2"))), this._enablePosition && r.push("#define POSITION"), o.useBones && o.computeBonesUsingShaders ? (n.push(sn.VertexBuffer.MatricesIndicesKind), n.push(sn.VertexBuffer.MatricesWeightsKind), 4 < o.numBoneInfluencers && (n.push(sn.VertexBuffer.MatricesIndicesExtraKind), n.push(sn.VertexBuffer.MatricesWeightsExtraKind)), r.push("#define NUM_BONE_INFLUENCERS " + o.numBoneInfluencers), r.push("#define BonesPerMesh " + (o.skeleton ? o.skeleton.bones.length + 1 : 0))) : r.push("#define NUM_BONE_INFLUENCERS 0"), t && (r.push("#define INSTANCES"), n.push("world0"), n.push("world1"), n.push("world2"), n.push("world3"));
                        var s = r.join("\n");
                        return this._cachedDefines !== s && (this._cachedDefines = s, this._effect = this._scene.getEngine().createEffect("geometry", n, ["world", "mBones", "viewProjection", "diffuseMatrix", "view"], ["diffuseSampler"], s, void 0, void 0, void 0, {
                            buffersCount: this._enablePosition ? 3 : 2
                        })), this._effect.isReady()
                    }, e.prototype.getGBuffer = function() {
                        return this._multiRenderTarget
                    }, Object.defineProperty(e.prototype, "samples", {
                        get: function() {
                            return this._multiRenderTarget.samples
                        },
                        set: function(e) {
                            this._multiRenderTarget.samples = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.dispose = function() {
                        this.getGBuffer().dispose()
                    }, e.prototype._createRenderTargets = function() {
                        var e = this,
                            t = this._scene.getEngine(),
                            i = this._enablePosition ? 3 : 2;
                        if (this._multiRenderTarget = new sn.MultiRenderTarget("gBuffer", {
                                width: t.getRenderWidth() * this._ratio,
                                height: t.getRenderHeight() * this._ratio
                            }, i, this._scene, {
                                generateMipMaps: !1,
                                generateDepthTexture: !0,
                                defaultType: sn.Engine.TEXTURETYPE_FLOAT
                            }), this.isSupported) {
                            this._multiRenderTarget.wrapU = sn.Texture.CLAMP_ADDRESSMODE, this._multiRenderTarget.wrapV = sn.Texture.CLAMP_ADDRESSMODE, this._multiRenderTarget.refreshRate = 1, this._multiRenderTarget.renderParticles = !1, this._multiRenderTarget.renderList = null, this._multiRenderTarget.onClearObservable.add(function(e) {
                                e.clear(new sn.Color4(0, 0, 0, 1), !0, !0, !0)
                            });
                            var r = function(t) {
                                var i = t.getRenderingMesh(),
                                    r = e._scene,
                                    n = r.getEngine(),
                                    o = t.getMaterial();
                                if (o) {
                                    n.setState(o.backFaceCulling, 0, !1, r.useRightHandedSystem);
                                    var s = i._getInstancesRenderList(t._id);
                                    if (!s.mustReturn) {
                                        var a = n.getCaps().instancedArrays && null !== s.visibleInstances[t._id];
                                        if (e.isReady(t, a)) {
                                            if (n.enableEffect(e._effect), i._bind(t, e._effect, sn.Material.TriangleFillMode), e._effect.setMatrix("viewProjection", r.getTransformMatrix()), e._effect.setMatrix("view", r.getViewMatrix()), o && o.needAlphaTesting()) {
                                                var l = o.getAlphaTestTexture();
                                                l && (e._effect.setTexture("diffuseSampler", l), e._effect.setMatrix("diffuseMatrix", l.getTextureMatrix()))
                                            }
                                            i.useBones && i.computeBonesUsingShaders && i.skeleton && e._effect.setMatrices("mBones", i.skeleton.getTransformMatrices(i)), i._processRendering(t, e._effect, sn.Material.TriangleFillMode, s, a, function(t, i) {
                                                return e._effect.setMatrix("world", i)
                                            })
                                        }
                                    }
                                }
                            };
                            this._multiRenderTarget.customRenderFunction = function(e, i, n, o) {
                                var s;
                                if (o.length) {
                                    for (t.setColorWrite(!1), s = 0; s < o.length; s++) r(o.data[s]);
                                    t.setColorWrite(!0)
                                }
                                for (s = 0; s < e.length; s++) r(e.data[s]);
                                for (s = 0; s < i.length; s++) r(i.data[s])
                            }
                        }
                    }, e
                }(), sn.GeometryBufferRenderer = an,
                function(e) {
                    Object.defineProperty(e.Scene.prototype, "geometryBufferRenderer", {
                        get: function() {
                            this._geometryBufferRenderer
                        },
                        set: function(e) {
                            e && e.isSupported && (this._geometryBufferRenderer = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.Scene.prototype.enableGeometryBufferRenderer = function(t) {
                        return void 0 === t && (t = 1), this._geometryBufferRenderer || (this._geometryBufferRenderer = new e.GeometryBufferRenderer(this, t), this._geometryBufferRenderer.isSupported || (this._geometryBufferRenderer = null)), this._geometryBufferRenderer
                    }, e.Scene.prototype.disableGeometryBufferRenderer = function() {
                        this._geometryBufferRenderer && (this._geometryBufferRenderer.dispose(), this._geometryBufferRenderer = null)
                    };
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER, this.scene = t
                        }
                        return t.prototype.register = function() {
                            this.scene._gatherRenderTargetsStage.registerStep(e.SceneComponentConstants.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER, this, this._gatherRenderTargets)
                        }, t.prototype.rebuild = function() {}, t.prototype.dispose = function() {}, t.prototype._gatherRenderTargets = function(e) {
                            this.scene._geometryBufferRenderer && e.push(this.scene._geometryBufferRenderer.getGBuffer())
                        }, t
                    }();
                    e.GeometryBufferRendererSceneComponent = t
                }($a || ($a = {})), ln = $a || ($a = {}), un = function(e) {
                    function t(t, i, r, n) {
                        var o = e.call(this, i.getEngine(), t) || this;
                        o.SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect", o.SSAORenderEffect = "SSAORenderEffect", o.SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect", o.SSAOBlurVRenderEffect = "SSAOBlurVRenderEffect", o.SSAOCombineRenderEffect = "SSAOCombineRenderEffect", o.totalStrength = 1, o.radius = 1e-4, o.area = .0075, o.fallOff = 1e-6, o.base = .5, o._firstUpdate = !0, o._scene = i, o._createRandomTexture(), o._depthTexture = i.enableDepthRenderer().getDepthMap();
                        var s = r.ssaoRatio || r,
                            a = r.combineRatio || r;
                        return o._originalColorPostProcess = new ln.PassPostProcess("SSAOOriginalSceneColor", a, null, ln.Texture.BILINEAR_SAMPLINGMODE, i.getEngine(), !1), o._createSSAOPostProcess(s), o._createBlurPostProcess(s), o._createSSAOCombinePostProcess(a), o.addEffect(new ln.PostProcessRenderEffect(i.getEngine(), o.SSAOOriginalSceneColorEffect, function() {
                            return o._originalColorPostProcess
                        }, !0)), o.addEffect(new ln.PostProcessRenderEffect(i.getEngine(), o.SSAORenderEffect, function() {
                            return o._ssaoPostProcess
                        }, !0)), o.addEffect(new ln.PostProcessRenderEffect(i.getEngine(), o.SSAOBlurHRenderEffect, function() {
                            return o._blurHPostProcess
                        }, !0)), o.addEffect(new ln.PostProcessRenderEffect(i.getEngine(), o.SSAOBlurVRenderEffect, function() {
                            return o._blurVPostProcess
                        }, !0)), o.addEffect(new ln.PostProcessRenderEffect(i.getEngine(), o.SSAOCombineRenderEffect, function() {
                            return o._ssaoCombinePostProcess
                        }, !0)), i.postProcessRenderPipelineManager.addPipeline(o), n && i.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(t, n), o
                    }
                    return b(t, e), t.prototype.dispose = function(t) {
                        void 0 === t && (t = !1);
                        for (var i = 0; i < this._scene.cameras.length; i++) {
                            var r = this._scene.cameras[i];
                            this._originalColorPostProcess.dispose(r), this._ssaoPostProcess.dispose(r), this._blurHPostProcess.dispose(r), this._blurVPostProcess.dispose(r), this._ssaoCombinePostProcess.dispose(r)
                        }
                        this._randomTexture.dispose(), t && this._scene.disableDepthRenderer(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), e.prototype.dispose.call(this)
                    }, t.prototype._createBlurPostProcess = function(e) {
                        var t = this;
                        this._blurHPostProcess = new ln.BlurPostProcess("BlurH", new ln.Vector2(1, 0), 16, e, null, ln.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, ln.Engine.TEXTURETYPE_UNSIGNED_INT), this._blurVPostProcess = new ln.BlurPostProcess("BlurV", new ln.Vector2(0, 1), 16, e, null, ln.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, ln.Engine.TEXTURETYPE_UNSIGNED_INT), this._blurHPostProcess.onActivateObservable.add(function() {
                            var e = t._blurHPostProcess.width / t._scene.getEngine().getRenderWidth();
                            t._blurHPostProcess.kernel = 16 * e
                        }), this._blurVPostProcess.onActivateObservable.add(function() {
                            var e = t._blurVPostProcess.height / t._scene.getEngine().getRenderHeight();
                            t._blurVPostProcess.kernel = 16 * e
                        })
                    }, t.prototype._rebuild = function() {
                        this._firstUpdate = !0, e.prototype._rebuild.call(this)
                    }, t.prototype._createSSAOPostProcess = function(e) {
                        var t = this,
                            i = [.5381, .1856, -.4319, .1379, .2486, .443, .3371, .5679, -.0057, -.6999, -.0451, -.0019, .0689, -.1598, -.8547, .056, .0069, -.1843, -.0146, .1402, .0762, .01, -.1924, -.0344, -.3577, -.5301, -.4358, -.3169, .1063, .0158, .0103, -.5869, .0046, -.0897, -.494, .3287, .7119, -.0154, -.0918, -.0533, .0596, -.5411, .0352, -.0631, .546, -.4776, .2847, -.0271];
                        this._ssaoPostProcess = new ln.PostProcess("ssao", "ssao", ["sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius", "area", "fallOff", "base", "range", "viewport"], ["randomSampler"], e, null, ln.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, "#define SAMPLES 16\n#define SSAO"), this._ssaoPostProcess.onApply = function(e) {
                            t._firstUpdate && (e.setArray3("sampleSphere", i), e.setFloat("samplesFactor", 1 / 16), e.setFloat("randTextureTiles", 4)), e.setFloat("totalStrength", t.totalStrength), e.setFloat("radius", t.radius), e.setFloat("area", t.area), e.setFloat("fallOff", t.fallOff), e.setFloat("base", t.base), e.setTexture("textureSampler", t._depthTexture), e.setTexture("randomSampler", t._randomTexture)
                        }
                    }, t.prototype._createSSAOCombinePostProcess = function(e) {
                        var t = this;
                        this._ssaoCombinePostProcess = new ln.PostProcess("ssaoCombine", "ssaoCombine", [], ["originalColor", "viewport"], e, null, ln.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._ssaoCombinePostProcess.onApply = function(e) {
                            e.setVector4("viewport", ln.Tmp.Vector4[0].copyFromFloats(0, 0, 1, 1)), e.setTextureFromPostProcess("originalColor", t._originalColorPostProcess)
                        }
                    }, t.prototype._createRandomTexture = function() {
                        this._randomTexture = new ln.DynamicTexture("SSAORandomTexture", 512, this._scene, !1, ln.Texture.TRILINEAR_SAMPLINGMODE), this._randomTexture.wrapU = ln.Texture.WRAP_ADDRESSMODE, this._randomTexture.wrapV = ln.Texture.WRAP_ADDRESSMODE;
                        for (var e = this._randomTexture.getContext(), t = function(e, t) {
                                return Math.random() * (t - e) + e
                            }, i = ln.Vector3.Zero(), r = 0; r < 512; r++)
                            for (var n = 0; n < 512; n++) i.x = Math.floor(255 * t(-1, 1)), i.y = Math.floor(255 * t(-1, 1)), i.z = Math.floor(255 * t(-1, 1)), e.fillStyle = "rgb(" + i.x + ", " + i.y + ", " + i.z + ")", e.fillRect(r, n, 1, 1);
                        this._randomTexture.update(!1)
                    }, y([ln.serialize()], t.prototype, "totalStrength", void 0), y([ln.serialize()], t.prototype, "radius", void 0), y([ln.serialize()], t.prototype, "area", void 0), y([ln.serialize()], t.prototype, "fallOff", void 0), y([ln.serialize()], t.prototype, "base", void 0), t
                }(ln.PostProcessRenderPipeline), ln.SSAORenderingPipeline = un, cn = $a || ($a = {}), hn = function(e) {
                    function t(t, i, r, n) {
                        var o = e.call(this, i.getEngine(), t) || this;
                        if (o.SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect", o.SSAORenderEffect = "SSAORenderEffect", o.SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect", o.SSAOBlurVRenderEffect = "SSAOBlurVRenderEffect", o.SSAOCombineRenderEffect = "SSAOCombineRenderEffect", o.totalStrength = 1, o.maxZ = 100, o.minZAspect = .2, o._samples = 8, o._textureSamples = 1, o._expensiveBlur = !0, o.radius = 2, o.base = 0, o._firstUpdate = !0, o._bits = new Uint32Array(1), o._scene = i, o._ratio = r, !o.isSupported) return cn.Tools.Error("SSAO 2 needs WebGL 2 support."), o;
                        var s = o._ratio.ssaoRatio || r,
                            a = o._ratio.blurRatio || r,
                            l = i.enableGeometryBufferRenderer();
                        return o._createRandomTexture(), o._depthTexture = l.getGBuffer().textures[0], o._normalTexture = l.getGBuffer().textures[1], o._originalColorPostProcess = new cn.PassPostProcess("SSAOOriginalSceneColor", 1, null, cn.Texture.BILINEAR_SAMPLINGMODE, i.getEngine(), !1), o._originalColorPostProcess.samples = o.textureSamples, o._createSSAOPostProcess(1), o._createBlurPostProcess(s, a), o._createSSAOCombinePostProcess(a), o.addEffect(new cn.PostProcessRenderEffect(i.getEngine(), o.SSAOOriginalSceneColorEffect, function() {
                            return o._originalColorPostProcess
                        }, !0)), o.addEffect(new cn.PostProcessRenderEffect(i.getEngine(), o.SSAORenderEffect, function() {
                            return o._ssaoPostProcess
                        }, !0)), o.addEffect(new cn.PostProcessRenderEffect(i.getEngine(), o.SSAOBlurHRenderEffect, function() {
                            return o._blurHPostProcess
                        }, !0)), o.addEffect(new cn.PostProcessRenderEffect(i.getEngine(), o.SSAOBlurVRenderEffect, function() {
                            return o._blurVPostProcess
                        }, !0)), o.addEffect(new cn.PostProcessRenderEffect(i.getEngine(), o.SSAOCombineRenderEffect, function() {
                            return o._ssaoCombinePostProcess
                        }, !0)), i.postProcessRenderPipelineManager.addPipeline(o), n && i.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(t, n), o
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "samples", {
                        get: function() {
                            return this._samples
                        },
                        set: function(e) {
                            this._ssaoPostProcess.updateEffect("#define SAMPLES " + e + "\n#define SSAO"), this._samples = e, this._sampleSphere = this._generateHemisphere(), this._firstUpdate = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "textureSamples", {
                        get: function() {
                            return this._textureSamples
                        },
                        set: function(e) {
                            this._textureSamples = e, this._originalColorPostProcess.samples = e, this._blurHPostProcess.samples = e, this._blurVPostProcess.samples = e, this._ssaoPostProcess.samples = e, this._ssaoCombinePostProcess.samples = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "expensiveBlur", {
                        get: function() {
                            return this._expensiveBlur
                        },
                        set: function(e) {
                            this._blurHPostProcess.updateEffect("#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE " + (e ? "1" : "0") + "\n", null, ["textureSampler", "depthSampler"]), this._blurVPostProcess.updateEffect("#define BILATERAL_BLUR\n#define SAMPLES 16\n#define EXPENSIVE " + (e ? "1" : "0") + "\n", null, ["textureSampler", "depthSampler"]), this._expensiveBlur = e, this._firstUpdate = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t, "IsSupported", {
                        get: function() {
                            var e = cn.Engine.LastCreatedEngine;
                            return !!e && e.getCaps().drawBuffersExtension
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.dispose = function(t) {
                        void 0 === t && (t = !1);
                        for (var i = 0; i < this._scene.cameras.length; i++) {
                            var r = this._scene.cameras[i];
                            this._originalColorPostProcess.dispose(r), this._ssaoPostProcess.dispose(r), this._blurHPostProcess.dispose(r), this._blurVPostProcess.dispose(r), this._ssaoCombinePostProcess.dispose(r)
                        }
                        this._randomTexture.dispose(), t && this._scene.disableGeometryBufferRenderer(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), e.prototype.dispose.call(this)
                    }, t.prototype._createBlurPostProcess = function(e, t) {
                        var i = this;
                        this._samplerOffsets = [];
                        for (var r = this.expensiveBlur, n = -8; n < 8; n++) this._samplerOffsets.push(2 * n + .5);
                        this._blurHPostProcess = new cn.PostProcess("BlurH", "ssao2", ["outSize", "samplerOffsets", "near", "far", "radius"], ["depthSampler"], e, null, cn.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, "#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE " + (r ? "1" : "0") + "\n"), this._blurHPostProcess.onApply = function(e) {
                            i._scene.activeCamera && (e.setFloat("outSize", 0 < i._ssaoCombinePostProcess.width ? i._ssaoCombinePostProcess.width : i._originalColorPostProcess.width), e.setFloat("near", i._scene.activeCamera.minZ), e.setFloat("far", i._scene.activeCamera.maxZ), e.setFloat("radius", i.radius), e.setTexture("depthSampler", i._depthTexture), i._firstUpdate && e.setArray("samplerOffsets", i._samplerOffsets))
                        }, this._blurVPostProcess = new cn.PostProcess("BlurV", "ssao2", ["outSize", "samplerOffsets", "near", "far", "radius"], ["depthSampler"], t, null, cn.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, "#define BILATERAL_BLUR\n#define BILATERAL_BLUR_V\n#define SAMPLES 16\n#define EXPENSIVE " + (r ? "1" : "0") + "\n"), this._blurVPostProcess.onApply = function(e) {
                            i._scene.activeCamera && (e.setFloat("outSize", 0 < i._ssaoCombinePostProcess.height ? i._ssaoCombinePostProcess.height : i._originalColorPostProcess.height), e.setFloat("near", i._scene.activeCamera.minZ), e.setFloat("far", i._scene.activeCamera.maxZ), e.setFloat("radius", i.radius), e.setTexture("depthSampler", i._depthTexture), i._firstUpdate && (e.setArray("samplerOffsets", i._samplerOffsets), i._firstUpdate = !1))
                        }, this._blurHPostProcess.samples = this.textureSamples, this._blurVPostProcess.samples = this.textureSamples
                    }, t.prototype._rebuild = function() {
                        this._firstUpdate = !0, e.prototype._rebuild.call(this)
                    }, t.prototype._radicalInverse_VdC = function(e) {
                        return this._bits[0] = e, this._bits[0] = (this._bits[0] << 16 | this._bits[0] >> 16) >>> 0, this._bits[0] = (1431655765 & this._bits[0]) << 1 | (2863311530 & this._bits[0]) >>> 1 >>> 0, this._bits[0] = (858993459 & this._bits[0]) << 2 | (3435973836 & this._bits[0]) >>> 2 >>> 0, this._bits[0] = (252645135 & this._bits[0]) << 4 | (4042322160 & this._bits[0]) >>> 4 >>> 0, this._bits[0] = (16711935 & this._bits[0]) << 8 | (4278255360 & this._bits[0]) >>> 8 >>> 0, 2.3283064365386963e-10 * this._bits[0]
                    }, t.prototype._hammersley = function(e, t) {
                        return [e / t, this._radicalInverse_VdC(e)]
                    }, t.prototype._hemisphereSample_uniform = function(e, t) {
                        var i = 2 * t * Math.PI,
                            r = 1 - (.85 * e + .15),
                            n = Math.sqrt(1 - r * r);
                        return new cn.Vector3(Math.cos(i) * n, Math.sin(i) * n, r)
                    }, t.prototype._generateHemisphere = function() {
                        for (var e, t = this.samples, i = [], r = 0; r < t;) {
                            if (t < 16) e = this._hemisphereSample_uniform(Math.random(), Math.random());
                            else {
                                var n = this._hammersley(r, t);
                                e = this._hemisphereSample_uniform(n[0], n[1])
                            }
                            i.push(e.x, e.y, e.z), r++
                        }
                        return i
                    }, t.prototype._createSSAOPostProcess = function(e) {
                        var t = this,
                            i = this.samples;
                        this._sampleSphere = this._generateHemisphere(), this._ssaoPostProcess = new cn.PostProcess("ssao2", "ssao2", ["sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius", "base", "range", "projection", "near", "far", "texelSize", "xViewport", "yViewport", "maxZ", "minZAspect"], ["randomSampler", "normalSampler"], e, null, cn.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, "#define SAMPLES " + i + "\n#define SSAO"), this._ssaoPostProcess.onApply = function(e) {
                            t._firstUpdate && (e.setArray3("sampleSphere", t._sampleSphere), e.setFloat("randTextureTiles", 32)), t._scene.activeCamera && (e.setFloat("samplesFactor", 1 / t.samples), e.setFloat("totalStrength", t.totalStrength), e.setFloat2("texelSize", 1 / t._ssaoPostProcess.width, 1 / t._ssaoPostProcess.height), e.setFloat("radius", t.radius), e.setFloat("maxZ", t.maxZ), e.setFloat("minZAspect", t.minZAspect), e.setFloat("base", t.base), e.setFloat("near", t._scene.activeCamera.minZ), e.setFloat("far", t._scene.activeCamera.maxZ), e.setFloat("xViewport", Math.tan(t._scene.activeCamera.fov / 2) * t._scene.getEngine().getAspectRatio(t._scene.activeCamera, !0)), e.setFloat("yViewport", Math.tan(t._scene.activeCamera.fov / 2)), e.setMatrix("projection", t._scene.getProjectionMatrix()), e.setTexture("textureSampler", t._depthTexture), e.setTexture("normalSampler", t._normalTexture), e.setTexture("randomSampler", t._randomTexture))
                        }, this._ssaoPostProcess.samples = this.textureSamples
                    }, t.prototype._createSSAOCombinePostProcess = function(e) {
                        var t = this;
                        this._ssaoCombinePostProcess = new cn.PostProcess("ssaoCombine", "ssaoCombine", [], ["originalColor", "viewport"], e, null, cn.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._ssaoCombinePostProcess.onApply = function(e) {
                            var i = t._scene.activeCamera.viewport;
                            e.setVector4("viewport", cn.Tmp.Vector4[0].copyFromFloats(i.x, i.y, i.width, i.height)), e.setTextureFromPostProcess("originalColor", t._originalColorPostProcess)
                        }, this._ssaoCombinePostProcess.samples = this.textureSamples
                    }, t.prototype._createRandomTexture = function() {
                        this._randomTexture = new cn.DynamicTexture("SSAORandomTexture", 128, this._scene, !1, cn.Texture.TRILINEAR_SAMPLINGMODE), this._randomTexture.wrapU = cn.Texture.WRAP_ADDRESSMODE, this._randomTexture.wrapV = cn.Texture.WRAP_ADDRESSMODE;
                        for (var e = this._randomTexture.getContext(), t = function(e, t) {
                                return Math.random() * (t - e) + e
                            }, i = cn.Vector3.Zero(), r = 0; r < 128; r++)
                            for (var n = 0; n < 128; n++) i.x = t(0, 1), i.y = t(0, 1), i.z = 0, i.normalize(), i.scaleInPlace(255), i.x = Math.floor(i.x), i.y = Math.floor(i.y), e.fillStyle = "rgb(" + i.x + ", " + i.y + ", " + i.z + ")", e.fillRect(r, n, 1, 1);
                        this._randomTexture.update(!1)
                    }, t.prototype.serialize = function() {
                        var e = cn.SerializationHelper.Serialize(this);
                        return e.customType = "SSAO2RenderingPipeline", e
                    }, t.Parse = function(e, i, r) {
                        return cn.SerializationHelper.Parse(function() {
                            return new t(e._name, i, e._ratio)
                        }, e, i, r)
                    }, y([cn.serialize()], t.prototype, "totalStrength", void 0), y([cn.serialize()], t.prototype, "maxZ", void 0), y([cn.serialize()], t.prototype, "minZAspect", void 0), y([cn.serialize("samples")], t.prototype, "_samples", void 0), y([cn.serialize("textureSamples")], t.prototype, "_textureSamples", void 0), y([cn.serialize()], t.prototype, "_ratio", void 0), y([cn.serialize("expensiveBlur")], t.prototype, "_expensiveBlur", void 0), y([cn.serialize()], t.prototype, "radius", void 0), y([cn.serialize()], t.prototype, "base", void 0), t
                }(cn.PostProcessRenderPipeline), cn.SSAO2RenderingPipeline = hn, dn = $a || ($a = {}), pn = function(e) {
                    function t(t, i, r, n, o) {
                        void 0 === n && (n = 1);
                        var s = e.call(this, r.getEngine(), t) || this;
                        return s.LensChromaticAberrationEffect = "LensChromaticAberrationEffect", s.HighlightsEnhancingEffect = "HighlightsEnhancingEffect", s.LensDepthOfFieldEffect = "LensDepthOfFieldEffect", s._scene = r, s._depthTexture = r.enableDepthRenderer().getDepthMap(), i.grain_texture ? s._grainTexture = i.grain_texture : s._createGrainTexture(), s._edgeBlur = i.edge_blur ? i.edge_blur : 0, s._grainAmount = i.grain_amount ? i.grain_amount : 0, s._chromaticAberration = i.chromatic_aberration ? i.chromatic_aberration : 0, s._distortion = i.distortion ? i.distortion : 0, s._highlightsGain = void 0 !== i.dof_gain ? i.dof_gain : -1, s._highlightsThreshold = i.dof_threshold ? i.dof_threshold : 1, s._dofDistance = void 0 !== i.dof_focus_distance ? i.dof_focus_distance : -1, s._dofAperture = i.dof_aperture ? i.dof_aperture : 1, s._dofDarken = i.dof_darken ? i.dof_darken : 0, s._dofPentagon = void 0 === i.dof_pentagon || i.dof_pentagon, s._blurNoise = void 0 === i.blur_noise || i.blur_noise, s._createChromaticAberrationPostProcess(n), s._createHighlightsPostProcess(n), s._createDepthOfFieldPostProcess(n / 4), s.addEffect(new dn.PostProcessRenderEffect(r.getEngine(), s.LensChromaticAberrationEffect, function() {
                            return s._chromaticAberrationPostProcess
                        }, !0)), s.addEffect(new dn.PostProcessRenderEffect(r.getEngine(), s.HighlightsEnhancingEffect, function() {
                            return s._highlightsPostProcess
                        }, !0)), s.addEffect(new dn.PostProcessRenderEffect(r.getEngine(), s.LensDepthOfFieldEffect, function() {
                            return s._depthOfFieldPostProcess
                        }, !0)), -1 === s._highlightsGain && s._disableEffect(s.HighlightsEnhancingEffect, null), r.postProcessRenderPipelineManager.addPipeline(s), o && r.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(t, o), s
                    }
                    return b(t, e), t.prototype.setEdgeBlur = function(e) {
                        this._edgeBlur = e
                    }, t.prototype.disableEdgeBlur = function() {
                        this._edgeBlur = 0
                    }, t.prototype.setGrainAmount = function(e) {
                        this._grainAmount = e
                    }, t.prototype.disableGrain = function() {
                        this._grainAmount = 0
                    }, t.prototype.setChromaticAberration = function(e) {
                        this._chromaticAberration = e
                    }, t.prototype.disableChromaticAberration = function() {
                        this._chromaticAberration = 0
                    }, t.prototype.setEdgeDistortion = function(e) {
                        this._distortion = e
                    }, t.prototype.disableEdgeDistortion = function() {
                        this._distortion = 0
                    }, t.prototype.setFocusDistance = function(e) {
                        this._dofDistance = e
                    }, t.prototype.disableDepthOfField = function() {
                        this._dofDistance = -1
                    }, t.prototype.setAperture = function(e) {
                        this._dofAperture = e
                    }, t.prototype.setDarkenOutOfFocus = function(e) {
                        this._dofDarken = e
                    }, t.prototype.enablePentagonBokeh = function() {
                        this._highlightsPostProcess.updateEffect("#define PENTAGON\n")
                    }, t.prototype.disablePentagonBokeh = function() {
                        this._highlightsPostProcess.updateEffect()
                    }, t.prototype.enableNoiseBlur = function() {
                        this._blurNoise = !0
                    }, t.prototype.disableNoiseBlur = function() {
                        this._blurNoise = !1
                    }, t.prototype.setHighlightsGain = function(e) {
                        this._highlightsGain = e
                    }, t.prototype.setHighlightsThreshold = function(e) {
                        -1 === this._highlightsGain && (this._highlightsGain = 1), this._highlightsThreshold = e
                    }, t.prototype.disableHighlights = function() {
                        this._highlightsGain = -1
                    }, t.prototype.dispose = function(e) {
                        void 0 === e && (e = !1), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), this._chromaticAberrationPostProcess = null, this._highlightsPostProcess = null, this._depthOfFieldPostProcess = null, this._grainTexture.dispose(), e && this._scene.disableDepthRenderer()
                    }, t.prototype._createChromaticAberrationPostProcess = function(e) {
                        var t = this;
                        this._chromaticAberrationPostProcess = new dn.PostProcess("LensChromaticAberration", "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], [], e, null, dn.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._chromaticAberrationPostProcess.onApply = function(e) {
                            e.setFloat("chromatic_aberration", t._chromaticAberration), e.setFloat("screen_width", t._scene.getEngine().getRenderWidth()), e.setFloat("screen_height", t._scene.getEngine().getRenderHeight()), e.setFloat("radialIntensity", 1), e.setFloat2("direction", 17, 17), e.setFloat2("centerPosition", .5, .5)
                        }
                    }, t.prototype._createHighlightsPostProcess = function(e) {
                        var t = this;
                        this._highlightsPostProcess = new dn.PostProcess("LensHighlights", "lensHighlights", ["gain", "threshold", "screen_width", "screen_height"], [], e, null, dn.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, this._dofPentagon ? "#define PENTAGON\n" : ""), this._highlightsPostProcess.onApply = function(e) {
                            e.setFloat("gain", t._highlightsGain), e.setFloat("threshold", t._highlightsThreshold), e.setTextureFromPostProcess("textureSampler", t._chromaticAberrationPostProcess), e.setFloat("screen_width", t._scene.getEngine().getRenderWidth()), e.setFloat("screen_height", t._scene.getEngine().getRenderHeight())
                        }
                    }, t.prototype._createDepthOfFieldPostProcess = function(e) {
                        var t = this;
                        this._depthOfFieldPostProcess = new dn.PostProcess("LensDepthOfField", "depthOfField", ["grain_amount", "blur_noise", "screen_width", "screen_height", "distortion", "dof_enabled", "screen_distance", "aperture", "darken", "edge_blur", "highlights", "near", "far"], ["depthSampler", "grainSampler", "highlightsSampler"], e, null, dn.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._depthOfFieldPostProcess.onApply = function(e) {
                            e.setTexture("depthSampler", t._depthTexture), e.setTexture("grainSampler", t._grainTexture), e.setTextureFromPostProcess("textureSampler", t._highlightsPostProcess), e.setTextureFromPostProcess("highlightsSampler", t._depthOfFieldPostProcess), e.setFloat("grain_amount", t._grainAmount), e.setBool("blur_noise", t._blurNoise), e.setFloat("screen_width", t._scene.getEngine().getRenderWidth()), e.setFloat("screen_height", t._scene.getEngine().getRenderHeight()), e.setFloat("distortion", t._distortion), e.setBool("dof_enabled", -1 !== t._dofDistance), e.setFloat("screen_distance", 1 / (.1 - 1 / t._dofDistance)), e.setFloat("aperture", t._dofAperture), e.setFloat("darken", t._dofDarken), e.setFloat("edge_blur", t._edgeBlur), e.setBool("highlights", -1 !== t._highlightsGain), t._scene.activeCamera && (e.setFloat("near", t._scene.activeCamera.minZ), e.setFloat("far", t._scene.activeCamera.maxZ))
                        }
                    }, t.prototype._createGrainTexture = function() {
                        this._grainTexture = new dn.DynamicTexture("LensNoiseTexture", 512, this._scene, !1, dn.Texture.BILINEAR_SAMPLINGMODE), this._grainTexture.wrapU = dn.Texture.WRAP_ADDRESSMODE, this._grainTexture.wrapV = dn.Texture.WRAP_ADDRESSMODE;
                        for (var e, t, i, r = this._grainTexture.getContext(), n = 0; n < 512; n++)
                            for (var o = 0; o < 512; o++) e = Math.floor(255 * (t = .42, i = .58, Math.random() * (i - t) + t)), r.fillStyle = "rgb(" + e + ", " + e + ", " + e + ")", r.fillRect(n, o, 1, 1);
                        this._grainTexture.update(!1)
                    }, t
                }(dn.PostProcessRenderPipeline), dn.LensRenderingPipeline = pn, fn = $a || ($a = {}), _n = function(e) {
                    function t(t, i, r, n, o) {
                        void 0 === n && (n = null);
                        var s = e.call(this, i.getEngine(), t) || this;
                        return s.downSampleX4PostProcess = null, s.brightPassPostProcess = null, s.blurHPostProcesses = [], s.blurVPostProcesses = [], s.textureAdderPostProcess = null, s.volumetricLightPostProcess = null, s.volumetricLightSmoothXPostProcess = null, s.volumetricLightSmoothYPostProcess = null, s.volumetricLightMergePostProces = null, s.volumetricLightFinalPostProcess = null, s.luminancePostProcess = null, s.luminanceDownSamplePostProcesses = [], s.hdrPostProcess = null, s.textureAdderFinalPostProcess = null, s.lensFlareFinalPostProcess = null, s.hdrFinalPostProcess = null, s.lensFlarePostProcess = null, s.lensFlareComposePostProcess = null, s.motionBlurPostProcess = null, s.depthOfFieldPostProcess = null, s.fxaaPostProcess = null, s.brightThreshold = 1, s.blurWidth = 512, s.horizontalBlur = !1, s.exposure = 1, s.lensTexture = null, s.volumetricLightCoefficient = .2, s.volumetricLightPower = 4, s.volumetricLightBlurScale = 64, s.sourceLight = null, s.hdrMinimumLuminance = 1, s.hdrDecreaseRate = .5, s.hdrIncreaseRate = .5, s.lensColorTexture = null, s.lensFlareStrength = 20, s.lensFlareGhostDispersal = 1.4, s.lensFlareHaloWidth = .7, s.lensFlareDistortionStrength = 16, s.lensStarTexture = null, s.lensFlareDirtTexture = null, s.depthOfFieldDistance = 10, s.depthOfFieldBlurWidth = 64, s.motionStrength = 1, s.animations = [], s._currentDepthOfFieldSource = null, s._hdrCurrentLuminance = 1, s._bloomEnabled = !1, s._depthOfFieldEnabled = !1, s._vlsEnabled = !1, s._lensFlareEnabled = !1, s._hdrEnabled = !1, s._motionBlurEnabled = !1, s._fxaaEnabled = !1, s._motionBlurSamples = 64, s._volumetricLightStepsCount = 50, s._samples = 1, s._cameras = o || [], s._scene = i, s._basePostProcess = n, s._ratio = r, s._floatTextureType = i.getEngine().getCaps().textureFloatRender ? fn.Engine.TEXTURETYPE_FLOAT : fn.Engine.TEXTURETYPE_HALF_FLOAT, i.postProcessRenderPipelineManager.addPipeline(s), s._buildPipeline(), s
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "BloomEnabled", {
                        get: function() {
                            return this._bloomEnabled
                        },
                        set: function(e) {
                            this._bloomEnabled !== e && (this._bloomEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "DepthOfFieldEnabled", {
                        get: function() {
                            return this._depthOfFieldEnabled
                        },
                        set: function(e) {
                            this._depthOfFieldEnabled !== e && (this._depthOfFieldEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "LensFlareEnabled", {
                        get: function() {
                            return this._lensFlareEnabled
                        },
                        set: function(e) {
                            this._lensFlareEnabled !== e && (this._lensFlareEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "HDREnabled", {
                        get: function() {
                            return this._hdrEnabled
                        },
                        set: function(e) {
                            this._hdrEnabled !== e && (this._hdrEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "VLSEnabled", {
                        get: function() {
                            return this._vlsEnabled
                        },
                        set: function(e) {
                            if (this._vlsEnabled !== e) {
                                if (e && !this._scene.enableGeometryBufferRenderer()) return void fn.Tools.Warn("Geometry renderer is not supported, cannot create volumetric lights in Standard Rendering Pipeline");
                                this._vlsEnabled = e, this._buildPipeline()
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "MotionBlurEnabled", {
                        get: function() {
                            return this._motionBlurEnabled
                        },
                        set: function(e) {
                            this._motionBlurEnabled !== e && (this._motionBlurEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "fxaaEnabled", {
                        get: function() {
                            return this._fxaaEnabled
                        },
                        set: function(e) {
                            this._fxaaEnabled !== e && (this._fxaaEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "volumetricLightStepsCount", {
                        get: function() {
                            return this._volumetricLightStepsCount
                        },
                        set: function(e) {
                            this.volumetricLightPostProcess && this.volumetricLightPostProcess.updateEffect("#define VLS\n#define NB_STEPS " + e.toFixed(1)), this._volumetricLightStepsCount = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "motionBlurSamples", {
                        get: function() {
                            return this._motionBlurSamples
                        },
                        set: function(e) {
                            this.motionBlurPostProcess && this.motionBlurPostProcess.updateEffect("#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES " + e.toFixed(1)), this._motionBlurSamples = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "samples", {
                        get: function() {
                            return this._samples
                        },
                        set: function(e) {
                            this._samples !== e && (this._samples = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._buildPipeline = function() {
                        var e = this,
                            t = this._ratio,
                            i = this._scene;
                        this._disposePostProcesses(), this._reset(), this._basePostProcess ? this.originalPostProcess = this._basePostProcess : (this.originalPostProcess = new fn.PostProcess("HDRPass", "standard", [], [], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, "#define PASS_POST_PROCESS", this._floatTextureType), this.originalPostProcess.onApply = function(t) {
                            e._currentDepthOfFieldSource = e.originalPostProcess
                        }), (this._bloomEnabled || this._vlsEnabled || this._lensFlareEnabled || this._depthOfFieldEnabled || this._motionBlurEnabled) && this.addEffect(new fn.PostProcessRenderEffect(i.getEngine(), "HDRPassPostProcess", function() {
                            return e.originalPostProcess
                        }, !0)), this._currentDepthOfFieldSource = this.originalPostProcess, this._bloomEnabled && (this._createDownSampleX4PostProcess(i, t / 2), this._createBrightPassPostProcess(i, t / 2), this._createBlurPostProcesses(i, t / 4, 1), this._createTextureAdderPostProcess(i, t), this.textureAdderFinalPostProcess = new fn.PostProcess("HDRDepthOfFieldSource", "standard", [], [], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, "#define PASS_POST_PROCESS", fn.Engine.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new fn.PostProcessRenderEffect(i.getEngine(), "HDRBaseDepthOfFieldSource", function() {
                            return e.textureAdderFinalPostProcess
                        }, !0))), this._vlsEnabled && (this._createVolumetricLightPostProcess(i, t), this.volumetricLightFinalPostProcess = new fn.PostProcess("HDRVLSFinal", "standard", [], [], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, "#define PASS_POST_PROCESS", fn.Engine.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new fn.PostProcessRenderEffect(i.getEngine(), "HDRVLSFinal", function() {
                            return e.volumetricLightFinalPostProcess
                        }, !0))), this._lensFlareEnabled && (this._createLensFlarePostProcess(i, t), this.lensFlareFinalPostProcess = new fn.PostProcess("HDRPostLensFlareDepthOfFieldSource", "standard", [], [], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, "#define PASS_POST_PROCESS", fn.Engine.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new fn.PostProcessRenderEffect(i.getEngine(), "HDRPostLensFlareDepthOfFieldSource", function() {
                            return e.lensFlareFinalPostProcess
                        }, !0))), this._hdrEnabled && (this._createLuminancePostProcesses(i, this._floatTextureType), this._createHdrPostProcess(i, t), this.hdrFinalPostProcess = new fn.PostProcess("HDRPostHDReDepthOfFieldSource", "standard", [], [], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, "#define PASS_POST_PROCESS", fn.Engine.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new fn.PostProcessRenderEffect(i.getEngine(), "HDRPostHDReDepthOfFieldSource", function() {
                            return e.hdrFinalPostProcess
                        }, !0))), this._depthOfFieldEnabled && (this._createBlurPostProcesses(i, t / 2, 3, "depthOfFieldBlurWidth"), this._createDepthOfFieldPostProcess(i, t)), this._motionBlurEnabled && this._createMotionBlurPostProcess(i, t), this._fxaaEnabled && (this.fxaaPostProcess = new fn.FxaaPostProcess("fxaa", 1, null, fn.Texture.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, fn.Engine.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new fn.PostProcessRenderEffect(i.getEngine(), "HDRFxaa", function() {
                            return e.fxaaPostProcess
                        }, !0))), null !== this._cameras && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras), !this._enableMSAAOnFirstPostProcess(this._samples) && 1 < this._samples && fn.Tools.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0")
                    }, t.prototype._createDownSampleX4PostProcess = function(e, t) {
                        var i = this,
                            r = new Array(32);
                        this.downSampleX4PostProcess = new fn.PostProcess("HDRDownSampleX4", "standard", ["dsOffsets"], [], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define DOWN_SAMPLE_X4", fn.Engine.TEXTURETYPE_UNSIGNED_INT), this.downSampleX4PostProcess.onApply = function(e) {
                            for (var t = 0, n = i.downSampleX4PostProcess.width, o = i.downSampleX4PostProcess.height, s = -2; s < 2; s++)
                                for (var a = -2; a < 2; a++) r[t] = (s + .5) * (1 / n), r[t + 1] = (a + .5) * (1 / o), t += 2;
                            e.setArray2("dsOffsets", r)
                        }, this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRDownSampleX4", function() {
                            return i.downSampleX4PostProcess
                        }, !0))
                    }, t.prototype._createBrightPassPostProcess = function(e, t) {
                        var i = this,
                            r = new Array(8);
                        this.brightPassPostProcess = new fn.PostProcess("HDRBrightPass", "standard", ["dsOffsets", "brightThreshold"], [], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define BRIGHT_PASS", fn.Engine.TEXTURETYPE_UNSIGNED_INT), this.brightPassPostProcess.onApply = function(e) {
                            var t = 1 / i.brightPassPostProcess.width,
                                n = 1 / i.brightPassPostProcess.height;
                            r[0] = -.5 * t, r[1] = .5 * n, r[2] = .5 * t, r[3] = .5 * n, r[4] = -.5 * t, r[5] = -.5 * n, r[6] = .5 * t, r[7] = -.5 * n, e.setArray2("dsOffsets", r), e.setFloat("brightThreshold", i.brightThreshold)
                        }, this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRBrightPass", function() {
                            return i.brightPassPostProcess
                        }, !0))
                    }, t.prototype._createBlurPostProcesses = function(e, t, i, r) {
                        var n = this;
                        void 0 === r && (r = "blurWidth");
                        var o = e.getEngine(),
                            s = new fn.BlurPostProcess("HDRBlurH_" + i, new fn.Vector2(1, 0), this[r], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, fn.Engine.TEXTURETYPE_UNSIGNED_INT),
                            a = new fn.BlurPostProcess("HDRBlurV_" + i, new fn.Vector2(0, 1), this[r], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, fn.Engine.TEXTURETYPE_UNSIGNED_INT);
                        s.onActivateObservable.add(function() {
                            var e = s.width / o.getRenderWidth();
                            s.kernel = n[r] * e
                        }), a.onActivateObservable.add(function() {
                            var e = a.height / o.getRenderHeight();
                            a.kernel = n.horizontalBlur ? 64 * e : n[r] * e
                        }), this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRBlurH" + i, function() {
                            return s
                        }, !0)), this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRBlurV" + i, function() {
                            return a
                        }, !0)), this.blurHPostProcesses.push(s), this.blurVPostProcesses.push(a)
                    }, t.prototype._createTextureAdderPostProcess = function(e, t) {
                        var i = this;
                        this.textureAdderPostProcess = new fn.PostProcess("HDRTextureAdder", "standard", ["exposure"], ["otherSampler", "lensSampler"], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define TEXTURE_ADDER", fn.Engine.TEXTURETYPE_UNSIGNED_INT), this.textureAdderPostProcess.onApply = function(e) {
                            e.setTextureFromPostProcess("otherSampler", i._vlsEnabled ? i._currentDepthOfFieldSource : i.originalPostProcess), e.setTexture("lensSampler", i.lensTexture), e.setFloat("exposure", i.exposure), i._currentDepthOfFieldSource = i.textureAdderFinalPostProcess
                        }, this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRTextureAdder", function() {
                            return i.textureAdderPostProcess
                        }, !0))
                    }, t.prototype._createVolumetricLightPostProcess = function(e, t) {
                        var i = this,
                            r = e.enableGeometryBufferRenderer();
                        r.enablePosition = !0;
                        var n = r.getGBuffer();
                        this.volumetricLightPostProcess = new fn.PostProcess("HDRVLS", "standard", ["shadowViewProjection", "cameraPosition", "sunDirection", "sunColor", "scatteringCoefficient", "scatteringPower", "depthValues"], ["shadowMapSampler", "positionSampler"], t / 8, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define VLS\n#define NB_STEPS " + this._volumetricLightStepsCount.toFixed(1));
                        var o = fn.Vector2.Zero();
                        this.volumetricLightPostProcess.onApply = function(e) {
                            if (i.sourceLight && i.sourceLight.getShadowGenerator() && i._scene.activeCamera) {
                                var t = i.sourceLight.getShadowGenerator();
                                e.setTexture("shadowMapSampler", t.getShadowMap()), e.setTexture("positionSampler", n.textures[2]), e.setColor3("sunColor", i.sourceLight.diffuse), e.setVector3("sunDirection", i.sourceLight.getShadowDirection()), e.setVector3("cameraPosition", i._scene.activeCamera.globalPosition), e.setMatrix("shadowViewProjection", t.getTransformMatrix()), e.setFloat("scatteringCoefficient", i.volumetricLightCoefficient), e.setFloat("scatteringPower", i.volumetricLightPower), o.x = i.sourceLight.getDepthMinZ(i._scene.activeCamera), o.y = i.sourceLight.getDepthMaxZ(i._scene.activeCamera), e.setVector2("depthValues", o)
                            }
                        }, this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRVLS", function() {
                            return i.volumetricLightPostProcess
                        }, !0)), this._createBlurPostProcesses(e, t / 4, 0, "volumetricLightBlurScale"), this.volumetricLightMergePostProces = new fn.PostProcess("HDRVLSMerge", "standard", [], ["originalSampler"], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define VLSMERGE"), this.volumetricLightMergePostProces.onApply = function(e) {
                            e.setTextureFromPostProcess("originalSampler", i._bloomEnabled ? i.textureAdderFinalPostProcess : i.originalPostProcess), i._currentDepthOfFieldSource = i.volumetricLightFinalPostProcess
                        }, this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRVLSMerge", function() {
                            return i.volumetricLightMergePostProces
                        }, !0))
                    }, t.prototype._createLuminancePostProcesses = function(e, i) {
                        var r = this,
                            n = Math.pow(3, t.LuminanceSteps);
                        this.luminancePostProcess = new fn.PostProcess("HDRLuminance", "standard", ["lumOffsets"], [], {
                            width: n,
                            height: n
                        }, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define LUMINANCE", i);
                        var o = [];
                        this.luminancePostProcess.onApply = function(e) {
                            var t = 1 / r.luminancePostProcess.width,
                                i = 1 / r.luminancePostProcess.height;
                            o[0] = -.5 * t, o[1] = .5 * i, o[2] = .5 * t, o[3] = .5 * i, o[4] = -.5 * t, o[5] = -.5 * i, o[6] = .5 * t, o[7] = -.5 * i, e.setArray2("lumOffsets", o)
                        }, this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRLuminance", function() {
                            return r.luminancePostProcess
                        }, !0));
                        for (var s = t.LuminanceSteps - 1; 0 <= s; s--) {
                            n = Math.pow(3, s);
                            var a = "#define LUMINANCE_DOWN_SAMPLE\n";
                            0 === s && (a += "#define FINAL_DOWN_SAMPLER");
                            var l = new fn.PostProcess("HDRLuminanceDownSample" + s, "standard", ["dsOffsets", "halfDestPixelSize"], [], {
                                width: n,
                                height: n
                            }, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, a, i);
                            this.luminanceDownSamplePostProcesses.push(l)
                        }
                        var u = this.luminancePostProcess;
                        this.luminanceDownSamplePostProcesses.forEach(function(t, i) {
                            var n = new Array(18);
                            t.onApply = function(e) {
                                if (u) {
                                    for (var o = 0, s = -1; s < 2; s++)
                                        for (var a = -1; a < 2; a++) n[o] = s / u.width, n[o + 1] = a / u.height, o += 2;
                                    e.setArray2("dsOffsets", n), e.setFloat("halfDestPixelSize", .5 / u.width), u = i === r.luminanceDownSamplePostProcesses.length - 1 ? r.luminancePostProcess : t
                                }
                            }, i === r.luminanceDownSamplePostProcesses.length - 1 && (t.onAfterRender = function(t) {
                                var i = e.getEngine().readPixels(0, 0, 1, 1),
                                    n = new fn.Vector4(1 / 16581375, 1 / 65025, 1 / 255, 1);
                                r._hdrCurrentLuminance = (i[0] * n.x + i[1] * n.y + i[2] * n.z + i[3] * n.w) / 100
                            }), r.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRLuminanceDownSample" + i, function() {
                                return t
                            }, !0))
                        })
                    }, t.prototype._createHdrPostProcess = function(e, t) {
                        var i = this;
                        this.hdrPostProcess = new fn.PostProcess("HDR", "standard", ["averageLuminance"], ["textureAdderSampler"], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define HDR", fn.Engine.TEXTURETYPE_UNSIGNED_INT);
                        var r = 1,
                            n = 0,
                            o = 0;
                        this.hdrPostProcess.onApply = function(t) {
                            if (t.setTextureFromPostProcess("textureAdderSampler", i._currentDepthOfFieldSource), n += e.getEngine().getDeltaTime(), r < 0) r = i._hdrCurrentLuminance;
                            else {
                                var s = (o - n) / 1e3;
                                i._hdrCurrentLuminance < r + i.hdrDecreaseRate * s ? r += i.hdrDecreaseRate * s : i._hdrCurrentLuminance > r - i.hdrIncreaseRate * s ? r -= i.hdrIncreaseRate * s : r = i._hdrCurrentLuminance
                            }
                            r = fn.Scalar.Clamp(r, i.hdrMinimumLuminance, 1e20), t.setFloat("averageLuminance", r), o = n, i._currentDepthOfFieldSource = i.hdrFinalPostProcess
                        }, this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDR", function() {
                            return i.hdrPostProcess
                        }, !0))
                    }, t.prototype._createLensFlarePostProcess = function(e, t) {
                        var i = this;
                        this.lensFlarePostProcess = new fn.PostProcess("HDRLensFlare", "standard", ["strength", "ghostDispersal", "haloWidth", "resolution", "distortionStrength"], ["lensColorSampler"], t / 2, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define LENS_FLARE", fn.Engine.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRLensFlare", function() {
                            return i.lensFlarePostProcess
                        }, !0)), this._createBlurPostProcesses(e, t / 4, 2), this.lensFlareComposePostProcess = new fn.PostProcess("HDRLensFlareCompose", "standard", ["lensStarMatrix"], ["otherSampler", "lensDirtSampler", "lensStarSampler"], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define LENS_FLARE_COMPOSE", fn.Engine.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRLensFlareCompose", function() {
                            return i.lensFlareComposePostProcess
                        }, !0));
                        var r = new fn.Vector2(0, 0);
                        this.lensFlarePostProcess.onApply = function(e) {
                            e.setTextureFromPostProcess("textureSampler", i._bloomEnabled ? i.blurHPostProcesses[0] : i.originalPostProcess), e.setTexture("lensColorSampler", i.lensColorTexture), e.setFloat("strength", i.lensFlareStrength), e.setFloat("ghostDispersal", i.lensFlareGhostDispersal), e.setFloat("haloWidth", i.lensFlareHaloWidth), r.x = i.lensFlarePostProcess.width, r.y = i.lensFlarePostProcess.height, e.setVector2("resolution", r), e.setFloat("distortionStrength", i.lensFlareDistortionStrength)
                        };
                        var n = fn.Matrix.FromValues(2, 0, -1, 0, 0, 2, -1, 0, 0, 0, 1, 0, 0, 0, 0, 1),
                            o = fn.Matrix.FromValues(.5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1, 0, 0, 0, 0, 1);
                        this.lensFlareComposePostProcess.onApply = function(e) {
                            if (i._scene.activeCamera) {
                                e.setTextureFromPostProcess("otherSampler", i._currentDepthOfFieldSource), e.setTexture("lensDirtSampler", i.lensFlareDirtTexture), e.setTexture("lensStarSampler", i.lensStarTexture);
                                var t = i._scene.activeCamera.getViewMatrix().getRow(0),
                                    r = i._scene.activeCamera.getViewMatrix().getRow(2),
                                    s = fn.Vector3.Dot(t.toVector3(), new fn.Vector3(1, 0, 0)) + fn.Vector3.Dot(r.toVector3(), new fn.Vector3(0, 0, 1));
                                s *= 4;
                                var a = fn.Matrix.FromValues(.5 * Math.cos(s), -Math.sin(s), 0, 0, Math.sin(s), .5 * Math.cos(s), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
                                    l = o.multiply(a).multiply(n);
                                e.setMatrix("lensStarMatrix", l), i._currentDepthOfFieldSource = i.lensFlareFinalPostProcess
                            }
                        }
                    }, t.prototype._createDepthOfFieldPostProcess = function(e, t) {
                        var i = this;
                        this.depthOfFieldPostProcess = new fn.PostProcess("HDRDepthOfField", "standard", ["distance"], ["otherSampler", "depthSampler"], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define DEPTH_OF_FIELD", fn.Engine.TEXTURETYPE_UNSIGNED_INT), this.depthOfFieldPostProcess.onApply = function(e) {
                            e.setTextureFromPostProcess("otherSampler", i._currentDepthOfFieldSource), e.setTexture("depthSampler", i._getDepthTexture()), e.setFloat("distance", i.depthOfFieldDistance)
                        }, this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRDepthOfField", function() {
                            return i.depthOfFieldPostProcess
                        }, !0))
                    }, t.prototype._createMotionBlurPostProcess = function(e, t) {
                        var i = this;
                        this.motionBlurPostProcess = new fn.PostProcess("HDRMotionBlur", "standard", ["inverseViewProjection", "prevViewProjection", "screenSize", "motionScale", "motionStrength"], ["depthSampler"], t, null, fn.Texture.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, "#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES " + this.motionBlurSamples.toFixed(1), fn.Engine.TEXTURETYPE_UNSIGNED_INT);
                        var r = 0,
                            n = fn.Matrix.Identity(),
                            o = fn.Matrix.Identity(),
                            s = fn.Matrix.Identity(),
                            a = fn.Vector2.Zero();
                        this.motionBlurPostProcess.onApply = function(t) {
                            (s = e.getProjectionMatrix().multiply(e.getViewMatrix())).invertToRef(o), t.setMatrix("inverseViewProjection", o), t.setMatrix("prevViewProjection", n), n = s, a.x = i.motionBlurPostProcess.width, a.y = i.motionBlurPostProcess.height, t.setVector2("screenSize", a), r = e.getEngine().getFps() / 60, t.setFloat("motionScale", r), t.setFloat("motionStrength", i.motionStrength), t.setTexture("depthSampler", i._getDepthTexture())
                        }, this.addEffect(new fn.PostProcessRenderEffect(e.getEngine(), "HDRMotionBlur", function() {
                            return i.motionBlurPostProcess
                        }, !0))
                    }, t.prototype._getDepthTexture = function() {
                        return this._scene.getEngine().getCaps().drawBuffersExtension ? this._scene.enableGeometryBufferRenderer().getGBuffer().textures[0] : this._scene.enableDepthRenderer().getDepthMap()
                    }, t.prototype._disposePostProcesses = function() {
                        for (var e = 0; e < this._cameras.length; e++) {
                            var t = this._cameras[e];
                            this.originalPostProcess && this.originalPostProcess.dispose(t), this.downSampleX4PostProcess && this.downSampleX4PostProcess.dispose(t), this.brightPassPostProcess && this.brightPassPostProcess.dispose(t), this.textureAdderPostProcess && this.textureAdderPostProcess.dispose(t), this.textureAdderFinalPostProcess && this.textureAdderFinalPostProcess.dispose(t), this.volumetricLightPostProcess && this.volumetricLightPostProcess.dispose(t), this.volumetricLightSmoothXPostProcess && this.volumetricLightSmoothXPostProcess.dispose(t), this.volumetricLightSmoothYPostProcess && this.volumetricLightSmoothYPostProcess.dispose(t), this.volumetricLightMergePostProces && this.volumetricLightMergePostProces.dispose(t), this.volumetricLightFinalPostProcess && this.volumetricLightFinalPostProcess.dispose(t), this.lensFlarePostProcess && this.lensFlarePostProcess.dispose(t), this.lensFlareComposePostProcess && this.lensFlareComposePostProcess.dispose(t);
                            for (var i = 0; i < this.luminanceDownSamplePostProcesses.length; i++) this.luminanceDownSamplePostProcesses[i].dispose(t);
                            for (this.luminancePostProcess && this.luminancePostProcess.dispose(t), this.hdrPostProcess && this.hdrPostProcess.dispose(t), this.hdrFinalPostProcess && this.hdrFinalPostProcess.dispose(t), this.depthOfFieldPostProcess && this.depthOfFieldPostProcess.dispose(t), this.motionBlurPostProcess && this.motionBlurPostProcess.dispose(t), this.fxaaPostProcess && this.fxaaPostProcess.dispose(t), i = 0; i < this.blurHPostProcesses.length; i++) this.blurHPostProcesses[i].dispose(t);
                            for (i = 0; i < this.blurVPostProcesses.length; i++) this.blurVPostProcesses[i].dispose(t)
                        }
                        this.originalPostProcess = null, this.downSampleX4PostProcess = null, this.brightPassPostProcess = null, this.textureAdderPostProcess = null, this.textureAdderFinalPostProcess = null, this.volumetricLightPostProcess = null, this.volumetricLightSmoothXPostProcess = null, this.volumetricLightSmoothYPostProcess = null, this.volumetricLightMergePostProces = null, this.volumetricLightFinalPostProcess = null, this.lensFlarePostProcess = null, this.lensFlareComposePostProcess = null, this.luminancePostProcess = null, this.hdrPostProcess = null, this.hdrFinalPostProcess = null, this.depthOfFieldPostProcess = null, this.motionBlurPostProcess = null, this.fxaaPostProcess = null, this.luminanceDownSamplePostProcesses = [], this.blurHPostProcesses = [], this.blurVPostProcesses = []
                    }, t.prototype.dispose = function() {
                        this._disposePostProcesses(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), e.prototype.dispose.call(this)
                    }, t.prototype.serialize = function() {
                        var e = fn.SerializationHelper.Serialize(this);
                        return this.sourceLight && (e.sourceLightId = this.sourceLight.id), e.customType = "StandardRenderingPipeline", e
                    }, t.Parse = function(e, i, r) {
                        var n = fn.SerializationHelper.Parse(function() {
                            return new t(e._name, i, e._ratio)
                        }, e, i, r);
                        return e.sourceLightId && (n.sourceLight = i.getLightByID(e.sourceLightId)), n
                    }, t.LuminanceSteps = 6, y([fn.serialize()], t.prototype, "brightThreshold", void 0), y([fn.serialize()], t.prototype, "blurWidth", void 0), y([fn.serialize()], t.prototype, "horizontalBlur", void 0), y([fn.serialize()], t.prototype, "exposure", void 0), y([fn.serializeAsTexture("lensTexture")], t.prototype, "lensTexture", void 0), y([fn.serialize()], t.prototype, "volumetricLightCoefficient", void 0), y([fn.serialize()], t.prototype, "volumetricLightPower", void 0), y([fn.serialize()], t.prototype, "volumetricLightBlurScale", void 0), y([fn.serialize()], t.prototype, "hdrMinimumLuminance", void 0), y([fn.serialize()], t.prototype, "hdrDecreaseRate", void 0), y([fn.serialize()], t.prototype, "hdrIncreaseRate", void 0), y([fn.serializeAsTexture("lensColorTexture")], t.prototype, "lensColorTexture", void 0), y([fn.serialize()], t.prototype, "lensFlareStrength", void 0), y([fn.serialize()], t.prototype, "lensFlareGhostDispersal", void 0), y([fn.serialize()], t.prototype, "lensFlareHaloWidth", void 0), y([fn.serialize()], t.prototype, "lensFlareDistortionStrength", void 0), y([fn.serializeAsTexture("lensStarTexture")], t.prototype, "lensStarTexture", void 0), y([fn.serializeAsTexture("lensFlareDirtTexture")], t.prototype, "lensFlareDirtTexture", void 0), y([fn.serialize()], t.prototype, "depthOfFieldDistance", void 0), y([fn.serialize()], t.prototype, "depthOfFieldBlurWidth", void 0), y([fn.serialize()], t.prototype, "motionStrength", void 0), y([fn.serialize()], t.prototype, "_ratio", void 0), y([fn.serialize()], t.prototype, "BloomEnabled", null), y([fn.serialize()], t.prototype, "DepthOfFieldEnabled", null), y([fn.serialize()], t.prototype, "LensFlareEnabled", null), y([fn.serialize()], t.prototype, "HDREnabled", null), y([fn.serialize()], t.prototype, "VLSEnabled", null), y([fn.serialize()], t.prototype, "MotionBlurEnabled", null), y([fn.serialize()], t.prototype, "fxaaEnabled", null), y([fn.serialize()], t.prototype, "volumetricLightStepsCount", null), y([fn.serialize()], t.prototype, "motionBlurSamples", null), y([fn.serialize()], t.prototype, "samples", null), t
                }(fn.PostProcessRenderPipeline), fn.StandardRenderingPipeline = _n, mn = $a || ($a = {}), gn = function(e) {
                    function t(t, i, r, n, o, s, a) {
                        void 0 === r && (r = null), void 0 === a && (a = mn.Engine.TEXTURETYPE_UNSIGNED_INT);
                        var l = e.call(this, t, "fxaa", ["texelSize"], null, i, r, n || mn.Texture.BILINEAR_SAMPLINGMODE, o, s, null, a, "fxaa", void 0, !0) || this,
                            u = l._getDefines();
                        return l.updateEffect(u), l.onApplyObservable.add(function(e) {
                            var t = l.texelSize;
                            e.setFloat2("texelSize", t.x, t.y)
                        }), l
                    }
                    return b(t, e), t.prototype._getDefines = function() {
                        var e = this.getEngine();
                        if (!e) return null;
                        var t = e.getGlInfo();
                        return t && t.renderer && -1 < t.renderer.toLowerCase().indexOf("mali") ? "#define MALI 1\n" : null
                    }, t
                }(mn.PostProcess), mn.FxaaPostProcess = gn, vn = $a || ($a = {}), yn = function(e) {
                    function t(t, i, r, n, o, s, a, l, u, c) {
                        void 0 === u && (u = vn.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === c && (c = !1);
                        var h = e.call(this, t, "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], [], n, o, s, a, l, null, u, void 0, null, c) || this;
                        return h.aberrationAmount = 30, h.radialIntensity = 0, h.direction = new vn.Vector2(.707, .707), h.centerPosition = new vn.Vector2(.5, .5), h.onApplyObservable.add(function(e) {
                            e.setFloat("chromatic_aberration", h.aberrationAmount), e.setFloat("screen_width", i), e.setFloat("screen_height", r), e.setFloat("radialIntensity", h.radialIntensity), e.setFloat2("direction", h.direction.x, h.direction.y), e.setFloat2("centerPosition", h.centerPosition.x, h.centerPosition.y)
                        }), h
                    }
                    return b(t, e), t
                }(vn.PostProcess), vn.ChromaticAberrationPostProcess = yn, bn = $a || ($a = {}), xn = function(e) {
                    function t(t, i, r, n, o, s, a, l) {
                        void 0 === a && (a = bn.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === l && (l = !1);
                        var u = e.call(this, t, "grain", ["intensity", "animatedSeed"], [], i, r, n, o, s, null, a, void 0, null, l) || this;
                        return u.intensity = 30, u.animated = !1, u.onApplyObservable.add(function(e) {
                            e.setFloat("intensity", u.intensity), e.setFloat("animatedSeed", u.animated ? Math.random() + 1 : 1)
                        }), u
                    }
                    return b(t, e), t
                }(bn.PostProcess), bn.GrainPostProcess = xn, Tn = $a || ($a = {}), En = function(e) {
                    function t(t, i, r, n, o, s, a, l) {
                        void 0 === a && (a = Tn.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === l && (l = !1);
                        var u = e.call(this, t, "sharpen", ["sharpnessAmounts", "screenSize"], null, i, r, n, o, s, null, a, void 0, null, l) || this;
                        return u.colorAmount = 1, u.edgeAmount = .3, u.onApply = function(e) {
                            e.setFloat2("screenSize", u.width, u.height), e.setFloat2("sharpnessAmounts", u.edgeAmount, u.colorAmount)
                        }, u
                    }
                    return b(t, e), t
                }(Tn.PostProcess), Tn.SharpenPostProcess = En, Sn = $a || ($a = {}), Pn = function(e) {
                    function t(t, i, r, n, o, s, a, l, u, c, h) {
                        void 0 === s && (s = Sn.Texture.BILINEAR_SAMPLINGMODE), void 0 === u && (u = Sn.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === c && (c = ""), void 0 === h && (h = !1);
                        var d = e.call(this, t, "kernelBlur", ["delta", "direction", "cameraMinMaxZ"], ["circleOfConfusionSampler"], n, o, s, a, l, null, u, "kernelBlur", {
                            varyingCount: 0,
                            depCount: 0
                        }, !0) || this;
                        return d.direction = i, d.blockCompilation = h, d._packedFloat = !1, d._staticDefines = "", d._staticDefines = c, d.onApplyObservable.add(function(e) {
                            d._outputTexture ? e.setFloat2("delta", 1 / d._outputTexture.width * d.direction.x, 1 / d._outputTexture.height * d.direction.y) : e.setFloat2("delta", 1 / d.width * d.direction.x, 1 / d.height * d.direction.y)
                        }), d.kernel = r, d
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "kernel", {
                        get: function() {
                            return this._idealKernel
                        },
                        set: function(e) {
                            this._idealKernel !== e && (e = Math.max(e, 1), this._idealKernel = e, this._kernel = this._nearestBestKernel(e), this.blockCompilation || this._updateParameters())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "packedFloat", {
                        get: function() {
                            return this._packedFloat
                        },
                        set: function(e) {
                            this._packedFloat !== e && (this._packedFloat = e, this.blockCompilation || this._updateParameters())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.updateEffect = function(e, t, i, r, n, o) {
                        void 0 === e && (e = null), void 0 === t && (t = null), void 0 === i && (i = null), this._updateParameters(n, o)
                    }, t.prototype._updateParameters = function(t, i) {
                        for (var r = this._kernel, n = (r - 1) / 2, o = [], s = [], a = 0, l = 0; l < r; l++) {
                            var u = l / (r - 1),
                                c = this._gaussianWeight(2 * u - 1);
                            o[l] = l - n, a += s[l] = c
                        }
                        for (l = 0; l < s.length; l++) s[l] /= a;
                        var h = [],
                            d = [],
                            p = [];
                        for (l = 0; l <= n; l += 2) {
                            var f = Math.min(l + 1, Math.floor(n));
                            if (l === f) p.push({
                                o: o[l],
                                w: s[l]
                            });
                            else {
                                var _ = f === n,
                                    m = s[l] + s[f] * (_ ? .5 : 1),
                                    g = o[l] + 1 / (1 + s[l] / s[f]);
                                0 === g ? (p.push({
                                    o: o[l],
                                    w: s[l]
                                }), p.push({
                                    o: o[l + 1],
                                    w: s[l + 1]
                                })) : (p.push({
                                    o: g,
                                    w: m
                                }), p.push({
                                    o: -g,
                                    w: m
                                }))
                            }
                        }
                        for (l = 0; l < p.length; l++) d[l] = p[l].o, h[l] = p[l].w;
                        o = d, s = h;
                        var v = this.getEngine().getCaps().maxVaryingVectors,
                            y = Math.max(v, 0) - 1,
                            b = Math.min(o.length, y),
                            x = "";
                        for (x += this._staticDefines, -1 != this._staticDefines.indexOf("DOF") && (x += "#define CENTER_WEIGHT " + this._glslFloat(s[b - 1]) + "\r\n", b--), l = 0; l < b; l++) x += "#define KERNEL_OFFSET" + l + " " + this._glslFloat(o[l]) + "\r\n", x += "#define KERNEL_WEIGHT" + l + " " + this._glslFloat(s[l]) + "\r\n";
                        var T = 0;
                        for (l = y; l < o.length; l++) x += "#define KERNEL_DEP_OFFSET" + T + " " + this._glslFloat(o[l]) + "\r\n", x += "#define KERNEL_DEP_WEIGHT" + T + " " + this._glslFloat(s[l]) + "\r\n", T++;
                        this.packedFloat && (x += "#define PACKEDFLOAT 1"), this.blockCompilation = !1, e.prototype.updateEffect.call(this, x, null, null, {
                            varyingCount: b,
                            depCount: T
                        }, t, i)
                    }, t.prototype._nearestBestKernel = function(e) {
                        for (var t = Math.round(e), i = 0, r = [t, t - 1, t + 1, t - 2, t + 2]; i < r.length; i++) {
                            var n = r[i];
                            if (n % 2 != 0 && Math.floor(n / 2) % 2 == 0 && 0 < n) return Math.max(n, 3)
                        }
                        return Math.max(t, 3)
                    }, t.prototype._gaussianWeight = function(e) {
                        var t = -e * e / (1 / 3 * 2 * (1 / 3));
                        return 1 / (Math.sqrt(2 * Math.PI) * (1 / 3)) * Math.exp(t)
                    }, t.prototype._glslFloat = function(e, t) {
                        return void 0 === t && (t = 8), e.toFixed(t).replace(/0+$/, "")
                    }, t
                }(Sn.PostProcess), Sn.BlurPostProcess = Pn, An = $a || ($a = {}), Cn = function(e) {
                    function t(t, i, r, n, o, s, a, l, u, c, h, d, p) {
                        void 0 === l && (l = null), void 0 === u && (u = An.Texture.BILINEAR_SAMPLINGMODE), void 0 === d && (d = An.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === p && (p = !1);
                        var f = e.call(this, t, r, n, o, s, u = An.Texture.BILINEAR_SAMPLINGMODE, c, h, d = An.Engine.TEXTURETYPE_UNSIGNED_INT, "#define DOF 1\r\n", p) || this;
                        return f.direction = r, f.onApplyObservable.add(function(e) {
                            null != l && e.setTextureFromPostProcess("textureSampler", l), e.setTextureFromPostProcessOutput("circleOfConfusionSampler", a), i.activeCamera && e.setFloat2("cameraMinMaxZ", i.activeCamera.minZ, i.activeCamera.maxZ)
                        }), f
                    }
                    return b(t, e), t
                }(An.BlurPostProcess), An.DepthOfFieldBlurPostProcess = Cn,
                function(e) {
                    var t = function() {};
                    e.DepthOfFieldMergePostProcessOptions = t;
                    var i = function(t) {
                        function i(i, r, n, o, s, a, l, u, c, h, d) {
                            void 0 === h && (h = e.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === d && (d = !1);
                            var p = t.call(this, i, "depthOfFieldMerge", [], ["circleOfConfusionSampler", "blurStep0", "blurStep1", "blurStep2"], s, a, l, u, c, null, h, void 0, null, !0) || this;
                            return p.blurSteps = o, p.onApplyObservable.add(function(e) {
                                e.setTextureFromPostProcess("textureSampler", r), e.setTextureFromPostProcessOutput("circleOfConfusionSampler", n), o.forEach(function(t, i) {
                                    e.setTextureFromPostProcessOutput("blurStep" + (o.length - i - 1), t)
                                })
                            }), d || p.updateEffect(), p
                        }
                        return b(i, t), i.prototype.updateEffect = function(e, i, r, n, o, s) {
                            void 0 === e && (e = null), void 0 === i && (i = null), void 0 === r && (r = null), e || (e = "", e += "#define BLUR_LEVEL " + (this.blurSteps.length - 1) + "\n"), t.prototype.updateEffect.call(this, e, i, r, n, o, s)
                        }, i
                    }(e.PostProcess);
                    e.DepthOfFieldMergePostProcess = i
                }($a || ($a = {})), Mn = $a || ($a = {}), Rn = function(e) {
                    function t(t, i, r, n, o, s, a, l, u) {
                        void 0 === l && (l = Mn.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === u && (u = !1);
                        var c = e.call(this, t, "circleOfConfusion", ["cameraMinMaxZ", "focusDistance", "cocPrecalculation"], ["depthSampler"], r, n, o, s, a, null, l, void 0, null, u) || this;
                        return c.lensSize = 50, c.fStop = 1.4, c.focusDistance = 2e3, c.focalLength = 50, c._depthTexture = null, c._depthTexture = i, c.onApplyObservable.add(function(e) {
                            if (c._depthTexture) {
                                e.setTexture("depthSampler", c._depthTexture);
                                var t = c.lensSize / c.fStop * c.focalLength / (c.focusDistance - c.focalLength);
                                e.setFloat("focusDistance", c.focusDistance), e.setFloat("cocPrecalculation", t), e.setFloat2("cameraMinMaxZ", c._depthTexture.activeCamera.minZ, c._depthTexture.activeCamera.maxZ)
                            } else Mn.Tools.Warn("No depth texture set on CircleOfConfusionPostProcess")
                        }), c
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "depthTexture", {
                        set: function(e) {
                            this._depthTexture = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t
                }(Mn.PostProcess), Mn.CircleOfConfusionPostProcess = Rn,
                function(e) {
                    var t, i;
                    (i = t = e.DepthOfFieldEffectBlurLevel || (e.DepthOfFieldEffectBlurLevel = {}))[i.Low = 0] = "Low", i[i.Medium = 1] = "Medium", i[i.High = 2] = "High";
                    var r = function(i) {
                        function r(r, n, o, s, a) {
                            void 0 === o && (o = t.Low), void 0 === s && (s = 0), void 0 === a && (a = !1);
                            var l = i.call(this, r.getEngine(), "depth of field", function() {
                                return l._effects
                            }, !0) || this;
                            l._effects = [], l._circleOfConfusion = new e.CircleOfConfusionPostProcess("circleOfConfusion", n, 1, null, e.Texture.BILINEAR_SAMPLINGMODE, r.getEngine(), !1, s, a), l._depthOfFieldBlurY = [], l._depthOfFieldBlurX = [];
                            var u = 1,
                                c = 15;
                            switch (o) {
                                case t.High:
                                    u = 3, c = 51;
                                    break;
                                case t.Medium:
                                    u = 2, c = 31;
                                    break;
                                default:
                                    c = 15, u = 1
                            }
                            for (var h = c / Math.pow(2, u - 1), d = 1, p = 0; p < u; p++) {
                                var f = new e.DepthOfFieldBlurPostProcess("verticle blur", r, new e.Vector2(0, 1), h, d, null, l._circleOfConfusion, 0 == p ? l._circleOfConfusion : null, e.Texture.BILINEAR_SAMPLINGMODE, r.getEngine(), !1, s, a);
                                f.autoClear = !1, d = .75 / Math.pow(2, p);
                                var _ = new e.DepthOfFieldBlurPostProcess("horizontal blur", r, new e.Vector2(1, 0), h, d, null, l._circleOfConfusion, null, e.Texture.BILINEAR_SAMPLINGMODE, r.getEngine(), !1, s, a);
                                _.autoClear = !1, l._depthOfFieldBlurY.push(f), l._depthOfFieldBlurX.push(_)
                            }
                            for (l._effects = [l._circleOfConfusion], p = 0; p < l._depthOfFieldBlurX.length; p++) l._effects.push(l._depthOfFieldBlurY[p]), l._effects.push(l._depthOfFieldBlurX[p]);
                            return l._dofMerge = new e.DepthOfFieldMergePostProcess("dofMerge", l._circleOfConfusion, l._circleOfConfusion, l._depthOfFieldBlurX, d, null, e.Texture.BILINEAR_SAMPLINGMODE, r.getEngine(), !1, s, a), l._dofMerge.autoClear = !1, l._effects.push(l._dofMerge), l
                        }
                        return b(r, i), Object.defineProperty(r.prototype, "focalLength", {
                            get: function() {
                                return this._circleOfConfusion.focalLength
                            },
                            set: function(e) {
                                this._circleOfConfusion.focalLength = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "fStop", {
                            get: function() {
                                return this._circleOfConfusion.fStop
                            },
                            set: function(e) {
                                this._circleOfConfusion.fStop = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "focusDistance", {
                            get: function() {
                                return this._circleOfConfusion.focusDistance
                            },
                            set: function(e) {
                                this._circleOfConfusion.focusDistance = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "lensSize", {
                            get: function() {
                                return this._circleOfConfusion.lensSize
                            },
                            set: function(e) {
                                this._circleOfConfusion.lensSize = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(r.prototype, "depthTexture", {
                            set: function(e) {
                                this._circleOfConfusion.depthTexture = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), r.prototype.disposeEffects = function(e) {
                            for (var t = 0; t < this._effects.length; t++) this._effects[t].dispose(e)
                        }, r.prototype._updateEffects = function() {
                            for (var e = 0; e < this._effects.length; e++) this._effects[e].updateEffect()
                        }, r.prototype._isReady = function() {
                            for (var e = 0; e < this._effects.length; e++)
                                if (!this._effects[e].isReady()) return !1;
                            return !0
                        }, r
                    }(e.PostProcessRenderEffect);
                    e.DepthOfFieldEffect = r
                }($a || ($a = {})), On = $a || ($a = {}), wn = function(e) {
                    function t(t, i, r, n, o, s, a, l, u, c, h) {
                        void 0 === c && (c = On.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === h && (h = !1);
                        var d = e.call(this, t, "bloomMerge", ["bloomWeight"], ["circleOfConfusionSampler", "blurStep0", "blurStep1", "blurStep2", "bloomBlur"], o, s, a, l, u, null, c, void 0, null, !0) || this;
                        return d.weight = n, d.onApplyObservable.add(function(e) {
                            e.setTextureFromPostProcess("textureSampler", i), e.setTextureFromPostProcessOutput("bloomBlur", r), e.setFloat("bloomWeight", d.weight)
                        }), h || d.updateEffect(), d
                    }
                    return b(t, e), t
                }(On.PostProcess), On.BloomMergePostProcess = wn, In = $a || ($a = {}), Dn = function(e) {
                    function t(t, i, r, n, o, s, a, l) {
                        void 0 === a && (a = In.Engine.TEXTURETYPE_UNSIGNED_INT), void 0 === l && (l = !1);
                        var u = e.call(this, t, "extractHighlights", ["threshold", "exposure"], null, i, r, n, o, s, null, a, void 0, null, l) || this;
                        return u.threshold = .9, u._exposure = 1, u._inputPostProcess = null,
                            u.onApplyObservable.add(function(e) {
                                u._inputPostProcess && e.setTextureFromPostProcess("textureSampler", u._inputPostProcess), e.setFloat("threshold", Math.pow(u.threshold, In.ToGammaSpace)), e.setFloat("exposure", u._exposure)
                            }), u
                    }
                    return b(t, e), t
                }(In.PostProcess), In.ExtractHighlightsPostProcess = Dn, Ln = $a || ($a = {}), Bn = function(e) {
                    function t(t, i, r, n, o, s) {
                        void 0 === o && (o = 0), void 0 === s && (s = !1);
                        var a = e.call(this, t.getEngine(), "bloom", function() {
                            return a._effects
                        }, !0) || this;
                        return a.bloomScale = i, a._effects = [], a._downscale = new Ln.ExtractHighlightsPostProcess("highlights", 1, null, Ln.Texture.BILINEAR_SAMPLINGMODE, t.getEngine(), !1, o, s), a._blurX = new Ln.BlurPostProcess("horizontal blur", new Ln.Vector2(1, 0), 10, i, null, Ln.Texture.BILINEAR_SAMPLINGMODE, t.getEngine(), !1, o, void 0, s), a._blurX.alwaysForcePOT = !0, a._blurX.autoClear = !1, a._blurY = new Ln.BlurPostProcess("vertical blur", new Ln.Vector2(0, 1), 10, i, null, Ln.Texture.BILINEAR_SAMPLINGMODE, t.getEngine(), !1, o, void 0, s), a._blurY.alwaysForcePOT = !0, a._blurY.autoClear = !1, a.kernel = n, a._effects = [a._downscale, a._blurX, a._blurY], a._merge = new Ln.BloomMergePostProcess("bloomMerge", a._downscale, a._blurY, r, i, null, Ln.Texture.BILINEAR_SAMPLINGMODE, t.getEngine(), !1, o, s), a._merge.autoClear = !1, a._effects.push(a._merge), a
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "threshold", {
                        get: function() {
                            return this._downscale.threshold
                        },
                        set: function(e) {
                            this._downscale.threshold = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "weight", {
                        get: function() {
                            return this._merge.weight
                        },
                        set: function(e) {
                            this._merge.weight = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "kernel", {
                        get: function() {
                            return this._blurX.kernel / this.bloomScale
                        },
                        set: function(e) {
                            this._blurX.kernel = e * this.bloomScale, this._blurY.kernel = e * this.bloomScale
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.disposeEffects = function(e) {
                        for (var t = 0; t < this._effects.length; t++) this._effects[t].dispose(e)
                    }, t.prototype._updateEffects = function() {
                        for (var e = 0; e < this._effects.length; e++) this._effects[e].updateEffect()
                    }, t.prototype._isReady = function() {
                        for (var e = 0; e < this._effects.length; e++)
                            if (!this._effects[e].isReady()) return !1;
                        return !0
                    }, t
                }(Ln.PostProcessRenderEffect), Ln.BloomEffect = Bn, Fn = $a || ($a = {}), Nn = function(e) {
                    function t(t, i, r, n, o) {
                        void 0 === t && (t = ""), void 0 === i && (i = !0), void 0 === r && (r = Fn.Engine.LastCreatedScene), void 0 === o && (o = !0);
                        var s = e.call(this, r.getEngine(), t) || this;
                        s._camerasToBeAttached = [], s.SharpenPostProcessId = "SharpenPostProcessEffect", s.ImageProcessingPostProcessId = "ImageProcessingPostProcessEffect", s.FxaaPostProcessId = "FxaaPostProcessEffect", s.ChromaticAberrationPostProcessId = "ChromaticAberrationPostProcessEffect", s.GrainPostProcessId = "GrainPostProcessEffect", s._glowLayer = null, s.animations = [], s._imageProcessingConfigurationObserver = null, s._sharpenEnabled = !1, s._bloomEnabled = !1, s._depthOfFieldEnabled = !1, s._depthOfFieldBlurLevel = Fn.DepthOfFieldEffectBlurLevel.Low, s._fxaaEnabled = !1, s._imageProcessingEnabled = !0, s._bloomScale = .5, s._chromaticAberrationEnabled = !1, s._grainEnabled = !1, s._buildAllowed = !0, s._resizeObserver = null, s._hardwareScaleLevel = 1, s._bloomKernel = 64, s._bloomWeight = .15, s._bloomThreshold = .9, s._samples = 1, s._hasCleared = !1, s._prevPostProcess = null, s._prevPrevPostProcess = null, s._depthOfFieldSceneObserver = null, s._cameras = n || r.cameras, s._cameras = s._cameras.slice(), s._camerasToBeAttached = s._cameras.slice(), s._buildAllowed = o, s._scene = r;
                        var a = s._scene.getEngine().getCaps();
                        s._hdr = i && (a.textureHalfFloatRender || a.textureFloatRender), s._hdr ? a.textureHalfFloatRender ? s._defaultPipelineTextureType = Fn.Engine.TEXTURETYPE_HALF_FLOAT : a.textureFloatRender && (s._defaultPipelineTextureType = Fn.Engine.TEXTURETYPE_FLOAT) : s._defaultPipelineTextureType = Fn.Engine.TEXTURETYPE_UNSIGNED_INT, r.postProcessRenderPipelineManager.addPipeline(s);
                        var l = s._scene.getEngine();
                        return s.sharpen = new Fn.SharpenPostProcess("sharpen", 1, null, Fn.Texture.BILINEAR_SAMPLINGMODE, l, !1, s._defaultPipelineTextureType, !0), s._sharpenEffect = new Fn.PostProcessRenderEffect(l, s.SharpenPostProcessId, function() {
                            return s.sharpen
                        }, !0), s.depthOfField = new Fn.DepthOfFieldEffect(s._scene, null, s._depthOfFieldBlurLevel, s._defaultPipelineTextureType, !0), s.bloom = new Fn.BloomEffect(s._scene, s._bloomScale, s._bloomWeight, s.bloomKernel, s._defaultPipelineTextureType, !0), s.chromaticAberration = new Fn.ChromaticAberrationPostProcess("ChromaticAberration", l.getRenderWidth(), l.getRenderHeight(), 1, null, Fn.Texture.BILINEAR_SAMPLINGMODE, l, !1, s._defaultPipelineTextureType, !0), s._chromaticAberrationEffect = new Fn.PostProcessRenderEffect(l, s.ChromaticAberrationPostProcessId, function() {
                            return s.chromaticAberration
                        }, !0), s.grain = new Fn.GrainPostProcess("Grain", 1, null, Fn.Texture.BILINEAR_SAMPLINGMODE, l, !1, s._defaultPipelineTextureType, !0), s._grainEffect = new Fn.PostProcessRenderEffect(l, s.GrainPostProcessId, function() {
                            return s.grain
                        }, !0), s._resizeObserver = l.onResizeObservable.add(function() {
                            s._hardwareScaleLevel = l.getHardwareScalingLevel(), s.bloomKernel = s.bloomKernel
                        }), s._imageProcessingConfigurationObserver = s._scene.imageProcessingConfiguration.onUpdateParameters.add(function() {
                            s.bloom._downscale._exposure = s._scene.imageProcessingConfiguration.exposure
                        }), s._buildPipeline(), s
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "sharpenEnabled", {
                        get: function() {
                            return this._sharpenEnabled
                        },
                        set: function(e) {
                            this._sharpenEnabled !== e && (this._sharpenEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "bloomKernel", {
                        get: function() {
                            return this._bloomKernel
                        },
                        set: function(e) {
                            this._bloomKernel = e, this.bloom.kernel = e / this._hardwareScaleLevel
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "bloomWeight", {
                        get: function() {
                            return this._bloomWeight
                        },
                        set: function(e) {
                            this._bloomWeight !== e && (this.bloom.weight = e, this._bloomWeight = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "bloomThreshold", {
                        get: function() {
                            return this._bloomThreshold
                        },
                        set: function(e) {
                            this._bloomThreshold !== e && (this.bloom.threshold = e, this._bloomThreshold = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "bloomScale", {
                        get: function() {
                            return this._bloomScale
                        },
                        set: function(e) {
                            this._bloomScale !== e && (this._bloomScale = e, this._rebuildBloom(), this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "bloomEnabled", {
                        get: function() {
                            return this._bloomEnabled
                        },
                        set: function(e) {
                            this._bloomEnabled !== e && (this._bloomEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._rebuildBloom = function() {
                        var e = this.bloom;
                        this.bloom = new Fn.BloomEffect(this._scene, this.bloomScale, this._bloomWeight, this.bloomKernel, this._defaultPipelineTextureType, !1), this.bloom.threshold = e.threshold;
                        for (var t = 0; t < this._cameras.length; t++) e.disposeEffects(this._cameras[t])
                    }, Object.defineProperty(t.prototype, "depthOfFieldEnabled", {
                        get: function() {
                            return this._depthOfFieldEnabled
                        },
                        set: function(e) {
                            this._depthOfFieldEnabled !== e && (this._depthOfFieldEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "depthOfFieldBlurLevel", {
                        get: function() {
                            return this._depthOfFieldBlurLevel
                        },
                        set: function(e) {
                            if (this._depthOfFieldBlurLevel !== e) {
                                this._depthOfFieldBlurLevel = e;
                                var t = this.depthOfField;
                                this.depthOfField = new Fn.DepthOfFieldEffect(this._scene, null, this._depthOfFieldBlurLevel, this._defaultPipelineTextureType, !1), this.depthOfField.focalLength = t.focalLength, this.depthOfField.focusDistance = t.focusDistance, this.depthOfField.fStop = t.fStop, this.depthOfField.lensSize = t.lensSize;
                                for (var i = 0; i < this._cameras.length; i++) t.disposeEffects(this._cameras[i]);
                                this._buildPipeline()
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "fxaaEnabled", {
                        get: function() {
                            return this._fxaaEnabled
                        },
                        set: function(e) {
                            this._fxaaEnabled !== e && (this._fxaaEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "samples", {
                        get: function() {
                            return this._samples
                        },
                        set: function(e) {
                            this._samples !== e && (this._samples = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "imageProcessingEnabled", {
                        get: function() {
                            return this._imageProcessingEnabled
                        },
                        set: function(e) {
                            this._imageProcessingEnabled !== e && (this._imageProcessingEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "glowLayerEnabled", {
                        get: function() {
                            return null == this._glowLayer
                        },
                        set: function(e) {
                            e && !this._glowLayer ? this._glowLayer = new Fn.GlowLayer("", this._scene) : !e && this._glowLayer && (this._glowLayer.dispose(), this._glowLayer = null)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "chromaticAberrationEnabled", {
                        get: function() {
                            return this._chromaticAberrationEnabled
                        },
                        set: function(e) {
                            this._chromaticAberrationEnabled !== e && (this._chromaticAberrationEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "grainEnabled", {
                        get: function() {
                            return this._grainEnabled
                        },
                        set: function(e) {
                            this._grainEnabled !== e && (this._grainEnabled = e, this._buildPipeline())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.prepare = function() {
                        var e = this._buildAllowed;
                        this._buildAllowed = !0, this._buildPipeline(), this._buildAllowed = e
                    }, t.prototype._setAutoClearAndTextureSharing = function(e, t) {
                        void 0 === t && (t = !1), this._hasCleared ? e.autoClear = !1 : (e.autoClear = !0, this._scene.autoClear = !1, this._hasCleared = !0), t || (this._prevPrevPostProcess ? e.shareOutputWith(this._prevPrevPostProcess) : e.useOwnOutput(), this._prevPostProcess && (this._prevPrevPostProcess = this._prevPostProcess), this._prevPostProcess = e)
                    }, t.prototype._buildPipeline = function() {
                        var e = this;
                        if (this._buildAllowed) {
                            this._scene.autoClear = !0;
                            var t = this._scene.getEngine();
                            if (this._disposePostProcesses(), null !== this._cameras && (this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._cameras = this._camerasToBeAttached.slice()), this._reset(), this._prevPostProcess = null, this._prevPrevPostProcess = null, this._hasCleared = !1, this.depthOfFieldEnabled) {
                                if (1 < this._cameras.length) {
                                    for (var i = 0, r = this._cameras; i < r.length; i++) {
                                        var n = r[i];
                                        (o = this._scene.enableDepthRenderer(n)).useOnlyInActiveCamera = !0
                                    }
                                    this._depthOfFieldSceneObserver = this._scene.onAfterRenderTargetsRenderObservable.add(function(t) {
                                        -1 < e._cameras.indexOf(t.activeCamera) && (e.depthOfField.depthTexture = t.enableDepthRenderer(t.activeCamera).getDepthMap())
                                    })
                                } else {
                                    this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);
                                    var o = this._scene.enableDepthRenderer(this._cameras[0]);
                                    this.depthOfField.depthTexture = o.getDepthMap()
                                }
                                this.depthOfField._isReady() || this.depthOfField._updateEffects(), this.addEffect(this.depthOfField), this._setAutoClearAndTextureSharing(this.depthOfField._effects[0], !0)
                            } else this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);
                            this.bloomEnabled && (this.bloom._isReady() || this.bloom._updateEffects(), this.addEffect(this.bloom), this._setAutoClearAndTextureSharing(this.bloom._effects[0], !0)), this._imageProcessingEnabled && (this.imageProcessing = new Fn.ImageProcessingPostProcess("imageProcessing", 1, null, Fn.Texture.BILINEAR_SAMPLINGMODE, t, !1, this._defaultPipelineTextureType), this._hdr ? (this.addEffect(new Fn.PostProcessRenderEffect(t, this.ImageProcessingPostProcessId, function() {
                                return e.imageProcessing
                            }, !0)), this._setAutoClearAndTextureSharing(this.imageProcessing)) : this._scene.imageProcessingConfiguration.applyByPostProcess = !1), this.sharpenEnabled && (this.sharpen.isReady() || this.sharpen.updateEffect(), this.addEffect(this._sharpenEffect), this._setAutoClearAndTextureSharing(this.sharpen)), this.grainEnabled && (this.grain.isReady() || this.grain.updateEffect(), this.addEffect(this._grainEffect), this._setAutoClearAndTextureSharing(this.grain)), this.chromaticAberrationEnabled && (this.chromaticAberration.isReady() || this.chromaticAberration.updateEffect(), this.addEffect(this._chromaticAberrationEffect), this._setAutoClearAndTextureSharing(this.chromaticAberration)), this.fxaaEnabled && (this.fxaa = new Fn.FxaaPostProcess("fxaa", 1, null, Fn.Texture.BILINEAR_SAMPLINGMODE, t, !1, this._defaultPipelineTextureType), this.addEffect(new Fn.PostProcessRenderEffect(t, this.FxaaPostProcessId, function() {
                                return e.fxaa
                            }, !0)), this._setAutoClearAndTextureSharing(this.fxaa, !0)), null !== this._cameras && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras), !this._enableMSAAOnFirstPostProcess(this.samples) && 1 < this.samples && Fn.Tools.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0")
                        }
                    }, t.prototype._disposePostProcesses = function(e) {
                        void 0 === e && (e = !1);
                        for (var t = 0; t < this._cameras.length; t++) {
                            var i = this._cameras[t];
                            this.imageProcessing && this.imageProcessing.dispose(i), this.fxaa && this.fxaa.dispose(i), e && (this.sharpen && this.sharpen.dispose(i), this.depthOfField && (this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver), this.depthOfField.disposeEffects(i)), this.bloom && this.bloom.disposeEffects(i), this.chromaticAberration && this.chromaticAberration.dispose(i), this.grain && this.grain.dispose(i), this._glowLayer && this._glowLayer.dispose())
                        }
                        this.imageProcessing = null, this.fxaa = null, e && (this.sharpen = null, this._sharpenEffect = null, this.depthOfField = null, this.bloom = null, this.chromaticAberration = null, this._chromaticAberrationEffect = null, this.grain = null, this._grainEffect = null, this._glowLayer = null)
                    }, t.prototype.addCamera = function(e) {
                        this._camerasToBeAttached.push(e), this._buildPipeline()
                    }, t.prototype.removeCamera = function(e) {
                        var t = this._camerasToBeAttached.indexOf(e);
                        this._camerasToBeAttached.splice(t, 1), this._buildPipeline()
                    }, t.prototype.dispose = function() {
                        this._disposePostProcesses(!0), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._scene.autoClear = !0, this._resizeObserver && (this._scene.getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this._scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigurationObserver), e.prototype.dispose.call(this)
                    }, t.prototype.serialize = function() {
                        var e = Fn.SerializationHelper.Serialize(this);
                        return e.customType = "DefaultRenderingPipeline", e
                    }, t.Parse = function(e, i, r) {
                        return Fn.SerializationHelper.Parse(function() {
                            return new t(e._name, e._name._hdr, i)
                        }, e, i, r)
                    }, y([Fn.serialize()], t.prototype, "sharpenEnabled", null), y([Fn.serialize()], t.prototype, "bloomKernel", null), y([Fn.serialize()], t.prototype, "_bloomWeight", void 0), y([Fn.serialize()], t.prototype, "_bloomThreshold", void 0), y([Fn.serialize()], t.prototype, "_hdr", void 0), y([Fn.serialize()], t.prototype, "bloomWeight", null), y([Fn.serialize()], t.prototype, "bloomThreshold", null), y([Fn.serialize()], t.prototype, "bloomScale", null), y([Fn.serialize()], t.prototype, "bloomEnabled", null), y([Fn.serialize()], t.prototype, "depthOfFieldEnabled", null), y([Fn.serialize()], t.prototype, "depthOfFieldBlurLevel", null), y([Fn.serialize()], t.prototype, "fxaaEnabled", null), y([Fn.serialize()], t.prototype, "samples", null), y([Fn.serialize()], t.prototype, "imageProcessingEnabled", null), y([Fn.serialize()], t.prototype, "glowLayerEnabled", null), y([Fn.serialize()], t.prototype, "chromaticAberrationEnabled", null), y([Fn.serialize()], t.prototype, "grainEnabled", null), t
                }(Fn.PostProcessRenderPipeline), Fn.DefaultRenderingPipeline = Nn,
                function(e) {
                    var t = function(e) {
                        function t() {
                            var t = e.call(this) || this;
                            return t.IMAGEPROCESSING = !1, t.VIGNETTE = !1, t.VIGNETTEBLENDMODEMULTIPLY = !1, t.VIGNETTEBLENDMODEOPAQUE = !1, t.TONEMAPPING = !1, t.TONEMAPPING_ACES = !1, t.CONTRAST = !1, t.COLORCURVES = !1, t.COLORGRADING = !1, t.COLORGRADING3D = !1, t.SAMPLER3DGREENDEPTH = !1, t.SAMPLER3DBGRMAP = !1, t.IMAGEPROCESSINGPOSTPROCESS = !1, t.EXPOSURE = !1, t.rebuild(), t
                        }
                        return b(t, e), t
                    }(e.MaterialDefines);
                    e.ImageProcessingConfigurationDefines = t;
                    var i = function() {
                        function t() {
                            this.colorCurves = new e.ColorCurves, this._colorCurvesEnabled = !1, this._colorGradingEnabled = !1, this._colorGradingWithGreenDepth = !0, this._colorGradingBGR = !0, this._exposure = 1, this._toneMappingEnabled = !1, this._toneMappingType = t.TONEMAPPING_STANDARD, this._contrast = 1, this.vignetteStretch = 0, this.vignetteCentreX = 0, this.vignetteCentreY = 0, this.vignetteWeight = 1.5, this.vignetteColor = new e.Color4(0, 0, 0, 0), this.vignetteCameraFov = .5, this._vignetteBlendMode = t.VIGNETTEMODE_MULTIPLY, this._vignetteEnabled = !1, this._applyByPostProcess = !1, this._isEnabled = !0, this.onUpdateParameters = new e.Observable
                        }
                        return Object.defineProperty(t.prototype, "colorCurvesEnabled", {
                            get: function() {
                                return this._colorCurvesEnabled
                            },
                            set: function(e) {
                                this._colorCurvesEnabled !== e && (this._colorCurvesEnabled = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "colorGradingTexture", {
                            get: function() {
                                return this._colorGradingTexture
                            },
                            set: function(e) {
                                this._colorGradingTexture !== e && (this._colorGradingTexture = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "colorGradingEnabled", {
                            get: function() {
                                return this._colorGradingEnabled
                            },
                            set: function(e) {
                                this._colorGradingEnabled !== e && (this._colorGradingEnabled = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "colorGradingWithGreenDepth", {
                            get: function() {
                                return this._colorGradingWithGreenDepth
                            },
                            set: function(e) {
                                this._colorGradingWithGreenDepth !== e && (this._colorGradingWithGreenDepth = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "colorGradingBGR", {
                            get: function() {
                                return this._colorGradingBGR
                            },
                            set: function(e) {
                                this._colorGradingBGR !== e && (this._colorGradingBGR = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "exposure", {
                            get: function() {
                                return this._exposure
                            },
                            set: function(e) {
                                this._exposure !== e && (this._exposure = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "toneMappingEnabled", {
                            get: function() {
                                return this._toneMappingEnabled
                            },
                            set: function(e) {
                                this._toneMappingEnabled !== e && (this._toneMappingEnabled = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "toneMappingType", {
                            get: function() {
                                return this._toneMappingType
                            },
                            set: function(e) {
                                this._toneMappingType !== e && (this._toneMappingType = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "contrast", {
                            get: function() {
                                return this._contrast
                            },
                            set: function(e) {
                                this._contrast !== e && (this._contrast = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "vignetteBlendMode", {
                            get: function() {
                                return this._vignetteBlendMode
                            },
                            set: function(e) {
                                this._vignetteBlendMode !== e && (this._vignetteBlendMode = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "vignetteEnabled", {
                            get: function() {
                                return this._vignetteEnabled
                            },
                            set: function(e) {
                                this._vignetteEnabled !== e && (this._vignetteEnabled = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "applyByPostProcess", {
                            get: function() {
                                return this._applyByPostProcess
                            },
                            set: function(e) {
                                this._applyByPostProcess !== e && (this._applyByPostProcess = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "isEnabled", {
                            get: function() {
                                return this._isEnabled
                            },
                            set: function(e) {
                                this._isEnabled !== e && (this._isEnabled = e, this._updateParameters())
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype._updateParameters = function() {
                            this.onUpdateParameters.notifyObservers(this)
                        }, t.prototype.getClassName = function() {
                            return "ImageProcessingConfiguration"
                        }, t.PrepareUniforms = function(t, i) {
                            i.EXPOSURE && t.push("exposureLinear"), i.CONTRAST && t.push("contrast"), i.COLORGRADING && t.push("colorTransformSettings"), i.VIGNETTE && (t.push("vInverseScreenSize"), t.push("vignetteSettings1"), t.push("vignetteSettings2")), i.COLORCURVES && e.ColorCurves.PrepareUniforms(t)
                        }, t.PrepareSamplers = function(e, t) {
                            t.COLORGRADING && e.push("txColorTransform")
                        }, t.prototype.prepareDefines = function(e, i) {
                            if (void 0 === i && (i = !1), i !== this.applyByPostProcess || !this._isEnabled) return e.VIGNETTE = !1, e.TONEMAPPING = !1, e.TONEMAPPING_ACES = !1, e.CONTRAST = !1, e.EXPOSURE = !1, e.COLORCURVES = !1, e.COLORGRADING = !1, e.COLORGRADING3D = !1, e.IMAGEPROCESSING = !1, void(e.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess && this._isEnabled);
                            switch (e.VIGNETTE = this.vignetteEnabled, e.VIGNETTEBLENDMODEMULTIPLY = this.vignetteBlendMode === t._VIGNETTEMODE_MULTIPLY, e.VIGNETTEBLENDMODEOPAQUE = !e.VIGNETTEBLENDMODEMULTIPLY, e.TONEMAPPING = this.toneMappingEnabled, this._toneMappingType) {
                                case t.TONEMAPPING_ACES:
                                    e.TONEMAPPING_ACES = !0
                            }
                            e.CONTRAST = 1 !== this.contrast, e.EXPOSURE = 1 !== this.exposure, e.COLORCURVES = this.colorCurvesEnabled && !!this.colorCurves, e.COLORGRADING = this.colorGradingEnabled && !!this.colorGradingTexture, e.COLORGRADING ? e.COLORGRADING3D = this.colorGradingTexture.is3D : e.COLORGRADING3D = !1, e.SAMPLER3DGREENDEPTH = this.colorGradingWithGreenDepth, e.SAMPLER3DBGRMAP = this.colorGradingBGR, e.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess, e.IMAGEPROCESSING = e.VIGNETTE || e.TONEMAPPING || e.CONTRAST || e.EXPOSURE || e.COLORCURVES || e.COLORGRADING
                        }, t.prototype.isReady = function() {
                            return !this.colorGradingEnabled || !this.colorGradingTexture || this.colorGradingTexture.isReady()
                        }, t.prototype.bind = function(t, i) {
                            if (void 0 === i && (i = 1), this._colorCurvesEnabled && this.colorCurves && e.ColorCurves.Bind(this.colorCurves, t), this._vignetteEnabled) {
                                var r = 1 / t.getEngine().getRenderWidth(),
                                    n = 1 / t.getEngine().getRenderHeight();
                                t.setFloat2("vInverseScreenSize", r, n);
                                var o = Math.tan(.5 * this.vignetteCameraFov),
                                    s = o * i,
                                    a = Math.sqrt(s * o);
                                s = e.Tools.Mix(s, a, this.vignetteStretch), o = e.Tools.Mix(o, a, this.vignetteStretch), t.setFloat4("vignetteSettings1", s, o, -s * this.vignetteCentreX, -o * this.vignetteCentreY);
                                var l = -2 * this.vignetteWeight;
                                t.setFloat4("vignetteSettings2", this.vignetteColor.r, this.vignetteColor.g, this.vignetteColor.b, l)
                            }
                            if (t.setFloat("exposureLinear", this.exposure), t.setFloat("contrast", this.contrast), this.colorGradingTexture) {
                                t.setTexture("txColorTransform", this.colorGradingTexture);
                                var u = this.colorGradingTexture.getSize().height;
                                t.setFloat4("colorTransformSettings", (u - 1) / u, .5 / u, u, this.colorGradingTexture.level)
                            }
                        }, t.prototype.clone = function() {
                            return e.SerializationHelper.Clone(function() {
                                return new t
                            }, this)
                        }, t.prototype.serialize = function() {
                            return e.SerializationHelper.Serialize(this)
                        }, t.Parse = function(i) {
                            return e.SerializationHelper.Parse(function() {
                                return new t
                            }, i, null, null)
                        }, Object.defineProperty(t, "VIGNETTEMODE_MULTIPLY", {
                            get: function() {
                                return this._VIGNETTEMODE_MULTIPLY
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t, "VIGNETTEMODE_OPAQUE", {
                            get: function() {
                                return this._VIGNETTEMODE_OPAQUE
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.TONEMAPPING_STANDARD = 0, t.TONEMAPPING_ACES = 1, t._VIGNETTEMODE_MULTIPLY = 0, t._VIGNETTEMODE_OPAQUE = 1, y([e.serializeAsColorCurves()], t.prototype, "colorCurves", void 0), y([e.serialize()], t.prototype, "_colorCurvesEnabled", void 0), y([e.serializeAsTexture("colorGradingTexture")], t.prototype, "_colorGradingTexture", void 0), y([e.serialize()], t.prototype, "_colorGradingEnabled", void 0), y([e.serialize()], t.prototype, "_colorGradingWithGreenDepth", void 0), y([e.serialize()], t.prototype, "_colorGradingBGR", void 0), y([e.serialize()], t.prototype, "_exposure", void 0), y([e.serialize()], t.prototype, "_toneMappingEnabled", void 0), y([e.serialize()], t.prototype, "_toneMappingType", void 0), y([e.serialize()], t.prototype, "_contrast", void 0), y([e.serialize()], t.prototype, "vignetteStretch", void 0), y([e.serialize()], t.prototype, "vignetteCentreX", void 0), y([e.serialize()], t.prototype, "vignetteCentreY", void 0), y([e.serialize()], t.prototype, "vignetteWeight", void 0), y([e.serializeAsColor4()], t.prototype, "vignetteColor", void 0), y([e.serialize()], t.prototype, "vignetteCameraFov", void 0), y([e.serialize()], t.prototype, "_vignetteBlendMode", void 0), y([e.serialize()], t.prototype, "_vignetteEnabled", void 0), y([e.serialize()], t.prototype, "_applyByPostProcess", void 0), y([e.serialize()], t.prototype, "_isEnabled", void 0), t
                    }();
                    e.ImageProcessingConfiguration = i
                }($a || ($a = {})), Vn = $a || ($a = {}), kn = function(e) {
                    function t(t, i) {
                        var r = e.call(this, i) || this;
                        return t && (r._engine = i.getEngine(), r._textureMatrix = Vn.Matrix.Identity(), r.name = t, r.url = t, r.hasAlpha = !1, r.isCube = !1, r.is3D = 1 < r._engine.webGLVersion, r.wrapU = Vn.Texture.CLAMP_ADDRESSMODE, r.wrapV = Vn.Texture.CLAMP_ADDRESSMODE, r.wrapR = Vn.Texture.CLAMP_ADDRESSMODE, r.anisotropicFilteringLevel = 1, r._texture = r._getFromCache(t, !0), r._texture || (i.useDelayedTextureLoading ? r.delayLoadState = Vn.Engine.DELAYLOADSTATE_NOTLOADED : r.loadTexture())), r
                    }
                    return b(t, e), t.prototype.getTextureMatrix = function() {
                        return this._textureMatrix
                    }, t.prototype.load3dlTexture = function() {
                        var e, i = this._engine;
                        e = 1 === i.webGLVersion ? i.createRawTexture(null, 1, 1, Vn.Engine.TEXTUREFORMAT_RGBA, !1, !1, Vn.Texture.BILINEAR_SAMPLINGMODE) : i.createRawTexture3D(null, 1, 1, 1, Vn.Engine.TEXTUREFORMAT_RGBA, !1, !1, Vn.Texture.BILINEAR_SAMPLINGMODE), this._texture = e;
                        var r = function(r) {
                                if ("string" == typeof r) {
                                    for (var n, o = null, s = null, a = r.split("\n"), l = 0, u = 0, c = 0, h = 0, d = 0, p = 0; p < a.length; p++)
                                        if (n = a[p], t._noneEmptyLineRegex.test(n) && 0 !== n.indexOf("#")) {
                                            var f = n.split(" ");
                                            if (0 !== l) {
                                                if (0 != l) {
                                                    var _ = Math.max(parseInt(f[0]), 0),
                                                        m = Math.max(parseInt(f[1]), 0),
                                                        g = Math.max(parseInt(f[2]), 0);
                                                    d = Math.max(_, d), d = Math.max(m, d), d = Math.max(g, d);
                                                    var v = 4 * (u + h * l + c * l * l);
                                                    s && (s[v + 0] = _, s[v + 1] = m, s[v + 2] = g), ++c % l == 0 && ++h % l == (c = 0) && (u++, h = 0)
                                                }
                                            } else l = f.length, o = new Uint8Array(l * l * l * 4), s = new Float32Array(l * l * l * 4)
                                        }
                                    if (s && o)
                                        for (p = 0; p < s.length; p++)
                                            if (0 < p && (p + 1) % 4 == 0) o[p] = 255;
                                            else {
                                                var y = s[p];
                                                o[p] = y / d * 255
                                            }
                                    e.is3D ? (e.updateSize(l, l, l), i.updateRawTexture3D(e, o, Vn.Engine.TEXTUREFORMAT_RGBA, !1)) : (e.updateSize(l * l, l), i.updateRawTexture(e, o, Vn.Engine.TEXTUREFORMAT_RGBA, !1))
                                }
                            },
                            n = this.getScene();
                        return n ? n._loadFile(this.url, r) : this._engine._loadFile(this.url, r), this._texture
                    }, t.prototype.loadTexture = function() {
                        this.url && this.url.toLocaleLowerCase().indexOf(".3dl") == this.url.length - 4 && this.load3dlTexture()
                    }, t.prototype.clone = function() {
                        var e = new t(this.url, this.getScene());
                        return e.level = this.level, e
                    }, t.prototype.delayLoad = function() {
                        this.delayLoadState === Vn.Engine.DELAYLOADSTATE_NOTLOADED && (this.delayLoadState = Vn.Engine.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, !0), this._texture || this.loadTexture())
                    }, t.Parse = function(e, i, r) {
                        var n = null;
                        return e.name && !e.isRenderTarget && ((n = new t(e.name, i)).name = e.name, n.level = e.level), n
                    }, t.prototype.serialize = function() {
                        if (!this.name) return null;
                        var e = {};
                        return e.name = this.name, e.level = this.level, e.customType = "BABYLON.ColorGradingTexture", e
                    }, t._noneEmptyLineRegex = /\S+/, t
                }(Vn.BaseTexture), Vn.ColorGradingTexture = kn, Un = $a || ($a = {}), Gn = function() {
                    function e() {
                        this._dirty = !0, this._tempColor = new Un.Color4(0, 0, 0, 0), this._globalCurve = new Un.Color4(0, 0, 0, 0), this._highlightsCurve = new Un.Color4(0, 0, 0, 0), this._midtonesCurve = new Un.Color4(0, 0, 0, 0), this._shadowsCurve = new Un.Color4(0, 0, 0, 0), this._positiveCurve = new Un.Color4(0, 0, 0, 0), this._negativeCurve = new Un.Color4(0, 0, 0, 0), this._globalHue = 30, this._globalDensity = 0, this._globalSaturation = 0, this._globalExposure = 0, this._highlightsHue = 30, this._highlightsDensity = 0, this._highlightsSaturation = 0, this._highlightsExposure = 0, this._midtonesHue = 30, this._midtonesDensity = 0, this._midtonesSaturation = 0, this._midtonesExposure = 0, this._shadowsHue = 30, this._shadowsDensity = 0, this._shadowsSaturation = 0, this._shadowsExposure = 0
                    }
                    return Object.defineProperty(e.prototype, "globalHue", {
                        get: function() {
                            return this._globalHue
                        },
                        set: function(e) {
                            this._globalHue = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "globalDensity", {
                        get: function() {
                            return this._globalDensity
                        },
                        set: function(e) {
                            this._globalDensity = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "globalSaturation", {
                        get: function() {
                            return this._globalSaturation
                        },
                        set: function(e) {
                            this._globalSaturation = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "globalExposure", {
                        get: function() {
                            return this._globalExposure
                        },
                        set: function(e) {
                            this._globalExposure = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "highlightsHue", {
                        get: function() {
                            return this._highlightsHue
                        },
                        set: function(e) {
                            this._highlightsHue = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "highlightsDensity", {
                        get: function() {
                            return this._highlightsDensity
                        },
                        set: function(e) {
                            this._highlightsDensity = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "highlightsSaturation", {
                        get: function() {
                            return this._highlightsSaturation
                        },
                        set: function(e) {
                            this._highlightsSaturation = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "highlightsExposure", {
                        get: function() {
                            return this._highlightsExposure
                        },
                        set: function(e) {
                            this._highlightsExposure = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "midtonesHue", {
                        get: function() {
                            return this._midtonesHue
                        },
                        set: function(e) {
                            this._midtonesHue = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "midtonesDensity", {
                        get: function() {
                            return this._midtonesDensity
                        },
                        set: function(e) {
                            this._midtonesDensity = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "midtonesSaturation", {
                        get: function() {
                            return this._midtonesSaturation
                        },
                        set: function(e) {
                            this._midtonesSaturation = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "midtonesExposure", {
                        get: function() {
                            return this._midtonesExposure
                        },
                        set: function(e) {
                            this._midtonesExposure = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "shadowsHue", {
                        get: function() {
                            return this._shadowsHue
                        },
                        set: function(e) {
                            this._shadowsHue = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "shadowsDensity", {
                        get: function() {
                            return this._shadowsDensity
                        },
                        set: function(e) {
                            this._shadowsDensity = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "shadowsSaturation", {
                        get: function() {
                            return this._shadowsSaturation
                        },
                        set: function(e) {
                            this._shadowsSaturation = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "shadowsExposure", {
                        get: function() {
                            return this._shadowsExposure
                        },
                        set: function(e) {
                            this._shadowsExposure = e, this._dirty = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getClassName = function() {
                        return "ColorCurves"
                    }, e.Bind = function(e, t, i, r, n) {
                        void 0 === i && (i = "vCameraColorCurvePositive"), void 0 === r && (r = "vCameraColorCurveNeutral"), void 0 === n && (n = "vCameraColorCurveNegative"), e._dirty && (e._dirty = !1, e.getColorGradingDataToRef(e._globalHue, e._globalDensity, e._globalSaturation, e._globalExposure, e._globalCurve), e.getColorGradingDataToRef(e._highlightsHue, e._highlightsDensity, e._highlightsSaturation, e._highlightsExposure, e._tempColor), e._tempColor.multiplyToRef(e._globalCurve, e._highlightsCurve), e.getColorGradingDataToRef(e._midtonesHue, e._midtonesDensity, e._midtonesSaturation, e._midtonesExposure, e._tempColor), e._tempColor.multiplyToRef(e._globalCurve, e._midtonesCurve), e.getColorGradingDataToRef(e._shadowsHue, e._shadowsDensity, e._shadowsSaturation, e._shadowsExposure, e._tempColor), e._tempColor.multiplyToRef(e._globalCurve, e._shadowsCurve), e._highlightsCurve.subtractToRef(e._midtonesCurve, e._positiveCurve), e._midtonesCurve.subtractToRef(e._shadowsCurve, e._negativeCurve)), t && (t.setFloat4(i, e._positiveCurve.r, e._positiveCurve.g, e._positiveCurve.b, e._positiveCurve.a), t.setFloat4(r, e._midtonesCurve.r, e._midtonesCurve.g, e._midtonesCurve.b, e._midtonesCurve.a), t.setFloat4(n, e._negativeCurve.r, e._negativeCurve.g, e._negativeCurve.b, e._negativeCurve.a))
                    }, e.PrepareUniforms = function(e) {
                        e.push("vCameraColorCurveNeutral", "vCameraColorCurvePositive", "vCameraColorCurveNegative")
                    }, e.prototype.getColorGradingDataToRef = function(t, i, r, n, o) {
                        null != t && (t = e.clamp(t, 0, 360), i = e.clamp(i, -100, 100), r = e.clamp(r, -100, 100), n = e.clamp(n, -100, 100), i = e.applyColorGradingSliderNonlinear(i), i *= .5, n = e.applyColorGradingSliderNonlinear(n), i < 0 && (i *= -1, t = (t + 180) % 360), e.fromHSBToRef(t, i, 50 + .25 * n, o), o.scaleToRef(2, o), o.a = 1 + .01 * r)
                    }, e.applyColorGradingSliderNonlinear = function(e) {
                        e /= 100;
                        var t = Math.abs(e);
                        return t = Math.pow(t, 2), e < 0 && (t *= -1), t *= 100
                    }, e.fromHSBToRef = function(t, i, r, n) {
                        var o = e.clamp(t, 0, 360),
                            s = e.clamp(i / 100, 0, 1),
                            a = e.clamp(r / 100, 0, 1);
                        if (0 === s) n.r = a, n.g = a, n.b = a;
                        else {
                            o /= 60;
                            var l = Math.floor(o),
                                u = o - l,
                                c = a * (1 - s),
                                h = a * (1 - s * u),
                                d = a * (1 - s * (1 - u));
                            switch (l) {
                                case 0:
                                    n.r = a, n.g = d, n.b = c;
                                    break;
                                case 1:
                                    n.r = h, n.g = a, n.b = c;
                                    break;
                                case 2:
                                    n.r = c, n.g = a, n.b = d;
                                    break;
                                case 3:
                                    n.r = c, n.g = h, n.b = a;
                                    break;
                                case 4:
                                    n.r = d, n.g = c, n.b = a;
                                    break;
                                default:
                                    n.r = a, n.g = c, n.b = h
                            }
                        }
                        n.a = 1
                    }, e.clamp = function(e, t, i) {
                        return Math.min(Math.max(e, t), i)
                    }, e.prototype.clone = function() {
                        return Un.SerializationHelper.Clone(function() {
                            return new e
                        }, this)
                    }, e.prototype.serialize = function() {
                        return Un.SerializationHelper.Serialize(this)
                    }, e.Parse = function(t) {
                        return Un.SerializationHelper.Parse(function() {
                            return new e
                        }, t, null, null)
                    }, y([Un.serialize()], e.prototype, "_globalHue", void 0), y([Un.serialize()], e.prototype, "_globalDensity", void 0), y([Un.serialize()], e.prototype, "_globalSaturation", void 0), y([Un.serialize()], e.prototype, "_globalExposure", void 0), y([Un.serialize()], e.prototype, "_highlightsHue", void 0), y([Un.serialize()], e.prototype, "_highlightsDensity", void 0), y([Un.serialize()], e.prototype, "_highlightsSaturation", void 0), y([Un.serialize()], e.prototype, "_highlightsExposure", void 0), y([Un.serialize()], e.prototype, "_midtonesHue", void 0), y([Un.serialize()], e.prototype, "_midtonesDensity", void 0), y([Un.serialize()], e.prototype, "_midtonesSaturation", void 0), y([Un.serialize()], e.prototype, "_midtonesExposure", void 0), e
                }(), Un.ColorCurves = Gn, zn = $a || ($a = {}), jn = function(e) {
                    function t(t, i, r, n, o, s, a, l, u, c) {
                        var h = e.call(this, t, "refraction", ["baseColor", "depth", "colorLevel"], ["refractionSampler"], s, a, l, u, c) || this;
                        return h.color = r, h.depth = n, h.colorLevel = o, h._ownRefractionTexture = !0, h.onActivateObservable.add(function(e) {
                            h._refTexture = h._refTexture || new zn.Texture(i, e.getScene())
                        }), h.onApplyObservable.add(function(e) {
                            e.setColor3("baseColor", h.color), e.setFloat("depth", h.depth), e.setFloat("colorLevel", h.colorLevel), e.setTexture("refractionSampler", h._refTexture)
                        }), h
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "refractionTexture", {
                        get: function() {
                            return this._refTexture
                        },
                        set: function(e) {
                            this._refTexture && this._ownRefractionTexture && this._refTexture.dispose(), this._refTexture = e, this._ownRefractionTexture = !1
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.dispose = function(t) {
                        this._refTexture && this._ownRefractionTexture && (this._refTexture.dispose(), this._refTexture = null), e.prototype.dispose.call(this, t)
                    }, t
                }(zn.PostProcess), zn.RefractionPostProcess = jn, Hn = $a || ($a = {}), Wn = function(e) {
                    function t(t, i, r, n, o, s) {
                        var a = e.call(this, t, "blackAndWhite", ["degree"], null, i, r, n, o, s) || this;
                        return a.degree = 1, a.onApplyObservable.add(function(e) {
                            e.setFloat("degree", a.degree)
                        }), a
                    }
                    return b(t, e), t
                }(Hn.PostProcess), Hn.BlackAndWhitePostProcess = Wn, Xn = $a || ($a = {}), Yn = function(e) {
                    function t(t, i, r, n, o, s, a, l) {
                        void 0 === l && (l = Xn.Engine.TEXTURETYPE_UNSIGNED_INT);
                        var u = e.call(this, t, "convolution", ["kernel", "screenSize"], null, r, n, o, s, a, null, l) || this;
                        return u.kernel = i, u.onApply = function(e) {
                            e.setFloat2("screenSize", u.width, u.height), e.setArray("kernel", u.kernel)
                        }, u
                    }
                    return b(t, e), t.EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1], t.EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0], t.EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1], t.SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0], t.EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2], t.GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0], t
                }(Xn.PostProcess), Xn.ConvolutionPostProcess = Yn, qn = $a || ($a = {}), Kn = function(e) {
                    function t(t, i, r, n, o, s, a) {
                        var l = e.call(this, t, "filter", ["kernelMatrix"], null, r, n, o, s, a) || this;
                        return l.kernelMatrix = i, l.onApply = function(e) {
                            e.setMatrix("kernelMatrix", l.kernelMatrix)
                        }, l
                    }
                    return b(t, e), t
                }(qn.PostProcess), qn.FilterPostProcess = Kn, Qn = $a || ($a = {}), Zn = function(e) {
                    function t(i, r, n, o, s, a, l, u, c) {
                        void 0 === s && (s = 100), void 0 === a && (a = Qn.Texture.BILINEAR_SAMPLINGMODE);
                        var h = e.call(this, i, "volumetricLightScattering", ["decay", "exposure", "weight", "meshPositionOnScreen", "density"], ["lightScatteringSampler"], r.postProcessRatio || r, n, a, l, u, "#define NUM_SAMPLES " + s) || this;
                        return h._screenCoordinates = Qn.Vector2.Zero(), h.customMeshPosition = Qn.Vector3.Zero(), h.useCustomMeshPosition = !1, h.invert = !0, h.excludedMeshes = new Array, h.exposure = .3, h.decay = .96815, h.weight = .58767, h.density = .926, l = (c = null === n ? c : n.getScene()).getEngine(), h._viewPort = new Qn.Viewport(0, 0, 1, 1).toGlobal(l.getRenderWidth(), l.getRenderHeight()), h.mesh = null !== o ? o : t.CreateDefaultMesh("VolumetricLightScatteringMesh", c), h._createPass(c, r.passRatio || r), h.onActivate = function(e) {
                            h.isSupported || h.dispose(e), h.onActivate = null
                        }, h.onApplyObservable.add(function(e) {
                            h._updateMeshScreenCoordinates(c), e.setTexture("lightScatteringSampler", h._volumetricLightScatteringRTT), e.setFloat("exposure", h.exposure), e.setFloat("decay", h.decay), e.setFloat("weight", h.weight), e.setFloat("density", h.density), e.setVector2("meshPositionOnScreen", h._screenCoordinates)
                        }), h
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "useDiffuseColor", {
                        get: function() {
                            return Qn.Tools.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead"), !1
                        },
                        set: function(e) {
                            Qn.Tools.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead")
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getClassName = function() {
                        return "VolumetricLightScatteringPostProcess"
                    }, t.prototype._isReady = function(e, t) {
                        var i = e.getMesh();
                        if (i === this.mesh && i.material) return i.material.isReady(i);
                        var r = [],
                            n = [Qn.VertexBuffer.PositionKind],
                            o = e.getMaterial();
                        o && (o.needAlphaTesting() && r.push("#define ALPHATEST"), i.isVerticesDataPresent(Qn.VertexBuffer.UVKind) && (n.push(Qn.VertexBuffer.UVKind), r.push("#define UV1")), i.isVerticesDataPresent(Qn.VertexBuffer.UV2Kind) && (n.push(Qn.VertexBuffer.UV2Kind), r.push("#define UV2"))), i.useBones && i.computeBonesUsingShaders ? (n.push(Qn.VertexBuffer.MatricesIndicesKind), n.push(Qn.VertexBuffer.MatricesWeightsKind), r.push("#define NUM_BONE_INFLUENCERS " + i.numBoneInfluencers), r.push("#define BonesPerMesh " + (i.skeleton ? i.skeleton.bones.length + 1 : 0))) : r.push("#define NUM_BONE_INFLUENCERS 0"), t && (r.push("#define INSTANCES"), n.push("world0"), n.push("world1"), n.push("world2"), n.push("world3"));
                        var s = r.join("\n");
                        return this._cachedDefines !== s && (this._cachedDefines = s, this._volumetricLightScatteringPass = i.getScene().getEngine().createEffect({
                            vertexElement: "depth",
                            fragmentElement: "volumetricLightScatteringPass"
                        }, n, ["world", "mBones", "viewProjection", "diffuseMatrix"], ["diffuseSampler"], s)), this._volumetricLightScatteringPass.isReady()
                    }, t.prototype.setCustomMeshPosition = function(e) {
                        this.customMeshPosition = e
                    }, t.prototype.getCustomMeshPosition = function() {
                        return this.customMeshPosition
                    }, t.prototype.dispose = function(t) {
                        var i = t.getScene().customRenderTargets.indexOf(this._volumetricLightScatteringRTT); - 1 !== i && t.getScene().customRenderTargets.splice(i, 1), this._volumetricLightScatteringRTT.dispose(), e.prototype.dispose.call(this, t)
                    }, t.prototype.getPass = function() {
                        return this._volumetricLightScatteringRTT
                    }, t.prototype._meshExcluded = function(e) {
                        return 0 < this.excludedMeshes.length && -1 !== this.excludedMeshes.indexOf(e)
                    }, t.prototype._createPass = function(e, t) {
                        var i = this,
                            r = e.getEngine();
                        this._volumetricLightScatteringRTT = new Qn.RenderTargetTexture("volumetricLightScatteringMap", {
                            width: r.getRenderWidth() * t,
                            height: r.getRenderHeight() * t
                        }, e, !1, !0, Qn.Engine.TEXTURETYPE_UNSIGNED_INT), this._volumetricLightScatteringRTT.wrapU = Qn.Texture.CLAMP_ADDRESSMODE, this._volumetricLightScatteringRTT.wrapV = Qn.Texture.CLAMP_ADDRESSMODE, this._volumetricLightScatteringRTT.renderList = null, this._volumetricLightScatteringRTT.renderParticles = !1, this._volumetricLightScatteringRTT.ignoreCameraViewport = !0;
                        var n = this.getCamera();
                        n ? n.customRenderTargets.push(this._volumetricLightScatteringRTT) : e.customRenderTargets.push(this._volumetricLightScatteringRTT);
                        var o, s = function(e) {
                                var t = e.getRenderingMesh();
                                if (!i._meshExcluded(t)) {
                                    var r = e.getMaterial();
                                    if (r) {
                                        var n = t.getScene(),
                                            o = n.getEngine();
                                        o.setState(r.backFaceCulling);
                                        var s = t._getInstancesRenderList(e._id);
                                        if (!s.mustReturn) {
                                            var a = o.getCaps().instancedArrays && null !== s.visibleInstances[e._id];
                                            if (i._isReady(e, a)) {
                                                var l = i._volumetricLightScatteringPass;
                                                if (t === i.mesh && (l = e.effect ? e.effect : r.getEffect()), o.enableEffect(l), t._bind(e, l, Qn.Material.TriangleFillMode), t === i.mesh) r.bind(t.getWorldMatrix(), t);
                                                else {
                                                    if (i._volumetricLightScatteringPass.setMatrix("viewProjection", n.getTransformMatrix()), r && r.needAlphaTesting()) {
                                                        var u = r.getAlphaTestTexture();
                                                        i._volumetricLightScatteringPass.setTexture("diffuseSampler", u), u && i._volumetricLightScatteringPass.setMatrix("diffuseMatrix", u.getTextureMatrix())
                                                    }
                                                    t.useBones && t.computeBonesUsingShaders && t.skeleton && i._volumetricLightScatteringPass.setMatrices("mBones", t.skeleton.getTransformMatrices(t))
                                                }
                                                t._processRendering(e, i._volumetricLightScatteringPass, Qn.Material.TriangleFillMode, s, a, function(e, t) {
                                                    return l.setMatrix("world", t)
                                                })
                                            }
                                        }
                                    }
                                }
                            },
                            a = new Qn.Color4(0, 0, 0, 1);
                        this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(function() {
                            o = e.clearColor, e.clearColor = a
                        }), this._volumetricLightScatteringRTT.onAfterRenderObservable.add(function() {
                            e.clearColor = o
                        }), this._volumetricLightScatteringRTT.customRenderFunction = function(t, i, r, n) {
                            var o, a = e.getEngine();
                            if (n.length) {
                                for (a.setColorWrite(!1), o = 0; o < n.length; o++) s(n.data[o]);
                                a.setColorWrite(!0)
                            }
                            for (o = 0; o < t.length; o++) s(t.data[o]);
                            for (o = 0; o < i.length; o++) s(i.data[o]);
                            if (r.length) {
                                for (o = 0; o < r.length; o++) {
                                    var l = r.data[o],
                                        u = l.getBoundingInfo();
                                    u && e.activeCamera && (l._alphaIndex = l.getMesh().alphaIndex, l._distanceToCamera = u.boundingSphere.centerWorld.subtract(e.activeCamera.position).length())
                                }
                                var c = r.data.slice(0, r.length);
                                for (c.sort(function(e, t) {
                                        return e._alphaIndex > t._alphaIndex ? 1 : e._alphaIndex < t._alphaIndex ? -1 : e._distanceToCamera < t._distanceToCamera ? 1 : e._distanceToCamera > t._distanceToCamera ? -1 : 0
                                    }), a.setAlphaMode(Qn.Engine.ALPHA_COMBINE), o = 0; o < c.length; o++) s(c[o]);
                                a.setAlphaMode(Qn.Engine.ALPHA_DISABLE)
                            }
                        }
                    }, t.prototype._updateMeshScreenCoordinates = function(e) {
                        var t, i = e.getTransformMatrix();
                        t = this.useCustomMeshPosition ? this.customMeshPosition : this.attachedNode ? this.attachedNode.position : this.mesh.parent ? this.mesh.getAbsolutePosition() : this.mesh.position;
                        var r = Qn.Vector3.Project(t, Qn.Matrix.Identity(), i, this._viewPort);
                        this._screenCoordinates.x = r.x / this._viewPort.width, this._screenCoordinates.y = r.y / this._viewPort.height, this.invert && (this._screenCoordinates.y = 1 - this._screenCoordinates.y)
                    }, t.CreateDefaultMesh = function(e, t) {
                        var i = Qn.Mesh.CreatePlane(e, 1, t);
                        i.billboardMode = Qn.AbstractMesh.BILLBOARDMODE_ALL;
                        var r = new Qn.StandardMaterial(e + "Material", t);
                        return r.emissiveColor = new Qn.Color3(1, 1, 1), i.material = r, i
                    }, y([Qn.serializeAsVector3()], t.prototype, "customMeshPosition", void 0), y([Qn.serialize()], t.prototype, "useCustomMeshPosition", void 0), y([Qn.serialize()], t.prototype, "invert", void 0), y([Qn.serializeAsMeshReference()], t.prototype, "mesh", void 0), y([Qn.serialize()], t.prototype, "excludedMeshes", void 0), y([Qn.serialize()], t.prototype, "exposure", void 0), y([Qn.serialize()], t.prototype, "decay", void 0), y([Qn.serialize()], t.prototype, "weight", void 0), y([Qn.serialize()], t.prototype, "density", void 0), t
                }(Qn.PostProcess), Qn.VolumetricLightScatteringPostProcess = Zn, Jn = $a || ($a = {}), $n = function(e) {
                    function t(t, i, r, n, o, s, a) {
                        var l = e.call(this, t, "colorCorrection", null, ["colorTable"], r, n, o, s, a) || this;
                        return l._colorTableTexture = new Jn.Texture(i, n.getScene(), !0, !1, Jn.Texture.TRILINEAR_SAMPLINGMODE), l._colorTableTexture.anisotropicFilteringLevel = 1, l._colorTableTexture.wrapU = Jn.Texture.CLAMP_ADDRESSMODE, l._colorTableTexture.wrapV = Jn.Texture.CLAMP_ADDRESSMODE, l.onApply = function(e) {
                            e.setTexture("colorTable", l._colorTableTexture)
                        }, l
                    }
                    return b(t, e), t
                }(Jn.PostProcess), Jn.ColorCorrectionPostProcess = $n,
                function(e) {
                    var t, i;
                    (i = t = e.TonemappingOperator || (e.TonemappingOperator = {}))[i.Hable = 0] = "Hable", i[i.Reinhard = 1] = "Reinhard", i[i.HejiDawson = 2] = "HejiDawson", i[i.Photographic = 3] = "Photographic";
                    var r = function(i) {
                        function r(r, n, o, s, a, l, u) {
                            void 0 === a && (a = e.Texture.BILINEAR_SAMPLINGMODE), void 0 === u && (u = e.Engine.TEXTURETYPE_UNSIGNED_INT);
                            var c = i.call(this, r, "tonemap", ["_ExposureAdjustment"], null, 1, s, a, l, !0, null, u) || this;
                            c._operator = n, c.exposureAdjustment = o;
                            var h = "#define ";
                            return c._operator === t.Hable ? h += "HABLE_TONEMAPPING" : c._operator === t.Reinhard ? h += "REINHARD_TONEMAPPING" : c._operator === t.HejiDawson ? h += "OPTIMIZED_HEJIDAWSON_TONEMAPPING" : c._operator === t.Photographic && (h += "PHOTOGRAPHIC_TONEMAPPING"), c.updateEffect(h), c.onApply = function(e) {
                                e.setFloat("_ExposureAdjustment", c.exposureAdjustment)
                            }, c
                        }
                        return b(r, i), r
                    }(e.PostProcess);
                    e.TonemapPostProcess = r
                }($a || ($a = {})), eo = $a || ($a = {}), to = function(e) {
                    function t(t, i, r, n, o, s) {
                        return e.call(this, t, "displayPass", ["passSampler"], ["passSampler"], i, r, n, o, s) || this
                    }
                    return b(t, e), t
                }(eo.PostProcess), eo.DisplayPassPostProcess = to, io = $a || ($a = {}), ro = function(e) {
                    function t(t, i, r, n, o, s, a) {
                        return void 0 === a && (a = io.Engine.TEXTURETYPE_UNSIGNED_INT), e.call(this, t, "highlights", null, null, i, r, n, o, s, null, a) || this
                    }
                    return b(t, e), t
                }(io.PostProcess), io.HighlightsPostProcess = ro, no = $a || ($a = {}), oo = function(e) {
                    function t(t, i, r, n, o, s, a, l) {
                        void 0 === r && (r = null), void 0 === a && (a = no.Engine.TEXTURETYPE_UNSIGNED_INT);
                        var u = e.call(this, t, "imageProcessing", [], [], i, r, n, o, s, null, a, "postprocess", null, !0) || this;
                        return u._fromLinearSpace = !0, u._defines = {
                            IMAGEPROCESSING: !1,
                            VIGNETTE: !1,
                            VIGNETTEBLENDMODEMULTIPLY: !1,
                            VIGNETTEBLENDMODEOPAQUE: !1,
                            TONEMAPPING: !1,
                            TONEMAPPING_ACES: !1,
                            CONTRAST: !1,
                            COLORCURVES: !1,
                            COLORGRADING: !1,
                            COLORGRADING3D: !1,
                            FROMLINEARSPACE: !1,
                            SAMPLER3DGREENDEPTH: !1,
                            SAMPLER3DBGRMAP: !1,
                            IMAGEPROCESSINGPOSTPROCESS: !1,
                            EXPOSURE: !1
                        }, l ? (l.applyByPostProcess = !0, u._attachImageProcessingConfiguration(l, !0), u.fromLinearSpace = !1) : (u._attachImageProcessingConfiguration(null, !0), u.imageProcessingConfiguration.applyByPostProcess = !0), u.onApply = function(e) {
                            u.imageProcessingConfiguration.bind(e, u.aspectRatio)
                        }, u
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "imageProcessingConfiguration", {
                        get: function() {
                            return this._imageProcessingConfiguration
                        },
                        set: function(e) {
                            this._attachImageProcessingConfiguration(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._attachImageProcessingConfiguration = function(e, t) {
                        var i = this;
                        if (void 0 === t && (t = !1), e !== this._imageProcessingConfiguration) {
                            if (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), e) this._imageProcessingConfiguration = e;
                            else {
                                var r = null,
                                    n = this.getEngine(),
                                    o = this.getCamera();
                                if (o) r = o.getScene();
                                else if (n && n.scenes) {
                                    var s = n.scenes;
                                    r = s[s.length - 1]
                                } else r = no.Engine.LastCreatedScene;
                                this._imageProcessingConfiguration = r.imageProcessingConfiguration
                            }
                            this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function(e) {
                                i._updateParameters()
                            })), t || this._updateParameters()
                        }
                    }, Object.defineProperty(t.prototype, "colorCurves", {
                        get: function() {
                            return this.imageProcessingConfiguration.colorCurves
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.colorCurves = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "colorCurvesEnabled", {
                        get: function() {
                            return this.imageProcessingConfiguration.colorCurvesEnabled
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.colorCurvesEnabled = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "colorGradingTexture", {
                        get: function() {
                            return this.imageProcessingConfiguration.colorGradingTexture
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.colorGradingTexture = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "colorGradingEnabled", {
                        get: function() {
                            return this.imageProcessingConfiguration.colorGradingEnabled
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.colorGradingEnabled = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "exposure", {
                        get: function() {
                            return this.imageProcessingConfiguration.exposure
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.exposure = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "toneMappingEnabled", {
                        get: function() {
                            return this._imageProcessingConfiguration.toneMappingEnabled
                        },
                        set: function(e) {
                            this._imageProcessingConfiguration.toneMappingEnabled = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "contrast", {
                        get: function() {
                            return this.imageProcessingConfiguration.contrast
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.contrast = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "vignetteStretch", {
                        get: function() {
                            return this.imageProcessingConfiguration.vignetteStretch
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.vignetteStretch = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "vignetteCentreX", {
                        get: function() {
                            return this.imageProcessingConfiguration.vignetteCentreX
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.vignetteCentreX = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "vignetteCentreY", {
                        get: function() {
                            return this.imageProcessingConfiguration.vignetteCentreY
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.vignetteCentreY = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "vignetteWeight", {
                        get: function() {
                            return this.imageProcessingConfiguration.vignetteWeight
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.vignetteWeight = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "vignetteColor", {
                        get: function() {
                            return this.imageProcessingConfiguration.vignetteColor
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.vignetteColor = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "vignetteCameraFov", {
                        get: function() {
                            return this.imageProcessingConfiguration.vignetteCameraFov
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.vignetteCameraFov = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "vignetteBlendMode", {
                        get: function() {
                            return this.imageProcessingConfiguration.vignetteBlendMode
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.vignetteBlendMode = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "vignetteEnabled", {
                        get: function() {
                            return this.imageProcessingConfiguration.vignetteEnabled
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.vignetteEnabled = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "fromLinearSpace", {
                        get: function() {
                            return this._fromLinearSpace
                        },
                        set: function(e) {
                            this._fromLinearSpace !== e && (this._fromLinearSpace = e, this._updateParameters())
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getClassName = function() {
                        return "ImageProcessingPostProcess"
                    }, t.prototype._updateParameters = function() {
                        this._defines.FROMLINEARSPACE = this._fromLinearSpace, this.imageProcessingConfiguration.prepareDefines(this._defines, !0);
                        var e = "";
                        for (var t in this._defines) this._defines[t] && (e += "#define " + t + ";\r\n");
                        var i = ["textureSampler"],
                            r = ["scale"];
                        no.ImageProcessingConfiguration && (no.ImageProcessingConfiguration.PrepareSamplers(i, this._defines), no.ImageProcessingConfiguration.PrepareUniforms(r, this._defines)), this.updateEffect(e, r, i)
                    }, t.prototype.dispose = function(t) {
                        e.prototype.dispose.call(this, t), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration && (this.imageProcessingConfiguration.applyByPostProcess = !1)
                    }, y([no.serialize()], t.prototype, "_fromLinearSpace", void 0), t
                }(no.PostProcess), no.ImageProcessingPostProcess = oo, so = $a || ($a = {}), ao = function(e) {
                    function t(t, i, r, n, o, s, a) {
                        void 0 === r && (r = null), void 0 === n && (n = null), void 0 === o && (o = null), void 0 === s && (s = null), void 0 === a && (a = null);
                        var l = e.call(this, t, i.getScene()) || this;
                        return l.name = t, l.children = new Array, l.animations = new Array, l._index = null, l._absoluteTransform = new so.Matrix, l._invertedAbsoluteTransform = new so.Matrix, l._scalingDeterminant = 1, l._worldTransform = new so.Matrix, l._needToDecompose = !0, l._needToCompose = !1, l._skeleton = i, l._localMatrix = n ? n.clone() : so.Matrix.Identity(), l._restPose = o || l._localMatrix.clone(), l._baseMatrix = s || l._localMatrix.clone(), l._index = a, i.bones.push(l), l.setParent(r, !1), (s || n) && l._updateDifferenceMatrix(), l
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "_matrix", {
                        get: function() {
                            return this._compose(), this._localMatrix
                        },
                        set: function(e) {
                            this._localMatrix.copyFrom(e), this._needToDecompose = !0
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.getSkeleton = function() {
                        return this._skeleton
                    }, t.prototype.getParent = function() {
                        return this._parent
                    }, t.prototype.setParent = function(e, t) {
                        if (void 0 === t && (t = !0), this._parent !== e) {
                            if (this._parent) {
                                var i = this._parent.children.indexOf(this); - 1 !== i && this._parent.children.splice(i, 1)
                            }
                            this._parent = e, this._parent && this._parent.children.push(this), t && this._updateDifferenceMatrix(), this.markAsDirty()
                        }
                    }, t.prototype.getLocalMatrix = function() {
                        return this._compose(), this._localMatrix
                    }, t.prototype.getBaseMatrix = function() {
                        return this._baseMatrix
                    }, t.prototype.getRestPose = function() {
                        return this._restPose
                    }, t.prototype.getWorldMatrix = function() {
                        return this._worldTransform
                    }, t.prototype.returnToRest = function() {
                        this.updateMatrix(this._restPose.clone())
                    }, t.prototype.getInvertedAbsoluteTransform = function() {
                        return this._invertedAbsoluteTransform
                    }, t.prototype.getAbsoluteTransform = function() {
                        return this._absoluteTransform
                    }, Object.defineProperty(t.prototype, "position", {
                        get: function() {
                            return this._decompose(), this._localPosition
                        },
                        set: function(e) {
                            this._decompose(), this._localPosition.copyFrom(e), this._markAsDirtyAndCompose()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "rotation", {
                        get: function() {
                            return this.getRotation()
                        },
                        set: function(e) {
                            this.setRotation(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "rotationQuaternion", {
                        get: function() {
                            return this._decompose(), this._localRotation
                        },
                        set: function(e) {
                            this.setRotationQuaternion(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "scaling", {
                        get: function() {
                            return this.getScale()
                        },
                        set: function(e) {
                            this.setScale(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "animationPropertiesOverride", {
                        get: function() {
                            return this._skeleton.animationPropertiesOverride
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._decompose = function() {
                        this._needToDecompose && (this._needToDecompose = !1, this._localScaling || (this._localScaling = so.Vector3.Zero(), this._localRotation = so.Quaternion.Zero(), this._localPosition = so.Vector3.Zero()), this._localMatrix.decompose(this._localScaling, this._localRotation, this._localPosition))
                    }, t.prototype._compose = function() {
                        this._needToCompose && (this._needToCompose = !1, so.Matrix.ComposeToRef(this._localScaling, this._localRotation, this._localPosition, this._localMatrix))
                    }, t.prototype.updateMatrix = function(e, t, i) {
                        void 0 === t && (t = !0), void 0 === i && (i = !0), this._baseMatrix.copyFrom(e), t && this._updateDifferenceMatrix(), i ? (this._localMatrix.copyFrom(e), this._markAsDirtyAndDecompose()) : this.markAsDirty()
                    }, t.prototype._updateDifferenceMatrix = function(e, t) {
                        if (void 0 === t && (t = !0), e || (e = this._baseMatrix), this._parent ? e.multiplyToRef(this._parent._absoluteTransform, this._absoluteTransform) : this._absoluteTransform.copyFrom(e), this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform), t)
                            for (var i = 0; i < this.children.length; i++) this.children[i]._updateDifferenceMatrix();
                        this._scalingDeterminant = this._absoluteTransform.determinant() < 0 ? -1 : 1
                    }, t.prototype.markAsDirty = function() {
                        this._currentRenderId++, this._childRenderId++, this._skeleton._markAsDirty()
                    }, t.prototype._markAsDirtyAndCompose = function() {
                        this.markAsDirty(), this._needToCompose = !0
                    }, t.prototype._markAsDirtyAndDecompose = function() {
                        this.markAsDirty(), this._needToDecompose = !0
                    }, t.prototype.copyAnimationRange = function(e, t, i, r, n) {
                        void 0 === r && (r = !1), void 0 === n && (n = null), 0 === this.animations.length && (this.animations.push(new so.Animation(this.name, "_matrix", e.animations[0].framePerSecond, so.Animation.ANIMATIONTYPE_MATRIX, 0)), this.animations[0].setKeys([]));
                        var o = e.animations[0].getRange(t);
                        if (!o) return !1;
                        for (var s, a, l, u = o.from, c = o.to, h = e.animations[0].getKeys(), d = e.length, p = e.getParent(), f = this.getParent(), _ = r && p && d && this.length && d !== this.length, m = _ && f && p ? f.length / p.length : 1, g = r && !f && n && (1 !== n.x || 1 !== n.y || 1 !== n.z), v = this.animations[0].getKeys(), y = 0, b = h.length; y < b; y++)(s = h[y]).frame >= u && s.frame <= c && (r ? (l = s.value.clone(), _ ? (a = l.getTranslation(), l.setTranslation(a.scaleInPlace(m))) : g && n ? (a = l.getTranslation(), l.setTranslation(a.multiplyInPlace(n))) : l = s.value) : l = s.value, v.push({
                            frame: s.frame + i,
                            value: l
                        }));
                        return this.animations[0].createRange(t, u + i, c + i), !0
                    }, t.prototype.translate = function(e, i, r) {
                        void 0 === i && (i = so.Space.LOCAL);
                        var n = this.getLocalMatrix();
                        if (i == so.Space.LOCAL) n.m[12] += e.x, n.m[13] += e.y, n.m[14] += e.z;
                        else {
                            var o = null;
                            r && (o = r.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();
                            var s = t._tmpMats[0],
                                a = t._tmpVecs[0];
                            this._parent && (r && o ? (s.copyFrom(this._parent.getAbsoluteTransform()), s.multiplyToRef(o, s)) : s.copyFrom(this._parent.getAbsoluteTransform())), s.m[12] = 0, s.m[13] = 0, s.m[14] = 0, s.invert(), so.Vector3.TransformCoordinatesToRef(e, s, a), n.m[12] += a.x, n.m[13] += a.y, n.m[14] += a.z
                        }
                        this._markAsDirtyAndDecompose()
                    }, t.prototype.setPosition = function(e, i, r) {
                        void 0 === i && (i = so.Space.LOCAL);
                        var n = this.getLocalMatrix();
                        if (i == so.Space.LOCAL) n.m[12] = e.x, n.m[13] = e.y, n.m[14] = e.z;
                        else {
                            var o = null;
                            r && (o = r.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();
                            var s = t._tmpMats[0],
                                a = t._tmpVecs[0];
                            this._parent && (r && o ? (s.copyFrom(this._parent.getAbsoluteTransform()), s.multiplyToRef(o, s)) : s.copyFrom(this._parent.getAbsoluteTransform())), s.invert(), so.Vector3.TransformCoordinatesToRef(e, s, a), n.m[12] = a.x, n.m[13] = a.y, n.m[14] = a.z
                        }
                        this._markAsDirtyAndDecompose()
                    }, t.prototype.setAbsolutePosition = function(e, t) {
                        this.setPosition(e, so.Space.WORLD, t)
                    }, t.prototype.scale = function(e, i, r, n) {
                        void 0 === n && (n = !1);
                        var o = this.getLocalMatrix(),
                            s = t._tmpMats[0];
                        so.Matrix.ScalingToRef(e, i, r, s), s.multiplyToRef(o, o), s.invert();
                        for (var a = 0, l = this.children; a < l.length; a++) {
                            var u = (d = l[a]).getLocalMatrix();
                            u.multiplyToRef(s, u), u.m[12] *= e, u.m[13] *= i, u.m[14] *= r, d._markAsDirtyAndDecompose()
                        }
                        if (this._markAsDirtyAndDecompose(), n)
                            for (var c = 0, h = this.children; c < h.length; c++) {
                                var d;
                                (d = h[c]).scale(e, i, r, n)
                            }
                    }, t.prototype.setScale = function(e) {
                        this._decompose(), this._localScaling.copyFrom(e), this._markAsDirtyAndCompose()
                    }, t.prototype.getScale = function() {
                        return this._decompose(), this._localScaling
                    }, t.prototype.getScaleToRef = function(e) {
                        this._decompose(), e.copyFrom(this._localScaling)
                    }, t.prototype.setYawPitchRoll = function(e, i, r, n, o) {
                        if (void 0 === n && (n = so.Space.LOCAL), n === so.Space.LOCAL) {
                            var s = t._tmpQuat;
                            return so.Quaternion.RotationYawPitchRollToRef(e, i, r, s), void this.setRotationQuaternion(s, n, o)
                        }
                        var a = t._tmpMats[0];
                        if (this._getNegativeRotationToRef(a, o)) {
                            var l = t._tmpMats[1];
                            so.Matrix.RotationYawPitchRollToRef(e, i, r, l), a.multiplyToRef(l, l), this._rotateWithMatrix(l, n, o)
                        }
                    }, t.prototype.rotate = function(e, i, r, n) {
                        void 0 === r && (r = so.Space.LOCAL);
                        var o = t._tmpMats[0];
                        o.m[12] = 0, o.m[13] = 0, o.m[14] = 0, so.Matrix.RotationAxisToRef(e, i, o), this._rotateWithMatrix(o, r, n)
                    }, t.prototype.setAxisAngle = function(e, i, r, n) {
                        if (void 0 === r && (r = so.Space.LOCAL), r === so.Space.LOCAL) {
                            var o = t._tmpQuat;
                            return so.Quaternion.RotationAxisToRef(e, i, o), void this.setRotationQuaternion(o, r, n)
                        }
                        var s = t._tmpMats[0];
                        if (this._getNegativeRotationToRef(s, n)) {
                            var a = t._tmpMats[1];
                            so.Matrix.RotationAxisToRef(e, i, a), s.multiplyToRef(a, a), this._rotateWithMatrix(a, r, n)
                        }
                    }, t.prototype.setRotation = function(e, t, i) {
                        void 0 === t && (t = so.Space.LOCAL), this.setYawPitchRoll(e.y, e.x, e.z, t, i)
                    }, t.prototype.setRotationQuaternion = function(e, i, r) {
                        if (void 0 === i && (i = so.Space.LOCAL), i === so.Space.LOCAL) return this._decompose(), this._localRotation.copyFrom(e), void this._markAsDirtyAndCompose();
                        var n = t._tmpMats[0];
                        if (this._getNegativeRotationToRef(n, r)) {
                            var o = t._tmpMats[1];
                            so.Matrix.FromQuaternionToRef(e, o), n.multiplyToRef(o, o), this._rotateWithMatrix(o, i, r)
                        }
                    }, t.prototype.setRotationMatrix = function(e, i, r) {
                        if (void 0 === i && (i = so.Space.LOCAL), i === so.Space.LOCAL) {
                            var n = t._tmpQuat;
                            return so.Quaternion.FromRotationMatrixToRef(e, n), void this.setRotationQuaternion(n, i, r)
                        }
                        var o = t._tmpMats[0];
                        if (this._getNegativeRotationToRef(o, r)) {
                            var s = t._tmpMats[1];
                            s.copyFrom(e), o.multiplyToRef(e, s), this._rotateWithMatrix(s, i, r)
                        }
                    }, t.prototype._rotateWithMatrix = function(e, i, r) {
                        void 0 === i && (i = so.Space.LOCAL);
                        var n = this.getLocalMatrix(),
                            o = n.m[12],
                            s = n.m[13],
                            a = n.m[14],
                            l = this.getParent(),
                            u = t._tmpMats[3],
                            c = t._tmpMats[4];
                        l && i == so.Space.WORLD ? (r ? (u.copyFrom(r.getWorldMatrix()), l.getAbsoluteTransform().multiplyToRef(u, u)) : u.copyFrom(l.getAbsoluteTransform()), c.copyFrom(u), c.invert(), n.multiplyToRef(u, n), n.multiplyToRef(e, n), n.multiplyToRef(c, n)) : i == so.Space.WORLD && r ? (u.copyFrom(r.getWorldMatrix()), c.copyFrom(u), c.invert(), n.multiplyToRef(u, n), n.multiplyToRef(e, n), n.multiplyToRef(c, n)) : n.multiplyToRef(e, n), n.m[12] = o, n.m[13] = s, n.m[14] = a, this.computeAbsoluteTransforms(), this._markAsDirtyAndDecompose()
                    }, t.prototype._getNegativeRotationToRef = function(e, i) {
                        var r = t._tmpMats[2];
                        return e.copyFrom(this.getAbsoluteTransform()), i && (e.multiplyToRef(i.getWorldMatrix(), e), so.Matrix.ScalingToRef(i.scaling.x, i.scaling.y, i.scaling.z, r)), e.invert(), !isNaN(e.m[0]) && (r.m[0] *= this._scalingDeterminant, e.multiplyToRef(r, e), !0)
                    }, t.prototype.getPosition = function(e, t) {
                        void 0 === e && (e = so.Space.LOCAL), void 0 === t && (t = null);
                        var i = so.Vector3.Zero();
                        return this.getPositionToRef(e, t, i), i
                    }, t.prototype.getPositionToRef = function(e, i, r) {
                        if (void 0 === e && (e = so.Space.LOCAL), e == so.Space.LOCAL) {
                            var n = this.getLocalMatrix();
                            r.x = n.m[12], r.y = n.m[13], r.z = n.m[14]
                        } else {
                            var o = null;
                            i && (o = i.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();
                            var s = t._tmpMats[0];
                            i && o ? (s.copyFrom(this.getAbsoluteTransform()), s.multiplyToRef(o, s)) : s = this.getAbsoluteTransform(), r.x = s.m[12], r.y = s.m[13], r.z = s.m[14]
                        }
                    }, t.prototype.getAbsolutePosition = function(e) {
                        void 0 === e && (e = null);
                        var t = so.Vector3.Zero();
                        return this.getPositionToRef(so.Space.WORLD, e, t), t
                    }, t.prototype.getAbsolutePositionToRef = function(e, t) {
                        this.getPositionToRef(so.Space.WORLD, e, t)
                    }, t.prototype.computeAbsoluteTransforms = function() {
                        if (this._compose(), this._parent) this._localMatrix.multiplyToRef(this._parent._absoluteTransform, this._absoluteTransform);
                        else {
                            this._absoluteTransform.copyFrom(this._localMatrix);
                            var e = this._skeleton.getPoseMatrix();
                            e && this._absoluteTransform.multiplyToRef(e, this._absoluteTransform)
                        }
                        for (var t = this.children, i = t.length, r = 0; r < i; r++) t[r].computeAbsoluteTransforms()
                    }, t.prototype.getDirection = function(e, t) {
                        void 0 === t && (t = null);
                        var i = so.Vector3.Zero();
                        return this.getDirectionToRef(e, t, i), i
                    }, t.prototype.getDirectionToRef = function(e, i, r) {
                        void 0 === i && (i = null);
                        var n = null;
                        i && (n = i.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();
                        var o = t._tmpMats[0];
                        o.copyFrom(this.getAbsoluteTransform()), i && n && o.multiplyToRef(n, o), so.Vector3.TransformNormalToRef(e, o, r), r.normalize()
                    }, t.prototype.getRotation = function(e, t) {
                        void 0 === e && (e = so.Space.LOCAL), void 0 === t && (t = null);
                        var i = so.Vector3.Zero();
                        return this.getRotationToRef(e, t, i), i
                    }, t.prototype.getRotationToRef = function(e, i, r) {
                        void 0 === e && (e = so.Space.LOCAL), void 0 === i && (i = null);
                        var n = t._tmpQuat;
                        this.getRotationQuaternionToRef(e, i, n), n.toEulerAnglesToRef(r)
                    }, t.prototype.getRotationQuaternion = function(e, t) {
                        void 0 === e && (e = so.Space.LOCAL), void 0 === t && (t = null);
                        var i = so.Quaternion.Identity();
                        return this.getRotationQuaternionToRef(e, t, i), i
                    }, t.prototype.getRotationQuaternionToRef = function(e, i, r) {
                        if (void 0 === e && (e = so.Space.LOCAL), void 0 === i && (i = null), e == so.Space.LOCAL) this._decompose(), r.copyFrom(this._localRotation);
                        else {
                            var n = t._tmpMats[0],
                                o = this.getAbsoluteTransform();
                            i ? o.multiplyToRef(i.getWorldMatrix(), n) : n.copyFrom(o), n.m[0] *= this._scalingDeterminant, n.m[1] *= this._scalingDeterminant, n.m[2] *= this._scalingDeterminant, n.decompose(void 0, r, void 0)
                        }
                    }, t.prototype.getRotationMatrix = function(e, t) {
                        void 0 === e && (e = so.Space.LOCAL);
                        var i = so.Matrix.Identity();
                        return this.getRotationMatrixToRef(e, t, i), i
                    }, t.prototype.getRotationMatrixToRef = function(e, i, r) {
                        if (void 0 === e && (e = so.Space.LOCAL), e == so.Space.LOCAL) this.getLocalMatrix().getRotationMatrixToRef(r);
                        else {
                            var n = t._tmpMats[0],
                                o = this.getAbsoluteTransform();
                            i ? o.multiplyToRef(i.getWorldMatrix(), n) : n.copyFrom(o), n.m[0] *= this._scalingDeterminant, n.m[1] *= this._scalingDeterminant, n.m[2] *= this._scalingDeterminant, n.getRotationMatrixToRef(r)
                        }
                    }, t.prototype.getAbsolutePositionFromLocal = function(e, t) {
                        void 0 === t && (t = null);
                        var i = so.Vector3.Zero();
                        return this.getAbsolutePositionFromLocalToRef(e, t, i), i
                    }, t.prototype.getAbsolutePositionFromLocalToRef = function(e, i, r) {
                        void 0 === i && (i = null);
                        var n = null;
                        i && (n = i.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();
                        var o = t._tmpMats[0];
                        i && n ? (o.copyFrom(this.getAbsoluteTransform()), o.multiplyToRef(n, o)) : o = this.getAbsoluteTransform(), so.Vector3.TransformCoordinatesToRef(e, o, r)
                    }, t.prototype.getLocalPositionFromAbsolute = function(e, t) {
                        void 0 === t && (t = null);
                        var i = so.Vector3.Zero();
                        return this.getLocalPositionFromAbsoluteToRef(e, t, i), i
                    }, t.prototype.getLocalPositionFromAbsoluteToRef = function(e, i, r) {
                        void 0 === i && (i = null);
                        var n = null;
                        i && (n = i.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();
                        var o = t._tmpMats[0];
                        o.copyFrom(this.getAbsoluteTransform()), i && n && o.multiplyToRef(n, o), o.invert(), so.Vector3.TransformCoordinatesToRef(e, o, r)
                    }, t._tmpVecs = [so.Vector3.Zero(), so.Vector3.Zero()], t._tmpQuat = so.Quaternion.Identity(), t._tmpMats = [so.Matrix.Identity(), so.Matrix.Identity(), so.Matrix.Identity(), so.Matrix.Identity(), so.Matrix.Identity()], t
                }(so.Node), so.Bone = ao, lo = $a || ($a = {}), uo = function() {
                    function e(e, t, i) {
                        if (this.targetPosition = lo.Vector3.Zero(), this.poleTargetPosition = lo.Vector3.Zero(), this.poleTargetLocalOffset = lo.Vector3.Zero(), this.poleAngle = 0, this.slerpAmount = 1, this._bone1Quat = lo.Quaternion.Identity(), this._bone1Mat = lo.Matrix.Identity(), this._bone2Ang = Math.PI, this._maxAngle = Math.PI, this._rightHandedSystem = !1, this._bendAxis = lo.Vector3.Right(), this._slerping = !1, this._adjustRoll = 0, this._bone2 = t, this._bone1 = t.getParent(), this._bone1) {
                            this.mesh = e;
                            var r = t.getPosition();
                            if (0 < t.getAbsoluteTransform().determinant() && (this._rightHandedSystem = !0, this._bendAxis.x = 0, this._bendAxis.y = 0, this._bendAxis.z = -1, r.x > r.y && r.x > r.z && (this._adjustRoll = .5 * Math.PI, this._bendAxis.z = 1)), this._bone1.length) {
                                var n = this._bone1.getScale(),
                                    o = this._bone2.getScale();
                                this._bone1Length = this._bone1.length * n.y * this.mesh.scaling.y, this._bone2Length = this._bone2.length * o.y * this.mesh.scaling.y
                            } else if (this._bone1.children[0]) {
                                e.computeWorldMatrix(!0);
                                var s = this._bone2.children[0].getAbsolutePosition(e),
                                    a = this._bone2.getAbsolutePosition(e),
                                    l = this._bone1.getAbsolutePosition(e);
                                this._bone1Length = lo.Vector3.Distance(s, a), this._bone2Length = lo.Vector3.Distance(a, l)
                            }
                            this._bone1.getRotationMatrixToRef(lo.Space.WORLD, e, this._bone1Mat), this.maxAngle = Math.PI, i && (i.targetMesh && (this.targetMesh = i.targetMesh, this.targetMesh.computeWorldMatrix(!0)), i.poleTargetMesh ? (this.poleTargetMesh = i.poleTargetMesh, this.poleTargetMesh.computeWorldMatrix(!0)) : i.poleTargetBone ? this.poleTargetBone = i.poleTargetBone : this._bone1.getParent() && (this.poleTargetBone = this._bone1.getParent()), i.poleTargetLocalOffset && this.poleTargetLocalOffset.copyFrom(i.poleTargetLocalOffset), i.poleAngle && (this.poleAngle = i.poleAngle), i.bendAxis && this._bendAxis.copyFrom(i.bendAxis), i.maxAngle && (this.maxAngle = i.maxAngle), i.slerpAmount && (this.slerpAmount = i.slerpAmount))
                        }
                    }
                    return Object.defineProperty(e.prototype, "maxAngle", {
                        get: function() {
                            return this._maxAngle
                        },
                        set: function(e) {
                            this._setMaxAngle(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._setMaxAngle = function(e) {
                        e < 0 && (e = 0), (e > Math.PI || null == e) && (e = Math.PI), this._maxAngle = e;
                        var t = this._bone1Length,
                            i = this._bone2Length;
                        this._maxReach = Math.sqrt(t * t + i * i - 2 * t * i * Math.cos(e))
                    }, e.prototype.update = function() {
                        var t = this._bone1;
                        if (t) {
                            var i = this.targetPosition,
                                r = this.poleTargetPosition,
                                n = e._tmpMats[0],
                                o = e._tmpMats[1];
                            this.targetMesh && i.copyFrom(this.targetMesh.getAbsolutePosition()), this.poleTargetBone ? this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset, this.mesh, r) : this.poleTargetMesh && lo.Vector3.TransformCoordinatesToRef(this.poleTargetLocalOffset, this.poleTargetMesh.getWorldMatrix(), r);
                            var s = e._tmpVecs[0],
                                a = e._tmpVecs[1],
                                l = e._tmpVecs[2],
                                u = e._tmpVecs[3],
                                c = e._tmpVecs[4],
                                h = e._tmpQuat;
                            t.getAbsolutePositionToRef(this.mesh, s), r.subtractToRef(s, c), 0 == c.x && 0 == c.y && 0 == c.z ? c.y = 1 : c.normalize(), i.subtractToRef(s, u), u.normalize(), lo.Vector3.CrossToRef(u, c, a), a.normalize(), lo.Vector3.CrossToRef(u, a, l), l.normalize(), lo.Matrix.FromXYZAxesToRef(l, u, a, n);
                            var d = this._bone1Length,
                                p = this._bone2Length,
                                f = lo.Vector3.Distance(s, i);
                            0 < this._maxReach && (f = Math.min(this._maxReach, f));
                            var _ = (p * p + f * f - d * d) / (2 * p * f),
                                m = (f * f + d * d - p * p) / (2 * f * d);
                            1 < _ && (_ = 1), 1 < m && (m = 1), _ < -1 && (_ = -1), m < -1 && (m = -1);
                            var g = Math.acos(_),
                                v = Math.acos(m),
                                y = -g - v;
                            if (this._rightHandedSystem) lo.Matrix.RotationYawPitchRollToRef(0, 0, this._adjustRoll, o), o.multiplyToRef(n, n), lo.Matrix.RotationAxisToRef(this._bendAxis, v, o), o.multiplyToRef(n, n);
                            else {
                                var b = e._tmpVecs[5];
                                b.copyFrom(this._bendAxis), b.x *= -1, lo.Matrix.RotationAxisToRef(b, -v, o), o.multiplyToRef(n, n)
                            }
                            this.poleAngle && (lo.Matrix.RotationAxisToRef(u, this.poleAngle, o), n.multiplyToRef(o, n)), this._bone1 && (this.slerpAmount < 1 ? (this._slerping || lo.Quaternion.FromRotationMatrixToRef(this._bone1Mat, this._bone1Quat), lo.Quaternion.FromRotationMatrixToRef(n, h), lo.Quaternion.SlerpToRef(this._bone1Quat, h, this.slerpAmount, this._bone1Quat), y = this._bone2Ang * (1 - this.slerpAmount) + y * this.slerpAmount, this._bone1.setRotationQuaternion(this._bone1Quat, lo.Space.WORLD, this.mesh), this._slerping = !0) : (this._bone1.setRotationMatrix(n, lo.Space.WORLD, this.mesh), this._bone1Mat.copyFrom(n), this._slerping = !1)), this._bone2.setAxisAngle(this._bendAxis, y, lo.Space.LOCAL), this._bone2Ang = y
                        }
                    }, e._tmpVecs = [lo.Vector3.Zero(), lo.Vector3.Zero(), lo.Vector3.Zero(), lo.Vector3.Zero(), lo.Vector3.Zero(), lo.Vector3.Zero()], e._tmpQuat = lo.Quaternion.Identity(), e._tmpMats = [lo.Matrix.Identity(), lo.Matrix.Identity()], e
                }(), lo.BoneIKController = uo, co = $a || ($a = {}), ho = function() {
                    function e(e, t, i, r) {
                        if (this.upAxis = co.Vector3.Up(), this.upAxisSpace = co.Space.LOCAL, this.adjustYaw = 0, this.adjustPitch = 0, this.adjustRoll = 0, this.slerpAmount = 1, this._boneQuat = co.Quaternion.Identity(), this._slerping = !1, this._firstFrameSkipped = !1, this._fowardAxis = co.Vector3.Forward(), this.mesh = e, this.bone = t, this.target = i, r && (r.adjustYaw && (this.adjustYaw = r.adjustYaw), r.adjustPitch && (this.adjustPitch = r.adjustPitch), r.adjustRoll && (this.adjustRoll = r.adjustRoll), null != r.maxYaw ? this.maxYaw = r.maxYaw : this.maxYaw = Math.PI, null != r.minYaw ? this.minYaw = r.minYaw : this.minYaw = -Math.PI, null != r.maxPitch ? this.maxPitch = r.maxPitch : this.maxPitch = Math.PI, null != r.minPitch ? this.minPitch = r.minPitch : this.minPitch = -Math.PI, null != r.slerpAmount && (this.slerpAmount = r.slerpAmount), null != r.upAxis && (this.upAxis = r.upAxis), null != r.upAxisSpace && (this.upAxisSpace = r.upAxisSpace), null != r.yawAxis || null != r.pitchAxis)) {
                            var n = co.Axis.Y,
                                o = co.Axis.X;
                            null != r.yawAxis && (n = r.yawAxis.clone()).normalize(), null != r.pitchAxis && (o = r.pitchAxis.clone()).normalize();
                            var s = co.Vector3.Cross(o, n);
                            this._transformYawPitch = co.Matrix.Identity(), co.Matrix.FromXYZAxesToRef(o, n, s, this._transformYawPitch), this._transformYawPitchInv = this._transformYawPitch.clone(), this._transformYawPitch.invert()
                        }
                        t.getParent() || this.upAxisSpace != co.Space.BONE || (this.upAxisSpace = co.Space.LOCAL)
                    }
                    return Object.defineProperty(e.prototype, "minYaw", {
                        get: function() {
                            return this._minYaw
                        },
                        set: function(e) {
                            this._minYaw = e, this._minYawSin = Math.sin(e), this._minYawCos = Math.cos(e), null != this._maxYaw && (this._midYawConstraint = .5 * this._getAngleDiff(this._minYaw, this._maxYaw) + this._minYaw, this._yawRange = this._maxYaw - this._minYaw)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "maxYaw", {
                        get: function() {
                            return this._maxYaw
                        },
                        set: function(e) {
                            this._maxYaw = e, this._maxYawSin = Math.sin(e), this._maxYawCos = Math.cos(e), null != this._minYaw && (this._midYawConstraint = .5 * this._getAngleDiff(this._minYaw, this._maxYaw) + this._minYaw, this._yawRange = this._maxYaw - this._minYaw)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "minPitch", {
                        get: function() {
                            return this._minPitch
                        },
                        set: function(e) {
                            this._minPitch = e, this._minPitchTan = Math.tan(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "maxPitch", {
                        get: function() {
                            return this._maxPitch
                        },
                        set: function(e) {
                            this._maxPitch = e, this._maxPitchTan = Math.tan(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.update = function() {
                        if (this.slerpAmount < 1 && !this._firstFrameSkipped) this._firstFrameSkipped = !0;
                        else {
                            var t = this.bone,
                                i = e._tmpVecs[0];
                            t.getAbsolutePositionToRef(this.mesh, i);
                            var r = this.target,
                                n = e._tmpMats[0],
                                o = e._tmpMats[1],
                                s = this.mesh,
                                a = t.getParent(),
                                l = e._tmpVecs[1];
                            l.copyFrom(this.upAxis), this.upAxisSpace == co.Space.BONE && a ? (this._transformYawPitch && co.Vector3.TransformCoordinatesToRef(l, this._transformYawPitchInv, l), a.getDirectionToRef(l, this.mesh, l)) : this.upAxisSpace == co.Space.LOCAL && (s.getDirectionToRef(l, l), 1 == s.scaling.x && 1 == s.scaling.y && 1 == s.scaling.z || l.normalize());
                            var u = !1,
                                c = !1;
                            if (this._maxYaw == Math.PI && this._minYaw == -Math.PI || (u = !0), this._maxPitch == Math.PI && this._minPitch == -Math.PI || (c = !0), u || c) {
                                var h = e._tmpMats[2],
                                    d = e._tmpMats[3];
                                if (this.upAxisSpace == co.Space.BONE && 1 == l.y && a) a.getRotationMatrixToRef(co.Space.WORLD, this.mesh, h);
                                else if (this.upAxisSpace != co.Space.LOCAL || 1 != l.y || a) {
                                    (f = e._tmpVecs[2]).copyFrom(this._fowardAxis), this._transformYawPitch && co.Vector3.TransformCoordinatesToRef(f, this._transformYawPitchInv, f), a ? a.getDirectionToRef(f, this.mesh, f) : s.getDirectionToRef(f, f);
                                    var p = co.Vector3.Cross(l, f);
                                    p.normalize();
                                    var f = co.Vector3.Cross(p, l);
                                    co.Matrix.FromXYZAxesToRef(p, l, f, h)
                                } else h.copyFrom(s.getWorldMatrix());
                                h.invertToRef(d);
                                var _ = null;
                                if (c) {
                                    var m = e._tmpVecs[3];
                                    r.subtractToRef(i, m), co.Vector3.TransformCoordinatesToRef(m, d, m), _ = Math.sqrt(m.x * m.x + m.z * m.z);
                                    var g = Math.atan2(m.y, _),
                                        v = g;
                                    g > this._maxPitch ? (m.y = this._maxPitchTan * _, v = this._maxPitch) : g < this._minPitch && (m.y = this._minPitchTan * _, v = this._minPitch), g != v && (co.Vector3.TransformCoordinatesToRef(m, h, m), m.addInPlace(i), r = m)
                                }
                                if (u) {
                                    m = e._tmpVecs[4], r.subtractToRef(i, m), co.Vector3.TransformCoordinatesToRef(m, d, m);
                                    var y = Math.atan2(m.x, m.z),
                                        b = y;
                                    if ((y > this._maxYaw || y < this._minYaw) && (null == _ && (_ = Math.sqrt(m.x * m.x + m.z * m.z)), this._yawRange > Math.PI ? this._isAngleBetween(y, this._maxYaw, this._midYawConstraint) ? (m.z = this._maxYawCos * _, m.x = this._maxYawSin * _, b = this._maxYaw) : this._isAngleBetween(y, this._midYawConstraint, this._minYaw) && (m.z = this._minYawCos * _, m.x = this._minYawSin * _, b = this._minYaw) : y > this._maxYaw ? (m.z = this._maxYawCos * _, m.x = this._maxYawSin * _, b = this._maxYaw) : y < this._minYaw && (m.z = this._minYawCos * _, m.x = this._minYawSin * _, b = this._minYaw)), this._slerping && this._yawRange > Math.PI) {
                                        var x = e._tmpVecs[8];
                                        x.copyFrom(co.Axis.Z), this._transformYawPitch && co.Vector3.TransformCoordinatesToRef(x, this._transformYawPitchInv, x);
                                        var T = e._tmpMats[4];
                                        this._boneQuat.toRotationMatrix(T), this.mesh.getWorldMatrix().multiplyToRef(T, T), co.Vector3.TransformCoordinatesToRef(x, T, x), co.Vector3.TransformCoordinatesToRef(x, d, x);
                                        var E = Math.atan2(x.x, x.z),
                                            S = this._getAngleBetween(E, y);
                                        if (this._getAngleBetween(E, this._midYawConstraint) < S) {
                                            null == _ && (_ = Math.sqrt(m.x * m.x + m.z * m.z));
                                            var P = this._getAngleBetween(E, this._maxYaw);
                                            b = this._getAngleBetween(E, this._minYaw) < P ? E + .75 * Math.PI : E - .75 * Math.PI, m.z = Math.cos(b) * _, m.x = Math.sin(b) * _
                                        }
                                    }
                                    y != b && (co.Vector3.TransformCoordinatesToRef(m, h, m), m.addInPlace(i), r = m)
                                }
                            }
                            var A = e._tmpVecs[5],
                                C = e._tmpVecs[6],
                                M = e._tmpVecs[7],
                                R = e._tmpQuat;
                            r.subtractToRef(i, A), A.normalize(), co.Vector3.CrossToRef(l, A, C), C.normalize(), co.Vector3.CrossToRef(A, C, M), M.normalize(), co.Matrix.FromXYZAxesToRef(C, M, A, n), 0 === C.x && 0 === C.y && 0 === C.z || 0 === M.x && 0 === M.y && 0 === M.z || 0 === A.x && 0 === A.y && 0 === A.z || ((this.adjustYaw || this.adjustPitch || this.adjustRoll) && (co.Matrix.RotationYawPitchRollToRef(this.adjustYaw, this.adjustPitch, this.adjustRoll, o), o.multiplyToRef(n, n)), this.slerpAmount < 1 ? (this._slerping || this.bone.getRotationQuaternionToRef(co.Space.WORLD, this.mesh, this._boneQuat), this._transformYawPitch && this._transformYawPitch.multiplyToRef(n, n), co.Quaternion.FromRotationMatrixToRef(n, R), co.Quaternion.SlerpToRef(this._boneQuat, R, this.slerpAmount, this._boneQuat), this.bone.setRotationQuaternion(this._boneQuat, co.Space.WORLD, this.mesh), this._slerping = !0) : (this._transformYawPitch && this._transformYawPitch.multiplyToRef(n, n), this.bone.setRotationMatrix(n, co.Space.WORLD, this.mesh), this._slerping = !1))
                        }
                    }, e.prototype._getAngleDiff = function(e, t) {
                        var i = t - e;
                        return (i %= 2 * Math.PI) > Math.PI ? i -= 2 * Math.PI : i < -Math.PI && (i += 2 * Math.PI), i
                    }, e.prototype._getAngleBetween = function(e, t) {
                        var i = 0;
                        return (i = (e = (e %= 2 * Math.PI) < 0 ? e + 2 * Math.PI : e) < (t = (t %= 2 * Math.PI) < 0 ? t + 2 * Math.PI : t) ? t - e : e - t) > Math.PI && (i = 2 * Math.PI - i), i
                    }, e.prototype._isAngleBetween = function(e, t, i) {
                        if (e = (e %= 2 * Math.PI) < 0 ? e + 2 * Math.PI : e, (t = (t %= 2 * Math.PI) < 0 ? t + 2 * Math.PI : t) < (i = (i %= 2 * Math.PI) < 0 ? i + 2 * Math.PI : i)) {
                            if (t < e && e < i) return !0
                        } else if (i < e && e < t) return !0;
                        return !1
                    }, e._tmpVecs = [co.Vector3.Zero(), co.Vector3.Zero(), co.Vector3.Zero(), co.Vector3.Zero(), co.Vector3.Zero(), co.Vector3.Zero(), co.Vector3.Zero(), co.Vector3.Zero(), co.Vector3.Zero(), co.Vector3.Zero()], e._tmpQuat = co.Quaternion.Identity(), e._tmpMats = [co.Matrix.Identity(), co.Matrix.Identity(), co.Matrix.Identity(), co.Matrix.Identity(), co.Matrix.Identity()], e
                }(), co.BoneLookController = ho, po = $a || ($a = {}), fo = function() {
                    function e(e, t, i) {
                        this.name = e, this.id = t, this.bones = new Array, this.needInitialSkinMatrix = !1, this._isDirty = !0, this._meshesWithPoseMatrix = new Array, this._identity = po.Matrix.Identity(), this._ranges = {}, this._lastAbsoluteTransformsUpdateId = -1, this.doNotSerialize = !1, this._animationPropertiesOverride = null, this.onBeforeComputeObservable = new po.Observable, this.bones = [], this._scene = i || po.Engine.LastCreatedScene, i.skeletons.push(this), this._isDirty = !0
                    }
                    return Object.defineProperty(e.prototype, "animationPropertiesOverride", {
                        get: function() {
                            return this._animationPropertiesOverride ? this._animationPropertiesOverride : this._scene.animationPropertiesOverride
                        },
                        set: function(e) {
                            this._animationPropertiesOverride = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getTransformMatrices = function(e) {
                        return this.needInitialSkinMatrix && e._bonesTransformMatrices ? e._bonesTransformMatrices : (this._transformMatrices || this.prepare(), this._transformMatrices)
                    }, e.prototype.getScene = function() {
                        return this._scene
                    }, e.prototype.toString = function(e) {
                        var t = "Name: " + this.name + ", nBones: " + this.bones.length;
                        if (t += ", nAnimationRanges: " + (this._ranges ? Object.keys(this._ranges).length : "none"), e) {
                            t += ", Ranges: {";
                            var i = !0;
                            for (var r in this._ranges) i && (t += ", ", i = !1), t += r;
                            t += "}"
                        }
                        return t
                    }, e.prototype.getBoneIndexByName = function(e) {
                        for (var t = 0, i = this.bones.length; t < i; t++)
                            if (this.bones[t].name === e) return t;
                        return -1
                    }, e.prototype.createAnimationRange = function(e, t, i) {
                        if (!this._ranges[e]) {
                            this._ranges[e] = new po.AnimationRange(e, t, i);
                            for (var r = 0, n = this.bones.length; r < n; r++) this.bones[r].animations[0] && this.bones[r].animations[0].createRange(e, t, i)
                        }
                    }, e.prototype.deleteAnimationRange = function(e, t) {
                        void 0 === t && (t = !0);
                        for (var i = 0, r = this.bones.length; i < r; i++) this.bones[i].animations[0] && this.bones[i].animations[0].deleteRange(e, t);
                        this._ranges[e] = null
                    }, e.prototype.getAnimationRange = function(e) {
                        return this._ranges[e]
                    }, e.prototype.getAnimationRanges = function() {
                        var e, t = [],
                            i = 0;
                        for (e in this._ranges) t[i] = this._ranges[e], i++;
                        return t
                    }, e.prototype.copyAnimationRange = function(e, t, i) {
                        if (void 0 === i && (i = !1), this._ranges[t] || !e.getAnimationRange(t)) return !1;
                        var r, n, o = !0,
                            s = this._getHighestAnimationFrame() + 1,
                            a = {},
                            l = e.bones;
                        for (n = 0, r = l.length; n < r; n++) a[l[n].name] = l[n];
                        this.bones.length !== l.length && (po.Tools.Warn("copyAnimationRange: this rig has " + this.bones.length + " bones, while source as " + l.length), o = !1);
                        var u = i && this.dimensionsAtRest && e.dimensionsAtRest ? this.dimensionsAtRest.divide(e.dimensionsAtRest) : null;
                        for (n = 0, r = this.bones.length; n < r; n++) {
                            var c = this.bones[n].name,
                                h = a[c];
                            h ? o = o && this.bones[n].copyAnimationRange(h, t, s, i, u) : (po.Tools.Warn("copyAnimationRange: not same rig, missing source bone " + c), o = !1)
                        }
                        var d = e.getAnimationRange(t);
                        return d && (this._ranges[t] = new po.AnimationRange(t, d.from + s, d.to + s)), o
                    }, e.prototype.returnToRest = function() {
                        for (var e = 0; e < this.bones.length; e++) this.bones[e].returnToRest()
                    }, e.prototype._getHighestAnimationFrame = function() {
                        for (var e = 0, t = 0, i = this.bones.length; t < i; t++)
                            if (this.bones[t].animations[0]) {
                                var r = this.bones[t].animations[0].getHighestFrame();
                                e < r && (e = r)
                            }
                        return e
                    }, e.prototype.beginAnimation = function(e, t, i, r) {
                        var n = this.getAnimationRange(e);
                        return n ? this._scene.beginAnimation(this, n.from, n.to, t, i, r) : null
                    }, e.prototype._markAsDirty = function() {
                        this._isDirty = !0
                    }, e.prototype._registerMeshWithPoseMatrix = function(e) {
                        this._meshesWithPoseMatrix.push(e)
                    }, e.prototype._unregisterMeshWithPoseMatrix = function(e) {
                        var t = this._meshesWithPoseMatrix.indexOf(e); - 1 < t && this._meshesWithPoseMatrix.splice(t, 1)
                    }, e.prototype._computeTransformMatrices = function(e, t) {
                        this.onBeforeComputeObservable.notifyObservers(this);
                        for (var i = 0; i < this.bones.length; i++) {
                            var r = this.bones[i],
                                n = r.getParent();
                            if (n ? r.getLocalMatrix().multiplyToRef(n.getWorldMatrix(), r.getWorldMatrix()) : t ? r.getLocalMatrix().multiplyToRef(t, r.getWorldMatrix()) : r.getWorldMatrix().copyFrom(r.getLocalMatrix()), -1 !== r._index) {
                                var o = null === r._index ? i : r._index;
                                r.getInvertedAbsoluteTransform().multiplyToArray(r.getWorldMatrix(), e, 16 * o)
                            }
                        }
                        this._identity.copyToArray(e, 16 * this.bones.length)
                    }, e.prototype.prepare = function() {
                        if (this._isDirty) {
                            if (this.needInitialSkinMatrix)
                                for (var e = 0; e < this._meshesWithPoseMatrix.length; e++) {
                                    var t = this._meshesWithPoseMatrix[e],
                                        i = t.getPoseMatrix();
                                    if (t._bonesTransformMatrices && t._bonesTransformMatrices.length === 16 * (this.bones.length + 1) || (t._bonesTransformMatrices = new Float32Array(16 * (this.bones.length + 1))), this._synchronizedWithMesh !== t) {
                                        this._synchronizedWithMesh = t;
                                        for (var r = 0; r < this.bones.length; r++) {
                                            var n = this.bones[r];
                                            n.getParent() || (n.getBaseMatrix().multiplyToRef(i, po.Tmp.Matrix[1]), n._updateDifferenceMatrix(po.Tmp.Matrix[1]))
                                        }
                                    }
                                    this._computeTransformMatrices(t._bonesTransformMatrices, i)
                                } else this._transformMatrices && this._transformMatrices.length === 16 * (this.bones.length + 1) || (this._transformMatrices = new Float32Array(16 * (this.bones.length + 1))), this._computeTransformMatrices(this._transformMatrices, null);
                            this._isDirty = !1, this._scene._activeBones.addCount(this.bones.length, !1)
                        }
                    }, e.prototype.getAnimatables = function() {
                        if (!this._animatables || this._animatables.length !== this.bones.length) {
                            this._animatables = [];
                            for (var e = 0; e < this.bones.length; e++) this._animatables.push(this.bones[e])
                        }
                        return this._animatables
                    }, e.prototype.clone = function(t, i) {
                        var r = new e(t, i || t, this._scene);
                        r.needInitialSkinMatrix = this.needInitialSkinMatrix;
                        for (var n = 0; n < this.bones.length; n++) {
                            var o = this.bones[n],
                                s = null,
                                a = o.getParent();
                            if (a) {
                                var l = this.bones.indexOf(a);
                                s = r.bones[l]
                            }
                            var u = new po.Bone(o.name, r, s, o.getBaseMatrix().clone(), o.getRestPose().clone());
                            po.Tools.DeepCopy(o.animations, u.animations)
                        }
                        if (this._ranges)
                            for (var c in r._ranges = {}, this._ranges) {
                                var h = this._ranges[c];
                                h && (r._ranges[c] = h.clone())
                            }
                        return this._isDirty = !0, r
                    }, e.prototype.enableBlending = function(e) {
                        void 0 === e && (e = .01), this.bones.forEach(function(t) {
                            t.animations.forEach(function(t) {
                                t.enableBlending = !0, t.blendingSpeed = e
                            })
                        })
                    }, e.prototype.dispose = function() {
                        this._meshesWithPoseMatrix = [], this.getScene().stopAnimation(this), this.getScene().removeSkeleton(this)
                    }, e.prototype.serialize = function() {
                        var e = {};
                        e.name = this.name, e.id = this.id, this.dimensionsAtRest && (e.dimensionsAtRest = this.dimensionsAtRest.asArray()), e.bones = [], e.needInitialSkinMatrix = this.needInitialSkinMatrix;
                        for (var t = 0; t < this.bones.length; t++) {
                            var i = this.bones[t],
                                r = i.getParent(),
                                n = {
                                    parentBoneIndex: r ? this.bones.indexOf(r) : -1,
                                    name: i.name,
                                    matrix: i.getBaseMatrix().toArray(),
                                    rest: i.getRestPose().toArray()
                                };
                            for (var o in e.bones.push(n), i.length && (n.length = i.length), i.metadata && (n.metadata = i.metadata), i.animations && 0 < i.animations.length && (n.animation = i.animations[0].serialize()), e.ranges = [], this._ranges) {
                                var s = this._ranges[o];
                                if (s) {
                                    var a = {};
                                    a.name = o, a.from = s.from, a.to = s.to, e.ranges.push(a)
                                }
                            }
                        }
                        return e
                    }, e.Parse = function(t, i) {
                        var r, n = new e(t.name, t.id, i);
                        for (t.dimensionsAtRest && (n.dimensionsAtRest = po.Vector3.FromArray(t.dimensionsAtRest)), n.needInitialSkinMatrix = t.needInitialSkinMatrix, r = 0; r < t.bones.length; r++) {
                            var o = t.bones[r],
                                s = null; - 1 < o.parentBoneIndex && (s = n.bones[o.parentBoneIndex]);
                            var a = o.rest ? po.Matrix.FromArray(o.rest) : null,
                                l = new po.Bone(o.name, n, s, po.Matrix.FromArray(o.matrix), a);
                            void 0 !== o.id && null !== o.id && (l.id = o.id), o.length && (l.length = o.length), o.metadata && (l.metadata = o.metadata), o.animation && l.animations.push(po.Animation.Parse(o.animation))
                        }
                        if (t.ranges)
                            for (r = 0; r < t.ranges.length; r++) {
                                var u = t.ranges[r];
                                n.createAnimationRange(u.name, u.from, u.to)
                            }
                        return n
                    }, e.prototype.computeAbsoluteTransforms = function(e) {
                        void 0 === e && (e = !1);
                        var t = this._scene.getRenderId();
                        (this._lastAbsoluteTransformsUpdateId != t || e) && (this.bones[0].computeAbsoluteTransforms(), this._lastAbsoluteTransformsUpdateId = t)
                    }, e.prototype.getPoseMatrix = function() {
                        var e = null;
                        return 0 < this._meshesWithPoseMatrix.length && (e = this._meshesWithPoseMatrix[0].getPoseMatrix()), e
                    }, e.prototype.sortBones = function() {
                        for (var e = new Array, t = new Array(this.bones.length), i = 0; i < this.bones.length; i++) this._sortBones(i, e, t);
                        this.bones = e
                    }, e.prototype._sortBones = function(e, t, i) {
                        if (!i[e]) {
                            i[e] = !0;
                            var r = this.bones[e];
                            void 0 === r._index && (r._index = e);
                            var n = r.getParent();
                            n && this._sortBones(this.bones.indexOf(n), t, i), t.push(r)
                        }
                    }, e
                }(), po.Skeleton = fo, _o = $a || ($a = {}), mo = function() {
                    function e() {}
                    return e.Ldexp = function(e, t) {
                        return 1023 < t ? e * Math.pow(2, 1023) * Math.pow(2, t - 1023) : t < -1074 ? e * Math.pow(2, -1074) * Math.pow(2, t + 1074) : e * Math.pow(2, t)
                    }, e.Rgbe2float = function(e, t, i, r, n, o) {
                        0 < n ? (n = this.Ldexp(1, n - 136), e[o + 0] = t * n, e[o + 1] = i * n, e[o + 2] = r * n) : (e[o + 0] = 0, e[o + 1] = 0, e[o + 2] = 0)
                    }, e.readStringLine = function(e, t) {
                        for (var i = "", r = "", n = t; n < e.length - t && "\n" != (r = String.fromCharCode(e[n])); n++) i += r;
                        return i
                    }, e.RGBE_ReadHeader = function(e) {
                        var t, i, r = this.readStringLine(e, 0);
                        if ("#" != r[0] || "?" != r[1]) throw "Bad HDR Format.";
                        for (var n = !1, o = !1, s = 0; s += r.length + 1, "FORMAT=32-bit_rle_rgbe" == (r = this.readStringLine(e, s)) ? o = !0 : 0 == r.length && (n = !0), !n;);
                        if (!o) throw "HDR Bad header format, unsupported FORMAT";
                        s += r.length + 1, r = this.readStringLine(e, s);
                        var a = /^\-Y (.*) \+X (.*)$/g.exec(r);
                        if (!a || a.length < 3) throw "HDR Bad header format, no size";
                        if (i = parseInt(a[2]), t = parseInt(a[1]), i < 8 || 32767 < i) throw "HDR Bad header format, unsupported size";
                        return {
                            height: t,
                            width: i,
                            dataPosition: s += r.length + 1
                        }
                    }, e.GetCubeMapTextureData = function(e, t) {
                        var i = new Uint8Array(e),
                            r = this.RGBE_ReadHeader(i),
                            n = this.RGBE_ReadPixels_RLE(i, r);
                        return _o.PanoramaToCubeMapTools.ConvertPanoramaToCubemap(n, r.width, r.height, t)
                    }, e.RGBE_ReadPixels = function(e, t) {
                        return this.RGBE_ReadPixels_RLE(e, t)
                    }, e.RGBE_ReadPixels_RLE = function(e, t) {
                        for (var i, r, n, o, s, a = t.height, l = t.width, u = t.dataPosition, c = 0, h = 0, d = 0, p = new ArrayBuffer(4 * l), f = new Uint8Array(p), _ = new ArrayBuffer(t.width * t.height * 4 * 3), m = new Float32Array(_); 0 < a;) {
                            if (i = e[u++], r = e[u++], n = e[u++], o = e[u++], 2 != i || 2 != r || 128 & n) throw "HDR Bad header format, not RLE";
                            if ((n << 8 | o) != l) throw "HDR Bad header format, wrong scan line width";
                            for (d = c = 0; d < 4; d++)
                                for (h = (d + 1) * l; c < h;)
                                    if (i = e[u++], r = e[u++], 128 < i) {
                                        if (0 == (s = i - 128) || h - c < s) throw "HDR Bad Format, bad scanline data (run)";
                                        for (; 0 < s--;) f[c++] = r
                                    } else {
                                        if (0 == (s = i) || h - c < s) throw "HDR Bad Format, bad scanline data (non-run)";
                                        if (f[c++] = r, 0 < --s)
                                            for (var g = 0; g < s; g++) f[c++] = e[u++]
                                    }
                            for (d = 0; d < l; d++) i = f[d], r = f[d + l], n = f[d + 2 * l], o = f[d + 3 * l], this.Rgbe2float(m, i, r, n, o, (t.height - a) * l * 3 + 3 * d);
                            a--
                        }
                        return m
                    }, e
                }(), _o.HDRTools = mo, go = $a || ($a = {}), vo = function(e) {
                    function t(t, i, r, n, o, s, a, l, u) {
                        void 0 === n && (n = !1), void 0 === o && (o = !0), void 0 === s && (s = !1), void 0 === a && (a = !1), void 0 === l && (l = null), void 0 === u && (u = null);
                        var c = e.call(this, i) || this;
                        return c._generateHarmonics = !0, c._onLoad = null, c._onError = null, c.coordinatesMode = go.Texture.CUBIC_MODE, c._isBlocking = !0, c._rotationY = 0, c.boundingBoxPosition = go.Vector3.Zero(), t && (c.name = t, c.url = t, c.hasAlpha = !1, c.isCube = !0, c._textureMatrix = go.Matrix.Identity(), c._onLoad = l, c._onError = u, c.gammaSpace = s, c._noMipmap = n, c._size = r, c._texture = c._getFromCache(t, c._noMipmap), c._texture || (i.useDelayedTextureLoading ? c.delayLoadState = go.Engine.DELAYLOADSTATE_NOTLOADED : c.loadTexture())), c
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "isBlocking", {
                        get: function() {
                            return this._isBlocking
                        },
                        set: function(e) {
                            this._isBlocking = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "rotationY", {
                        get: function() {
                            return this._rotationY
                        },
                        set: function(e) {
                            this._rotationY = e, this.setReflectionTextureMatrix(go.Matrix.RotationY(this._rotationY))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "boundingBoxSize", {
                        get: function() {
                            return this._boundingBoxSize
                        },
                        set: function(e) {
                            if (!this._boundingBoxSize || !this._boundingBoxSize.equals(e)) {
                                this._boundingBoxSize = e;
                                var t = this.getScene();
                                t && t.markAllMaterialsAsDirty(go.Material.TextureDirtyFlag)
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.loadTexture = function() {
                        var e = this,
                            i = this.getScene();
                        i && (this._texture = i.getEngine().createRawCubeTextureFromUrl(this.url, i, this._size, go.Engine.TEXTUREFORMAT_RGB, i.getEngine().getCaps().textureFloat ? go.Engine.TEXTURETYPE_FLOAT : go.Engine.TEXTURETYPE_UNSIGNED_INT, this._noMipmap, function(i) {
                            e.lodGenerationOffset = 0, e.lodGenerationScale = .8;
                            var r = e.getScene();
                            if (!r) return null;
                            var n = go.HDRTools.GetCubeMapTextureData(i, e._size);
                            if (e._generateHarmonics) {
                                var o = go.CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial(n);
                                e.sphericalPolynomial = o
                            }
                            for (var s = [], a = null, l = 0; l < 6; l++) {
                                if (!r.getEngine().getCaps().textureFloat) {
                                    var u = new ArrayBuffer(e._size * e._size * 3);
                                    a = new Uint8Array(u)
                                }
                                var c = n[t._facesMapping[l]];
                                if (e.gammaSpace || a)
                                    for (var h = 0; h < e._size * e._size; h++)
                                        if (e.gammaSpace && (c[3 * h + 0] = Math.pow(c[3 * h + 0], go.ToGammaSpace), c[3 * h + 1] = Math.pow(c[3 * h + 1], go.ToGammaSpace), c[3 * h + 2] = Math.pow(c[3 * h + 2], go.ToGammaSpace)), a) {
                                            var d = Math.max(255 * c[3 * h + 0], 0),
                                                p = Math.max(255 * c[3 * h + 1], 0),
                                                f = Math.max(255 * c[3 * h + 2], 0),
                                                _ = Math.max(Math.max(d, p), f);
                                            if (255 < _) {
                                                var m = 255 / _;
                                                d *= m, p *= m, f *= m
                                            }
                                            a[3 * h + 0] = d, a[3 * h + 1] = p, a[3 * h + 2] = f
                                        }
                                a ? s.push(a) : s.push(c)
                            }
                            return s
                        }, null, this._onLoad, this._onError))
                    }, t.prototype.clone = function() {
                        var e = this.getScene();
                        if (!e) return this;
                        var i = new t(this.url, e, this._size, this._noMipmap, this._generateHarmonics, this.gammaSpace);
                        return i.level = this.level, i.wrapU = this.wrapU, i.wrapV = this.wrapV, i.coordinatesIndex = this.coordinatesIndex, i.coordinatesMode = this.coordinatesMode, i
                    }, t.prototype.delayLoad = function() {
                        this.delayLoadState === go.Engine.DELAYLOADSTATE_NOTLOADED && (this.delayLoadState = go.Engine.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, this._noMipmap), this._texture || this.loadTexture())
                    }, t.prototype.getReflectionTextureMatrix = function() {
                        return this._textureMatrix
                    }, t.prototype.setReflectionTextureMatrix = function(e) {
                        this._textureMatrix = e
                    }, t.Parse = function(e, i, r) {
                        var n = null;
                        return e.name && !e.isRenderTarget && ((n = new t(r + e.name, i, e.size, e.noMipmap, e.generateHarmonics, e.useInGammaSpace)).name = e.name, n.hasAlpha = e.hasAlpha, n.level = e.level, n.coordinatesMode = e.coordinatesMode, n.isBlocking = e.isBlocking), n && (e.boundingBoxPosition && (n.boundingBoxPosition = go.Vector3.FromArray(e.boundingBoxPosition)), e.boundingBoxSize && (n.boundingBoxSize = go.Vector3.FromArray(e.boundingBoxSize)), e.rotationY && (n.rotationY = e.rotationY)), n
                    }, t.prototype.serialize = function() {
                        if (!this.name) return null;
                        var e = {};
                        return e.name = this.name, e.hasAlpha = this.hasAlpha, e.isCube = !0, e.level = this.level, e.size = this._size, e.coordinatesMode = this.coordinatesMode, e.useInGammaSpace = this.gammaSpace, e.generateHarmonics = this._generateHarmonics, e.customType = "BABYLON.HDRCubeTexture", e.noMipmap = this._noMipmap, e.isBlocking = this._isBlocking, e.rotationY = this._rotationY, e
                    }, t._facesMapping = ["right", "left", "up", "down", "front", "back"], t
                }(go.BaseTexture), go.HDRCubeTexture = vo, yo = $a || ($a = {}), bo = function() {
                    function e() {}
                    return e.ConvertPanoramaToCubemap = function(e, t, i, r) {
                        if (!e) throw "ConvertPanoramaToCubemap: input cannot be null";
                        if (e.length != t * i * 3) throw "ConvertPanoramaToCubemap: input size is wrong";
                        return {
                            front: this.CreateCubemapTexture(r, this.FACE_FRONT, e, t, i),
                            back: this.CreateCubemapTexture(r, this.FACE_BACK, e, t, i),
                            left: this.CreateCubemapTexture(r, this.FACE_LEFT, e, t, i),
                            right: this.CreateCubemapTexture(r, this.FACE_RIGHT, e, t, i),
                            up: this.CreateCubemapTexture(r, this.FACE_UP, e, t, i),
                            down: this.CreateCubemapTexture(r, this.FACE_DOWN, e, t, i),
                            size: r,
                            type: yo.Engine.TEXTURETYPE_FLOAT,
                            format: yo.Engine.TEXTUREFORMAT_RGB,
                            gammaSpace: !1
                        }
                    }, e.CreateCubemapTexture = function(e, t, i, r, n) {
                        for (var o = new ArrayBuffer(e * e * 4 * 3), s = new Float32Array(o), a = t[1].subtract(t[0]).scale(1 / e), l = t[3].subtract(t[2]).scale(1 / e), u = 1 / e, c = 0, h = 0; h < e; h++) {
                            for (var d = t[0], p = t[2], f = 0; f < e; f++) {
                                var _ = p.subtract(d).scale(c).add(d);
                                _.normalize();
                                var m = this.CalcProjectionSpherical(_, i, r, n);
                                s[h * e * 3 + 3 * f + 0] = m.r, s[h * e * 3 + 3 * f + 1] = m.g, s[h * e * 3 + 3 * f + 2] = m.b, d = d.add(a), p = p.add(l)
                            }
                            c += u
                        }
                        return s
                    }, e.CalcProjectionSpherical = function(e, t, i, r) {
                        for (var n = Math.atan2(e.z, e.x), o = Math.acos(e.y); n < -Math.PI;) n += 2 * Math.PI;
                        for (; n > Math.PI;) n -= 2 * Math.PI;
                        var s = n / Math.PI,
                            a = o / Math.PI;
                        s = .5 * s + .5;
                        var l = Math.round(s * i);
                        l < 0 ? l = 0 : i <= l && (l = i - 1);
                        var u = Math.round(a * r);
                        u < 0 ? u = 0 : r <= u && (u = r - 1);
                        var c = r - u - 1;
                        return {
                            r: t[c * i * 3 + 3 * l + 0],
                            g: t[c * i * 3 + 3 * l + 1],
                            b: t[c * i * 3 + 3 * l + 2]
                        }
                    }, e.FACE_FRONT = [new yo.Vector3(-1, -1, -1), new yo.Vector3(1, -1, -1), new yo.Vector3(-1, 1, -1), new yo.Vector3(1, 1, -1)], e.FACE_BACK = [new yo.Vector3(1, -1, 1), new yo.Vector3(-1, -1, 1), new yo.Vector3(1, 1, 1), new yo.Vector3(-1, 1, 1)], e.FACE_RIGHT = [new yo.Vector3(1, -1, -1), new yo.Vector3(1, -1, 1), new yo.Vector3(1, 1, -1), new yo.Vector3(1, 1, 1)], e.FACE_LEFT = [new yo.Vector3(-1, -1, 1), new yo.Vector3(-1, -1, -1), new yo.Vector3(-1, 1, 1), new yo.Vector3(-1, 1, -1)], e.FACE_DOWN = [new yo.Vector3(-1, 1, -1), new yo.Vector3(1, 1, -1), new yo.Vector3(-1, 1, 1), new yo.Vector3(1, 1, 1)], e.FACE_UP = [new yo.Vector3(-1, -1, 1), new yo.Vector3(1, -1, 1), new yo.Vector3(-1, -1, -1), new yo.Vector3(1, -1, -1)], e
                }(), yo.PanoramaToCubeMapTools = bo,
                function(e) {
                    var t = function(e) {
                            function t(t, i) {
                                var r = e.call(this, t.x, t.y) || this;
                                return r.index = i, r
                            }
                            return b(t, e), t
                        }(e.Vector2),
                        r = function() {
                            function i() {
                                this.elements = new Array
                            }
                            return i.prototype.add = function(e) {
                                var i = this,
                                    r = new Array;
                                return e.forEach(function(e) {
                                    if (0 === r.length || !e.equalsWithEpsilon(r[0])) {
                                        var n = new t(e, i.elements.length);
                                        r.push(n), i.elements.push(n)
                                    }
                                }), r
                            }, i.prototype.computeBounds = function() {
                                var t = new e.Vector2(this.elements[0].x, this.elements[0].y),
                                    i = new e.Vector2(this.elements[0].x, this.elements[0].y);
                                return this.elements.forEach(function(e) {
                                    e.x < t.x ? t.x = e.x : e.x > i.x && (i.x = e.x), e.y < t.y ? t.y = e.y : e.y > i.y && (i.y = e.y)
                                }), {
                                    min: t,
                                    max: i,
                                    width: i.x - t.x,
                                    height: i.y - t.y
                                }
                            }, i
                        }(),
                        n = function() {
                            function t() {}
                            return t.Rectangle = function(t, i, r, n) {
                                return [new e.Vector2(t, i), new e.Vector2(r, i), new e.Vector2(r, n), new e.Vector2(t, n)]
                            }, t.Circle = function(t, i, r, n) {
                                void 0 === i && (i = 0), void 0 === r && (r = 0), void 0 === n && (n = 32);
                                for (var o = new Array, s = 0, a = 2 * Math.PI / n, l = 0; l < n; l++) o.push(new e.Vector2(i + Math.cos(s) * t, r + Math.sin(s) * t)), s -= a;
                                return o
                            }, t.Parse = function(t) {
                                var i, r = t.split(/[^-+eE\.\d]+/).map(parseFloat).filter(function(e) {
                                        return !isNaN(e)
                                    }),
                                    n = [];
                                for (i = 0; i < (2147483646 & r.length); i += 2) n.push(new e.Vector2(r[i], r[i + 1]));
                                return n
                            }, t.StartingAt = function(t, i) {
                                return e.Path2.StartingAt(t, i)
                            }, t
                        }();
                    e.Polygon = n;
                    var o = function() {
                        function t(t, n, o) {
                            var s;
                            this._points = new r, this._outlinepoints = new r, this._holes = new Array, this._epoints = new Array, this._eholes = new Array, this._name = t, this._scene = o, s = n instanceof e.Path2 ? n.getPoints() : n, this._addToepoint(s), this._points.add(s), this._outlinepoints.add(s), void 0 === i && e.Tools.Warn("Earcut was not found, the polygon will not be built.")
                        }
                        return t.prototype._addToepoint = function(e) {
                            for (var t = 0, i = e; t < i.length; t++) {
                                var r = i[t];
                                this._epoints.push(r.x, r.y)
                            }
                        }, t.prototype.addHole = function(e) {
                            this._points.add(e);
                            var t = new r;
                            return t.add(e), this._holes.push(t), this._eholes.push(this._epoints.length / 2), this._addToepoint(e), this
                        }, t.prototype.build = function(t, r) {
                            var n = this;
                            void 0 === t && (t = !1), void 0 === r && (r = 0);
                            var o = new e.Mesh(this._name, this._scene),
                                s = new Array,
                                a = new Array,
                                l = new Array,
                                u = this._points.computeBounds();
                            this._points.elements.forEach(function(e) {
                                s.push(0, 1, 0), a.push(e.x, 0, e.y), l.push((e.x - u.min.x) / u.width, (e.y - u.min.y) / u.height)
                            });
                            for (var c = new Array, h = i(this._epoints, this._eholes, 2), d = 0; d < h.length; d++) c.push(h[d]);
                            if (0 < r) {
                                var p = a.length / 3;
                                this._points.elements.forEach(function(e) {
                                    s.push(0, -1, 0), a.push(e.x, -r, e.y), l.push(1 - (e.x - u.min.x) / u.width, 1 - (e.y - u.min.y) / u.height)
                                });
                                var f = c.length;
                                for (d = 0; d < f; d += 3) {
                                    var _ = c[d + 0],
                                        m = c[d + 1],
                                        g = c[d + 2];
                                    c.push(g + p), c.push(m + p), c.push(_ + p)
                                }
                                this.addSide(a, s, l, c, u, this._outlinepoints, r, !1), this._holes.forEach(function(e) {
                                    n.addSide(a, s, l, c, u, e, r, !0)
                                })
                            }
                            return o.setVerticesData(e.VertexBuffer.PositionKind, a, t), o.setVerticesData(e.VertexBuffer.NormalKind, s, t), o.setVerticesData(e.VertexBuffer.UVKind, l, t), o.setIndices(c), o
                        }, t.prototype.addSide = function(t, i, r, n, o, s, a, l) {
                            for (var u = t.length / 3, c = 0, h = 0; h < s.elements.length; h++) {
                                var d, p = s.elements[h];
                                d = h + 1 > s.elements.length - 1 ? s.elements[0] : s.elements[h + 1], t.push(p.x, 0, p.y), t.push(p.x, -a, p.y), t.push(d.x, 0, d.y), t.push(d.x, -a, d.y);
                                var f = new e.Vector3(p.x, 0, p.y),
                                    _ = new e.Vector3(d.x, 0, d.y).subtract(f),
                                    m = new e.Vector3(0, 1, 0),
                                    g = e.Vector3.Cross(_, m);
                                g = g.normalize(), r.push(c / o.width, 0), r.push(c / o.width, 1), c += _.length(), r.push(c / o.width, 0), r.push(c / o.width, 1), l ? (i.push(g.x, g.y, g.z), i.push(g.x, g.y, g.z), i.push(g.x, g.y, g.z), i.push(g.x, g.y, g.z), n.push(u), n.push(u + 2), n.push(u + 1), n.push(u + 1), n.push(u + 2), n.push(u + 3)) : (i.push(-g.x, -g.y, -g.z), i.push(-g.x, -g.y, -g.z), i.push(-g.x, -g.y, -g.z), i.push(-g.x, -g.y, -g.z), n.push(u), n.push(u + 1), n.push(u + 2), n.push(u + 1), n.push(u + 3), n.push(u + 2)), u += 4
                            }
                        }, t
                    }();
                    e.PolygonMeshBuilder = o
                }($a || ($a = {})), xo = $a || ($a = {}), To = 0, Eo = function() {
                    function e(e, t, i) {
                        this.pos = e, this.normal = t, this.uv = i
                    }
                    return e.prototype.clone = function() {
                        return new e(this.pos.clone(), this.normal.clone(), this.uv.clone())
                    }, e.prototype.flip = function() {
                        this.normal = this.normal.scale(-1)
                    }, e.prototype.interpolate = function(t, i) {
                        return new e(xo.Vector3.Lerp(this.pos, t.pos, i), xo.Vector3.Lerp(this.normal, t.normal, i), xo.Vector2.Lerp(this.uv, t.uv, i))
                    }, e
                }(), So = function() {
                    function e(e, t) {
                        this.normal = e, this.w = t
                    }
                    return e.FromPoints = function(t, i, r) {
                        var n = r.subtract(t),
                            o = i.subtract(t);
                        if (0 === n.lengthSquared() || 0 === o.lengthSquared()) return null;
                        var s = xo.Vector3.Normalize(xo.Vector3.Cross(n, o));
                        return new e(s, xo.Vector3.Dot(s, t))
                    }, e.prototype.clone = function() {
                        return new e(this.normal.clone(), this.w)
                    }, e.prototype.flip = function() {
                        this.normal.scaleInPlace(-1), this.w = -this.w
                    }, e.prototype.splitPolygon = function(t, i, r, n, o) {
                        var s, a, l = 0,
                            u = [];
                        for (s = 0; s < t.vertices.length; s++) {
                            var c = (a = xo.Vector3.Dot(this.normal, t.vertices[s].pos) - this.w) < -e.EPSILON ? 2 : e.EPSILON < a ? 1 : 0;
                            l |= c, u.push(c)
                        }
                        switch (l) {
                            case 0:
                                (0 < xo.Vector3.Dot(this.normal, t.plane.normal) ? i : r).push(t);
                                break;
                            case 1:
                                n.push(t);
                                break;
                            case 2:
                                o.push(t);
                                break;
                            case 3:
                                var h, d = [],
                                    p = [];
                                for (s = 0; s < t.vertices.length; s++) {
                                    var f = (s + 1) % t.vertices.length,
                                        _ = u[s],
                                        m = u[f],
                                        g = t.vertices[s],
                                        v = t.vertices[f];
                                    if (2 !== _ && d.push(g), 1 !== _ && p.push(2 !== _ ? g.clone() : g), 3 == (_ | m)) {
                                        a = (this.w - xo.Vector3.Dot(this.normal, g.pos)) / xo.Vector3.Dot(this.normal, v.pos.subtract(g.pos));
                                        var y = g.interpolate(v, a);
                                        d.push(y), p.push(y.clone())
                                    }
                                }
                                3 <= d.length && (h = new Po(d, t.shared)).plane && n.push(h), 3 <= p.length && (h = new Po(p, t.shared)).plane && o.push(h)
                        }
                    }, e.EPSILON = 1e-5, e
                }(), Po = function() {
                    function e(e, t) {
                        this.vertices = e, this.shared = t, this.plane = So.FromPoints(e[0].pos, e[1].pos, e[2].pos)
                    }
                    return e.prototype.clone = function() {
                        return new e(this.vertices.map(function(e) {
                            return e.clone()
                        }), this.shared)
                    }, e.prototype.flip = function() {
                        this.vertices.reverse().map(function(e) {
                            e.flip()
                        }), this.plane.flip()
                    }, e
                }(), Ao = function() {
                    function e(e) {
                        this.plane = null, this.front = null, this.back = null, this.polygons = new Array, e && this.build(e)
                    }
                    return e.prototype.clone = function() {
                        var t = new e;
                        return t.plane = this.plane && this.plane.clone(), t.front = this.front && this.front.clone(), t.back = this.back && this.back.clone(), t.polygons = this.polygons.map(function(e) {
                            return e.clone()
                        }), t
                    }, e.prototype.invert = function() {
                        for (var e = 0; e < this.polygons.length; e++) this.polygons[e].flip();
                        this.plane && this.plane.flip(), this.front && this.front.invert(), this.back && this.back.invert();
                        var t = this.front;
                        this.front = this.back, this.back = t
                    }, e.prototype.clipPolygons = function(e) {
                        if (!this.plane) return e.slice();
                        for (var t = new Array, i = new Array, r = 0; r < e.length; r++) this.plane.splitPolygon(e[r], t, i, t, i);
                        return this.front && (t = this.front.clipPolygons(t)), i = this.back ? this.back.clipPolygons(i) : [], t.concat(i)
                    }, e.prototype.clipTo = function(e) {
                        this.polygons = e.clipPolygons(this.polygons), this.front && this.front.clipTo(e), this.back && this.back.clipTo(e)
                    }, e.prototype.allPolygons = function() {
                        var e = this.polygons.slice();
                        return this.front && (e = e.concat(this.front.allPolygons())), this.back && (e = e.concat(this.back.allPolygons())), e
                    }, e.prototype.build = function(t) {
                        if (t.length) {
                            this.plane || (this.plane = t[0].plane.clone());
                            for (var i = new Array, r = new Array, n = 0; n < t.length; n++) this.plane.splitPolygon(t[n], this.polygons, this.polygons, i, r);
                            i.length && (this.front || (this.front = new e), this.front.build(i)), r.length && (this.back || (this.back = new e), this.back.build(r))
                        }
                    }, e
                }(), Co = function() {
                    function e() {
                        this.polygons = new Array
                    }
                    return e.FromMesh = function(t) {
                        var i, r, n, o, s, a, l, u, c, h, d = new Array,
                            p = null;
                        if (!(t instanceof xo.Mesh)) throw "BABYLON.CSG: Wrong Mesh type, must be BABYLON.Mesh";
                        t.computeWorldMatrix(!0), l = t.getWorldMatrix(), u = t.position.clone(), c = t.rotation.clone(), t.rotationQuaternion && (p = t.rotationQuaternion.clone()), h = t.scaling.clone();
                        for (var f = t.getIndices(), _ = t.getVerticesData(xo.VertexBuffer.PositionKind), m = t.getVerticesData(xo.VertexBuffer.NormalKind), g = t.getVerticesData(xo.VertexBuffer.UVKind), v = t.subMeshes, y = 0, b = v.length; y < b; y++)
                            for (var x = v[y].indexStart, T = v[y].indexCount + v[y].indexStart; x < T; x += 3) {
                                a = [];
                                for (var E = 0; E < 3; E++) {
                                    var S = new xo.Vector3(m[3 * f[x + E]], m[3 * f[x + E] + 1], m[3 * f[x + E] + 2]);
                                    n = new xo.Vector2(g[2 * f[x + E]], g[2 * f[x + E] + 1]);
                                    var P = new xo.Vector3(_[3 * f[x + E]], _[3 * f[x + E] + 1], _[3 * f[x + E] + 2]);
                                    o = xo.Vector3.TransformCoordinates(P, l), r = xo.Vector3.TransformNormal(S, l), i = new Eo(o, r, n), a.push(i)
                                }(s = new Po(a, {
                                    subMeshId: y,
                                    meshId: To,
                                    materialIndex: v[y].materialIndex
                                })).plane && d.push(s)
                            }
                        var A = e.FromPolygons(d);
                        return A.matrix = l, A.position = u, A.rotation = c, A.scaling = h, A.rotationQuaternion = p, To++, A
                    }, e.FromPolygons = function(t) {
                        var i = new e;
                        return i.polygons = t, i
                    }, e.prototype.clone = function() {
                        var t = new e;
                        return t.polygons = this.polygons.map(function(e) {
                            return e.clone()
                        }), t.copyTransformAttributes(this), t
                    }, e.prototype.union = function(t) {
                        var i = new Ao(this.clone().polygons),
                            r = new Ao(t.clone().polygons);
                        return i.clipTo(r), r.clipTo(i), r.invert(), r.clipTo(i), r.invert(), i.build(r.allPolygons()), e.FromPolygons(i.allPolygons()).copyTransformAttributes(this)
                    }, e.prototype.unionInPlace = function(e) {
                        var t = new Ao(this.polygons),
                            i = new Ao(e.polygons);
                        t.clipTo(i), i.clipTo(t), i.invert(), i.clipTo(t), i.invert(), t.build(i.allPolygons()), this.polygons = t.allPolygons()
                    }, e.prototype.subtract = function(t) {
                        var i = new Ao(this.clone().polygons),
                            r = new Ao(t.clone().polygons);
                        return i.invert(), i.clipTo(r), r.clipTo(i), r.invert(), r.clipTo(i), r.invert(), i.build(r.allPolygons()), i.invert(), e.FromPolygons(i.allPolygons()).copyTransformAttributes(this)
                    }, e.prototype.subtractInPlace = function(e) {
                        var t = new Ao(this.polygons),
                            i = new Ao(e.polygons);
                        t.invert(), t.clipTo(i), i.clipTo(t), i.invert(), i.clipTo(t), i.invert(), t.build(i.allPolygons()), t.invert(), this.polygons = t.allPolygons()
                    }, e.prototype.intersect = function(t) {
                        var i = new Ao(this.clone().polygons),
                            r = new Ao(t.clone().polygons);
                        return i.invert(), r.clipTo(i), r.invert(), i.clipTo(r), r.clipTo(i), i.build(r.allPolygons()), i.invert(), e.FromPolygons(i.allPolygons()).copyTransformAttributes(this)
                    }, e.prototype.intersectInPlace = function(e) {
                        var t = new Ao(this.polygons),
                            i = new Ao(e.polygons);
                        t.invert(), i.clipTo(t), i.invert(), t.clipTo(i), i.clipTo(t), t.build(i.allPolygons()), t.invert(), this.polygons = t.allPolygons()
                    }, e.prototype.inverse = function() {
                        var e = this.clone();
                        return e.inverseInPlace(), e
                    }, e.prototype.inverseInPlace = function() {
                        this.polygons.map(function(e) {
                            e.flip()
                        })
                    }, e.prototype.copyTransformAttributes = function(e) {
                        return this.matrix = e.matrix, this.position = e.position, this.rotation = e.rotation, this.scaling = e.scaling, this.rotationQuaternion = e.rotationQuaternion, this
                    }, e.prototype.buildMeshGeometry = function(e, t, i) {
                        var r = this.matrix.clone();
                        r.invert();
                        var n, o, s, a = new xo.Mesh(e, t),
                            l = [],
                            u = [],
                            c = [],
                            h = [],
                            d = xo.Vector3.Zero(),
                            p = xo.Vector3.Zero(),
                            f = xo.Vector2.Zero(),
                            _ = this.polygons,
                            m = [0, 0, 0],
                            g = {},
                            v = 0,
                            y = {};
                        i && _.sort(function(e, t) {
                            return e.shared.meshId === t.shared.meshId ? e.shared.subMeshId - t.shared.subMeshId : e.shared.meshId - t.shared.meshId
                        });
                        for (var b = 0, x = _.length; b < x; b++) {
                            y[(n = _[b]).shared.meshId] || (y[n.shared.meshId] = {}), y[n.shared.meshId][n.shared.subMeshId] || (y[n.shared.meshId][n.shared.subMeshId] = {
                                indexStart: 1 / 0,
                                indexEnd: -1 / 0,
                                materialIndex: n.shared.materialIndex
                            }), s = y[n.shared.meshId][n.shared.subMeshId];
                            for (var T = 2, E = n.vertices.length; T < E; T++) {
                                m[0] = 0, m[1] = T - 1, m[2] = T;
                                for (var S = 0; S < 3; S++) {
                                    d.copyFrom(n.vertices[m[S]].pos), p.copyFrom(n.vertices[m[S]].normal), f.copyFrom(n.vertices[m[S]].uv);
                                    var P = xo.Vector3.TransformCoordinates(d, r),
                                        A = xo.Vector3.TransformNormal(p, r);
                                    void 0 !== (o = g[P.x + "," + P.y + "," + P.z]) && c[3 * o] === A.x && c[3 * o + 1] === A.y && c[3 * o + 2] === A.z && h[2 * o] === f.x && h[2 * o + 1] === f.y || (l.push(P.x, P.y, P.z), h.push(f.x, f.y), c.push(p.x, p.y, p.z), o = g[P.x + "," + P.y + "," + P.z] = l.length / 3 - 1), u.push(o), s.indexStart = Math.min(v, s.indexStart), s.indexEnd = Math.max(v, s.indexEnd), v++
                                }
                            }
                        }
                        if (a.setVerticesData(xo.VertexBuffer.PositionKind, l), a.setVerticesData(xo.VertexBuffer.NormalKind, c), a.setVerticesData(xo.VertexBuffer.UVKind, h), a.setIndices(u, null), i) {
                            var C, M = 0;
                            for (var R in a.subMeshes = new Array, y) {
                                for (var O in C = -1, y[R]) s = y[R][O], xo.SubMesh.CreateFromIndices(s.materialIndex + M, s.indexStart, s.indexEnd - s.indexStart + 1, a), C = Math.max(s.materialIndex, C);
                                M += ++C
                            }
                        }
                        return a
                    }, e.prototype.toMesh = function(e, t, i, r) {
                        var n = this.buildMeshGeometry(e, i, r);
                        return n.material = t, n.position.copyFrom(this.position), n.rotation.copyFrom(this.rotation), this.rotationQuaternion && (n.rotationQuaternion = this.rotationQuaternion.clone()), n.scaling.copyFrom(this.scaling), n.computeWorldMatrix(!0), n
                    }, e
                }(), xo.CSG = Co, Mo = $a || ($a = {}), Ro = function() {
                    function e(e, t, i, r, n) {
                        this.size = e, this.position = t, this.alphaMode = Mo.Engine.ALPHA_ONEONE, this.color = i || new Mo.Color3(1, 1, 1), this.texture = r ? new Mo.Texture(r, n.getScene(), !0) : null, (this._system = n).lensFlares.push(this)
                    }
                    return e.AddFlare = function(t, i, r, n, o) {
                        return new e(t, i, r, n, o)
                    }, e.prototype.dispose = function() {
                        this.texture && this.texture.dispose();
                        var e = this._system.lensFlares.indexOf(this);
                        this._system.lensFlares.splice(e, 1)
                    }, e
                }(), Mo.LensFlare = Ro,
                function(e) {
                    e.AbstractScene.AddParser(e.SceneComponentConstants.NAME_LENSFLARESYSTEM, function(t, i, r, n) {
                        if (void 0 !== t.lensFlareSystems && null !== t.lensFlareSystems) {
                            r.lensFlareSystems || (r.lensFlareSystems = new Array);
                            for (var o = 0, s = t.lensFlareSystems.length; o < s; o++) {
                                var a = t.lensFlareSystems[o],
                                    l = e.LensFlareSystem.Parse(a, i, n);
                                r.lensFlareSystems.push(l)
                            }
                        }
                    }), e.AbstractScene.prototype.getLensFlareSystemByName = function(e) {
                        for (var t = 0; t < this.lensFlareSystems.length; t++)
                            if (this.lensFlareSystems[t].name === e) return this.lensFlareSystems[t];
                        return null
                    }, e.AbstractScene.prototype.getLensFlareSystemByID = function(e) {
                        for (var t = 0; t < this.lensFlareSystems.length; t++)
                            if (this.lensFlareSystems[t].id === e) return this.lensFlareSystems[t];
                        return null
                    }, e.AbstractScene.prototype.removeLensFlareSystem = function(e) {
                        var t = this.lensFlareSystems.indexOf(e);
                        return -1 !== t && this.lensFlareSystems.splice(t, 1), t
                    }, e.AbstractScene.prototype.addLensFlareSystem = function(e) {
                        this.lensFlareSystems.push(e)
                    };
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_LENSFLARESYSTEM, (this.scene = t).lensFlareSystems = new Array
                        }
                        return t.prototype.register = function() {
                            this.scene._afterCameraDrawStage.registerStep(e.SceneComponentConstants.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM, this, this._draw)
                        }, t.prototype.rebuild = function() {}, t.prototype.addFromContainer = function(e) {
                            var t = this;
                            e.lensFlareSystems && e.lensFlareSystems.forEach(function(e) {
                                t.scene.addLensFlareSystem(e)
                            })
                        }, t.prototype.removeFromContainer = function(e) {
                            var t = this;
                            e.lensFlareSystems && e.lensFlareSystems.forEach(function(e) {
                                t.scene.removeLensFlareSystem(e)
                            })
                        }, t.prototype.serialize = function(e) {
                            e.lensFlareSystems = [];
                            for (var t = 0, i = this.scene.lensFlareSystems; t < i.length; t++) {
                                var r = i[t];
                                e.lensFlareSystems.push(r.serialize())
                            }
                        }, t.prototype.dispose = function() {
                            for (var e = this.scene.lensFlareSystems; e.length;) e[0].dispose()
                        }, t.prototype._draw = function(t) {
                            if (this.scene.lensFlaresEnabled) {
                                var i = this.scene.lensFlareSystems;
                                e.Tools.StartPerformanceCounter("Lens flares", 0 < i.length);
                                for (var r = 0, n = i; r < n.length; r++) {
                                    var o = n[r];
                                    0 != (t.layerMask & o.layerMask) && o.render()
                                }
                                e.Tools.EndPerformanceCounter("Lens flares", 0 < i.length)
                            }
                        }, t
                    }();
                    e.LensFlareSystemSceneComponent = t
                }($a || ($a = {})), Oo = $a || ($a = {}), wo = function() {
                    function e(e, t, i) {
                        this.name = e, this.lensFlares = new Array, this.borderLimit = 300, this.viewportBorder = 0, this.layerMask = 268435455, this._vertexBuffers = {}, this._isEnabled = !0, this._scene = i || Oo.Engine.LastCreatedScene;
                        var r = this._scene._getComponent(Oo.SceneComponentConstants.NAME_LENSFLARESYSTEM);
                        r || (r = new Oo.LensFlareSystemSceneComponent(this._scene), i._addComponent(r)), this._emitter = t, this.id = e, i.lensFlareSystems.push(this), this.meshesSelectionPredicate = function(e) {
                            return i.activeCamera && e.material && e.isVisible && e.isEnabled() && e.isBlocker && 0 != (e.layerMask & i.activeCamera.layerMask)
                        };
                        var n = i.getEngine(),
                            o = [];
                        o.push(1, 1), o.push(-1, 1), o.push(-1, -1), o.push(1, -1), this._vertexBuffers[Oo.VertexBuffer.PositionKind] = new Oo.VertexBuffer(n, o, Oo.VertexBuffer.PositionKind, !1, !1, 2);
                        var s = [];
                        s.push(0), s.push(1), s.push(2), s.push(0), s.push(2), s.push(3), this._indexBuffer = n.createIndexBuffer(s), this._effect = n.createEffect("lensFlare", [Oo.VertexBuffer.PositionKind], ["color", "viewportMatrix"], ["textureSampler"], "")
                    }
                    return Object.defineProperty(e.prototype, "isEnabled", {
                        get: function() {
                            return this._isEnabled
                        },
                        set: function(e) {
                            this._isEnabled = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getScene = function() {
                        return this._scene
                    }, e.prototype.getEmitter = function() {
                        return this._emitter
                    }, e.prototype.setEmitter = function(e) {
                        this._emitter = e
                    }, e.prototype.getEmitterPosition = function() {
                        return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position
                    }, e.prototype.computeEffectivePosition = function(e) {
                        var t = this.getEmitterPosition();
                        return t = Oo.Vector3.Project(t, Oo.Matrix.Identity(), this._scene.getTransformMatrix(), e), this._positionX = t.x, this._positionY = t.y, t = Oo.Vector3.TransformCoordinates(this.getEmitterPosition(), this._scene.getViewMatrix()), 0 < this.viewportBorder && (e.x -= this.viewportBorder, e.y -= this.viewportBorder, e.width += 2 * this.viewportBorder, e.height += 2 * this.viewportBorder, t.x += this.viewportBorder, t.y += this.viewportBorder, this._positionX += this.viewportBorder, this._positionY += this.viewportBorder), 0 < t.z && (this._positionX > e.x && this._positionX < e.x + e.width && this._positionY > e.y && (this._positionY, e.y, e.height), !0)
                    }, e.prototype._isVisible = function() {
                        if (!this._isEnabled || !this._scene.activeCamera) return !1;
                        var e = this.getEmitterPosition().subtract(this._scene.activeCamera.globalPosition),
                            t = e.length();
                        e.normalize();
                        var i = new Oo.Ray(this._scene.activeCamera.globalPosition, e),
                            r = this._scene.pickWithRay(i, this.meshesSelectionPredicate, !0);
                        return !r || !r.hit || r.distance > t
                    }, e.prototype.render = function() {
                        if (!this._effect.isReady() || !this._scene.activeCamera) return !1;
                        var e, t, i = this._scene.getEngine(),
                            r = this._scene.activeCamera.viewport.toGlobal(i.getRenderWidth(!0), i.getRenderHeight(!0));
                        if (!this.computeEffectivePosition(r)) return !1;
                        if (!this._isVisible()) return !1;
                        e = this._positionX < this.borderLimit + r.x ? this.borderLimit + r.x - this._positionX : this._positionX > r.x + r.width - this.borderLimit ? this._positionX - r.x - r.width + this.borderLimit : 0;
                        var n = (t = this._positionY < this.borderLimit + r.y ? this.borderLimit + r.y - this._positionY : this._positionY > r.y + r.height - this.borderLimit ? this._positionY - r.y - r.height + this.borderLimit : 0) < e ? e : t;
                        (n -= this.viewportBorder) > this.borderLimit && (n = this.borderLimit);
                        var o = 1 - Oo.Scalar.Clamp(n / this.borderLimit, 0, 1);
                        if (o < 0) return !1;
                        1 < o && (o = 1), 0 < this.viewportBorder && (r.x += this.viewportBorder, r.y += this.viewportBorder, r.width -= 2 * this.viewportBorder, r.height -= 2 * this.viewportBorder, this._positionX -= this.viewportBorder, this._positionY -= this.viewportBorder);
                        var s = r.x + r.width / 2,
                            a = r.y + r.height / 2,
                            l = s - this._positionX,
                            u = a - this._positionY;
                        i.enableEffect(this._effect), i.setState(!1), i.setDepthBuffer(!1), i.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect);
                        for (var c = 0; c < this.lensFlares.length; c++) {
                            var h = this.lensFlares[c];
                            i.setAlphaMode(h.alphaMode);
                            var d = s - l * h.position,
                                p = a - u * h.position,
                                f = h.size,
                                _ = h.size * i.getAspectRatio(this._scene.activeCamera, !0),
                                m = d / (r.width + 2 * r.x) * 2 - 1,
                                g = 1 - p / (r.height + 2 * r.y) * 2,
                                v = Oo.Matrix.FromValues(f / 2, 0, 0, 0, 0, _ / 2, 0, 0, 0, 0, 1, 0, m, g, 0, 1);
                            this._effect.setMatrix("viewportMatrix", v), this._effect.setTexture("textureSampler", h.texture), this._effect.setFloat4("color", h.color.r * o, h.color.g * o, h.color.b * o, 1), i.drawElementsType(Oo.Material.TriangleFillMode, 0, 6)
                        }
                        return i.setDepthBuffer(!0), i.setAlphaMode(Oo.Engine.ALPHA_DISABLE), !0
                    }, e.prototype.dispose = function() {
                        var e = this._vertexBuffers[Oo.VertexBuffer.PositionKind];
                        for (e && (e.dispose(), this._vertexBuffers[Oo.VertexBuffer.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null); this.lensFlares.length;) this.lensFlares[0].dispose();
                        var t = this._scene.lensFlareSystems.indexOf(this);
                        this._scene.lensFlareSystems.splice(t, 1)
                    }, e.Parse = function(t, i, r) {
                        var n = i.getLastEntryByID(t.emitterId),
                            o = t.name || "lensFlareSystem#" + t.emitterId,
                            s = new e(o, n, i);
                        s.id = t.id || o, s.borderLimit = t.borderLimit;
                        for (var a = 0; a < t.flares.length; a++) {
                            var l = t.flares[a];
                            Oo.LensFlare.AddFlare(l.size, l.position, Oo.Color3.FromArray(l.color), l.textureName ? r + l.textureName : "", s)
                        }
                        return s
                    }, e.prototype.serialize = function() {
                        var e = {};
                        e.id = this.id, e.name = this.name, e.emitterId = this.getEmitter().id, e.borderLimit = this.borderLimit, e.flares = [];
                        for (var t = 0; t < this.lensFlares.length; t++) {
                            var i = this.lensFlares[t];
                            e.flares.push({
                                size: i.size,
                                position: i.position,
                                color: i.color.asArray(),
                                textureName: Oo.Tools.GetFilename(i.texture ? i.texture.name : "")
                            })
                        }
                        return e
                    }, e
                }(), Oo.LensFlareSystem = wo,
                function(e) {
                    var t = function() {
                            function e(e, t) {
                                this.type = e, (this.jointData = t).nativeParams = t.nativeParams || {}
                            }
                            return Object.defineProperty(e.prototype, "physicsJoint", {
                                get: function() {
                                    return this._physicsJoint
                                },
                                set: function(e) {
                                    this._physicsJoint, this._physicsJoint = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(e.prototype, "physicsPlugin", {
                                set: function(e) {
                                    this._physicsPlugin = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), e.prototype.executeNativeFunction = function(e) {
                                e(this._physicsPlugin.world, this._physicsJoint)
                            }, e.DistanceJoint = 0, e.HingeJoint = 1, e.BallAndSocketJoint = 2, e.WheelJoint = 3, e.SliderJoint = 4, e.PrismaticJoint = 5, e.UniversalJoint = 6, e.Hinge2Joint = e.WheelJoint, e.PointToPointJoint = 8, e.SpringJoint = 9, e.LockJoint = 10, e
                        }(),
                        i = function(e) {
                            function i(i) {
                                return e.call(this, t.DistanceJoint, i) || this
                            }
                            return b(i, e), i.prototype.updateDistance = function(e, t) {
                                this._physicsPlugin.updateDistanceJoint(this, e, t)
                            }, i
                        }(e.PhysicsJoint = t);
                    e.DistanceJoint = i;
                    var r = function(e) {
                            function t(t, i) {
                                return e.call(this, t, i) || this
                            }
                            return b(t, e), t.prototype.setMotor = function(e, t) {
                                this._physicsPlugin.setMotor(this, e || 0, t)
                            }, t.prototype.setLimit = function(e, t) {
                                this._physicsPlugin.setLimit(this, e, t)
                            }, t
                        }(t),
                        n = function(e) {
                            function i(i) {
                                return e.call(this, t.HingeJoint, i) || this
                            }
                            return b(i, e), i.prototype.setMotor = function(e, t) {
                                this._physicsPlugin.setMotor(this, e || 0, t)
                            }, i.prototype.setLimit = function(e, t) {
                                this._physicsPlugin.setLimit(this, e, t)
                            }, i
                        }(e.MotorEnabledJoint = r);
                    e.HingeJoint = n;
                    var o = function(e) {
                        function i(i) {
                            return e.call(this, t.Hinge2Joint, i) || this
                        }
                        return b(i, e), i.prototype.setMotor = function(e, t, i) {
                            void 0 === i && (i = 0), this._physicsPlugin.setMotor(this, e || 0, t, i)
                        }, i.prototype.setLimit = function(e, t, i) {
                            void 0 === i && (i = 0), this._physicsPlugin.setLimit(this, e, t, i)
                        }, i
                    }(r);
                    e.Hinge2Joint = o
                }($a || ($a = {})), Io = $a || ($a = {}), Do = function() {
                    function e(e, t, i, r) {
                        void 0 === i && (i = {
                            mass: 0
                        });
                        var n = this;
                        this.object = e, this.type = t, this._options = i, this._scene = r, this._bodyUpdateRequired = !1, this._onBeforePhysicsStepCallbacks = new Array, this._onAfterPhysicsStepCallbacks = new Array, this._onPhysicsCollideCallbacks = [], this._deltaPosition = Io.Vector3.Zero(), this._isDisposed = !1, this._tmpQuat = new Io.Quaternion, this._tmpQuat2 = new Io.Quaternion, this.beforeStep = function() {
                            n._physicsEngine && (n.object.translate(n._deltaPosition, -1), n._deltaRotationConjugated && n.object.rotationQuaternion && n.object.rotationQuaternion.multiplyToRef(n._deltaRotationConjugated, n.object.rotationQuaternion), n.object.computeWorldMatrix(!1), n.object.parent && n.object.rotationQuaternion ? (n.getParentsRotation(), n._tmpQuat.multiplyToRef(n.object.rotationQuaternion, n._tmpQuat)) : n._tmpQuat.copyFrom(n.object.rotationQuaternion || new Io.Quaternion), n._options.disableBidirectionalTransformation || n.object.rotationQuaternion && n._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(n, n.object.getAbsolutePivotPoint(), n._tmpQuat), n._onBeforePhysicsStepCallbacks.forEach(function(e) {
                                e(n)
                            }))
                        }, this.afterStep = function() {
                            n._physicsEngine && (n._onAfterPhysicsStepCallbacks.forEach(function(e) {
                                e(n)
                            }), n._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(n), n.object.parent && n.object.rotationQuaternion && (n.getParentsRotation(), n._tmpQuat.conjugateInPlace(), n._tmpQuat.multiplyToRef(n.object.rotationQuaternion, n.object.rotationQuaternion)), n.object.setAbsolutePosition(n.object.position), n._deltaRotation && n.object.rotationQuaternion && n.object.rotationQuaternion.multiplyToRef(n._deltaRotation, n.object.rotationQuaternion), n.object.translate(n._deltaPosition, 1))
                        }, this.onCollideEvent = null, this.onCollide = function(e) {
                            if ((n._onPhysicsCollideCallbacks.length || n.onCollideEvent) && n._physicsEngine) {
                                var t = n._physicsEngine.getImpostorWithPhysicsBody(e.body);
                                t && (n.onCollideEvent && n.onCollideEvent(n, t), n._onPhysicsCollideCallbacks.filter(function(e) {
                                    return -1 !== e.otherImpostors.indexOf(t)
                                }).forEach(function(e) {
                                    e.callback(n, t)
                                }))
                            }
                        }, this.object ? (!this._scene && e.getScene && (this._scene = e.getScene()), this._scene && (this._physicsEngine = this._scene.getPhysicsEngine(), this._physicsEngine ? (this.object.rotationQuaternion || (this.object.rotation ? this.object.rotationQuaternion = Io.Quaternion.RotationYawPitchRoll(this.object.rotation.y, this.object.rotation.x, this.object.rotation.z) : this.object.rotationQuaternion = new Io.Quaternion), this._options.mass = void 0 === i.mass ? 0 : i.mass, this._options.friction = void 0 === i.friction ? .2 : i.friction, this._options.restitution = void 0 === i.restitution ? .2 : i.restitution, this._joints = [], !this.object.parent || this._options.ignoreParent ? this._init() : this.object.parent.physicsImpostor && Io.Tools.Warn("You must affect impostors to children before affecting impostor to parent.")) : Io.Tools.Error("Physics not enabled. Please use scene.enablePhysics(...) before creating impostors."))) : Io.Tools.Error("No object was provided. A physics object is obligatory")
                    }
                    return Object.defineProperty(e.prototype, "isDisposed", {
                        get: function() {
                            return this._isDisposed
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "mass", {
                        get: function() {
                            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyMass(this) : 0
                        },
                        set: function(e) {
                            this.setMass(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "friction", {
                        get: function() {
                            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyFriction(this) : 0
                        },
                        set: function(e) {
                            this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyFriction(this, e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "restitution", {
                        get: function() {
                            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this) : 0
                        },
                        set: function(e) {
                            this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this, e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._init = function() {
                        this._physicsEngine && (this._physicsEngine.removeImpostor(this), this.physicsBody = null, this._parent = this._parent || this._getPhysicsParent(), this._isDisposed || this.parent && !this._options.ignoreParent || this._physicsEngine.addImpostor(this))
                    }, e.prototype._getPhysicsParent = function() {
                        return this.object.parent instanceof Io.AbstractMesh ? this.object.parent.physicsImpostor : null
                    }, e.prototype.isBodyInitRequired = function() {
                        return this._bodyUpdateRequired || !this._physicsBody && !this._parent
                    }, e.prototype.setScalingUpdated = function(e) {
                        this.forceUpdate()
                    }, e.prototype.forceUpdate = function() {
                        this._init(), this.parent && !this._options.ignoreParent && this.parent.forceUpdate()
                    }, Object.defineProperty(e.prototype, "physicsBody", {
                        get: function() {
                            return this._parent && !this._options.ignoreParent ? this._parent.physicsBody : this._physicsBody
                        },
                        set: function(e) {
                            this._physicsBody && this._physicsEngine && this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this), this._physicsBody = e, this.resetUpdateFlags()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "parent", {
                        get: function() {
                            return !this._options.ignoreParent && this._parent ? this._parent : null
                        },
                        set: function(e) {
                            this._parent = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.resetUpdateFlags = function() {
                        this._bodyUpdateRequired = !1
                    }, e.prototype.getObjectExtendSize = function() {
                        if (this.object.getBoundingInfo) {
                            var t = this.object.rotationQuaternion;
                            this.object.rotationQuaternion = e.IDENTITY_QUATERNION, this.object.computeWorldMatrix && this.object.computeWorldMatrix(!0);
                            var i = this.object.getBoundingInfo().boundingBox.extendSizeWorld.scale(2);
                            return this.object.rotationQuaternion = t, this.object.computeWorldMatrix && this.object.computeWorldMatrix(!0), i
                        }
                        return e.DEFAULT_OBJECT_SIZE
                    }, e.prototype.getObjectCenter = function() {
                        return this.object.getBoundingInfo ? this.object.getBoundingInfo().boundingBox.centerWorld : this.object.position
                    }, e.prototype.getParam = function(e) {
                        return this._options[e]
                    }, e.prototype.setParam = function(e, t) {
                        this._options[e] = t, this._bodyUpdateRequired = !0
                    }, e.prototype.setMass = function(e) {
                        this.getParam("mass") !== e && this.setParam("mass", e), this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyMass(this, e)
                    }, e.prototype.getLinearVelocity = function() {
                        return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this) : Io.Vector3.Zero()
                    }, e.prototype.setLinearVelocity = function(e) {
                        this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this, e)
                    }, e.prototype.getAngularVelocity = function() {
                        return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this) : Io.Vector3.Zero()
                    }, e.prototype.setAngularVelocity = function(e) {
                        this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this, e)
                    }, e.prototype.executeNativeFunction = function(e) {
                        this._physicsEngine && e(this._physicsEngine.getPhysicsPlugin().world, this.physicsBody)
                    }, e.prototype.registerBeforePhysicsStep = function(e) {
                        this._onBeforePhysicsStepCallbacks.push(e)
                    }, e.prototype.unregisterBeforePhysicsStep = function(e) {
                        var t = this._onBeforePhysicsStepCallbacks.indexOf(e); - 1 < t ? this._onBeforePhysicsStepCallbacks.splice(t, 1) : Io.Tools.Warn("Function to remove was not found")
                    }, e.prototype.registerAfterPhysicsStep = function(e) {
                        this._onAfterPhysicsStepCallbacks.push(e)
                    }, e.prototype.unregisterAfterPhysicsStep = function(e) {
                        var t = this._onAfterPhysicsStepCallbacks.indexOf(e); - 1 < t ? this._onAfterPhysicsStepCallbacks.splice(t, 1) : Io.Tools.Warn("Function to remove was not found")
                    }, e.prototype.registerOnPhysicsCollide = function(e, t) {
                        var i = e instanceof Array ? e : [e];
                        this._onPhysicsCollideCallbacks.push({
                            callback: t,
                            otherImpostors: i
                        })
                    }, e.prototype.unregisterOnPhysicsCollide = function(e, t) {
                        var i = e instanceof Array ? e : [e],
                            r = -1;
                        this._onPhysicsCollideCallbacks.some(function(e, n) {
                            if (e.callback === t && e.otherImpostors.length === i.length) {
                                var o = e.otherImpostors.every(function(e) {
                                    return -1 < i.indexOf(e)
                                });
                                return o && (r = n), o
                            }
                            return !1
                        }) ? this._onPhysicsCollideCallbacks.splice(r, 1) : Io.Tools.Warn("Function to remove was not found")
                    }, e.prototype.getParentsRotation = function() {
                        var e = this.object.parent;
                        for (this._tmpQuat.copyFromFloats(0, 0, 0, 1); e;) e.rotationQuaternion ? this._tmpQuat2.copyFrom(e.rotationQuaternion) : Io.Quaternion.RotationYawPitchRollToRef(e.rotation.y, e.rotation.x, e.rotation.z, this._tmpQuat2), this._tmpQuat.multiplyToRef(this._tmpQuat2, this._tmpQuat), e = e.parent;
                        return this._tmpQuat
                    }, e.prototype.applyForce = function(e, t) {
                        return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().applyForce(this, e, t), this
                    }, e.prototype.applyImpulse = function(e, t) {
                        return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().applyImpulse(this, e, t), this
                    }, e.prototype.createJoint = function(e, t, i) {
                        var r = new Io.PhysicsJoint(t, i);
                        return this.addJoint(e, r), this
                    }, e.prototype.addJoint = function(e, t) {
                        return this._joints.push({
                            otherImpostor: e,
                            joint: t
                        }), this._physicsEngine && this._physicsEngine.addJoint(this, e, t), this
                    }, e.prototype.sleep = function() {
                        return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().sleepBody(this), this
                    }, e.prototype.wakeUp = function() {
                        return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().wakeUpBody(this), this
                    }, e.prototype.clone = function(t) {
                        return t ? new e(t, this.type, this._options, this._scene) : null
                    }, e.prototype.dispose = function() {
                        var e = this;
                        this._physicsEngine && (this._joints.forEach(function(t) {
                            e._physicsEngine && e._physicsEngine.removeJoint(e, t.otherImpostor, t.joint)
                        }), this._physicsEngine.removeImpostor(this), this.parent && this.parent.forceUpdate(), this._isDisposed = !0)
                    }, e.prototype.setDeltaPosition = function(e) {
                        this._deltaPosition.copyFrom(e)
                    }, e.prototype.setDeltaRotation = function(e) {
                        this._deltaRotation || (this._deltaRotation = new Io.Quaternion), this._deltaRotation.copyFrom(e), this._deltaRotationConjugated = this._deltaRotation.conjugate()
                    }, e.prototype.getBoxSizeToRef = function(e) {
                        return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this, e), this
                    }, e.prototype.getRadius = function() {
                        return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getRadius(this) : 0
                    }, e.prototype.syncBoneWithImpostor = function(t, i, r, n, o) {
                        var s = e._tmpVecs[0],
                            a = this.object;
                        if (a.rotationQuaternion)
                            if (o) {
                                var l = e._tmpQuat;
                                a.rotationQuaternion.multiplyToRef(o, l), t.setRotationQuaternion(l, Io.Space.WORLD, i)
                            } else t.setRotationQuaternion(a.rotationQuaternion, Io.Space.WORLD, i);
                        s.x = 0, s.y = 0, s.z = 0, r && (s.x = r.x, s.y = r.y, s.z = r.z, t.getDirectionToRef(s, i, s), null == n && (n = r.length()), s.x *= n, s.y *= n, s.z *= n), t.getParent() ? (s.addInPlace(a.getAbsolutePosition()), t.setAbsolutePosition(s, i)) : (i.setAbsolutePosition(a.getAbsolutePosition()), i.position.x -= s.x, i.position.y -= s.y, i.position.z -= s.z)
                    }, e.prototype.syncImpostorWithBone = function(t, i, r, n, o, s) {
                        var a = this.object;
                        if (a.rotationQuaternion)
                            if (o) {
                                var l = e._tmpQuat;
                                t.getRotationQuaternionToRef(Io.Space.WORLD, i, l), l.multiplyToRef(o, a.rotationQuaternion)
                            } else t.getRotationQuaternionToRef(Io.Space.WORLD, i, a.rotationQuaternion);
                        var u = e._tmpVecs[0],
                            c = e._tmpVecs[1];
                        s || ((s = e._tmpVecs[2]).x = 0, s.y = 1, s.z = 0), t.getDirectionToRef(s, i, c), t.getAbsolutePositionToRef(i, u), null == n && r && (n = r.length()), null != n && (u.x += c.x * n, u.y += c.y * n, u.z += c.z * n), a.setAbsolutePosition(u)
                    }, e.DEFAULT_OBJECT_SIZE = new Io.Vector3(1, 1, 1), e.IDENTITY_QUATERNION = Io.Quaternion.Identity(), e._tmpVecs = [Io.Vector3.Zero(), Io.Vector3.Zero(), Io.Vector3.Zero()], e._tmpQuat = Io.Quaternion.Identity(), e.NoImpostor = 0, e.SphereImpostor = 1, e.BoxImpostor = 2, e.PlaneImpostor = 3, e.MeshImpostor = 4, e.CylinderImpostor = 7, e.ParticleImpostor = 8, e.HeightmapImpostor = 9, e
                }(), Io.PhysicsImpostor = Do, Lo = $a || ($a = {}), Bo = function() {
                    function e(e, t) {
                        if (void 0 === t && (t = new Lo.CannonJSPlugin), this._physicsPlugin = t, this._impostors = [], this._joints = [], !this._physicsPlugin.isSupported()) throw new Error("Physics Engine " + this._physicsPlugin.name + " cannot be found. Please make sure it is included.");
                        e = e || new Lo.Vector3(0, -9.807, 0), this.setGravity(e), this.setTimeStep()
                    }
                    return e.prototype.setGravity = function(e) {
                        this.gravity = e, this._physicsPlugin.setGravity(this.gravity)
                    }, e.prototype.setTimeStep = function(e) {
                        void 0 === e && (e = 1 / 60), this._physicsPlugin.setTimeStep(e)
                    }, e.prototype.getTimeStep = function() {
                        return this._physicsPlugin.getTimeStep()
                    }, e.prototype.dispose = function() {
                        this._impostors.forEach(function(e) {
                            e.dispose()
                        }), this._physicsPlugin.dispose()
                    }, e.prototype.getPhysicsPluginName = function() {
                        return this._physicsPlugin.name
                    }, e.prototype.addImpostor = function(e) {
                        e.uniqueId = this._impostors.push(e), e.parent || this._physicsPlugin.generatePhysicsBody(e)
                    }, e.prototype.removeImpostor = function(e) {
                        var t = this._impostors.indexOf(e);
                        if (-1 < t) {
                            var i = this._impostors.splice(t, 1);
                            i.length && (i[0].physicsBody = null)
                        }
                    }, e.prototype.addJoint = function(e, t, i) {
                        var r = {
                            mainImpostor: e,
                            connectedImpostor: t,
                            joint: i
                        };
                        i.physicsPlugin = this._physicsPlugin, this._joints.push(r), this._physicsPlugin.generateJoint(r)
                    }, e.prototype.removeJoint = function(e, t, i) {
                        var r = this._joints.filter(function(r) {
                            return r.connectedImpostor === t && r.joint === i && r.mainImpostor === e
                        });
                        r.length && this._physicsPlugin.removeJoint(r[0])
                    }, e.prototype._step = function(e) {
                        var t = this;
                        this._impostors.forEach(function(e) {
                            e.isBodyInitRequired() && t._physicsPlugin.generatePhysicsBody(e)
                        }), .1 < e ? e = .1 : e <= 0 && (e = 1 / 60), this._physicsPlugin.executeStep(e, this._impostors)
                    }, e.prototype.getPhysicsPlugin = function() {
                        return this._physicsPlugin
                    }, e.prototype.getImpostors = function() {
                        return this._impostors
                    }, e.prototype.getImpostorForPhysicsObject = function(e) {
                        for (var t = 0; t < this._impostors.length; ++t)
                            if (this._impostors[t].object === e) return this._impostors[t];
                        return null
                    }, e.prototype.getImpostorWithPhysicsBody = function(e) {
                        for (var t = 0; t < this._impostors.length; ++t)
                            if (this._impostors[t].physicsBody === e) return this._impostors[t];
                        return null
                    }, e.Epsilon = .001, e
                }(), Lo.PhysicsEngine = Bo,
                function(e) {
                    var t = function() {
                        function t(t) {
                            this._scene = t, this._physicsEngine = this._scene.getPhysicsEngine(), this._physicsEngine || e.Tools.Warn("Physics engine not enabled. Please enable the physics before you can use the methods.")
                        }
                        return t.prototype.applyRadialExplosionImpulse = function(t, r, n, s) {
                            if (void 0 === s && (s = o.Constant), !this._physicsEngine) return e.Tools.Warn("Physics engine not enabled. Please enable the physics before you call this method."), null;
                            var a = this._physicsEngine.getImpostors();
                            if (0 === a.length) return null;
                            var l = new i(this._scene);
                            return a.forEach(function(e) {
                                var i = l.getImpostorForceAndContactPoint(e, t, r, n, s);
                                i && e.applyImpulse(i.force, i.contactPoint)
                            }), l.dispose(!1), l
                        }, t.prototype.applyRadialExplosionForce = function(t, r, n, s) {
                            if (void 0 === s && (s = o.Constant), !this._physicsEngine) return e.Tools.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;
                            var a = this._physicsEngine.getImpostors();
                            if (0 === a.length) return null;
                            var l = new i(this._scene);
                            return a.forEach(function(e) {
                                var i = l.getImpostorForceAndContactPoint(e, t, r, n, s);
                                i && e.applyForce(i.force, i.contactPoint)
                            }), l.dispose(!1), l
                        }, t.prototype.gravitationalField = function(t, i, n, s) {
                            if (void 0 === s && (s = o.Constant), !this._physicsEngine) return e.Tools.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;
                            if (0 === this._physicsEngine.getImpostors().length) return null;
                            var a = new r(this, this._scene, t, i, n, s);
                            return a.dispose(!1), a
                        }, t.prototype.updraft = function(t, i, r, o, s) {
                            if (void 0 === s && (s = a.Center), !this._physicsEngine) return e.Tools.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;
                            if (0 === this._physicsEngine.getImpostors().length) return null;
                            var l = new n(this._scene, t, i, r, o, s);
                            return l.dispose(!1), l
                        }, t.prototype.vortex = function(t, i, r, n) {
                            if (!this._physicsEngine) return e.Tools.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."), null;
                            if (0 === this._physicsEngine.getImpostors().length) return null;
                            var o = new u(this._scene, t, i, r, n);
                            return o.dispose(!1), o
                        }, t
                    }();
                    e.PhysicsHelper = t;
                    var i = function() {
                        function t(e) {
                            this._sphereOptions = {
                                segments: 32,
                                diameter: 1
                            }, this._rays = [], this._dataFetched = !1, this._scene = e
                        }
                        return t.prototype.getData = function() {
                            return this._dataFetched = !0, {
                                sphere: this._sphere,
                                rays: this._rays
                            }
                        }, t.prototype.getImpostorForceAndContactPoint = function(t, i, r, n, s) {
                            if (0 === t.mass) return null;
                            if (!this._intersectsWithSphere(t, i, r)) return null;
                            if ("Mesh" !== t.object.getClassName() && "InstancedMesh" !== t.object.getClassName()) return null;
                            var a = t.getObjectCenter().subtract(i),
                                l = new e.Ray(i, a, r);
                            this._rays.push(l);
                            var u = l.intersectsMesh(t.object).pickedPoint;
                            if (!u) return null;
                            var c = e.Vector3.Distance(i, u);
                            if (r < c) return null;
                            var h = s === o.Constant ? n : n * (1 - c / r);
                            return {
                                force: a.multiplyByFloats(h, h, h),
                                contactPoint: u
                            }
                        }, t.prototype.dispose = function(e) {
                            var t = this;
                            void 0 === e && (e = !0), e ? this._sphere.dispose() : setTimeout(function() {
                                t._dataFetched || t._sphere.dispose()
                            }, 0)
                        }, t.prototype._prepareSphere = function() {
                            this._sphere || (this._sphere = e.MeshBuilder.CreateSphere("radialExplosionEventSphere", this._sphereOptions, this._scene), this._sphere.isVisible = !1)
                        }, t.prototype._intersectsWithSphere = function(t, i, r) {
                            var n = t.object;
                            return this._prepareSphere(), this._sphere.position = i, this._sphere.scaling = new e.Vector3(2 * r, 2 * r, 2 * r), this._sphere._updateBoundingInfo(), this._sphere.computeWorldMatrix(!0), this._sphere.intersectsMesh(n, !0)
                        }, t
                    }();
                    e.PhysicsRadialExplosionEvent = i;
                    var r = function() {
                        function e(e, t, i, r, n, s) {
                            void 0 === s && (s = o.Constant), this._dataFetched = !1, this._physicsHelper = e, this._scene = t, this._origin = i, this._radius = r, this._strength = n, this._falloff = s, this._tickCallback = this._tick.bind(this)
                        }
                        return e.prototype.getData = function() {
                            return this._dataFetched = !0, {
                                sphere: this._sphere
                            }
                        }, e.prototype.enable = function() {
                            this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback)
                        }, e.prototype.disable = function() {
                            this._scene.unregisterBeforeRender(this._tickCallback)
                        }, e.prototype.dispose = function(e) {
                            var t = this;
                            void 0 === e && (e = !0), e ? this._sphere.dispose() : setTimeout(function() {
                                t._dataFetched || t._sphere.dispose()
                            }, 0)
                        }, e.prototype._tick = function() {
                            if (this._sphere) this._physicsHelper.applyRadialExplosionForce(this._origin, this._radius, -1 * this._strength, this._falloff);
                            else {
                                var e = this._physicsHelper.applyRadialExplosionForce(this._origin, this._radius, -1 * this._strength, this._falloff);
                                e && (this._sphere = e.getData().sphere.clone("radialExplosionEventSphereClone"))
                            }
                        }, e
                    }();
                    e.PhysicsGravitationalFieldEvent = r;
                    var n = function() {
                        function t(t, i, r, n, o, s) {
                            this._scene = t, this._origin = i, this._radius = r, this._strength = n, this._height = o, this._updraftMode = s, this._originTop = e.Vector3.Zero(), this._originDirection = e.Vector3.Zero(), this._cylinderPosition = e.Vector3.Zero(), this._dataFetched = !1, this._physicsEngine = this._scene.getPhysicsEngine(), this._origin.addToRef(new e.Vector3(0, this._height / 2, 0), this._cylinderPosition), this._origin.addToRef(new e.Vector3(0, this._height, 0), this._originTop), this._updraftMode === a.Perpendicular && (this._originDirection = this._origin.subtract(this._originTop).normalize()), this._tickCallback = this._tick.bind(this)
                        }
                        return t.prototype.getData = function() {
                            return this._dataFetched = !0, {
                                cylinder: this._cylinder
                            }
                        }, t.prototype.enable = function() {
                            this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback)
                        }, t.prototype.disable = function() {
                            this._scene.unregisterBeforeRender(this._tickCallback)
                        }, t.prototype.dispose = function(e) {
                            var t = this;
                            void 0 === e && (e = !0), e ? this._cylinder.dispose() : setTimeout(function() {
                                t._dataFetched || t._cylinder.dispose()
                            }, 0)
                        }, t.prototype.getImpostorForceAndContactPoint = function(e) {
                            if (0 === e.mass) return null;
                            if (!this._intersectsWithCylinder(e)) return null;
                            var t = e.getObjectCenter();
                            if (this._updraftMode === a.Perpendicular) var i = this._originDirection;
                            else i = t.subtract(this._originTop);
                            var r = -1 * this._strength;
                            return {
                                force: i.multiplyByFloats(r, r, r),
                                contactPoint: t
                            }
                        }, t.prototype._tick = function() {
                            var e = this;
                            this._physicsEngine.getImpostors().forEach(function(t) {
                                var i = e.getImpostorForceAndContactPoint(t);
                                i && t.applyForce(i.force, i.contactPoint)
                            })
                        }, t.prototype._prepareCylinder = function() {
                            this._cylinder || (this._cylinder = e.MeshBuilder.CreateCylinder("updraftEventCylinder", {
                                height: this._height,
                                diameter: 2 * this._radius
                            }, this._scene), this._cylinder.isVisible = !1)
                        }, t.prototype._intersectsWithCylinder = function(e) {
                            var t = e.object;
                            return this._prepareCylinder(), this._cylinder.position = this._cylinderPosition, this._cylinder.intersectsMesh(t, !0)
                        }, t
                    }();
                    e.PhysicsUpdraftEvent = n;
                    var o, s, a, l, u = function() {
                        function t(t, i, r, n, o) {
                            this._scene = t, this._origin = i, this._radius = r, this._strength = n, this._height = o, this._originTop = e.Vector3.Zero(), this._centripetalForceThreshold = .7, this._updraftMultiplier = .02, this._cylinderPosition = e.Vector3.Zero(), this._dataFetched = !1, this._physicsEngine = this._scene.getPhysicsEngine(), this._origin.addToRef(new e.Vector3(0, this._height / 2, 0), this._cylinderPosition), this._origin.addToRef(new e.Vector3(0, this._height, 0), this._originTop), this._tickCallback = this._tick.bind(this)
                        }
                        return t.prototype.getData = function() {
                            return this._dataFetched = !0, {
                                cylinder: this._cylinder
                            }
                        }, t.prototype.enable = function() {
                            this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback)
                        }, t.prototype.disable = function() {
                            this._scene.unregisterBeforeRender(this._tickCallback)
                        }, t.prototype.dispose = function(e) {
                            var t = this;
                            void 0 === e && (e = !0), e ? this._cylinder.dispose() : setTimeout(function() {
                                t._dataFetched || t._cylinder.dispose()
                            }, 0)
                        }, t.prototype.getImpostorForceAndContactPoint = function(t) {
                            if (0 === t.mass) return null;
                            if (!this._intersectsWithCylinder(t)) return null;
                            if ("Mesh" !== t.object.getClassName() && "InstancedMesh" !== t.object.getClassName()) return null;
                            var i = t.getObjectCenter(),
                                r = new e.Vector3(this._origin.x, i.y, this._origin.z),
                                n = i.subtract(r),
                                o = new e.Ray(r, n, this._radius).intersectsMesh(t.object),
                                s = o.pickedPoint;
                            if (!s) return null;
                            var a = o.distance / this._radius,
                                l = e.Vector3.Cross(r, i).normalize(),
                                u = s.normalize();
                            if (a > this._centripetalForceThreshold && (u = u.negate()), a > this._centripetalForceThreshold) var c = u.x * this._strength / 8,
                                h = u.y * this._updraftMultiplier,
                                d = u.z * this._strength / 8;
                            else c = (l.x + u.x) / 2, h = this._originTop.y * this._updraftMultiplier, d = (l.z + u.z) / 2;
                            var p = new e.Vector3(c, h, d);
                            return {
                                force: p = p.multiplyByFloats(this._strength, this._strength, this._strength),
                                contactPoint: i
                            }
                        }, t.prototype._tick = function() {
                            var e = this;
                            this._physicsEngine.getImpostors().forEach(function(t) {
                                var i = e.getImpostorForceAndContactPoint(t);
                                i && t.applyForce(i.force, i.contactPoint)
                            })
                        }, t.prototype._prepareCylinder = function() {
                            this._cylinder || (this._cylinder = e.MeshBuilder.CreateCylinder("vortexEventCylinder", {
                                height: this._height,
                                diameter: 2 * this._radius
                            }, this._scene), this._cylinder.isVisible = !1)
                        }, t.prototype._intersectsWithCylinder = function(e) {
                            var t = e.object;
                            return this._prepareCylinder(), this._cylinder.position = this._cylinderPosition, this._cylinder.intersectsMesh(t, !0)
                        }, t
                    }();
                    e.PhysicsVortexEvent = u, (s = o = e.PhysicsRadialImpulseFalloff || (e.PhysicsRadialImpulseFalloff = {}))[s.Constant = 0] = "Constant", s[s.Linear = 1] = "Linear", (l = a = e.PhysicsUpdraftMode || (e.PhysicsUpdraftMode = {}))[l.Center = 0] = "Center", l[l.Perpendicular = 1] = "Perpendicular"
                }($a || ($a = {})), Fo = $a || ($a = {}), No = function() {
                    function t(t, i) {
                        void 0 === t && (t = !0), void 0 === i && (i = 10), this._useDeltaForWorldStep = t, this.name = "CannonJSPlugin", this._physicsMaterials = new Array, this._fixedTimeStep = 1 / 60, this.BJSCANNON = e, this._minus90X = new Fo.Quaternion(-.7071067811865475, 0, 0, .7071067811865475), this._plus90X = new Fo.Quaternion(.7071067811865475, 0, 0, .7071067811865475), this._tmpPosition = Fo.Vector3.Zero(), this._tmpDeltaPosition = Fo.Vector3.Zero(), this._tmpUnityRotation = new Fo.Quaternion, this.isSupported() ? (this._extendNamespace(), this.world = new this.BJSCANNON.World, this.world.broadphase = new this.BJSCANNON.NaiveBroadphase, this.world.solver.iterations = i) : Fo.Tools.Error("CannonJS is not available. Please make sure you included the js file.")
                    }
                    return t.prototype.setGravity = function(e) {
                        this.world.gravity.copy(e)
                    }, t.prototype.setTimeStep = function(e) {
                        this._fixedTimeStep = e
                    }, t.prototype.getTimeStep = function() {
                        return this._fixedTimeStep
                    }, t.prototype.executeStep = function(e, t) {
                        this.world.step(this._fixedTimeStep, this._useDeltaForWorldStep ? e : 0, 3)
                    }, t.prototype.applyImpulse = function(e, t, i) {
                        var r = new this.BJSCANNON.Vec3(i.x, i.y, i.z),
                            n = new this.BJSCANNON.Vec3(t.x, t.y, t.z);
                        e.physicsBody.applyImpulse(n, r)
                    }, t.prototype.applyForce = function(e, t, i) {
                        var r = new this.BJSCANNON.Vec3(i.x, i.y, i.z),
                            n = new this.BJSCANNON.Vec3(t.x, t.y, t.z);
                        e.physicsBody.applyForce(n, r)
                    }, t.prototype.generatePhysicsBody = function(e) {
                        if (e.parent) e.physicsBody && (this.removePhysicsBody(e), e.forceUpdate());
                        else {
                            if (e.isBodyInitRequired()) {
                                var t = this._createShape(e),
                                    i = e.physicsBody;
                                i && this.removePhysicsBody(e);
                                var r = this._addMaterial("mat-" + e.uniqueId, e.getParam("friction"), e.getParam("restitution")),
                                    n = {
                                        mass: e.getParam("mass"),
                                        material: r
                                    },
                                    o = e.getParam("nativeOptions");
                                for (var s in o) o.hasOwnProperty(s) && (n[s] = o[s]);
                                e.physicsBody = new this.BJSCANNON.Body(n), e.physicsBody.addEventListener("collide", e.onCollide), this.world.addEventListener("preStep", e.beforeStep), this.world.addEventListener("postStep", e.afterStep), e.physicsBody.addShape(t), this.world.add(e.physicsBody), i && ["force", "torque", "velocity", "angularVelocity"].forEach(function(t) {
                                    e.physicsBody[t].copy(i[t])
                                }), this._processChildMeshes(e)
                            }
                            this._updatePhysicsBodyTransformation(e)
                        }
                    }, t.prototype._processChildMeshes = function(e) {
                        var t = this,
                            i = e.object.getChildMeshes ? e.object.getChildMeshes(!0) : [],
                            r = e.object.rotationQuaternion;
                        if (i.length) {
                            var n = function(i, o) {
                                if (r && o.rotationQuaternion) {
                                    var s = o.getPhysicsImpostor();
                                    if (s && s.parent !== e) {
                                        var a = o.getAbsolutePosition().subtract(e.object.getAbsolutePosition()),
                                            l = o.rotationQuaternion.multiply(Fo.Quaternion.Inverse(r));
                                        s.physicsBody && (t.removePhysicsBody(s), s.physicsBody = null), s.parent = e, s.resetUpdateFlags(), e.physicsBody.addShape(t._createShape(s), new t.BJSCANNON.Vec3(a.x, a.y, a.z), new t.BJSCANNON.Quaternion(l.x, l.y, l.z, l.w)), e.physicsBody.mass += s.getParam("mass")
                                    }
                                    r.multiplyInPlace(o.rotationQuaternion), o.getChildMeshes(!0).filter(function(e) {
                                        return !!e.physicsImpostor
                                    }).forEach(n.bind(t, o.getAbsolutePosition()))
                                }
                            };
                            i.filter(function(e) {
                                return !!e.physicsImpostor
                            }).forEach(n.bind(this, e.object.getAbsolutePosition()))
                        }
                    }, t.prototype.removePhysicsBody = function(e) {
                        e.physicsBody.removeEventListener("collide", e.onCollide), this.world.removeEventListener("preStep", e.beforeStep), this.world.removeEventListener("postStep", e.afterStep), this.world.remove(e.physicsBody)
                    }, t.prototype.generateJoint = function(e) {
                        var t = e.mainImpostor.physicsBody,
                            i = e.connectedImpostor.physicsBody;
                        if (t && i) {
                            var r, n = e.joint.jointData,
                                o = {
                                    pivotA: n.mainPivot ? (new this.BJSCANNON.Vec3).copy(n.mainPivot) : null,
                                    pivotB: n.connectedPivot ? (new this.BJSCANNON.Vec3).copy(n.connectedPivot) : null,
                                    axisA: n.mainAxis ? (new this.BJSCANNON.Vec3).copy(n.mainAxis) : null,
                                    axisB: n.connectedAxis ? (new this.BJSCANNON.Vec3).copy(n.connectedAxis) : null,
                                    maxForce: n.nativeParams.maxForce,
                                    collideConnected: !!n.collision
                                };
                            switch (e.joint.type) {
                                case Fo.PhysicsJoint.HingeJoint:
                                case Fo.PhysicsJoint.Hinge2Joint:
                                    r = new this.BJSCANNON.HingeConstraint(t, i, o);
                                    break;
                                case Fo.PhysicsJoint.DistanceJoint:
                                    r = new this.BJSCANNON.DistanceConstraint(t, i, n.maxDistance || 2);
                                    break;
                                case Fo.PhysicsJoint.SpringJoint:
                                    var s = n;
                                    r = new this.BJSCANNON.Spring(t, i, {
                                        restLength: s.length,
                                        stiffness: s.stiffness,
                                        damping: s.damping,
                                        localAnchorA: o.pivotA,
                                        localAnchorB: o.pivotB
                                    });
                                    break;
                                case Fo.PhysicsJoint.LockJoint:
                                    r = new this.BJSCANNON.LockConstraint(t, i, o);
                                    break;
                                case Fo.PhysicsJoint.PointToPointJoint:
                                case Fo.PhysicsJoint.BallAndSocketJoint:
                                default:
                                    r = new this.BJSCANNON.PointToPointConstraint(t, o.pivotA, i, o.pivotA, o.maxForce)
                            }
                            r.collideConnected = !!n.collision, e.joint.physicsJoint = r, e.joint.type !== Fo.PhysicsJoint.SpringJoint ? this.world.addConstraint(r) : (e.joint.jointData.forceApplicationCallback = e.joint.jointData.forceApplicationCallback || function() {
                                r.applyForce()
                            }, e.mainImpostor.registerAfterPhysicsStep(e.joint.jointData.forceApplicationCallback))
                        }
                    }, t.prototype.removeJoint = function(e) {
                        e.joint.type !== Fo.PhysicsJoint.SpringJoint ? this.world.removeConstraint(e.joint.physicsJoint) : e.mainImpostor.unregisterAfterPhysicsStep(e.joint.jointData.forceApplicationCallback)
                    }, t.prototype._addMaterial = function(e, t, i) {
                        var r, n;
                        for (r = 0; r < this._physicsMaterials.length; r++)
                            if ((n = this._physicsMaterials[r]).friction === t && n.restitution === i) return n;
                        var o = new this.BJSCANNON.Material(e);
                        return o.friction = t, o.restitution = i, this._physicsMaterials.push(o), o
                    }, t.prototype._checkWithEpsilon = function(e) {
                        return e < Fo.PhysicsEngine.Epsilon ? Fo.PhysicsEngine.Epsilon : e
                    }, t.prototype._createShape = function(e) {
                        var t, i = e.object,
                            r = e.getObjectExtendSize();
                        switch (e.type) {
                            case Fo.PhysicsImpostor.SphereImpostor:
                                var n = r.x,
                                    o = r.y,
                                    s = r.z;
                                t = new this.BJSCANNON.Sphere(Math.max(this._checkWithEpsilon(n), this._checkWithEpsilon(o), this._checkWithEpsilon(s)) / 2);
                                break;
                            case Fo.PhysicsImpostor.CylinderImpostor:
                                t = new this.BJSCANNON.Cylinder(this._checkWithEpsilon(r.x) / 2, this._checkWithEpsilon(r.x) / 2, this._checkWithEpsilon(r.y), 16);
                                break;
                            case Fo.PhysicsImpostor.BoxImpostor:
                                var a = r.scale(.5);
                                t = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(this._checkWithEpsilon(a.x), this._checkWithEpsilon(a.y), this._checkWithEpsilon(a.z)));
                                break;
                            case Fo.PhysicsImpostor.PlaneImpostor:
                                Fo.Tools.Warn("Attention, PlaneImposter might not behave as you expect. Consider using BoxImposter instead"), t = new this.BJSCANNON.Plane;
                                break;
                            case Fo.PhysicsImpostor.MeshImpostor:
                                var l = i.getVerticesData ? i.getVerticesData(Fo.VertexBuffer.PositionKind) : [],
                                    u = i.getIndices ? i.getIndices() : [];
                                if (!l) return;
                                var c = i.position.clone(),
                                    h = i.rotation && i.rotation.clone(),
                                    d = i.rotationQuaternion && i.rotationQuaternion.clone();
                                i.position.copyFromFloats(0, 0, 0), i.rotation && i.rotation.copyFromFloats(0, 0, 0), i.rotationQuaternion && i.rotationQuaternion.copyFrom(e.getParentsRotation()), i.rotationQuaternion && i.parent && i.rotationQuaternion.conjugateInPlace();
                                var p, f = i.computeWorldMatrix(!0),
                                    _ = new Array;
                                for (p = 0; p < l.length; p += 3) Fo.Vector3.TransformCoordinates(Fo.Vector3.FromArray(l, p), f).toArray(_, p);
                                Fo.Tools.Warn("MeshImpostor only collides against spheres."), t = new this.BJSCANNON.Trimesh(_, u), i.position.copyFrom(c), h && i.rotation && i.rotation.copyFrom(h), d && i.rotationQuaternion && i.rotationQuaternion.copyFrom(d);
                                break;
                            case Fo.PhysicsImpostor.HeightmapImpostor:
                                var m = i.position.clone(),
                                    g = i.rotation && i.rotation.clone(),
                                    v = i.rotationQuaternion && i.rotationQuaternion.clone();
                                i.position.copyFromFloats(0, 0, 0), i.rotation && i.rotation.copyFromFloats(0, 0, 0), i.rotationQuaternion && i.rotationQuaternion.copyFrom(e.getParentsRotation()), i.rotationQuaternion && i.parent && i.rotationQuaternion.conjugateInPlace(), i.rotationQuaternion && i.rotationQuaternion.multiplyInPlace(this._minus90X), t = this._createHeightmap(i), i.position.copyFrom(m), g && i.rotation && i.rotation.copyFrom(g), v && i.rotationQuaternion && i.rotationQuaternion.copyFrom(v), i.computeWorldMatrix(!0);
                                break;
                            case Fo.PhysicsImpostor.ParticleImpostor:
                                t = new this.BJSCANNON.Particle
                        }
                        return t
                    }, t.prototype._createHeightmap = function(e, t) {
                        var i, r = e.getVerticesData(Fo.VertexBuffer.PositionKind),
                            n = e.computeWorldMatrix(!0),
                            o = new Array;
                        for (i = 0; i < r.length; i += 3) Fo.Vector3.TransformCoordinates(Fo.Vector3.FromArray(r, i), n).toArray(o, i);
                        r = o;
                        for (var s = new Array, a = t || ~~(Math.sqrt(r.length / 3) - 1), l = e.getBoundingInfo(), u = Math.min(l.boundingBox.extendSizeWorld.x, l.boundingBox.extendSizeWorld.y), c = l.boundingBox.extendSizeWorld.z, h = 2 * u / a, d = 0; d < r.length; d += 3) {
                            var p = Math.round(r[d + 0] / h + a / 2),
                                f = Math.round(-1 * (r[d + 1] / h - a / 2)),
                                _ = -r[d + 2] + c;
                            s[p] || (s[p] = []), s[p][f] || (s[p][f] = _), s[p][f] = Math.max(_, s[p][f])
                        }
                        for (p = 0; p <= a; ++p) {
                            if (!s[p]) {
                                for (var m = 1; !s[(p + m) % a];) m++;
                                s[p] = s[(p + m) % a].slice()
                            }
                            for (f = 0; f <= a; ++f)
                                if (!s[p][f]) {
                                    var g;
                                    for (m = 1; void 0 === g;) g = s[p][(f + m++) % a];
                                    s[p][f] = g
                                }
                        }
                        var v = new this.BJSCANNON.Heightfield(s, {
                            elementSize: h
                        });
                        return v.minY = c, v
                    }, t.prototype._updatePhysicsBodyTransformation = function(e) {
                        var t = e.object;
                        if (t.computeWorldMatrix && t.computeWorldMatrix(!0), t.getBoundingInfo()) {
                            var i = e.getObjectCenter();
                            this._tmpDeltaPosition.copyFrom(t.getAbsolutePivotPoint().subtract(i)), this._tmpDeltaPosition.divideInPlace(e.object.scaling), this._tmpPosition.copyFrom(i);
                            var r = t.rotationQuaternion;
                            if (r) {
                                if (e.type !== Fo.PhysicsImpostor.PlaneImpostor && e.type !== Fo.PhysicsImpostor.HeightmapImpostor && e.type !== Fo.PhysicsImpostor.CylinderImpostor || (r = r.multiply(this._minus90X), e.setDeltaRotation(this._plus90X)), e.type === Fo.PhysicsImpostor.HeightmapImpostor) {
                                    var n = t,
                                        o = n.getBoundingInfo(),
                                        s = n.rotationQuaternion;
                                    n.rotationQuaternion = this._tmpUnityRotation, n.computeWorldMatrix(!0);
                                    var a = i.clone(),
                                        l = n.getPivotMatrix() || Fo.Matrix.Translation(0, 0, 0),
                                        u = Fo.Matrix.Translation(o.boundingBox.extendSizeWorld.x, 0, -o.boundingBox.extendSizeWorld.z);
                                    n.setPreTransformMatrix(u), n.computeWorldMatrix(!0);
                                    var c = o.boundingBox.centerWorld.subtract(i).subtract(n.position).negate();
                                    this._tmpPosition.copyFromFloats(c.x, c.y - o.boundingBox.extendSizeWorld.y, c.z), this._tmpDeltaPosition.copyFrom(o.boundingBox.centerWorld.subtract(a)), this._tmpDeltaPosition.y += o.boundingBox.extendSizeWorld.y, n.rotationQuaternion = s, n.setPreTransformMatrix(l), n.computeWorldMatrix(!0)
                                } else e.type === Fo.PhysicsImpostor.MeshImpostor && this._tmpDeltaPosition.copyFromFloats(0, 0, 0);
                                e.setDeltaPosition(this._tmpDeltaPosition), e.physicsBody.position.copy(this._tmpPosition), e.physicsBody.quaternion.copy(r)
                            }
                        }
                    }, t.prototype.setTransformationFromPhysicsBody = function(e) {
                        e.object.position.copyFrom(e.physicsBody.position), e.object.rotationQuaternion && e.object.rotationQuaternion.copyFrom(e.physicsBody.quaternion)
                    }, t.prototype.setPhysicsBodyTransformation = function(e, t, i) {
                        e.physicsBody.position.copy(t), e.physicsBody.quaternion.copy(i)
                    }, t.prototype.isSupported = function() {
                        return void 0 !== this.BJSCANNON
                    }, t.prototype.setLinearVelocity = function(e, t) {
                        e.physicsBody.velocity.copy(t)
                    }, t.prototype.setAngularVelocity = function(e, t) {
                        e.physicsBody.angularVelocity.copy(t)
                    }, t.prototype.getLinearVelocity = function(e) {
                        var t = e.physicsBody.velocity;
                        return t ? new Fo.Vector3(t.x, t.y, t.z) : null
                    }, t.prototype.getAngularVelocity = function(e) {
                        var t = e.physicsBody.angularVelocity;
                        return t ? new Fo.Vector3(t.x, t.y, t.z) : null
                    }, t.prototype.setBodyMass = function(e, t) {
                        e.physicsBody.mass = t, e.physicsBody.updateMassProperties()
                    }, t.prototype.getBodyMass = function(e) {
                        return e.physicsBody.mass
                    }, t.prototype.getBodyFriction = function(e) {
                        return e.physicsBody.material.friction
                    }, t.prototype.setBodyFriction = function(e, t) {
                        e.physicsBody.material.friction = t
                    }, t.prototype.getBodyRestitution = function(e) {
                        return e.physicsBody.material.restitution
                    }, t.prototype.setBodyRestitution = function(e, t) {
                        e.physicsBody.material.restitution = t
                    }, t.prototype.sleepBody = function(e) {
                        e.physicsBody.sleep()
                    }, t.prototype.wakeUpBody = function(e) {
                        e.physicsBody.wakeUp()
                    }, t.prototype.updateDistanceJoint = function(e, t, i) {
                        e.physicsJoint.distance = t
                    }, t.prototype.setMotor = function(e, t, i, r) {
                        r || (e.physicsJoint.enableMotor(), e.physicsJoint.setMotorSpeed(t), i && this.setLimit(e, i))
                    }, t.prototype.setLimit = function(e, t, i) {
                        e.physicsJoint.motorEquation.maxForce = t, e.physicsJoint.motorEquation.minForce = void 0 === i ? -t : i
                    }, t.prototype.syncMeshWithImpostor = function(e, t) {
                        var i = t.physicsBody;
                        e.position.x = i.position.x, e.position.y = i.position.y, e.position.z = i.position.z, e.rotationQuaternion && (e.rotationQuaternion.x = i.quaternion.x, e.rotationQuaternion.y = i.quaternion.y, e.rotationQuaternion.z = i.quaternion.z, e.rotationQuaternion.w = i.quaternion.w)
                    }, t.prototype.getRadius = function(e) {
                        return e.physicsBody.shapes[0].boundingSphereRadius
                    }, t.prototype.getBoxSizeToRef = function(e, t) {
                        var i = e.physicsBody.shapes[0];
                        t.x = 2 * i.halfExtents.x, t.y = 2 * i.halfExtents.y, t.z = 2 * i.halfExtents.z
                    }, t.prototype.dispose = function() {}, t.prototype._extendNamespace = function() {
                        var e = new this.BJSCANNON.Vec3,
                            t = this.BJSCANNON;
                        this.BJSCANNON.World.prototype.step = function(i, r, n) {
                            if (n = n || 10, 0 === (r = r || 0)) this.internalStep(i), this.time += i;
                            else {
                                var o = Math.floor((this.time + r) / i) - Math.floor(this.time / i);
                                o = Math.min(o, n) || 1;
                                for (var s = performance.now(), a = 0; a !== o && (this.internalStep(i), !(performance.now() - s > 1e3 * i)); a++);
                                this.time += r;
                                for (var l = this.time % i / i, u = e, c = this.bodies, h = 0; h !== c.length; h++) {
                                    var d = c[h];
                                    d.type !== t.Body.STATIC && d.sleepState !== t.Body.SLEEPING ? (d.position.vsub(d.previousPosition, u), u.scale(l, u), d.position.vadd(u, d.interpolatedPosition)) : (d.interpolatedPosition.copy(d.position), d.interpolatedQuaternion.copy(d.quaternion))
                                }
                            }
                        }
                    }, t
                }(), Fo.CannonJSPlugin = No, Vo = $a || ($a = {}), ko = function() {
                    function e(e) {
                        this.name = "OimoJSPlugin", this._tmpImpostorsArray = [], this._tmpPositionVector = Vo.Vector3.Zero(), this.BJSOIMO = t, this.world = new this.BJSOIMO.World({
                            iterations: e
                        }), this.world.clear()
                    }
                    return e.prototype.setGravity = function(e) {
                        this.world.gravity.copy(e)
                    }, e.prototype.setTimeStep = function(e) {
                        this.world.timeStep = e
                    }, e.prototype.getTimeStep = function() {
                        return this.world.timeStep
                    }, e.prototype.executeStep = function(e, t) {
                        var i = this;
                        t.forEach(function(e) {
                            e.beforeStep()
                        }), this.world.step(), t.forEach(function(e) {
                            e.afterStep(), i._tmpImpostorsArray[e.uniqueId] = e
                        });
                        for (var r = this.world.contacts; null !== r;)
                            if (!r.touching || r.body1.sleeping || r.body2.sleeping) {
                                var n = this._tmpImpostorsArray[+r.body1.name],
                                    o = this._tmpImpostorsArray[+r.body2.name];
                                n && o && (n.onCollide({
                                    body: o.physicsBody
                                }), o.onCollide({
                                    body: n.physicsBody
                                })), r = r.next
                            } else r = r.next
                    }, e.prototype.applyImpulse = function(e, t, i) {
                        var r = e.physicsBody.mass;
                        e.physicsBody.applyImpulse(i.scale(this.world.invScale), t.scale(this.world.invScale * r))
                    }, e.prototype.applyForce = function(e, t, i) {
                        Vo.Tools.Warn("Oimo doesn't support applying force. Using impule instead."), this.applyImpulse(e, t, i)
                    }, e.prototype.generatePhysicsBody = function(e) {
                        var t = this;
                        if (e.parent) e.physicsBody && (this.removePhysicsBody(e), e.forceUpdate());
                        else {
                            if (e.isBodyInitRequired()) {
                                var i = {
                                        name: e.uniqueId,
                                        config: [e.getParam("mass") || 1, e.getParam("friction"), e.getParam("restitution")],
                                        size: [],
                                        type: [],
                                        pos: [],
                                        posShape: [],
                                        rot: [],
                                        rotShape: [],
                                        move: 0 !== e.getParam("mass"),
                                        density: e.getParam("mass"),
                                        friction: e.getParam("friction"),
                                        restitution: e.getParam("restitution"),
                                        world: this.world
                                    },
                                    r = [e];
                                (s = e.object).getChildMeshes && s.getChildMeshes().forEach(function(e) {
                                    e.physicsImpostor && r.push(e.physicsImpostor)
                                });
                                var n = function(e) {
                                        return Math.max(e, Vo.PhysicsEngine.Epsilon)
                                    },
                                    o = new Vo.Quaternion;
                                r.forEach(function(r) {
                                    if (r.object.rotationQuaternion) {
                                        var s = r.object.rotationQuaternion;
                                        o = s.clone();
                                        var a = s.toEulerAngles(),
                                            l = r.getObjectExtendSize(),
                                            u = 57.29577951308232;
                                        if (r === e) {
                                            var c = e.getObjectCenter();
                                            e.object.getAbsolutePivotPoint().subtractToRef(c, t._tmpPositionVector), t._tmpPositionVector.divideInPlace(e.object.scaling), i.pos.push(c.x), i.pos.push(c.y), i.pos.push(c.z), i.posShape.push(0, 0, 0), i.rot.push(0), i.rot.push(0), i.rot.push(0), i.rotShape.push(0, 0, 0)
                                        } else {
                                            var h = r.object.getAbsolutePosition().subtract(e.object.getAbsolutePosition());
                                            i.posShape.push(h.x), i.posShape.push(h.y), i.posShape.push(h.z), i.pos.push(0, 0, 0), i.rot.push(0), i.rot.push(0), i.rot.push(0), i.rotShape.push(a.x * u), i.rotShape.push(a.y * u), i.rotShape.push(a.z * u)
                                        }
                                        switch (r.type) {
                                            case Vo.PhysicsImpostor.ParticleImpostor:
                                                Vo.Tools.Warn("No Particle support in OIMO.js. using SphereImpostor instead");
                                            case Vo.PhysicsImpostor.SphereImpostor:
                                                var d = l.x,
                                                    p = l.y,
                                                    f = l.z,
                                                    _ = Math.max(n(d), n(p), n(f)) / 2;
                                                i.type.push("sphere"), i.size.push(_), i.size.push(_), i.size.push(_);
                                                break;
                                            case Vo.PhysicsImpostor.CylinderImpostor:
                                                var m = n(l.x) / 2,
                                                    g = n(l.y);
                                                i.type.push("cylinder"), i.size.push(m), i.size.push(g), i.size.push(g);
                                                break;
                                            case Vo.PhysicsImpostor.PlaneImpostor:
                                            case Vo.PhysicsImpostor.BoxImpostor:
                                            default:
                                                m = n(l.x), g = n(l.y);
                                                var v = n(l.z);
                                                i.type.push("box"), i.size.push(m), i.size.push(g), i.size.push(v)
                                        }
                                        r.object.rotationQuaternion = s
                                    }
                                }), e.physicsBody = this.world.add(i), e.physicsBody.resetQuaternion(o), e.physicsBody.updatePosition(0)
                            } else this._tmpPositionVector.copyFromFloats(0, 0, 0);
                            var s;
                            e.setDeltaPosition(this._tmpPositionVector)
                        }
                    }, e.prototype.removePhysicsBody = function(e) {
                        this.world.removeRigidBody(e.physicsBody)
                    }, e.prototype.generateJoint = function(e) {
                        var t = e.mainImpostor.physicsBody,
                            i = e.connectedImpostor.physicsBody;
                        if (t && i) {
                            var r, n = e.joint.jointData,
                                o = n.nativeParams || {},
                                s = {
                                    body1: t,
                                    body2: i,
                                    axe1: o.axe1 || (n.mainAxis ? n.mainAxis.asArray() : null),
                                    axe2: o.axe2 || (n.connectedAxis ? n.connectedAxis.asArray() : null),
                                    pos1: o.pos1 || (n.mainPivot ? n.mainPivot.asArray() : null),
                                    pos2: o.pos2 || (n.connectedPivot ? n.connectedPivot.asArray() : null),
                                    min: o.min,
                                    max: o.max,
                                    collision: o.collision || n.collision,
                                    spring: o.spring,
                                    world: this.world
                                };
                            switch (e.joint.type) {
                                case Vo.PhysicsJoint.BallAndSocketJoint:
                                    r = "jointBall";
                                    break;
                                case Vo.PhysicsJoint.SpringJoint:
                                    Vo.Tools.Warn("OIMO.js doesn't support Spring Constraint. Simulating using DistanceJoint instead");
                                    var a = n;
                                    s.min = a.length || s.min, s.max = Math.max(s.min, s.max);
                                case Vo.PhysicsJoint.DistanceJoint:
                                    r = "jointDistance", s.max = n.maxDistance;
                                    break;
                                case Vo.PhysicsJoint.PrismaticJoint:
                                    r = "jointPrisme";
                                    break;
                                case Vo.PhysicsJoint.SliderJoint:
                                    r = "jointSlide";
                                    break;
                                case Vo.PhysicsJoint.WheelJoint:
                                    r = "jointWheel";
                                    break;
                                case Vo.PhysicsJoint.HingeJoint:
                                default:
                                    r = "jointHinge"
                            }
                            s.type = r, e.joint.physicsJoint = this.world.add(s)
                        }
                    }, e.prototype.removeJoint = function(e) {
                        try {
                            this.world.removeJoint(e.joint.physicsJoint)
                        } catch (e) {
                            Vo.Tools.Warn(e)
                        }
                    }, e.prototype.isSupported = function() {
                        return void 0 !== this.BJSOIMO
                    }, e.prototype.setTransformationFromPhysicsBody = function(e) {
                        e.physicsBody.sleeping || (e.object.position.copyFrom(e.physicsBody.getPosition()), e.object.rotationQuaternion && e.object.rotationQuaternion.copyFrom(e.physicsBody.getQuaternion()))
                    }, e.prototype.setPhysicsBodyTransformation = function(e, t, i) {
                        var r = e.physicsBody;
                        r.position.copy(t), r.orientation.copy(i), r.syncShapes(), r.awake()
                    }, e.prototype.setLinearVelocity = function(e, t) {
                        e.physicsBody.linearVelocity.copy(t)
                    }, e.prototype.setAngularVelocity = function(e, t) {
                        e.physicsBody.angularVelocity.copy(t)
                    }, e.prototype.getLinearVelocity = function(e) {
                        var t = e.physicsBody.linearVelocity;
                        return t ? new Vo.Vector3(t.x, t.y, t.z) : null
                    }, e.prototype.getAngularVelocity = function(e) {
                        var t = e.physicsBody.angularVelocity;
                        return t ? new Vo.Vector3(t.x, t.y, t.z) : null
                    }, e.prototype.setBodyMass = function(e, t) {
                        var i = 0 === t;
                        e.physicsBody.shapes.density = i ? 1 : t, e.physicsBody.setupMass(i ? 2 : 1)
                    }, e.prototype.getBodyMass = function(e) {
                        return e.physicsBody.shapes.density
                    }, e.prototype.getBodyFriction = function(e) {
                        return e.physicsBody.shapes.friction
                    }, e.prototype.setBodyFriction = function(e, t) {
                        e.physicsBody.shapes.friction = t
                    }, e.prototype.getBodyRestitution = function(e) {
                        return e.physicsBody.shapes.restitution
                    }, e.prototype.setBodyRestitution = function(e, t) {
                        e.physicsBody.shapes.restitution = t
                    }, e.prototype.sleepBody = function(e) {
                        e.physicsBody.sleep()
                    }, e.prototype.wakeUpBody = function(e) {
                        e.physicsBody.awake()
                    }, e.prototype.updateDistanceJoint = function(e, t, i) {
                        e.physicsJoint.limitMotor.upperLimit = t, void 0 !== i && (e.physicsJoint.limitMotor.lowerLimit = i)
                    }, e.prototype.setMotor = function(e, t, i, r) {
                        var n = r ? e.physicsJoint.rotationalLimitMotor2 : e.physicsJoint.rotationalLimitMotor1 || e.physicsJoint.rotationalLimitMotor || e.physicsJoint.limitMotor;
                        n && n.setMotor(t, i)
                    }, e.prototype.setLimit = function(e, t, i, r) {
                        var n = r ? e.physicsJoint.rotationalLimitMotor2 : e.physicsJoint.rotationalLimitMotor1 || e.physicsJoint.rotationalLimitMotor || e.physicsJoint.limitMotor;
                        n && n.setLimit(t, void 0 === i ? -t : i)
                    }, e.prototype.syncMeshWithImpostor = function(e, t) {
                        var i = t.physicsBody;
                        e.position.x = i.position.x, e.position.y = i.position.y, e.position.z = i.position.z, e.rotationQuaternion && (e.rotationQuaternion.x = i.orientation.x, e.rotationQuaternion.y = i.orientation.y, e.rotationQuaternion.z = i.orientation.z, e.rotationQuaternion.w = i.orientation.s)
                    }, e.prototype.getRadius = function(e) {
                        return e.physicsBody.shapes.radius
                    }, e.prototype.getBoxSizeToRef = function(e, t) {
                        var i = e.physicsBody.shapes;
                        t.x = 2 * i.halfWidth, t.y = 2 * i.halfHeight, t.z = 2 * i.halfDepth
                    }, e.prototype.dispose = function() {
                        this.world.clear()
                    }, e
                }(), Vo.OimoJSPlugin = ko,
                function(e) {
                    e.Scene.prototype.getPhysicsEngine = function() {
                            return this._physicsEngine
                        }, e.Scene.prototype.enablePhysics = function(i, r) {
                            if (void 0 === i && (i = null), this._physicsEngine) return !0;
                            var n = this._getComponent(e.SceneComponentConstants.NAME_PHYSICSENGINE);
                            n || (n = new t(this), this._addComponent(n));
                            try {
                                return this._physicsEngine = new e.PhysicsEngine(i, r), !0
                            } catch (i) {
                                return e.Tools.Error(i.message), !1
                            }
                        }, e.Scene.prototype.disablePhysicsEngine = function() {
                            this._physicsEngine && (this._physicsEngine.dispose(), this._physicsEngine = null)
                        }, e.Scene.prototype.isPhysicsEnabled = function() {
                            return void 0 !== this._physicsEngine
                        },
                        e.Scene.prototype.deleteCompoundImpostor = function(e) {
                            var t = e.parts[0].mesh;
                            t.physicsImpostor && (t.physicsImpostor.dispose(), t.physicsImpostor = null)
                        }, e.Scene.prototype._advancePhysicsEngineStep = function(e) {
                            this._physicsEngine && (this.onBeforePhysicsObservable.notifyObservers(this), this._physicsEngine._step(e / 1e3), this.onAfterPhysicsObservable.notifyObservers(this))
                        }, Object.defineProperty(e.AbstractMesh.prototype, "physicsImpostor", {
                            get: function() {
                                return this._physicsImpostor
                            },
                            set: function(e) {
                                var t = this;
                                this._physicsImpostor !== e && (this._disposePhysicsObserver && this.onDisposeObservable.remove(this._disposePhysicsObserver), (this._physicsImpostor = e) && (this._disposePhysicsObserver = this.onDisposeObservable.add(function() {
                                    t.physicsImpostor && (t.physicsImpostor.dispose(), t.physicsImpostor = null)
                                })))
                            },
                            enumerable: !0,
                            configurable: !0
                        }), e.AbstractMesh.prototype.getPhysicsImpostor = function() {
                            return this.physicsImpostor
                        }, e.AbstractMesh.prototype.applyImpulse = function(e, t) {
                            return this.physicsImpostor && this.physicsImpostor.applyImpulse(e, t), this
                        }, e.AbstractMesh.prototype.setPhysicsLinkWith = function(t, i, r, n) {
                            return this.physicsImpostor && t.physicsImpostor && this.physicsImpostor.createJoint(t.physicsImpostor, e.PhysicsJoint.HingeJoint, {
                                mainPivot: i,
                                connectedPivot: r,
                                nativeParams: n
                            }), this
                        };
                    var t = function() {
                        function t(t) {
                            var i = this;
                            this.name = e.SceneComponentConstants.NAME_PHYSICSENGINE, this.scene = t, this.scene.onBeforePhysicsObservable = new e.Observable, this.scene.onAfterPhysicsObservable = new e.Observable, this.scene.getDeterministicFrameTime = function() {
                                return i.scene._physicsEngine ? 1e3 * i.scene._physicsEngine.getTimeStep() : 1e3 / 60
                            }
                        }
                        return t.prototype.register = function() {}, t.prototype.rebuild = function() {}, t.prototype.dispose = function() {
                            this.scene.onBeforePhysicsObservable.clear(), this.scene.onAfterPhysicsObservable.clear(), this.scene._physicsEngine && this.scene.disablePhysicsEngine()
                        }, t
                    }();
                    e.PhysicsEngineSceneComponent = t
                }($a || ($a = {})),
                function(e) {
                    function t(e) {
                        return e.charCodeAt(0) + (e.charCodeAt(1) << 8) + (e.charCodeAt(2) << 16) + (e.charCodeAt(3) << 24)
                    }
                    var i = t("DXT1"),
                        r = t("DXT3"),
                        n = t("DXT5"),
                        o = t("DX10"),
                        s = function() {
                            function t() {}
                            return t.GetDDSInfo = function(t) {
                                var s = new Int32Array(t, 0, 31),
                                    a = new Int32Array(t, 0, 35),
                                    l = 1;
                                131072 & s[2] && (l = Math.max(1, s[7]));
                                var u = s[21],
                                    c = u === o ? a[32] : 0,
                                    h = e.Engine.TEXTURETYPE_UNSIGNED_INT;
                                switch (u) {
                                    case 113:
                                        h = e.Engine.TEXTURETYPE_HALF_FLOAT;
                                        break;
                                    case 116:
                                        h = e.Engine.TEXTURETYPE_FLOAT;
                                        break;
                                    case o:
                                        if (10 === c) {
                                            h = e.Engine.TEXTURETYPE_HALF_FLOAT;
                                            break
                                        }
                                }
                                return {
                                    width: s[4],
                                    height: s[3],
                                    mipmapCount: l,
                                    isFourCC: 4 == (4 & s[20]),
                                    isRGB: 64 == (64 & s[20]),
                                    isLuminance: 131072 == (131072 & s[20]),
                                    isCube: 512 == (512 & s[28]),
                                    isCompressed: u === i || u === r || u === n,
                                    dxgiFormat: c,
                                    textureType: h
                                }
                            }, t._ToHalfFloat = function(e) {
                                t._FloatView || (t._FloatView = new Float32Array(1), t._Int32View = new Int32Array(t._FloatView.buffer)), t._FloatView[0] = e;
                                var i = t._Int32View[0],
                                    r = i >> 16 & 32768,
                                    n = i >> 12 & 2047,
                                    o = i >> 23 & 255;
                                return o < 103 ? r : 142 < o ? (r |= 31744, r |= (255 == o ? 0 : 1) && 8388607 & i) : o < 113 ? r |= ((n |= 2048) >> 114 - o) + (n >> 113 - o & 1) : (r |= o - 112 << 10 | n >> 1, r += 1 & n)
                            }, t._FromHalfFloat = function(e) {
                                var t = (32768 & e) >> 15,
                                    i = (31744 & e) >> 10,
                                    r = 1023 & e;
                                return 0 === i ? (t ? -1 : 1) * Math.pow(2, -14) * (r / Math.pow(2, 10)) : 31 == i ? r ? NaN : 1 / 0 * (t ? -1 : 1) : (t ? -1 : 1) * Math.pow(2, i - 15) * (1 + r / Math.pow(2, 10))
                            }, t._GetHalfFloatAsFloatRGBAArrayBuffer = function(e, i, r, n, o, s) {
                                for (var a = new Float32Array(n), l = new Uint16Array(o, r), u = 0, c = 0; c < i; c++)
                                    for (var h = 0; h < e; h++) {
                                        var d = 4 * (h + c * e);
                                        a[u] = t._FromHalfFloat(l[d]), a[u + 1] = t._FromHalfFloat(l[d + 1]), a[u + 2] = t._FromHalfFloat(l[d + 2]), a[u + 3] = t.StoreLODInAlphaChannel ? s : t._FromHalfFloat(l[d + 3]), u += 4
                                    }
                                return a
                            }, t._GetHalfFloatRGBAArrayBuffer = function(e, i, r, n, o, s) {
                                if (t.StoreLODInAlphaChannel) {
                                    for (var a = new Uint16Array(n), l = new Uint16Array(o, r), u = 0, c = 0; c < i; c++)
                                        for (var h = 0; h < e; h++) {
                                            var d = 4 * (h + c * e);
                                            a[u] = l[d], a[u + 1] = l[d + 1], a[u + 2] = l[d + 2], a[u + 3] = t._ToHalfFloat(s), u += 4
                                        }
                                    return a
                                }
                                return new Uint16Array(o, r, n)
                            }, t._GetFloatRGBAArrayBuffer = function(e, i, r, n, o, s) {
                                if (t.StoreLODInAlphaChannel) {
                                    for (var a = new Float32Array(n), l = new Float32Array(o, r), u = 0, c = 0; c < i; c++)
                                        for (var h = 0; h < e; h++) {
                                            var d = 4 * (h + c * e);
                                            a[u] = l[d], a[u + 1] = l[d + 1], a[u + 2] = l[d + 2], a[u + 3] = s, u += 4
                                        }
                                    return a
                                }
                                return new Float32Array(o, r, n)
                            }, t._GetFloatAsUIntRGBAArrayBuffer = function(i, r, n, o, s, a) {
                                for (var l = new Uint8Array(o), u = new Float32Array(s, n), c = 0, h = 0; h < r; h++)
                                    for (var d = 0; d < i; d++) {
                                        var p = 4 * (d + h * i);
                                        l[c] = 255 * e.Scalar.Clamp(u[p]), l[c + 1] = 255 * e.Scalar.Clamp(u[p + 1]), l[c + 2] = 255 * e.Scalar.Clamp(u[p + 2]), l[c + 3] = t.StoreLODInAlphaChannel ? a : 255 * e.Scalar.Clamp(u[p + 3]), c += 4
                                    }
                                return l
                            }, t._GetHalfFloatAsUIntRGBAArrayBuffer = function(i, r, n, o, s, a) {
                                for (var l = new Uint8Array(o), u = new Uint16Array(s, n), c = 0, h = 0; h < r; h++)
                                    for (var d = 0; d < i; d++) {
                                        var p = 4 * (d + h * i);
                                        l[c] = 255 * e.Scalar.Clamp(t._FromHalfFloat(u[p])), l[c + 1] = 255 * e.Scalar.Clamp(t._FromHalfFloat(u[p + 1])), l[c + 2] = 255 * e.Scalar.Clamp(t._FromHalfFloat(u[p + 2])), l[c + 3] = t.StoreLODInAlphaChannel ? a : 255 * e.Scalar.Clamp(t._FromHalfFloat(u[p + 3])), c += 4
                                    }
                                return l
                            }, t._GetRGBAArrayBuffer = function(e, t, i, r, n, o, s, a, l) {
                                for (var u = new Uint8Array(r), c = new Uint8Array(n, i), h = 0, d = 0; d < t; d++)
                                    for (var p = 0; p < e; p++) {
                                        var f = 4 * (p + d * e);
                                        u[h] = c[f + o], u[h + 1] = c[f + s], u[h + 2] = c[f + a], u[h + 3] = c[f + l], h += 4
                                    }
                                return u
                            }, t._ExtractLongWordOrder = function(e) {
                                return 0 === e || 255 === e || -16777216 === e ? 0 : 1 + t._ExtractLongWordOrder(e >> 8)
                            }, t._GetRGBArrayBuffer = function(e, t, i, r, n, o, s, a) {
                                for (var l = new Uint8Array(r), u = new Uint8Array(n, i), c = 0, h = 0; h < t; h++)
                                    for (var d = 0; d < e; d++) {
                                        var p = 3 * (d + h * e);
                                        l[c] = u[p + o], l[c + 1] = u[p + s], l[c + 2] = u[p + a], c += 3
                                    }
                                return l
                            }, t._GetLuminanceArrayBuffer = function(e, t, i, r, n) {
                                for (var o = new Uint8Array(r), s = new Uint8Array(n, i), a = 0, l = 0; l < t; l++)
                                    for (var u = 0; u < e; u++) {
                                        var c = u + l * e;
                                        o[a] = s[c], a++
                                    }
                                return o
                            }, t.UploadDDSLevels = function(s, a, l, u, c, h, d, p) {
                                void 0 === d && (d = -1);
                                var f = null;
                                u.sphericalPolynomial && (f = new Array);
                                var _, m, g, v, y, b, x = s.getCaps().s3tc,
                                    T = new Int32Array(l, 0, 31),
                                    E = 0,
                                    S = 0,
                                    P = 1;
                                if (542327876 === T[0])
                                    if (u.isFourCC || u.isRGB || u.isLuminance)
                                        if (!u.isCompressed || x) {
                                            var A = T[22];
                                            g = T[1] + 4;
                                            var C = !1;
                                            if (u.isFourCC) switch (T[21]) {
                                                case i:
                                                    P = 8, S = x.COMPRESSED_RGBA_S3TC_DXT1_EXT;
                                                    break;
                                                case r:
                                                    P = 16, S = x.COMPRESSED_RGBA_S3TC_DXT3_EXT;
                                                    break;
                                                case n:
                                                    P = 16, S = x.COMPRESSED_RGBA_S3TC_DXT5_EXT;
                                                    break;
                                                case 113:
                                                case 116:
                                                    C = !0;
                                                    break;
                                                case o:
                                                    g += 20;
                                                    var M = !1;
                                                    switch (u.dxgiFormat) {
                                                        case 10:
                                                            M = C = !0;
                                                            break;
                                                        case 88:
                                                            u.isRGB = !0, A = 32, M = !(u.isFourCC = !1)
                                                    }
                                                    if (M) break;
                                                default:
                                                    return
                                            }
                                            var R = t._ExtractLongWordOrder(T[23]),
                                                O = t._ExtractLongWordOrder(T[24]),
                                                w = t._ExtractLongWordOrder(T[25]),
                                                I = t._ExtractLongWordOrder(T[26]);
                                            C && (S = s._getRGBABufferInternalSizedFormat(u.textureType)), y = 1, 131072 & T[2] && !1 !== c && (y = Math.max(1, T[7]));
                                            for (var D = 0; D < h; D++) {
                                                for (_ = T[4], m = T[3], b = 0; b < y; ++b) {
                                                    if (-1 === d || d === b) {
                                                        var L = -1 === d ? b : 0;
                                                        if (!u.isCompressed && u.isFourCC) {
                                                            a.format = e.Engine.TEXTUREFORMAT_RGBA, E = _ * m * 4;
                                                            var B = null;
                                                            s._badOS || s._badDesktopOS || !s.getCaps().textureHalfFloat && !s.getCaps().textureFloat ? (128 === A ? (B = t._GetFloatAsUIntRGBAArrayBuffer(_, m, g, E, l, L), f && 0 == L && f.push(t._GetFloatRGBAArrayBuffer(_, m, g, E, l, L))) : 64 === A && (B = t._GetHalfFloatAsUIntRGBAArrayBuffer(_, m, g, E, l, L), f && 0 == L && f.push(t._GetHalfFloatAsFloatRGBAArrayBuffer(_, m, g, E, l, L))), a.type = e.Engine.TEXTURETYPE_UNSIGNED_INT) : 128 === A ? (a.type = e.Engine.TEXTURETYPE_FLOAT, B = t._GetFloatRGBAArrayBuffer(_, m, g, E, l, L), f && 0 == L && f.push(B)) : 64 !== A || s.getCaps().textureHalfFloat ? (a.type = e.Engine.TEXTURETYPE_HALF_FLOAT, B = t._GetHalfFloatRGBAArrayBuffer(_, m, g, E, l, L), f && 0 == L && f.push(t._GetHalfFloatAsFloatRGBAArrayBuffer(_, m, g, E, l, L))) : (a.type = e.Engine.TEXTURETYPE_FLOAT, B = t._GetHalfFloatAsFloatRGBAArrayBuffer(_, m, g, E, l, L), f && 0 == L && f.push(B)), B && s._uploadDataToTextureDirectly(a, B, D, L)
                                                        } else if (u.isRGB) a.type = e.Engine.TEXTURETYPE_UNSIGNED_INT, 24 === A ? (a.format = e.Engine.TEXTUREFORMAT_RGB, v = t._GetRGBArrayBuffer(_, m, g, E = _ * m * 3, l, R, O, w)) : (a.format = e.Engine.TEXTUREFORMAT_RGBA, v = t._GetRGBAArrayBuffer(_, m, g, E = _ * m * 4, l, R, O, w, I)), s._uploadDataToTextureDirectly(a, v, D, L);
                                                        else if (u.isLuminance) {
                                                            var F = s._getUnpackAlignement(),
                                                                N = _,
                                                                V = Math.floor((_ + F - 1) / F) * F;
                                                            v = t._GetLuminanceArrayBuffer(_, m, g, E = V * (m - 1) + N, l), a.format = e.Engine.TEXTUREFORMAT_LUMINANCE, a.type = e.Engine.TEXTURETYPE_UNSIGNED_INT, s._uploadDataToTextureDirectly(a, v, D, L)
                                                        } else E = Math.max(4, _) / 4 * Math.max(4, m) / 4 * P, v = new Uint8Array(l, g, E), a.type = e.Engine.TEXTURETYPE_UNSIGNED_INT, s._uploadCompressedDataToTextureDirectly(a, S, _, m, v, D, L)
                                                    }
                                                    g += A ? _ * m * (A / 8) : E, _ *= .5, m *= .5, _ = Math.max(1, _), m = Math.max(1, m)
                                                }
                                                if (void 0 !== p) break
                                            }
                                            f && 0 < f.length ? u.sphericalPolynomial = e.CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial({
                                                size: T[4],
                                                right: f[0],
                                                left: f[1],
                                                up: f[2],
                                                down: f[3],
                                                front: f[4],
                                                back: f[5],
                                                format: e.Engine.TEXTUREFORMAT_RGBA,
                                                type: e.Engine.TEXTURETYPE_FLOAT,
                                                gammaSpace: !1
                                            }) : u.sphericalPolynomial = void 0
                                        } else e.Tools.Error("Compressed textures are not supported on this platform.");
                                else e.Tools.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");
                                else e.Tools.Error("Invalid magic number in DDS header")
                            }, t.StoreLODInAlphaChannel = !1, t
                        }();
                    e.DDSTools = s
                }($a || ($a = {})), Uo = $a || ($a = {}), Go = function() {
                    function e() {
                        this.supportCascades = !0
                    }
                    return e.prototype.canLoad = function(e, t, i, r, n) {
                        return 0 === e.indexOf(".dds")
                    }, e.prototype.transformUrl = function(e, t) {
                        return e
                    }, e.prototype.getFallbackTextureUrl = function(e, t) {
                        return null
                    }, e.prototype.loadCubeData = function(e, t, i, r, n) {
                        var o, s = t.getEngine(),
                            a = !1;
                        if (Array.isArray(e))
                            for (var l = 0; l < e.length; l++) {
                                var u = e[l];
                                o = Uo.DDSTools.GetDDSInfo(u), t.width = o.width, t.height = o.height, a = (o.isRGB || o.isLuminance || 1 < o.mipmapCount) && t.generateMipMaps, s._unpackFlipY(o.isCompressed), Uo.DDSTools.UploadDDSLevels(s, t, u, o, a, 6, -1, l), o.isFourCC || 1 !== o.mipmapCount || s.generateMipMapsForCubemap(t)
                            } else {
                                var c = e;
                                o = Uo.DDSTools.GetDDSInfo(c), t.width = o.width, t.height = o.height, i && (o.sphericalPolynomial = new Uo.SphericalPolynomial), a = (o.isRGB || o.isLuminance || 1 < o.mipmapCount) && t.generateMipMaps, s._unpackFlipY(o.isCompressed), Uo.DDSTools.UploadDDSLevels(s, t, c, o, a, 6), o.isFourCC || 1 !== o.mipmapCount || s.generateMipMapsForCubemap(t)
                            }
                        s._setCubeMapTextureParams(a), t.isReady = !0, r && r({
                            isDDS: !0,
                            width: t.width,
                            info: o,
                            data: e,
                            texture: t
                        })
                    }, e.prototype.loadData = function(e, t, i) {
                        var r = Uo.DDSTools.GetDDSInfo(e),
                            n = (r.isRGB || r.isLuminance || 1 < r.mipmapCount) && t.generateMipMaps && r.width >> r.mipmapCount - 1 == 1;
                        i(r.width, r.height, n, r.isFourCC, function() {
                            Uo.DDSTools.UploadDDSLevels(t.getEngine(), t, e, r, n, 1)
                        })
                    }, e
                }(), Uo.Engine._TextureLoaders.push(new Go), zo = $a || ($a = {}), jo = function() {
                    function e() {}
                    return e.GetTGAHeader = function(e) {
                        var t = 0;
                        return {
                            id_length: e[t++],
                            colormap_type: e[t++],
                            image_type: e[t++],
                            colormap_index: e[t++] | e[t++] << 8,
                            colormap_length: e[t++] | e[t++] << 8,
                            colormap_size: e[t++],
                            origin: [e[t++] | e[t++] << 8, e[t++] | e[t++] << 8],
                            width: e[t++] | e[t++] << 8,
                            height: e[t++] | e[t++] << 8,
                            pixel_size: e[t++],
                            flags: e[t++]
                        }
                    }, e.UploadContent = function(t, i) {
                        if (i.length < 19) zo.Tools.Error("Unable to load TGA file - Not enough data to contain header");
                        else {
                            var r = 18,
                                n = e.GetTGAHeader(i);
                            if (n.id_length + r > i.length) zo.Tools.Error("Unable to load TGA file - Not enough data");
                            else {
                                r += n.id_length;
                                var o, s = !1,
                                    a = !1,
                                    l = !1;
                                switch (n.image_type) {
                                    case e._TYPE_RLE_INDEXED:
                                        s = !0;
                                    case e._TYPE_INDEXED:
                                        a = !0;
                                        break;
                                    case e._TYPE_RLE_RGB:
                                        s = !0;
                                    case e._TYPE_RGB:
                                        break;
                                    case e._TYPE_RLE_GREY:
                                        s = !0;
                                    case e._TYPE_GREY:
                                        l = !0
                                }
                                var u, c, h, d, p, f, _, m = n.pixel_size >> 3,
                                    g = n.width * n.height * m;
                                if (a && (u = i.subarray(r, r += n.colormap_length * (n.colormap_size >> 3))), s) {
                                    var v, y, b;
                                    o = new Uint8Array(g);
                                    for (var x = 0, T = new Uint8Array(m); r < g && x < g;)
                                        if (y = 1 + (127 & (v = i[r++])), 128 & v) {
                                            for (b = 0; b < m; ++b) T[b] = i[r++];
                                            for (b = 0; b < y; ++b) o.set(T, x + b * m);
                                            x += m * y
                                        } else {
                                            for (y *= m, b = 0; b < y; ++b) o[x + b] = i[r++];
                                            x += y
                                        }
                                } else o = i.subarray(r, r += a ? n.width * n.height : g);
                                switch ((n.flags & e._ORIGIN_MASK) >> e._ORIGIN_SHIFT) {
                                    default:
                                        case e._ORIGIN_UL:
                                        c = 0,
                                    d = 1,
                                    _ = n.width,
                                    h = 0,
                                    p = 1,
                                    f = n.height;
                                    break;
                                    case e._ORIGIN_BL:
                                            c = 0,
                                        d = 1,
                                        _ = n.width,
                                        h = n.height - 1,
                                        f = p = -1;
                                        break;
                                    case e._ORIGIN_UR:
                                            c = n.width - 1,
                                        _ = d = -1,
                                        h = 0,
                                        p = 1,
                                        f = n.height;
                                        break;
                                    case e._ORIGIN_BR:
                                            c = n.width - 1,
                                        _ = d = -1,
                                        h = n.height - 1,
                                        f = p = -1
                                }
                                var E = e["_getImageData" + (l ? "Grey" : "") + n.pixel_size + "bits"](n, u, o, h, p, f, c, d, _);
                                t.getEngine()._uploadDataToTextureDirectly(t, E)
                            }
                        }
                    }, e._getImageData8bits = function(e, t, i, r, n, o, s, a, l) {
                        var u, c, h, d = i,
                            p = t,
                            f = e.width,
                            _ = e.height,
                            m = 0,
                            g = new Uint8Array(f * _ * 4);
                        for (h = r; h !== o; h += n)
                            for (c = s; c !== l; c += a, m++) u = d[m], g[4 * (c + f * h) + 3] = 255, g[4 * (c + f * h) + 2] = p[3 * u + 0], g[4 * (c + f * h) + 1] = p[3 * u + 1], g[4 * (c + f * h) + 0] = p[3 * u + 2];
                        return g
                    }, e._getImageData16bits = function(e, t, i, r, n, o, s, a, l) {
                        var u, c, h, d = i,
                            p = e.width,
                            f = e.height,
                            _ = 0,
                            m = new Uint8Array(p * f * 4);
                        for (h = r; h !== o; h += n)
                            for (c = s; c !== l; c += a, _ += 2) {
                                var g = 255 * ((31744 & (u = d[_ + 0] + (d[_ + 1] << 8))) >> 10) / 31 | 0,
                                    v = 255 * ((992 & u) >> 5) / 31 | 0,
                                    y = 255 * (31 & u) / 31 | 0;
                                m[4 * (c + p * h) + 0] = g, m[4 * (c + p * h) + 1] = v, m[4 * (c + p * h) + 2] = y, m[4 * (c + p * h) + 3] = 32768 & u ? 0 : 255
                            }
                        return m
                    }, e._getImageData24bits = function(e, t, i, r, n, o, s, a, l) {
                        var u, c, h = i,
                            d = e.width,
                            p = e.height,
                            f = 0,
                            _ = new Uint8Array(d * p * 4);
                        for (c = r; c !== o; c += n)
                            for (u = s; u !== l; u += a, f += 3) _[4 * (u + d * c) + 3] = 255, _[4 * (u + d * c) + 2] = h[f + 0], _[4 * (u + d * c) + 1] = h[f + 1], _[4 * (u + d * c) + 0] = h[f + 2];
                        return _
                    }, e._getImageData32bits = function(e, t, i, r, n, o, s, a, l) {
                        var u, c, h = i,
                            d = e.width,
                            p = e.height,
                            f = 0,
                            _ = new Uint8Array(d * p * 4);
                        for (c = r; c !== o; c += n)
                            for (u = s; u !== l; u += a, f += 4) _[4 * (u + d * c) + 2] = h[f + 0], _[4 * (u + d * c) + 1] = h[f + 1], _[4 * (u + d * c) + 0] = h[f + 2], _[4 * (u + d * c) + 3] = h[f + 3];
                        return _
                    }, e._getImageDataGrey8bits = function(e, t, i, r, n, o, s, a, l) {
                        var u, c, h, d = i,
                            p = e.width,
                            f = e.height,
                            _ = 0,
                            m = new Uint8Array(p * f * 4);
                        for (h = r; h !== o; h += n)
                            for (c = s; c !== l; c += a, _++) u = d[_], m[4 * (c + p * h) + 0] = u, m[4 * (c + p * h) + 1] = u, m[4 * (c + p * h) + 2] = u, m[4 * (c + p * h) + 3] = 255;
                        return m
                    }, e._getImageDataGrey16bits = function(e, t, i, r, n, o, s, a, l) {
                        var u, c, h = i,
                            d = e.width,
                            p = e.height,
                            f = 0,
                            _ = new Uint8Array(d * p * 4);
                        for (c = r; c !== o; c += n)
                            for (u = s; u !== l; u += a, f += 2) _[4 * (u + d * c) + 0] = h[f + 0], _[4 * (u + d * c) + 1] = h[f + 0], _[4 * (u + d * c) + 2] = h[f + 0], _[4 * (u + d * c) + 3] = h[f + 1];
                        return _
                    }, e._TYPE_INDEXED = 1, e._TYPE_RGB = 2, e._TYPE_GREY = 3, e._TYPE_RLE_INDEXED = 9, e._TYPE_RLE_RGB = 10, e._TYPE_RLE_GREY = 11, e._ORIGIN_MASK = 48, e._ORIGIN_SHIFT = 4, e._ORIGIN_BL = 0, e._ORIGIN_BR = 1, e._ORIGIN_UL = 2, e._ORIGIN_UR = 3, e
                }(), zo.TGATools = jo, Ho = $a || ($a = {}), Wo = function() {
                    function e() {
                        this.supportCascades = !1
                    }
                    return e.prototype.canLoad = function(e, t, i, r, n) {
                        return 0 === e.indexOf(".tga")
                    }, e.prototype.transformUrl = function(e, t) {
                        return e
                    }, e.prototype.getFallbackTextureUrl = function(e, t) {
                        return null
                    }, e.prototype.loadCubeData = function(e, t, i, r, n) {
                        throw ".env not supported in Cube."
                    }, e.prototype.loadData = function(e, t, i) {
                        var r = new Uint8Array(e),
                            n = Ho.TGATools.GetTGAHeader(r);
                        i(n.width, n.height, t.generateMipMaps, !1, function() {
                            Ho.TGATools.UploadContent(t, r)
                        })
                    }, e
                }(), Ho.Engine._TextureLoaders.push(new Wo), Xo = $a || ($a = {}), Yo = function() {
                    function e(t, i, r, n) {
                        this.arrayBuffer = t;
                        var o = new Uint8Array(this.arrayBuffer, 0, 12);
                        if (171 === o[0] && 75 === o[1] && 84 === o[2] && 88 === o[3] && 32 === o[4] && 49 === o[5] && 49 === o[6] && 187 === o[7] && 13 === o[8] && 10 === o[9] && 26 === o[10] && 10 === o[11]) {
                            var s = new Int32Array(this.arrayBuffer, 12, 13),
                                a = 16909060 === s[0];
                            this.glType = a ? this.switchEndianness(s[1]) : s[1], this.glTypeSize = a ? this.switchEndianness(s[2]) : s[2], this.glFormat = a ? this.switchEndianness(s[3]) : s[3], this.glInternalFormat = a ? this.switchEndianness(s[4]) : s[4], this.glBaseInternalFormat = a ? this.switchEndianness(s[5]) : s[5], this.pixelWidth = a ? this.switchEndianness(s[6]) : s[6], this.pixelHeight = a ? this.switchEndianness(s[7]) : s[7], this.pixelDepth = a ? this.switchEndianness(s[8]) : s[8], this.numberOfArrayElements = a ? this.switchEndianness(s[9]) : s[9], this.numberOfFaces = a ? this.switchEndianness(s[10]) : s[10], this.numberOfMipmapLevels = a ? this.switchEndianness(s[11]) : s[11], this.bytesOfKeyValueData = a ? this.switchEndianness(s[12]) : s[12], 0 === this.glType ? (this.numberOfMipmapLevels = Math.max(1, this.numberOfMipmapLevels), 0 !== this.pixelHeight && 0 === this.pixelDepth ? 0 === this.numberOfArrayElements ? this.numberOfFaces === i ? this.loadType = e.COMPRESSED_2D : Xo.Tools.Error("number of faces expected" + i + ", but found " + this.numberOfFaces) : Xo.Tools.Error("texture arrays not currently supported") : Xo.Tools.Error("only 2D textures currently supported")) : Xo.Tools.Error("only compressed formats currently supported")
                        } else Xo.Tools.Error("texture missing KTX identifier")
                    }
                    return e.prototype.switchEndianness = function(e) {
                        return (255 & e) << 24 | (65280 & e) << 8 | e >> 8 & 65280 | e >> 24 & 255
                    }, e.prototype.uploadLevels = function(t, i) {
                        switch (this.loadType) {
                            case e.COMPRESSED_2D:
                                this._upload2DCompressedLevels(t, i)
                        }
                    }, e.prototype._upload2DCompressedLevels = function(t, i) {
                        for (var r = e.HEADER_LEN + this.bytesOfKeyValueData, n = this.pixelWidth, o = this.pixelHeight, s = i ? this.numberOfMipmapLevels : 1, a = 0; a < s; a++) {
                            var l = new Int32Array(this.arrayBuffer, r, 1)[0];
                            r += 4;
                            for (var u = 0; u < this.numberOfFaces; u++) {
                                var c = new Uint8Array(this.arrayBuffer, r, l);
                                t.getEngine()._uploadCompressedDataToTextureDirectly(t, this.glInternalFormat, n, o, c, u, a), r += l, r += 3 - (l + 3) % 4
                            }
                            n = Math.max(1, .5 * n), o = Math.max(1, .5 * o)
                        }
                    }, e.HEADER_LEN = 64, e.COMPRESSED_2D = 0, e.COMPRESSED_3D = 1, e.TEX_2D = 2, e.TEX_3D = 3, e
                }(), Xo.KhronosTextureContainer = Yo, qo = $a || ($a = {}), Ko = function() {
                    function e() {
                        this.supportCascades = !1
                    }
                    return e.prototype.canLoad = function(e, t, i, r, n) {
                        return !(!t || r || i || n)
                    }, e.prototype.transformUrl = function(e, t) {
                        var i = e.lastIndexOf(".");
                        return (-1 < i ? e.substring(0, i) : e) + t
                    }, e.prototype.getFallbackTextureUrl = function(e, t) {
                        var i = new RegExp(t + "$");
                        return e.replace(i, "")
                    }, e.prototype.loadCubeData = function(e, t, i, r, n) {
                        if (!Array.isArray(e)) {
                            var o = t.getEngine(),
                                s = new qo.KhronosTextureContainer(e, 6),
                                a = 1 < s.numberOfMipmapLevels && t.generateMipMaps;
                            o._unpackFlipY(!0), s.uploadLevels(t, t.generateMipMaps), t.width = s.pixelWidth, t.height = s.pixelHeight, o._setCubeMapTextureParams(a), t.isReady = !0
                        }
                    }, e.prototype.loadData = function(e, t, i) {
                        var r = new qo.KhronosTextureContainer(e, 1);
                        i(r.pixelWidth, r.pixelHeight, !1, !0, function() {
                            r.uploadLevels(t, t.generateMipMaps)
                        })
                    }, e
                }(), qo.Engine._TextureLoaders.unshift(new Ko), Qo = $a || ($a = {}), Zo = function() {
                    function e() {}
                    return e.GetEnvInfo = function(t) {
                        for (var i = new DataView(t), r = 0, n = 0; n < e._MagicBytes.length; n++)
                            if (i.getUint8(r++) !== e._MagicBytes[n]) return Qo.Tools.Error("Not a babylon environment map"), null;
                        for (var o = "", s = 0; s = i.getUint8(r++);) o += String.fromCharCode(s);
                        var a = JSON.parse(o);
                        return a.specular && (a.specular.specularDataPosition = r, a.specular.lodGenerationScale = a.specular.lodGenerationScale || .8), a
                    }, e.CreateEnvTextureAsync = function(t) {
                        var i = this,
                            r = t.getInternalTexture();
                        if (!r) return Promise.reject("The cube texture is invalid.");
                        if (!t._prefiltered) return Promise.reject("The cube texture is invalid (not prefiltered).");
                        var n = r.getEngine();
                        if (n && n.premultipliedAlpha) return Promise.reject("Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.");
                        if (t.textureType === Qo.Engine.TEXTURETYPE_UNSIGNED_INT) return Promise.reject("The cube texture should allow HDR (Full Float or Half Float).");
                        var o = n.getRenderingCanvas();
                        if (!o) return Promise.reject("Env texture can only be created when the engine is associated to a canvas.");
                        var s = Qo.Engine.TEXTURETYPE_FLOAT;
                        if (!n.getCaps().textureFloatRender && (s = Qo.Engine.TEXTURETYPE_HALF_FLOAT, !n.getCaps().textureHalfFloatRender)) return Promise.reject("Env texture can only be created when the browser supports half float or full float rendering.");
                        var a = r.width,
                            l = new Qo.Scene(n),
                            u = {},
                            c = [],
                            h = Qo.Scalar.Log2(r.width);
                        h = Math.round(h);
                        for (var d = 0; d <= h; d++) ! function(e) {
                            for (var i = Math.pow(2, h - e), r = 0; r < 6; r++) ! function(r) {
                                var a = t.readPixels(r, e),
                                    h = n.createRawTexture(a, i, i, Qo.Engine.TEXTUREFORMAT_RGBA, !1, !1, Qo.Texture.NEAREST_SAMPLINGMODE, null, s),
                                    d = new Promise(function(t, s) {
                                        var a = new Qo.PostProcess("rgbdEncode", "rgbdEncode", null, null, 1, null, Qo.Texture.NEAREST_SAMPLINGMODE, n, !1, void 0, Qo.Engine.TEXTURETYPE_UNSIGNED_INT, void 0, null, !1);
                                        a.getEffect().executeWhenCompiled(function() {
                                            a.onApply = function(e) {
                                                e._bindTexture("textureSampler", h)
                                            };
                                            var s = n.getRenderWidth(),
                                                c = n.getRenderHeight();
                                            n.setSize(i, i), l.postProcessManager.directRender([a], null), Qo.Tools.ToBlob(o, function(i) {
                                                var n = new FileReader;
                                                n.onload = function(i) {
                                                    var n = i.target.result;
                                                    u[6 * e + r] = n, t()
                                                }, n.readAsArrayBuffer(i)
                                            }), n.setSize(s, c)
                                        })
                                    });
                                c.push(d)
                            }(r)
                        }(d);
                        return Promise.all(c).then(function() {
                            l.dispose();
                            for (var r = {
                                    version: 1,
                                    width: a,
                                    irradiance: i._CreateEnvTextureIrradiance(t),
                                    specular: {
                                        mipmaps: [],
                                        lodGenerationScale: t.lodGenerationScale
                                    }
                                }, n = 0, o = 0; o <= h; o++)
                                for (var s = 0; s < 6; s++) {
                                    var c = u[6 * o + s].byteLength;
                                    r.specular.mipmaps.push({
                                        length: c,
                                        position: n
                                    }), n += c
                                }
                            for (var d = JSON.stringify(r), p = new ArrayBuffer(d.length + 1), f = new Uint8Array(p), _ = (o = 0, d.length); o < _; o++) f[o] = d.charCodeAt(o);
                            f[d.length] = 0;
                            var m = e._MagicBytes.length + n + p.byteLength,
                                g = new ArrayBuffer(m),
                                v = new Uint8Array(g),
                                y = new DataView(g),
                                b = 0;
                            for (o = 0; o < e._MagicBytes.length; o++) y.setUint8(b++, e._MagicBytes[o]);
                            for (v.set(new Uint8Array(p), b), b += p.byteLength, o = 0; o <= h; o++)
                                for (s = 0; s < 6; s++) {
                                    var x = u[6 * o + s];
                                    v.set(new Uint8Array(x), b), b += x.byteLength
                                }
                            return g
                        })
                    }, e._CreateEnvTextureIrradiance = function(e) {
                        var t = e.sphericalPolynomial;
                        return null == t ? null : {
                            x: [t.x.x, t.x.y, t.x.z],
                            y: [t.y.x, t.y.y, t.y.z],
                            z: [t.z.x, t.z.y, t.z.z],
                            xx: [t.xx.x, t.xx.y, t.xx.z],
                            yy: [t.yy.x, t.yy.y, t.yy.z],
                            zz: [t.zz.x, t.zz.y, t.zz.z],
                            yz: [t.yz.x, t.yz.y, t.yz.z],
                            zx: [t.zx.x, t.zx.y, t.zx.z],
                            xy: [t.xy.x, t.xy.y, t.xy.z]
                        }
                    }, e.UploadEnvLevelsAsync = function(t, i, r) {
                        if (1 !== r.version) throw new Error('Unsupported babylon environment map version "' + r.version + '"');
                        var n = r.specular;
                        if (!n) return Promise.resolve();
                        var o = Qo.Scalar.Log2(r.width);
                        if (o = Math.round(o) + 1, n.mipmaps.length !== 6 * o) throw new Error('Unsupported specular mipmaps number "' + n.mipmaps.length + '"');
                        t._lodGenerationScale = n.lodGenerationScale;
                        for (var s = new Array(o), a = 0; a < o; a++) {
                            s[a] = new Array(6);
                            for (var l = 0; l < 6; l++) {
                                var u = n.mipmaps[6 * a + l];
                                s[a][l] = new Uint8Array(i, n.specularDataPosition + u.position, u.length)
                            }
                        }
                        return e.UploadLevelsAsync(t, s)
                    }, e.UploadLevelsAsync = function(e, t) {
                        if (!Qo.Tools.IsExponentOfTwo(e.width)) throw new Error("Texture size must be a power of two");
                        var i = Math.round(Qo.Scalar.Log2(e.width)) + 1,
                            r = e.getEngine(),
                            n = !1,
                            o = !1,
                            s = null,
                            a = null,
                            l = null,
                            u = r.getCaps();
                        if (e.format = Qo.Engine.TEXTUREFORMAT_RGBA, e.type = Qo.Engine.TEXTURETYPE_UNSIGNED_INT, e.generateMipMaps = !0, r.updateTextureSamplingMode(Qo.Texture.TRILINEAR_SAMPLINGMODE, e), u.textureLOD ? r.webGLVersion < 2 ? n = !1 : u.textureHalfFloatRender && u.textureHalfFloatLinearFiltering ? (n = !0, e.type = Qo.Engine.TEXTURETYPE_HALF_FLOAT) : u.textureFloatRender && u.textureFloatLinearFiltering && (n = !0, e.type = Qo.Engine.TEXTURETYPE_FLOAT) : (o = !(n = !1), l = {}), n) s = new Qo.PostProcess("rgbdDecode", "rgbdDecode", null, null, 1, null, Qo.Texture.TRILINEAR_SAMPLINGMODE, r, !1, void 0, e.type, void 0, null, !1), e._isRGBD = !1, e.invertY = !1, a = r.createRenderTargetCubeTexture(e.width, {
                            generateDepthBuffer: !1,
                            generateMipMaps: !0,
                            generateStencilBuffer: !1,
                            samplingMode: Qo.Texture.TRILINEAR_SAMPLINGMODE,
                            type: e.type,
                            format: Qo.Engine.TEXTUREFORMAT_RGBA
                        });
                        else if (e._isRGBD = !0, e.invertY = !0, o)
                            for (var c = e._lodGenerationScale, h = e._lodGenerationOffset, d = 0; d < 3; d++) {
                                var p = (i - 1) * c + h,
                                    f = h + (p - h) * (1 - d / 2),
                                    _ = Math.round(Math.min(Math.max(f, 0), p)),
                                    m = new Qo.InternalTexture(r, Qo.InternalTexture.DATASOURCE_TEMP);
                                m.isCube = !0, m.invertY = !0, m.generateMipMaps = !1, r.updateTextureSamplingMode(Qo.Texture.LINEAR_LINEAR, m);
                                var g = new Qo.BaseTexture(null);
                                switch (g.isCube = !0, g._texture = m, l[_] = g, d) {
                                    case 0:
                                        e._lodTextureLow = g;
                                        break;
                                    case 1:
                                        e._lodTextureMid = g;
                                        break;
                                    case 2:
                                        e._lodTextureHigh = g
                                }
                            }
                        var v = [];
                        for (d = 0; d < t.length; d++) ! function(i) {
                            for (var u = 0; u < 6; u++) ! function(u) {
                                var c = t[i][u],
                                    h = new Blob([c], {
                                        type: "image/png"
                                    }),
                                    d = URL.createObjectURL(h),
                                    p = new Image;
                                p.src = d;
                                var f = new Promise(function(t, c) {
                                    p.onload = function() {
                                        if (n) {
                                            var h = r.createTexture(null, !0, !0, null, Qo.Texture.NEAREST_SAMPLINGMODE, null, function(e) {
                                                c(e)
                                            }, p);
                                            s.getEffect().executeWhenCompiled(function() {
                                                s.onApply = function(e) {
                                                    e._bindTexture("textureSampler", h), e.setFloat2("scale", 1, 1)
                                                }, r.scenes[0].postProcessManager.directRender([s], a, !0, u, i), r.restoreDefaultFramebuffer(), h.dispose(), window.URL.revokeObjectURL(d), t()
                                            })
                                        } else {
                                            if (r._uploadImageToTexture(e, p, u, i), o) {
                                                var f = l[i];
                                                f && r._uploadImageToTexture(f._texture, p, u, 0)
                                            }
                                            t()
                                        }
                                    }, p.onerror = function(e) {
                                        c(e)
                                    }
                                });
                                v.push(f)
                            }(u)
                        }(d);
                        if (t.length < i) {
                            var y = void 0,
                                b = Math.pow(2, i - 1 - t.length),
                                x = b * b * 4;
                            switch (e.type) {
                                case Qo.Engine.TEXTURETYPE_UNSIGNED_INT:
                                    y = new Uint8Array(x);
                                    break;
                                case Qo.Engine.TEXTURETYPE_HALF_FLOAT:
                                    y = new Uint16Array(x);
                                    break;
                                case Qo.Engine.TEXTURETYPE_FLOAT:
                                    y = new Float32Array(x)
                            }
                            for (d = t.length; d < i; d++)
                                for (var T = 0; T < 6; T++) r._uploadArrayBufferViewToTexture(e, y, T, d)
                        }
                        return Promise.all(v).then(function() {
                            a && (r._releaseFramebufferObjects(a), a._swapAndDie(e)), s && s.dispose(), o && (e._lodTextureHigh && e._lodTextureHigh._texture && (e._lodTextureHigh._texture.isReady = !0), e._lodTextureMid && e._lodTextureMid._texture && (e._lodTextureMid._texture.isReady = !0), e._lodTextureLow && e._lodTextureLow._texture && (e._lodTextureLow._texture.isReady = !0))
                        })
                    }, e.UploadEnvSpherical = function(e, t) {
                        1 !== t.version && Qo.Tools.Warn('Unsupported babylon environment map version "' + t.version + '"');
                        var i = t.irradiance;
                        if (i) {
                            var r = new Qo.SphericalPolynomial;
                            Qo.Vector3.FromArrayToRef(i.x, 0, r.x), Qo.Vector3.FromArrayToRef(i.y, 0, r.y), Qo.Vector3.FromArrayToRef(i.z, 0, r.z), Qo.Vector3.FromArrayToRef(i.xx, 0, r.xx), Qo.Vector3.FromArrayToRef(i.yy, 0, r.yy), Qo.Vector3.FromArrayToRef(i.zz, 0, r.zz), Qo.Vector3.FromArrayToRef(i.yz, 0, r.yz), Qo.Vector3.FromArrayToRef(i.zx, 0, r.zx), Qo.Vector3.FromArrayToRef(i.xy, 0, r.xy), e._sphericalPolynomial = r
                        }
                    }, e._MagicBytes = [134, 22, 135, 150, 246, 214, 150, 54], e
                }(), Qo.EnvironmentTextureTools = Zo, Jo = $a || ($a = {}), $o = function() {
                    function e() {
                        this.supportCascades = !1
                    }
                    return e.prototype.canLoad = function(e, t, i, r, n) {
                        return 0 === e.indexOf(".env")
                    }, e.prototype.transformUrl = function(e, t) {
                        return e
                    }, e.prototype.getFallbackTextureUrl = function(e, t) {
                        return null
                    }, e.prototype.loadCubeData = function(e, t, i, r, n) {
                        if (!Array.isArray(e)) {
                            e = e;
                            var o = Jo.EnvironmentTextureTools.GetEnvInfo(e);
                            o ? (t.width = o.width, t.height = o.width, Jo.EnvironmentTextureTools.UploadEnvSpherical(t, o), Jo.EnvironmentTextureTools.UploadEnvLevelsAsync(t, e, o).then(function() {
                                t.isReady = !0, r && r()
                            })) : n && n("Can not parse the environment file", null)
                        }
                    }, e.prototype.loadData = function(e, t, i) {
                        throw ".env not supported in 2d."
                    }, e
                }(), Jo.Engine._TextureLoaders.push(new $o), es = $a || ($a = {}), ts = function() {
                    function e(e) {
                        var t = this;
                        this.originalScene = e, this._pointerCaptures = {}, this._lastPointerEvents = {}, this.shouldRender = !0, this.onlyCheckPointerDownEvents = !0, this.processAllEvents = !1, this.onPointerOutObservable = new es.Observable, this.utilityLayerScene = new es.Scene(e.getEngine()), this.utilityLayerScene.useRightHandedSystem = e.useRightHandedSystem, this.utilityLayerScene._allowPostProcessClearColor = !1, e.getEngine().scenes.pop(), this.utilityLayerScene.detachControl(), this._originalPointerObserver = e.onPrePointerObservable.add(function(i, r) {
                            if (t.processAllEvents || i.type === es.PointerEventTypes.POINTERMOVE || i.type === es.PointerEventTypes.POINTERUP || i.type === es.PointerEventTypes.POINTERDOWN) {
                                var n = i.event;
                                if (e.isPointerCaptured(n.pointerId)) t._pointerCaptures[n.pointerId] = !1;
                                else {
                                    var o = i.ray ? t.utilityLayerScene.pickWithRay(i.ray) : t.utilityLayerScene.pick(e.pointerX, e.pointerY);
                                    if (!i.ray && o && (i.ray = o.ray), t.utilityLayerScene.onPrePointerObservable.notifyObservers(i), t.onlyCheckPointerDownEvents && i.type != es.PointerEventTypes.POINTERDOWN) return i.skipOnPointerObservable || t.utilityLayerScene.onPointerObservable.notifyObservers(new es.PointerInfo(i.type, i.event, o)), void(i.type === es.PointerEventTypes.POINTERUP && t._pointerCaptures[n.pointerId] && (t._pointerCaptures[n.pointerId] = !1));
                                    if (t.utilityLayerScene.autoClearDepthAndStencil) o && o.hit && (i.skipOnPointerObservable || t.utilityLayerScene.onPointerObservable.notifyObservers(new es.PointerInfo(i.type, i.event, o)), i.skipOnPointerObservable = !0);
                                    else {
                                        var s = i.ray ? e.pickWithRay(i.ray) : e.pick(e.pointerX, e.pointerY),
                                            a = i.event;
                                        s && o && (0 === o.distance && s.pickedMesh ? t.mainSceneTrackerPredicate && t.mainSceneTrackerPredicate(s.pickedMesh) ? (t._notifyObservers(i, s, a), i.skipOnPointerObservable = !0) : i.type === es.PointerEventTypes.POINTERDOWN ? t._pointerCaptures[a.pointerId] = !0 : t._lastPointerEvents[a.pointerId] && (t.onPointerOutObservable.notifyObservers(a.pointerId), delete t._lastPointerEvents[a.pointerId]) : !t._pointerCaptures[a.pointerId] && (o.distance < s.distance || 0 === s.distance) ? (t._notifyObservers(i, o, a), i.skipOnPointerObservable || (i.skipOnPointerObservable = 0 < o.distance)) : !t._pointerCaptures[a.pointerId] && o.distance > s.distance && (t.mainSceneTrackerPredicate && t.mainSceneTrackerPredicate(s.pickedMesh) ? (t._notifyObservers(i, s, a), i.skipOnPointerObservable = !0) : t._lastPointerEvents[a.pointerId] && (t.onPointerOutObservable.notifyObservers(a.pointerId), delete t._lastPointerEvents[a.pointerId])), i.type === es.PointerEventTypes.POINTERUP && t._pointerCaptures[a.pointerId] && (t._pointerCaptures[a.pointerId] = !1))
                                    }
                                }
                            }
                        }), this.utilityLayerScene.autoClear = !1, this._afterRenderObserver = this.originalScene.onAfterRenderObservable.add(function() {
                            t.shouldRender && t.render()
                        }), this._sceneDisposeObserver = this.originalScene.onDisposeObservable.add(function() {
                            t.dispose()
                        }), this._updateCamera()
                    }
                    return Object.defineProperty(e, "DefaultUtilityLayer", {
                        get: function() {
                            return null == e._DefaultUtilityLayer && (e._DefaultUtilityLayer = new e(es.Engine.LastCreatedScene)).originalScene.onDisposeObservable.addOnce(function() {
                                e._DefaultUtilityLayer = null
                            }), e._DefaultUtilityLayer
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e, "DefaultKeepDepthUtilityLayer", {
                        get: function() {
                            return null == e._DefaultKeepDepthUtilityLayer && ((e._DefaultKeepDepthUtilityLayer = new e(es.Engine.LastCreatedScene)).utilityLayerScene.autoClearDepthAndStencil = !1, e._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce(function() {
                                e._DefaultKeepDepthUtilityLayer = null
                            })), e._DefaultKeepDepthUtilityLayer
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._notifyObservers = function(e, t, i) {
                        e.skipOnPointerObservable || (this.utilityLayerScene.onPointerObservable.notifyObservers(new es.PointerInfo(e.type, e.event, t)), this._lastPointerEvents[i.pointerId] = !0)
                    }, e.prototype.render = function() {
                        if (this._updateCamera(), this.utilityLayerScene.activeCamera) {
                            var e = this.utilityLayerScene.activeCamera.getScene(),
                                t = this.utilityLayerScene.activeCamera;
                            t._scene = this.utilityLayerScene, t.leftCamera && (t.leftCamera._scene = this.utilityLayerScene), t.rightCamera && (t.rightCamera._scene = this.utilityLayerScene), this.utilityLayerScene.render(!1), t._scene = e, t.leftCamera && (t.leftCamera._scene = e), t.rightCamera && (t.rightCamera._scene = e)
                        }
                    }, e.prototype.dispose = function() {
                        this.onPointerOutObservable.clear(), this._afterRenderObserver && this.originalScene.onAfterRenderObservable.remove(this._afterRenderObserver), this._sceneDisposeObserver && this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver), this._originalPointerObserver && this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver), this.utilityLayerScene.dispose()
                    }, e.prototype._updateCamera = function() {
                        this.utilityLayerScene.activeCamera = this.originalScene.activeCamera
                    }, e._DefaultUtilityLayer = null, e._DefaultKeepDepthUtilityLayer = null, e
                }(), es.UtilityLayerRenderer = ts, is = $a || ($a = {}), rs = function() {
                    function e(e) {
                        this.maxDragAngle = 0, this._useAlternatePickedPointAboveMaxDragAngle = !1, this.currentDraggingPointerID = -1, this.dragging = !1, this.dragDeltaRatio = .2, this.updateDragPlane = !0, this._debugMode = !1, this._moving = !1, this.onDragObservable = new is.Observable, this.onDragStartObservable = new is.Observable, this.onDragEndObservable = new is.Observable, this.moveAttached = !0, this.enabled = !0, this.detachCameraControls = !0, this.useObjectOrienationForDragging = !0, this._tmpVector = new is.Vector3(0, 0, 0), this._alternatePickedPoint = new is.Vector3(0, 0, 0), this._worldDragAxis = new is.Vector3(0, 0, 0), this._targetPosition = new is.Vector3(0, 0, 0), this._attachedElement = null, this._startDragRay = new is.Ray(new is.Vector3, new is.Vector3), this._lastPointerRay = {}, this._dragDelta = new is.Vector3, this._pointA = new is.Vector3(0, 0, 0), this._pointB = new is.Vector3(0, 0, 0), this._pointC = new is.Vector3(0, 0, 0), this._lineA = new is.Vector3(0, 0, 0), this._lineB = new is.Vector3(0, 0, 0), this._localAxis = new is.Vector3(0, 0, 0), this._lookAt = new is.Vector3(0, 0, 0), this._options = e || {};
                        var t = 0;
                        if (this._options.dragAxis && t++, this._options.dragPlaneNormal && t++, 1 < t) throw "Multiple drag modes specified in dragBehavior options. Only one expected"
                    }
                    return Object.defineProperty(e.prototype, "name", {
                        get: function() {
                            return "PointerDrag"
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.init = function() {}, e.prototype.attach = function(t) {
                        var i = this;
                        this._scene = t.getScene(), this._attachedNode = t,
                            e._planeScene || (this._debugMode ? e._planeScene = this._scene : ((e._planeScene = new is.Scene(this._scene.getEngine())).detachControl(), this._scene.getEngine().scenes.pop(), this._scene.onDisposeObservable.addOnce(function() {
                                e._planeScene.dispose(), e._planeScene = null
                            }))), this._dragPlane = is.Mesh.CreatePlane("pointerDragPlane", this._debugMode ? 1 : 1e4, e._planeScene, !1, is.Mesh.DOUBLESIDE), this.lastDragPosition = new is.Vector3(0, 0, 0), this._pointerObserver = this._scene.onPointerObservable.add(function(t, r) {
                                var n;
                                if (i.enabled)
                                    if (t.type == is.PointerEventTypes.POINTERDOWN) !i.dragging && t.pickInfo && t.pickInfo.hit && t.pickInfo.pickedMesh && t.pickInfo.pickedPoint && t.pickInfo.ray && (n = t.pickInfo.pickedMesh, i._attachedNode == n || n.isDescendantOf(i._attachedNode)) && i._startDrag(t.event.pointerId, t.pickInfo.ray, t.pickInfo.pickedPoint);
                                    else if (t.type == is.PointerEventTypes.POINTERUP) i.currentDraggingPointerID == t.event.pointerId && i.releaseDrag();
                                else if (t.type == is.PointerEventTypes.POINTERMOVE) {
                                    var o = t.event.pointerId;
                                    i.currentDraggingPointerID === e._AnyMouseID && o !== e._AnyMouseID && "mouse" == t.event.pointerType && (i._lastPointerRay[i.currentDraggingPointerID] && (i._lastPointerRay[o] = i._lastPointerRay[i.currentDraggingPointerID], delete i._lastPointerRay[i.currentDraggingPointerID]), i.currentDraggingPointerID = o), i._lastPointerRay[o] || (i._lastPointerRay[o] = new is.Ray(new is.Vector3, new is.Vector3)), t.pickInfo && t.pickInfo.ray && (i._lastPointerRay[o].origin.copyFrom(t.pickInfo.ray.origin), i._lastPointerRay[o].direction.copyFrom(t.pickInfo.ray.direction), i.currentDraggingPointerID == o && i.dragging && i._moveDrag(t.pickInfo.ray))
                                }
                            }), this._beforeRenderObserver = this._scene.onBeforeRenderObservable.add(function() {
                                i._moving && i.moveAttached && (is.BoundingBoxGizmo._RemoveAndStorePivotPoint(i._attachedNode), i._targetPosition.subtractToRef(i._attachedNode.absolutePosition, i._tmpVector), i._tmpVector.scaleInPlace(i.dragDeltaRatio), i._attachedNode.getAbsolutePosition().addToRef(i._tmpVector, i._tmpVector), i._attachedNode.setAbsolutePosition(i._tmpVector), is.BoundingBoxGizmo._RestorePivotPoint(i._attachedNode))
                            })
                    }, e.prototype.releaseDrag = function() {
                        this.dragging = !1, this.onDragEndObservable.notifyObservers({
                            dragPlanePoint: this.lastDragPosition,
                            pointerId: this.currentDraggingPointerID
                        }), this.currentDraggingPointerID = -1, this._moving = !1, this.detachCameraControls && this._attachedElement && this._scene.activeCamera && !this._scene.activeCamera.leftCamera && this._scene.activeCamera.attachControl(this._attachedElement, !0)
                    }, e.prototype.startDrag = function(t, i, r) {
                        void 0 === t && (t = e._AnyMouseID), this._startDrag(t, i, r);
                        var n = this._lastPointerRay[t];
                        t === e._AnyMouseID && (n = this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]), n && this._moveDrag(n)
                    }, e.prototype._startDrag = function(e, t, i) {
                        if (this._scene.activeCamera && !this.dragging && this._attachedNode) {
                            is.BoundingBoxGizmo._RemoveAndStorePivotPoint(this._attachedNode), t ? (this._startDragRay.direction.copyFrom(t.direction), this._startDragRay.origin.copyFrom(t.origin)) : (this._startDragRay.origin.copyFrom(this._scene.activeCamera.position), this._attachedNode.getWorldMatrix().getTranslationToRef(this._tmpVector), this._tmpVector.subtractToRef(this._scene.activeCamera.position, this._startDragRay.direction)), this._updateDragPlanePosition(this._startDragRay, i || this._tmpVector);
                            var r = this._pickWithRayOnDragPlane(this._startDragRay);
                            r && (this.dragging = !0, this.currentDraggingPointerID = e, this.lastDragPosition.copyFrom(r), this.onDragStartObservable.notifyObservers({
                                dragPlanePoint: r,
                                pointerId: this.currentDraggingPointerID
                            }), this._targetPosition.copyFrom(this._attachedNode.absolutePosition), this.detachCameraControls && this._scene.activeCamera && !this._scene.activeCamera.leftCamera && (this._scene.activeCamera.inputs.attachedElement ? (this._attachedElement = this._scene.activeCamera.inputs.attachedElement, this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement)) : this._attachedElement = null)), is.BoundingBoxGizmo._RestorePivotPoint(this._attachedNode)
                        }
                    }, e.prototype._moveDrag = function(e) {
                        this._moving = !0;
                        var t = this._pickWithRayOnDragPlane(e);
                        if (t) {
                            this.updateDragPlane && this._updateDragPlanePosition(e, t);
                            var i = 0;
                            this._options.dragAxis ? (is.Vector3.TransformCoordinatesToRef(this._options.dragAxis, this._attachedNode.getWorldMatrix().getRotationMatrix(), this._worldDragAxis), t.subtractToRef(this.lastDragPosition, this._tmpVector), i = is.Vector3.Dot(this._tmpVector, this._worldDragAxis), this._worldDragAxis.scaleToRef(i, this._dragDelta)) : (i = this._dragDelta.length(), t.subtractToRef(this.lastDragPosition, this._dragDelta)), this._targetPosition.addInPlace(this._dragDelta), this.onDragObservable.notifyObservers({
                                dragDistance: i,
                                delta: this._dragDelta,
                                dragPlanePoint: t,
                                dragPlaneNormal: this._dragPlane.forward,
                                pointerId: this.currentDraggingPointerID
                            }), this.lastDragPosition.copyFrom(t)
                        }
                    }, e.prototype._pickWithRayOnDragPlane = function(t) {
                        var i = this;
                        if (!t) return null;
                        var r = Math.acos(is.Vector3.Dot(this._dragPlane.forward, t.direction));
                        if (r > Math.PI / 2 && (r = Math.PI - r), 0 < this.maxDragAngle && r > this.maxDragAngle) {
                            if (this._useAlternatePickedPointAboveMaxDragAngle) {
                                this._tmpVector.copyFrom(t.direction), this._attachedNode.absolutePosition.subtractToRef(t.origin, this._alternatePickedPoint), this._alternatePickedPoint.normalize(), this._alternatePickedPoint.scaleInPlace(-2 * is.Vector3.Dot(this._alternatePickedPoint, this._tmpVector)), this._tmpVector.addInPlace(this._alternatePickedPoint);
                                var n = is.Vector3.Dot(this._dragPlane.forward, this._tmpVector);
                                return this._dragPlane.forward.scaleToRef(-n, this._alternatePickedPoint), this._alternatePickedPoint.addInPlace(this._tmpVector), this._alternatePickedPoint.addInPlace(this._attachedNode.absolutePosition), this._alternatePickedPoint
                            }
                            return null
                        }
                        var o = e._planeScene.pickWithRay(t, function(e) {
                            return e == i._dragPlane
                        });
                        return o && o.hit && o.pickedMesh && o.pickedPoint ? o.pickedPoint : null
                    }, e.prototype._updateDragPlanePosition = function(e, t) {
                        this._pointA.copyFrom(t), this._options.dragAxis ? (this.useObjectOrienationForDragging ? is.Vector3.TransformCoordinatesToRef(this._options.dragAxis, this._attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragAxis), this._pointA.addToRef(this._localAxis, this._pointB), e.origin.subtractToRef(this._pointA, this._pointC), this._pointA.addToRef(this._pointC.normalize(), this._pointC), this._pointB.subtractToRef(this._pointA, this._lineA), this._pointC.subtractToRef(this._pointA, this._lineB), is.Vector3.CrossToRef(this._lineA, this._lineB, this._lookAt), is.Vector3.CrossToRef(this._lineA, this._lookAt, this._lookAt), this._lookAt.normalize(), this._dragPlane.position.copyFrom(this._pointA), this._pointA.subtractToRef(this._lookAt, this._lookAt), this._dragPlane.lookAt(this._lookAt)) : this._options.dragPlaneNormal ? (this.useObjectOrienationForDragging ? is.Vector3.TransformCoordinatesToRef(this._options.dragPlaneNormal, this._attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragPlaneNormal), this._dragPlane.position.copyFrom(this._pointA), this._pointA.subtractToRef(this._localAxis, this._lookAt), this._dragPlane.lookAt(this._lookAt)) : (this._dragPlane.position.copyFrom(this._pointA), this._dragPlane.lookAt(e.origin)), this._dragPlane.computeWorldMatrix(!0)
                    }, e.prototype.detach = function() {
                        this._pointerObserver && this._scene.onPointerObservable.remove(this._pointerObserver), this._beforeRenderObserver && this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver)
                    }, e._AnyMouseID = -2, e
                }(), is.PointerDragBehavior = rs, ns = $a || ($a = {}), os = function() {
                    function e() {
                        this._startDistance = 0, this._initialScale = new ns.Vector3(0, 0, 0), this._targetScale = new ns.Vector3(0, 0, 0), this._sceneRenderObserver = null, this._dragBehaviorA = new ns.PointerDragBehavior({}), this._dragBehaviorA.moveAttached = !1, this._dragBehaviorB = new ns.PointerDragBehavior({}), this._dragBehaviorB.moveAttached = !1
                    }
                    return Object.defineProperty(e.prototype, "name", {
                        get: function() {
                            return "MultiPointerScale"
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.init = function() {}, e.prototype._getCurrentDistance = function() {
                        return this._dragBehaviorA.lastDragPosition.subtract(this._dragBehaviorB.lastDragPosition).length()
                    }, e.prototype.attach = function(e) {
                        var t = this;
                        this._ownerNode = e, this._dragBehaviorA.onDragStartObservable.add(function(i) {
                            t._dragBehaviorA.dragging && t._dragBehaviorB.dragging && (t._dragBehaviorA.currentDraggingPointerID == t._dragBehaviorB.currentDraggingPointerID ? t._dragBehaviorA.releaseDrag() : (t._initialScale.copyFrom(e.scaling), t._startDistance = t._getCurrentDistance()))
                        }), this._dragBehaviorB.onDragStartObservable.add(function(i) {
                            t._dragBehaviorA.dragging && t._dragBehaviorB.dragging && (t._dragBehaviorA.currentDraggingPointerID == t._dragBehaviorB.currentDraggingPointerID ? t._dragBehaviorB.releaseDrag() : (t._initialScale.copyFrom(e.scaling), t._startDistance = t._getCurrentDistance()))
                        }), [this._dragBehaviorA, this._dragBehaviorB].forEach(function(e) {
                            e.onDragObservable.add(function() {
                                if (t._dragBehaviorA.dragging && t._dragBehaviorB.dragging) {
                                    var e = t._getCurrentDistance() / t._startDistance;
                                    t._initialScale.scaleToRef(e, t._targetScale)
                                }
                            })
                        }), e.addBehavior(this._dragBehaviorA), e.addBehavior(this._dragBehaviorB), this._sceneRenderObserver = e.getScene().onBeforeRenderObservable.add(function() {
                            if (t._dragBehaviorA.dragging && t._dragBehaviorB.dragging) {
                                var i = t._targetScale.subtract(e.scaling).scaleInPlace(.1);
                                .01 < i.length() && e.scaling.addInPlace(i)
                            }
                        })
                    }, e.prototype.detach = function() {
                        var e = this;
                        this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver), [this._dragBehaviorA, this._dragBehaviorB].forEach(function(t) {
                            t.onDragStartObservable.clear(), t.onDragObservable.clear(), e._ownerNode.removeBehavior(t)
                        })
                    }, e
                }(), ns.MultiPointerScaleBehavior = os, ss = $a || ($a = {}), as = function() {
                    function e() {
                        this._sceneRenderObserver = null, this._targetPosition = new ss.Vector3(0, 0, 0), this._moving = !1, this._startingOrientation = new ss.Quaternion, this.zDragFactor = 3, this.dragging = !1, this.dragDeltaRatio = .2, this.currentDraggingPointerID = -1, this.detachCameraControls = !0, this.onDragStartObservable = new ss.Observable, this.onDragEndObservable = new ss.Observable
                    }
                    return Object.defineProperty(e.prototype, "name", {
                        get: function() {
                            return "SixDofDrag"
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.init = function() {}, e.prototype.attach = function(t) {
                        var i = this;
                        this._ownerNode = t, this._scene = this._ownerNode.getScene(), e._virtualScene || ((e._virtualScene = new ss.Scene(this._scene.getEngine())).detachControl(), this._scene.getEngine().scenes.pop());
                        var r = null,
                            n = new ss.Vector3(0, 0, 0);
                        this._virtualOriginMesh = new ss.AbstractMesh("", e._virtualScene), this._virtualOriginMesh.rotationQuaternion = new ss.Quaternion, this._virtualDragMesh = new ss.AbstractMesh("", e._virtualScene), this._virtualDragMesh.rotationQuaternion = new ss.Quaternion;
                        var o = null;
                        this._pointerObserver = this._scene.onPointerObservable.add(function(e, t) {
                            if (e.type == ss.PointerEventTypes.POINTERDOWN) {
                                if (!i.dragging && e.pickInfo && e.pickInfo.hit && e.pickInfo.pickedMesh && e.pickInfo.ray && (c = e.pickInfo.pickedMesh, i._ownerNode == c || c.isDescendantOf(i._ownerNode))) {
                                    i._scene.activeCamera && i._scene.activeCamera.cameraRigMode == ss.Camera.RIG_MODE_NONE && e.pickInfo.ray.origin.copyFrom(i._scene.activeCamera.position), r = i._ownerNode, ss.BoundingBoxGizmo._RemoveAndStorePivotPoint(r), n.copyFrom(e.pickInfo.ray.origin), i._virtualOriginMesh.position.copyFrom(e.pickInfo.ray.origin), i._virtualOriginMesh.lookAt(e.pickInfo.ray.origin.subtract(e.pickInfo.ray.direction)), i._virtualOriginMesh.removeChild(i._virtualDragMesh), r.computeWorldMatrix(), i._virtualDragMesh.position.copyFrom(r.absolutePosition), r.rotationQuaternion || (r.rotationQuaternion = ss.Quaternion.RotationYawPitchRoll(r.rotation.y, r.rotation.x, r.rotation.z));
                                    var s = r.parent;
                                    r.setParent(null), i._virtualDragMesh.rotationQuaternion.copyFrom(r.rotationQuaternion), r.setParent(s), i._virtualOriginMesh.addChild(i._virtualDragMesh), i._targetPosition.copyFrom(i._virtualDragMesh.absolutePosition), i.dragging = !0, i.currentDraggingPointerID = e.event.pointerId, i.detachCameraControls && i._scene.activeCamera && !i._scene.activeCamera.leftCamera && (i._scene.activeCamera.inputs.attachedElement ? (o = i._scene.activeCamera.inputs.attachedElement, i._scene.activeCamera.detachControl(i._scene.activeCamera.inputs.attachedElement)) : o = null), ss.BoundingBoxGizmo._RestorePivotPoint(r), i.onDragStartObservable.notifyObservers({})
                                }
                            } else if (e.type == ss.PointerEventTypes.POINTERUP) i.currentDraggingPointerID == e.event.pointerId && (i.dragging = !1, i._moving = !1, i.currentDraggingPointerID = -1, r = null, i._virtualOriginMesh.removeChild(i._virtualDragMesh), i.detachCameraControls && o && i._scene.activeCamera && !i._scene.activeCamera.leftCamera && i._scene.activeCamera.attachControl(o, !0), i.onDragEndObservable.notifyObservers({}));
                            else if (e.type == ss.PointerEventTypes.POINTERMOVE && i.currentDraggingPointerID == e.event.pointerId && i.dragging && e.pickInfo && e.pickInfo.ray && r) {
                                var a = i.zDragFactor;
                                i._scene.activeCamera && i._scene.activeCamera.cameraRigMode == ss.Camera.RIG_MODE_NONE && (e.pickInfo.ray.origin.copyFrom(i._scene.activeCamera.position), a = 0);
                                var l = e.pickInfo.ray.origin.subtract(n);
                                n.copyFrom(e.pickInfo.ray.origin);
                                var u = -ss.Vector3.Dot(l, e.pickInfo.ray.direction);
                                i._virtualOriginMesh.addChild(i._virtualDragMesh), i._virtualDragMesh.position.z -= i._virtualDragMesh.position.z < 1 ? u * i.zDragFactor : u * a * i._virtualDragMesh.position.z, i._virtualDragMesh.position.z < 0 && (i._virtualDragMesh.position.z = 0), i._virtualOriginMesh.position.copyFrom(e.pickInfo.ray.origin), i._virtualOriginMesh.lookAt(e.pickInfo.ray.origin.subtract(e.pickInfo.ray.direction)), i._virtualOriginMesh.removeChild(i._virtualDragMesh), i._targetPosition.copyFrom(i._virtualDragMesh.absolutePosition), r.parent && ss.Vector3.TransformCoordinatesToRef(i._targetPosition, ss.Matrix.Invert(r.parent.getWorldMatrix()), i._targetPosition), i._moving || i._startingOrientation.copyFrom(i._virtualDragMesh.rotationQuaternion), i._moving = !0
                            }
                            var c
                        });
                        var s = new ss.Quaternion;
                        this._sceneRenderObserver = t.getScene().onBeforeRenderObservable.add(function() {
                            if (i.dragging && i._moving && r) {
                                ss.BoundingBoxGizmo._RemoveAndStorePivotPoint(r), r.position.addInPlace(i._targetPosition.subtract(r.position).scale(i.dragDeltaRatio)), s.copyFrom(i._startingOrientation), s.x = -s.x, s.y = -s.y, s.z = -s.z, i._virtualDragMesh.rotationQuaternion.multiplyToRef(s, s), ss.Quaternion.RotationYawPitchRollToRef(s.toEulerAngles("xyz").y, 0, 0, s), s.multiplyToRef(i._startingOrientation, s);
                                var e = r.parent;
                                r.setParent(null), ss.Quaternion.SlerpToRef(r.rotationQuaternion, s, i.dragDeltaRatio, r.rotationQuaternion), r.setParent(e), ss.BoundingBoxGizmo._RestorePivotPoint(r)
                            }
                        })
                    }, e.prototype.detach = function() {
                        this._scene && this._scene.onPointerObservable.remove(this._pointerObserver), this._ownerNode && this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver), this._virtualOriginMesh && this._virtualOriginMesh.dispose(), this._virtualDragMesh && this._virtualDragMesh.dispose(), this.onDragEndObservable.clear(), this.onDragStartObservable.clear()
                    }, e
                }(), ss.SixDofDragBehavior = as, ls = $a || ($a = {}), us = function(e, t, i, r) {
                    void 0 === t && (t = new ls.Vector3), void 0 === i && (i = 0), void 0 === r && (r = !1), this.direction = e, this.rotatedDirection = t, this.diff = i, this.ignore = r
                }, cs = function() {
                    function e(e) {
                        this.ui = e, this.name = "AttachToBoxBehavior", this.distanceAwayFromFace = .15, this.distanceAwayFromBottomOfFace = .15, this._faceVectors = [new us(ls.Vector3.Up()), new us(ls.Vector3.Down()), new us(ls.Vector3.Left()), new us(ls.Vector3.Right()), new us(ls.Vector3.Forward()), new us(ls.Vector3.Forward().scaleInPlace(-1))], this._tmpMatrix = new ls.Matrix, this._tmpVector = new ls.Vector3, this._zeroVector = ls.Vector3.Zero(), this._lookAtTmpMatrix = new ls.Matrix
                    }
                    return e.prototype.init = function() {}, e.prototype._closestFace = function(e) {
                        var t = this;
                        return this._faceVectors.forEach(function(i) {
                            t._target.rotationQuaternion || (t._target.rotationQuaternion = ls.Quaternion.RotationYawPitchRoll(t._target.rotation.y, t._target.rotation.x, t._target.rotation.z)), t._target.rotationQuaternion.toRotationMatrix(t._tmpMatrix), ls.Vector3.TransformCoordinatesToRef(i.direction, t._tmpMatrix, i.rotatedDirection), i.diff = ls.Vector3.GetAngleBetweenVectors(i.rotatedDirection, e, ls.Vector3.Cross(i.rotatedDirection, e))
                        }), this._faceVectors.reduce(function(e, t) {
                            return e.ignore ? t : t.ignore ? e : e.diff < t.diff ? e : t
                        }, this._faceVectors[0])
                    }, e.prototype._lookAtToRef = function(e, t, i) {
                        void 0 === t && (t = new ls.Vector3(0, 1, 0)), ls.Matrix.LookAtLHToRef(this._zeroVector, e, t, this._lookAtTmpMatrix), this._lookAtTmpMatrix.invert(), ls.Quaternion.FromRotationMatrixToRef(this._lookAtTmpMatrix, i)
                    }, e.prototype.attach = function(e) {
                        var t = this;
                        this._target = e, this._scene = this._target.getScene(), this._onRenderObserver = this._scene.onBeforeRenderObservable.add(function() {
                            if (t._scene.activeCamera) {
                                var i = t._scene.activeCamera.position;
                                t._scene.activeCamera.devicePosition && (i = t._scene.activeCamera.devicePosition);
                                var r = t._closestFace(i.subtract(e.position));
                                t._scene.activeCamera.leftCamera ? t._scene.activeCamera.leftCamera.computeWorldMatrix().getRotationMatrixToRef(t._tmpMatrix) : t._scene.activeCamera.computeWorldMatrix().getRotationMatrixToRef(t._tmpMatrix), ls.Vector3.TransformCoordinatesToRef(ls.Vector3.Up(), t._tmpMatrix, t._tmpVector), t._faceVectors.forEach(function(e) {
                                    r.direction.x && e.direction.x && (e.ignore = !0), r.direction.y && e.direction.y && (e.ignore = !0), r.direction.z && e.direction.z && (e.ignore = !0)
                                });
                                var n = t._closestFace(t._tmpVector);
                                t._faceVectors.forEach(function(e) {
                                    e.ignore = !1
                                }), t.ui.position.copyFrom(e.position), r.direction.x && (r.rotatedDirection.scaleToRef(e.scaling.x / 2 + t.distanceAwayFromFace, t._tmpVector), t.ui.position.addInPlace(t._tmpVector)), r.direction.y && (r.rotatedDirection.scaleToRef(e.scaling.y / 2 + t.distanceAwayFromFace, t._tmpVector), t.ui.position.addInPlace(t._tmpVector)), r.direction.z && (r.rotatedDirection.scaleToRef(e.scaling.z / 2 + t.distanceAwayFromFace, t._tmpVector), t.ui.position.addInPlace(t._tmpVector)), t.ui.rotationQuaternion || (t.ui.rotationQuaternion = ls.Quaternion.RotationYawPitchRoll(t.ui.rotation.y, t.ui.rotation.x, t.ui.rotation.z)), r.rotatedDirection.scaleToRef(-1, t._tmpVector), t._lookAtToRef(t._tmpVector, n.rotatedDirection, t.ui.rotationQuaternion), n.direction.x && t.ui.up.scaleToRef(t.distanceAwayFromBottomOfFace - e.scaling.x / 2, t._tmpVector), n.direction.y && t.ui.up.scaleToRef(t.distanceAwayFromBottomOfFace - e.scaling.y / 2, t._tmpVector), n.direction.z && t.ui.up.scaleToRef(t.distanceAwayFromBottomOfFace - e.scaling.z / 2, t._tmpVector), t.ui.position.addInPlace(t._tmpVector)
                            }
                        })
                    }, e.prototype.detach = function() {
                        this._scene.onBeforeRenderObservable.remove(this._onRenderObserver)
                    }, e
                }(), ls.AttachToBoxBehavior = cs, hs = $a || ($a = {}), ds = function() {
                    function e() {
                        var e = this;
                        this.delay = 0, this.fadeInTime = 300, this._millisecondsPerFrame = 1e3 / 60, this._hovered = !1, this._hoverValue = 0, this._ownerNode = null, this._update = function() {
                            if (e._ownerNode) {
                                if (e._hoverValue += e._hovered ? e._millisecondsPerFrame : -e._millisecondsPerFrame, e._setAllVisibility(e._ownerNode, (e._hoverValue - e.delay) / e.fadeInTime), 1 < e._ownerNode.visibility) return e._setAllVisibility(e._ownerNode, 1), void(e._hoverValue = e.fadeInTime + e.delay);
                                if (e._ownerNode.visibility < 0 && (e._setAllVisibility(e._ownerNode, 0), e._hoverValue < 0)) return void(e._hoverValue = 0);
                                setTimeout(e._update, e._millisecondsPerFrame)
                            }
                        }
                    }
                    return Object.defineProperty(e.prototype, "name", {
                        get: function() {
                            return "FadeInOut"
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.init = function() {}, e.prototype.attach = function(e) {
                        this._ownerNode = e, this._setAllVisibility(this._ownerNode, 0)
                    }, e.prototype.detach = function() {
                        this._ownerNode = null
                    }, e.prototype.fadeIn = function(e) {
                        this._hovered = e, this._update()
                    }, e.prototype._setAllVisibility = function(e, t) {
                        var i = this;
                        e.visibility = t, e.getChildMeshes().forEach(function(e) {
                            i._setAllVisibility(e, t)
                        })
                    }, e
                }(), hs.FadeInOutBehavior = ds, ps = $a || ($a = {}), fs = function() {
                    function e(e) {
                        void 0 === e && (e = ps.UtilityLayerRenderer.DefaultUtilityLayer);
                        var t = this;
                        this.gizmoLayer = e, this.scaleRatio = 1, this._tmpMatrix = new ps.Matrix, this._customMeshSet = !1, this.updateGizmoRotationToMatchAttachedMesh = !0, this.updateGizmoPositionToMatchAttachedMesh = !0, this._updateScale = !0, this._interactionsEnabled = !0, this._tempVector = new ps.Vector3, this._rootMesh = new ps.Mesh("gizmoRootNode", e.utilityLayerScene), this._beforeRenderObserver = this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(function() {
                            t._update()
                        }), this.attachedMesh = null
                    }
                    return Object.defineProperty(e.prototype, "attachedMesh", {
                        get: function() {
                            return this._attachedMesh
                        },
                        set: function(e) {
                            this._attachedMesh = e, this._rootMesh.setEnabled(!!e), this._attachedMeshChanged(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.setCustomMesh = function(e) {
                        if (e.getScene() != this.gizmoLayer.utilityLayerScene) throw "When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";
                        this._rootMesh.getChildMeshes().forEach(function(e) {
                            e.dispose()
                        }), e.parent = this._rootMesh, this._customMeshSet = !0
                    }, e.prototype._attachedMeshChanged = function(e) {}, e.prototype._update = function() {
                        if (this.attachedMesh && (this.updateGizmoRotationToMatchAttachedMesh ? (this._rootMesh.rotationQuaternion || (this._rootMesh.rotationQuaternion = ps.Quaternion.RotationYawPitchRoll(this._rootMesh.rotation.y, this._rootMesh.rotation.x, this._rootMesh.rotation.z)), this._tempVector.copyFrom(this.attachedMesh.scaling), this.attachedMesh.scaling.x < 0 && (this.attachedMesh.scaling.x *= -1), this.attachedMesh.scaling.y < 0 && (this.attachedMesh.scaling.y *= -1), this.attachedMesh.scaling.z < 0 && (this.attachedMesh.scaling.z *= -1), this.attachedMesh.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix), this.attachedMesh.scaling.copyFrom(this._tempVector), this.attachedMesh.computeWorldMatrix(), ps.Quaternion.FromRotationMatrixToRef(this._tmpMatrix, this._rootMesh.rotationQuaternion)) : this._rootMesh.rotationQuaternion && this._rootMesh.rotationQuaternion.set(0, 0, 0, 1), this.updateGizmoPositionToMatchAttachedMesh && this._rootMesh.position.copyFrom(this.attachedMesh.absolutePosition), this._updateScale && this.gizmoLayer.utilityLayerScene.activeCamera && this.attachedMesh)) {
                            var e = this.gizmoLayer.utilityLayerScene.activeCamera.position;
                            this.gizmoLayer.utilityLayerScene.activeCamera.devicePosition && (e = this.gizmoLayer.utilityLayerScene.activeCamera.devicePosition), this._rootMesh.position.subtractToRef(e, this._tempVector);
                            var t = this._tempVector.length() * this.scaleRatio;
                            this._rootMesh.scaling.set(t, t, t)
                        }
                    }, e.prototype.dispose = function() {
                        this._rootMesh.dispose(), this._beforeRenderObserver && this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver)
                    }, e
                }(), ps.Gizmo = fs, _s = $a || ($a = {}), ms = function(e) {
                    function t(t, i, r) {
                        void 0 === i && (i = _s.Color3.Gray()), void 0 === r && (r = _s.UtilityLayerRenderer.DefaultUtilityLayer);
                        var n = e.call(this, r) || this;
                        n._pointerObserver = null, n.snapDistance = 0, n.onSnapObservable = new _s.Observable;
                        var o = new _s.StandardMaterial("", r.utilityLayerScene);
                        o.disableLighting = !0, o.emissiveColor = i;
                        var s = new _s.StandardMaterial("", r.utilityLayerScene);
                        s.disableLighting = !0, s.emissiveColor = i.add(new _s.Color3(.3, .3, .3));
                        var a = new _s.AbstractMesh("", r.utilityLayerScene),
                            l = _s.MeshBuilder.CreateCylinder("yPosMesh", {
                                diameterTop: 0,
                                height: 1.5,
                                diameterBottom: .75,
                                tessellation: 96
                            }, r.utilityLayerScene),
                            u = _s.MeshBuilder.CreateLines("yPosMesh", {
                                points: [new _s.Vector3(0, 0, 0), new _s.Vector3(0, 1.1, 0)]
                            }, r.utilityLayerScene);
                        u.color = o.emissiveColor, a.addChild(l), a.addChild(u), l.scaling.scaleInPlace(.05), l.material = o, l.rotation.x = Math.PI / 2, l.position.z += .3, u.scaling.scaleInPlace(.26), u.rotation.x = Math.PI / 2, u.material = o, a.lookAt(n._rootMesh.position.subtract(t)), a.scaling.scaleInPlace(1 / 3), n._rootMesh.addChild(a);
                        var c = 0,
                            h = new _s.Vector3,
                            d = {
                                snapDistance: 0
                            };
                        n.dragBehavior = new _s.PointerDragBehavior({
                            dragAxis: t
                        }), n.dragBehavior.moveAttached = !1, n._rootMesh.addBehavior(n.dragBehavior);
                        var p = new _s.Vector3,
                            f = new _s.Matrix;
                        return n.dragBehavior.onDragObservable.add(function(e) {
                            if (n.attachedMesh)
                                if (n.attachedMesh.parent ? (n.attachedMesh.parent.computeWorldMatrix().invertToRef(f), f.setTranslationFromFloats(0, 0, 0), _s.Vector3.TransformCoordinatesToRef(e.delta, f, p)) : p.copyFrom(e.delta), 0 == n.snapDistance) n.attachedMesh.position.addInPlace(p);
                                else if (c += e.dragDistance, Math.abs(c) > n.snapDistance) {
                                var t = Math.floor(Math.abs(c) / n.snapDistance);
                                c %= n.snapDistance, p.normalizeToRef(h), h.scaleInPlace(n.snapDistance * t), n.attachedMesh.position.addInPlace(h), d.snapDistance = n.snapDistance * t, n.onSnapObservable.notifyObservers(d)
                            }
                        }), n._pointerObserver = r.utilityLayerScene.onPointerObservable.add(function(e, t) {
                            if (!n._customMeshSet) {
                                var i = e.pickInfo && -1 != n._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh) ? s : o;
                                n._rootMesh.getChildMeshes().forEach(function(e) {
                                    e.material = i, e.color && (e.color = i.emissiveColor)
                                })
                            }
                        }), n
                    }
                    return b(t, e), t.prototype._attachedMeshChanged = function(e) {
                        this.dragBehavior && (this.dragBehavior.enabled = !!e)
                    }, t.prototype.dispose = function() {
                        this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), e.prototype.dispose.call(this)
                    }, t
                }(_s.Gizmo), _s.AxisDragGizmo = ms, gs = $a || ($a = {}), vs = function(e) {
                    function t(t, i, r) {
                        void 0 === i && (i = gs.Color3.Gray()), void 0 === r && (r = gs.UtilityLayerRenderer.DefaultUtilityLayer);
                        var n = e.call(this, r) || this;
                        n._pointerObserver = null, n.snapDistance = 0, n.onSnapObservable = new gs.Observable, n.uniformScaling = !1, n._coloredMaterial = new gs.StandardMaterial("", r.utilityLayerScene), n._coloredMaterial.disableLighting = !0, n._coloredMaterial.emissiveColor = i;
                        var o = new gs.StandardMaterial("", r.utilityLayerScene);
                        o.disableLighting = !0, o.emissiveColor = i.add(new gs.Color3(.3, .3, .3));
                        var s = new gs.AbstractMesh("", r.utilityLayerScene),
                            a = gs.MeshBuilder.CreateBox("yPosMesh", {
                                size: .4
                            }, r.utilityLayerScene),
                            l = gs.MeshBuilder.CreateLines("yPosMesh", {
                                points: [new gs.Vector3(0, 0, 0), new gs.Vector3(0, 1.1, 0)]
                            }, r.utilityLayerScene);
                        l.color = n._coloredMaterial.emissiveColor, s.addChild(a), s.addChild(l), a.scaling.scaleInPlace(.1), a.material = n._coloredMaterial, a.rotation.x = Math.PI / 2, a.position.z += .3, l.scaling.scaleInPlace(.26), l.rotation.x = Math.PI / 2, l.material = n._coloredMaterial, s.lookAt(n._rootMesh.position.subtract(t)), n._rootMesh.addChild(s), s.scaling.scaleInPlace(1 / 3), n.dragBehavior = new gs.PointerDragBehavior({
                            dragAxis: t
                        }), n.dragBehavior.moveAttached = !1, n._rootMesh.addBehavior(n.dragBehavior);
                        var u = 0,
                            c = new gs.Vector3,
                            h = {
                                snapDistance: 0
                            };
                        return n.dragBehavior.onDragObservable.add(function(e) {
                            if (n.attachedMesh) {
                                var i = !1,
                                    r = 0;
                                n.uniformScaling ? (n.attachedMesh.scaling.normalizeToRef(c), c.y < 0 && c.scaleInPlace(-1)) : c.copyFrom(t), 0 == n.snapDistance ? c.scaleToRef(e.dragDistance, c) : (u += e.dragDistance, Math.abs(u) > n.snapDistance ? (r = Math.floor(u / n.snapDistance), u %= n.snapDistance, c.scaleToRef(n.snapDistance * r, c), i = !0) : c.scaleInPlace(0)), n.attachedMesh.scaling.addInPlace(c), i && (h.snapDistance = n.snapDistance * r, n.onSnapObservable.notifyObservers(h))
                            }
                        }), n._pointerObserver = r.utilityLayerScene.onPointerObservable.add(function(e, t) {
                            if (!n._customMeshSet) {
                                var i = e.pickInfo && -1 != n._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh) ? o : n._coloredMaterial;
                                n._rootMesh.getChildMeshes().forEach(function(e) {
                                    e.material = i, e.color && (e.color = i.emissiveColor)
                                })
                            }
                        }), n
                    }
                    return b(t, e), t.prototype._attachedMeshChanged = function(e) {
                        this.dragBehavior && (this.dragBehavior.enabled = !!e)
                    }, t.prototype.dispose = function() {
                        this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), e.prototype.dispose.call(this)
                    }, t.prototype.setCustomMesh = function(t, i) {
                        var r = this;
                        void 0 === i && (i = !1), e.prototype.setCustomMesh.call(this, t), i && (this._rootMesh.getChildMeshes().forEach(function(e) {
                            e.material = r._coloredMaterial, e.color && (e.color = r._coloredMaterial.emissiveColor)
                        }), this._customMeshSet = !1)
                    }, t
                }(gs.Gizmo), gs.AxisScaleGizmo = vs, ys = $a || ($a = {}), bs = function(e) {
                    function t(t, i, r, n) {
                        void 0 === i && (i = ys.Color3.Gray()), void 0 === r && (r = ys.UtilityLayerRenderer.DefaultUtilityLayer), void 0 === n && (n = 32);
                        var o = e.call(this, r) || this;
                        o._pointerObserver = null, o.snapDistance = 0, o.onSnapObservable = new ys.Observable;
                        var s = new ys.StandardMaterial("", r.utilityLayerScene);
                        s.disableLighting = !0, s.emissiveColor = i;
                        var a = new ys.StandardMaterial("", r.utilityLayerScene);
                        a.disableLighting = !0, a.emissiveColor = i.add(new ys.Color3(.3, .3, .3));
                        for (var l = new ys.AbstractMesh("", r.utilityLayerScene), u = new Array, c = 0; c < n; c++) {
                            var h = 2 * Math.PI * (c / (n - 1));
                            u.push(new ys.Vector3(.8 * Math.sin(h), 0, .8 * Math.cos(h)))
                        }
                        var d = ys.Mesh.CreateLines("", u, r.utilityLayerScene);
                        d.color = s.emissiveColor, d.scaling.scaleInPlace(.26), d.material = s, d.rotation.x = Math.PI / 2, l.addChild(d), l.lookAt(o._rootMesh.position.subtract(t)), o._rootMesh.addChild(l), l.scaling.scaleInPlace(1 / 3), o.dragBehavior = new ys.PointerDragBehavior({
                            dragPlaneNormal: t
                        }), o.dragBehavior.moveAttached = !1, o.dragBehavior.maxDragAngle = 9 * Math.PI / 20, o.dragBehavior._useAlternatePickedPointAboveMaxDragAngle = !0, o._rootMesh.addBehavior(o.dragBehavior);
                        var p = new ys.Vector3;
                        o.dragBehavior.onDragStartObservable.add(function(e) {
                            o.attachedMesh && p.copyFrom(e.dragPlanePoint)
                        });
                        var f = new ys.Matrix,
                            _ = new ys.Vector3,
                            m = new ys.Vector3,
                            g = {
                                snapDistance: 0
                            },
                            v = 0,
                            y = new ys.Matrix,
                            b = new ys.Vector3,
                            x = new ys.Quaternion;
                        return o.dragBehavior.onDragObservable.add(function(e) {
                            if (o.attachedMesh) {
                                o.attachedMesh.rotationQuaternion || (o.attachedMesh.rotationQuaternion = ys.Quaternion.RotationYawPitchRoll(o.attachedMesh.rotation.y, o.attachedMesh.rotation.x, o.attachedMesh.rotation.z));
                                var i = e.dragPlanePoint.subtract(o.attachedMesh.absolutePosition).normalize(),
                                    n = p.subtract(o.attachedMesh.absolutePosition).normalize(),
                                    s = ys.Vector3.Cross(i, n),
                                    a = ys.Vector3.Dot(i, n),
                                    l = Math.atan2(s.length(), a);
                                if (_.copyFrom(t), m.copyFrom(t), o.updateGizmoRotationToMatchAttachedMesh && (o.attachedMesh.rotationQuaternion.toRotationMatrix(f), m = ys.Vector3.TransformCoordinates(_, f)), r.utilityLayerScene.activeCamera) {
                                    var u = r.utilityLayerScene.activeCamera.position.subtract(o.attachedMesh.position);
                                    0 < ys.Vector3.Dot(u, m) && (_.scaleInPlace(-1), m.scaleInPlace(-1))
                                }
                                0 < ys.Vector3.Dot(m, s) && (l = -l);
                                var c = !1;
                                if (0 != o.snapDistance)
                                    if (v += l, Math.abs(v) > o.snapDistance) {
                                        var h = Math.floor(v / o.snapDistance);
                                        v %= o.snapDistance, l = o.snapDistance * h, c = !0
                                    } else l = 0;
                                y.reset(), o.attachedMesh.parent && (o.attachedMesh.parent.computeWorldMatrix().invertToRef(y), y.getRotationMatrixToRef(y), ys.Vector3.TransformCoordinatesToRef(_, y, _));
                                var d = Math.sin(l / 2);
                                x.set(_.x * d, _.y * d, _.z * d, Math.cos(l / 2)), 0 < y.determinant() && (x.toEulerAnglesToRef(b), ys.Quaternion.RotationYawPitchRollToRef(b.y, -b.x, -b.z, x)), o.updateGizmoRotationToMatchAttachedMesh ? o.attachedMesh.rotationQuaternion.multiplyToRef(x, o.attachedMesh.rotationQuaternion) : x.multiplyToRef(o.attachedMesh.rotationQuaternion, o.attachedMesh.rotationQuaternion), p.copyFrom(e.dragPlanePoint), c && (g.snapDistance = l, o.onSnapObservable.notifyObservers(g))
                            }
                        }), o._pointerObserver = r.utilityLayerScene.onPointerObservable.add(function(e, t) {
                            if (!o._customMeshSet) {
                                var i = e.pickInfo && -1 != o._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh) ? a : s;
                                o._rootMesh.getChildMeshes().forEach(function(e) {
                                    e.material = i, e.color && (e.color = i.emissiveColor)
                                })
                            }
                        }), o
                    }
                    return b(t, e), t.prototype._attachedMeshChanged = function(e) {
                        this.dragBehavior && (this.dragBehavior.enabled = !!e)
                    }, t.prototype.dispose = function() {
                        this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), e.prototype.dispose.call(this)
                    }, t
                }(ys.Gizmo), ys.PlaneRotationGizmo = bs, xs = $a || ($a = {}), Ts = function(e) {
                    function t(t) {
                        void 0 === t && (t = xs.UtilityLayerRenderer.DefaultUtilityLayer);
                        var i = e.call(this, t) || this;
                        return i.onDragStartObservable = new xs.Observable, i.onDragEndObservable = new xs.Observable, i.xGizmo = new xs.AxisDragGizmo(new xs.Vector3(1, 0, 0), xs.Color3.Red().scale(.5), t), i.yGizmo = new xs.AxisDragGizmo(new xs.Vector3(0, 1, 0), xs.Color3.Green().scale(.5), t), i.zGizmo = new xs.AxisDragGizmo(new xs.Vector3(0, 0, 1), xs.Color3.Blue().scale(.5), t), [i.xGizmo, i.yGizmo, i.zGizmo].forEach(function(e) {
                            e.dragBehavior.onDragStartObservable.add(function() {
                                    i.onDragStartObservable.notifyObservers({})
                                }),
                                e.dragBehavior.onDragEndObservable.add(function() {
                                    i.onDragEndObservable.notifyObservers({})
                                })
                        }), i.attachedMesh = null, i
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "attachedMesh", {
                        set: function(e) {
                            this.xGizmo && (this.xGizmo.attachedMesh = e, this.yGizmo.attachedMesh = e, this.zGizmo.attachedMesh = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "updateGizmoRotationToMatchAttachedMesh", {
                        get: function() {
                            return this.xGizmo.updateGizmoRotationToMatchAttachedMesh
                        },
                        set: function(e) {
                            this.xGizmo && (this.xGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.yGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.zGizmo.updateGizmoRotationToMatchAttachedMesh = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "snapDistance", {
                        get: function() {
                            return this.xGizmo.snapDistance
                        },
                        set: function(e) {
                            this.xGizmo && (this.xGizmo.snapDistance = e, this.yGizmo.snapDistance = e, this.zGizmo.snapDistance = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "scaleRatio", {
                        get: function() {
                            return this.xGizmo.scaleRatio
                        },
                        set: function(e) {
                            this.xGizmo && (this.xGizmo.scaleRatio = e, this.yGizmo.scaleRatio = e, this.zGizmo.scaleRatio = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.dispose = function() {
                        this.xGizmo.dispose(), this.yGizmo.dispose(), this.zGizmo.dispose(), this.onDragStartObservable.clear(), this.onDragEndObservable.clear()
                    }, t.prototype.setCustomMesh = function(e) {
                        xs.Tools.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)")
                    }, t
                }(xs.Gizmo), xs.PositionGizmo = Ts, Es = $a || ($a = {}), Ss = function(e) {
                    function t(t, i) {
                        void 0 === t && (t = Es.UtilityLayerRenderer.DefaultUtilityLayer), void 0 === i && (i = 32);
                        var r = e.call(this, t) || this;
                        return r.onDragStartObservable = new Es.Observable, r.onDragEndObservable = new Es.Observable, r.xGizmo = new Es.PlaneRotationGizmo(new Es.Vector3(1, 0, 0), Es.Color3.Red().scale(.5), t, i), r.yGizmo = new Es.PlaneRotationGizmo(new Es.Vector3(0, 1, 0), Es.Color3.Green().scale(.5), t, i), r.zGizmo = new Es.PlaneRotationGizmo(new Es.Vector3(0, 0, 1), Es.Color3.Blue().scale(.5), t, i), [r.xGizmo, r.yGizmo, r.zGizmo].forEach(function(e) {
                            e.dragBehavior.onDragStartObservable.add(function() {
                                r.onDragStartObservable.notifyObservers({})
                            }), e.dragBehavior.onDragEndObservable.add(function() {
                                r.onDragEndObservable.notifyObservers({})
                            })
                        }), r.attachedMesh = null, r
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "attachedMesh", {
                        set: function(e) {
                            this.xGizmo && (this.xGizmo.attachedMesh = e, this.yGizmo.attachedMesh = e, this.zGizmo.attachedMesh = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "updateGizmoRotationToMatchAttachedMesh", {
                        get: function() {
                            return this.xGizmo.updateGizmoRotationToMatchAttachedMesh
                        },
                        set: function(e) {
                            this.xGizmo && (this.xGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.yGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.zGizmo.updateGizmoRotationToMatchAttachedMesh = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "snapDistance", {
                        get: function() {
                            return this.xGizmo.snapDistance
                        },
                        set: function(e) {
                            this.xGizmo && (this.xGizmo.snapDistance = e, this.yGizmo.snapDistance = e, this.zGizmo.snapDistance = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "scaleRatio", {
                        get: function() {
                            return this.xGizmo.scaleRatio
                        },
                        set: function(e) {
                            this.xGizmo && (this.xGizmo.scaleRatio = e, this.yGizmo.scaleRatio = e, this.zGizmo.scaleRatio = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.dispose = function() {
                        this.xGizmo.dispose(), this.yGizmo.dispose(), this.zGizmo.dispose(), this.onDragStartObservable.clear(), this.onDragEndObservable.clear()
                    }, t.prototype.setCustomMesh = function(e) {
                        Es.Tools.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)")
                    }, t
                }(Es.Gizmo), Es.RotationGizmo = Ss, Ps = $a || ($a = {}), As = function(e) {
                    function t(t) {
                        void 0 === t && (t = Ps.UtilityLayerRenderer.DefaultUtilityLayer);
                        var i = e.call(this, t) || this;
                        i.onDragStartObservable = new Ps.Observable, i.onDragEndObservable = new Ps.Observable, i.xGizmo = new Ps.AxisScaleGizmo(new Ps.Vector3(1, 0, 0), Ps.Color3.Red().scale(.5), t), i.yGizmo = new Ps.AxisScaleGizmo(new Ps.Vector3(0, 1, 0), Ps.Color3.Green().scale(.5), t), i.zGizmo = new Ps.AxisScaleGizmo(new Ps.Vector3(0, 0, 1), Ps.Color3.Blue().scale(.5), t), i.uniformScaleGizmo = new Ps.AxisScaleGizmo(new Ps.Vector3(0, 1, 0), Ps.Color3.Yellow().scale(.5), t), i.uniformScaleGizmo.updateGizmoRotationToMatchAttachedMesh = !1, i.uniformScaleGizmo.uniformScaling = !0;
                        var r = Ps.Mesh.CreatePolyhedron("", {
                            type: 1
                        }, i.uniformScaleGizmo.gizmoLayer.utilityLayerScene);
                        r.scaling.scaleInPlace(.02), r.visibility = 0;
                        var n = Ps.Mesh.CreatePolyhedron("", {
                            type: 1
                        }, i.uniformScaleGizmo.gizmoLayer.utilityLayerScene);
                        return n.scaling.scaleInPlace(.007), r.addChild(n), i.uniformScaleGizmo.setCustomMesh(r, !0), [i.xGizmo, i.yGizmo, i.zGizmo, i.uniformScaleGizmo].forEach(function(e) {
                            e.dragBehavior.onDragStartObservable.add(function() {
                                i.onDragStartObservable.notifyObservers({})
                            }), e.dragBehavior.onDragEndObservable.add(function() {
                                i.onDragEndObservable.notifyObservers({})
                            })
                        }), i.attachedMesh = null, i
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "attachedMesh", {
                        set: function(e) {
                            this.xGizmo && (this.xGizmo.attachedMesh = e, this.yGizmo.attachedMesh = e, this.zGizmo.attachedMesh = e, this.uniformScaleGizmo.attachedMesh = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "updateGizmoRotationToMatchAttachedMesh", {
                        get: function() {
                            return this.xGizmo.updateGizmoRotationToMatchAttachedMesh
                        },
                        set: function(e) {
                            e || Ps.Tools.Warn("Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported."), this.xGizmo && (this.xGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.yGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.zGizmo.updateGizmoRotationToMatchAttachedMesh = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "snapDistance", {
                        get: function() {
                            return this.xGizmo.snapDistance
                        },
                        set: function(e) {
                            this.xGizmo && (this.xGizmo.snapDistance = e, this.yGizmo.snapDistance = e, this.zGizmo.snapDistance = e, this.uniformScaleGizmo.snapDistance = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "scaleRatio", {
                        get: function() {
                            return this.xGizmo.scaleRatio
                        },
                        set: function(e) {
                            this.xGizmo && (this.xGizmo.scaleRatio = e, this.yGizmo.scaleRatio = e, this.zGizmo.scaleRatio = e, this.uniformScaleGizmo.scaleRatio = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.dispose = function() {
                        this.xGizmo.dispose(), this.yGizmo.dispose(), this.zGizmo.dispose(), this.uniformScaleGizmo.dispose(), this.onDragStartObservable.clear(), this.onDragEndObservable.clear()
                    }, t
                }(Ps.Gizmo), Ps.ScaleGizmo = As, Cs = $a || ($a = {}), Ms = function(e) {
                    function t(i, r) {
                        void 0 === i && (i = Cs.Color3.Gray()), void 0 === r && (r = Cs.UtilityLayerRenderer.DefaultKeepDepthUtilityLayer);
                        var n = e.call(this, r) || this;
                        n._boundingDimensions = new Cs.Vector3(1, 1, 1), n._renderObserver = null, n._pointerObserver = null, n._scaleDragSpeed = .2, n._tmpQuaternion = new Cs.Quaternion, n._tmpVector = new Cs.Vector3(0, 0, 0), n._tmpRotationMatrix = new Cs.Matrix, n.ignoreChildren = !1, n.includeChildPredicate = null, n.rotationSphereSize = .1, n.scaleBoxSize = .1, n.fixedDragMeshScreenSize = !1, n.fixedDragMeshScreenSizeDistanceFactor = 10, n.onDragStartObservable = new Cs.Observable, n.onScaleBoxDragObservable = new Cs.Observable, n.onScaleBoxDragEndObservable = new Cs.Observable, n.onRotationSphereDragObservable = new Cs.Observable, n.onRotationSphereDragEndObservable = new Cs.Observable, n.scalePivot = null, n._existingMeshScale = new Cs.Vector3, n._updateScale = !1, n._anchorMesh = new Cs.AbstractMesh("anchor", r.utilityLayerScene);
                        var o = new Cs.StandardMaterial("", r.utilityLayerScene);
                        o.disableLighting = !0, o.emissiveColor = i;
                        var s = new Cs.StandardMaterial("", r.utilityLayerScene);
                        s.disableLighting = !0, s.emissiveColor = i.clone().add(new Cs.Color3(.3, .3, .3)), n._lineBoundingBox = new Cs.AbstractMesh("", r.utilityLayerScene), n._lineBoundingBox.rotationQuaternion = new Cs.Quaternion;
                        var a = [];
                        a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(0, 0, 0), new Cs.Vector3(n._boundingDimensions.x, 0, 0)]
                        }, r.utilityLayerScene)), a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(0, 0, 0), new Cs.Vector3(0, n._boundingDimensions.y, 0)]
                        }, r.utilityLayerScene)), a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(0, 0, 0), new Cs.Vector3(0, 0, n._boundingDimensions.z)]
                        }, r.utilityLayerScene)), a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(n._boundingDimensions.x, 0, 0), new Cs.Vector3(n._boundingDimensions.x, n._boundingDimensions.y, 0)]
                        }, r.utilityLayerScene)), a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(n._boundingDimensions.x, 0, 0), new Cs.Vector3(n._boundingDimensions.x, 0, n._boundingDimensions.z)]
                        }, r.utilityLayerScene)), a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(0, n._boundingDimensions.y, 0), new Cs.Vector3(n._boundingDimensions.x, n._boundingDimensions.y, 0)]
                        }, r.utilityLayerScene)), a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(0, n._boundingDimensions.y, 0), new Cs.Vector3(0, n._boundingDimensions.y, n._boundingDimensions.z)]
                        }, r.utilityLayerScene)), a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(0, 0, n._boundingDimensions.z), new Cs.Vector3(n._boundingDimensions.x, 0, n._boundingDimensions.z)]
                        }, r.utilityLayerScene)), a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(0, 0, n._boundingDimensions.z), new Cs.Vector3(0, n._boundingDimensions.y, n._boundingDimensions.z)]
                        }, r.utilityLayerScene)), a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(n._boundingDimensions.x, n._boundingDimensions.y, n._boundingDimensions.z), new Cs.Vector3(0, n._boundingDimensions.y, n._boundingDimensions.z)]
                        }, r.utilityLayerScene)), a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(n._boundingDimensions.x, n._boundingDimensions.y, n._boundingDimensions.z), new Cs.Vector3(n._boundingDimensions.x, 0, n._boundingDimensions.z)]
                        }, r.utilityLayerScene)), a.push(Cs.MeshBuilder.CreateLines("lines", {
                            points: [new Cs.Vector3(n._boundingDimensions.x, n._boundingDimensions.y, n._boundingDimensions.z), new Cs.Vector3(n._boundingDimensions.x, n._boundingDimensions.y, 0)]
                        }, r.utilityLayerScene)), a.forEach(function(e) {
                            e.color = i, e.position.addInPlace(new Cs.Vector3(-n._boundingDimensions.x / 2, -n._boundingDimensions.y / 2, -n._boundingDimensions.z / 2)), e.isPickable = !1, n._lineBoundingBox.addChild(e)
                        }), n._rootMesh.addChild(n._lineBoundingBox), n._rotateSpheresParent = new Cs.AbstractMesh("", r.utilityLayerScene), n._rotateSpheresParent.rotationQuaternion = new Cs.Quaternion;
                        for (var l = this, u = 0; u < 12; u++) ! function(e) {
                            var i = Cs.MeshBuilder.CreateSphere("", {
                                diameter: 1
                            }, r.utilityLayerScene);
                            i.rotationQuaternion = new Cs.Quaternion, i.material = o, (d = new Cs.PointerDragBehavior({})).moveAttached = !1, d.updateDragPlane = !1, i.addBehavior(d);
                            var s = new Cs.Vector3(1, 0, 0),
                                a = 0;
                            d.onDragStartObservable.add(function(e) {
                                s.copyFrom(i.forward), a = 0
                            }), d.onDragObservable.add(function(i) {
                                if (n.onRotationSphereDragObservable.notifyObservers({}), n.attachedMesh) {
                                    t._RemoveAndStorePivotPoint(n.attachedMesh);
                                    var r = s,
                                        o = i.dragPlaneNormal.scale(Cs.Vector3.Dot(i.dragPlaneNormal, r)),
                                        l = r.subtract(o).normalizeToNew(),
                                        u = -Cs.Vector3.Dot(l, i.delta);
                                    u = u / n._boundingDimensions.length() * n._anchorMesh.scaling.length(), n.attachedMesh.rotationQuaternion || (n.attachedMesh.rotationQuaternion = Cs.Quaternion.RotationYawPitchRoll(n.attachedMesh.rotation.y, n.attachedMesh.rotation.x, n.attachedMesh.rotation.z)), n._anchorMesh.rotationQuaternion || (n._anchorMesh.rotationQuaternion = Cs.Quaternion.RotationYawPitchRoll(n._anchorMesh.rotation.y, n._anchorMesh.rotation.x, n._anchorMesh.rotation.z)), a += u, Math.abs(a) <= 2 * Math.PI && (8 <= e ? Cs.Quaternion.RotationYawPitchRollToRef(0, 0, u, n._tmpQuaternion) : 4 <= e ? Cs.Quaternion.RotationYawPitchRollToRef(u, 0, 0, n._tmpQuaternion) : Cs.Quaternion.RotationYawPitchRollToRef(0, u, 0, n._tmpQuaternion), n._anchorMesh.addChild(n.attachedMesh), n._anchorMesh.rotationQuaternion.multiplyToRef(n._tmpQuaternion, n._anchorMesh.rotationQuaternion), n._anchorMesh.removeChild(n.attachedMesh)), n.updateBoundingBox(), t._RestorePivotPoint(n.attachedMesh)
                                }
                            }), d.onDragStartObservable.add(function() {
                                n.onDragStartObservable.notifyObservers({}), n._selectNode(i)
                            }), d.onDragEndObservable.add(function() {
                                n.onRotationSphereDragEndObservable.notifyObservers({}), n._selectNode(null)
                            }), l._rotateSpheresParent.addChild(i)
                        }(u);
                        n._rootMesh.addChild(n._rotateSpheresParent), n._scaleBoxesParent = new Cs.AbstractMesh("", r.utilityLayerScene), n._scaleBoxesParent.rotationQuaternion = new Cs.Quaternion;
                        for (var c = 0; c < 2; c++)
                            for (var h = 0; h < 2; h++)
                                for (var d, p = this, f = 0; f < 2; f++) ! function() {
                                    var e = Cs.MeshBuilder.CreateBox("", {
                                        size: 1
                                    }, r.utilityLayerScene);
                                    e.material = o;
                                    var i = new Cs.Vector3(0 == c ? -1 : 1, 0 == h ? -1 : 1, 0 == f ? -1 : 1);
                                    (d = new Cs.PointerDragBehavior({
                                        dragAxis: i
                                    })).moveAttached = !1, e.addBehavior(d), d.onDragObservable.add(function(i) {
                                        if (n.onScaleBoxDragObservable.notifyObservers({}), n.attachedMesh) {
                                            t._RemoveAndStorePivotPoint(n.attachedMesh);
                                            var r = i.dragDistance / n._boundingDimensions.length() * n._anchorMesh.scaling.length(),
                                                o = new Cs.Vector3(r, r, r);
                                            o.scaleInPlace(n._scaleDragSpeed), n.updateBoundingBox(), n.scalePivot ? (n.attachedMesh.getWorldMatrix().getRotationMatrixToRef(n._tmpRotationMatrix), n._boundingDimensions.scaleToRef(.5, n._tmpVector), Cs.Vector3.TransformCoordinatesToRef(n._tmpVector, n._tmpRotationMatrix, n._tmpVector), n._anchorMesh.position.subtractInPlace(n._tmpVector), n._boundingDimensions.multiplyToRef(n.scalePivot, n._tmpVector), Cs.Vector3.TransformCoordinatesToRef(n._tmpVector, n._tmpRotationMatrix, n._tmpVector), n._anchorMesh.position.addInPlace(n._tmpVector)) : (e.absolutePosition.subtractToRef(n._anchorMesh.position, n._tmpVector), n._anchorMesh.position.subtractInPlace(n._tmpVector)), n._anchorMesh.addChild(n.attachedMesh), n._anchorMesh.scaling.addInPlace(o), (n._anchorMesh.scaling.x < 0 || n._anchorMesh.scaling.y < 0 || n._anchorMesh.scaling.z < 0) && n._anchorMesh.scaling.subtractInPlace(o), n._anchorMesh.removeChild(n.attachedMesh), t._RestorePivotPoint(n.attachedMesh)
                                        }
                                    }), d.onDragStartObservable.add(function() {
                                        n.onDragStartObservable.notifyObservers({}), n._selectNode(e)
                                    }), d.onDragEndObservable.add(function() {
                                        n.onScaleBoxDragEndObservable.notifyObservers({}), n._selectNode(null)
                                    }), p._scaleBoxesParent.addChild(e)
                                }();
                        n._rootMesh.addChild(n._scaleBoxesParent);
                        var _ = new Array;
                        return n._pointerObserver = r.utilityLayerScene.onPointerObservable.add(function(e, t) {
                            _[e.event.pointerId] ? e.pickInfo && e.pickInfo.pickedMesh != _[e.event.pointerId] && (_[e.event.pointerId].material = o, delete _[e.event.pointerId]) : n._rotateSpheresParent.getChildMeshes().concat(n._scaleBoxesParent.getChildMeshes()).forEach(function(t) {
                                e.pickInfo && e.pickInfo.pickedMesh == t && ((_[e.event.pointerId] = t).material = s)
                            })
                        }), n._renderObserver = n.gizmoLayer.originalScene.onBeforeRenderObservable.add(function() {
                            n.attachedMesh && !n._existingMeshScale.equals(n.attachedMesh.scaling) && n.updateBoundingBox()
                        }), n.updateBoundingBox(), n
                    }
                    return b(t, e), t._RemoveAndStorePivotPoint = function(e) {
                        e && 0 === t._PivotCached && (e.getPivotPointToRef(t._OldPivotPoint), t._OldPivotPoint.equalsToFloats(0, 0, 0) || (e.setPivotMatrix(Cs.Matrix.IdentityReadOnly), t._OldPivotPoint.subtractToRef(e.getPivotPoint(), t._PivotTranslation), t._PivotTmpVector.copyFromFloats(1, 1, 1), t._PivotTmpVector.subtractInPlace(e.scaling), t._PivotTmpVector.multiplyInPlace(t._PivotTranslation), e.position.addInPlace(t._PivotTmpVector))), t._PivotCached++
                    }, t._RestorePivotPoint = function(e) {
                        e && !t._OldPivotPoint.equalsToFloats(0, 0, 0) && 1 === t._PivotCached && (e.setPivotPoint(t._OldPivotPoint), t._PivotTmpVector.copyFromFloats(1, 1, 1), t._PivotTmpVector.subtractInPlace(e.scaling), t._PivotTmpVector.multiplyInPlace(t._PivotTranslation), e.position.subtractInPlace(t._PivotTmpVector)), this._PivotCached--
                    }, t.prototype._attachedMeshChanged = function(e) {
                        e && (t._RemoveAndStorePivotPoint(e), this._anchorMesh.addChild(e), this._anchorMesh.removeChild(e), t._RestorePivotPoint(e), this.updateBoundingBox())
                    }, t.prototype._selectNode = function(e) {
                        this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach(function(t, i) {
                            t.isVisible = !e || t == e
                        })
                    }, t.prototype.updateBoundingBox = function() {
                        if (this.attachedMesh) {
                            t._RemoveAndStorePivotPoint(this.attachedMesh), this._update(), this.attachedMesh.rotationQuaternion || (this.attachedMesh.rotationQuaternion = Cs.Quaternion.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z)), this._anchorMesh.rotationQuaternion || (this._anchorMesh.rotationQuaternion = Cs.Quaternion.RotationYawPitchRoll(this._anchorMesh.rotation.y, this._anchorMesh.rotation.x, this._anchorMesh.rotation.z)), this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion), this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion), this._tmpVector.copyFrom(this.attachedMesh.position), this.attachedMesh.rotationQuaternion.set(0, 0, 0, 1), this.attachedMesh.position.set(0, 0, 0);
                            var e = this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren, this.includeChildPredicate);
                            e.max.subtractToRef(e.min, this._boundingDimensions), this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions), this._lineBoundingBox.position.set((e.max.x + e.min.x) / 2, (e.max.y + e.min.y) / 2, (e.max.z + e.min.z) / 2), this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position), this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position), this._lineBoundingBox.computeWorldMatrix(), this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition), this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion), this.attachedMesh.position.copyFrom(this._tmpVector)
                        }
                        for (var i = this._rotateSpheresParent.getChildMeshes(), r = 0; r < 3; r++)
                            for (var n = 0; n < 2; n++)
                                for (var o = 0; o < 2; o++) {
                                    var s = 4 * r + 2 * n + o;
                                    if (0 == r && (i[s].position.set(this._boundingDimensions.x / 2, this._boundingDimensions.y * n, this._boundingDimensions.z * o), i[s].position.addInPlace(new Cs.Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), i[s].lookAt(Cs.Vector3.Cross(Cs.Vector3.Right(), i[s].position.normalizeToNew()).normalizeToNew().add(i[s].position))), 1 == r && (i[s].position.set(this._boundingDimensions.x * n, this._boundingDimensions.y / 2, this._boundingDimensions.z * o), i[s].position.addInPlace(new Cs.Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), i[s].lookAt(Cs.Vector3.Cross(Cs.Vector3.Up(), i[s].position.normalizeToNew()).normalizeToNew().add(i[s].position))), 2 == r && (i[s].position.set(this._boundingDimensions.x * n, this._boundingDimensions.y * o, this._boundingDimensions.z / 2), i[s].position.addInPlace(new Cs.Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), i[s].lookAt(Cs.Vector3.Cross(Cs.Vector3.Forward(), i[s].position.normalizeToNew()).normalizeToNew().add(i[s].position))), this.fixedDragMeshScreenSize) {
                                        this._rootMesh.computeWorldMatrix(), this._rotateSpheresParent.computeWorldMatrix(), i[s].computeWorldMatrix(), i[s].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);
                                        var a = this.rotationSphereSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor;
                                        i[s].scaling.set(a, a, a)
                                    } else i[s].scaling.set(this.rotationSphereSize, this.rotationSphereSize, this.rotationSphereSize)
                                }
                        var l = this._scaleBoxesParent.getChildMeshes();
                        for (r = 0; r < 2; r++)
                            for (n = 0; n < 2; n++)
                                for (o = 0; o < 2; o++) l[s = 4 * r + 2 * n + o] && (l[s].position.set(this._boundingDimensions.x * r, this._boundingDimensions.y * n, this._boundingDimensions.z * o), l[s].position.addInPlace(new Cs.Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), this.fixedDragMeshScreenSize ? (this._rootMesh.computeWorldMatrix(), this._scaleBoxesParent.computeWorldMatrix(), l[s].computeWorldMatrix(), l[s].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector), a = this.scaleBoxSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor, l[s].scaling.set(a, a, a)) : l[s].scaling.set(this.scaleBoxSize, this.scaleBoxSize, this.scaleBoxSize));
                        this.attachedMesh && (this._existingMeshScale.copyFrom(this.attachedMesh.scaling), t._RestorePivotPoint(this.attachedMesh))
                    }, t.prototype.setEnabledRotationAxis = function(e) {
                        this._rotateSpheresParent.getChildMeshes().forEach(function(t, i) {
                            i < 4 ? t.setEnabled(-1 != e.indexOf("x")) : i < 8 ? t.setEnabled(-1 != e.indexOf("y")) : t.setEnabled(-1 != e.indexOf("z"))
                        })
                    }, t.prototype.dispose = function() {
                        this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver), this._lineBoundingBox.dispose(), this._rotateSpheresParent.dispose(), this._scaleBoxesParent.dispose(), e.prototype.dispose.call(this)
                    }, t.MakeNotPickableAndWrapInBoundingBox = function(e) {
                        var t = function(e) {
                            e.isPickable = !1, e.getChildMeshes().forEach(function(e) {
                                t(e)
                            })
                        };
                        t(e), e.rotationQuaternion || (e.rotationQuaternion = Cs.Quaternion.RotationYawPitchRoll(e.rotation.y, e.rotation.x, e.rotation.z));
                        var i = e.position.clone(),
                            r = e.rotationQuaternion.clone();
                        e.rotationQuaternion.set(0, 0, 0, 1), e.position.set(0, 0, 0);
                        var n = Cs.MeshBuilder.CreateBox("box", {
                                size: 1
                            }, e.getScene()),
                            o = e.getHierarchyBoundingVectors();
                        return o.max.subtractToRef(o.min, n.scaling), n.position.set((o.max.x + o.min.x) / 2, (o.max.y + o.min.y) / 2, (o.max.z + o.min.z) / 2), e.addChild(n), e.rotationQuaternion.copyFrom(r), e.position.copyFrom(i), e.removeChild(n), n.addChild(e), n.visibility = 0, n
                    }, t.prototype.setCustomMesh = function(e) {
                        Cs.Tools.Error("Custom meshes are not supported on this gizmo")
                    }, t._PivotCached = 0, t._OldPivotPoint = new Cs.Vector3, t._PivotTranslation = new Cs.Vector3, t._PivotTmpVector = new Cs.Vector3, t
                }(Cs.Gizmo), Cs.BoundingBoxGizmo = Ms, Rs = $a || ($a = {}), Os = function() {
                    function e(e) {
                        var t = this;
                        this.scene = e, this._gizmosEnabled = {
                            positionGizmo: !1,
                            rotationGizmo: !1,
                            scaleGizmo: !1,
                            boundingBoxGizmo: !1
                        }, this._pointerObserver = null, this._attachedMesh = null, this._boundingBoxColor = Rs.Color3.FromHexString("#0984e3"), this.boundingBoxDragBehavior = new Rs.SixDofDragBehavior, this.attachableMeshes = null, this.usePointerToAttachGizmos = !0, this._defaultKeepDepthUtilityLayer = new Rs.UtilityLayerRenderer(e), this._defaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = !1, this._defaultUtilityLayer = new Rs.UtilityLayerRenderer(e), this.gizmos = {
                            positionGizmo: null,
                            rotationGizmo: null,
                            scaleGizmo: null,
                            boundingBoxGizmo: null
                        }, this._pointerObserver = e.onPointerObservable.add(function(e, i) {
                            if (t.usePointerToAttachGizmos && e.type == Rs.PointerEventTypes.POINTERDOWN)
                                if (e.pickInfo && e.pickInfo.pickedMesh) {
                                    var r = e.pickInfo.pickedMesh;
                                    if (null == t.attachableMeshes)
                                        for (; r && null != r.parent;) r = r.parent;
                                    else {
                                        var n = !1;
                                        t.attachableMeshes.forEach(function(e) {
                                            r && (r == e || r.isDescendantOf(e)) && (r = e, n = !0)
                                        }), n || (r = null)
                                    }
                                    r instanceof Rs.AbstractMesh ? t._attachedMesh != r && t.attachToMesh(r) : t.attachToMesh(null)
                                } else t.attachToMesh(null)
                        })
                    }
                    return e.prototype.attachToMesh = function(e) {
                        for (var t in this._attachedMesh && this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh = e, this.gizmos) {
                            var i = this.gizmos[t];
                            i && this._gizmosEnabled[t] && (i.attachedMesh = e)
                        }
                        this.boundingBoxGizmoEnabled && this._attachedMesh && this._attachedMesh.addBehavior(this.boundingBoxDragBehavior)
                    }, Object.defineProperty(e.prototype, "positionGizmoEnabled", {
                        get: function() {
                            return this._gizmosEnabled.positionGizmo
                        },
                        set: function(e) {
                            e ? (this.gizmos.positionGizmo || (this.gizmos.positionGizmo = new Rs.PositionGizmo(this._defaultUtilityLayer)), this.gizmos.positionGizmo.attachedMesh = this._attachedMesh) : this.gizmos.positionGizmo && (this.gizmos.positionGizmo.attachedMesh = null), this._gizmosEnabled.positionGizmo = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "rotationGizmoEnabled", {
                        get: function() {
                            return this._gizmosEnabled.rotationGizmo
                        },
                        set: function(e) {
                            e ? (this.gizmos.rotationGizmo || (this.gizmos.rotationGizmo = new Rs.RotationGizmo(this._defaultUtilityLayer)), this.gizmos.rotationGizmo.attachedMesh = this._attachedMesh) : this.gizmos.rotationGizmo && (this.gizmos.rotationGizmo.attachedMesh = null), this._gizmosEnabled.rotationGizmo = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "scaleGizmoEnabled", {
                        get: function() {
                            return this._gizmosEnabled.scaleGizmo
                        },
                        set: function(e) {
                            e ? (this.gizmos.scaleGizmo = this.gizmos.scaleGizmo || new Rs.ScaleGizmo(this._defaultUtilityLayer), this.gizmos.scaleGizmo.attachedMesh = this._attachedMesh) : this.gizmos.scaleGizmo && (this.gizmos.scaleGizmo.attachedMesh = null), this._gizmosEnabled.scaleGizmo = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "boundingBoxGizmoEnabled", {
                        get: function() {
                            return this._gizmosEnabled.boundingBoxGizmo
                        },
                        set: function(e) {
                            e ? (this.gizmos.boundingBoxGizmo = this.gizmos.boundingBoxGizmo || new Rs.BoundingBoxGizmo(this._boundingBoxColor, this._defaultKeepDepthUtilityLayer), this.gizmos.boundingBoxGizmo.attachedMesh = this._attachedMesh, this._attachedMesh && (this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh.addBehavior(this.boundingBoxDragBehavior))) : this.gizmos.boundingBoxGizmo && (this.gizmos.boundingBoxGizmo.attachedMesh = null), this._gizmosEnabled.boundingBoxGizmo = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.dispose = function() {
                        for (var e in this.scene.onPointerObservable.remove(this._pointerObserver), this.gizmos) {
                            var t = this.gizmos[e];
                            t && t.dispose()
                        }
                        this._defaultKeepDepthUtilityLayer.dispose(), this._defaultUtilityLayer.dispose(), this.boundingBoxDragBehavior.detach()
                    }, e
                }(), Rs.GizmoManager = Os, ws = $a || ($a = {}), Is = function() {
                    function e(e, t, i) {
                        void 0 === t && (t = 0), void 0 === i && (i = null), this.name = e, this.animations = new Array, this._positions = null, this._normals = null, this._tangents = null, this.onInfluenceChanged = new ws.Observable, this._onDataLayoutChanged = new ws.Observable, this._animationPropertiesOverride = null, this._scene = i || ws.Engine.LastCreatedScene, this.influence = t
                    }
                    return Object.defineProperty(e.prototype, "influence", {
                        get: function() {
                            return this._influence
                        },
                        set: function(e) {
                            if (this._influence !== e) {
                                var t = this._influence;
                                this._influence = e, this.onInfluenceChanged.hasObservers && this.onInfluenceChanged.notifyObservers(0 === t || 0 === e)
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "animationPropertiesOverride", {
                        get: function() {
                            return !this._animationPropertiesOverride && this._scene ? this._scene.animationPropertiesOverride : this._animationPropertiesOverride
                        },
                        set: function(e) {
                            this._animationPropertiesOverride = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "hasPositions", {
                        get: function() {
                            return !!this._positions
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "hasNormals", {
                        get: function() {
                            return !!this._normals
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "hasTangents", {
                        get: function() {
                            return !!this._tangents
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.setPositions = function(e) {
                        var t = this.hasPositions;
                        this._positions = e, t !== this.hasPositions && this._onDataLayoutChanged.notifyObservers(void 0)
                    }, e.prototype.getPositions = function() {
                        return this._positions
                    }, e.prototype.setNormals = function(e) {
                        var t = this.hasNormals;
                        this._normals = e, t !== this.hasNormals && this._onDataLayoutChanged.notifyObservers(void 0)
                    }, e.prototype.getNormals = function() {
                        return this._normals
                    }, e.prototype.setTangents = function(e) {
                        var t = this.hasTangents;
                        this._tangents = e, t !== this.hasTangents && this._onDataLayoutChanged.notifyObservers(void 0)
                    }, e.prototype.getTangents = function() {
                        return this._tangents
                    }, e.prototype.serialize = function() {
                        var e = {};
                        return e.name = this.name, e.influence = this.influence, e.positions = Array.prototype.slice.call(this.getPositions()), this.hasNormals && (e.normals = Array.prototype.slice.call(this.getNormals())), this.hasTangents && (e.tangents = Array.prototype.slice.call(this.getTangents())), ws.Animation.AppendSerializedAnimations(this, e), e
                    }, e.Parse = function(t) {
                        var i = new e(t.name, t.influence);
                        if (i.setPositions(t.positions), t.normals && i.setNormals(t.normals), t.tangents && i.setTangents(t.tangents), t.animations)
                            for (var r = 0; r < t.animations.length; r++) {
                                var n = t.animations[r];
                                i.animations.push(ws.Animation.Parse(n))
                            }
                        return i
                    }, e.FromMesh = function(t, i, r) {
                        i || (i = t.name);
                        var n = new e(i, r, t.getScene());
                        return n.setPositions(t.getVerticesData(ws.VertexBuffer.PositionKind)), t.isVerticesDataPresent(ws.VertexBuffer.NormalKind) && n.setNormals(t.getVerticesData(ws.VertexBuffer.NormalKind)), t.isVerticesDataPresent(ws.VertexBuffer.TangentKind) && n.setTangents(t.getVerticesData(ws.VertexBuffer.TangentKind)), n
                    }, e
                }(), ws.MorphTarget = Is, Ds = $a || ($a = {}), Ls = function() {
                    function e(e) {
                        void 0 === e && (e = null), this._targets = new Array, this._targetInfluenceChangedObservers = new Array, this._targetDataLayoutChangedObservers = new Array, this._activeTargets = new Ds.SmartArray(16), this._supportsNormals = !1, this._supportsTangents = !1, this._vertexCount = 0, this._uniqueId = 0, this._tempInfluences = new Array, e || (e = Ds.Engine.LastCreatedScene), this._scene = e, this._scene && (this._scene.morphTargetManagers.push(this), this._uniqueId = this._scene.getUniqueId())
                    }
                    return Object.defineProperty(e.prototype, "uniqueId", {
                        get: function() {
                            return this._uniqueId
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "vertexCount", {
                        get: function() {
                            return this._vertexCount
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "supportsNormals", {
                        get: function() {
                            return this._supportsNormals
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "supportsTangents", {
                        get: function() {
                            return this._supportsTangents
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "numTargets", {
                        get: function() {
                            return this._targets.length
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "numInfluencers", {
                        get: function() {
                            return this._activeTargets.length
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "influences", {
                        get: function() {
                            return this._influences
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getActiveTarget = function(e) {
                        return this._activeTargets.data[e]
                    }, e.prototype.getTarget = function(e) {
                        return this._targets[e]
                    }, e.prototype.addTarget = function(e) {
                        var t = this;
                        this._targets.push(e), this._targetInfluenceChangedObservers.push(e.onInfluenceChanged.add(function(e) {
                            t._syncActiveTargets(e)
                        })), this._targetDataLayoutChangedObservers.push(e._onDataLayoutChanged.add(function() {
                            t._syncActiveTargets(!0)
                        })), this._syncActiveTargets(!0)
                    }, e.prototype.removeTarget = function(e) {
                        var t = this._targets.indexOf(e);
                        0 <= t && (this._targets.splice(t, 1), e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t, 1)[0]), e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t, 1)[0]), this._syncActiveTargets(!0))
                    }, e.prototype.serialize = function() {
                        var e = {};
                        e.id = this.uniqueId, e.targets = [];
                        for (var t = 0, i = this._targets; t < i.length; t++) {
                            var r = i[t];
                            e.targets.push(r.serialize())
                        }
                        return e
                    }, e.prototype._syncActiveTargets = function(e) {
                        var t = 0;
                        this._activeTargets.reset(), this._supportsNormals = !0, this._supportsTangents = !0;
                        for (var i = this._vertexCount = 0, r = this._targets; i < r.length; i++) {
                            var n = r[i];
                            if (0 !== n.influence) {
                                this._activeTargets.push(n), this._tempInfluences[t++] = n.influence, this._supportsNormals = this._supportsNormals && n.hasNormals, this._supportsTangents = this._supportsTangents && n.hasTangents;
                                var o = n.getPositions();
                                if (o) {
                                    var s = o.length / 3;
                                    if (0 === this._vertexCount) this._vertexCount = s;
                                    else if (this._vertexCount !== s) return void Ds.Tools.Error("Incompatible target. Targets must all have the same vertices count.")
                                }
                            }
                        }
                        this._influences && this._influences.length === t || (this._influences = new Float32Array(t));
                        for (var a = 0; a < t; a++) this._influences[a] = this._tempInfluences[a];
                        e && this.synchronize()
                    }, e.prototype.synchronize = function() {
                        if (this._scene)
                            for (var e = 0, t = this._scene.meshes; e < t.length; e++) {
                                var i = t[e];
                                i.morphTargetManager === this && i._syncGeometryWithMorphTargetManager()
                            }
                    }, e.Parse = function(t, i) {
                        var r = new e(i);
                        r._uniqueId = t.id;
                        for (var n = 0, o = t.targets; n < o.length; n++) {
                            var s = o[n];
                            r.addTarget(Ds.MorphTarget.Parse(s))
                        }
                        return r
                    }, e
                }(), Ds.MorphTargetManager = Ls, Bs = $a || ($a = {}), Fs = function() {
                    function e(e, t, i) {
                        void 0 === i && (i = 2), this.maxDepth = i, this.dynamicContent = new Array, this._maxBlockCapacity = t || 64, this._selectionContent = new Bs.SmartArrayNoDuplicate(1024),
                            this._creationFunc = e
                    }
                    return e.prototype.update = function(t, i, r) {
                        e._CreateBlocks(t, i, r, this._maxBlockCapacity, 0, this.maxDepth, this, this._creationFunc)
                    }, e.prototype.addMesh = function(e) {
                        for (var t = 0; t < this.blocks.length; t++) this.blocks[t].addEntry(e)
                    }, e.prototype.select = function(e, t) {
                        this._selectionContent.reset();
                        for (var i = 0; i < this.blocks.length; i++) this.blocks[i].select(e, this._selectionContent, t);
                        return t ? this._selectionContent.concat(this.dynamicContent) : this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent
                    }, e.prototype.intersects = function(e, t, i) {
                        this._selectionContent.reset();
                        for (var r = 0; r < this.blocks.length; r++) this.blocks[r].intersects(e, t, this._selectionContent, i);
                        return i ? this._selectionContent.concat(this.dynamicContent) : this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent
                    }, e.prototype.intersectsRay = function(e) {
                        this._selectionContent.reset();
                        for (var t = 0; t < this.blocks.length; t++) this.blocks[t].intersectsRay(e, this._selectionContent);
                        return this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent
                    }, e._CreateBlocks = function(e, t, i, r, n, o, s, a) {
                        s.blocks = new Array;
                        for (var l = new Bs.Vector3((t.x - e.x) / 2, (t.y - e.y) / 2, (t.z - e.z) / 2), u = 0; u < 2; u++)
                            for (var c = 0; c < 2; c++)
                                for (var h = 0; h < 2; h++) {
                                    var d = e.add(l.multiplyByFloats(u, c, h)),
                                        p = e.add(l.multiplyByFloats(u + 1, c + 1, h + 1)),
                                        f = new Bs.OctreeBlock(d, p, r, n + 1, o, a);
                                    f.addEntries(i), s.blocks.push(f)
                                }
                    }, e.CreationFuncForMeshes = function(e, t) {
                        var i = e.getBoundingInfo();
                        !e.isBlocked && i.boundingBox.intersectsMinMax(t.minPoint, t.maxPoint) && t.entries.push(e)
                    }, e.CreationFuncForSubMeshes = function(e, t) {
                        e.getBoundingInfo().boundingBox.intersectsMinMax(t.minPoint, t.maxPoint) && t.entries.push(e)
                    }, e
                }(), Bs.Octree = Fs, Ns = $a || ($a = {}), Vs = function() {
                    function e(e, t, i, r, n, o) {
                        this.entries = new Array, this._boundingVectors = new Array, this._capacity = i, this._depth = r, this._maxDepth = n, this._creationFunc = o, this._minPoint = e, this._maxPoint = t, this._boundingVectors.push(e.clone()), this._boundingVectors.push(t.clone()), this._boundingVectors.push(e.clone()), this._boundingVectors[2].x = t.x, this._boundingVectors.push(e.clone()), this._boundingVectors[3].y = t.y, this._boundingVectors.push(e.clone()), this._boundingVectors[4].z = t.z, this._boundingVectors.push(t.clone()), this._boundingVectors[5].z = e.z, this._boundingVectors.push(t.clone()), this._boundingVectors[6].x = e.x, this._boundingVectors.push(t.clone()), this._boundingVectors[7].y = e.y
                    }
                    return Object.defineProperty(e.prototype, "capacity", {
                        get: function() {
                            return this._capacity
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "minPoint", {
                        get: function() {
                            return this._minPoint
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "maxPoint", {
                        get: function() {
                            return this._maxPoint
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.addEntry = function(e) {
                        if (this.blocks)
                            for (var t = 0; t < this.blocks.length; t++) this.blocks[t].addEntry(e);
                        else this._creationFunc(e, this), this.entries.length > this.capacity && this._depth < this._maxDepth && this.createInnerBlocks()
                    }, e.prototype.addEntries = function(e) {
                        for (var t = 0; t < e.length; t++) {
                            var i = e[t];
                            this.addEntry(i)
                        }
                    }, e.prototype.select = function(e, t, i) {
                        if (Ns.BoundingBox.IsInFrustum(this._boundingVectors, e)) {
                            if (this.blocks) {
                                for (var r = 0; r < this.blocks.length; r++) this.blocks[r].select(e, t, i);
                                return
                            }
                            i ? t.concat(this.entries) : t.concatWithNoDuplicate(this.entries)
                        }
                    }, e.prototype.intersects = function(e, t, i, r) {
                        if (Ns.BoundingBox.IntersectsSphere(this._minPoint, this._maxPoint, e, t)) {
                            if (this.blocks) {
                                for (var n = 0; n < this.blocks.length; n++) this.blocks[n].intersects(e, t, i, r);
                                return
                            }
                            r ? i.concat(this.entries) : i.concatWithNoDuplicate(this.entries)
                        }
                    }, e.prototype.intersectsRay = function(e, t) {
                        if (e.intersectsBoxMinMax(this._minPoint, this._maxPoint)) {
                            if (this.blocks) {
                                for (var i = 0; i < this.blocks.length; i++) this.blocks[i].intersectsRay(e, t);
                                return
                            }
                            t.concatWithNoDuplicate(this.entries)
                        }
                    }, e.prototype.createInnerBlocks = function() {
                        Ns.Octree._CreateBlocks(this._minPoint, this._maxPoint, this.entries, this._capacity, this._depth, this._maxDepth, this, this._creationFunc)
                    }, e
                }(), Ns.OctreeBlock = Vs,
                function(e) {
                    e.Scene.prototype.createOrUpdateSelectionOctree = function(i, r) {
                        void 0 === i && (i = 64), void 0 === r && (r = 2);
                        var n = this._getComponent(e.SceneComponentConstants.NAME_OCTREE);
                        n || (n = new t(this), this._addComponent(n)), this._selectionOctree || (this._selectionOctree = new e.Octree(e.Octree.CreationFuncForMeshes, i, r));
                        var o = this.getWorldExtends();
                        return this._selectionOctree.update(o.min, o.max, this.meshes), this._selectionOctree
                    }, Object.defineProperty(e.Scene.prototype, "selectionOctree", {
                        get: function() {
                            return this._selectionOctree
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.AbstractMesh.prototype.createOrUpdateSubmeshesOctree = function(i, r) {
                        void 0 === i && (i = 64), void 0 === r && (r = 2);
                        var n = this.getScene(),
                            o = n._getComponent(e.SceneComponentConstants.NAME_OCTREE);
                        o || (o = new t(n), n._addComponent(o)), this._submeshesOctree || (this._submeshesOctree = new e.Octree(e.Octree.CreationFuncForSubMeshes, i, r)), this.computeWorldMatrix(!0);
                        var s = this.getBoundingInfo().boundingBox;
                        return this._submeshesOctree.update(s.minimumWorld, s.maximumWorld, this.subMeshes), this._submeshesOctree
                    };
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_OCTREE, this.checksIsEnabled = !0, this._tempRay = new e.Ray(e.Vector3.Zero(), new e.Vector3(1, 1, 1)), this.scene = t, this.scene.getActiveMeshCandidates = this.getActiveMeshCandidates.bind(this), this.scene.getActiveSubMeshCandidates = this.getActiveSubMeshCandidates.bind(this), this.scene.getCollidingSubMeshCandidates = this.getCollidingSubMeshCandidates.bind(this), this.scene.getIntersectingSubMeshCandidates = this.getIntersectingSubMeshCandidates.bind(this)
                        }
                        return t.prototype.register = function() {
                            var e = this;
                            this.scene.onMeshRemovedObservable.add(function(t) {
                                var i = e.scene.selectionOctree;
                                if (null != i) {
                                    var r = i.dynamicContent.indexOf(t); - 1 !== r && i.dynamicContent.splice(r, 1)
                                }
                            }), this.scene.onMeshImportedObservable.add(function(t) {
                                var i = e.scene.selectionOctree;
                                null != i && i.addMesh(t)
                            })
                        }, t.prototype.getActiveMeshCandidates = function() {
                            return this.scene._selectionOctree ? this.scene._selectionOctree.select(this.scene.frustumPlanes) : this.scene._getDefaultMeshCandidates()
                        }, t.prototype.getActiveSubMeshCandidates = function(e) {
                            return e._submeshesOctree && e.useOctreeForRenderingSelection ? e._submeshesOctree.select(this.scene.frustumPlanes) : this.scene._getDefaultSubMeshCandidates(e)
                        }, t.prototype.getIntersectingSubMeshCandidates = function(t, i) {
                            return t._submeshesOctree && t.useOctreeForPicking ? (e.Ray.TransformToRef(i, t.getWorldMatrix(), this._tempRay), t._submeshesOctree.intersectsRay(this._tempRay)) : this.scene._getDefaultSubMeshCandidates(t)
                        }, t.prototype.getCollidingSubMeshCandidates = function(e, t) {
                            if (e._submeshesOctree && e.useOctreeForCollisions) {
                                var i = t._velocityWorldLength + Math.max(t._radius.x, t._radius.y, t._radius.z);
                                return e._submeshesOctree.intersects(t._basePointWorld, i)
                            }
                            return this.scene._getDefaultSubMeshCandidates(e)
                        }, t.prototype.rebuild = function() {}, t.prototype.dispose = function() {}, t
                    }();
                    e.OctreeSceneComponent = t
                }($a || ($a = {})), ks = $a || ($a = {}), Us = function(e) {
                    function t(t, i, r, n, o, s) {
                        var a = e.call(this, t, "anaglyph", null, ["leftSampler"], i, r[1], n, o, s) || this;
                        return a._passedProcess = r[0]._rigPostProcess, a.onApplyObservable.add(function(e) {
                            e.setTextureFromPostProcess("leftSampler", a._passedProcess)
                        }), a
                    }
                    return b(t, e), t
                }(ks.PostProcess), ks.AnaglyphPostProcess = Us,
                function(e) {
                    e.Node.AddNodeConstructor("AnaglyphArcRotateCamera", function(i, r, n) {
                        return function() {
                            return new t(i, 0, 0, 1, e.Vector3.Zero(), n.interaxial_distance, r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o, s, a, l) {
                            var u = t.call(this, i, r, n, o, s, l) || this;
                            return u.interaxialDistance = a, u.setCameraRigMode(e.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, {
                                interaxialDistance: a
                            }), u
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "AnaglyphArcRotateCamera"
                        }, i
                    }(e.ArcRotateCamera);
                    e.AnaglyphArcRotateCamera = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("AnaglyphFreeCamera", function(i, r, n) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), n.interaxial_distance, r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o) {
                            var s = t.call(this, i, r, o) || this;
                            return s.interaxialDistance = n, s.setCameraRigMode(e.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, {
                                interaxialDistance: n
                            }), s
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "AnaglyphFreeCamera"
                        }, i
                    }(e.FreeCamera);
                    e.AnaglyphFreeCamera = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("AnaglyphGamepadCamera", function(i, r, n) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), n.interaxial_distance, r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o) {
                            var s = t.call(this, i, r, o) || this;
                            return s.interaxialDistance = n, s.setCameraRigMode(e.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, {
                                interaxialDistance: n
                            }), s
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "AnaglyphGamepadCamera"
                        }, i
                    }(e.GamepadCamera);
                    e.AnaglyphGamepadCamera = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("AnaglyphUniversalCamera", function(i, r, n) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), n.interaxial_distance, r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o) {
                            var s = t.call(this, i, r, o) || this;
                            return s.interaxialDistance = n, s.setCameraRigMode(e.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, {
                                interaxialDistance: n
                            }), s
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "AnaglyphUniversalCamera"
                        }, i
                    }(e.UniversalCamera);
                    e.AnaglyphUniversalCamera = t
                }($a || ($a = {})), Gs = $a || ($a = {}), zs = function(e) {
                    function t(t, i, r, n, o, s) {
                        var a = e.call(this, t, "stereoscopicInterlace", ["stepSize"], ["camASampler"], 1, i[1], n, o, s, r ? "#define IS_STEREOSCOPIC_HORIZ 1" : void 0) || this;
                        return a._passedProcess = i[0]._rigPostProcess, a._stepSize = new Gs.Vector2(1 / a.width, 1 / a.height), a.onSizeChangedObservable.add(function() {
                            a._stepSize = new Gs.Vector2(1 / a.width, 1 / a.height)
                        }), a.onApplyObservable.add(function(e) {
                            e.setTextureFromPostProcess("camASampler", a._passedProcess), e.setFloat2("stepSize", a._stepSize.x, a._stepSize.y)
                        }), a
                    }
                    return b(t, e), t
                }(Gs.PostProcess), Gs.StereoscopicInterlacePostProcess = zs,
                function(e) {
                    e.Node.AddNodeConstructor("StereoscopicArcRotateCamera", function(i, r, n) {
                        return function() {
                            return new t(i, 0, 0, 1, e.Vector3.Zero(), n.interaxial_distance, n.isStereoscopicSideBySide, r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o, s, a, l, u) {
                            var c = t.call(this, i, r, n, o, s, u) || this;
                            return c.interaxialDistance = a, c.isStereoscopicSideBySide = l, c.setCameraRigMode(l ? e.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : e.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
                                interaxialDistance: a
                            }), c
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "StereoscopicArcRotateCamera"
                        }, i
                    }(e.ArcRotateCamera);
                    e.StereoscopicArcRotateCamera = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("StereoscopicFreeCamera", function(i, r, n) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), n.interaxial_distance, n.isStereoscopicSideBySide, r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o, s) {
                            var a = t.call(this, i, r, s) || this;
                            return a.interaxialDistance = n, a.isStereoscopicSideBySide = o, a.setCameraRigMode(o ? e.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : e.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
                                interaxialDistance: n
                            }), a
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "StereoscopicFreeCamera"
                        }, i
                    }(e.FreeCamera);
                    e.StereoscopicFreeCamera = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("StereoscopicGamepadCamera", function(i, r, n) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), n.interaxial_distance, n.isStereoscopicSideBySide, r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o, s) {
                            var a = t.call(this, i, r, s) || this;
                            return a.interaxialDistance = n, a.isStereoscopicSideBySide = o, a.setCameraRigMode(o ? e.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : e.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
                                interaxialDistance: n
                            }), a
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "StereoscopicGamepadCamera"
                        }, i
                    }(e.GamepadCamera);
                    e.StereoscopicGamepadCamera = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("StereoscopicFreeCamera", function(i, r, n) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), n.interaxial_distance, n.isStereoscopicSideBySide, r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o, s) {
                            var a = t.call(this, i, r, s) || this;
                            return a.interaxialDistance = n, a.isStereoscopicSideBySide = o, a.setCameraRigMode(o ? e.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : e.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER, {
                                interaxialDistance: n
                            }), a
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "StereoscopicUniversalCamera"
                        }, i
                    }(e.UniversalCamera);
                    e.StereoscopicUniversalCamera = t
                }($a || ($a = {})), js = $a || ($a = {}), Hs = function(e) {
                    function t(t, i, r, n) {
                        var o = e.call(this, t, "vrDistortionCorrection", ["LensCenter", "Scale", "ScaleIn", "HmdWarpParam"], null, n.postProcessScaleFactor, i, js.Texture.BILINEAR_SAMPLINGMODE) || this;
                        return o._isRightEye = r, o._distortionFactors = n.distortionK, o._postProcessScaleFactor = n.postProcessScaleFactor, o._lensCenterOffset = n.lensCenterOffset, o.adaptScaleToCurrentViewport = !0, o.onSizeChangedObservable.add(function() {
                            o._scaleIn = new js.Vector2(2, 2 / o.aspectRatio), o._scaleFactor = new js.Vector2(1 / o._postProcessScaleFactor * .5, 1 / o._postProcessScaleFactor * .5 * o.aspectRatio), o._lensCenter = new js.Vector2(o._isRightEye ? .5 - .5 * o._lensCenterOffset : .5 + .5 * o._lensCenterOffset, .5)
                        }), o.onApplyObservable.add(function(e) {
                            e.setFloat2("LensCenter", o._lensCenter.x, o._lensCenter.y), e.setFloat2("Scale", o._scaleFactor.x, o._scaleFactor.y), e.setFloat2("ScaleIn", o._scaleIn.x, o._scaleIn.y), e.setFloat4("HmdWarpParam", o._distortionFactors[0], o._distortionFactors[1], o._distortionFactors[2], o._distortionFactors[3])
                        }), o
                    }
                    return b(t, e), t
                }(js.PostProcess), js.VRDistortionCorrectionPostProcess = Hs, Ws = $a || ($a = {}), Xs = function() {
                    function e() {
                        var e = this;
                        this._screenOrientationAngle = 0, this._screenQuaternion = new Ws.Quaternion, this._alpha = 0, this._beta = 0, this._gamma = 0, this._orientationChanged = function() {
                            e._screenOrientationAngle = void 0 !== window.orientation ? +window.orientation : window.screen.orientation && window.screen.orientation.angle ? window.screen.orientation.angle : 0, e._screenOrientationAngle = -Ws.Tools.ToRadians(e._screenOrientationAngle / 2), e._screenQuaternion.copyFromFloats(0, Math.sin(e._screenOrientationAngle), 0, Math.cos(e._screenOrientationAngle))
                        }, this._deviceOrientation = function(t) {
                            e._alpha = null !== t.alpha ? t.alpha : 0, e._beta = null !== t.beta ? t.beta : 0, e._gamma = null !== t.gamma ? t.gamma : 0
                        }, this._constantTranform = new Ws.Quaternion(-Math.sqrt(.5), 0, 0, Math.sqrt(.5)), this._orientationChanged()
                    }
                    return Object.defineProperty(e.prototype, "camera", {
                        get: function() {
                            return this._camera
                        },
                        set: function(e) {
                            this._camera = e, null == this._camera || this._camera.rotationQuaternion || (this._camera.rotationQuaternion = new Ws.Quaternion)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.attachControl = function(e, t) {
                        window.addEventListener("orientationchange", this._orientationChanged), window.addEventListener("deviceorientation", this._deviceOrientation), this._orientationChanged()
                    }, e.prototype.detachControl = function(e) {
                        window.removeEventListener("orientationchange", this._orientationChanged), window.removeEventListener("deviceorientation", this._deviceOrientation)
                    }, e.prototype.checkInputs = function() {
                        this._alpha && (Ws.Quaternion.RotationYawPitchRollToRef(Ws.Tools.ToRadians(this._alpha), Ws.Tools.ToRadians(this._beta), -Ws.Tools.ToRadians(this._gamma), this.camera.rotationQuaternion), this._camera.rotationQuaternion.multiplyInPlace(this._screenQuaternion), this._camera.rotationQuaternion.multiplyInPlace(this._constantTranform), this._camera.rotationQuaternion.z *= -1, this._camera.rotationQuaternion.w *= -1)
                    }, e.prototype.getClassName = function() {
                        return "FreeCameraDeviceOrientationInput"
                    }, e.prototype.getSimpleName = function() {
                        return "deviceOrientation"
                    }, e
                }(), Ws.FreeCameraDeviceOrientationInput = Xs, Ws.CameraInputTypes.FreeCameraDeviceOrientationInput = Xs, Ys = $a || ($a = {}), qs = function() {
                    function e() {
                        this.alphaCorrection = 1, this.betaCorrection = 1, this.gammaCorrection = 1, this._alpha = 0, this._gamma = 0, this._dirty = !1, this._deviceOrientationHandler = this._onOrientationEvent.bind(this)
                    }
                    return e.prototype.attachControl = function(e, t) {
                        this.camera.attachControl(e, t), window.addEventListener("deviceorientation", this._deviceOrientationHandler)
                    }, e.prototype._onOrientationEvent = function(e) {
                        null !== e.alpha && (this._alpha = 0 | +e.alpha), null !== e.gamma && (this._gamma = 0 | +e.gamma), this._dirty = !0
                    }, e.prototype.checkInputs = function() {
                        this._dirty && (this._dirty = !1, this._gamma < 0 && (this._gamma = 180 + this._gamma), this.camera.alpha = -this._alpha / 180 * Math.PI % Math.PI * 2, this.camera.beta = this._gamma / 180 * Math.PI)
                    }, e.prototype.detachControl = function(e) {
                        window.removeEventListener("deviceorientation", this._deviceOrientationHandler)
                    }, e.prototype.getClassName = function() {
                        return "ArcRotateCameraVRDeviceOrientationInput"
                    }, e.prototype.getSimpleName = function() {
                        return "VRDeviceOrientation"
                    }, e
                }(), Ys.ArcRotateCameraVRDeviceOrientationInput = qs, Ys.CameraInputTypes.ArcRotateCameraVRDeviceOrientationInput = qs, Ks = $a || ($a = {}), Qs = function() {
                    function e() {
                        this.compensateDistortion = !0
                    }
                    return Object.defineProperty(e.prototype, "aspectRatio", {
                        get: function() {
                            return this.hResolution / (2 * this.vResolution)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "aspectRatioFov", {
                        get: function() {
                            return 2 * Math.atan(this.postProcessScaleFactor * this.vScreenSize / (2 * this.eyeToScreenDistance))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "leftHMatrix", {
                        get: function() {
                            var e = 4 * (this.hScreenSize / 4 - this.lensSeparationDistance / 2) / this.hScreenSize;
                            return Ks.Matrix.Translation(e, 0, 0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "rightHMatrix", {
                        get: function() {
                            var e = 4 * (this.hScreenSize / 4 - this.lensSeparationDistance / 2) / this.hScreenSize;
                            return Ks.Matrix.Translation(-e, 0, 0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "leftPreViewMatrix", {
                        get: function() {
                            return Ks.Matrix.Translation(.5 * this.interpupillaryDistance, 0, 0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "rightPreViewMatrix", {
                        get: function() {
                            return Ks.Matrix.Translation(-.5 * this.interpupillaryDistance, 0, 0)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.GetDefault = function() {
                        var t = new e;
                        return t.hResolution = 1280, t.vResolution = 800, t.hScreenSize = .149759993, t.vScreenSize = .0935999975, t.vScreenCenter = .0467999987, t.eyeToScreenDistance = .0410000011, t.lensSeparationDistance = .063500002, t.interpupillaryDistance = .064000003, t.distortionK = [1, .219999999, .239999995, 0], t.chromaAbCorrection = [.995999992, -.00400000019, 1.01400006, 0], t.postProcessScaleFactor = 1.714605507808412, t.lensCenterOffset = .151976421, t
                    }, e
                }(), Ks.VRCameraMetrics = Qs,
                function(e) {
                    e.Node.AddNodeConstructor("WebVRFreeCamera", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    }), e.Node.AddNodeConstructor("WebVRGamepadCamera", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o) {
                            void 0 === o && (o = {});
                            var s = t.call(this, i, r, n) || this;
                            s.webVROptions = o, s._vrDevice = null, s.rawPose = null, s._specsVersion = "1.1", s._attached = !1, s._descendants = [], s._deviceRoomPosition = e.Vector3.Zero(), s._deviceRoomRotationQuaternion = e.Quaternion.Identity(), s._standingMatrix = null, s.devicePosition = e.Vector3.Zero(), s.deviceRotationQuaternion = e.Quaternion.Identity(), s.deviceScaleFactor = 1, s._deviceToWorld = e.Matrix.Identity(), s._worldToDevice = e.Matrix.Identity(), s.controllers = [], s.onControllersAttachedObservable = new e.Observable, s.onControllerMeshLoadedObservable = new e.Observable, s.onPoseUpdatedFromDeviceObservable = new e.Observable, s._poseSet = !1, s.rigParenting = !0, s._defaultHeight = void 0, s._htmlElementAttached = null, s._detachIfAttached = function() {
                                var e = s.getEngine().getVRDevice();
                                e && !e.isPresenting && s._htmlElementAttached && s.detachControl(s._htmlElementAttached)
                            }, s._workingVector = e.Vector3.Zero(), s._oneVector = e.Vector3.One(), s._workingMatrix = e.Matrix.Identity(), s._tmpMatrix = new e.Matrix, s._cache.position = e.Vector3.Zero(), o.defaultHeight && (s._defaultHeight = o.defaultHeight, s.position.y = s._defaultHeight), s.minZ = .1, 5 === arguments.length && (s.webVROptions = arguments[4]), null == s.webVROptions.trackPosition && (s.webVROptions.trackPosition = !0), null == s.webVROptions.controllerMeshes && (s.webVROptions.controllerMeshes = !0), null == s.webVROptions.defaultLightingOnControllers && (s.webVROptions.defaultLightingOnControllers = !0), s.rotationQuaternion = new e.Quaternion, s.webVROptions && s.webVROptions.positionScale && (s.deviceScaleFactor = s.webVROptions.positionScale);
                            var a = s.getEngine();
                            return s._onVREnabled = function(e) {
                                e && s.initControllers()
                            }, a.onVRRequestPresentComplete.add(s._onVREnabled), a.initWebVR().add(function(t) {
                                t.vrDisplay && s._vrDevice !== t.vrDisplay && (s._vrDevice = t.vrDisplay, s.setCameraRigMode(e.Camera.RIG_MODE_WEBVR, {
                                    parentCamera: s,
                                    vrDisplay: s._vrDevice,
                                    frameData: s._frameData,
                                    specs: s._specsVersion
                                }), s._attached && s.getEngine().enableVR())
                            }), "undefined" != typeof VRFrameData && (s._frameData = new VRFrameData), n.onBeforeCameraRenderObservable.add(function(e) {
                                e.parent === s && s.rigParenting && (s._descendants = s.getDescendants(!0, function(e) {
                                    var t = s.controllers.some(function(t) {
                                            return t._mesh === e
                                        }),
                                        i = -1 !== s._rigCameras.indexOf(e);
                                    return !t && !i
                                }), s._descendants.forEach(function(t) {
                                    t.parent = e
                                }))
                            }), n.onAfterCameraRenderObservable.add(function(e) {
                                e.parent === s && s.rigParenting && s._descendants.forEach(function(e) {
                                    e.parent = s
                                })
                            }), s
                        }
                        return b(i, t), i.prototype.deviceDistanceToRoomGround = function() {
                            return this._standingMatrix ? (this._standingMatrix.getTranslationToRef(this._workingVector), this._deviceRoomPosition.y + this._workingVector.y) : this._defaultHeight || 0
                        }, i.prototype.useStandingMatrix = function(t) {
                            var i = this;
                            void 0 === t && (t = function(e) {}), this.getEngine().initWebVRAsync().then(function(r) {
                                r.vrDisplay && r.vrDisplay.stageParameters && r.vrDisplay.stageParameters.sittingToStandingTransform && i.webVROptions.trackPosition ? (i._standingMatrix = new e.Matrix, e.Matrix.FromFloat32ArrayToRefScaled(r.vrDisplay.stageParameters.sittingToStandingTransform, 0, 1, i._standingMatrix), i.getScene().useRightHandedSystem || [2, 6, 8, 9, 14].forEach(function(e) {
                                    i._standingMatrix && (i._standingMatrix.m[e] *= -1)
                                }), t(!0)) : t(!1)
                            })
                        }, i.prototype.useStandingMatrixAsync = function() {
                            var e = this;
                            return new Promise(function(t, i) {
                                e.useStandingMatrix(function(e) {
                                    t(e)
                                })
                            })
                        }, i.prototype.dispose = function() {
                            this._detachIfAttached(), this.getEngine().onVRRequestPresentComplete.removeCallback(this._onVREnabled), this._updateCacheWhenTrackingDisabledObserver && this._scene.onBeforeRenderObservable.remove(this._updateCacheWhenTrackingDisabledObserver), t.prototype.dispose.call(this)
                        }, i.prototype.getControllerByName = function(e) {
                            for (var t = 0, i = this.controllers; t < i.length; t++) {
                                var r = i[t];
                                if (r.hand === e) return r
                            }
                            return null
                        }, Object.defineProperty(i.prototype, "leftController", {
                            get: function() {
                                return this._leftController || (this._leftController = this.getControllerByName("left")), this._leftController
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "rightController", {
                            get: function() {
                                return this._rightController || (this._rightController = this.getControllerByName("right")), this._rightController
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i.prototype.getForwardRay = function(e) {
                            return void 0 === e && (e = 100), this.leftCamera ? t.prototype.getForwardRay.call(this, e, this.leftCamera.getWorldMatrix(), this.leftCamera.globalPosition) : t.prototype.getForwardRay.call(this, e)
                        }, i.prototype._checkInputs = function() {
                            this._vrDevice && this._vrDevice.isPresenting && (this._vrDevice.getFrameData(this._frameData), this.updateFromDevice(this._frameData.pose)), t.prototype._checkInputs.call(this)
                        }, i.prototype.updateFromDevice = function(e) {
                            e && e.orientation && (this.rawPose = e, this._deviceRoomRotationQuaternion.copyFromFloats(e.orientation[0], e.orientation[1], -e.orientation[2], -e.orientation[3]), this.getScene().useRightHandedSystem && (this._deviceRoomRotationQuaternion.z *= -1, this._deviceRoomRotationQuaternion.w *= -1), this.webVROptions.trackPosition && this.rawPose.position && (this._deviceRoomPosition.copyFromFloats(this.rawPose.position[0], this.rawPose.position[1], -this.rawPose.position[2]), this.getScene().useRightHandedSystem && (this._deviceRoomPosition.z *= -1)), this._poseSet = !0)
                        }, i.prototype.attachControl = function(i, r) {
                            t.prototype.attachControl.call(this, i, r), this._attached = !0, this._htmlElementAttached = i, r = !e.Camera.ForceAttachControlToAlwaysPreventDefault && r, this._vrDevice && this.getEngine().enableVR(), window.addEventListener("vrdisplaypresentchange", this._detachIfAttached)
                        }, i.prototype.detachControl = function(e) {
                            this.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), t.prototype.detachControl.call(this, e), this._attached = !1, this.getEngine().disableVR(), window.removeEventListener("vrdisplaypresentchange", this._detachIfAttached)
                        }, i.prototype.getClassName = function() {
                            return "WebVRFreeCamera"
                        }, i.prototype.resetToCurrentRotation = function() {
                            this._vrDevice.resetPose()
                        }, i.prototype._updateRigCameras = function() {
                            var e = this._rigCameras[0],
                                t = this._rigCameras[1];
                            e.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion), t.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion), e.position.copyFrom(this._deviceRoomPosition), t.position.copyFrom(this._deviceRoomPosition)
                        }, i.prototype._correctPositionIfNotTrackPosition = function(t, i) {
                            void 0 === i && (i = !1), this.rawPose && this.rawPose.position && !this.webVROptions.trackPosition && (e.Matrix.TranslationToRef(this.rawPose.position[0], this.rawPose.position[1], -this.rawPose.position[2], this._tmpMatrix), i || this._tmpMatrix.invert(), this._tmpMatrix.multiplyToRef(t, t))
                        }, i.prototype._updateCache = function(i) {
                            var r = this;
                            this.rotationQuaternion.equals(this._cache.rotationQuaternion) && this.position.equals(this._cache.position) || (this.updateCacheCalled || (this.updateCacheCalled = !0, this.update()), this.rotationQuaternion.toRotationMatrix(this._workingMatrix), e.Vector3.TransformCoordinatesToRef(this._deviceRoomPosition, this._workingMatrix, this._workingVector), this.devicePosition.subtractToRef(this._workingVector, this._workingVector), e.Matrix.ComposeToRef(this._oneVector, this.rotationQuaternion, this._workingVector, this._deviceToWorld), this._deviceToWorld.getTranslationToRef(this._workingVector), this._workingVector.addInPlace(this.position), this._workingVector.subtractInPlace(this._cache.position), this._deviceToWorld.setTranslation(this._workingVector), this._deviceToWorld.invertToRef(this._worldToDevice), this.controllers.forEach(function(e) {
                                e._deviceToWorld.copyFrom(r._deviceToWorld), r._correctPositionIfNotTrackPosition(e._deviceToWorld), e.update()
                            })), i || t.prototype._updateCache.call(this), this.updateCacheCalled = !1
                        }, i.prototype._computeDevicePosition = function() {
                            e.Vector3.TransformCoordinatesToRef(this._deviceRoomPosition, this._deviceToWorld, this.devicePosition)
                        }, i.prototype.update = function() {
                            this._computeDevicePosition(), e.Matrix.FromQuaternionToRef(this._deviceRoomRotationQuaternion, this._workingMatrix), this._workingMatrix.multiplyToRef(this._deviceToWorld, this._workingMatrix), e.Quaternion.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion), this._poseSet && this.onPoseUpdatedFromDeviceObservable.notifyObservers(null), t.prototype.update.call(this)
                        }, i.prototype._getViewMatrix = function() {
                            return e.Matrix.Identity()
                        }, i.prototype._getWebVRViewMatrix = function() {
                            var t = this,
                                i = this._cameraRigParams.parentCamera;
                            i._updateCache();
                            var r = this._cameraRigParams.left ? this._cameraRigParams.frameData.leftViewMatrix : this._cameraRigParams.frameData.rightViewMatrix;
                            return e.Matrix.FromArrayToRef(r, 0, this._webvrViewMatrix), this.getScene().useRightHandedSystem || [2, 6, 8, 9, 14].forEach(function(e) {
                                t._webvrViewMatrix.m[e] *= -1
                            }), this._webvrViewMatrix.getRotationMatrixToRef(this._cameraRotationMatrix), e.Vector3.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint), this.position.addToRef(this._transformedReferencePoint, this._currentTarget), 1 !== i.deviceScaleFactor && (this._webvrViewMatrix.invert(), i.deviceScaleFactor && (this._webvrViewMatrix.m[12] *= i.deviceScaleFactor, this._webvrViewMatrix.m[13] *= i.deviceScaleFactor, this._webvrViewMatrix.m[14] *= i.deviceScaleFactor), this._webvrViewMatrix.invert()), i._correctPositionIfNotTrackPosition(this._webvrViewMatrix, !0), i._worldToDevice.multiplyToRef(this._webvrViewMatrix, this._webvrViewMatrix), this._workingMatrix = this._workingMatrix || e.Matrix.Identity(), this._webvrViewMatrix.invertToRef(this._workingMatrix), this._workingMatrix.multiplyToRef(i.getWorldMatrix(), this._workingMatrix), this._workingMatrix.getTranslationToRef(this._globalPosition), this._markSyncedWithParent(), this._webvrViewMatrix
                        }, i.prototype._getWebVRProjectionMatrix = function() {
                            var t = this,
                                i = this.parent;
                            i._vrDevice.depthNear = i.minZ, i._vrDevice.depthFar = i.maxZ;
                            var r = this._cameraRigParams.left ? this._cameraRigParams.frameData.leftProjectionMatrix : this._cameraRigParams.frameData.rightProjectionMatrix;
                            return e.Matrix.FromArrayToRef(r, 0, this._projectionMatrix), this.getScene().useRightHandedSystem || [8, 9, 10, 11].forEach(function(e) {
                                t._projectionMatrix.m[e] *= -1
                            }), this._projectionMatrix
                        }, i.prototype.initControllers = function() {
                            var t = this;
                            this.controllers = [];
                            var i = this.getScene().gamepadManager;
                            this._onGamepadDisconnectedObserver = i.onGamepadDisconnectedObservable.add(function(i) {
                                if (i.type === e.Gamepad.POSE_ENABLED) {
                                    var r = i;
                                    r.defaultModel && r.defaultModel.setEnabled(!1), "right" === r.hand && (t._rightController = null), "left" === r.hand && (t._leftController = null);
                                    var n = t.controllers.indexOf(r); - 1 !== n && t.controllers.splice(n, 1)
                                }
                            }), this._onGamepadConnectedObserver = i.onGamepadConnectedObservable.add(function(i) {
                                if (i.type === e.Gamepad.POSE_ENABLED) {
                                    var r = i;
                                    if (t.webVROptions.trackPosition || (r._disableTrackPosition(new e.Vector3("left" == r.hand ? -.15 : .15, -.5, .25)), t._updateCacheWhenTrackingDisabledObserver || (t._updateCacheWhenTrackingDisabledObserver = t._scene.onBeforeRenderObservable.add(function() {
                                            t._updateCache()
                                        }))), r.deviceScaleFactor = t.deviceScaleFactor, r._deviceToWorld.copyFrom(t._deviceToWorld), t._correctPositionIfNotTrackPosition(r._deviceToWorld), t.webVROptions.controllerMeshes && (r.defaultModel ? r.defaultModel.setEnabled(!0) : r.initControllerMesh(t.getScene(), function(i) {
                                            if (i.scaling.scaleInPlace(t.deviceScaleFactor), t.onControllerMeshLoadedObservable.notifyObservers(r), t.webVROptions.defaultLightingOnControllers) {
                                                t._lightOnControllers || (t._lightOnControllers = new e.HemisphericLight("vrControllersLight", new e.Vector3(0, 1, 0), t.getScene()));
                                                var n = function(e, t) {
                                                    var i = e.getChildren();
                                                    i && 0 !== i.length && i.forEach(function(e) {
                                                        t.includedOnlyMeshes.push(e), n(e, t)
                                                    })
                                                };
                                                t._lightOnControllers.includedOnlyMeshes.push(i), n(i, t._lightOnControllers)
                                            }
                                        })), r.attachToPoseControlledCamera(t), -1 === t.controllers.indexOf(r)) {
                                        t.controllers.push(r);
                                        for (var n = !1, o = 0; o < t.controllers.length; o++) t.controllers[o].controllerType === e.PoseEnabledControllerType.VIVE && (n ? t.controllers[o].hand = "right" : (n = !0, t.controllers[o].hand = "left"));
                                        2 <= t.controllers.length && t.onControllersAttachedObservable.notifyObservers(t.controllers)
                                    }
                                }
                            })
                        }, i
                    }(e.FreeCamera);
                    e.WebVRFreeCamera = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("DeviceOrientationCamera", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n) {
                            var o = t.call(this, i, r, n) || this;
                            return o._quaternionCache = new e.Quaternion, o.inputs.addDeviceOrientation(), o
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "DeviceOrientationCamera"
                        }, i.prototype._checkInputs = function() {
                            t.prototype._checkInputs.call(this), this._quaternionCache.copyFrom(this.rotationQuaternion), this._initialQuaternion && this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion)
                        }, i.prototype.resetToCurrentRotation = function(t) {
                            var i = this;
                            void 0 === t && (t = e.Axis.Y), this.rotationQuaternion && (this._initialQuaternion || (this._initialQuaternion = new e.Quaternion), this._initialQuaternion.copyFrom(this._quaternionCache || this.rotationQuaternion), ["x", "y", "z"].forEach(function(e) {
                                t[e] ? i._initialQuaternion[e] *= -1 : i._initialQuaternion[e] = 0
                            }), this._initialQuaternion.normalize(), this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion))
                        }, i
                    }(e.FreeCamera);
                    e.DeviceOrientationCamera = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("VRDeviceOrientationFreeCamera", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o, s) {
                            void 0 === o && (o = !0), void 0 === s && (s = e.VRCameraMetrics.GetDefault());
                            var a = t.call(this, i, r, n) || this;
                            return s.compensateDistortion = o, a.setCameraRigMode(e.Camera.RIG_MODE_VR, {
                                vrCameraMetrics: s
                            }), a
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "VRDeviceOrientationFreeCamera"
                        }, i
                    }(e.DeviceOrientationCamera);
                    e.VRDeviceOrientationFreeCamera = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("VRDeviceOrientationFreeCamera", function(i, r) {
                        return function() {
                            return new t(i, 0, 0, 1, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o, s, a, l, u) {
                            void 0 === l && (l = !0), void 0 === u && (u = e.VRCameraMetrics.GetDefault());
                            var c = t.call(this, i, r, n, o, s, a) || this;
                            return u.compensateDistortion = l, c.setCameraRigMode(e.Camera.RIG_MODE_VR, {
                                vrCameraMetrics: u
                            }), c.inputs.addVRDeviceOrientation(), c
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "VRDeviceOrientationArcRotateCamera"
                        }, i
                    }(e.ArcRotateCamera);
                    e.VRDeviceOrientationArcRotateCamera = t
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("VRDeviceOrientationGamepadCamera", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(t) {
                        function i(i, r, n, o, s) {
                            void 0 === o && (o = !0), void 0 === s && (s = e.VRCameraMetrics.GetDefault());
                            var a = t.call(this, i, r, n, o, s) || this;
                            return a.inputs.addGamepad(), a
                        }
                        return b(i, t), i.prototype.getClassName = function() {
                            return "VRDeviceOrientationGamepadCamera"
                        }, i
                    }(e.VRDeviceOrientationFreeCamera);
                    e.VRDeviceOrientationGamepadCamera = t
                }($a || ($a = {})), Zs = $a || ($a = {}), Js = function() {
                    function e(t, i) {
                        if (void 0 === i && (i = null), this.scene = t, this._pointerDownOnMeshAsked = !1, this._isActionableMesh = !1, this._teleportationRequestInitiated = !1, this._teleportationBackRequestInitiated = !1, this._rotationRightAsked = !1, this._rotationLeftAsked = !1, this._dpadPressed = !0, this._activePointer = !1, this._id = e._idCounter++, i) this._gazeTracker = i.clone("gazeTracker");
                        else {
                            this._gazeTracker = Zs.Mesh.CreateTorus("gazeTracker", .0035, .0025, 20, t, !1), this._gazeTracker.bakeCurrentTransformIntoVertices(), this._gazeTracker.isPickable = !1, this._gazeTracker.isVisible = !1;
                            var r = new Zs.StandardMaterial("targetMat", t);
                            r.specularColor = Zs.Color3.Black(), r.emissiveColor = new Zs.Color3(.7, .7, .7), r.backFaceCulling = !1, this._gazeTracker.material = r
                        }
                    }
                    return e.prototype._getForwardRay = function(e) {
                        return new Zs.Ray(Zs.Vector3.Zero(), new Zs.Vector3(0, 0, e))
                    }, e.prototype._selectionPointerDown = function() {
                        this._pointerDownOnMeshAsked = !0, this._currentHit && this.scene.simulatePointerDown(this._currentHit, {
                            pointerId: this._id
                        })
                    }, e.prototype._selectionPointerUp = function() {
                        this._currentHit && this.scene.simulatePointerUp(this._currentHit, {
                            pointerId: this._id
                        }), this._pointerDownOnMeshAsked = !1
                    }, e.prototype._activatePointer = function() {
                        this._activePointer = !0
                    }, e.prototype._deactivatePointer = function() {
                        this._activePointer = !1
                    }, e.prototype._updatePointerDistance = function(e) {
                        void 0 === e && (e = 100)
                    }, e.prototype.dispose = function() {
                        this._interactionsEnabled = !1, this._teleportationEnabled = !1, this._gazeTracker && this._gazeTracker.dispose()
                    }, e._idCounter = 0, e
                }(), $s = function(e) {
                    function t(t, i, r) {
                        var n = e.call(this, i, r) || this;
                        n.webVRController = t, n._laserPointer = Zs.Mesh.CreateCylinder("laserPointer", 1, .004, 2e-4, 20, 1, i, !1);
                        var o = new Zs.StandardMaterial("laserPointerMat", i);
                        if (o.emissiveColor = new Zs.Color3(.7, .7, .7), o.alpha = .6, n._laserPointer.material = o, n._laserPointer.rotation.x = Math.PI / 2, n._laserPointer.position.z = -.5, n._laserPointer.isVisible = !1, n._laserPointer.isPickable = !1, !t.mesh) {
                            var s = new Zs.Mesh("preloadControllerMesh", i),
                                a = new Zs.Mesh(Zs.PoseEnabledController.POINTING_POSE, i);
                            a.rotation.x = -.7, s.addChild(a), t.attachToMesh(s)
                        }
                        return n._setLaserPointerParent(t.mesh), n._meshAttachedObserver = t._meshAttachedObservable.add(function(e) {
                            n._setLaserPointerParent(e)
                        }), n
                    }
                    return b(t, e), t.prototype._getForwardRay = function(e) {
                        return this.webVRController.getForwardRay(e)
                    }, t.prototype._activatePointer = function() {
                        e.prototype._activatePointer.call(this), this._laserPointer.isVisible = !0
                    }, t.prototype._deactivatePointer = function() {
                        e.prototype._deactivatePointer.call(this), this._laserPointer.isVisible = !1
                    }, t.prototype._setLaserPointerColor = function(e) {
                        this._laserPointer.material.emissiveColor = e
                    }, t.prototype._setLaserPointerParent = function(e) {
                        var t = function(e) {
                            e.isPickable = !1, e.getChildMeshes().forEach(function(e) {
                                t(e)
                            })
                        };
                        t(e);
                        var i = e.getChildMeshes();
                        this.webVRController._pointingPoseNode = null;
                        for (var r = 0; r < i.length; r++)
                            if (i[r].name && 0 <= i[r].name.indexOf(Zs.PoseEnabledController.POINTING_POSE)) {
                                e = i[r], this.webVRController._pointingPoseNode = e;
                                break
                            }
                        this._laserPointer.parent = e
                    }, t.prototype._updatePointerDistance = function(e) {
                        void 0 === e && (e = 100), this._laserPointer.scaling.y = e, this._laserPointer.position.z = -e / 2
                    }, t.prototype.dispose = function() {
                        e.prototype.dispose.call(this), this._laserPointer.dispose(), this._meshAttachedObserver && this.webVRController._meshAttachedObservable.remove(this._meshAttachedObserver)
                    }, t
                }(Js), ea = function(e) {
                    function t(t, i) {
                        var r = e.call(this, i) || this;
                        return r.getCamera = t, r
                    }
                    return b(t, e), t.prototype._getForwardRay = function(e) {
                        var t = this.getCamera();
                        return t ? t.getForwardRay(e) : new Zs.Ray(Zs.Vector3.Zero(), Zs.Vector3.Forward())
                    }, t
                }(Js), ta = function() {
                    function e(e, t) {
                        void 0 === t && (t = {});
                        var i = this;
                        if (this.webVROptions = t, this._webVRsupported = !1, this._webVRready = !1, this._webVRrequesting = !1, this._webVRpresenting = !1, this._fullscreenVRpresenting = !1, this.onEnteringVRObservable = new Zs.Observable, this.onExitingVRObservable = new Zs.Observable, this.onControllerMeshLoadedObservable = new Zs.Observable, this._useCustomVRButton = !1, this._teleportationRequested = !1, this._teleportActive = !1, this._floorMeshesCollection = [], this._rotationAllowed = !0, this._teleportBackwardsVector = new Zs.Vector3(0, -1, -1), this._isDefaultTeleportationTarget = !0, this._teleportationFillColor = "#444444", this._teleportationBorderColor = "#FFFFFF", this._rotationAngle = 0, this._haloCenter = new Zs.Vector3(0, 0, 0), this._padSensibilityUp = .65, this._padSensibilityDown = .35, this._leftController = null, this._rightController = null, this.onNewMeshSelected = new Zs.Observable, this.onNewMeshPicked = new Zs.Observable, this.onBeforeCameraTeleport = new Zs.Observable, this.onAfterCameraTeleport = new Zs.Observable, this.onSelectedMeshUnselected = new Zs.Observable, this.teleportationEnabled = !0, this._teleportationInitialized = !1, this._interactionsEnabled = !1, this._interactionsRequested = !1, this._displayGaze = !0, this._displayLaserPointer = !0, this.updateGazeTrackerScale = !0, this._onResize = function() {
                                i.moveButtonToBottomRight(), i._fullscreenVRpresenting && i._webVRready && i.exitVR()
                            }, this._onFullscreenChange = function() {
                                void 0 !== document.fullscreen ? i._fullscreenVRpresenting = document.fullscreen : void 0 !== document.mozFullScreen ? i._fullscreenVRpresenting = document.mozFullScreen : void 0 !== document.webkitIsFullScreen ? i._fullscreenVRpresenting = document.webkitIsFullScreen : void 0 !== document.msIsFullScreen ? i._fullscreenVRpresenting = document.msIsFullScreen : void 0 !== document.msFullscreenElement && (i._fullscreenVRpresenting = document.msFullscreenElement), !i._fullscreenVRpresenting && i._canvas && (i.exitVR(), i._useCustomVRButton || (i._btnVR.style.top = i._canvas.offsetTop + i._canvas.offsetHeight - 70 + "px", i._btnVR.style.left = i._canvas.offsetLeft + i._canvas.offsetWidth - 100 + "px"))
                            }, this.beforeRender = function() {
                                i._leftController && i._leftController._activePointer && i._castRayAndSelectObject(i._leftController), i._rightController && i._rightController._activePointer && i._castRayAndSelectObject(i._rightController), i._noControllerIsActive ? i._castRayAndSelectObject(i._cameraGazer) : i._cameraGazer._gazeTracker.isVisible = !1
                            }, this._onNewGamepadConnected = function(e) {
                                if (e.type !== Zs.Gamepad.POSE_ENABLED) e.leftStick && e.onleftstickchanged(function(e) {
                                    i._teleportationInitialized && i.teleportationEnabled && (!i._leftController && !i._rightController || i._leftController && !i._leftController._activePointer && i._rightController && !i._rightController._activePointer) && (i._checkTeleportWithRay(e, i._cameraGazer), i._checkTeleportBackwards(e, i._cameraGazer))
                                }), e.rightStick && e.onrightstickchanged(function(e) {
                                    i._teleportationInitialized && i._checkRotate(e, i._cameraGazer)
                                }), e.type === Zs.Gamepad.XBOX && (e.onbuttondown(function(e) {
                                    i._interactionsEnabled && e === Zs.Xbox360Button.A && i._cameraGazer._selectionPointerDown()
                                }), e.onbuttonup(function(e) {
                                    i._interactionsEnabled && e === Zs.Xbox360Button.A && i._cameraGazer._selectionPointerUp()
                                }));
                                else {
                                    var t = e,
                                        r = new $s(t, i._scene, i._cameraGazer._gazeTracker);
                                    "right" === t.hand || i._leftController && i._leftController.webVRController != t ? i._rightController = r : i._leftController = r, i._tryEnableInteractionOnController(r)
                                }
                            }, this._tryEnableInteractionOnController = function(e) {
                                i._interactionsRequested && !e._interactionsEnabled && i._enableInteractionOnController(e), i._teleportationRequested && !e._teleportationEnabled && i._enableTeleportationOnController(e)
                            }, this._onNewGamepadDisconnected = function(e) {
                                e instanceof Zs.WebVRController && ("left" === e.hand && null != i._leftController && (i._leftController.dispose(), i._leftController = null), "right" === e.hand && null != i._rightController && (i._rightController.dispose(), i._rightController = null))
                            }, this._workingVector = Zs.Vector3.Zero(), this._workingQuaternion = Zs.Quaternion.Identity(), this._workingMatrix = Zs.Matrix.Identity(), this._scene = e, this._canvas = e.getEngine().getRenderingCanvas(), void 0 === t.createFallbackVRDeviceOrientationFreeCamera && (t.createFallbackVRDeviceOrientationFreeCamera = !0), void 0 === t.createDeviceOrientationCamera && (t.createDeviceOrientationCamera = !0), void 0 === t.laserToggle && (t.laserToggle = !0), void 0 === t.defaultHeight && (t.defaultHeight = 1.7), t.useCustomVRButton && (this._useCustomVRButton = !0, t.customVRButton && (this._btnVR = t.customVRButton)), t.rayLength && (this._rayLength = t.rayLength), this._defaultHeight = t.defaultHeight, t.positionScale && (this._rayLength *= t.positionScale, this._defaultHeight *= t.positionScale), this._hasEnteredVR = !1, this._scene.activeCamera ? this._position = this._scene.activeCamera.position.clone() : this._position = new Zs.Vector3(0, this._defaultHeight, 0), t.createDeviceOrientationCamera || !this._scene.activeCamera) {
                            if (this._deviceOrientationCamera = new Zs.DeviceOrientationCamera("deviceOrientationVRHelper", this._position.clone(), e), this._scene.activeCamera && (this._deviceOrientationCamera.minZ = this._scene.activeCamera.minZ, this._deviceOrientationCamera.maxZ = this._scene.activeCamera.maxZ, this._scene.activeCamera instanceof Zs.TargetCamera && this._scene.activeCamera.rotation)) {
                                var r = this._scene.activeCamera;
                                r.rotationQuaternion ? this._deviceOrientationCamera.rotationQuaternion.copyFrom(r.rotationQuaternion) : this._deviceOrientationCamera.rotationQuaternion.copyFrom(Zs.Quaternion.RotationYawPitchRoll(r.rotation.y, r.rotation.x, r.rotation.z)), this._deviceOrientationCamera.rotation = r.rotation.clone()
                            }
                            this._scene.activeCamera = this._deviceOrientationCamera, this._canvas && this._scene.activeCamera.attachControl(this._canvas)
                        } else this._existingCamera = this._scene.activeCamera;
                        if (t.createFallbackVRDeviceOrientationFreeCamera && (this._vrDeviceOrientationCamera = new Zs.VRDeviceOrientationFreeCamera("VRDeviceOrientationVRHelper", this._position, this._scene)), this._webVRCamera = new Zs.WebVRFreeCamera("WebVRHelper", this._position, this._scene, t), this._webVRCamera.useStandingMatrix(), this._cameraGazer = new ea(function() {
                                return i.currentVRCamera
                            }, e), !this._useCustomVRButton) {
                            this._btnVR = document.createElement("BUTTON"), this._btnVR.className = "babylonVRicon", this._btnVR.id = "babylonVRiconbtn", this._btnVR.title = "Click to switch to VR";
                            var n = document.createElement("style");
                            n.appendChild(document.createTextNode(".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }.babylonVRicon.vrdisplaypresenting { display: none; }")), document.getElementsByTagName("head")[0].appendChild(n), this.moveButtonToBottomRight()
                        }
                        this._btnVR && this._btnVR.addEventListener("click", function() {
                            i.isInVRMode ? i.exitVR() : i.enterVR()
                        }), window.addEventListener("resize", this._onResize), document.addEventListener("fullscreenchange", this._onFullscreenChange, !1), document.addEventListener("mozfullscreenchange", this._onFullscreenChange, !1), document.addEventListener("webkitfullscreenchange", this._onFullscreenChange, !1), document.addEventListener("msfullscreenchange", this._onFullscreenChange, !1), document.onmsfullscreenchange = this._onFullscreenChange, t.createFallbackVRDeviceOrientationFreeCamera ? this.displayVRButton() : this._scene.getEngine().onVRDisplayChangedObservable.add(function(e) {
                            e.vrDisplay && i.displayVRButton()
                        }), this._onKeyDown = function(e) {
                            27 === e.keyCode && i.isInVRMode && i.exitVR()
                        }, document.addEventListener("keydown", this._onKeyDown), this._scene.onPrePointerObservable.add(function(e, t) {
                            i.isInVRMode && (i.exitVR(), i._fullscreenVRpresenting && i._scene.getEngine().switchFullscreen(!0))
                        }, Zs.PointerEventTypes.POINTERDOUBLETAP, !1), this._onVRDisplayChanged = function(e) {
                            return i.onVRDisplayChanged(e)
                        }, this._onVrDisplayPresentChange = function() {
                            return i.onVrDisplayPresentChange()
                        }, this._onVRRequestPresentStart = function() {
                            i._webVRrequesting = !0, i.updateButtonVisibility()
                        }, this._onVRRequestPresentComplete = function(e) {
                            i._webVRrequesting = !1, i.updateButtonVisibility()
                        }, e.getEngine().onVRDisplayChangedObservable.add(this._onVRDisplayChanged), e.getEngine().onVRRequestPresentStart.add(this._onVRRequestPresentStart), e.getEngine().onVRRequestPresentComplete.add(this._onVRRequestPresentComplete), window.addEventListener("vrdisplaypresentchange", this._onVrDisplayPresentChange), e.onDisposeObservable.add(function() {
                            i.dispose()
                        }), this._webVRCamera.onControllerMeshLoadedObservable.add(function(e) {
                            return i._onDefaultMeshLoaded(e)
                        }), this._scene.gamepadManager.onGamepadConnectedObservable.add(this._onNewGamepadConnected), this._scene.gamepadManager.onGamepadDisconnectedObservable.add(this._onNewGamepadDisconnected), this.updateButtonVisibility(), this._circleEase = new Zs.CircleEase, this._circleEase.setEasingMode(Zs.EasingFunction.EASINGMODE_EASEINOUT), this.webVROptions.floorMeshes && this.enableTeleportation({
                            floorMeshes: this.webVROptions.floorMeshes
                        })
                    }
                    return Object.defineProperty(e.prototype, "onEnteringVR", {
                        get: function() {
                            return this.onEnteringVRObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "onExitingVR", {
                        get: function() {
                            return this.onExitingVRObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "onControllerMeshLoaded", {
                        get: function() {
                            return this.onControllerMeshLoadedObservable
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "teleportationTarget", {
                        get: function() {
                            return this._teleportationTarget
                        },
                        set: function(e) {
                            e && (e.name = "teleportationTarget", this._isDefaultTeleportationTarget = !1, this._teleportationTarget = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "gazeTrackerMesh", {
                        get: function() {
                            return this._cameraGazer._gazeTracker
                        },
                        set: function(e) {
                            e && (this._cameraGazer._gazeTracker && this._cameraGazer._gazeTracker.dispose(), this._leftController && this._leftController._gazeTracker && this._leftController._gazeTracker.dispose(), this._rightController && this._rightController._gazeTracker && this._rightController._gazeTracker.dispose(), this._cameraGazer._gazeTracker = e, this._cameraGazer._gazeTracker.bakeCurrentTransformIntoVertices(), this._cameraGazer._gazeTracker.isPickable = !1, this._cameraGazer._gazeTracker.isVisible = !1, this._cameraGazer._gazeTracker.name = "gazeTracker", this._leftController && (this._leftController._gazeTracker = this._cameraGazer._gazeTracker.clone("gazeTracker")), this._rightController && (this._rightController._gazeTracker = this._cameraGazer._gazeTracker.clone("gazeTracker")))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "leftControllerGazeTrackerMesh", {
                        get: function() {
                            return this._leftController ? this._leftController._gazeTracker : null
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "rightControllerGazeTrackerMesh", {
                        get: function() {
                            return this._rightController ? this._rightController._gazeTracker : null
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "displayGaze", {
                        get: function() {
                            return this._displayGaze
                        },
                        set: function(e) {
                            (this._displayGaze = e) || (this._cameraGazer._gazeTracker.isVisible = !1, this._leftController && (this._leftController._gazeTracker.isVisible = !1), this._rightController && (this._rightController._gazeTracker.isVisible = !1))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "displayLaserPointer", {
                        get: function() {
                            return this._displayLaserPointer
                        },
                        set: function(e) {
                            (this._displayLaserPointer = e) ? (this._rightController && this._rightController._activatePointer(), this._leftController && this._leftController._activatePointer()) : (this._rightController && (this._rightController._deactivatePointer(), this._rightController._gazeTracker.isVisible = !1), this._leftController && (this._leftController._deactivatePointer(), this._leftController._gazeTracker.isVisible = !1))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "deviceOrientationCamera", {
                        get: function() {
                            return this._deviceOrientationCamera
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "currentVRCamera", {
                        get: function() {
                            return this._webVRready ? this._webVRCamera : this._scene.activeCamera
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "webVRCamera", {
                        get: function() {
                            return this._webVRCamera
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "vrDeviceOrientationCamera", {
                        get: function() {
                            return this._vrDeviceOrientationCamera
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "_teleportationRequestInitiated", {
                        get: function() {
                            return this._cameraGazer._teleportationRequestInitiated || null !== this._leftController && this._leftController._teleportationRequestInitiated || null !== this._rightController && this._rightController._teleportationRequestInitiated
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._onDefaultMeshLoaded = function(e) {
                        this._leftController && this._leftController.webVRController == e && e.mesh && this._leftController._setLaserPointerParent(e.mesh), this._rightController && this._rightController.webVRController == e && e.mesh && this._rightController._setLaserPointerParent(e.mesh);
                        try {
                            this.onControllerMeshLoadedObservable.notifyObservers(e)
                        } catch (e) {
                            Zs.Tools.Warn("Error in your custom logic onControllerMeshLoaded: " + e)
                        }
                    }, Object.defineProperty(e.prototype, "isInVRMode", {
                        get: function() {
                            return this._webVRpresenting || this._fullscreenVRpresenting
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.onVrDisplayPresentChange = function() {
                        var e = this._scene.getEngine().getVRDevice();
                        if (e) {
                            var t = this._webVRpresenting;
                            this._webVRpresenting = e.isPresenting, t && !this._webVRpresenting && this.exitVR()
                        } else Zs.Tools.Warn("Detected VRDisplayPresentChange on an unknown VRDisplay. Did you can enterVR on the vrExperienceHelper?");
                        this.updateButtonVisibility()
                    }, e.prototype.onVRDisplayChanged = function(e) {
                        this._webVRsupported = e.vrSupported, this._webVRready = !!e.vrDisplay, this._webVRpresenting = e.vrDisplay && e.vrDisplay.isPresenting, this.updateButtonVisibility()
                    }, e.prototype.moveButtonToBottomRight = function() {
                        this._canvas && !this._useCustomVRButton && (this._btnVR.style.top = this._canvas.offsetTop + this._canvas.offsetHeight - 70 + "px", this._btnVR.style.left = this._canvas.offsetLeft + this._canvas.offsetWidth - 100 + "px")
                    }, e.prototype.displayVRButton = function() {
                        this._useCustomVRButton || this._btnVRDisplayed || (document.body.appendChild(this._btnVR), this._btnVRDisplayed = !0)
                    }, e.prototype.updateButtonVisibility = function() {
                        this._btnVR && !this._useCustomVRButton && (this._btnVR.className = "babylonVRicon", this.isInVRMode ? this._btnVR.className += " vrdisplaypresenting" : (this._webVRready && (this._btnVR.className += " vrdisplayready"), this._webVRsupported && (this._btnVR.className += " vrdisplaysupported"), this._webVRrequesting && (this._btnVR.className += " vrdisplayrequesting")))
                    }, e.prototype.enterVR = function() {
                        if (this.onEnteringVRObservable) try {
                            this.onEnteringVRObservable.notifyObservers(this)
                        } catch (e) {
                            Zs.Tools.Warn("Error in your custom logic onEnteringVR: " + e)
                        }
                        this._scene.activeCamera && (this._position = this._scene.activeCamera.position.clone(), this._existingCamera = this._scene.activeCamera), this._webVRrequesting || (this._webVRready ? this._webVRpresenting || (this._webVRCamera.position = this._position, this._scene.activeCamera = this._webVRCamera) : this._vrDeviceOrientationCamera && (this._vrDeviceOrientationCamera.position = this._position, this._scene.activeCamera && (this._vrDeviceOrientationCamera.minZ = this._scene.activeCamera.minZ), this._scene.activeCamera = this._vrDeviceOrientationCamera, this._scene.getEngine().switchFullscreen(!0), this.updateButtonVisibility()), this._scene.activeCamera && this._canvas && this._scene.activeCamera.attachControl(this._canvas), this._interactionsEnabled && this._scene.registerBeforeRender(this.beforeRender), this._hasEnteredVR = !0)
                    }, e.prototype.exitVR = function() {
                        if (this._hasEnteredVR) {
                            if (this.onExitingVRObservable) try {
                                this.onExitingVRObservable.notifyObservers(this)
                            } catch (e) {
                                Zs.Tools.Warn("Error in your custom logic onExitingVR: " + e)
                            }
                            this._webVRpresenting && this._scene.getEngine().disableVR(), this._scene.activeCamera && (this._position = this._scene.activeCamera.position.clone()), this._deviceOrientationCamera ? (this._deviceOrientationCamera.position = this._position, this._scene.activeCamera = this._deviceOrientationCamera, this._canvas && this._scene.activeCamera.attachControl(this._canvas)) : this._existingCamera && (this._existingCamera.position = this._position, this._scene.activeCamera = this._existingCamera), this.updateButtonVisibility(), this._interactionsEnabled && (this._scene.unregisterBeforeRender(this.beforeRender), this._cameraGazer._gazeTracker.isVisible = !1, this._leftController && (this._leftController._gazeTracker.isVisible = !1), this._rightController && (this._rightController._gazeTracker.isVisible = !1)), this._scene.getEngine().resize(), this._hasEnteredVR = !1
                        }
                    }, Object.defineProperty(e.prototype, "position", {
                        get: function() {
                            return this._position
                        },
                        set: function(e) {
                            this._position = e, this._scene.activeCamera && (this._scene.activeCamera.position = e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.enableInteractions = function() {
                        var e = this;
                        this._interactionsEnabled || (this._interactionsRequested = !0, this._leftController && this._enableInteractionOnController(this._leftController), this._rightController && this._enableInteractionOnController(this._rightController), this.raySelectionPredicate = function(t) {
                            return t.isVisible && (t.isPickable || t.name === e._floorMeshName)
                        }, this.meshSelectionPredicate = function(e) {
                            return !0
                        }, this._raySelectionPredicate = function(t) {
                            return !!(e._isTeleportationFloor(t) || -1 === t.name.indexOf("gazeTracker") && -1 === t.name.indexOf("teleportationTarget") && -1 === t.name.indexOf("torusTeleportation")) && e.raySelectionPredicate(t)
                        }, this._interactionsEnabled = !0)
                    }, Object.defineProperty(e.prototype, "_noControllerIsActive", {
                        get: function() {
                            return !(this._leftController && this._leftController._activePointer || this._rightController && this._rightController._activePointer)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._isTeleportationFloor = function(e) {
                        for (var t = 0; t < this._floorMeshesCollection.length; t++)
                            if (this._floorMeshesCollection[t].id === e.id) return !0;
                        return !(!this._floorMeshName || e.name !== this._floorMeshName)
                    }, e.prototype.addFloorMesh = function(e) {
                        this._floorMeshesCollection && (-1 < this._floorMeshesCollection.indexOf(e) || this._floorMeshesCollection.push(e))
                    }, e.prototype.removeFloorMesh = function(e) {
                        if (this._floorMeshesCollection) {
                            var t = this._floorMeshesCollection.indexOf(e); - 1 !== t && this._floorMeshesCollection.splice(t, 1)
                        }
                    }, e.prototype.enableTeleportation = function(e) {
                        if (void 0 === e && (e = {}), !this._teleportationInitialized) {
                            this._teleportationRequested = !0, this.enableInteractions(), e.floorMeshName && (this._floorMeshName = e.floorMeshName), e.floorMeshes && (this._floorMeshesCollection = e.floorMeshes), null != this._leftController && this._enableTeleportationOnController(this._leftController), null != this._rightController && this._enableTeleportationOnController(this._rightController);
                            var t = new Zs.ImageProcessingConfiguration;
                            t.vignetteColor = new Zs.Color4(0, 0, 0, 0), t.vignetteEnabled = !0, this._postProcessMove = new Zs.ImageProcessingPostProcess("postProcessMove", 1, this._webVRCamera, void 0, void 0, void 0, void 0, t), this._webVRCamera.detachPostProcess(this._postProcessMove), this._teleportationInitialized = !0, this._isDefaultTeleportationTarget && (this._createTeleportationCircles(), this._teleportationTarget.scaling.scaleInPlace(this._webVRCamera.deviceScaleFactor))
                        }
                    }, e.prototype._enableInteractionOnController = function(e) {
                        var t = this;
                        e.webVRController.mesh && (e._interactionsEnabled = !0, e._activatePointer(), this.webVROptions.laserToggle && e.webVRController.onMainButtonStateChangedObservable.add(function(i) {
                            t._displayLaserPointer && 1 === i.value && (e._activePointer ? e._deactivatePointer() : e._activatePointer(), t.displayGaze && (e._gazeTracker.isVisible = e._activePointer))
                        }), e.webVRController.onTriggerStateChangedObservable.add(function(i) {
                            var r = e;
                            t._noControllerIsActive && (r = t._cameraGazer), r._pointerDownOnMeshAsked ? i.value < t._padSensibilityDown && r._selectionPointerUp() : i.value > t._padSensibilityUp && r._selectionPointerDown()
                        }))
                    }, e.prototype._checkTeleportWithRay = function(e, t) {
                        this._teleportationRequestInitiated && !t._teleportationRequestInitiated || (t._teleportationRequestInitiated ? Math.sqrt(e.y * e.y + e.x * e.x) < this._padSensibilityDown && (this._teleportActive && this.teleportCamera(this._haloCenter), t._teleportationRequestInitiated = !1) : e.y < -this._padSensibilityUp && t._dpadPressed && (t._activatePointer(), t._teleportationRequestInitiated = !0))
                    }, e.prototype._checkRotate = function(e, t) {
                        t._teleportationRequestInitiated || (t._rotationLeftAsked ? e.x > -this._padSensibilityDown && (t._rotationLeftAsked = !1) : e.x < -this._padSensibilityUp && t._dpadPressed && (t._rotationLeftAsked = !0, this._rotationAllowed && this._rotateCamera(!1)), t._rotationRightAsked ? e.x < this._padSensibilityDown && (t._rotationRightAsked = !1) : e.x > this._padSensibilityUp && t._dpadPressed && (t._rotationRightAsked = !0, this._rotationAllowed && this._rotateCamera(!0)))
                    }, e.prototype._checkTeleportBackwards = function(e, t) {
                        if (!t._teleportationRequestInitiated)
                            if (e.y > this._padSensibilityUp && t._dpadPressed) {
                                if (!t._teleportationBackRequestInitiated) {
                                    if (!this.currentVRCamera) return;
                                    var i = Zs.Quaternion.FromRotationMatrix(this.currentVRCamera.getWorldMatrix().getRotationMatrix()),
                                        r = this.currentVRCamera.position;
                                    this.currentVRCamera.devicePosition && this.currentVRCamera.deviceRotationQuaternion && (i = this.currentVRCamera.deviceRotationQuaternion, r = this.currentVRCamera.devicePosition), i.toEulerAnglesToRef(this._workingVector), this._workingVector.z = 0, this._workingVector.x = 0, Zs.Quaternion.RotationYawPitchRollToRef(this._workingVector.y, this._workingVector.x, this._workingVector.z, this._workingQuaternion), this._workingQuaternion.toRotationMatrix(this._workingMatrix), Zs.Vector3.TransformCoordinatesToRef(this._teleportBackwardsVector, this._workingMatrix, this._workingVector);
                                    var n = new Zs.Ray(r, this._workingVector),
                                        o = this._scene.pickWithRay(n, this._raySelectionPredicate);
                                    o && o.pickedPoint && o.pickedMesh && this._isTeleportationFloor(o.pickedMesh) && o.distance < 5 && this.teleportCamera(o.pickedPoint), t._teleportationBackRequestInitiated = !0
                                }
                            } else t._teleportationBackRequestInitiated = !1
                    }, e.prototype._enableTeleportationOnController = function(e) {
                        var t = this;
                        e.webVRController.mesh && (e._interactionsEnabled || this._enableInteractionOnController(e), e._interactionsEnabled = !0, e._teleportationEnabled = !0, e.webVRController.controllerType === Zs.PoseEnabledControllerType.VIVE && (e._dpadPressed = !1, e.webVRController.onPadStateChangedObservable.add(function(t) {
                            e._dpadPressed = t.pressed, e._dpadPressed || (e._rotationLeftAsked = !1, e._rotationRightAsked = !1, e._teleportationBackRequestInitiated = !1)
                        })), e.webVRController.onPadValuesChangedObservable.add(function(i) {
                            t.teleportationEnabled && (t._checkTeleportBackwards(i, e), t._checkTeleportWithRay(i, e)), t._checkRotate(i, e)
                        }))
                    }, e.prototype._createTeleportationCircles = function() {
                        this._teleportationTarget = Zs.Mesh.CreateGround("teleportationTarget", 2, 2, 2, this._scene), this._teleportationTarget.isPickable = !1;
                        var e = new Zs.DynamicTexture("DynamicTexture", 512, this._scene, !0);
                        e.hasAlpha = !0;
                        var t = e.getContext();
                        t.beginPath(), t.arc(256, 256, 200, 0, 2 * Math.PI, !1), t.fillStyle = this._teleportationFillColor, t.fill(), t.lineWidth = 10, t.strokeStyle = this._teleportationBorderColor, t.stroke(), t.closePath(), e.update();
                        var i = new Zs.StandardMaterial("TextPlaneMaterial", this._scene);
                        i.diffuseTexture = e, this._teleportationTarget.material = i;
                        var r = Zs.Mesh.CreateTorus("torusTeleportation", .75, .1, 25, this._scene, !1);
                        r.isPickable = !1, r.parent = this._teleportationTarget;
                        var n = new Zs.Animation("animationInnerCircle", "position.y", 30, Zs.Animation.ANIMATIONTYPE_FLOAT, Zs.Animation.ANIMATIONLOOPMODE_CYCLE),
                            o = [];
                        o.push({
                            frame: 0,
                            value: 0
                        }), o.push({
                            frame: 30,
                            value: .4
                        }), o.push({
                            frame: 60,
                            value: 0
                        }), n.setKeys(o);
                        var s = new Zs.SineEase;
                        s.setEasingMode(Zs.EasingFunction.EASINGMODE_EASEINOUT), n.setEasingFunction(s), r.animations = [], r.animations.push(n), this._scene.beginAnimation(r, 0, 60, !0), this._hideTeleportationTarget()
                    }, e.prototype._displayTeleportationTarget = function() {
                        this._teleportActive = !0, this._teleportationInitialized && (this._teleportationTarget.isVisible = !0, this._isDefaultTeleportationTarget && (this._teleportationTarget.getChildren()[0].isVisible = !0))
                    }, e.prototype._hideTeleportationTarget = function() {
                        this._teleportActive = !1, this._teleportationInitialized && (this._teleportationTarget.isVisible = !1, this._isDefaultTeleportationTarget && (this._teleportationTarget.getChildren()[0].isVisible = !1))
                    }, e.prototype._rotateCamera = function(e) {
                        var t = this;
                        if (this.currentVRCamera instanceof Zs.FreeCamera) {
                            e ? this._rotationAngle++ : this._rotationAngle--, this.currentVRCamera.animations = [];
                            var i = Zs.Quaternion.FromRotationMatrix(Zs.Matrix.RotationY(Math.PI / 4 * this._rotationAngle)),
                                r = new Zs.Animation("animationRotation", "rotationQuaternion", 90, Zs.Animation.ANIMATIONTYPE_QUATERNION, Zs.Animation.ANIMATIONLOOPMODE_CONSTANT),
                                n = [];
                            n.push({
                                frame: 0,
                                value: this.currentVRCamera.rotationQuaternion
                            }), n.push({
                                frame: 6,
                                value: i
                            }), r.setKeys(n), r.setEasingFunction(this._circleEase), this.currentVRCamera.animations.push(r), this._postProcessMove.animations = [];
                            var o = new Zs.Animation("animationPP", "vignetteWeight", 90, Zs.Animation.ANIMATIONTYPE_FLOAT, Zs.Animation.ANIMATIONLOOPMODE_CONSTANT),
                                s = [];
                            s.push({
                                frame: 0,
                                value: 0
                            }), s.push({
                                frame: 3,
                                value: 4
                            }), s.push({
                                frame: 6,
                                value: 0
                            }), o.setKeys(s), o.setEasingFunction(this._circleEase), this._postProcessMove.animations.push(o);
                            var a = new Zs.Animation("animationPP2", "vignetteStretch", 90, Zs.Animation.ANIMATIONTYPE_FLOAT, Zs.Animation.ANIMATIONLOOPMODE_CONSTANT),
                                l = [];
                            l.push({
                                frame: 0,
                                value: 0
                            }), l.push({
                                frame: 3,
                                value: 10
                            }), l.push({
                                frame: 6,
                                value: 0
                            }), a.setKeys(l), a.setEasingFunction(this._circleEase), this._postProcessMove.animations.push(a), this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0, this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0, this._postProcessMove.samples = 4, this._webVRCamera.attachPostProcess(this._postProcessMove), this._scene.beginAnimation(this._postProcessMove, 0, 6, !1, 1, function() {
                                t._webVRCamera.detachPostProcess(t._postProcessMove)
                            }), this._scene.beginAnimation(this.currentVRCamera, 0, 6, !1, 1)
                        }
                    }, e.prototype._moveTeleportationSelectorTo = function(e, t, i) {
                        if (e.pickedPoint) {
                            t._teleportationRequestInitiated && (this._displayTeleportationTarget(), this._haloCenter.copyFrom(e.pickedPoint), this._teleportationTarget.position.copyFrom(e.pickedPoint));
                            var r = this._convertNormalToDirectionOfRay(e.getNormal(!0, !1), i);
                            if (r) {
                                var n = Zs.Vector3.Cross(Zs.Axis.Y, r),
                                    o = Zs.Vector3.Cross(r, n);
                                Zs.Vector3.RotationFromAxisToRef(o, r, n, this._teleportationTarget.rotation)
                            }
                            this._teleportationTarget.position.y += .1
                        }
                    }, e.prototype.teleportCamera = function(e) {
                        var t = this;
                        if (this.currentVRCamera instanceof Zs.FreeCamera) {
                            this.webVRCamera.leftCamera ? (this._workingVector.copyFrom(this.webVRCamera.leftCamera.globalPosition), this._workingVector.subtractInPlace(this.webVRCamera.position), e.subtractToRef(this._workingVector, this._workingVector)) : this._workingVector.copyFrom(e), this.isInVRMode ? this._workingVector.y += this.webVRCamera.deviceDistanceToRoomGround() * this._webVRCamera.deviceScaleFactor : this._workingVector.y += this._defaultHeight, this.onBeforeCameraTeleport.notifyObservers(this._workingVector), this.currentVRCamera.animations = [];
                            var i = new Zs.Animation("animationCameraTeleportation", "position", 90, Zs.Animation.ANIMATIONTYPE_VECTOR3, Zs.Animation.ANIMATIONLOOPMODE_CONSTANT),
                                r = [{
                                    frame: 0,
                                    value: this.currentVRCamera.position
                                }, {
                                    frame: 11,
                                    value: this._workingVector
                                }];
                            i.setKeys(r), i.setEasingFunction(this._circleEase), this.currentVRCamera.animations.push(i), this._postProcessMove.animations = [];
                            var n = new Zs.Animation("animationPP", "vignetteWeight", 90, Zs.Animation.ANIMATIONTYPE_FLOAT, Zs.Animation.ANIMATIONLOOPMODE_CONSTANT),
                                o = [];
                            o.push({
                                frame: 0,
                                value: 0
                            }), o.push({
                                frame: 5,
                                value: 8
                            }), o.push({
                                frame: 11,
                                value: 0
                            }), n.setKeys(o), this._postProcessMove.animations.push(n);
                            var s = new Zs.Animation("animationPP2", "vignetteStretch", 90, Zs.Animation.ANIMATIONTYPE_FLOAT, Zs.Animation.ANIMATIONLOOPMODE_CONSTANT),
                                a = [];
                            a.push({
                                frame: 0,
                                value: 0
                            }), a.push({
                                frame: 5,
                                value: 10
                            }), a.push({
                                frame: 11,
                                value: 0
                            }), s.setKeys(a), this._postProcessMove.animations.push(s), this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0, this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0, this._webVRCamera.attachPostProcess(this._postProcessMove), this._scene.beginAnimation(this._postProcessMove, 0, 11, !1, 1, function() {
                                t._webVRCamera.detachPostProcess(t._postProcessMove)
                            }), this._scene.beginAnimation(this.currentVRCamera, 0, 11, !1, 1, function() {
                                t.onAfterCameraTeleport.notifyObservers(t._workingVector)
                            }), this._hideTeleportationTarget()
                        }
                    }, e.prototype._convertNormalToDirectionOfRay = function(e, t) {
                        return e && Math.acos(Zs.Vector3.Dot(e, t.direction)) < Math.PI / 2 && e.scaleInPlace(-1), e
                    }, e.prototype._castRayAndSelectObject = function(e) {
                        if (this.currentVRCamera instanceof Zs.FreeCamera) {
                            var t = e._getForwardRay(this._rayLength),
                                i = this._scene.pickWithRay(t, this._raySelectionPredicate);
                            if (i && (e._laserPointer && (i.originMesh = e._laserPointer.parent), this._scene.simulatePointerMove(i, {
                                    pointerId: e._id
                                })), (e._currentHit = i) && i.pickedPoint) {
                                if (this._displayGaze) {
                                    var r = 1;
                                    e._gazeTracker.isVisible = !0, e._isActionableMesh && (r = 3), this.updateGazeTrackerScale && (e._gazeTracker.scaling.x = i.distance * r, e._gazeTracker.scaling.y = i.distance * r, e._gazeTracker.scaling.z = i.distance * r);
                                    var n = this._convertNormalToDirectionOfRay(i.getNormal(), t);
                                    if (n) {
                                        var o = Zs.Vector3.Cross(Zs.Axis.Y, n),
                                            s = Zs.Vector3.Cross(n, o);
                                        Zs.Vector3.RotationFromAxisToRef(s, n, o, e._gazeTracker.rotation)
                                    }
                                    e._gazeTracker.position.copyFrom(i.pickedPoint), e._gazeTracker.position.x < 0 ? e._gazeTracker.position.x += .002 : e._gazeTracker.position.x -= .002, e._gazeTracker.position.y < 0 ? e._gazeTracker.position.y += .002 : e._gazeTracker.position.y -= .002, e._gazeTracker.position.z < 0 ? e._gazeTracker.position.z += .002 : e._gazeTracker.position.z -= .002
                                }
                                e._updatePointerDistance(i.distance)
                            } else e._updatePointerDistance(), e._gazeTracker.isVisible = !1;
                            if (i && i.pickedMesh) {
                                if (this._teleportationInitialized && this._isTeleportationFloor(i.pickedMesh) && i.pickedPoint) return e._currentMeshSelected && !this._isTeleportationFloor(e._currentMeshSelected) && this._notifySelectedMeshUnselected(e._currentMeshSelected), e._currentMeshSelected = null, void(e._teleportationRequestInitiated && this._moveTeleportationSelectorTo(i, e, t));
                                if (i.pickedMesh !== e._currentMeshSelected)
                                    if (this.meshSelectionPredicate(i.pickedMesh)) {
                                        this.onNewMeshPicked.notifyObservers(i), e._currentMeshSelected = i.pickedMesh, i.pickedMesh.isPickable && i.pickedMesh.actionManager ? (this.changeGazeColor(new Zs.Color3(0, 0, 1)), this.changeLaserColor(new Zs.Color3(.2, .2, 1)), e._isActionableMesh = !0) : (this.changeGazeColor(new Zs.Color3(.7, .7, .7)), this.changeLaserColor(new Zs.Color3(.7, .7, .7)), e._isActionableMesh = !1);
                                        try {
                                            this.onNewMeshSelected.notifyObservers(i.pickedMesh)
                                        } catch (e) {
                                            Zs.Tools.Warn("Error in your custom logic onNewMeshSelected: " + e)
                                        }
                                    } else this._notifySelectedMeshUnselected(e._currentMeshSelected), e._currentMeshSelected = null, this.changeGazeColor(new Zs.Color3(.7, .7, .7)), this.changeLaserColor(new Zs.Color3(.7, .7, .7))
                            } else this._notifySelectedMeshUnselected(e._currentMeshSelected), e._currentMeshSelected = null, this.changeGazeColor(new Zs.Color3(.7, .7, .7)), this.changeLaserColor(new Zs.Color3(.7, .7, .7))
                        }
                    }, e.prototype._notifySelectedMeshUnselected = function(e) {
                        e && this.onSelectedMeshUnselected.notifyObservers(e)
                    }, e.prototype.changeLaserColor = function(e) {
                        this._leftController && this._leftController._setLaserPointerColor(e), this._rightController && this._rightController._setLaserPointerColor(e)
                    }, e.prototype.changeGazeColor = function(e) {
                        this._cameraGazer._gazeTracker.material && (this._cameraGazer._gazeTracker.material.emissiveColor = e, this._leftController && (this._leftController._gazeTracker.material.emissiveColor = e), this._rightController && (this._rightController._gazeTracker.material.emissiveColor = e))
                    }, e.prototype.dispose = function() {
                        this.isInVRMode && this.exitVR(), this._postProcessMove && this._postProcessMove.dispose(), this._webVRCamera && this._webVRCamera.dispose(), this._vrDeviceOrientationCamera && this._vrDeviceOrientationCamera.dispose(), !this._useCustomVRButton && this._btnVR.parentNode && document.body.removeChild(this._btnVR), this._deviceOrientationCamera && this._scene.activeCamera != this._deviceOrientationCamera && this._deviceOrientationCamera.dispose(), this._cameraGazer && this._cameraGazer.dispose(), this._leftController && this._leftController.dispose(), this._rightController && this._rightController.dispose(), this._teleportationTarget && this._teleportationTarget.dispose(), this._floorMeshesCollection = [], document.removeEventListener("keydown", this._onKeyDown), window.removeEventListener("vrdisplaypresentchange", this._onVrDisplayPresentChange), window.removeEventListener("resize", this._onResize), document.removeEventListener("fullscreenchange", this._onFullscreenChange), document.removeEventListener("mozfullscreenchange", this._onFullscreenChange), document.removeEventListener("webkitfullscreenchange", this._onFullscreenChange), document.removeEventListener("msfullscreenchange", this._onFullscreenChange), document.onmsfullscreenchange = null, this._scene.getEngine().onVRDisplayChangedObservable.removeCallback(this._onVRDisplayChanged), this._scene.getEngine().onVRRequestPresentStart.removeCallback(this._onVRRequestPresentStart), this._scene.getEngine().onVRRequestPresentComplete.removeCallback(this._onVRRequestPresentComplete), window.removeEventListener("vrdisplaypresentchange", this._onVrDisplayPresentChange), this._scene.gamepadManager.onGamepadConnectedObservable.removeCallback(this._onNewGamepadConnected), this._scene.gamepadManager.onGamepadDisconnectedObservable.removeCallback(this._onNewGamepadDisconnected), this._scene.unregisterBeforeRender(this.beforeRender)
                    }, e.prototype.getClassName = function() {
                        return "VRExperienceHelper"
                    }, e
                }(), Zs.VRExperienceHelper = ta,
                function(e) {
                    var t, i;
                    (i = t = e.JoystickAxis || (e.JoystickAxis = {}))[i.X = 0] = "X", i[i.Y = 1] = "Y", i[i.Z = 2] = "Z";
                    var r = function() {
                        function i(r) {
                            var n = this;
                            if (this._leftJoystick = !!r, i._globalJoystickIndex++, this._axisTargetedByLeftAndRight = t.X, this._axisTargetedByUpAndDown = t.Y, this.reverseLeftRight = !1, this.reverseUpDown = !1, this._touches = new e.StringDictionary, this.deltaPosition = e.Vector3.Zero(), this._joystickSensibility = 25, this._inversedSensibility = 1 / (this._joystickSensibility / 1e3), this._onResize = function(e) {
                                    i.vjCanvasWidth = window.innerWidth, i.vjCanvasHeight = window.innerHeight, i.vjCanvas && (i.vjCanvas.width = i.vjCanvasWidth, i.vjCanvas.height = i.vjCanvasHeight), i.halfWidth = i.vjCanvasWidth / 2
                                }, !i.vjCanvas) {
                                window.addEventListener("resize", this._onResize, !1), i.vjCanvas = document.createElement("canvas"), i.vjCanvasWidth = window.innerWidth, i.vjCanvasHeight = window.innerHeight, i.vjCanvas.width = window.innerWidth, i.vjCanvas.height = window.innerHeight, i.vjCanvas.style.width = "100%", i.vjCanvas.style.height = "100%", i.vjCanvas.style.position = "absolute", i.vjCanvas.style.backgroundColor = "transparent", i.vjCanvas.style.top = "0px", i.vjCanvas.style.left = "0px", i.vjCanvas.style.zIndex = "5", i.vjCanvas.style.msTouchAction = "none", i.vjCanvas.setAttribute("touch-action", "none");
                                var o = i.vjCanvas.getContext("2d");
                                if (!o) throw new Error("Unable to create canvas for virtual joystick");
                                (i.vjCanvasContext = o).strokeStyle = "#ffffff", i.vjCanvasContext.lineWidth = 2, document.body.appendChild(i.vjCanvas)
                            }
                            i.halfWidth = i.vjCanvas.width / 2, this.pressed = !1, this._joystickColor = "cyan", this._joystickPointerID = -1, this._joystickPointerPos = new e.Vector2(0, 0), this._joystickPreviousPointerPos = new e.Vector2(0, 0), this._joystickPointerStartPos = new e.Vector2(0, 0), this._deltaJoystickVector = new e.Vector2(0, 0), this._onPointerDownHandlerRef = function(e) {
                                n._onPointerDown(e)
                            }, this._onPointerMoveHandlerRef = function(e) {
                                n._onPointerMove(e)
                            }, this._onPointerUpHandlerRef = function(e) {
                                n._onPointerUp(e)
                            }, i.vjCanvas.addEventListener("pointerdown", this._onPointerDownHandlerRef, !1), i.vjCanvas.addEventListener("pointermove", this._onPointerMoveHandlerRef, !1), i.vjCanvas.addEventListener("pointerup", this._onPointerUpHandlerRef, !1), i.vjCanvas.addEventListener("pointerout", this._onPointerUpHandlerRef, !1), i.vjCanvas.addEventListener("contextmenu", function(e) {
                                e.preventDefault()
                            }, !1), requestAnimationFrame(function() {
                                n._drawVirtualJoystick()
                            })
                        }
                        return i.prototype.setJoystickSensibility = function(e) {
                            this._joystickSensibility = e, this._inversedSensibility = 1 / (this._joystickSensibility / 1e3)
                        }, i.prototype._onPointerDown = function(e) {
                            e.preventDefault(), (!0 === this._leftJoystick ? e.clientX < i.halfWidth : e.clientX > i.halfWidth) && this._joystickPointerID < 0 ? (this._joystickPointerID = e.pointerId, this._joystickPointerStartPos.x = e.clientX, this._joystickPointerStartPos.y = e.clientY, this._joystickPointerPos = this._joystickPointerStartPos.clone(), this._joystickPreviousPointerPos = this._joystickPointerStartPos.clone(), this._deltaJoystickVector.x = 0, this._deltaJoystickVector.y = 0, this.pressed = !0, this._touches.add(e.pointerId.toString(), e)) : i._globalJoystickIndex < 2 && this._action && (this._action(), this._touches.add(e.pointerId.toString(), {
                                x: e.clientX,
                                y: e.clientY,
                                prevX: e.clientX,
                                prevY: e.clientY
                            }))
                        }, i.prototype._onPointerMove = function(e) {
                            if (this._joystickPointerID == e.pointerId) {
                                this._joystickPointerPos.x = e.clientX, this._joystickPointerPos.y = e.clientY, this._deltaJoystickVector = this._joystickPointerPos.clone(), this._deltaJoystickVector = this._deltaJoystickVector.subtract(this._joystickPointerStartPos);
                                var i = (this.reverseLeftRight ? -1 : 1) * this._deltaJoystickVector.x / this._inversedSensibility;
                                switch (this._axisTargetedByLeftAndRight) {
                                    case t.X:
                                        this.deltaPosition.x = Math.min(1, Math.max(-1, i));
                                        break;
                                    case t.Y:
                                        this.deltaPosition.y = Math.min(1, Math.max(-1, i));
                                        break;
                                    case t.Z:
                                        this.deltaPosition.z = Math.min(1, Math.max(-1, i))
                                }
                                var r = (this.reverseUpDown ? 1 : -1) * this._deltaJoystickVector.y / this._inversedSensibility;
                                switch (this._axisTargetedByUpAndDown) {
                                    case t.X:
                                        this.deltaPosition.x = Math.min(1, Math.max(-1, r));
                                        break;
                                    case t.Y:
                                        this.deltaPosition.y = Math.min(1, Math.max(-1, r));
                                        break;
                                    case t.Z:
                                        this.deltaPosition.z = Math.min(1, Math.max(-1, r))
                                }
                            } else {
                                var n = this._touches.get(e.pointerId.toString());
                                n && (n.x = e.clientX, n.y = e.clientY)
                            }
                        }, i.prototype._onPointerUp = function(e) {
                            if (this._joystickPointerID == e.pointerId) i.vjCanvasContext.clearRect(this._joystickPointerStartPos.x - 64, this._joystickPointerStartPos.y - 64, 128, 128), i.vjCanvasContext.clearRect(this._joystickPreviousPointerPos.x - 42, this._joystickPreviousPointerPos.y - 42, 84, 84), this._joystickPointerID = -1, this.pressed = !1;
                            else {
                                var t = this._touches.get(e.pointerId.toString());
                                t && i.vjCanvasContext.clearRect(t.prevX - 44, t.prevY - 44, 88, 88)
                            }
                            this._deltaJoystickVector.x = 0, this._deltaJoystickVector.y = 0, this._touches.remove(e.pointerId.toString())
                        }, i.prototype.setJoystickColor = function(e) {
                            this._joystickColor = e
                        }, i.prototype.setActionOnTouch = function(e) {
                            this._action = e
                        }, i.prototype.setAxisForLeftRight = function(e) {
                            switch (e) {
                                case t.X:
                                case t.Y:
                                case t.Z:
                                    this._axisTargetedByLeftAndRight = e;
                                    break;
                                default:
                                    this._axisTargetedByLeftAndRight = t.X
                            }
                        }, i.prototype.setAxisForUpDown = function(e) {
                            switch (e) {
                                case t.X:
                                case t.Y:
                                case t.Z:
                                    this._axisTargetedByUpAndDown = e;
                                    break;
                                default:
                                    this._axisTargetedByUpAndDown = t.Y
                            }
                        }, i.prototype._drawVirtualJoystick = function() {
                            var e = this;
                            this.pressed && this._touches.forEach(function(t, r) {
                                r.pointerId === e._joystickPointerID ? (i.vjCanvasContext.clearRect(e._joystickPointerStartPos.x - 64, e._joystickPointerStartPos.y - 64, 128, 128), i.vjCanvasContext.clearRect(e._joystickPreviousPointerPos.x - 42, e._joystickPreviousPointerPos.y - 42, 84, 84), i.vjCanvasContext.beginPath(), i.vjCanvasContext.lineWidth = 6, i.vjCanvasContext.strokeStyle = e._joystickColor, i.vjCanvasContext.arc(e._joystickPointerStartPos.x, e._joystickPointerStartPos.y, 40, 0, 2 * Math.PI, !0), i.vjCanvasContext.stroke(), i.vjCanvasContext.closePath(), i.vjCanvasContext.beginPath(), i.vjCanvasContext.strokeStyle = e._joystickColor, i.vjCanvasContext.lineWidth = 2, i.vjCanvasContext.arc(e._joystickPointerStartPos.x, e._joystickPointerStartPos.y, 60, 0, 2 * Math.PI, !0), i.vjCanvasContext.stroke(), i.vjCanvasContext.closePath(), i.vjCanvasContext.beginPath(), i.vjCanvasContext.strokeStyle = e._joystickColor, i.vjCanvasContext.arc(e._joystickPointerPos.x, e._joystickPointerPos.y, 40, 0, 2 * Math.PI, !0), i.vjCanvasContext.stroke(), i.vjCanvasContext.closePath(), e._joystickPreviousPointerPos = e._joystickPointerPos.clone()) : (i.vjCanvasContext.clearRect(r.prevX - 44, r.prevY - 44, 88, 88), i.vjCanvasContext.beginPath(), i.vjCanvasContext.fillStyle = "white", i.vjCanvasContext.beginPath(), i.vjCanvasContext.strokeStyle = "red", i.vjCanvasContext.lineWidth = 6, i.vjCanvasContext.arc(r.x, r.y, 40, 0, 2 * Math.PI, !0), i.vjCanvasContext.stroke(), i.vjCanvasContext.closePath(), r.prevX = r.x, r.prevY = r.y)
                            }), requestAnimationFrame(function() {
                                e._drawVirtualJoystick()
                            })
                        }, i.prototype.releaseCanvas = function() {
                            i.vjCanvas && (i.vjCanvas.removeEventListener("pointerdown", this._onPointerDownHandlerRef), i.vjCanvas.removeEventListener("pointermove", this._onPointerMoveHandlerRef), i.vjCanvas.removeEventListener("pointerup", this._onPointerUpHandlerRef), i.vjCanvas.removeEventListener("pointerout", this._onPointerUpHandlerRef), window.removeEventListener("resize", this._onResize), document.body.removeChild(i.vjCanvas), i.vjCanvas = null)
                        }, i._globalJoystickIndex = 0, i
                    }();
                    e.VirtualJoystick = r
                }($a || ($a = {})),
                function(e) {
                    e.Node.AddNodeConstructor("VirtualJoysticksCamera", function(i, r) {
                        return function() {
                            return new t(i, e.Vector3.Zero(), r)
                        }
                    });
                    var t = function(e) {
                        function t(t, i, r) {
                            var n = e.call(this, t, i, r) || this;
                            return n.inputs.addVirtualJoystick(), n
                        }
                        return b(t, e), t.prototype.getClassName = function() {
                            return "VirtualJoysticksCamera"
                        }, t
                    }(e.FreeCamera);
                    e.VirtualJoysticksCamera = t
                }($a || ($a = {})), ia = $a || ($a = {}), ra = function() {
                    function e() {}
                    return e.prototype.getLeftJoystick = function() {
                        return this._leftjoystick
                    }, e.prototype.getRightJoystick = function() {
                        return this._rightjoystick
                    }, e.prototype.checkInputs = function() {
                        if (this._leftjoystick) {
                            var e = this.camera,
                                t = 50 * e._computeLocalCameraSpeed(),
                                i = ia.Matrix.RotationYawPitchRoll(e.rotation.y, e.rotation.x, 0),
                                r = ia.Vector3.TransformCoordinates(new ia.Vector3(this._leftjoystick.deltaPosition.x * t, this._leftjoystick.deltaPosition.y * t, this._leftjoystick.deltaPosition.z * t), i);
                            e.cameraDirection = e.cameraDirection.add(r), e.cameraRotation = e.cameraRotation.addVector3(this._rightjoystick.deltaPosition), this._leftjoystick.pressed || (this._leftjoystick.deltaPosition = this._leftjoystick.deltaPosition.scale(.9)), this._rightjoystick.pressed || (this._rightjoystick.deltaPosition = this._rightjoystick.deltaPosition.scale(.9))
                        }
                    }, e.prototype.attachControl = function(e, t) {
                        this._leftjoystick = new ia.VirtualJoystick(!0), this._leftjoystick.setAxisForUpDown(ia.JoystickAxis.Z), this._leftjoystick.setAxisForLeftRight(ia.JoystickAxis.X), this._leftjoystick.setJoystickSensibility(.15), this._rightjoystick = new ia.VirtualJoystick(!1), this._rightjoystick.setAxisForUpDown(ia.JoystickAxis.X), this._rightjoystick.setAxisForLeftRight(ia.JoystickAxis.Y), this._rightjoystick.reverseUpDown = !0, this._rightjoystick.setJoystickSensibility(.05), this._rightjoystick.setJoystickColor("yellow")
                    }, e.prototype.detachControl = function(e) {
                        this._leftjoystick.releaseCanvas(), this._rightjoystick.releaseCanvas()
                    }, e.prototype.getClassName = function() {
                        return "FreeCameraVirtualJoystickInput"
                    }, e.prototype.getSimpleName = function() {
                        return "virtualJoystick"
                    }, e
                }(), ia.FreeCameraVirtualJoystickInput = ra, ia.CameraInputTypes.FreeCameraVirtualJoystickInput = ra,
                function(e) {
                    var t = function(e, t, i) {
                        this.quality = e, this.distance = t, this.optimizeMesh = i
                    };
                    e.SimplificationSettings = t;
                    var i, r, n = function() {
                        function t() {
                            this.running = !1, this._simplificationArray = []
                        }
                        return t.prototype.addTask = function(e) {
                            this._simplificationArray.push(e)
                        }, t.prototype.executeNext = function() {
                            var e = this._simplificationArray.pop();
                            e ? (this.running = !0, this.runSimplification(e)) : this.running = !1
                        }, t.prototype.runSimplification = function(t) {
                            var i = this;
                            if (t.parallelProcessing) t.settings.forEach(function(e) {
                                i.getSimplifier(t).simplify(e, function(r) {
                                    t.mesh.addLODLevel(e.distance, r), r.isVisible = !0, e.quality === t.settings[t.settings.length - 1].quality && t.successCallback && t.successCallback(), i.executeNext()
                                })
                            });
                            else {
                                var r = this.getSimplifier(t);
                                e.AsyncLoop.Run(t.settings.length, function(e) {
                                    var i, n;
                                    i = t.settings[e.index], n = function() {
                                        e.executeNext()
                                    }, r.simplify(i, function(e) {
                                        t.mesh.addLODLevel(i.distance, e), e.isVisible = !0, n()
                                    })
                                }, function() {
                                    t.successCallback && t.successCallback(), i.executeNext()
                                })
                            }
                        }, t.prototype.getSimplifier = function(e) {
                            switch (e.simplificationType) {
                                case i.QUADRATIC:
                                default:
                                    return new u(e.mesh)
                            }
                        }, t
                    }();
                    e.SimplificationQueue = n, (r = i = e.SimplificationType || (e.SimplificationType = {}))[r.QUADRATIC = 0] = "QUADRATIC";
                    var o = function(e) {
                            this.vertices = e, this.error = new Array(4), this.deleted = !1, this.isDirty = !1, this.deletePending = !1, this.borderFactor = 0
                        },
                        s = function() {
                            function e(e, t) {
                                this.position = e, this.id = t, this.isBorder = !0, this.q = new a, this.triangleCount = 0, this.triangleStart = 0, this.originalOffsets = []
                            }
                            return e.prototype.updatePosition = function(e) {
                                this.position.copyFrom(e)
                            }, e
                        }(),
                        a = function() {
                            function e(e) {
                                this.data = new Array(10);
                                for (var t = 0; t < 10; ++t) e && e[t] ? this.data[t] = e[t] : this.data[t] = 0
                            }
                            return e.prototype.det = function(e, t, i, r, n, o, s, a, l) {
                                return this.data[e] * this.data[n] * this.data[l] + this.data[i] * this.data[r] * this.data[a] + this.data[t] * this.data[o] * this.data[s] - this.data[i] * this.data[n] * this.data[s] - this.data[e] * this.data[o] * this.data[a] - this.data[t] * this.data[r] * this.data[l]
                            }, e.prototype.addInPlace = function(e) {
                                for (var t = 0; t < 10; ++t) this.data[t] += e.data[t]
                            }, e.prototype.addArrayInPlace = function(e) {
                                for (var t = 0; t < 10; ++t) this.data[t] += e[t]
                            }, e.prototype.add = function(t) {
                                for (var i = new e, r = 0; r < 10; ++r) i.data[r] = this.data[r] + t.data[r];
                                return i
                            }, e.FromData = function(t, i, r, n) {
                                return new e(e.DataFromNumbers(t, i, r, n))
                            }, e.DataFromNumbers = function(e, t, i, r) {
                                return [e * e, e * t, e * i, e * r, t * t, t * i, t * r, i * i, i * r, r * r]
                            }, e
                        }(),
                        l = function(e, t) {
                            this.vertexId = e, this.triangleId = t
                        },
                        u = function() {
                            function t(t) {
                                this._mesh = t, this.syncIterations = 5e3, this.aggressiveness = 7, this.decimationIterations = 100, this.boundingBoxEpsilon = e.Epsilon
                            }
                            return t.prototype.simplify = function(t, i) {
                                var r = this;
                                this.initDecimatedMesh(), e.AsyncLoop.Run(this._mesh.subMeshes.length, function(e) {
                                    r.initWithMesh(e.index, function() {
                                        r.runDecimation(t, e.index, function() {
                                            e.executeNext()
                                        })
                                    }, t.optimizeMesh)
                                }, function() {
                                    setTimeout(function() {
                                        i(r._reconstructedMesh)
                                    }, 0)
                                })
                            }, t.prototype.runDecimation = function(t, i, r) {
                                var n = this,
                                    o = ~~(this.triangles.length * t.quality),
                                    s = 0,
                                    a = this.triangles.length;
                                e.AsyncLoop.Run(this.decimationIterations, function(t) {
                                    var i, r;
                                    a - s <= o ? t.breakLoop() : (i = t.index, r = function() {
                                        t.executeNext()
                                    }, setTimeout(function() {
                                        i % 5 == 0 && n.updateMesh(0 === i);
                                        for (var t = 0; t < n.triangles.length; ++t) n.triangles[t].isDirty = !1;
                                        var l = 1e-9 * Math.pow(i + 3, n.aggressiveness);
                                        e.AsyncLoop.SyncAsyncForLoop(n.triangles.length, n.syncIterations, function(t) {
                                            var i = ~~((n.triangles.length / 2 + t) % n.triangles.length),
                                                r = n.triangles[i];
                                            if (r && !(r.error[3] > l || r.deleted || r.isDirty))
                                                for (var o = 0; o < 3; ++o)
                                                    if (r.error[o] < l) {
                                                        var a = [],
                                                            u = [],
                                                            c = r.vertices[o],
                                                            h = r.vertices[(o + 1) % 3];
                                                        if (c.isBorder || h.isBorder) continue;
                                                        var d = e.Vector3.Zero(),
                                                            p = e.Vector3.Zero(),
                                                            f = e.Vector2.Zero(),
                                                            _ = new e.Color4(0, 0, 0, 1);
                                                        n.calculateError(c, h, d, p, f, _);
                                                        var m = new Array;
                                                        if (n.isFlipped(c, h, d, a, r.borderFactor, m)) continue;
                                                        if (n.isFlipped(h, c, d, u, r.borderFactor, m)) continue;
                                                        if (a.indexOf(!0) < 0 || u.indexOf(!0) < 0) continue;
                                                        var g = new Array;
                                                        if (m.forEach(function(e) {
                                                                -1 === g.indexOf(e) && (e.deletePending = !0, g.push(e))
                                                            }), g.length % 2 != 0) continue;
                                                        c.q = h.q.add(c.q), c.updatePosition(d);
                                                        var v = n.references.length;
                                                        s = n.updateTriangles(c, c, a, s), s = n.updateTriangles(c, h, u, s);
                                                        var y = n.references.length - v;
                                                        if (y <= c.triangleCount) {
                                                            if (y)
                                                                for (var b = 0; b < y; b++) n.references[c.triangleStart + b] = n.references[v + b]
                                                        } else c.triangleStart = v;
                                                        c.triangleCount = y;
                                                        break
                                                    }
                                        }, r, function() {
                                            return a - s <= o
                                        })
                                    }, 0))
                                }, function() {
                                    setTimeout(function() {
                                        n.reconstructMesh(i), r()
                                    }, 0)
                                })
                            }, t.prototype.initWithMesh = function(t, i, r) {
                                var n = this;
                                this.vertices = [], this.triangles = [];
                                var a = this._mesh.getVerticesData(e.VertexBuffer.PositionKind),
                                    l = this._mesh.getIndices(),
                                    u = this._mesh.subMeshes[t],
                                    c = [],
                                    h = u.verticesCount;
                                e.AsyncLoop.SyncAsyncForLoop(h, this.syncIterations / 4 >> 0, function(t) {
                                    if (a) {
                                        var i = t + u.verticesStart,
                                            o = e.Vector3.FromArray(a, 3 * i),
                                            l = function(e) {
                                                if (r)
                                                    for (var t = 0; t < n.vertices.length; ++t)
                                                        if (n.vertices[t].position.equals(e)) return n.vertices[t];
                                                return null
                                            }(o) || new s(o, n.vertices.length);
                                        l.originalOffsets.push(i), l.id === n.vertices.length && n.vertices.push(l), c.push(l.id)
                                    }
                                }, function() {
                                    e.AsyncLoop.SyncAsyncForLoop(u.indexCount / 3, n.syncIterations, function(e) {
                                        if (l) {
                                            var t = 3 * (u.indexStart / 3 + e),
                                                i = l[t + 0],
                                                r = l[t + 1],
                                                s = l[t + 2],
                                                a = n.vertices[c[i - u.verticesStart]],
                                                h = n.vertices[c[r - u.verticesStart]],
                                                d = n.vertices[c[s - u.verticesStart]],
                                                p = new o([a, h, d]);
                                            p.originalOffset = t, n.triangles.push(p)
                                        }
                                    }, function() {
                                        n.init(i)
                                    })
                                })
                            }, t.prototype.init = function(t) {
                                var i = this;
                                e.AsyncLoop.SyncAsyncForLoop(this.triangles.length, this.syncIterations, function(t) {
                                    var r = i.triangles[t];
                                    r.normal = e.Vector3.Cross(r.vertices[1].position.subtract(r.vertices[0].position), r.vertices[2].position.subtract(r.vertices[0].position)).normalize();
                                    for (var n = 0; n < 3; n++) r.vertices[n].q.addArrayInPlace(a.DataFromNumbers(r.normal.x, r.normal.y, r.normal.z, -e.Vector3.Dot(r.normal, r.vertices[0].position)))
                                }, function() {
                                    e.AsyncLoop.SyncAsyncForLoop(i.triangles.length, i.syncIterations, function(e) {
                                        for (var t = i.triangles[e], r = 0; r < 3; ++r) t.error[r] = i.calculateError(t.vertices[r], t.vertices[(r + 1) % 3]);
                                        t.error[3] = Math.min(t.error[0], t.error[1], t.error[2])
                                    }, function() {
                                        t()
                                    })
                                })
                            }, t.prototype.reconstructMesh = function(t) {
                                var i, r, n, o = [];
                                for (i = 0; i < this.vertices.length; ++i) this.vertices[i].triangleCount = 0;
                                for (i = 0; i < this.triangles.length; ++i)
                                    if (!this.triangles[i].deleted) {
                                        for (r = this.triangles[i], n = 0; n < 3; ++n) r.vertices[n].triangleCount = 1;
                                        o.push(r)
                                    }
                                var s = this._reconstructedMesh.getVerticesData(e.VertexBuffer.PositionKind) || [],
                                    a = this._reconstructedMesh.getVerticesData(e.VertexBuffer.NormalKind) || [],
                                    l = this._reconstructedMesh.getVerticesData(e.VertexBuffer.UVKind) || [],
                                    u = this._reconstructedMesh.getVerticesData(e.VertexBuffer.ColorKind) || [],
                                    c = this._mesh.getVerticesData(e.VertexBuffer.NormalKind),
                                    h = this._mesh.getVerticesData(e.VertexBuffer.UVKind),
                                    d = this._mesh.getVerticesData(e.VertexBuffer.ColorKind),
                                    p = 0;
                                for (i = 0; i < this.vertices.length; ++i) {
                                    var f = this.vertices[i];
                                    f.id = p, f.triangleCount && f.originalOffsets.forEach(function(e) {
                                        c && (s.push(f.position.x), s.push(f.position.y), s.push(f.position.z), a.push(c[3 * e]), a.push(c[3 * e + 1]), a.push(c[3 * e + 2]), h && h.length ? (l.push(h[2 * e]), l.push(h[2 * e + 1])) : d && d.length && (u.push(d[4 * e]), u.push(d[4 * e + 1]), u.push(d[4 * e + 2]), u.push(d[4 * e + 3])), ++p)
                                    })
                                }
                                var _ = this._reconstructedMesh.getTotalIndices(),
                                    m = this._reconstructedMesh.getTotalVertices(),
                                    g = this._reconstructedMesh.subMeshes;
                                this._reconstructedMesh.subMeshes = [];
                                var v = this._reconstructedMesh.getIndices(),
                                    y = this._mesh.getIndices();
                                for (i = 0; i < o.length; ++i) r = o[i], [0, 1, 2].forEach(function(e) {
                                    var t = y[r.originalOffset + e],
                                        i = r.vertices[e].originalOffsets.indexOf(t);
                                    i < 0 && (i = 0), v.push(r.vertices[e].id + i + m)
                                });
                                this._reconstructedMesh.setIndices(v), this._reconstructedMesh.setVerticesData(e.VertexBuffer.PositionKind, s), this._reconstructedMesh.setVerticesData(e.VertexBuffer.NormalKind, a), 0 < l.length && this._reconstructedMesh.setVerticesData(e.VertexBuffer.UVKind, l), 0 < u.length && this._reconstructedMesh.setVerticesData(e.VertexBuffer.ColorKind, u);
                                var b = this._mesh.subMeshes[t];
                                0 < t && (this._reconstructedMesh.subMeshes = [], g.forEach(function(t) {
                                    e.SubMesh.AddToMesh(t.materialIndex, t.verticesStart, t.verticesCount, t.indexStart, t.indexCount, t.getMesh())
                                }), e.SubMesh.AddToMesh(b.materialIndex, m, p, _, 3 * o.length, this._reconstructedMesh))
                            }, t.prototype.initDecimatedMesh = function() {
                                this._reconstructedMesh = new e.Mesh(this._mesh.name + "Decimated", this._mesh.getScene()), this._reconstructedMesh.material = this._mesh.material, this._reconstructedMesh.parent = this._mesh.parent, this._reconstructedMesh.isVisible = !1, this._reconstructedMesh.renderingGroupId = this._mesh.renderingGroupId
                            }, t.prototype.isFlipped = function(t, i, r, n, o, s) {
                                for (var a = 0; a < t.triangleCount; ++a) {
                                    var l = this.triangles[this.references[t.triangleStart + a].triangleId];
                                    if (!l.deleted) {
                                        var u = this.references[t.triangleStart + a].vertexId,
                                            c = l.vertices[(u + 1) % 3],
                                            h = l.vertices[(u + 2) % 3];
                                        if (c !== i && h !== i) {
                                            var d = c.position.subtract(r);
                                            d = d.normalize();
                                            var p = h.position.subtract(r);
                                            if (p = p.normalize(), .999 < Math.abs(e.Vector3.Dot(d, p))) return !0;
                                            var f = e.Vector3.Cross(d, p).normalize();
                                            if (n[a] = !1, e.Vector3.Dot(f, l.normal) < .2) return !0
                                        } else n[a] = !0, s.push(l)
                                    }
                                }
                                return !1
                            }, t.prototype.updateTriangles = function(e, t, i, r) {
                                for (var n = r, o = 0; o < t.triangleCount; ++o) {
                                    var s = this.references[t.triangleStart + o],
                                        a = this.triangles[s.triangleId];
                                    a.deleted || (i[o] && a.deletePending ? (a.deleted = !0, n++) : (a.vertices[s.vertexId] = e, a.isDirty = !0, a.error[0] = this.calculateError(a.vertices[0], a.vertices[1]) + a.borderFactor / 2, a.error[1] = this.calculateError(a.vertices[1], a.vertices[2]) + a.borderFactor / 2, a.error[2] = this.calculateError(a.vertices[2], a.vertices[0]) + a.borderFactor / 2, a.error[3] = Math.min(a.error[0], a.error[1], a.error[2]), this.references.push(s)))
                                }
                                return n
                            }, t.prototype.identifyBorder = function() {
                                for (var e = 0; e < this.vertices.length; ++e) {
                                    var t, i = [],
                                        r = [],
                                        n = this.vertices[e];
                                    for (t = 0; t < n.triangleCount; ++t)
                                        for (var o = this.triangles[this.references[n.triangleStart + t].triangleId], s = 0; s < 3; s++) {
                                            for (var a = 0, l = o.vertices[s]; a < i.length && r[a] !== l.id;) ++a;
                                            a === i.length ? (i.push(1), r.push(l.id)) : i[a]++
                                        }
                                    for (t = 0; t < i.length; ++t) 1 === i[t] ? this.vertices[r[t]].isBorder = !0 : this.vertices[r[t]].isBorder = !1
                                }
                            }, t.prototype.updateMesh = function(e) {
                                var t, i, r, n;
                                if (void 0 === e && (e = !1), !e) {
                                    var o = [];
                                    for (t = 0; t < this.triangles.length; ++t) this.triangles[t].deleted || o.push(this.triangles[t]);
                                    this.triangles = o
                                }
                                for (t = 0; t < this.vertices.length; ++t) this.vertices[t].triangleCount = 0, this.vertices[t].triangleStart = 0;
                                for (t = 0; t < this.triangles.length; ++t)
                                    for (i = this.triangles[t], r = 0; r < 3; ++r)(n = i.vertices[r]).triangleCount++;
                                var s = 0;
                                for (t = 0; t < this.vertices.length; ++t) this.vertices[t].triangleStart = s, s += this.vertices[t].triangleCount, this.vertices[t].triangleCount = 0;
                                var a = new Array(3 * this.triangles.length);
                                for (t = 0; t < this.triangles.length; ++t)
                                    for (i = this.triangles[t], r = 0; r < 3; ++r) a[(n = i.vertices[r]).triangleStart + n.triangleCount] = new l(r, t), n.triangleCount++;
                                this.references = a, e && this.identifyBorder()
                            }, t.prototype.vertexError = function(e, t) {
                                var i = t.x,
                                    r = t.y,
                                    n = t.z;
                                return e.data[0] * i * i + 2 * e.data[1] * i * r + 2 * e.data[2] * i * n + 2 * e.data[3] * i + e.data[4] * r * r + 2 * e.data[5] * r * n + 2 * e.data[6] * r + e.data[7] * n * n + 2 * e.data[8] * n + e.data[9]
                            }, t.prototype.calculateError = function(t, i, r, n, o, s) {
                                var a = t.q.add(i.q),
                                    l = t.isBorder && i.isBorder,
                                    u = 0,
                                    c = a.det(0, 1, 2, 1, 4, 5, 2, 5, 7);
                                if (0 === c || l) {
                                    var h = t.position.add(i.position).divide(new e.Vector3(2, 2, 2)),
                                        d = this.vertexError(a, t.position),
                                        p = this.vertexError(a, i.position),
                                        f = this.vertexError(a, h);
                                    (u = Math.min(d, p, f)) === d ? r && r.copyFrom(t.position) : u === p ? r && r.copyFrom(i.position) : r && r.copyFrom(h)
                                } else r || (r = e.Vector3.Zero()), r.x = -1 / c * a.det(1, 2, 3, 4, 5, 6, 5, 7, 8), r.y = 1 / c * a.det(0, 2, 3, 1, 5, 6, 2, 7, 8), r.z = -1 / c * a.det(0, 1, 3, 1, 4, 6, 2, 5, 8), u = this.vertexError(a, r);
                                return u
                            }, t
                        }()
                }($a || ($a = {})),
                function(e) {
                    Object.defineProperty(e.Scene.prototype, "simplificationQueue", {
                        get: function() {
                            if (!this._simplificationQueue) {
                                this._simplificationQueue = new e.SimplificationQueue;
                                var i = this._getComponent(e.SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE);
                                i || (i = new t(this), this._addComponent(i))
                            }
                            return this._simplificationQueue
                        },
                        set: function(e) {
                            this._simplificationQueue = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.Mesh.prototype.simplify = function(t, i, r, n) {
                        return void 0 === i && (i = !0), void 0 === r && (r = e.SimplificationType.QUADRATIC), this.getScene().simplificationQueue.addTask({
                            settings: t,
                            parallelProcessing: i,
                            mesh: this,
                            simplificationType: r,
                            successCallback: n
                        }), this
                    };
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE, this.scene = t
                        }
                        return t.prototype.register = function() {
                            this.scene._beforeCameraUpdateStage.registerStep(e.SceneComponentConstants.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE, this, this._beforeCameraUpdate)
                        }, t.prototype.rebuild = function() {}, t.prototype.dispose = function() {}, t.prototype._beforeCameraUpdate = function() {
                            this.scene._simplificationQueue && !this.scene._simplificationQueue.running && this.scene._simplificationQueue.executeNext()
                        }, t
                    }();
                    e.SimplicationQueueSceneComponent = t
                }($a || ($a = {})), na = function(e, t) {
                    this.distance = e, this.mesh = t
                }, ($a || ($a = {})).MeshLODLevel = na,
                function(e) {
                    var t = function() {
                            function e(e) {
                                void 0 === e && (e = 0), this.priority = e
                            }
                            return e.prototype.getDescription = function() {
                                return ""
                            }, e.prototype.apply = function(e, t) {
                                return !0
                            }, e
                        }(),
                        i = function(e) {
                            function t(t, i, r) {
                                void 0 === t && (t = 0), void 0 === i && (i = 1024), void 0 === r && (r = .5);
                                var n = e.call(this, t) || this;
                                return n.priority = t, n.maximumSize = i, n.step = r, n
                            }
                            return b(t, e), t.prototype.getDescription = function() {
                                return "Reducing render target texture size to " + this.maximumSize
                            }, t.prototype.apply = function(e, t) {
                                for (var i = !0, r = 0; r < e.textures.length; r++) {
                                    var n = e.textures[r];
                                    if (n.canRescale && !n.getContext) {
                                        var o = n.getSize();
                                        Math.max(o.width, o.height) > this.maximumSize && (n.scale(this.step), i = !1)
                                    }
                                }
                                return i
                            }, t
                        }(e.SceneOptimization = t);
                    e.TextureOptimization = i;
                    var r = function(e) {
                        function t(t, i, r) {
                            void 0 === t && (t = 0), void 0 === i && (i = 2), void 0 === r && (r = .25);
                            var n = e.call(this, t) || this;
                            return n.priority = t, n.maximumScale = i, n.step = r,
                                n._currentScale = -1, n._directionOffset = 1, n
                        }
                        return b(t, e), t.prototype.getDescription = function() {
                            return "Setting hardware scaling level to " + this._currentScale
                        }, t.prototype.apply = function(e, t) {
                            return -1 === this._currentScale && (this._currentScale = e.getEngine().getHardwareScalingLevel(), this._currentScale > this.maximumScale && (this._directionOffset = -1)), this._currentScale += this._directionOffset * this.step, e.getEngine().setHardwareScalingLevel(this._currentScale), 1 === this._directionOffset ? this._currentScale >= this.maximumScale : this._currentScale <= this.maximumScale
                        }, t
                    }(t);
                    e.HardwareScalingOptimization = r;
                    var n = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t.prototype.getDescription = function() {
                            return "Turning shadows on/off"
                        }, t.prototype.apply = function(e, t) {
                            return e.shadowsEnabled = t.isInImprovementMode, !0
                        }, t
                    }(t);
                    e.ShadowsOptimization = n;
                    var o = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t.prototype.getDescription = function() {
                            return "Turning post-processes on/off"
                        }, t.prototype.apply = function(e, t) {
                            return e.postProcessesEnabled = t.isInImprovementMode, !0
                        }, t
                    }(t);
                    e.PostProcessesOptimization = o;
                    var s = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t.prototype.getDescription = function() {
                            return "Turning lens flares on/off"
                        }, t.prototype.apply = function(e, t) {
                            return e.lensFlaresEnabled = t.isInImprovementMode, !0
                        }, t
                    }(t);
                    e.LensFlaresOptimization = s;
                    var a = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t.prototype.getDescription = function() {
                            return this.onGetDescription ? this.onGetDescription() : "Running user defined callback"
                        }, t.prototype.apply = function(e, t) {
                            return !this.onApply || this.onApply(e, t)
                        }, t
                    }(t);
                    e.CustomOptimization = a;
                    var l = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t.prototype.getDescription = function() {
                            return "Turning particles on/off"
                        }, t.prototype.apply = function(e, t) {
                            return e.particlesEnabled = t.isInImprovementMode, !0
                        }, t
                    }(t);
                    e.ParticlesOptimization = l;
                    var u = function(e) {
                        function t() {
                            return null !== e && e.apply(this, arguments) || this
                        }
                        return b(t, e), t.prototype.getDescription = function() {
                            return "Turning render targets off"
                        }, t.prototype.apply = function(e, t) {
                            return e.renderTargetsEnabled = t.isInImprovementMode, !0
                        }, t
                    }(t);
                    e.RenderTargetsOptimization = u;
                    var c = function(t) {
                        function i() {
                            var i = null !== t && t.apply(this, arguments) || this;
                            return i._canBeMerged = function(t) {
                                if (!(t instanceof e.Mesh)) return !1;
                                var i = t;
                                return !(i.isDisposed() || !i.isVisible || !i.isEnabled() || 0 < i.instances.length || i.skeleton || i.hasLODLevels)
                            }, i
                        }
                        return b(i, t), Object.defineProperty(i, "UpdateSelectionTree", {
                            get: function() {
                                return i._UpdateSelectionTree
                            },
                            set: function(e) {
                                i._UpdateSelectionTree = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i.prototype.getDescription = function() {
                            return "Merging similar meshes together"
                        }, i.prototype.apply = function(t, r, n) {
                            for (var o = t.meshes.slice(0), s = o.length, a = 0; a < s; a++) {
                                var l = new Array,
                                    u = o[a];
                                if (this._canBeMerged(u)) {
                                    l.push(u);
                                    for (var c = a + 1; c < s; c++) {
                                        var h = o[c];
                                        this._canBeMerged(h) && h.material === u.material && h.checkCollisions === u.checkCollisions && (l.push(h), s--, o.splice(c, 1), c--)
                                    }
                                    l.length < 2 || e.Mesh.MergeMeshes(l, void 0, !0)
                                }
                            }
                            var d = t;
                            return d.createOrUpdateSelectionOctree && (null != n ? n && d.createOrUpdateSelectionOctree() : i.UpdateSelectionTree && d.createOrUpdateSelectionOctree()), !0
                        }, i._UpdateSelectionTree = !1, i
                    }(t);
                    e.MergeMeshesOptimization = c;
                    var h = function() {
                        function e(e, t) {
                            void 0 === e && (e = 60), void 0 === t && (t = 2e3), this.targetFrameRate = e, this.trackerDuration = t, this.optimizations = new Array
                        }
                        return e.prototype.addOptimization = function(e) {
                            return this.optimizations.push(e), this
                        }, e.prototype.addCustomOptimization = function(e, t, i) {
                            void 0 === i && (i = 0);
                            var r = new a(i);
                            return r.onApply = e, r.onGetDescription = t, this.optimizations.push(r), this
                        }, e.LowDegradationAllowed = function(t) {
                            var r = new e(t),
                                a = 0;
                            return r.addOptimization(new c(a)), r.addOptimization(new n(a)), r.addOptimization(new s(a)), a++, r.addOptimization(new o(a)), r.addOptimization(new l(a)), a++, r.addOptimization(new i(a, 1024)), r
                        }, e.ModerateDegradationAllowed = function(t) {
                            var a = new e(t),
                                h = 0;
                            return a.addOptimization(new c(h)), a.addOptimization(new n(h)), a.addOptimization(new s(h)), h++, a.addOptimization(new o(h)), a.addOptimization(new l(h)), h++, a.addOptimization(new i(h, 512)), h++, a.addOptimization(new u(h)), h++, a.addOptimization(new r(h, 2)), a
                        }, e.HighDegradationAllowed = function(t) {
                            var a = new e(t),
                                h = 0;
                            return a.addOptimization(new c(h)), a.addOptimization(new n(h)), a.addOptimization(new s(h)), h++, a.addOptimization(new o(h)), a.addOptimization(new l(h)), h++, a.addOptimization(new i(h, 256)), h++, a.addOptimization(new u(h)), h++, a.addOptimization(new r(h, 4)), a
                        }, e
                    }();
                    e.SceneOptimizerOptions = h;
                    var d = function() {
                        function t(t, i, r, n) {
                            void 0 === r && (r = !0), void 0 === n && (n = !1);
                            var o = this;
                            if (this._isRunning = !1, this._currentPriorityLevel = 0, this._targetFrameRate = 60, this._trackerDuration = 2e3, this._currentFrameRate = 0, this._improvementMode = !1, this.onSuccessObservable = new e.Observable, this.onNewOptimizationAppliedObservable = new e.Observable, this.onFailureObservable = new e.Observable, this._options = i || new h, this._options.targetFrameRate && (this._targetFrameRate = this._options.targetFrameRate), this._options.trackerDuration && (this._trackerDuration = this._options.trackerDuration), r)
                                for (var s = 0, a = 0, l = this._options.optimizations; a < l.length; a++) l[a].priority = s++;
                            this._improvementMode = n, this._scene = t || e.Engine.LastCreatedScene, this._sceneDisposeObserver = this._scene.onDisposeObservable.add(function() {
                                o._sceneDisposeObserver = null, o.dispose()
                            })
                        }
                        return Object.defineProperty(t.prototype, "isInImprovementMode", {
                            get: function() {
                                return this._improvementMode
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "currentPriorityLevel", {
                            get: function() {
                                return this._currentPriorityLevel
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "currentFrameRate", {
                            get: function() {
                                return this._currentFrameRate
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "targetFrameRate", {
                            get: function() {
                                return this._targetFrameRate
                            },
                            set: function(e) {
                                this._targetFrameRate = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "trackerDuration", {
                            get: function() {
                                return this._trackerDuration
                            },
                            set: function(e) {
                                this._trackerDuration = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(t.prototype, "optimizations", {
                            get: function() {
                                return this._options.optimizations
                            },
                            enumerable: !0,
                            configurable: !0
                        }), t.prototype.stop = function() {
                            this._isRunning = !1
                        }, t.prototype.reset = function() {
                            this._currentPriorityLevel = 0
                        }, t.prototype.start = function() {
                            var e = this;
                            this._isRunning || (this._isRunning = !0, this._scene.executeWhenReady(function() {
                                setTimeout(function() {
                                    e._checkCurrentState()
                                }, e._trackerDuration)
                            }))
                        }, t.prototype._checkCurrentState = function() {
                            var e = this;
                            if (this._isRunning) {
                                var t = this._scene,
                                    i = this._options;
                                if (this._currentFrameRate = Math.round(t.getEngine().getFps()), this._improvementMode && this._currentFrameRate <= this._targetFrameRate || !this._improvementMode && this._currentFrameRate >= this._targetFrameRate) return this._isRunning = !1, void this.onSuccessObservable.notifyObservers(this);
                                for (var r = !0, n = !0, o = 0; o < i.optimizations.length; o++) {
                                    var s = i.optimizations[o];
                                    s.priority === this._currentPriorityLevel && (n = !1, r = r && s.apply(t, this), this.onNewOptimizationAppliedObservable.notifyObservers(s))
                                }
                                if (n) return this._isRunning = !1, void this.onFailureObservable.notifyObservers(this);
                                r && this._currentPriorityLevel++, t.executeWhenReady(function() {
                                    setTimeout(function() {
                                        e._checkCurrentState()
                                    }, e._trackerDuration)
                                })
                            }
                        }, t.prototype.dispose = function() {
                            this.stop(), this.onSuccessObservable.clear(), this.onFailureObservable.clear(), this.onNewOptimizationAppliedObservable.clear(), this._sceneDisposeObserver && this._scene.onDisposeObservable.remove(this._sceneDisposeObserver)
                        }, t.OptimizeAsync = function(e, i, r, n) {
                            var o = new t(e, i || h.ModerateDegradationAllowed(), !1);
                            return r && o.onSuccessObservable.add(function() {
                                r()
                            }), n && o.onFailureObservable.add(function() {
                                n()
                            }), o.start(), o
                        }, t
                    }();
                    e.SceneOptimizer = d
                }($a || ($a = {})),
                function(e) {
                    e.Scene.prototype.getOutlineRenderer = function() {
                        return this._outlineRenderer || (this._outlineRenderer = new t(this)), this._outlineRenderer
                    }, Object.defineProperty(e.AbstractMesh.prototype, "renderOutline", {
                        get: function() {
                            return this._renderOutline
                        },
                        set: function(e) {
                            e && this.getScene().getOutlineRenderer(), this._renderOutline = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.AbstractMesh.prototype, "renderOverlay", {
                        get: function() {
                            return this._renderOverlay
                        },
                        set: function(e) {
                            e && this.getScene().getOutlineRenderer(), this._renderOverlay = e
                        },
                        enumerable: !0,
                        configurable: !0
                    });
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_OUTLINERENDERER, this.zOffset = 1, this.scene = t, this._engine = t.getEngine(), this.scene._addComponent(this)
                        }
                        return t.prototype.register = function() {
                            this.scene._beforeRenderingMeshStage.registerStep(e.SceneComponentConstants.STEP_BEFORERENDERINGMESH_OUTLINE, this, this._beforeRenderingMesh), this.scene._afterRenderingMeshStage.registerStep(e.SceneComponentConstants.STEP_AFTERRENDERINGMESH_OUTLINE, this, this._afterRenderingMesh)
                        }, t.prototype.rebuild = function() {}, t.prototype.dispose = function() {}, t.prototype.render = function(t, i, r) {
                            var n = this;
                            void 0 === r && (r = !1);
                            var o = this.scene,
                                s = o.getEngine(),
                                a = s.getCaps().instancedArrays && null !== i.visibleInstances[t._id] && void 0 !== i.visibleInstances[t._id];
                            if (this.isReady(t, a)) {
                                var l = t.getRenderingMesh(),
                                    u = t.getMaterial();
                                if (u && o.activeCamera) {
                                    if (s.enableEffect(this._effect), u.useLogarithmicDepth && this._effect.setFloat("logarithmicDepthConstant", 2 / (Math.log(o.activeCamera.maxZ + 1) / Math.LN2)), this._effect.setFloat("offset", r ? 0 : l.outlineWidth), this._effect.setColor4("color", r ? l.overlayColor : l.outlineColor, r ? l.overlayAlpha : u.alpha), this._effect.setMatrix("viewProjection", o.getTransformMatrix()), l.useBones && l.computeBonesUsingShaders && l.skeleton && this._effect.setMatrices("mBones", l.skeleton.getTransformMatrices(l)), l._bind(t, this._effect, e.Material.TriangleFillMode), u && u.needAlphaTesting()) {
                                        var c = u.getAlphaTestTexture();
                                        c && (this._effect.setTexture("diffuseSampler", c), this._effect.setMatrix("diffuseMatrix", c.getTextureMatrix()))
                                    }
                                    s.setZOffset(-this.zOffset), l._processRendering(t, this._effect, e.Material.TriangleFillMode, i, a, function(e, t) {
                                        n._effect.setMatrix("world", t)
                                    }), s.setZOffset(0)
                                }
                            }
                        }, t.prototype.isReady = function(t, i) {
                            var r = [],
                                n = [e.VertexBuffer.PositionKind, e.VertexBuffer.NormalKind],
                                o = t.getMesh(),
                                s = t.getMaterial();
                            s && (s.needAlphaTesting() && (r.push("#define ALPHATEST"), o.isVerticesDataPresent(e.VertexBuffer.UVKind) && (n.push(e.VertexBuffer.UVKind), r.push("#define UV1")), o.isVerticesDataPresent(e.VertexBuffer.UV2Kind) && (n.push(e.VertexBuffer.UV2Kind), r.push("#define UV2"))), s.useLogarithmicDepth && r.push("#define LOGARITHMICDEPTH")), o.useBones && o.computeBonesUsingShaders ? (n.push(e.VertexBuffer.MatricesIndicesKind), n.push(e.VertexBuffer.MatricesWeightsKind), 4 < o.numBoneInfluencers && (n.push(e.VertexBuffer.MatricesIndicesExtraKind), n.push(e.VertexBuffer.MatricesWeightsExtraKind)), r.push("#define NUM_BONE_INFLUENCERS " + o.numBoneInfluencers), r.push("#define BonesPerMesh " + (o.skeleton ? o.skeleton.bones.length + 1 : 0))) : r.push("#define NUM_BONE_INFLUENCERS 0"), i && (r.push("#define INSTANCES"), n.push("world0"), n.push("world1"), n.push("world2"), n.push("world3"));
                            var a = r.join("\n");
                            return this._cachedDefines !== a && (this._cachedDefines = a, this._effect = this.scene.getEngine().createEffect("outline", n, ["world", "mBones", "viewProjection", "diffuseMatrix", "offset", "color", "logarithmicDepthConstant"], ["diffuseSampler"], a)), this._effect.isReady()
                        }, t.prototype._beforeRenderingMesh = function(e, t, i) {
                            this._savedDepthWrite = this._engine.getDepthWrite(), e.renderOutline && (this._engine.setDepthWrite(!1), this.render(t, i), this._engine.setDepthWrite(this._savedDepthWrite))
                        }, t.prototype._afterRenderingMesh = function(t, i, r) {
                            if (t.renderOutline && this._savedDepthWrite && (this._engine.setDepthWrite(!0), this._engine.setColorWrite(!1), this.render(i, r), this._engine.setColorWrite(!0)), t.renderOverlay) {
                                var n = this._engine.getAlphaMode();
                                this._engine.setAlphaMode(e.Engine.ALPHA_COMBINE), this.render(i, r, !0), this._engine.setAlphaMode(n)
                            }
                        }, t
                    }();
                    e.OutlineRenderer = t
                }($a || ($a = {})),
                function(e) {
                    e.AbstractMesh.prototype.disableEdgesRendering = function() {
                        return this._edgesRenderer && (this._edgesRenderer.dispose(), this._edgesRenderer = null), this
                    }, e.AbstractMesh.prototype.enableEdgesRendering = function(e, t) {
                        return void 0 === e && (e = .95), void 0 === t && (t = !1), this.disableEdgesRendering(), this._edgesRenderer = new i(this, e, t), this
                    }, Object.defineProperty(e.AbstractMesh.prototype, "edgesRenderer", {
                        get: function() {
                            return this._edgesRenderer
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.LinesMesh.prototype.enableEdgesRendering = function(t, i) {
                        return void 0 === t && (t = .95), void 0 === i && (i = !1), this.disableEdgesRendering(), this._edgesRenderer = new e.LineEdgesRenderer(this, t, i), this
                    };
                    var t = function() {
                            this.edges = new Array, this.edgesConnectedCount = 0
                        },
                        i = function() {
                            function i(e, t, i, r) {
                                void 0 === t && (t = .95), void 0 === i && (i = !1), void 0 === r && (r = !0);
                                var n = this;
                                this.edgesWidthScalerForOrthographic = 1e3, this.edgesWidthScalerForPerspective = 50, this._linesPositions = new Array, this._linesNormals = new Array, this._linesIndices = new Array, this._buffers = {}, this._checkVerticesInsteadOfIndices = !1, this.isEnabled = !0, this._source = e, this._checkVerticesInsteadOfIndices = i, this._epsilon = t, this._prepareRessources(), r && this._generateEdgesLines(), this._meshRebuildObserver = this._source.onRebuildObservable.add(function() {
                                    n._rebuild()
                                }), this._meshDisposeObserver = this._source.onDisposeObservable.add(function() {
                                    n.dispose()
                                })
                            }
                            return i.prototype._prepareRessources = function() {
                                this._lineShader || (this._lineShader = new e.ShaderMaterial("lineShader", this._source.getScene(), "line", {
                                    attributes: ["position", "normal"],
                                    uniforms: ["worldViewProjection", "color", "width", "aspectRatio"]
                                }), this._lineShader.disableDepthWrite = !0, this._lineShader.backFaceCulling = !1)
                            }, i.prototype._rebuild = function() {
                                var t = this._buffers[e.VertexBuffer.PositionKind];
                                t && t._rebuild(), (t = this._buffers[e.VertexBuffer.NormalKind]) && t._rebuild();
                                var i = this._source.getScene().getEngine();
                                this._ib = i.createIndexBuffer(this._linesIndices)
                            }, i.prototype.dispose = function() {
                                this._source.onRebuildObservable.remove(this._meshRebuildObserver), this._source.onDisposeObservable.remove(this._meshDisposeObserver);
                                var t = this._buffers[e.VertexBuffer.PositionKind];
                                t && (t.dispose(), this._buffers[e.VertexBuffer.PositionKind] = null), (t = this._buffers[e.VertexBuffer.NormalKind]) && (t.dispose(), this._buffers[e.VertexBuffer.NormalKind] = null), this._source.getScene().getEngine()._releaseBuffer(this._ib), this._lineShader.dispose()
                            }, i.prototype._processEdgeForAdjacencies = function(e, t, i, r, n) {
                                return e === i && t === r || e === r && t === i ? 0 : e === r && t === n || e === n && t === r ? 1 : e === n && t === i || e === i && t === n ? 2 : -1
                            }, i.prototype._processEdgeForAdjacenciesWithVertices = function(e, t, i, r, n) {
                                return e.equalsWithEpsilon(i) && t.equalsWithEpsilon(r) || e.equalsWithEpsilon(r) && t.equalsWithEpsilon(i) ? 0 : e.equalsWithEpsilon(r) && t.equalsWithEpsilon(n) || e.equalsWithEpsilon(n) && t.equalsWithEpsilon(r) ? 1 : e.equalsWithEpsilon(n) && t.equalsWithEpsilon(i) || e.equalsWithEpsilon(i) && t.equalsWithEpsilon(n) ? 2 : -1
                            }, i.prototype._checkEdge = function(t, i, r, n, o) {
                                if (void 0 === i || e.Vector3.Dot(r[t], r[i]) < this._epsilon) {
                                    var s = this._linesPositions.length / 3;
                                    n.subtract(o).normalize(), this._linesPositions.push(n.x), this._linesPositions.push(n.y), this._linesPositions.push(n.z), this._linesPositions.push(n.x), this._linesPositions.push(n.y), this._linesPositions.push(n.z), this._linesPositions.push(o.x), this._linesPositions.push(o.y), this._linesPositions.push(o.z), this._linesPositions.push(o.x), this._linesPositions.push(o.y), this._linesPositions.push(o.z), this._linesNormals.push(o.x), this._linesNormals.push(o.y), this._linesNormals.push(o.z), this._linesNormals.push(-1), this._linesNormals.push(o.x), this._linesNormals.push(o.y), this._linesNormals.push(o.z), this._linesNormals.push(1), this._linesNormals.push(n.x), this._linesNormals.push(n.y), this._linesNormals.push(n.z), this._linesNormals.push(-1), this._linesNormals.push(n.x), this._linesNormals.push(n.y), this._linesNormals.push(n.z), this._linesNormals.push(1), this._linesIndices.push(s), this._linesIndices.push(s + 1), this._linesIndices.push(s + 2), this._linesIndices.push(s), this._linesIndices.push(s + 2), this._linesIndices.push(s + 3)
                                }
                            }, i.prototype._generateEdgesLines = function() {
                                var i = this._source.getVerticesData(e.VertexBuffer.PositionKind),
                                    r = this._source.getIndices();
                                if (r && i) {
                                    var n, o, s = new Array,
                                        a = new Array;
                                    for (n = 0; n < r.length; n += 3) {
                                        o = new t;
                                        var l = r[n],
                                            u = r[n + 1],
                                            c = r[n + 2];
                                        o.p0 = new e.Vector3(i[3 * l], i[3 * l + 1], i[3 * l + 2]), o.p1 = new e.Vector3(i[3 * u], i[3 * u + 1], i[3 * u + 2]), o.p2 = new e.Vector3(i[3 * c], i[3 * c + 1], i[3 * c + 2]);
                                        var h = e.Vector3.Cross(o.p1.subtract(o.p0), o.p2.subtract(o.p1));
                                        h.normalize(), a.push(h), s.push(o)
                                    }
                                    for (n = 0; n < s.length; n++) {
                                        o = s[n];
                                        for (var d = n + 1; d < s.length; d++) {
                                            var p = s[d];
                                            if (3 === o.edgesConnectedCount) break;
                                            if (3 !== p.edgesConnectedCount)
                                                for (var f = r[3 * d], _ = r[3 * d + 1], m = r[3 * d + 2], g = 0; g < 3; g++) {
                                                    var v = 0;
                                                    if (void 0 === o.edges[g]) {
                                                        switch (g) {
                                                            case 0:
                                                                v = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(o.p0, o.p1, p.p0, p.p1, p.p2) : this._processEdgeForAdjacencies(r[3 * n], r[3 * n + 1], f, _, m);
                                                                break;
                                                            case 1:
                                                                v = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(o.p1, o.p2, p.p0, p.p1, p.p2) : this._processEdgeForAdjacencies(r[3 * n + 1], r[3 * n + 2], f, _, m);
                                                                break;
                                                            case 2:
                                                                v = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(o.p2, o.p0, p.p0, p.p1, p.p2) : this._processEdgeForAdjacencies(r[3 * n + 2], r[3 * n], f, _, m)
                                                        }
                                                        if (-1 !== v && (o.edges[g] = d, p.edges[v] = n, o.edgesConnectedCount++, p.edgesConnectedCount++, 3 === o.edgesConnectedCount)) break
                                                    }
                                                }
                                        }
                                    }
                                    for (n = 0; n < s.length; n++) {
                                        var y = s[n];
                                        this._checkEdge(n, y.edges[0], a, y.p0, y.p1), this._checkEdge(n, y.edges[1], a, y.p1, y.p2), this._checkEdge(n, y.edges[2], a, y.p2, y.p0)
                                    }
                                    var b = this._source.getScene().getEngine();
                                    this._buffers[e.VertexBuffer.PositionKind] = new e.VertexBuffer(b, this._linesPositions, e.VertexBuffer.PositionKind, !1), this._buffers[e.VertexBuffer.NormalKind] = new e.VertexBuffer(b, this._linesNormals, e.VertexBuffer.NormalKind, !1, !1, 4), this._ib = b.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length
                                }
                            }, i.prototype.isReady = function() {
                                return this._lineShader.isReady()
                            }, i.prototype.render = function() {
                                var t = this._source.getScene();
                                if (this.isReady() && t.activeCamera) {
                                    var i = t.getEngine();
                                    this._lineShader._preBind(), 1 !== this._source.edgesColor.a ? i.setAlphaMode(e.Engine.ALPHA_COMBINE) : i.setAlphaMode(e.Engine.ALPHA_DISABLE), i.bindBuffers(this._buffers, this._ib, this._lineShader.getEffect()), t.resetCachedMaterial(), this._lineShader.setColor4("color", this._source.edgesColor), t.activeCamera.mode === e.Camera.ORTHOGRAPHIC_CAMERA ? this._lineShader.setFloat("width", this._source.edgesWidth / this.edgesWidthScalerForOrthographic) : this._lineShader.setFloat("width", this._source.edgesWidth / this.edgesWidthScalerForPerspective), this._lineShader.setFloat("aspectRatio", i.getAspectRatio(t.activeCamera)), this._lineShader.bind(this._source.getWorldMatrix()), i.drawElementsType(e.Material.TriangleFillMode, 0, this._indicesCount), this._lineShader.unbind()
                                }
                            }, i
                        }();
                    e.EdgesRenderer = i
                }($a || ($a = {})), oa = $a || ($a = {}), sa = function() {
                    this.edges = new Array, this.edgesConnectedCount = 0
                }, aa = function(e) {
                    function t(t, i, r) {
                        void 0 === i && (i = .95), void 0 === r && (r = !1);
                        var n = e.call(this, t, i, r, !1) || this;
                        return n._generateEdgesLines(), n
                    }
                    return b(t, e), t.prototype._checkEdge = function(e, t, i, r, n) {
                        var o = this._linesPositions.length / 3;
                        r.subtract(n).normalize(), this._linesPositions.push(r.x), this._linesPositions.push(r.y), this._linesPositions.push(r.z), this._linesPositions.push(r.x), this._linesPositions.push(r.y), this._linesPositions.push(r.z), this._linesPositions.push(n.x), this._linesPositions.push(n.y), this._linesPositions.push(n.z), this._linesPositions.push(n.x), this._linesPositions.push(n.y), this._linesPositions.push(n.z), this._linesNormals.push(n.x), this._linesNormals.push(n.y), this._linesNormals.push(n.z), this._linesNormals.push(-1), this._linesNormals.push(n.x), this._linesNormals.push(n.y), this._linesNormals.push(n.z), this._linesNormals.push(1), this._linesNormals.push(r.x), this._linesNormals.push(r.y), this._linesNormals.push(r.z), this._linesNormals.push(-1), this._linesNormals.push(r.x), this._linesNormals.push(r.y), this._linesNormals.push(r.z), this._linesNormals.push(1), this._linesIndices.push(o), this._linesIndices.push(o + 1), this._linesIndices.push(o + 2), this._linesIndices.push(o), this._linesIndices.push(o + 2), this._linesIndices.push(o + 3)
                    }, t.prototype._generateEdgesLines = function() {
                        var e = this._source.getVerticesData(oa.VertexBuffer.PositionKind);
                        if (this._source.getIndices() && e) {
                            for (var t, i = new Array, r = new Array, n = 0; n < e.length / 3 - 1; n++) {
                                var o = new sa;
                                o.p0 = new oa.Vector3(e[3 * n], e[3 * n + 1], e[3 * n + 2]), o.p1 = new oa.Vector3(e[3 * (n + 1)], e[3 * (n + 1) + 1], e[3 * (n + 1) + 2]), i.push(o)
                            }
                            for (t = 0; t < i.length; t++) {
                                var s = i[t];
                                this._checkEdge(t, s.edges[0], r, s.p0, s.p1)
                            }
                            var a = this._source.getScene().getEngine();
                            this._buffers[oa.VertexBuffer.PositionKind] = new oa.VertexBuffer(a, this._linesPositions, oa.VertexBuffer.PositionKind, !1), this._buffers[oa.VertexBuffer.NormalKind] = new oa.VertexBuffer(a, this._linesNormals, oa.VertexBuffer.NormalKind, !1, !1, 4), this._ib = a.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length
                        }
                    }, t
                }(oa.EdgesRenderer), oa.LineEdgesRenderer = aa,
                function(e) {
                    e.AbstractScene.AddParser(e.SceneComponentConstants.NAME_EFFECTLAYER, function(t, i, r, n) {
                        if (t.effectLayers) {
                            r.effectLayers || (r.effectLayers = new Array);
                            for (var o = 0; o < t.effectLayers.length; o++) {
                                var s = e.EffectLayer.Parse(t.effectLayers[o], i, n);
                                r.effectLayers.push(s)
                            }
                        }
                    }), e.AbstractScene.prototype.removeEffectLayer = function(e) {
                        var t = this.effectLayers.indexOf(e);
                        return -1 !== t && this.effectLayers.splice(t, 1), t
                    }, e.AbstractScene.prototype.addEffectLayer = function(e) {
                        this.effectLayers.push(e)
                    };
                    var t = function() {
                        function t(t) {
                            this.name = e.SceneComponentConstants.NAME_EFFECTLAYER, this._renderEffects = !1, this._needStencil = !1, this._previousStencilState = !1, this.scene = t, this._engine = t.getEngine(), t.effectLayers = new Array
                        }
                        return t.prototype.register = function() {
                            this.scene._isReadyForMeshStage.registerStep(e.SceneComponentConstants.STEP_ISREADYFORMESH_EFFECTLAYER, this, this._isReadyForMesh), this.scene._cameraDrawRenderTargetStage.registerStep(e.SceneComponentConstants.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER, this, this._renderMainTexture), this.scene._beforeCameraDrawStage.registerStep(e.SceneComponentConstants.STEP_BEFORECAMERADRAW_EFFECTLAYER, this, this._setStencil), this.scene._afterRenderingGroupDrawStage.registerStep(e.SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW, this, this._drawRenderingGroup), this.scene._afterCameraDrawStage.registerStep(e.SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER, this, this._setStencilBack), this.scene._afterCameraDrawStage.registerStep(e.SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW, this, this._drawCamera)
                        }, t.prototype.rebuild = function() {
                            for (var e = 0, t = this.scene.effectLayers; e < t.length; e++) t[e]._rebuild()
                        }, t.prototype.serialize = function(e) {
                            e.effectLayers = [];
                            for (var t = 0, i = this.scene.effectLayers; t < i.length; t++) {
                                var r = i[t];
                                r.serialize && e.effectLayers.push(r.serialize())
                            }
                        }, t.prototype.addFromContainer = function(e) {
                            var t = this;
                            e.effectLayers && e.effectLayers.forEach(function(e) {
                                t.scene.addEffectLayer(e)
                            })
                        }, t.prototype.removeFromContainer = function(e) {
                            var t = this;
                            e.effectLayers && e.effectLayers.forEach(function(e) {
                                t.scene.removeEffectLayer(e)
                            })
                        }, t.prototype.dispose = function() {
                            for (var e = this.scene.effectLayers; e.length;) e[0].dispose()
                        }, t.prototype._isReadyForMesh = function(e, t) {
                            for (var i = 0, r = this.scene.effectLayers; i < r.length; i++) {
                                var n = r[i];
                                if (n.hasMesh(e))
                                    for (var o = 0, s = e.subMeshes; o < s.length; o++) {
                                        var a = s[o];
                                        if (!n.isReady(a, t)) return !1
                                    }
                            }
                            return !0
                        }, t.prototype._renderMainTexture = function(t) {
                            this._renderEffects = !1, this._needStencil = !1;
                            var i = this.scene.effectLayers;
                            if (i && 0 < i.length) {
                                this._previousStencilState = this._engine.getStencilBuffer();
                                for (var r = 0, n = i; r < n.length; r++) {
                                    var o = n[r];
                                    if (o.shouldRender() && (!o.camera || o.camera.cameraRigMode === e.Camera.RIG_MODE_NONE && t === o.camera || o.camera.cameraRigMode !== e.Camera.RIG_MODE_NONE && -1 < o.camera._rigCameras.indexOf(t))) {
                                        this._renderEffects = !0, this._needStencil = this._needStencil || o.needStencil();
                                        var s = o._mainTexture;
                                        s._shouldRender() && (this.scene.incrementRenderId(), s.render(!1, !1))
                                    }
                                }
                                this.scene.incrementRenderId()
                            }
                        }, t.prototype._setStencil = function(e) {
                            this._needStencil && this._engine.setStencilBuffer(!0)
                        }, t.prototype._setStencilBack = function(e) {
                            this._needStencil && this._engine.setStencilBuffer(this._previousStencilState)
                        }, t.prototype._draw = function(e) {
                            if (this._renderEffects) {
                                this._engine.setDepthBuffer(!1);
                                for (var t = this.scene.effectLayers, i = 0; i < t.length; i++) {
                                    var r = t[i];
                                    r.renderingGroupId === e && r.shouldRender() && r.render()
                                }
                                this._engine.setDepthBuffer(!0)
                            }
                        }, t.prototype._drawCamera = function(e) {
                            this._renderEffects && this._draw(-1)
                        }, t.prototype._drawRenderingGroup = function(e) {
                            !this.scene._isInIntermediateRendering() && this._renderEffects && this._draw(e)
                        }, t
                    }();
                    e.EffectLayerSceneComponent = t
                }($a || ($a = {}));
            var la, ua, ca, ha, da, pa, fa, _a, ma, ga, va, ya, ba, xa, Ta, Ea, Sa, Pa, Aa, Ca, Ma, Ra, Oa, wa, Ia, Da, La, Ba, Fa;
            ae = this && this.__assign || function() {
                    return (ae = Object.assign || function(e) {
                        for (var t, i = 1, r = arguments.length; i < r; i++)
                            for (var n in t = arguments[i]) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
                        return e
                    }).apply(this, arguments)
                }, la = $a || ($a = {}), ua = function() {
                    function e(e, t) {
                        this._vertexBuffers = {}, this._maxSize = 0, this._mainTextureDesiredSize = {
                            width: 0,
                            height: 0
                        }, this._shouldRender = !0, this._postProcesses = [], this._textures = [], this._emissiveTextureAndColor = {
                            texture: null,
                            color: new la.Color4
                        }, this.neutralColor = new la.Color4, this.isEnabled = !0, this.onDisposeObservable = new la.Observable, this.onBeforeRenderMainTextureObservable = new la.Observable, this.onBeforeComposeObservable = new la.Observable, this.onAfterComposeObservable = new la.Observable, this.onSizeChangedObservable = new la.Observable, this.name = e, this._scene = t || la.Engine.LastCreatedScene;
                        var i = this._scene._getComponent(la.SceneComponentConstants.NAME_EFFECTLAYER);
                        i || (i = new la.EffectLayerSceneComponent(this._scene), this._scene._addComponent(i)), this._engine = this._scene.getEngine(), this._maxSize = this._engine.getCaps().maxTextureSize, this._scene.effectLayers.push(this), this._generateIndexBuffer(), this._genrateVertexBuffer()
                    }
                    return Object.defineProperty(e.prototype, "camera", {
                        get: function() {
                            return this._effectLayerOptions.camera
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "renderingGroupId", {
                        get: function() {
                            return this._effectLayerOptions.renderingGroupId
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._init = function(e) {
                        this._effectLayerOptions = ae({
                            mainTextureRatio: .5,
                            alphaBlendingMode: la.Engine.ALPHA_COMBINE,
                            camera: null,
                            renderingGroupId: -1
                        }, e), this._setMainTextureSize(), this._createMainTexture(), this._createTextureAndPostProcesses(), this._mergeEffect = this._createMergeEffect()
                    }, e.prototype._generateIndexBuffer = function() {
                        var e = [];
                        e.push(0), e.push(1), e.push(2), e.push(0), e.push(2), e.push(3), this._indexBuffer = this._engine.createIndexBuffer(e)
                    }, e.prototype._genrateVertexBuffer = function() {
                        var e = [];
                        e.push(1, 1), e.push(-1, 1), e.push(-1, -1), e.push(1, -1);
                        var t = new la.VertexBuffer(this._engine, e, la.VertexBuffer.PositionKind, !1, !1, 2);
                        this._vertexBuffers[la.VertexBuffer.PositionKind] = t
                    }, e.prototype._setMainTextureSize = function() {
                        this._effectLayerOptions.mainTextureFixedSize ? (this._mainTextureDesiredSize.width = this._effectLayerOptions.mainTextureFixedSize, this._mainTextureDesiredSize.height = this._effectLayerOptions.mainTextureFixedSize) : (this._mainTextureDesiredSize.width = this._engine.getRenderWidth() * this._effectLayerOptions.mainTextureRatio, this._mainTextureDesiredSize.height = this._engine.getRenderHeight() * this._effectLayerOptions.mainTextureRatio, this._mainTextureDesiredSize.width = this._engine.needPOTTextures ? la.Tools.GetExponentOfTwo(this._mainTextureDesiredSize.width, this._maxSize) : this._mainTextureDesiredSize.width, this._mainTextureDesiredSize.height = this._engine.needPOTTextures ? la.Tools.GetExponentOfTwo(this._mainTextureDesiredSize.height, this._maxSize) : this._mainTextureDesiredSize.height), this._mainTextureDesiredSize.width = Math.floor(this._mainTextureDesiredSize.width), this._mainTextureDesiredSize.height = Math.floor(this._mainTextureDesiredSize.height)
                    }, e.prototype._createMainTexture = function() {
                        var e = this;
                        this._mainTexture = new la.RenderTargetTexture("HighlightLayerMainRTT", {
                            width: this._mainTextureDesiredSize.width,
                            height: this._mainTextureDesiredSize.height
                        }, this._scene, !1, !0, la.Engine.TEXTURETYPE_UNSIGNED_INT), this._mainTexture.activeCamera = this._effectLayerOptions.camera, this._mainTexture.wrapU = la.Texture.CLAMP_ADDRESSMODE, this._mainTexture.wrapV = la.Texture.CLAMP_ADDRESSMODE, this._mainTexture.anisotropicFilteringLevel = 1, this._mainTexture.updateSamplingMode(la.Texture.BILINEAR_SAMPLINGMODE), this._mainTexture.renderParticles = !1, this._mainTexture.renderList = null, this._mainTexture.ignoreCameraViewport = !0, this._mainTexture.customRenderFunction = function(t, i, r, n) {
                            var o;
                            e.onBeforeRenderMainTextureObservable.notifyObservers(e);
                            var s = e._scene.getEngine();
                            if (n.length) {
                                for (s.setColorWrite(!1), o = 0; o < n.length; o++) e._renderSubMesh(n.data[o]);
                                s.setColorWrite(!0)
                            }
                            for (o = 0; o < t.length; o++) e._renderSubMesh(t.data[o]);
                            for (o = 0; o < i.length; o++) e._renderSubMesh(i.data[o]);
                            for (o = 0; o < r.length; o++) e._renderSubMesh(r.data[o])
                        }, this._mainTexture.onClearObservable.add(function(t) {
                            t.clear(e.neutralColor, !0, !0, !0)
                        })
                    }, e.prototype._isReady = function(e, t, i) {
                        var r = e.getMaterial();
                        if (!r) return !1;
                        if (!r.isReady(e.getMesh(), t)) return !1;
                        var n = [],
                            o = [la.VertexBuffer.PositionKind],
                            s = e.getMesh(),
                            a = !1,
                            l = !1;
                        if (r && r.needAlphaTesting()) {
                            var u = r.getAlphaTestTexture();
                            u && (n.push("#define ALPHATEST"), s.isVerticesDataPresent(la.VertexBuffer.UV2Kind) && 1 === u.coordinatesIndex ? (n.push("#define DIFFUSEUV2"), l = !0) : s.isVerticesDataPresent(la.VertexBuffer.UVKind) && (n.push("#define DIFFUSEUV1"), a = !0))
                        }
                        i && (n.push("#define EMISSIVE"), s.isVerticesDataPresent(la.VertexBuffer.UV2Kind) && 1 === i.coordinatesIndex ? (n.push("#define EMISSIVEUV2"), l = !0) : s.isVerticesDataPresent(la.VertexBuffer.UVKind) && (n.push("#define EMISSIVEUV1"), a = !0)), a && (o.push(la.VertexBuffer.UVKind), n.push("#define UV1")), l && (o.push(la.VertexBuffer.UV2Kind), n.push("#define UV2")), s.useBones && s.computeBonesUsingShaders ? (o.push(la.VertexBuffer.MatricesIndicesKind), o.push(la.VertexBuffer.MatricesWeightsKind), 4 < s.numBoneInfluencers && (o.push(la.VertexBuffer.MatricesIndicesExtraKind), o.push(la.VertexBuffer.MatricesWeightsExtraKind)), n.push("#define NUM_BONE_INFLUENCERS " + s.numBoneInfluencers), n.push("#define BonesPerMesh " + (s.skeleton ? s.skeleton.bones.length + 1 : 0))) : n.push("#define NUM_BONE_INFLUENCERS 0");
                        var c = s.morphTargetManager,
                            h = 0;
                        c && 0 < c.numInfluencers && (n.push("#define MORPHTARGETS"), h = c.numInfluencers, n.push("#define NUM_MORPH_INFLUENCERS " + h), la.MaterialHelper.PrepareAttributesForMorphTargets(o, s, {
                            NUM_MORPH_INFLUENCERS: h
                        })), t && (n.push("#define INSTANCES"), o.push("world0"), o.push("world1"), o.push("world2"), o.push("world3"));
                        var d = n.join("\n");
                        return this._cachedDefines !== d && (this._cachedDefines = d, this._effectLayerMapGenerationEffect = this._scene.getEngine().createEffect("glowMapGeneration", o, ["world", "mBones", "viewProjection", "diffuseMatrix", "color", "emissiveMatrix", "morphTargetInfluences"], ["diffuseSampler", "emissiveSampler"], d, void 0, void 0, void 0, {
                            maxSimultaneousMorphTargets: h
                        })), this._effectLayerMapGenerationEffect.isReady()
                    }, e.prototype.render = function() {
                        var e = this._mergeEffect;
                        if (e.isReady()) {
                            for (var t = 0; t < this._postProcesses.length; t++)
                                if (!this._postProcesses[t].isReady()) return;
                            var i = this._scene.getEngine();
                            this.onBeforeComposeObservable.notifyObservers(this), i.enableEffect(e), i.setState(!1), i.bindBuffers(this._vertexBuffers, this._indexBuffer, e);
                            var r = i.getAlphaMode();
                            i.setAlphaMode(this._effectLayerOptions.alphaBlendingMode), this._internalRender(e), i.setAlphaMode(r), this.onAfterComposeObservable.notifyObservers(this);
                            var n = this._mainTexture.getSize();
                            this._setMainTextureSize(), n.width === this._mainTextureDesiredSize.width && n.height === this._mainTextureDesiredSize.height || (this.onSizeChangedObservable.notifyObservers(this), this._disposeTextureAndPostProcesses(), this._createMainTexture(), this._createTextureAndPostProcesses())
                        }
                    }, e.prototype.hasMesh = function(e) {
                        return -1 === this.renderingGroupId || e.renderingGroupId === this.renderingGroupId
                    }, e.prototype.shouldRender = function() {
                        return this.isEnabled && this._shouldRender
                    }, e.prototype._shouldRenderMesh = function(e) {
                        return !0
                    }, e.prototype._shouldRenderEmissiveTextureForMesh = function(e) {
                        return !0
                    }, e.prototype._renderSubMesh = function(e) {
                        var t = this;
                        if (this.shouldRender()) {
                            var i = e.getMaterial(),
                                r = e.getRenderingMesh(),
                                n = this._scene,
                                o = n.getEngine();
                            if (i && !i.needAlphaBlendingForMesh(r)) {
                                o.setState(i.backFaceCulling);
                                var s = r._getInstancesRenderList(e._id);
                                if (!s.mustReturn && this._shouldRenderMesh(r)) {
                                    var a = o.getCaps().instancedArrays && null !== s.visibleInstances[e._id] && void 0 !== s.visibleInstances[e._id];
                                    if (this._setEmissiveTextureAndColor(r, e, i), this._isReady(e, a, this._emissiveTextureAndColor.texture)) {
                                        if (o.enableEffect(this._effectLayerMapGenerationEffect), r._bind(e, this._effectLayerMapGenerationEffect, la.Material.TriangleFillMode), this._effectLayerMapGenerationEffect.setMatrix("viewProjection", n.getTransformMatrix()), this._effectLayerMapGenerationEffect.setFloat4("color", this._emissiveTextureAndColor.color.r, this._emissiveTextureAndColor.color.g, this._emissiveTextureAndColor.color.b, this._emissiveTextureAndColor.color.a), i && i.needAlphaTesting()) {
                                            var l = i.getAlphaTestTexture();
                                            if (l) {
                                                this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", l);
                                                var u = l.getTextureMatrix();
                                                u && this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", u)
                                            }
                                        }
                                        this._emissiveTextureAndColor.texture && (this._effectLayerMapGenerationEffect.setTexture("emissiveSampler", this._emissiveTextureAndColor.texture), this._effectLayerMapGenerationEffect.setMatrix("emissiveMatrix", this._emissiveTextureAndColor.texture.getTextureMatrix())), r.useBones && r.computeBonesUsingShaders && r.skeleton && this._effectLayerMapGenerationEffect.setMatrices("mBones", r.skeleton.getTransformMatrices(r)), la.MaterialHelper.BindMorphTargetParameters(r, this._effectLayerMapGenerationEffect), r._processRendering(e, this._effectLayerMapGenerationEffect, la.Material.TriangleFillMode, s, a, function(e, i) {
                                            return t._effectLayerMapGenerationEffect.setMatrix("world", i)
                                        })
                                    } else this._mainTexture.resetRefreshCounter()
                                }
                            }
                        }
                    }, e.prototype._rebuild = function() {
                        var e = this._vertexBuffers[la.VertexBuffer.PositionKind];
                        e && e._rebuild(), this._generateIndexBuffer()
                    }, e.prototype._disposeTextureAndPostProcesses = function() {
                        this._mainTexture.dispose();
                        for (var e = 0; e < this._postProcesses.length; e++) this._postProcesses[e] && this._postProcesses[e].dispose();
                        for (this._postProcesses = [], e = 0; e < this._textures.length; e++) this._textures[e] && this._textures[e].dispose();
                        this._textures = []
                    }, e.prototype.dispose = function() {
                        var e = this._vertexBuffers[la.VertexBuffer.PositionKind];
                        e && (e.dispose(), this._vertexBuffers[la.VertexBuffer.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._disposeTextureAndPostProcesses();
                        var t = this._scene.effectLayers.indexOf(this, 0); - 1 < t && this._scene.effectLayers.splice(t, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onBeforeRenderMainTextureObservable.clear(), this.onBeforeComposeObservable.clear(), this.onAfterComposeObservable.clear(), this.onSizeChangedObservable.clear()
                    }, e.prototype.getClassName = function() {
                        return "EffectLayer"
                    }, e.Parse = function(e, t, i) {
                        return la.Tools.Instantiate(e.customType).Parse(e, t, i)
                    }, y([la.serialize()], e.prototype, "name", void 0), y([la.serializeAsColor4()], e.prototype, "neutralColor", void 0), y([la.serialize()], e.prototype, "isEnabled", void 0), y([la.serializeAsCameraReference()], e.prototype, "camera", null), y([la.serialize()], e.prototype, "renderingGroupId", null), e
                }(), la.EffectLayer = ua,
                function(e) {
                    e.AbstractScene.prototype.getHighlightLayerByName = function(e) {
                        for (var t = 0; t < this.effectLayers.length; t++)
                            if (this.effectLayers[t].name === e && this.effectLayers[t].getEffectName() === i.EffectName) return this.effectLayers[t];
                        return null
                    };
                    var t = function(t) {
                            function i(i, r, n, o, s, a, l, u) {
                                void 0 === a && (a = e.Texture.BILINEAR_SAMPLINGMODE);
                                var c = t.call(this, i, "glowBlurPostProcess", ["screenSize", "direction", "blurWidth"], null, o, s, a, l, u) || this;
                                return c.direction = r, c.kernel = n, c.onApplyObservable.add(function(e) {
                                    e.setFloat2("screenSize", c.width, c.height), e.setVector2("direction", c.direction), e.setFloat("blurWidth", c.kernel)
                                }), c
                            }
                            return b(i, t), i
                        }(e.PostProcess),
                        i = function(i) {
                            function r(t, n, o) {
                                var s = i.call(this, t, n) || this;
                                return s.name = t, s.innerGlow = !0, s.outerGlow = !0, s.onBeforeBlurObservable = new e.Observable, s.onAfterBlurObservable = new e.Observable, s._instanceGlowingMeshStencilReference = r.GlowingMeshStencilReference++, s._meshes = {}, s._excludedMeshes = {}, s.neutralColor = r.NeutralColor, s._engine.isStencilEnable || e.Tools.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new BABYLON.Engine(canvas, antialias, { stencil: true }"), s._options = ae({
                                    mainTextureRatio: .5,
                                    blurTextureSizeRatio: .5,
                                    blurHorizontalSize: 1,
                                    blurVerticalSize: 1,
                                    alphaBlendingMode: e.Engine.ALPHA_COMBINE,
                                    camera: null,
                                    renderingGroupId: -1
                                }, o), s._init({
                                    alphaBlendingMode: s._options.alphaBlendingMode,
                                    camera: s._options.camera,
                                    mainTextureFixedSize: s._options.mainTextureFixedSize,
                                    mainTextureRatio: s._options.mainTextureRatio,
                                    renderingGroupId: s._options.renderingGroupId
                                }), s._shouldRender = !1, s
                            }
                            return b(r, i), Object.defineProperty(r.prototype, "blurHorizontalSize", {
                                get: function() {
                                    return this._horizontalBlurPostprocess.kernel
                                },
                                set: function(e) {
                                    this._horizontalBlurPostprocess.kernel = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), Object.defineProperty(r.prototype, "blurVerticalSize", {
                                get: function() {
                                    return this._verticalBlurPostprocess.kernel
                                },
                                set: function(e) {
                                    this._verticalBlurPostprocess.kernel = e
                                },
                                enumerable: !0,
                                configurable: !0
                            }), r.prototype.getEffectName = function() {
                                return r.EffectName
                            }, r.prototype._createMergeEffect = function() {
                                return this._engine.createEffect("glowMapMerge", [e.VertexBuffer.PositionKind], ["offset"], ["textureSampler"], this._options.isStroke ? "#define STROKE \n" : void 0)
                            }, r.prototype._createTextureAndPostProcesses = function() {
                                var i = this,
                                    r = this._mainTextureDesiredSize.width * this._options.blurTextureSizeRatio,
                                    n = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;
                                r = this._engine.needPOTTextures ? e.Tools.GetExponentOfTwo(r, this._maxSize) : r, n = this._engine.needPOTTextures ? e.Tools.GetExponentOfTwo(n, this._maxSize) : n;
                                var o = 0;
                                o = this._engine.getCaps().textureHalfFloatRender ? e.Engine.TEXTURETYPE_HALF_FLOAT : e.Engine.TEXTURETYPE_UNSIGNED_INT, this._blurTexture = new e.RenderTargetTexture("HighlightLayerBlurRTT", {
                                    width: r,
                                    height: n
                                }, this._scene, !1, !0, o), this._blurTexture.wrapU = e.Texture.CLAMP_ADDRESSMODE, this._blurTexture.wrapV = e.Texture.CLAMP_ADDRESSMODE, this._blurTexture.anisotropicFilteringLevel = 16, this._blurTexture.updateSamplingMode(e.Texture.TRILINEAR_SAMPLINGMODE), this._blurTexture.renderParticles = !1, this._blurTexture.ignoreCameraViewport = !0, this._textures = [this._blurTexture], this._options.alphaBlendingMode === e.Engine.ALPHA_COMBINE ? (this._downSamplePostprocess = new e.PassPostProcess("HighlightLayerPPP", this._options.blurTextureSizeRatio, null, e.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._downSamplePostprocess.onApplyObservable.add(function(e) {
                                    e.setTexture("textureSampler", i._mainTexture)
                                }), this._horizontalBlurPostprocess = new t("HighlightLayerHBP", new e.Vector2(1, 0), this._options.blurHorizontalSize, 1, null, e.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._horizontalBlurPostprocess.onApplyObservable.add(function(e) {
                                    e.setFloat2("screenSize", r, n)
                                }), this._verticalBlurPostprocess = new t("HighlightLayerVBP", new e.Vector2(0, 1), this._options.blurVerticalSize, 1, null, e.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._verticalBlurPostprocess.onApplyObservable.add(function(e) {
                                    e.setFloat2("screenSize", r, n)
                                }), this._postProcesses = [this._downSamplePostprocess, this._horizontalBlurPostprocess, this._verticalBlurPostprocess]) : (this._horizontalBlurPostprocess = new e.BlurPostProcess("HighlightLayerHBP", new e.Vector2(1, 0), this._options.blurHorizontalSize / 2, {
                                    width: r,
                                    height: n
                                }, null, e.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._horizontalBlurPostprocess.width = r, this._horizontalBlurPostprocess.height = n, this._horizontalBlurPostprocess.onApplyObservable.add(function(e) {
                                    e.setTexture("textureSampler", i._mainTexture)
                                }), this._verticalBlurPostprocess = new e.BlurPostProcess("HighlightLayerVBP", new e.Vector2(0, 1), this._options.blurVerticalSize / 2, {
                                    width: r,
                                    height: n
                                }, null, e.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess]), this._mainTexture.onAfterUnbindObservable.add(function() {
                                    i.onBeforeBlurObservable.notifyObservers(i);
                                    var e = i._blurTexture.getInternalTexture();
                                    e && i._scene.postProcessManager.directRender(i._postProcesses, e, !0), i.onAfterBlurObservable.notifyObservers(i)
                                }), this._postProcesses.map(function(e) {
                                    e.autoClear = !1
                                })
                            }, r.prototype.needStencil = function() {
                                return !0
                            }, r.prototype.isReady = function(e, t) {
                                var r = e.getMaterial(),
                                    n = e.getRenderingMesh();
                                if (!r || !n || !this._meshes) return !1;
                                var o = null,
                                    s = this._meshes[n.uniqueId];
                                return s && s.glowEmissiveOnly && r && (o = r.emissiveTexture), i.prototype._isReady.call(this, e, t, o)
                            }, r.prototype._internalRender = function(t) {
                                t.setTexture("textureSampler", this._blurTexture);
                                var i = this._engine,
                                    r = i.getStencilBuffer(),
                                    n = i.getStencilFunction(),
                                    o = i.getStencilMask(),
                                    s = i.getStencilOperationPass(),
                                    a = i.getStencilOperationFail(),
                                    l = i.getStencilOperationDepthFail(),
                                    u = i.getStencilFunctionReference();
                                i.setStencilOperationPass(e.Engine.REPLACE), i.setStencilOperationFail(e.Engine.KEEP), i.setStencilOperationDepthFail(e.Engine.KEEP), i.setStencilMask(0), i.setStencilBuffer(!0), i.setStencilFunctionReference(this._instanceGlowingMeshStencilReference), this.outerGlow && (t.setFloat("offset", 0), i.setStencilFunction(e.Engine.NOTEQUAL), i.drawElementsType(e.Material.TriangleFillMode, 0, 6)), this.innerGlow && (t.setFloat("offset", 1), i.setStencilFunction(e.Engine.EQUAL), i.drawElementsType(e.Material.TriangleFillMode, 0, 6)), i.setStencilFunction(n), i.setStencilMask(o), i.setStencilBuffer(r), i.setStencilOperationPass(s), i.setStencilOperationFail(a), i.setStencilOperationDepthFail(l), i.setStencilFunctionReference(u)
                            }, r.prototype.shouldRender = function() {
                                return !!i.prototype.shouldRender.call(this) && !!this._meshes
                            }, r.prototype._shouldRenderMesh = function(e) {
                                return !(this._excludedMeshes && this._excludedMeshes[e.uniqueId] || !i.prototype.hasMesh.call(this, e))
                            }, r.prototype._setEmissiveTextureAndColor = function(e, t, i) {
                                var r = this._meshes[e.uniqueId];
                                r ? this._emissiveTextureAndColor.color.set(r.color.r, r.color.g, r.color.b, 1) : this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a), r && r.glowEmissiveOnly && i ? (this._emissiveTextureAndColor.texture = i.emissiveTexture, this._emissiveTextureAndColor.color.set(1, 1, 1, 1)) : this._emissiveTextureAndColor.texture = null
                            }, r.prototype.addExcludedMesh = function(e) {
                                this._excludedMeshes && (this._excludedMeshes[e.uniqueId] || (this._excludedMeshes[e.uniqueId] = {
                                    mesh: e,
                                    beforeRender: e.onBeforeRenderObservable.add(function(e) {
                                        e.getEngine().setStencilBuffer(!1)
                                    }),
                                    afterRender: e.onAfterRenderObservable.add(function(e) {
                                        e.getEngine().setStencilBuffer(!0)
                                    })
                                }))
                            }, r.prototype.removeExcludedMesh = function(e) {
                                if (this._excludedMeshes) {
                                    var t = this._excludedMeshes[e.uniqueId];
                                    t && (t.beforeRender && e.onBeforeRenderObservable.remove(t.beforeRender), t.afterRender && e.onAfterRenderObservable.remove(t.afterRender)), this._excludedMeshes[e.uniqueId] = null
                                }
                            }, r.prototype.hasMesh = function(e) {
                                return !!this._meshes && !!i.prototype.hasMesh.call(this, e) && void 0 !== this._meshes[e.uniqueId] && null !== this._meshes[e.uniqueId]
                            }, r.prototype.addMesh = function(e, t, i) {
                                var r = this;
                                if (void 0 === i && (i = !1), this._meshes) {
                                    var n = this._meshes[e.uniqueId];
                                    n ? n.color = t : (this._meshes[e.uniqueId] = {
                                        mesh: e,
                                        color: t,
                                        observerHighlight: e.onBeforeRenderObservable.add(function(e) {
                                            r._excludedMeshes && r._excludedMeshes[e.uniqueId] ? r._defaultStencilReference(e) : e.getScene().getEngine().setStencilFunctionReference(r._instanceGlowingMeshStencilReference)
                                        }),
                                        observerDefault: e.onAfterRenderObservable.add(this._defaultStencilReference),
                                        glowEmissiveOnly: i
                                    }, e.onDisposeObservable.add(function() {
                                        r._disposeMesh(e)
                                    })), this._shouldRender = !0
                                }
                            }, r.prototype.removeMesh = function(e) {
                                if (this._meshes) {
                                    var t = this._meshes[e.uniqueId];
                                    for (var i in t && (t.observerHighlight && e.onBeforeRenderObservable.remove(t.observerHighlight), t.observerDefault && e.onAfterRenderObservable.remove(t.observerDefault), delete this._meshes[e.uniqueId]), this._shouldRender = !1, this._meshes)
                                        if (this._meshes[i]) {
                                            this._shouldRender = !0;
                                            break
                                        }
                                }
                            }, r.prototype._defaultStencilReference = function(e) {
                                e.getScene().getEngine().setStencilFunctionReference(r.NormalMeshStencilReference)
                            }, r.prototype._disposeMesh = function(e) {
                                this.removeMesh(e), this.removeExcludedMesh(e)
                            }, r.prototype.dispose = function() {
                                if (this._meshes) {
                                    for (var e in this._meshes)(t = this._meshes[e]) && t.mesh && (t.observerHighlight && t.mesh.onBeforeRenderObservable.remove(t.observerHighlight), t.observerDefault && t.mesh.onAfterRenderObservable.remove(t.observerDefault));
                                    this._meshes = null
                                }
                                if (this._excludedMeshes) {
                                    for (var e in this._excludedMeshes) {
                                        var t;
                                        (t = this._excludedMeshes[e]) && (t.beforeRender && t.mesh.onBeforeRenderObservable.remove(t.beforeRender), t.afterRender && t.mesh.onAfterRenderObservable.remove(t.afterRender))
                                    }
                                    this._excludedMeshes = null
                                }
                                i.prototype.dispose.call(this)
                            }, r.prototype.getClassName = function() {
                                return "HighlightLayer"
                            }, r.prototype.serialize = function() {
                                var t = e.SerializationHelper.Serialize(this);
                                if (t.customType = "BABYLON.HighlightLayer", t.meshes = [], this._meshes)
                                    for (var i in this._meshes) {
                                        var r = this._meshes[i];
                                        r && t.meshes.push({
                                            glowEmissiveOnly: r.glowEmissiveOnly,
                                            color: r.color.asArray(),
                                            meshId: r.mesh.id
                                        })
                                    }
                                if (t.excludedMeshes = [], this._excludedMeshes)
                                    for (var n in this._excludedMeshes) {
                                        var o = this._excludedMeshes[n];
                                        o && t.excludedMeshes.push(o.mesh.id)
                                    }
                                return t
                            }, r.Parse = function(t, i, n) {
                                var o, s = e.SerializationHelper.Parse(function() {
                                    return new r(t.name, i, t.options)
                                }, t, i, n);
                                for (o = 0; o < t.excludedMeshes.length; o++)(a = i.getMeshByID(t.excludedMeshes[o])) && s.addExcludedMesh(a);
                                for (o = 0; o < t.meshes.length; o++) {
                                    var a, l = t.meshes[o];
                                    (a = i.getMeshByID(l.meshId)) && s.addMesh(a, e.Color3.FromArray(l.color), l.glowEmissiveOnly)
                                }
                                return s
                            }, r.EffectName = "HighlightLayer", r.NeutralColor = new e.Color4(0, 0, 0, 0), r.GlowingMeshStencilReference = 2, r.NormalMeshStencilReference = 1, y([e.serialize()], r.prototype, "innerGlow", void 0), y([e.serialize()], r.prototype, "outerGlow", void 0), y([e.serialize()], r.prototype, "blurHorizontalSize", null), y([e.serialize()], r.prototype, "blurVerticalSize", null), y([e.serialize("options")], r.prototype, "_options", void 0), r
                        }(e.EffectLayer);
                    e.HighlightLayer = i
                }($a || ($a = {})),
                function(e) {
                    e.AbstractScene.prototype.getGlowLayerByName = function(e) {
                        for (var i = 0; i < this.effectLayers.length; i++)
                            if (this.effectLayers[i].name === e && this.effectLayers[i].getEffectName() === t.EffectName) return this.effectLayers[i];
                        return null
                    };
                    var t = function(t) {
                        function i(r, n, o) {
                            var s = t.call(this, r, n) || this;
                            return s._intensity = 1, s._includedOnlyMeshes = [], s._excludedMeshes = [], s.neutralColor = new e.Color4(0, 0, 0, 1), s._options = ae({
                                mainTextureRatio: i.DefaultTextureRatio,
                                blurKernelSize: 32,
                                mainTextureFixedSize: void 0,
                                camera: null,
                                mainTextureSamples: 1,
                                renderingGroupId: -1
                            }, o), s._init({
                                alphaBlendingMode: e.Engine.ALPHA_ADD,
                                camera: s._options.camera,
                                mainTextureFixedSize: s._options.mainTextureFixedSize,
                                mainTextureRatio: s._options.mainTextureRatio,
                                renderingGroupId: s._options.renderingGroupId
                            }), s
                        }
                        return b(i, t), Object.defineProperty(i.prototype, "blurKernelSize", {
                            get: function() {
                                return this._horizontalBlurPostprocess1.kernel
                            },
                            set: function(e) {
                                this._horizontalBlurPostprocess1.kernel = e, this._verticalBlurPostprocess1.kernel = e, this._horizontalBlurPostprocess2.kernel = e, this._verticalBlurPostprocess2.kernel = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(i.prototype, "intensity", {
                            get: function() {
                                return this._intensity
                            },
                            set: function(e) {
                                this._intensity = e
                            },
                            enumerable: !0,
                            configurable: !0
                        }), i.prototype.getEffectName = function() {
                            return i.EffectName
                        }, i.prototype._createMergeEffect = function() {
                            return this._engine.createEffect("glowMapMerge", [e.VertexBuffer.PositionKind], ["offset"], ["textureSampler", "textureSampler2"], "#define EMISSIVE \n")
                        }, i.prototype._createTextureAndPostProcesses = function() {
                            var t = this,
                                i = this._mainTextureDesiredSize.width,
                                r = this._mainTextureDesiredSize.height;
                            i = this._engine.needPOTTextures ? e.Tools.GetExponentOfTwo(i, this._maxSize) : i, r = this._engine.needPOTTextures ? e.Tools.GetExponentOfTwo(r, this._maxSize) : r;
                            var n = 0;
                            n = this._engine.getCaps().textureHalfFloatRender ? e.Engine.TEXTURETYPE_HALF_FLOAT : e.Engine.TEXTURETYPE_UNSIGNED_INT, this._blurTexture1 = new e.RenderTargetTexture("GlowLayerBlurRTT", {
                                width: i,
                                height: r
                            }, this._scene, !1, !0, n), this._blurTexture1.wrapU = e.Texture.CLAMP_ADDRESSMODE, this._blurTexture1.wrapV = e.Texture.CLAMP_ADDRESSMODE, this._blurTexture1.updateSamplingMode(e.Texture.BILINEAR_SAMPLINGMODE), this._blurTexture1.renderParticles = !1, this._blurTexture1.ignoreCameraViewport = !0;
                            var o = Math.floor(i / 2),
                                s = Math.floor(r / 2);
                            this._blurTexture2 = new e.RenderTargetTexture("GlowLayerBlurRTT2", {
                                width: o,
                                height: s
                            }, this._scene, !1, !0, n), this._blurTexture2.wrapU = e.Texture.CLAMP_ADDRESSMODE, this._blurTexture2.wrapV = e.Texture.CLAMP_ADDRESSMODE, this._blurTexture2.updateSamplingMode(e.Texture.BILINEAR_SAMPLINGMODE), this._blurTexture2.renderParticles = !1, this._blurTexture2.ignoreCameraViewport = !0, this._textures = [this._blurTexture1, this._blurTexture2], this._horizontalBlurPostprocess1 = new e.BlurPostProcess("GlowLayerHBP1", new e.Vector2(1, 0), this._options.blurKernelSize / 2, {
                                width: i,
                                height: r
                            }, null, e.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, n), this._horizontalBlurPostprocess1.width = i, this._horizontalBlurPostprocess1.height = r, this._horizontalBlurPostprocess1.onApplyObservable.add(function(e) {
                                e.setTexture("textureSampler", t._mainTexture)
                            }), this._verticalBlurPostprocess1 = new e.BlurPostProcess("GlowLayerVBP1", new e.Vector2(0, 1), this._options.blurKernelSize / 2, {
                                width: i,
                                height: r
                            }, null, e.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, n), this._horizontalBlurPostprocess2 = new e.BlurPostProcess("GlowLayerHBP2", new e.Vector2(1, 0), this._options.blurKernelSize / 2, {
                                width: o,
                                height: s
                            }, null, e.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, n), this._horizontalBlurPostprocess2.width = o, this._horizontalBlurPostprocess2.height = s, this._horizontalBlurPostprocess2.onApplyObservable.add(function(e) {
                                e.setTexture("textureSampler", t._blurTexture1)
                            }), this._verticalBlurPostprocess2 = new e.BlurPostProcess("GlowLayerVBP2", new e.Vector2(0, 1), this._options.blurKernelSize / 2, {
                                width: o,
                                height: s
                            }, null, e.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, n), this._postProcesses = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1, this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2], this._postProcesses1 = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1], this._postProcesses2 = [this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2], this._mainTexture.samples = this._options.mainTextureSamples, this._mainTexture.onAfterUnbindObservable.add(function() {
                                var e = t._blurTexture1.getInternalTexture();
                                e && (t._scene.postProcessManager.directRender(t._postProcesses1, e, !0), (e = t._blurTexture2.getInternalTexture()) && t._scene.postProcessManager.directRender(t._postProcesses2, e, !0))
                            }), this._postProcesses.map(function(e) {
                                e.autoClear = !1
                            })
                        }, i.prototype.isReady = function(e, i) {
                            var r = e.getMaterial(),
                                n = e.getRenderingMesh();
                            if (!r || !n) return !1;
                            var o = r.emissiveTexture;
                            return t.prototype._isReady.call(this, e, i, o)
                        }, i.prototype.needStencil = function() {
                            return !1
                        }, i.prototype._internalRender = function(t) {
                            t.setTexture("textureSampler", this._blurTexture1), t.setTexture("textureSampler2", this._blurTexture2), t.setFloat("offset", this._intensity);
                            var i = this._engine,
                                r = i.getStencilBuffer();
                            i.setStencilBuffer(!1), i.drawElementsType(e.Material.TriangleFillMode, 0, 6), i.setStencilBuffer(r)
                        }, i.prototype._setEmissiveTextureAndColor = function(e, t, i) {
                            var r = 1;
                            this.customEmissiveTextureSelector ? this._emissiveTextureAndColor.texture = this.customEmissiveTextureSelector(e, t, i) : i ? (this._emissiveTextureAndColor.texture = i.emissiveTexture, this._emissiveTextureAndColor.texture && (r = this._emissiveTextureAndColor.texture.level)) : this._emissiveTextureAndColor.texture = null, this.customEmissiveColorSelector ? this.customEmissiveColorSelector(e, t, i, this._emissiveTextureAndColor.color) : i.emissiveColor ? this._emissiveTextureAndColor.color.set(i.emissiveColor.r * r, i.emissiveColor.g * r, i.emissiveColor.b * r, 1) : this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a)
                        }, i.prototype._shouldRenderMesh = function(e) {
                            return this.hasMesh(e)
                        }, i.prototype.addExcludedMesh = function(e) {
                            -1 === this._excludedMeshes.indexOf(e.uniqueId) && this._excludedMeshes.push(e.uniqueId)
                        }, i.prototype.removeExcludedMesh = function(e) {
                            var t = this._excludedMeshes.indexOf(e.uniqueId); - 1 !== t && this._excludedMeshes.splice(t, 1)
                        }, i.prototype.addIncludedOnlyMesh = function(e) {
                            -1 === this._includedOnlyMeshes.indexOf(e.uniqueId) && this._includedOnlyMeshes.push(e.uniqueId)
                        }, i.prototype.removeIncludedOnlyMesh = function(e) {
                            var t = this._includedOnlyMeshes.indexOf(e.uniqueId); - 1 !== t && this._includedOnlyMeshes.splice(t, 1)
                        }, i.prototype.hasMesh = function(e) {
                            return !!t.prototype.hasMesh.call(this, e) && (this._includedOnlyMeshes.length ? -1 !== this._includedOnlyMeshes.indexOf(e.uniqueId) : !this._excludedMeshes.length || -1 === this._excludedMeshes.indexOf(e.uniqueId))
                        }, i.prototype._disposeMesh = function(e) {
                            this.removeIncludedOnlyMesh(e), this.removeExcludedMesh(e)
                        }, i.prototype.getClassName = function() {
                            return "GlowLayer"
                        }, i.prototype.serialize = function() {
                            var t, i = e.SerializationHelper.Serialize(this);
                            if (i.customType = "BABYLON.GlowLayer", i.includedMeshes = [], this._includedOnlyMeshes.length)
                                for (t = 0; t < this._includedOnlyMeshes.length; t++)(r = this._scene.getMeshByUniqueID(this._includedOnlyMeshes[t])) && i.includedMeshes.push(r.id);
                            if (i.excludedMeshes = [], this._excludedMeshes.length)
                                for (t = 0; t < this._excludedMeshes.length; t++) {
                                    var r;
                                    (r = this._scene.getMeshByUniqueID(this._excludedMeshes[t])) && i.excludedMeshes.push(r.id)
                                }
                            return i
                        }, i.Parse = function(t, r, n) {
                            var o, s = e.SerializationHelper.Parse(function() {
                                return new i(t.name, r, t.options)
                            }, t, r, n);
                            for (o = 0; o < t.excludedMeshes.length; o++)(a = r.getMeshByID(t.excludedMeshes[o])) && s.addExcludedMesh(a);
                            for (o = 0; o < t.includedMeshes.length; o++) {
                                var a;
                                (a = r.getMeshByID(t.includedMeshes[o])) && s.addIncludedOnlyMesh(a)
                            }
                            return s
                        }, i.EffectName = "GlowLayer", i.DefaultBlurKernelSize = 32, i.DefaultTextureRatio = .5, y([e.serialize()], i.prototype, "blurKernelSize", null), y([e.serialize()], i.prototype, "intensity", null), y([e.serialize("options")], i.prototype, "_options", void 0), i
                    }(e.EffectLayer);
                    e.GlowLayer = t
                }($a || ($a = {})),
                function(e) {
                    var t, i;
                    (i = t = e.AssetTaskState || (e.AssetTaskState = {}))[i.INIT = 0] = "INIT", i[i.RUNNING = 1] = "RUNNING", i[i.DONE = 2] = "DONE", i[i.ERROR = 3] = "ERROR";
                    var r = function() {
                        function e(e) {
                            this.name = e, this._isCompleted = !1, this._taskState = t.INIT
                        }
                        return Object.defineProperty(e.prototype, "isCompleted", {
                            get: function() {
                                return this._isCompleted
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(e.prototype, "taskState", {
                            get: function() {
                                return this._taskState
                            },
                            enumerable: !0,
                            configurable: !0
                        }), Object.defineProperty(e.prototype, "errorObject", {
                            get: function() {
                                return this._errorObject
                            },
                            enumerable: !0,
                            configurable: !0
                        }), e.prototype._setErrorObject = function(e, t) {
                            this._errorObject || (this._errorObject = {
                                message: e,
                                exception: t
                            })
                        }, e.prototype.run = function(e, i, r) {
                            var n = this;
                            this._taskState = t.RUNNING, this.runTask(e, function() {
                                n.onDoneCallback(i, r)
                            }, function(e, t) {
                                n.onErrorCallback(r, e, t)
                            })
                        }, e.prototype.runTask = function(e, t, i) {
                            throw new Error("runTask is not implemented")
                        }, e.prototype.reset = function() {
                            this._taskState = t.INIT
                        }, e.prototype.onErrorCallback = function(e, i, r) {
                            this._taskState = t.ERROR, this._errorObject = {
                                message: i,
                                exception: r
                            }, this.onError && this.onError(this, i, r), e()
                        }, e.prototype.onDoneCallback = function(e, i) {
                            try {
                                this._taskState = t.DONE, this._isCompleted = !0, this.onSuccess && this.onSuccess(this), e()
                            } catch (e) {
                                this.onErrorCallback(i, "Task is done, error executing success callback(s)", e)
                            }
                        }, e
                    }();
                    e.AbstractAssetTask = r;
                    var n = function(e, t, i) {
                        this.remainingCount = e, this.totalCount = t, this.task = i
                    };
                    e.AssetsProgressEvent = n;
                    var o = function(t) {
                        function i(e, i, r, n) {
                            var o = t.call(this, e) || this;
                            return o.name = e, o.meshesNames = i, o.rootUrl = r, o.sceneFilename = n, o
                        }
                        return b(i, t), i.prototype.runTask = function(t, i, r) {
                            var n = this;
                            e.SceneLoader.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, t, function(e, t, r) {
                                n.loadedMeshes = e, n.loadedParticleSystems = t, n.loadedSkeletons = r, i()
                            }, null, function(e, t, i) {
                                r(t, i)
                            })
                        }, i
                    }(r);
                    e.MeshAssetTask = o;
                    var s = function(e) {
                        function t(t, i) {
                            var r = e.call(this, t) || this;
                            return r.name = t, r.url = i, r
                        }
                        return b(t, e), t.prototype.runTask = function(e, t, i) {
                            var r = this;
                            e._loadFile(this.url, function(e) {
                                r.text = e, t()
                            }, void 0, !1, !1, function(e, t) {
                                e && i(e.status + " " + e.statusText, t)
                            })
                        }, t
                    }(r);
                    e.TextFileAssetTask = s;
                    var a = function(e) {
                        function t(t, i) {
                            var r = e.call(this, t) || this;
                            return r.name = t, r.url = i, r
                        }
                        return b(t, e), t.prototype.runTask = function(e, t, i) {
                            var r = this;
                            e._loadFile(this.url, function(e) {
                                r.data = e, t()
                            }, void 0, !0, !0, function(e, t) {
                                e && i(e.status + " " + e.statusText, t)
                            })
                        }, t
                    }(r);
                    e.BinaryFileAssetTask = a;
                    var l = function(t) {
                        function i(e, i) {
                            var r = t.call(this, e) || this;
                            return r.name = e, r.url = i, r
                        }
                        return b(i, t), i.prototype.runTask = function(t, i, r) {
                            var n = this,
                                o = new Image;
                            e.Tools.SetCorsBehavior(this.url, o), o.onload = function() {
                                n.image = o, i()
                            }, o.onerror = function(e) {
                                r("Error loading image", e)
                            }, o.src = this.url
                        }, i
                    }(r);
                    e.ImageAssetTask = l;
                    var u = function(t) {
                        function i(i, r, n, o, s) {
                            void 0 === s && (s = e.Texture.TRILINEAR_SAMPLINGMODE);
                            var a = t.call(this, i) || this;
                            return a.name = i, a.url = r, a.noMipmap = n, a.invertY = o, a.samplingMode = s, a
                        }
                        return b(i, t), i.prototype.runTask = function(t, i, r) {
                            this.texture = new e.Texture(this.url, t, this.noMipmap, this.invertY, this.samplingMode, function() {
                                i()
                            }, function(e, t) {
                                r(e, t)
                            })
                        }, i
                    }(r);
                    e.TextureAssetTask = u;
                    var c = function(t) {
                        function i(e, i, r, n, o) {
                            var s = t.call(this, e) || this;
                            return s.name = e, s.url = i, s.extensions = r, s.noMipmap = n, s.files = o, s
                        }
                        return b(i, t), i.prototype.runTask = function(t, i, r) {
                            this.texture = new e.CubeTexture(this.url, t, this.extensions, this.noMipmap, this.files, function() {
                                i()
                            }, function(e, t) {
                                r(e, t)
                            })
                        }, i
                    }(r);
                    e.CubeTextureAssetTask = c;
                    var h = function(t) {
                        function i(e, i, r, n, o, s, a) {
                            void 0 === n && (n = !1), void 0 === o && (o = !0), void 0 === s && (s = !1), void 0 === a && (a = !1);
                            var l = t.call(this, e) || this;
                            return l.name = e, l.url = i, l.size = r, l.noMipmap = n, l.generateHarmonics = o, l.gammaSpace = s, l.reserved = a, l
                        }
                        return b(i, t), i.prototype.run = function(t, i, r) {
                            this.texture = new e.HDRCubeTexture(this.url, t, this.size, this.noMipmap, this.generateHarmonics, this.gammaSpace, this.reserved, function() {
                                i()
                            }, function(e, t) {
                                r(e, t)
                            })
                        }, i
                    }(r);
                    e.HDRCubeTextureAssetTask = h;
                    var d = function() {
                        function i(t) {
                            this._isLoading = !1, this._tasks = new Array, this._waitingTasksCount = 0, this._totalTasksCount = 0, this.onTaskSuccessObservable = new e.Observable, this.onTaskErrorObservable = new e.Observable, this.onTasksDoneObservable = new e.Observable, this.onProgressObservable = new e.Observable, this.useDefaultLoadingScreen = !0, this._scene = t
                        }
                        return i.prototype.addMeshTask = function(e, t, i, r) {
                            var n = new o(e, t, i, r);
                            return this._tasks.push(n), n
                        }, i.prototype.addTextFileTask = function(e, t) {
                            var i = new s(e, t);
                            return this._tasks.push(i), i
                        }, i.prototype.addBinaryFileTask = function(e, t) {
                            var i = new a(e, t);
                            return this._tasks.push(i), i
                        }, i.prototype.addImageTask = function(e, t) {
                            var i = new l(e, t);
                            return this._tasks.push(i), i
                        }, i.prototype.addTextureTask = function(t, i, r, n, o) {
                            void 0 === o && (o = e.Texture.TRILINEAR_SAMPLINGMODE);
                            var s = new u(t, i, r, n, o);
                            return this._tasks.push(s), s
                        }, i.prototype.addCubeTextureTask = function(e, t, i, r, n) {
                            var o = new c(e, t, i, r, n);
                            return this._tasks.push(o), o
                        }, i.prototype.addHDRCubeTextureTask = function(e, t, i, r, n, o, s) {
                            void 0 === r && (r = !1), void 0 === n && (n = !0), void 0 === o && (o = !1), void 0 === s && (s = !1);
                            var a = new h(e, t, i, r, n, o, s);
                            return this._tasks.push(a), a
                        }, i.prototype.removeTask = function(e) {
                            var t = this._tasks.indexOf(e); - 1 < t && this._tasks.splice(t, 1)
                        }, i.prototype._decreaseWaitingTasksCount = function(i) {
                            this._waitingTasksCount--;
                            try {
                                this.onProgress && this.onProgress(this._waitingTasksCount, this._totalTasksCount, i), this.onProgressObservable.notifyObservers(new n(this._waitingTasksCount, this._totalTasksCount, i))
                            } catch (i) {
                                e.Tools.Error("Error running progress callbacks.")
                            }
                            if (0 === this._waitingTasksCount) {
                                try {
                                    this.onFinish && this.onFinish(this._tasks);
                                    for (var r = this._tasks.slice(), o = 0, s = r; o < s.length; o++)
                                        if ((i = s[o]).taskState === t.DONE) {
                                            var a = this._tasks.indexOf(i); - 1 < a && this._tasks.splice(a, 1)
                                        }
                                    this.onTasksDoneObservable.notifyObservers(this._tasks)
                                } catch (i) {
                                    e.Tools.Error("Error running tasks-done callbacks.")
                                }
                                this._isLoading = !1, this._scene.getEngine().hideLoadingUI()
                            }
                        }, i.prototype._runTask = function(e) {
                            var t = this,
                                i = function(i, r) {
                                    e._setErrorObject(i, r), t.onTaskError && t.onTaskError(e), t.onTaskErrorObservable.notifyObservers(e), t._decreaseWaitingTasksCount(e)
                                };
                            e.run(this._scene, function() {
                                try {
                                    t.onTaskSuccess && t.onTaskSuccess(e), t.onTaskSuccessObservable.notifyObservers(e), t._decreaseWaitingTasksCount(e)
                                } catch (e) {
                                    i("Error executing task success callbacks", e)
                                }
                            }, i)
                        }, i.prototype.reset = function() {
                            return this._isLoading = !1, this._tasks = new Array, this
                        }, i.prototype.load = function() {
                            if (this._isLoading) return this;
                            if (this._isLoading = !0, this._waitingTasksCount = this._tasks.length, this._totalTasksCount = this._tasks.length, 0 === this._waitingTasksCount) return this._isLoading = !1, this.onFinish && this.onFinish(this._tasks), this.onTasksDoneObservable.notifyObservers(this._tasks), this;
                            this.useDefaultLoadingScreen && this._scene.getEngine().displayLoadingUI();
                            for (var e = 0; e < this._tasks.length; e++) {
                                var i = this._tasks[e];
                                i.taskState === t.INIT && this._runTask(i)
                            }
                            return this
                        }, i
                    }();
                    e.AssetsManager = d
                }($a || ($a = {})), ca = $a || ($a = {}), ha = [], da = function(e, t) {
                    if (!ha[e.id] && !e.doNotSerialize) {
                        if (e instanceof ca.BoxGeometry) t.boxes.push(e.serialize());
                        else if (e instanceof ca.SphereGeometry) t.spheres.push(e.serialize());
                        else if (e instanceof ca.CylinderGeometry) t.cylinders.push(e.serialize());
                        else if (e instanceof ca.TorusGeometry) t.toruses.push(e.serialize());
                        else if (e instanceof ca.GroundGeometry) t.grounds.push(e.serialize());
                        else if (e instanceof ca.Plane) t.planes.push(e.serialize());
                        else if (e instanceof ca.TorusKnotGeometry) t.torusKnots.push(e.serialize());
                        else {
                            if (e instanceof ca._PrimitiveGeometry) throw new Error("Unknown primitive type");
                            t.vertexData.push(e.serializeVerticeData())
                        }
                        ha[e.id] = !0
                    }
                }, pa = function(e, t) {
                    var i = {},
                        r = e._geometry;
                    return r && (e.getScene().getGeometryByID(r.id) || da(r, t.geometries)), e.serialize && e.serialize(i), i
                }, fa = function() {
                    function e() {}
                    return e.ClearCache = function() {
                        ha = []
                    }, e.Serialize = function(t) {
                        var i, r, n, o = {};
                        if (e.ClearCache(), o.useDelayedTextureLoading = t.useDelayedTextureLoading, o.autoClear = t.autoClear, o.clearColor = t.clearColor.asArray(), o.ambientColor = t.ambientColor.asArray(), o.gravity = t.gravity.asArray(), o.collisionsEnabled = t.collisionsEnabled, o.workerCollisions = t.workerCollisions, t.fogMode && 0 !== t.fogMode && (o.fogMode = t.fogMode, o.fogColor = t.fogColor.asArray(), o.fogStart = t.fogStart, o.fogEnd = t.fogEnd, o.fogDensity = t.fogDensity), t.isPhysicsEnabled()) {
                            var s = t.getPhysicsEngine();
                            s && (o.physicsEnabled = !0, o.physicsGravity = s.gravity.asArray(), o.physicsEngine = s.getPhysicsPluginName())
                        }
                        t.metadata && (o.metadata = t.metadata), o.morphTargetManagers = [];
                        for (var a = 0, l = t.meshes; a < l.length; a++) {
                            var u = (_ = l[a]).morphTargetManager;
                            u && o.morphTargetManagers.push(u.serialize())
                        }
                        for (o.lights = [], i = 0; i < t.lights.length; i++)(r = t.lights[i]).doNotSerialize || o.lights.push(r.serialize());
                        for (o.cameras = [], i = 0; i < t.cameras.length; i++) {
                            var c = t.cameras[i];
                            c.doNotSerialize || o.cameras.push(c.serialize())
                        }
                        for (t.activeCamera && (o.activeCameraID = t.activeCamera.id), ca.Animation.AppendSerializedAnimations(t, o), o.materials = [], o.multiMaterials = [], i = 0; i < t.materials.length; i++)(n = t.materials[i]).doNotSerialize || o.materials.push(n.serialize());
                        for (o.multiMaterials = [], i = 0; i < t.multiMaterials.length; i++) {
                            var h = t.multiMaterials[i];
                            o.multiMaterials.push(h.serialize())
                        }
                        for (t.environmentTexture && (o.environmentTexture = t.environmentTexture.name), o.skeletons = [], i = 0; i < t.skeletons.length; i++) {
                            var d = t.skeletons[i];
                            d.doNotSerialize || o.skeletons.push(d.serialize())
                        }
                        for (o.transformNodes = [], i = 0; i < t.transformNodes.length; i++) o.transformNodes.push(t.transformNodes[i].serialize());
                        o.geometries = {}, o.geometries.boxes = [], o.geometries.spheres = [], o.geometries.cylinders = [], o.geometries.toruses = [], o.geometries.grounds = [], o.geometries.planes = [], o.geometries.torusKnots = [], o.geometries.vertexData = [], ha = [];
                        var p = t.getGeometries();
                        for (i = 0; i < p.length; i++) {
                            var f = p[i];
                            f.isReady() && da(f, o.geometries)
                        }
                        for (o.meshes = [], i = 0; i < t.meshes.length; i++) {
                            var _;
                            if ((_ = t.meshes[i]) instanceof ca.Mesh) {
                                var m = _;
                                m.doNotSerialize || m.delayLoadState !== ca.Engine.DELAYLOADSTATE_LOADED && m.delayLoadState !== ca.Engine.DELAYLOADSTATE_NONE || o.meshes.push(pa(m, o))
                            }
                        }
                        for (o.particleSystems = [], i = 0; i < t.particleSystems.length; i++) o.particleSystems.push(t.particleSystems[i].serialize());
                        t.actionManager && (o.actions = t.actionManager.serialize("scene"));
                        for (var g = 0, v = t._serializableComponents; g < v.length; g++) v[g].serialize(o);
                        return o
                    }, e.SerializeMesh = function(t, i, r) {
                        void 0 === i && (i = !1), void 0 === r && (r = !1);
                        var n = {};
                        if (e.ClearCache(), t = t instanceof Array ? t : [t], i || r)
                            for (var o = 0; o < t.length; ++o) r && t[o].getDescendants().forEach(function(e) {
                                e instanceof ca.Mesh && t.indexOf(e) < 0 && t.push(e)
                            }), i && t[o].parent && t.indexOf(t[o].parent) < 0 && t.push(t[o].parent);
                        return t.forEach(function(e) {
                            ! function(e, t) {
                                if (e.delayLoadState === ca.Engine.DELAYLOADSTATE_LOADED || e.delayLoadState === ca.Engine.DELAYLOADSTATE_NONE) {
                                    if (e.material)
                                        if (e.material instanceof ca.MultiMaterial) {
                                            if (t.multiMaterials = t.multiMaterials || [], t.materials = t.materials || [], !t.multiMaterials.some(function(t) {
                                                    return t.id === e.material.id
                                                })) {
                                                t.multiMaterials.push(e.material.serialize());
                                                for (var i = 0, r = e.material.subMaterials; i < r.length; i++) ! function(e) {
                                                    e && (t.materials.some(function(t) {
                                                        return t.id === e.id
                                                    }) || t.materials.push(e.serialize()))
                                                }(r[i])
                                            }
                                        } else t.materials = t.materials || [], t.materials.some(function(t) {
                                            return t.id === e.material.id
                                        }) || t.materials.push(e.material.serialize());
                                    var n = e._geometry;
                                    n && (t.geometries || (t.geometries = {}, t.geometries.boxes = [], t.geometries.spheres = [], t.geometries.cylinders = [], t.geometries.toruses = [], t.geometries.grounds = [], t.geometries.planes = [], t.geometries.torusKnots = [], t.geometries.vertexData = []), da(n, t.geometries)), e.skeleton && (t.skeletons = t.skeletons || [], t.skeletons.push(e.skeleton.serialize())), t.meshes = t.meshes || [], t.meshes.push(pa(e, t))
                                }
                            }(e, n)
                        }), n
                    }, e
                }(), ca.SceneSerializer = fa, _a = $a || ($a = {}), ma = function() {
                    function e(e, t, i, r, n) {
                        void 0 === r && (r = !0), void 0 === n && (n = !1);
                        var o = this;
                        this.name = e, this._viewMatrix = _a.Matrix.Identity(), this._target = _a.Vector3.Zero(), this._add = _a.Vector3.Zero(), this._invertYAxis = !1, this.position = _a.Vector3.Zero(), this._scene = i, this._scene.reflectionProbes || (this._scene.reflectionProbes = new Array), this._scene.reflectionProbes.push(this), this._renderTargetTexture = new _a.RenderTargetTexture(e, t, i, r, !0, n ? _a.Engine.TEXTURETYPE_FLOAT : _a.Engine.TEXTURETYPE_UNSIGNED_INT, !0), this._renderTargetTexture.onBeforeRenderObservable.add(function(e) {
                            switch (e) {
                                case 0:
                                    o._add.copyFromFloats(1, 0, 0);
                                    break;
                                case 1:
                                    o._add.copyFromFloats(-1, 0, 0);
                                    break;
                                case 2:
                                    o._add.copyFromFloats(0, o._invertYAxis ? 1 : -1, 0);
                                    break;
                                case 3:
                                    o._add.copyFromFloats(0, o._invertYAxis ? -1 : 1, 0);
                                    break;
                                case 4:
                                    o._add.copyFromFloats(0, 0, 1);
                                    break;
                                case 5:
                                    o._add.copyFromFloats(0, 0, -1)
                            }
                            o._attachedMesh && o.position.copyFrom(o._attachedMesh.getAbsolutePosition()), o.position.addToRef(o._add, o._target), _a.Matrix.LookAtLHToRef(o.position, o._target, _a.Vector3.Up(), o._viewMatrix), i.setTransformMatrix(o._viewMatrix, o._projectionMatrix), i._forcedViewPosition = o.position
                        }), this._renderTargetTexture.onAfterUnbindObservable.add(function() {
                            i._forcedViewPosition = null, i.updateTransformMatrix(!0)
                        }), i.activeCamera && (this._projectionMatrix = _a.Matrix.PerspectiveFovLH(Math.PI / 2, 1, i.activeCamera.minZ, i.activeCamera.maxZ))
                    }
                    return Object.defineProperty(e.prototype, "samples", {
                        get: function() {
                            return this._renderTargetTexture.samples
                        },
                        set: function(e) {
                            this._renderTargetTexture.samples = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "refreshRate", {
                        get: function() {
                            return this._renderTargetTexture.refreshRate
                        },
                        set: function(e) {
                            this._renderTargetTexture.refreshRate = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.getScene = function() {
                        return this._scene
                    }, Object.defineProperty(e.prototype, "cubeTexture", {
                        get: function() {
                            return this._renderTargetTexture
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "renderList", {
                        get: function() {
                            return this._renderTargetTexture.renderList
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.attachToMesh = function(e) {
                        this._attachedMesh = e
                    }, e.prototype.setRenderingAutoClearDepthStencil = function(e, t) {
                        this._renderTargetTexture.setRenderingAutoClearDepthStencil(e, t)
                    }, e.prototype.dispose = function() {
                        var e = this._scene.reflectionProbes.indexOf(this); - 1 !== e && this._scene.reflectionProbes.splice(e, 1), this._renderTargetTexture && (this._renderTargetTexture.dispose(), this._renderTargetTexture = null)
                    }, e
                }(), _a.ReflectionProbe = ma, ga = $a || ($a = {}), va = function() {
                    function e(e) {
                        this.name = ga.SceneComponentConstants.NAME_LAYER, this.scene = e, this._engine = e.getEngine(), e.layers = new Array
                    }
                    return e.prototype.register = function() {
                        this.scene._beforeCameraDrawStage.registerStep(ga.SceneComponentConstants.STEP_BEFORECAMERADRAW_LAYER, this, this._drawBackground), this.scene._afterCameraDrawStage.registerStep(ga.SceneComponentConstants.STEP_AFTERCAMERADRAW_LAYER, this, this._drawForeground)
                    }, e.prototype.rebuild = function() {
                        for (var e = 0, t = this.scene.layers; e < t.length; e++) t[e]._rebuild()
                    }, e.prototype.dispose = function() {
                        for (var e = this.scene.layers; e.length;) e[0].dispose()
                    }, e.prototype._draw = function(e, t) {
                        var i = this.scene.layers;
                        if (i.length) {
                            this._engine.setDepthBuffer(!1);
                            for (var r = e.layerMask, n = 0, o = i; n < o.length; n++) {
                                var s = o[n];
                                s.isBackground === t && 0 != (s.layerMask & r) && s.render()
                            }
                            this._engine.setDepthBuffer(!0)
                        }
                    }, e.prototype._drawBackground = function(e) {
                        this._draw(e, !0)
                    }, e.prototype._drawForeground = function(e) {
                        this._draw(e, !1)
                    }, e
                }(), ga.LayerSceneComponent = va, ya = $a || ($a = {}), ba = function() {
                    function e(e, t, i, r, n) {
                        this.name = e, this.scale = new ya.Vector2(1, 1), this.offset = new ya.Vector2(0, 0), this.alphaBlendingMode = ya.Engine.ALPHA_COMBINE, this.layerMask = 268435455, this._vertexBuffers = {}, this.onDisposeObservable = new ya.Observable, this.onBeforeRenderObservable = new ya.Observable, this.onAfterRenderObservable = new ya.Observable, this.texture = t ? new ya.Texture(t, i, !0) : null, this.isBackground = void 0 === r || r, this.color = void 0 === n ? new ya.Color4(1, 1, 1, 1) : n, this._scene = i || ya.Engine.LastCreatedScene;
                        var o = this._scene._getComponent(ya.SceneComponentConstants.NAME_LAYER);
                        o || (o = new ya.LayerSceneComponent(this._scene), this._scene._addComponent(o)), this._scene.layers.push(this);
                        var s = this._scene.getEngine(),
                            a = [];
                        a.push(1, 1), a.push(-1, 1), a.push(-1, -1), a.push(1, -1);
                        var l = new ya.VertexBuffer(s, a, ya.VertexBuffer.PositionKind, !1, !1, 2);
                        this._vertexBuffers[ya.VertexBuffer.PositionKind] = l, this._createIndexBuffer(), this._effect = s.createEffect("layer", [ya.VertexBuffer.PositionKind], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], ""), this._alphaTestEffect = s.createEffect("layer", [ya.VertexBuffer.PositionKind], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], "#define ALPHATEST")
                    }
                    return Object.defineProperty(e.prototype, "onDispose", {
                        set: function(e) {
                            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "onBeforeRender", {
                        set: function(e) {
                            this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "onAfterRender", {
                        set: function(e) {
                            this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(e)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype._createIndexBuffer = function() {
                        var e = this._scene.getEngine(),
                            t = [];
                        t.push(0), t.push(1), t.push(2), t.push(0), t.push(2), t.push(3), this._indexBuffer = e.createIndexBuffer(t)
                    }, e.prototype._rebuild = function() {
                        var e = this._vertexBuffers[ya.VertexBuffer.PositionKind];
                        e && e._rebuild(), this._createIndexBuffer()
                    }, e.prototype.render = function() {
                        var e = this.alphaTest ? this._alphaTestEffect : this._effect;
                        if (e.isReady() && this.texture && this.texture.isReady()) {
                            var t = this._scene.getEngine();
                            this.onBeforeRenderObservable.notifyObservers(this), t.enableEffect(e), t.setState(!1), e.setTexture("textureSampler", this.texture), e.setMatrix("textureMatrix", this.texture.getTextureMatrix()), e.setFloat4("color", this.color.r, this.color.g, this.color.b, this.color.a), e.setVector2("offset", this.offset), e.setVector2("scale", this.scale), t.bindBuffers(this._vertexBuffers, this._indexBuffer, e), this.alphaTest ? t.drawElementsType(ya.Material.TriangleFillMode, 0, 6) : (t.setAlphaMode(this.alphaBlendingMode), t.drawElementsType(ya.Material.TriangleFillMode, 0, 6), t.setAlphaMode(ya.Engine.ALPHA_DISABLE)), this.onAfterRenderObservable.notifyObservers(this)
                        }
                    }, e.prototype.dispose = function() {
                        var e = this._vertexBuffers[ya.VertexBuffer.PositionKind];
                        e && (e.dispose(), this._vertexBuffers[ya.VertexBuffer.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this.texture && (this.texture.dispose(), this.texture = null);
                        var t = this._scene.layers.indexOf(this);
                        this._scene.layers.splice(t, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onAfterRenderObservable.clear(), this.onBeforeRenderObservable.clear()
                    }, e
                }(), ya.Layer = ba, xa = $a || ($a = {}), Ta = function() {
                    function e() {}
                    return e.CreateResizedCopy = function(e, t, i, r) {
                            void 0 === r && (r = !0);
                            var n = e.getScene(),
                                o = n.getEngine(),
                                s = new xa.RenderTargetTexture("resized" + e.name, {
                                    width: t,
                                    height: i
                                }, n, !e.noMipmap, !0, e._texture.type, !1, e._samplingMode, !1);
                            s.wrapU = e.wrapU, s.wrapV = e.wrapV, s.uOffset = e.uOffset, s.vOffset = e.vOffset, s.uScale = e.uScale, s.vScale = e.vScale, s.uAng = e.uAng, s.vAng = e.vAng, s.wAng = e.wAng, s.coordinatesIndex = e.coordinatesIndex, s.level = e.level, s.anisotropicFilteringLevel = e.anisotropicFilteringLevel, s._texture.isReady = !1, e.wrapU = xa.Texture.CLAMP_ADDRESSMODE, e.wrapV = xa.Texture.CLAMP_ADDRESSMODE;
                            var a = new xa.PassPostProcess("pass", 1, null, r ? xa.Texture.BILINEAR_SAMPLINGMODE : xa.Texture.NEAREST_SAMPLINGMODE, o, !1, xa.Engine.TEXTURETYPE_UNSIGNED_INT);
                            return a.getEffect().executeWhenCompiled(function() {
                                a.onApply = function(t) {
                                    t.setTexture("textureSampler", e)
                                };
                                var t = s.getInternalTexture();
                                t && (n.postProcessManager.directRender([a], t), o.unBindFramebuffer(t), s.disposeFramebufferObjects(), a.dispose(), t.isReady = !0)
                            }), s
                        }, e.GetEnvironmentBRDFTexture = function(e) {
                            if (!e._environmentBRDFTexture) {
                                var t = xa.Texture.CreateFromBase64String(this._environmentBRDFBase64Texture, "EnvironmentBRDFTexture", e, !0, !1, xa.Texture.BILINEAR_SAMPLINGMODE);
                                t.wrapU = xa.Texture.CLAMP_ADDRESSMODE, t.wrapV = xa.Texture.CLAMP_ADDRESSMODE, e._environmentBRDFTexture = t
                            }
                            return e._environmentBRDFTexture
                        },
                        e._environmentBRDFBase64Texture = "data:image/png;base64, ", e
                }(), xa.TextureTools = Ta, Ea = $a || ($a = {}), Sa = function() {
                    function e() {
                        this._mode = e.FitFrustumSidesMode, this._radiusScale = 1, this._positionScale = .5, this._defaultElevation = .3, this._elevationReturnTime = 1500, this._elevationReturnWaitTime = 1e3, this._zoomStopsAnimation = !1, this._framingTime = 1500, this.autoCorrectCameraLimitsAndSensibility = !0, this._isPointerDown = !1, this._lastInteractionTime = -1 / 0, this._animatables = new Array, this._betaIsAnimating = !1
                    }
                    return Object.defineProperty(e.prototype, "name", {
                        get: function() {
                            return "Framing"
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "mode", {
                        get: function() {
                            return this._mode
                        },
                        set: function(e) {
                            this._mode = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "radiusScale", {
                        get: function() {
                            return this._radiusScale
                        },
                        set: function(e) {
                            this._radiusScale = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "positionScale", {
                        get: function() {
                            return this._positionScale
                        },
                        set: function(e) {
                            this._positionScale = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "defaultElevation", {
                        get: function() {
                            return this._defaultElevation
                        },
                        set: function(e) {
                            this._defaultElevation = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "elevationReturnTime", {
                        get: function() {
                            return this._elevationReturnTime
                        },
                        set: function(e) {
                            this._elevationReturnTime = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "elevationReturnWaitTime", {
                        get: function() {
                            return this._elevationReturnWaitTime
                        },
                        set: function(e) {
                            this._elevationReturnWaitTime = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "zoomStopsAnimation", {
                        get: function() {
                            return this._zoomStopsAnimation
                        },
                        set: function(e) {
                            this._zoomStopsAnimation = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "framingTime", {
                        get: function() {
                            return this._framingTime
                        },
                        set: function(e) {
                            this._framingTime = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.init = function() {}, e.prototype.attach = function(t) {
                        var i = this;
                        this._attachedCamera = t;
                        var r = this._attachedCamera.getScene();
                        e.EasingFunction.setEasingMode(e.EasingMode), this._onPrePointerObservableObserver = r.onPrePointerObservable.add(function(e) {
                            e.type !== Ea.PointerEventTypes.POINTERDOWN ? e.type === Ea.PointerEventTypes.POINTERUP && (i._isPointerDown = !1) : i._isPointerDown = !0
                        }), this._onMeshTargetChangedObserver = t.onMeshTargetChangedObservable.add(function(e) {
                            e && i.zoomOnMesh(e)
                        }), this._onAfterCheckInputsObserver = t.onAfterCheckInputsObservable.add(function() {
                            i._applyUserInteraction(), i._maintainCameraAboveGround()
                        })
                    }, e.prototype.detach = function() {
                        if (this._attachedCamera) {
                            var e = this._attachedCamera.getScene();
                            this._onPrePointerObservableObserver && e.onPrePointerObservable.remove(this._onPrePointerObservableObserver), this._onAfterCheckInputsObserver && this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._onMeshTargetChangedObserver && this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver), this._attachedCamera = null
                        }
                    }, e.prototype.zoomOnMesh = function(e, t, i) {
                        void 0 === t && (t = !1), void 0 === i && (i = null), e.computeWorldMatrix(!0);
                        var r = e.getBoundingInfo().boundingBox;
                        this.zoomOnBoundingInfo(r.minimumWorld, r.maximumWorld, t, i)
                    }, e.prototype.zoomOnMeshHierarchy = function(e, t, i) {
                        void 0 === t && (t = !1), void 0 === i && (i = null), e.computeWorldMatrix(!0);
                        var r = e.getHierarchyBoundingVectors(!0);
                        this.zoomOnBoundingInfo(r.min, r.max, t, i)
                    }, e.prototype.zoomOnMeshesHierarchy = function(e, t, i) {
                        void 0 === t && (t = !1), void 0 === i && (i = null);
                        for (var r = new Ea.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), n = new Ea.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE), o = 0; o < e.length; o++) {
                            var s = e[o].getHierarchyBoundingVectors(!0);
                            Ea.Tools.CheckExtends(s.min, r, n), Ea.Tools.CheckExtends(s.max, r, n)
                        }
                        this.zoomOnBoundingInfo(r, n, t, i)
                    }, e.prototype.zoomOnBoundingInfo = function(t, i, r, n) {
                        var o, s = this;
                        if (void 0 === r && (r = !1), void 0 === n && (n = null), this._attachedCamera) {
                            var a = t.y,
                                l = a + (i.y - a) * this._positionScale,
                                u = i.subtract(t).scale(.5);
                            if (r) o = new Ea.Vector3(0, l, 0);
                            else {
                                var c = t.add(u);
                                o = new Ea.Vector3(c.x, l, c.z)
                            }
                            this._vectorTransition || (this._vectorTransition = Ea.Animation.CreateAnimation("target", Ea.Animation.ANIMATIONTYPE_VECTOR3, 60, e.EasingFunction)), this._betaIsAnimating = !0;
                            var h = Ea.Animation.TransitionTo("target", o, this._attachedCamera, this._attachedCamera.getScene(), 60, this._vectorTransition, this._framingTime);
                            h && this._animatables.push(h);
                            var d = 0;
                            if (this._mode === e.FitFrustumSidesMode) {
                                var p = this._calculateLowerRadiusFromModelBoundingSphere(t, i);
                                this.autoCorrectCameraLimitsAndSensibility && (this._attachedCamera.lowerRadiusLimit = u.length() + this._attachedCamera.minZ), d = p
                            } else this._mode === e.IgnoreBoundsSizeMode && (d = this._calculateLowerRadiusFromModelBoundingSphere(t, i), this.autoCorrectCameraLimitsAndSensibility && null === this._attachedCamera.lowerRadiusLimit && (this._attachedCamera.lowerRadiusLimit = this._attachedCamera.minZ));
                            if (this.autoCorrectCameraLimitsAndSensibility) {
                                var f = i.subtract(t).length();
                                this._attachedCamera.panningSensibility = 5e3 / f, this._attachedCamera.wheelPrecision = 100 / d
                            }
                            this._radiusTransition || (this._radiusTransition = Ea.Animation.CreateAnimation("radius", Ea.Animation.ANIMATIONTYPE_FLOAT, 60, e.EasingFunction)), (h = Ea.Animation.TransitionTo("radius", d, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusTransition, this._framingTime, function() {
                                s.stopAllAnimations(), n && n(), s._attachedCamera && s._attachedCamera.useInputToRestoreState && s._attachedCamera.storeState()
                            })) && this._animatables.push(h)
                        }
                    }, e.prototype._calculateLowerRadiusFromModelBoundingSphere = function(t, i) {
                        var r = i.subtract(t).length(),
                            n = this._getFrustumSlope(),
                            o = .5 * r * this._radiusScale,
                            s = o * Math.sqrt(1 + 1 / (n.x * n.x)),
                            a = o * Math.sqrt(1 + 1 / (n.y * n.y)),
                            l = Math.max(s, a),
                            u = this._attachedCamera;
                        return u ? (u.lowerRadiusLimit && this._mode === e.IgnoreBoundsSizeMode && (l = l < u.lowerRadiusLimit ? u.lowerRadiusLimit : l), u.upperRadiusLimit && (l = l > u.upperRadiusLimit ? u.upperRadiusLimit : l), l) : 0
                    }, e.prototype._maintainCameraAboveGround = function() {
                        var t = this;
                        if (!(this._elevationReturnTime < 0)) {
                            var i = Ea.Tools.Now - this._lastInteractionTime,
                                r = .5 * Math.PI - this._defaultElevation,
                                n = .5 * Math.PI;
                            if (this._attachedCamera && !this._betaIsAnimating && this._attachedCamera.beta > n && i >= this._elevationReturnWaitTime) {
                                this._betaIsAnimating = !0, this.stopAllAnimations(), this._betaTransition || (this._betaTransition = Ea.Animation.CreateAnimation("beta", Ea.Animation.ANIMATIONTYPE_FLOAT, 60, e.EasingFunction));
                                var o = Ea.Animation.TransitionTo("beta", r, this._attachedCamera, this._attachedCamera.getScene(), 60, this._betaTransition, this._elevationReturnTime, function() {
                                    t._clearAnimationLocks(), t.stopAllAnimations()
                                });
                                o && this._animatables.push(o)
                            }
                        }
                    }, e.prototype._getFrustumSlope = function() {
                        var e = this._attachedCamera;
                        if (!e) return Ea.Vector2.Zero();
                        var t = e.getScene().getEngine().getAspectRatio(e),
                            i = Math.tan(e.fov / 2),
                            r = i * t;
                        return new Ea.Vector2(r, i)
                    }, e.prototype._clearAnimationLocks = function() {
                        this._betaIsAnimating = !1
                    }, e.prototype._applyUserInteraction = function() {
                        this.isUserIsMoving && (this._lastInteractionTime = Ea.Tools.Now, this.stopAllAnimations(), this._clearAnimationLocks())
                    }, e.prototype.stopAllAnimations = function() {
                        for (this._attachedCamera && (this._attachedCamera.animations = []); this._animatables.length;) this._animatables[0] && (this._animatables[0].onAnimationEnd = null, this._animatables[0].stop()), this._animatables.shift()
                    }, Object.defineProperty(e.prototype, "isUserIsMoving", {
                        get: function() {
                            return !!this._attachedCamera && (0 !== this._attachedCamera.inertialAlphaOffset || 0 !== this._attachedCamera.inertialBetaOffset || 0 !== this._attachedCamera.inertialRadiusOffset || 0 !== this._attachedCamera.inertialPanningX || 0 !== this._attachedCamera.inertialPanningY || this._isPointerDown)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.EasingFunction = new Ea.ExponentialEase, e.EasingMode = Ea.EasingFunction.EASINGMODE_EASEINOUT, e.IgnoreBoundsSizeMode = 0, e.FitFrustumSidesMode = 1, e
                }(), Ea.FramingBehavior = Sa, Pa = $a || ($a = {}), Aa = function() {
                    function e() {
                        this.transitionDuration = 450, this.lowerRadiusTransitionRange = 2, this.upperRadiusTransitionRange = -2, this._autoTransitionRange = !1, this._radiusIsAnimating = !1, this._radiusBounceTransition = null, this._animatables = new Array
                    }
                    return Object.defineProperty(e.prototype, "name", {
                        get: function() {
                            return "Bouncing"
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "autoTransitionRange", {
                        get: function() {
                            return this._autoTransitionRange
                        },
                        set: function(e) {
                            var t = this;
                            if (this._autoTransitionRange !== e) {
                                this._autoTransitionRange = e;
                                var i = this._attachedCamera;
                                i && (e ? this._onMeshTargetChangedObserver = i.onMeshTargetChangedObservable.add(function(e) {
                                    if (e) {
                                        e.computeWorldMatrix(!0);
                                        var i = e.getBoundingInfo().diagonalLength;
                                        t.lowerRadiusTransitionRange = .05 * i, t.upperRadiusTransitionRange = .05 * i
                                    }
                                }) : this._onMeshTargetChangedObserver && i.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver))
                            }
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.init = function() {}, e.prototype.attach = function(e) {
                        var t = this;
                        this._attachedCamera = e, this._onAfterCheckInputsObserver = e.onAfterCheckInputsObservable.add(function() {
                            t._attachedCamera && (t._isRadiusAtLimit(t._attachedCamera.lowerRadiusLimit) && t._applyBoundRadiusAnimation(t.lowerRadiusTransitionRange), t._isRadiusAtLimit(t._attachedCamera.upperRadiusLimit) && t._applyBoundRadiusAnimation(t.upperRadiusTransitionRange))
                        })
                    }, e.prototype.detach = function() {
                        this._attachedCamera && (this._onAfterCheckInputsObserver && this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._onMeshTargetChangedObserver && this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver), this._attachedCamera = null)
                    }, e.prototype._isRadiusAtLimit = function(e) {
                        return !!this._attachedCamera && this._attachedCamera.radius === e && !this._radiusIsAnimating
                    }, e.prototype._applyBoundRadiusAnimation = function(t) {
                        var i = this;
                        if (this._attachedCamera) {
                            this._radiusBounceTransition || (e.EasingFunction.setEasingMode(e.EasingMode), this._radiusBounceTransition = Pa.Animation.CreateAnimation("radius", Pa.Animation.ANIMATIONTYPE_FLOAT, 60, e.EasingFunction)), this._cachedWheelPrecision = this._attachedCamera.wheelPrecision, this._attachedCamera.wheelPrecision = 1 / 0, this._attachedCamera.inertialRadiusOffset = 0, this.stopAllAnimations(), this._radiusIsAnimating = !0;
                            var r = Pa.Animation.TransitionTo("radius", this._attachedCamera.radius + t, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusBounceTransition, this.transitionDuration, function() {
                                return i._clearAnimationLocks()
                            });
                            r && this._animatables.push(r)
                        }
                    }, e.prototype._clearAnimationLocks = function() {
                        this._radiusIsAnimating = !1, this._attachedCamera && (this._attachedCamera.wheelPrecision = this._cachedWheelPrecision)
                    }, e.prototype.stopAllAnimations = function() {
                        for (this._attachedCamera && (this._attachedCamera.animations = []); this._animatables.length;) this._animatables[0].onAnimationEnd = null, this._animatables[0].stop(), this._animatables.shift()
                    }, e.EasingFunction = new Pa.BackEase(.3), e.EasingMode = Pa.EasingFunction.EASINGMODE_EASEOUT, e
                }(), Pa.BouncingBehavior = Aa, Ca = $a || ($a = {}), Ma = function() {
                    function e() {
                        this._zoomStopsAnimation = !1, this._idleRotationSpeed = .05, this._idleRotationWaitTime = 2e3, this._idleRotationSpinupTime = 2e3, this._isPointerDown = !1, this._lastFrameTime = null, this._lastInteractionTime = -1 / 0, this._cameraRotationSpeed = 0, this._lastFrameRadius = 0
                    }
                    return Object.defineProperty(e.prototype, "name", {
                        get: function() {
                            return "AutoRotation"
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "zoomStopsAnimation", {
                        get: function() {
                            return this._zoomStopsAnimation
                        },
                        set: function(e) {
                            this._zoomStopsAnimation = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "idleRotationSpeed", {
                        get: function() {
                            return this._idleRotationSpeed
                        },
                        set: function(e) {
                            this._idleRotationSpeed = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "idleRotationWaitTime", {
                        get: function() {
                            return this._idleRotationWaitTime
                        },
                        set: function(e) {
                            this._idleRotationWaitTime = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "idleRotationSpinupTime", {
                        get: function() {
                            return this._idleRotationSpinupTime
                        },
                        set: function(e) {
                            this._idleRotationSpinupTime = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "rotationInProgress", {
                        get: function() {
                            return 0 < Math.abs(this._cameraRotationSpeed)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.init = function() {}, e.prototype.attach = function(e) {
                        var t = this;
                        this._attachedCamera = e;
                        var i = this._attachedCamera.getScene();
                        this._onPrePointerObservableObserver = i.onPrePointerObservable.add(function(e) {
                            e.type !== Ca.PointerEventTypes.POINTERDOWN ? e.type === Ca.PointerEventTypes.POINTERUP && (t._isPointerDown = !1) : t._isPointerDown = !0
                        }), this._onAfterCheckInputsObserver = e.onAfterCheckInputsObservable.add(function() {
                            var e = Ca.Tools.Now,
                                i = 0;
                            null != t._lastFrameTime && (i = e - t._lastFrameTime), t._lastFrameTime = e, t._applyUserInteraction();
                            var r = e - t._lastInteractionTime - t._idleRotationWaitTime,
                                n = Math.max(Math.min(r / t._idleRotationSpinupTime, 1), 0);
                            t._cameraRotationSpeed = t._idleRotationSpeed * n, t._attachedCamera && (t._attachedCamera.alpha -= t._cameraRotationSpeed * (i / 1e3))
                        })
                    }, e.prototype.detach = function() {
                        if (this._attachedCamera) {
                            var e = this._attachedCamera.getScene();
                            this._onPrePointerObservableObserver && e.onPrePointerObservable.remove(this._onPrePointerObservableObserver), this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._attachedCamera = null
                        }
                    }, e.prototype._userIsZooming = function() {
                        return !!this._attachedCamera && 0 !== this._attachedCamera.inertialRadiusOffset
                    }, e.prototype._shouldAnimationStopForInteraction = function() {
                        if (!this._attachedCamera) return !1;
                        var e = !1;
                        return this._lastFrameRadius === this._attachedCamera.radius && 0 !== this._attachedCamera.inertialRadiusOffset && (e = !0), this._lastFrameRadius = this._attachedCamera.radius, this._zoomStopsAnimation ? e : this._userIsZooming()
                    }, e.prototype._applyUserInteraction = function() {
                        this._userIsMoving() && !this._shouldAnimationStopForInteraction() && (this._lastInteractionTime = Ca.Tools.Now)
                    }, e.prototype._userIsMoving = function() {
                        return !!this._attachedCamera && (0 !== this._attachedCamera.inertialAlphaOffset || 0 !== this._attachedCamera.inertialBetaOffset || 0 !== this._attachedCamera.inertialRadiusOffset || 0 !== this._attachedCamera.inertialPanningX || 0 !== this._attachedCamera.inertialPanningY || this._isPointerDown)
                    }, e
                }(), Ca.AutoRotationBehavior = Ma,
                function(e) {
                    var t = function() {
                        this.renderWidth = 512, this.renderHeight = 256, this.textureSize = 512, this.deterministicLockstep = !1, this.lockstepMaxSteps = 4
                    };
                    e.NullEngineOptions = t;
                    var i = function(i) {
                        function r(r) {
                            void 0 === r && (r = new t);
                            var n = i.call(this, null) || this;
                            return void 0 === r.deterministicLockstep && (r.deterministicLockstep = !1), void 0 === r.lockstepMaxSteps && (r.lockstepMaxSteps = 4), n._options = r, n._caps = new e.EngineCapabilities, n._caps.maxTexturesImageUnits = 16, n._caps.maxVertexTextureImageUnits = 16, n._caps.maxTextureSize = 512, n._caps.maxCubemapTextureSize = 512, n._caps.maxRenderTextureSize = 512, n._caps.maxVertexAttribs = 16, n._caps.maxVaryingVectors = 16, n._caps.maxFragmentUniformVectors = 16, n._caps.maxVertexUniformVectors = 16, n._caps.standardDerivatives = !1, n._caps.astc = null, n._caps.s3tc = null, n._caps.pvrtc = null, n._caps.etc1 = null, n._caps.etc2 = null, n._caps.textureAnisotropicFilterExtension = null, n._caps.maxAnisotropy = 0, n._caps.uintIndices = !1, n._caps.fragmentDepthSupported = !1, n._caps.highPrecisionShaderSupported = !0, n._caps.colorBufferFloat = !1, n._caps.textureFloat = !1, n._caps.textureFloatLinearFiltering = !1, n._caps.textureFloatRender = !1, n._caps.textureHalfFloat = !1, n._caps.textureHalfFloatLinearFiltering = !1, n._caps.textureHalfFloatRender = !1, n._caps.textureLOD = !1, n._caps.drawBuffersExtension = !1, n._caps.depthTextureExtension = !1, n._caps.vertexArrayObject = !1, n._caps.instancedArrays = !1, e.Tools.Log("Babylon.js null engine (v" + e.Engine.Version + ") launched"), "undefined" == typeof URL && (URL = {
                                createObjectURL: function() {},
                                revokeObjectURL: function() {}
                            }), "undefined" == typeof Blob && (Blob = function() {}), n
                        }
                        return b(r, i), r.prototype.isDeterministicLockStep = function() {
                            return this._options.deterministicLockstep
                        }, r.prototype.getLockstepMaxSteps = function() {
                            return this._options.lockstepMaxSteps
                        }, r.prototype.getHardwareScalingLevel = function() {
                            return 1
                        }, r.prototype.createVertexBuffer = function(e) {
                            return {
                                capacity: 0,
                                references: 1,
                                is32Bits: !1
                            }
                        }, r.prototype.createIndexBuffer = function(e) {
                            return {
                                capacity: 0,
                                references: 1,
                                is32Bits: !1
                            }
                        }, r.prototype.clear = function(e, t, i, r) {
                            void 0 === r && (r = !1)
                        }, r.prototype.getRenderWidth = function(e) {
                            return void 0 === e && (e = !1), !e && this._currentRenderTarget ? this._currentRenderTarget.width : this._options.renderWidth
                        }, r.prototype.getRenderHeight = function(e) {
                            return void 0 === e && (e = !1), !e && this._currentRenderTarget ? this._currentRenderTarget.height : this._options.renderHeight
                        }, r.prototype.setViewport = function(e, t, i) {
                            this._cachedViewport = e
                        }, r.prototype.createShaderProgram = function(e, t, i, r) {
                            return {
                                transformFeedback: null,
                                __SPECTOR_rebuildProgram: null
                            }
                        }, r.prototype.getUniforms = function(e, t) {
                            return []
                        }, r.prototype.getAttributes = function(e, t) {
                            return []
                        }, r.prototype.bindSamplers = function(e) {
                            this._currentEffect = null
                        }, r.prototype.enableEffect = function(e) {
                            (this._currentEffect = e).onBind && e.onBind(e), e._onBindObservable && e._onBindObservable.notifyObservers(e)
                        }, r.prototype.setState = function(e, t, i, r) {
                            void 0 === t && (t = 0), void 0 === r && (r = !1)
                        }, r.prototype.setIntArray = function(e, t) {}, r.prototype.setIntArray2 = function(e, t) {}, r.prototype.setIntArray3 = function(e, t) {}, r.prototype.setIntArray4 = function(e, t) {}, r.prototype.setFloatArray = function(e, t) {}, r.prototype.setFloatArray2 = function(e, t) {}, r.prototype.setFloatArray3 = function(e, t) {}, r.prototype.setFloatArray4 = function(e, t) {}, r.prototype.setArray = function(e, t) {}, r.prototype.setArray2 = function(e, t) {}, r.prototype.setArray3 = function(e, t) {}, r.prototype.setArray4 = function(e, t) {}, r.prototype.setMatrices = function(e, t) {}, r.prototype.setMatrix = function(e, t) {}, r.prototype.setMatrix3x3 = function(e, t) {}, r.prototype.setMatrix2x2 = function(e, t) {}, r.prototype.setFloat = function(e, t) {}, r.prototype.setFloat2 = function(e, t, i) {}, r.prototype.setFloat3 = function(e, t, i, r) {}, r.prototype.setBool = function(e, t) {}, r.prototype.setFloat4 = function(e, t, i, r, n) {}, r.prototype.setColor3 = function(e, t) {}, r.prototype.setColor4 = function(e, t, i) {}, r.prototype.setAlphaMode = function(t, i) {
                            void 0 === i && (i = !1), this._alphaMode !== t && (this._alphaState.alphaBlend = t !== e.Engine.ALPHA_DISABLE, i || this.setDepthWrite(t === e.Engine.ALPHA_DISABLE), this._alphaMode = t)
                        }, r.prototype.bindBuffers = function(e, t, i) {}, r.prototype.wipeCaches = function(e) {
                            this.preventCacheWipeBetweenFrames || (this.resetTextureCache(), this._currentEffect = null, e && (this._currentProgram = null, this._stencilState.reset(), this._depthCullingState.reset(), this._alphaState.reset()), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null)
                        }, r.prototype.draw = function(e, t, i, r) {}, r.prototype.drawElementsType = function(e, t, i, r) {}, r.prototype.drawArraysType = function(e, t, i, r) {}, r.prototype._createTexture = function() {
                            return {}
                        }, r.prototype._releaseTexture = function(e) {}, r.prototype.createTexture = function(t, i, r, n, o, s, a, l, u, c) {
                            void 0 === o && (o = e.Texture.TRILINEAR_SAMPLINGMODE), void 0 === s && (s = null), void 0 === a && (a = null), void 0 === l && (l = null);
                            var h = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_URL),
                                d = String(t);
                            return h.url = d, h.generateMipMaps = !i, h.samplingMode = o, h.invertY = r, h.baseWidth = this._options.textureSize, h.baseHeight = this._options.textureSize, h.width = this._options.textureSize, h.height = this._options.textureSize, c && (h.format = c), h.isReady = !0, s && s(), this._internalTexturesCache.push(h), h
                        }, r.prototype.createRenderTargetTexture = function(t, i) {
                            var r = new e.RenderTargetCreationOptions;
                            void 0 !== i && "object" == typeof i ? (r.generateMipMaps = i.generateMipMaps, r.generateDepthBuffer = void 0 === i.generateDepthBuffer || i.generateDepthBuffer, r.generateStencilBuffer = r.generateDepthBuffer && i.generateStencilBuffer, r.type = void 0 === i.type ? e.Engine.TEXTURETYPE_UNSIGNED_INT : i.type, r.samplingMode = void 0 === i.samplingMode ? e.Texture.TRILINEAR_SAMPLINGMODE : i.samplingMode) : (r.generateMipMaps = i, r.generateDepthBuffer = !0, r.generateStencilBuffer = !1, r.type = e.Engine.TEXTURETYPE_UNSIGNED_INT, r.samplingMode = e.Texture.TRILINEAR_SAMPLINGMODE);
                            var n = new e.InternalTexture(this, e.InternalTexture.DATASOURCE_RENDERTARGET),
                                o = t.width || t,
                                s = t.height || t;
                            return n._depthStencilBuffer = {}, n._framebuffer = {}, n.baseWidth = o, n.baseHeight = s, n.width = o, n.height = s, n.isReady = !0, n.samples = 1, n.generateMipMaps = !!r.generateMipMaps, n.samplingMode = r.samplingMode, n.type = r.type, n._generateDepthBuffer = r.generateDepthBuffer, n._generateStencilBuffer = !!r.generateStencilBuffer, this._internalTexturesCache.push(n), n
                        }, r.prototype.updateTextureSamplingMode = function(e, t) {
                            t.samplingMode = e
                        }, r.prototype.bindFramebuffer = function(e, t, i, r, n) {
                            this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = e, this._currentFramebuffer = e._MSAAFramebuffer ? e._MSAAFramebuffer : e._framebuffer, this._cachedViewport && !n && this.setViewport(this._cachedViewport, i, r)
                        }, r.prototype.unBindFramebuffer = function(e, t, i) {
                            void 0 === t && (t = !1), this._currentRenderTarget = null, i && (e._MSAAFramebuffer && (this._currentFramebuffer = e._framebuffer), i()), this._currentFramebuffer = null
                        }, r.prototype.createDynamicVertexBuffer = function(e) {
                            return {
                                capacity: 1,
                                references: 1,
                                is32Bits: !1
                            }
                        }, r.prototype.updateDynamicTexture = function(e, t, i, r, n) {
                            void 0 === r && (r = !1)
                        }, r.prototype.getError = function() {
                            return 0
                        }, r.prototype._getUnpackAlignement = function() {
                            return 1
                        }, r.prototype._unpackFlipY = function(e) {}, r.prototype.updateDynamicIndexBuffer = function(e, t, i) {
                            void 0 === i && (i = 0)
                        }, r.prototype.updateDynamicVertexBuffer = function(e, t, i, r) {}, r.prototype._bindTextureDirectly = function(e, t) {
                            return this._boundTexturesCache[this._activeChannel] !== t && (this._boundTexturesCache[this._activeChannel] = t, !0)
                        }, r.prototype._bindTexture = function(e, t) {
                            e < 0 || this._bindTextureDirectly(0, t)
                        }, r.prototype._releaseBuffer = function(e) {
                            return 0 === --e.references
                        }, r.prototype.releaseEffects = function() {}, r.prototype.displayLoadingUI = function() {}, r.prototype.hideLoadingUI = function() {}, r.prototype._uploadCompressedDataToTextureDirectly = function(e, t, i, r, n, o, s) {
                            void 0 === o && (o = 0), void 0 === s && (s = 0)
                        }, r.prototype._uploadDataToTextureDirectly = function(e, t, i, r) {
                            void 0 === i && (i = 0), void 0 === r && (r = 0)
                        }, r.prototype._uploadArrayBufferViewToTexture = function(e, t, i, r) {
                            void 0 === i && (i = 0), void 0 === r && (r = 0)
                        }, r.prototype._uploadImageToTexture = function(e, t, i, r) {
                            void 0 === i && (i = 0), void 0 === r && (r = 0)
                        }, r
                    }(e.Engine);
                    e.NullEngine = i
                }($a || ($a = {})), Ra = $a || ($a = {}), Oa = function() {
                    function e(e) {
                        this.engine = e, this._captureGPUFrameTime = !1, this._gpuFrameTime = new Ra.PerfCounter, this._captureShaderCompilationTime = !1, this._shaderCompilationTime = new Ra.PerfCounter, this._onBeginFrameObserver = null, this._onEndFrameObserver = null, this._onBeforeShaderCompilationObserver = null, this._onAfterShaderCompilationObserver = null
                    }
                    return Object.defineProperty(e.prototype, "gpuFrameTimeCounter", {
                        get: function() {
                            return this._gpuFrameTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "captureGPUFrameTime", {
                        get: function() {
                            return this._captureGPUFrameTime
                        },
                        set: function(e) {
                            var t = this;
                            e !== this._captureGPUFrameTime && ((this._captureGPUFrameTime = e) ? (this._onBeginFrameObserver = this.engine.onBeginFrameObservable.add(function() {
                                t._gpuFrameTimeToken || (t._gpuFrameTimeToken = t.engine.startTimeQuery())
                            }), this._onEndFrameObserver = this.engine.onEndFrameObservable.add(function() {
                                if (t._gpuFrameTimeToken) {
                                    var e = t.engine.endTimeQuery(t._gpuFrameTimeToken); - 1 < e && (t._gpuFrameTimeToken = null, t._gpuFrameTime.fetchNewFrame(), t._gpuFrameTime.addCount(e, !0))
                                }
                            })) : (this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver), this._onBeginFrameObserver = null, this.engine.onEndFrameObservable.remove(this._onEndFrameObserver), this._onEndFrameObserver = null))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "shaderCompilationTimeCounter", {
                        get: function() {
                            return this._shaderCompilationTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "captureShaderCompilationTime", {
                        get: function() {
                            return this._captureShaderCompilationTime
                        },
                        set: function(e) {
                            var t = this;
                            e !== this._captureShaderCompilationTime && ((this._captureShaderCompilationTime = e) ? (this._onBeforeShaderCompilationObserver = this.engine.onBeforeShaderCompilationObservable.add(function() {
                                t._shaderCompilationTime.fetchNewFrame(), t._shaderCompilationTime.beginMonitoring()
                            }), this._onAfterShaderCompilationObserver = this.engine.onAfterShaderCompilationObservable.add(function() {
                                t._shaderCompilationTime.endMonitoring()
                            })) : (this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver), this._onBeforeShaderCompilationObserver = null, this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver), this._onAfterShaderCompilationObserver = null))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.dispose = function() {
                        this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver), this._onBeginFrameObserver = null, this.engine.onEndFrameObservable.remove(this._onEndFrameObserver), this._onEndFrameObserver = null, this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver), this._onBeforeShaderCompilationObserver = null, this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver), this._onAfterShaderCompilationObserver = null, this.engine = null
                    }, e
                }(), Ra.EngineInstrumentation = Oa, wa = $a || ($a = {}), Ia = function() {
                    function e(e) {
                        var t = this;
                        this.scene = e, this._captureActiveMeshesEvaluationTime = !1, this._activeMeshesEvaluationTime = new wa.PerfCounter, this._captureRenderTargetsRenderTime = !1, this._renderTargetsRenderTime = new wa.PerfCounter, this._captureFrameTime = !1, this._frameTime = new wa.PerfCounter, this._captureRenderTime = !1, this._renderTime = new wa.PerfCounter, this._captureInterFrameTime = !1, this._interFrameTime = new wa.PerfCounter, this._captureParticlesRenderTime = !1, this._particlesRenderTime = new wa.PerfCounter, this._captureSpritesRenderTime = !1, this._spritesRenderTime = new wa.PerfCounter, this._capturePhysicsTime = !1, this._physicsTime = new wa.PerfCounter, this._captureAnimationsTime = !1, this._animationsTime = new wa.PerfCounter, this._captureCameraRenderTime = !1, this._cameraRenderTime = new wa.PerfCounter, this._onBeforeActiveMeshesEvaluationObserver = null, this._onAfterActiveMeshesEvaluationObserver = null, this._onBeforeRenderTargetsRenderObserver = null, this._onAfterRenderTargetsRenderObserver = null, this._onAfterRenderObserver = null, this._onBeforeDrawPhaseObserver = null, this._onAfterDrawPhaseObserver = null, this._onBeforeAnimationsObserver = null, this._onBeforeParticlesRenderingObserver = null, this._onAfterParticlesRenderingObserver = null, this._onBeforeSpritesRenderingObserver = null, this._onAfterSpritesRenderingObserver = null, this._onBeforePhysicsObserver = null, this._onAfterPhysicsObserver = null, this._onAfterAnimationsObserver = null, this._onBeforeCameraRenderObserver = null, this._onAfterCameraRenderObserver = null, this._onBeforeAnimationsObserver = e.onBeforeAnimationsObservable.add(function() {
                            t._captureActiveMeshesEvaluationTime && t._activeMeshesEvaluationTime.fetchNewFrame(), t._captureRenderTargetsRenderTime && t._renderTargetsRenderTime.fetchNewFrame(), t._captureFrameTime && (wa.Tools.StartPerformanceCounter("Scene rendering"), t._frameTime.beginMonitoring()), t._captureInterFrameTime && t._interFrameTime.endMonitoring(), t._captureParticlesRenderTime && t._particlesRenderTime.fetchNewFrame(), t._captureSpritesRenderTime && t._spritesRenderTime.fetchNewFrame(), t._captureAnimationsTime && t._animationsTime.beginMonitoring(), t.scene.getEngine()._drawCalls.fetchNewFrame(), t.scene.getEngine()._textureCollisions.fetchNewFrame()
                        }), this._onAfterRenderObserver = e.onAfterRenderObservable.add(function() {
                            t._captureFrameTime && (wa.Tools.EndPerformanceCounter("Scene rendering"), t._frameTime.endMonitoring()), t._captureRenderTime && t._renderTime.endMonitoring(!1), t._captureInterFrameTime && t._interFrameTime.beginMonitoring()
                        })
                    }
                    return Object.defineProperty(e.prototype, "activeMeshesEvaluationTimeCounter", {
                        get: function() {
                            return this._activeMeshesEvaluationTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "captureActiveMeshesEvaluationTime", {
                        get: function() {
                            return this._captureActiveMeshesEvaluationTime
                        },
                        set: function(e) {
                            var t = this;
                            e !== this._captureActiveMeshesEvaluationTime && ((this._captureActiveMeshesEvaluationTime = e) ? (this._onBeforeActiveMeshesEvaluationObserver = this.scene.onBeforeActiveMeshesEvaluationObservable.add(function() {
                                wa.Tools.StartPerformanceCounter("Active meshes evaluation"), t._activeMeshesEvaluationTime.beginMonitoring()
                            }), this._onAfterActiveMeshesEvaluationObserver = this.scene.onAfterActiveMeshesEvaluationObservable.add(function() {
                                wa.Tools.EndPerformanceCounter("Active meshes evaluation"), t._activeMeshesEvaluationTime.endMonitoring()
                            })) : (this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver), this._onBeforeActiveMeshesEvaluationObserver = null, this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver), this._onAfterActiveMeshesEvaluationObserver = null))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "renderTargetsRenderTimeCounter", {
                        get: function() {
                            return this._renderTargetsRenderTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "captureRenderTargetsRenderTime", {
                        get: function() {
                            return this._captureRenderTargetsRenderTime
                        },
                        set: function(e) {
                            var t = this;
                            e !== this._captureRenderTargetsRenderTime && ((this._captureRenderTargetsRenderTime = e) ? (this._onBeforeRenderTargetsRenderObserver = this.scene.onBeforeRenderTargetsRenderObservable.add(function() {
                                wa.Tools.StartPerformanceCounter("Render targets rendering"), t._renderTargetsRenderTime.beginMonitoring()
                            }), this._onAfterRenderTargetsRenderObserver = this.scene.onAfterRenderTargetsRenderObservable.add(function() {
                                wa.Tools.EndPerformanceCounter("Render targets rendering"), t._renderTargetsRenderTime.endMonitoring(!1)
                            })) : (this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver), this._onBeforeRenderTargetsRenderObserver = null, this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver), this._onAfterRenderTargetsRenderObserver = null))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "particlesRenderTimeCounter", {
                        get: function() {
                            return this._particlesRenderTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "captureParticlesRenderTime", {
                        get: function() {
                            return this._captureParticlesRenderTime
                        },
                        set: function(e) {
                            var t = this;
                            e !== this._captureParticlesRenderTime && ((this._captureParticlesRenderTime = e) ? (this._onBeforeParticlesRenderingObserver = this.scene.onBeforeParticlesRenderingObservable.add(function() {
                                wa.Tools.StartPerformanceCounter("Particles"), t._particlesRenderTime.beginMonitoring()
                            }), this._onAfterParticlesRenderingObserver = this.scene.onAfterParticlesRenderingObservable.add(function() {
                                wa.Tools.EndPerformanceCounter("Particles"), t._particlesRenderTime.endMonitoring(!1)
                            })) : (this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver), this._onBeforeParticlesRenderingObserver = null, this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver), this._onAfterParticlesRenderingObserver = null))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "spritesRenderTimeCounter", {
                        get: function() {
                            return this._spritesRenderTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "captureSpritesRenderTime", {
                        get: function() {
                            return this._captureSpritesRenderTime
                        },
                        set: function(e) {
                            var t = this;
                            e !== this._captureSpritesRenderTime && (this._captureSpritesRenderTime = e, this.scene.spriteManagers && (e ? (this._onBeforeSpritesRenderingObserver = this.scene.onBeforeSpritesRenderingObservable.add(function() {
                                wa.Tools.StartPerformanceCounter("Sprites"), t._spritesRenderTime.beginMonitoring()
                            }), this._onAfterSpritesRenderingObserver = this.scene.onAfterSpritesRenderingObservable.add(function() {
                                wa.Tools.EndPerformanceCounter("Sprites"), t._spritesRenderTime.endMonitoring(!1)
                            })) : (this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver), this._onBeforeSpritesRenderingObserver = null, this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver), this._onAfterSpritesRenderingObserver = null)))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "physicsTimeCounter", {
                        get: function() {
                            return this._physicsTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "capturePhysicsTime", {
                        get: function() {
                            return this._capturePhysicsTime
                        },
                        set: function(e) {
                            var t = this;
                            e !== this._capturePhysicsTime && this.scene.onBeforePhysicsObservable && ((this._capturePhysicsTime = e) ? (this._onBeforePhysicsObserver = this.scene.onBeforePhysicsObservable.add(function() {
                                wa.Tools.StartPerformanceCounter("Physics"), t._physicsTime.beginMonitoring()
                            }), this._onAfterPhysicsObserver = this.scene.onAfterPhysicsObservable.add(function() {
                                wa.Tools.EndPerformanceCounter("Physics"), t._physicsTime.endMonitoring()
                            })) : (this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver), this._onBeforePhysicsObserver = null, this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver), this._onAfterPhysicsObserver = null))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "animationsTimeCounter", {
                        get: function() {
                            return this._animationsTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "captureAnimationsTime", {
                        get: function() {
                            return this._captureAnimationsTime
                        },
                        set: function(e) {
                            var t = this;
                            e !== this._captureAnimationsTime && ((this._captureAnimationsTime = e) ? this._onAfterAnimationsObserver = this.scene.onAfterAnimationsObservable.add(function() {
                                t._animationsTime.endMonitoring()
                            }) : (this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver), this._onAfterAnimationsObserver = null))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "frameTimeCounter", {
                        get: function() {
                            return this._frameTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "captureFrameTime", {
                        get: function() {
                            return this._captureFrameTime
                        },
                        set: function(e) {
                            this._captureFrameTime = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "interFrameTimeCounter", {
                        get: function() {
                            return this._interFrameTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "captureInterFrameTime", {
                        get: function() {
                            return this._captureInterFrameTime
                        },
                        set: function(e) {
                            this._captureInterFrameTime = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "renderTimeCounter", {
                        get: function() {
                            return this._renderTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "captureRenderTime", {
                        get: function() {
                            return this._captureRenderTime
                        },
                        set: function(e) {
                            var t = this;
                            e !== this._captureRenderTime && ((this._captureRenderTime = e) ? (this._onBeforeDrawPhaseObserver = this.scene.onBeforeDrawPhaseObservable.add(function() {
                                t._renderTime.beginMonitoring(), wa.Tools.StartPerformanceCounter("Main render")
                            }), this._onAfterDrawPhaseObserver = this.scene.onAfterDrawPhaseObservable.add(function() {
                                t._renderTime.endMonitoring(!1), wa.Tools.EndPerformanceCounter("Main render")
                            })) : (this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver), this._onBeforeDrawPhaseObserver = null, this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver), this._onAfterDrawPhaseObserver = null))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "cameraRenderTimeCounter", {
                        get: function() {
                            return this._cameraRenderTime
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "captureCameraRenderTime", {
                        get: function() {
                            return this._captureCameraRenderTime
                        },
                        set: function(e) {
                            var t = this;
                            e !== this._captureCameraRenderTime && ((this._captureCameraRenderTime = e) ? (this._onBeforeCameraRenderObserver = this.scene.onBeforeCameraRenderObservable.add(function(e) {
                                t._cameraRenderTime.beginMonitoring(), wa.Tools.StartPerformanceCounter("Rendering camera " + e.name)
                            }), this._onAfterCameraRenderObserver = this.scene.onAfterCameraRenderObservable.add(function(e) {
                                t._cameraRenderTime.endMonitoring(!1), wa.Tools.EndPerformanceCounter("Rendering camera " + e.name)
                            })) : (this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = null, this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = null))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "drawCallsCounter", {
                        get: function() {
                            return this.scene.getEngine()._drawCalls
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(e.prototype, "textureCollisionsCounter", {
                        get: function() {
                            return this.scene.getEngine()._textureCollisions
                        },
                        enumerable: !0,
                        configurable: !0
                    }), e.prototype.dispose = function() {
                        this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = null, this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver), this._onBeforeActiveMeshesEvaluationObserver = null, this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver), this._onAfterActiveMeshesEvaluationObserver = null, this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver), this._onBeforeRenderTargetsRenderObserver = null, this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver), this._onAfterRenderTargetsRenderObserver = null, this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver), this._onBeforeAnimationsObserver = null, this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver), this._onBeforeParticlesRenderingObserver = null, this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver), this._onAfterParticlesRenderingObserver = null, this._onBeforeSpritesRenderingObserver && (this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver), this._onBeforeSpritesRenderingObserver = null), this._onAfterSpritesRenderingObserver && (this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver), this._onAfterSpritesRenderingObserver = null), this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver), this._onBeforeDrawPhaseObserver = null, this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver), this._onAfterDrawPhaseObserver = null, this._onBeforePhysicsObserver && (this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver), this._onBeforePhysicsObserver = null), this._onAfterPhysicsObserver && (this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver), this._onAfterPhysicsObserver = null), this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver), this._onAfterAnimationsObserver = null, this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = null, this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = null, this.scene = null
                    }, e
                }(), wa.SceneInstrumentation = Ia, Da = function() {
                    this._timeElapsedQueryEnded = !1
                }, ($a || ($a = {}))._TimeToken = Da, La = $a || ($a = {}), Ba = function(e) {
                    function t() {
                        var t = e.call(this) || this;
                        return t.DIFFUSE = !1, t.DIFFUSEDIRECTUV = 0, t.GAMMADIFFUSE = !1, t.DIFFUSEHASALPHA = !1, t.OPACITYFRESNEL = !1, t.REFLECTIONBLUR = !1, t.REFLECTIONFRESNEL = !1, t.REFLECTIONFALLOFF = !1, t.TEXTURELODSUPPORT = !1, t.PREMULTIPLYALPHA = !1, t.USERGBCOLOR = !1, t.USEHIGHLIGHTANDSHADOWCOLORS = !1, t.NOISE = !1, t.REFLECTIONBGR = !1, t.IMAGEPROCESSING = !1, t.VIGNETTE = !1, t.VIGNETTEBLENDMODEMULTIPLY = !1, t.VIGNETTEBLENDMODEOPAQUE = !1, t.TONEMAPPING = !1, t.TONEMAPPING_ACES = !1, t.CONTRAST = !1, t.COLORCURVES = !1, t.COLORGRADING = !1, t.COLORGRADING3D = !1, t.SAMPLER3DGREENDEPTH = !1, t.SAMPLER3DBGRMAP = !1, t.IMAGEPROCESSINGPOSTPROCESS = !1, t.EXPOSURE = !1, t.REFLECTION = !1, t.REFLECTIONMAP_3D = !1, t.REFLECTIONMAP_SPHERICAL = !1, t.REFLECTIONMAP_PLANAR = !1, t.REFLECTIONMAP_CUBIC = !1, t.REFLECTIONMAP_PROJECTION = !1, t.REFLECTIONMAP_SKYBOX = !1, t.REFLECTIONMAP_SKYBOX_TRANSFORMED = !1, t.REFLECTIONMAP_EXPLICIT = !1, t.REFLECTIONMAP_EQUIRECTANGULAR = !1, t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, t.INVERTCUBICMAP = !1, t.REFLECTIONMAP_OPPOSITEZ = !1, t.LODINREFLECTIONALPHA = !1, t.GAMMAREFLECTION = !1, t.RGBDREFLECTION = !1, t.EQUIRECTANGULAR_RELFECTION_FOV = !1, t.MAINUV1 = !1, t.MAINUV2 = !1, t.UV1 = !1, t.UV2 = !1, t.CLIPPLANE = !1, t.CLIPPLANE2 = !1, t.CLIPPLANE3 = !1, t.CLIPPLANE4 = !1, t.POINTSIZE = !1, t.FOG = !1, t.NORMAL = !1, t.NUM_BONE_INFLUENCERS = 0, t.BonesPerMesh = 0, t.INSTANCES = !1, t.SHADOWFLOAT = !1, t.rebuild(), t
                    }
                    return b(t, e), t
                }(La.MaterialDefines), Fa = function(e) {
                    function t(t, i) {
                        var r = e.call(this, t, i) || this;
                        return r.primaryColor = La.Color3.White(), r._primaryColorShadowLevel = 0, r._primaryColorHighlightLevel = 0, r.reflectionTexture = null, r.reflectionBlur = 0, r.diffuseTexture = null, r._shadowLights = null, r.shadowLights = null, r.shadowLevel = 0, r.sceneCenter = La.Vector3.Zero(), r.opacityFresnel = !0, r.reflectionFresnel = !1, r.reflectionFalloffDistance = 0, r.reflectionAmount = 1, r.reflectionReflectance0 = .05, r.reflectionReflectance90 = .5, r.useRGBColor = !0, r.enableNoise = !1, r._fovMultiplier = 1, r.useEquirectangularFOV = !1, r._maxSimultaneousLights = 4, r.maxSimultaneousLights = 4, r._imageProcessingObserver = null, r.switchToBGR = !1, r._renderTargets = new La.SmartArray(16), r._reflectionControls = La.Vector4.Zero(), r._white = La.Color3.White(), r._primaryShadowColor = La.Color3.Black(), r._primaryHighlightColor = La.Color3.Black(), r._attachImageProcessingConfiguration(null), r.getRenderTargetTextures = function() {
                            return r._renderTargets.reset(), r._diffuseTexture && r._diffuseTexture.isRenderTarget && r._renderTargets.push(r._diffuseTexture), r._reflectionTexture && r._reflectionTexture.isRenderTarget && r._renderTargets.push(r._reflectionTexture), r._renderTargets
                        }, r
                    }
                    return b(t, e), Object.defineProperty(t.prototype, "_perceptualColor", {
                        get: function() {
                            return this.__perceptualColor
                        },
                        set: function(e) {
                            this.__perceptualColor = e, this._computePrimaryColorFromPerceptualColor(), this._markAllSubMeshesAsLightsDirty()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "primaryColorShadowLevel", {
                        get: function() {
                            return this._primaryColorShadowLevel
                        },
                        set: function(e) {
                            this._primaryColorShadowLevel = e, this._computePrimaryColors(), this._markAllSubMeshesAsLightsDirty()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "primaryColorHighlightLevel", {
                        get: function() {
                            return this._primaryColorHighlightLevel
                        },
                        set: function(e) {
                            this._primaryColorHighlightLevel = e, this._computePrimaryColors(), this._markAllSubMeshesAsLightsDirty()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "reflectionStandardFresnelWeight", {
                        set: function(e) {
                            var i = e;
                            i < .5 ? (i *= 2, this.reflectionReflectance0 = t.StandardReflectance0 * i, this.reflectionReflectance90 = t.StandardReflectance90 * i) : (i = 2 * i - 1, this.reflectionReflectance0 = t.StandardReflectance0 + (1 - t.StandardReflectance0) * i, this.reflectionReflectance90 = t.StandardReflectance90 + (1 - t.StandardReflectance90) * i)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "fovMultiplier", {
                        get: function() {
                            return this._fovMultiplier
                        },
                        set: function(e) {
                            isNaN(e) && (e = 1), this._fovMultiplier = Math.max(0, Math.min(2, e))
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype._attachImageProcessingConfiguration = function(e) {
                        var t = this;
                        e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = e || this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function(e) {
                            t._computePrimaryColorFromPerceptualColor(), t._markAllSubMeshesAsImageProcessingDirty()
                        })))
                    }, Object.defineProperty(t.prototype, "imageProcessingConfiguration", {
                        get: function() {
                            return this._imageProcessingConfiguration
                        },
                        set: function(e) {
                            this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty()
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraColorCurvesEnabled", {
                        get: function() {
                            return this.imageProcessingConfiguration.colorCurvesEnabled
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.colorCurvesEnabled = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraColorGradingEnabled", {
                        get: function() {
                            return this.imageProcessingConfiguration.colorGradingEnabled
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.colorGradingEnabled = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraToneMappingEnabled", {
                        get: function() {
                            return this._imageProcessingConfiguration.toneMappingEnabled
                        },
                        set: function(e) {
                            this._imageProcessingConfiguration.toneMappingEnabled = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraExposure", {
                        get: function() {
                            return this._imageProcessingConfiguration.exposure
                        },
                        set: function(e) {
                            this._imageProcessingConfiguration.exposure = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraContrast", {
                        get: function() {
                            return this._imageProcessingConfiguration.contrast
                        },
                        set: function(e) {
                            this._imageProcessingConfiguration.contrast = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraColorGradingTexture", {
                        get: function() {
                            return this._imageProcessingConfiguration.colorGradingTexture
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.colorGradingTexture = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "cameraColorCurves", {
                        get: function() {
                            return this.imageProcessingConfiguration.colorCurves
                        },
                        set: function(e) {
                            this.imageProcessingConfiguration.colorCurves = e
                        },
                        enumerable: !0,
                        configurable: !0
                    }), Object.defineProperty(t.prototype, "hasRenderTargetTextures", {
                        get: function() {
                            return !(!this._diffuseTexture || !this._diffuseTexture.isRenderTarget) || !(!this._reflectionTexture || !this._reflectionTexture.isRenderTarget)
                        },
                        enumerable: !0,
                        configurable: !0
                    }), t.prototype.needAlphaTesting = function() {
                        return !0
                    }, t.prototype.needAlphaBlending = function() {
                        return this.alpha < 0 || null != this._diffuseTexture && this._diffuseTexture.hasAlpha
                    }, t.prototype.isReadyForSubMesh = function(e, t, i) {
                        var r = this;
                        if (void 0 === i && (i = !1), t.effect && this.isFrozen && this._wasPreviouslyReady) return !0;
                        t._materialDefines || (t._materialDefines = new Ba);
                        var n = this.getScene(),
                            o = t._materialDefines;
                        if (!this.checkReadyOnEveryCall && t.effect && o._renderId === n.getRenderId()) return !0;
                        var s = n.getEngine();
                        if (La.MaterialHelper.PrepareDefinesForLights(n, e, o, !1, this._maxSimultaneousLights), o._needNormals = !0, o._areTexturesDirty) {
                            if (o._needUVs = !1, n.texturesEnabled) {
                                if (n.getEngine().getCaps().textureLOD && (o.TEXTURELODSUPPORT = !0), this._diffuseTexture && La.StandardMaterial.DiffuseTextureEnabled) {
                                    if (!this._diffuseTexture.isReadyOrNotBlocking()) return !1;
                                    La.MaterialHelper.PrepareDefinesForMergedUV(this._diffuseTexture, o, "DIFFUSE"), o.DIFFUSEHASALPHA = this._diffuseTexture.hasAlpha, o.GAMMADIFFUSE = this._diffuseTexture.gammaSpace, o.OPACITYFRESNEL = this._opacityFresnel
                                } else o.DIFFUSE = !1, o.DIFFUSEHASALPHA = !1, o.GAMMADIFFUSE = !1, o.OPACITYFRESNEL = !1;
                                var a = this._reflectionTexture;
                                if (a && La.StandardMaterial.ReflectionTextureEnabled) {
                                    if (!a.isReadyOrNotBlocking()) return !1;
                                    switch (o.REFLECTION = !0, o.GAMMAREFLECTION = a.gammaSpace, o.RGBDREFLECTION = a.isRGBD, o.REFLECTIONBLUR = 0 < this._reflectionBlur, o.REFLECTIONMAP_OPPOSITEZ = this.getScene().useRightHandedSystem ? !a.invertZ : a.invertZ, o.LODINREFLECTIONALPHA = a.lodLevelInAlpha, o.EQUIRECTANGULAR_RELFECTION_FOV = this.useEquirectangularFOV, o.REFLECTIONBGR = this.switchToBGR, a.coordinatesMode === La.Texture.INVCUBIC_MODE && (o.INVERTCUBICMAP = !0), o.REFLECTIONMAP_3D = a.isCube, a.coordinatesMode) {
                                        case La.Texture.EXPLICIT_MODE:
                                            o.REFLECTIONMAP_EXPLICIT = !0;
                                            break;
                                        case La.Texture.PLANAR_MODE:
                                            o.REFLECTIONMAP_PLANAR = !0;
                                            break;
                                        case La.Texture.PROJECTION_MODE:
                                            o.REFLECTIONMAP_PROJECTION = !0;
                                            break;
                                        case La.Texture.SKYBOX_MODE:
                                            o.REFLECTIONMAP_SKYBOX = !0, o.REFLECTIONMAP_SKYBOX_TRANSFORMED = !a.getReflectionTextureMatrix().isIdentity();
                                            break;
                                        case La.Texture.SPHERICAL_MODE:
                                            o.REFLECTIONMAP_SPHERICAL = !0;
                                            break;
                                        case La.Texture.EQUIRECTANGULAR_MODE:
                                            o.REFLECTIONMAP_EQUIRECTANGULAR = !0;
                                            break;
                                        case La.Texture.FIXED_EQUIRECTANGULAR_MODE:
                                            o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !0;
                                            break;
                                        case La.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
                                            o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !0;
                                            break;
                                        case La.Texture.CUBIC_MODE:
                                        case La.Texture.INVCUBIC_MODE:
                                        default:
                                            o.REFLECTIONMAP_CUBIC = !0
                                    }
                                    this.reflectionFresnel ? (o.REFLECTIONFRESNEL = !0, o.REFLECTIONFALLOFF = 0 < this.reflectionFalloffDistance, this._reflectionControls.x = this.reflectionAmount, this._reflectionControls.y = this.reflectionReflectance0, this._reflectionControls.z = this.reflectionReflectance90, this._reflectionControls.w = 1 / this.reflectionFalloffDistance) : (o.REFLECTIONFRESNEL = !1, o.REFLECTIONFALLOFF = !1)
                                } else o.REFLECTION = !1, o.REFLECTIONFRESNEL = !1, o.REFLECTIONFALLOFF = !1, o.REFLECTIONBLUR = !1, o.REFLECTIONMAP_3D = !1, o.REFLECTIONMAP_SPHERICAL = !1, o.REFLECTIONMAP_PLANAR = !1, o.REFLECTIONMAP_CUBIC = !1, o.REFLECTIONMAP_PROJECTION = !1, o.REFLECTIONMAP_SKYBOX = !1, o.REFLECTIONMAP_SKYBOX_TRANSFORMED = !1, o.REFLECTIONMAP_EXPLICIT = !1, o.REFLECTIONMAP_EQUIRECTANGULAR = !1, o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, o.INVERTCUBICMAP = !1, o.REFLECTIONMAP_OPPOSITEZ = !1, o.LODINREFLECTIONALPHA = !1, o.GAMMAREFLECTION = !1, o.RGBDREFLECTION = !1
                            }
                            o.PREMULTIPLYALPHA = this.alphaMode === La.Engine.ALPHA_PREMULTIPLIED || this.alphaMode === La.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF, o.USERGBCOLOR = this._useRGBColor, o.NOISE = this._enableNoise
                        }
                        if (o._areLightsDirty && (o.USEHIGHLIGHTANDSHADOWCOLORS = !this._useRGBColor && (0 !== this._primaryColorShadowLevel || 0 !== this._primaryColorHighlightLevel)), o._areImageProcessingDirty && this._imageProcessingConfiguration) {
                            if (!this._imageProcessingConfiguration.isReady()) return !1;
                            this._imageProcessingConfiguration.prepareDefines(o)
                        }
                        if (La.MaterialHelper.PrepareDefinesForMisc(e, n, !1, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), o), La.MaterialHelper.PrepareDefinesForFrameBoundValues(n, s, o, i), La.MaterialHelper.PrepareDefinesForAttributes(e, o, !1, !0, !1) && e && (n.getEngine().getCaps().standardDerivatives || e.isVerticesDataPresent(La.VertexBuffer.NormalKind) || (e.createNormals(!0), La.Tools.Warn("BackgroundMaterial: Normals have been created for the mesh: " + e.name))), o.isDirty) {
                            o.markAsProcessed(), n.resetCachedMaterial();
                            var l = new La.EffectFallbacks;
                            o.FOG && l.addFallback(0, "FOG"), o.POINTSIZE && l.addFallback(1, "POINTSIZE"), La.MaterialHelper.HandleFallbacksForShadows(o, l, this._maxSimultaneousLights), 0 < o.NUM_BONE_INFLUENCERS && l.addCPUSkinningFallback(0, e);
                            var u = [La.VertexBuffer.PositionKind];
                            o.NORMAL && u.push(La.VertexBuffer.NormalKind), o.UV1 && u.push(La.VertexBuffer.UVKind), o.UV2 && u.push(La.VertexBuffer.UV2Kind), La.MaterialHelper.PrepareAttributesForBones(u, e, o, l), La.MaterialHelper.PrepareAttributesForInstances(u, o);
                            var c = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vFogInfos", "vFogColor", "pointSize", "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "mBones", "vPrimaryColor", "vPrimaryColorShadow", "vReflectionInfos", "reflectionMatrix", "vReflectionMicrosurfaceInfos", "fFovMultiplier", "shadowLevel", "alpha", "vBackgroundCenter", "vReflectionControl", "vDiffuseInfos", "diffuseMatrix"],
                                h = ["diffuseSampler", "reflectionSampler", "reflectionSamplerLow", "reflectionSamplerHigh"],
                                d = ["Material", "Scene"];
                            La.ImageProcessingConfiguration && (La.ImageProcessingConfiguration.PrepareUniforms(c, o), La.ImageProcessingConfiguration.PrepareSamplers(h, o)), La.MaterialHelper.PrepareUniformsAndSamplersList({
                                uniformsNames: c,
                                uniformBuffersNames: d,
                                samplers: h,
                                defines: o,
                                maxSimultaneousLights: this._maxSimultaneousLights
                            });
                            var p = o.toString();
                            t.setEffect(n.getEngine().createEffect("background", {
                                attributes: u,
                                uniformsNames: c,
                                uniformBuffersNames: d,
                                samplers: h,
                                defines: p,
                                fallbacks: l,
                                onCompiled: function(e) {
                                    r.onCompiled && r.onCompiled(e), r.bindSceneUniformBuffer(e, n.getSceneUniformBuffer())
                                },
                                onError: this.onError,
                                indexParameters: {
                                    maxSimultaneousLights: this._maxSimultaneousLights
                                }
                            }, s), o), this.buildUniformLayout()
                        }
                        return !(!t.effect || !t.effect.isReady()) && (o._renderId = n.getRenderId(), this._wasPreviouslyReady = !0)
                    }, t.prototype._computePrimaryColorFromPerceptualColor = function() {
                        this.__perceptualColor && (this._primaryColor.copyFrom(this.__perceptualColor), this._primaryColor.toLinearSpaceToRef(this._primaryColor), this._imageProcessingConfiguration && this._primaryColor.scaleToRef(1 / this._imageProcessingConfiguration.exposure, this._primaryColor), this._computePrimaryColors())
                    }, t.prototype._computePrimaryColors = function() {
                        0 === this._primaryColorShadowLevel && 0 === this._primaryColorHighlightLevel || (this._primaryColor.scaleToRef(this._primaryColorShadowLevel, this._primaryShadowColor), this._primaryColor.subtractToRef(this._primaryShadowColor, this._primaryShadowColor), this._white.subtractToRef(this._primaryColor, this._primaryHighlightColor), this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel, this._primaryHighlightColor), this._primaryColor.addToRef(this._primaryHighlightColor, this._primaryHighlightColor))
                    }, t.prototype.buildUniformLayout = function() {
                        this._uniformBuffer.addUniform("vPrimaryColor", 4), this._uniformBuffer.addUniform("vPrimaryColorShadow", 4), this._uniformBuffer.addUniform("vDiffuseInfos", 2), this._uniformBuffer.addUniform("vReflectionInfos", 2), this._uniformBuffer.addUniform("diffuseMatrix", 16), this._uniformBuffer.addUniform("reflectionMatrix", 16), this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos", 3), this._uniformBuffer.addUniform("fFovMultiplier", 1), this._uniformBuffer.addUniform("pointSize", 1), this._uniformBuffer.addUniform("shadowLevel", 1), this._uniformBuffer.addUniform("alpha", 1), this._uniformBuffer.addUniform("vBackgroundCenter", 3), this._uniformBuffer.addUniform("vReflectionControl", 4), this._uniformBuffer.create()
                    }, t.prototype.unbind = function() {
                        this._diffuseTexture && this._diffuseTexture.isRenderTarget && this._uniformBuffer.setTexture("diffuseSampler", null), this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._uniformBuffer.setTexture("reflectionSampler", null), e.prototype.unbind.call(this)
                    }, t.prototype.bindOnlyWorldMatrix = function(e) {
                        this._activeEffect.setMatrix("world", e)
                    }, t.prototype.bindForSubMesh = function(e, t, i) {
                        var r = this.getScene(),
                            n = i._materialDefines;
                        if (n) {
                            var o = i.effect;
                            if (o) {
                                this._activeEffect = o, this.bindOnlyWorldMatrix(e), La.MaterialHelper.BindBonesParameters(t, this._activeEffect);
                                var s = this._mustRebind(r, o, t.visibility);
                                if (s) {
                                    this._uniformBuffer.bindToEffect(o, "Material"), this.bindViewProjection(o);
                                    var a = this._reflectionTexture;
                                    this._uniformBuffer.useUbo && this.isFrozen && this._uniformBuffer.isSync || (r.texturesEnabled && (this._diffuseTexture && La.StandardMaterial.DiffuseTextureEnabled && (this._uniformBuffer.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), La.MaterialHelper.BindTextureMatrix(this._diffuseTexture, this._uniformBuffer, "diffuse")), a && La.StandardMaterial.ReflectionTextureEnabled && (this._uniformBuffer.updateMatrix("reflectionMatrix", a.getReflectionTextureMatrix()), this._uniformBuffer.updateFloat2("vReflectionInfos", a.level, this._reflectionBlur), this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos", a.getSize().width, a.lodGenerationScale, a.lodGenerationOffset))), 0 < this.shadowLevel && this._uniformBuffer.updateFloat("shadowLevel", this.shadowLevel), this._uniformBuffer.updateFloat("alpha", this.alpha), this.pointsCloud && this._uniformBuffer.updateFloat("pointSize", this.pointSize), n.USEHIGHLIGHTANDSHADOWCOLORS ? (this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryHighlightColor, 1), this._uniformBuffer.updateColor4("vPrimaryColorShadow", this._primaryShadowColor, 1)) : this._uniformBuffer.updateColor4("vPrimaryColor", this._primaryColor, 1)), this._uniformBuffer.updateFloat("fFovMultiplier", this._fovMultiplier), r.texturesEnabled && (this._diffuseTexture && La.StandardMaterial.DiffuseTextureEnabled && this._uniformBuffer.setTexture("diffuseSampler", this._diffuseTexture), a && La.StandardMaterial.ReflectionTextureEnabled && (n.REFLECTIONBLUR && n.TEXTURELODSUPPORT ? this._uniformBuffer.setTexture("reflectionSampler", a) : n.REFLECTIONBLUR ? (this._uniformBuffer.setTexture("reflectionSampler", a._lodTextureMid || a), this._uniformBuffer.setTexture("reflectionSamplerLow", a._lodTextureLow || a), this._uniformBuffer.setTexture("reflectionSamplerHigh", a._lodTextureHigh || a)) : this._uniformBuffer.setTexture("reflectionSampler", a), n.REFLECTIONFRESNEL && (this._uniformBuffer.updateFloat3("vBackgroundCenter", this.sceneCenter.x, this.sceneCenter.y, this.sceneCenter.z), this._uniformBuffer.updateFloat4("vReflectionControl", this._reflectionControls.x, this._reflectionControls.y, this._reflectionControls.z, this._reflectionControls.w)))), La.MaterialHelper.BindClipPlane(this._activeEffect, r), La.MaterialHelper.BindEyePosition(o, r)
                                }!s && this.isFrozen || (r.lightsEnabled && La.MaterialHelper.BindLights(r, t, this._activeEffect, n, this._maxSimultaneousLights, !1), this.bindView(o), La.MaterialHelper.BindFogParameters(r, t, this._activeEffect, !0), this._imageProcessingConfiguration && this._imageProcessingConfiguration.bind(this._activeEffect)), this._uniformBuffer.update(), this._afterBind(t, this._activeEffect)
                            }
                        }
                    }, t.prototype.dispose = function(t, i) {
                        void 0 === t && (t = !1), void 0 === i && (i = !1), i && (this.diffuseTexture && this.diffuseTexture.dispose(), this.reflectionTexture && this.reflectionTexture.dispose()), this._renderTargets.dispose(), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), e.prototype.dispose.call(this, t)
                    }, t.prototype.clone = function(e) {
                        var i = this;
                        return La.SerializationHelper.Clone(function() {
                            return new t(e, i.getScene())
                        }, this)
                    }, t.prototype.serialize = function() {
                        var e = La.SerializationHelper.Serialize(this);
                        return e.customType = "BABYLON.BackgroundMaterial", e
                    }, t.prototype.getClassName = function() {
                        return "BackgroundMaterial"
                    }, t.Parse = function(e, i, r) {
                        return La.SerializationHelper.Parse(function() {
                            return new t(e.name, i)
                        }, e, i, r)
                    }, t.StandardReflectance0 = .05, t.StandardReflectance90 = .5, y([La.serializeAsColor3()], t.prototype, "_primaryColor", void 0), y([La.expandToProperty("_markAllSubMeshesAsLightsDirty")], t.prototype, "primaryColor", void 0), y([La.serializeAsColor3()], t.prototype, "__perceptualColor", void 0), y([La.serialize()], t.prototype, "_primaryColorShadowLevel", void 0), y([La.serialize()], t.prototype, "_primaryColorHighlightLevel", void 0), y([La.expandToProperty("_markAllSubMeshesAsLightsDirty")], t.prototype, "primaryColorHighlightLevel", null), y([La.serializeAsTexture()], t.prototype, "_reflectionTexture", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "reflectionTexture", void 0), y([La.serialize()], t.prototype, "_reflectionBlur", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "reflectionBlur", void 0), y([La.serializeAsTexture()], t.prototype, "_diffuseTexture", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "diffuseTexture", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "shadowLights", void 0), y([La.serialize()], t.prototype, "_shadowLevel", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "shadowLevel", void 0), y([La.serializeAsVector3()], t.prototype, "_sceneCenter", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "sceneCenter", void 0), y([La.serialize()], t.prototype, "_opacityFresnel", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "opacityFresnel", void 0), y([La.serialize()], t.prototype, "_reflectionFresnel", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "reflectionFresnel", void 0), y([La.serialize()], t.prototype, "_reflectionFalloffDistance", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "reflectionFalloffDistance", void 0), y([La.serialize()], t.prototype, "_reflectionAmount", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "reflectionAmount", void 0), y([La.serialize()], t.prototype, "_reflectionReflectance0", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "reflectionReflectance0", void 0), y([La.serialize()], t.prototype, "_reflectionReflectance90", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "reflectionReflectance90", void 0), y([La.serialize()], t.prototype, "_useRGBColor", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "useRGBColor", void 0), y([La.serialize()], t.prototype, "_enableNoise", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "enableNoise", void 0), y([La.serialize()], t.prototype, "_maxSimultaneousLights", void 0), y([La.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t.prototype, "maxSimultaneousLights", void 0), y([La.serializeAsImageProcessingConfiguration()], t.prototype, "_imageProcessingConfiguration", void 0), t
                }(La.PushMaterial), La.BackgroundMaterial = Fa;
            var Na, Va, ka, Ua, Ga, za, ja, Ha, Wa, Xa, Ya, qa, Ka, Qa;
            ae = this && this.__assign || function() {
                return (ae = Object.assign || function(e) {
                    for (var t, i = 1, r = arguments.length; i < r; i++)
                        for (var n in t = arguments[i]) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
                    return e
                }).apply(this, arguments)
            }, Na = $a || ($a = {}), Va = function() {
                function e(t, i) {
                    var r = this;
                    this._errorHandler = function(e, t) {
                        r.onErrorObservable.notifyObservers({
                            message: e,
                            exception: t
                        })
                    }, this._options = ae({}, e._getDefaultOptions(), t), this._scene = i, this.onErrorObservable = new Na.Observable, this._setupBackground(), this._setupImageProcessing()
                }
                return e._getDefaultOptions = function() {
                    return {
                        createGround: !0,
                        groundSize: 15,
                        groundTexture: this._groundTextureCDNUrl,
                        groundColor: new Na.Color3(.2, .2, .3).toLinearSpace().scale(3),
                        groundOpacity: .9,
                        enableGroundShadow: !0,
                        groundShadowLevel: .5,
                        enableGroundMirror: !1,
                        groundMirrorSizeRatio: .3,
                        groundMirrorBlurKernel: 64,
                        groundMirrorAmount: 1,
                        groundMirrorFresnelWeight: 1,
                        groundMirrorFallOffDistance: 0,
                        groundMirrorTextureType: Na.Engine.TEXTURETYPE_UNSIGNED_INT,
                        groundYBias: 1e-5,
                        createSkybox: !0,
                        skyboxSize: 20,
                        skyboxTexture: this._skyboxTextureCDNUrl,
                        skyboxColor: new Na.Color3(.2, .2, .3).toLinearSpace().scale(3),
                        backgroundYRotation: 0,
                        sizeAuto: !0,
                        rootPosition: Na.Vector3.Zero(),
                        setupImageProcessing: !0,
                        environmentTexture: this._environmentTextureCDNUrl,
                        cameraExposure: .8,
                        cameraContrast: 1.2,
                        toneMappingEnabled: !0
                    }
                }, Object.defineProperty(e.prototype, "rootMesh", {
                    get: function() {
                        return this._rootMesh
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(e.prototype, "skybox", {
                    get: function() {
                        return this._skybox
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(e.prototype, "skyboxTexture", {
                    get: function() {
                        return this._skyboxTexture
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(e.prototype, "skyboxMaterial", {
                    get: function() {
                        return this._skyboxMaterial
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(e.prototype, "ground", {
                    get: function() {
                        return this._ground
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(e.prototype, "groundTexture", {
                    get: function() {
                        return this._groundTexture
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(e.prototype, "groundMirror", {
                    get: function() {
                        return this._groundMirror
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(e.prototype, "groundMirrorRenderList", {
                    get: function() {
                        return this._groundMirror ? this._groundMirror.renderList : null
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(e.prototype, "groundMaterial", {
                    get: function() {
                        return this._groundMaterial
                    },
                    enumerable: !0,
                    configurable: !0
                }), e.prototype.updateOptions = function(e) {
                    var t = ae({}, this._options, e);
                    this._ground && !t.createGround && (this._ground.dispose(), this._ground = null), this._groundMaterial && !t.createGround && (this._groundMaterial.dispose(), this._groundMaterial = null), this._groundTexture && this._options.groundTexture != t.groundTexture && (this._groundTexture.dispose(), this._groundTexture = null), this._skybox && !t.createSkybox && (this._skybox.dispose(), this._skybox = null), this._skyboxMaterial && !t.createSkybox && (this._skyboxMaterial.dispose(), this._skyboxMaterial = null), this._skyboxTexture && this._options.skyboxTexture != t.skyboxTexture && (this._skyboxTexture.dispose(), this._skyboxTexture = null), this._groundMirror && !t.enableGroundMirror && (this._groundMirror.dispose(), this._groundMirror = null), this._scene.environmentTexture && this._options.environmentTexture != t.environmentTexture && this._scene.environmentTexture.dispose(), this._options = t, this._setupBackground(), this._setupImageProcessing()
                }, e.prototype.setMainColor = function(e) {
                    this.groundMaterial && (this.groundMaterial.primaryColor = e),
                        this.skyboxMaterial && (this.skyboxMaterial.primaryColor = e), this.groundMirror && (this.groundMirror.clearColor = new Na.Color4(e.r, e.g, e.b, 1))
                }, e.prototype._setupImageProcessing = function() {
                    this._options.setupImageProcessing && (this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast, this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure, this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled, this._setupEnvironmentTexture())
                }, e.prototype._setupEnvironmentTexture = function() {
                    if (!this._scene.environmentTexture)
                        if (this._options.environmentTexture instanceof Na.BaseTexture) this._scene.environmentTexture = this._options.environmentTexture;
                        else {
                            var e = Na.CubeTexture.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);
                            this._scene.environmentTexture = e
                        }
                }, e.prototype._setupBackground = function() {
                    this._rootMesh || (this._rootMesh = new Na.Mesh("BackgroundHelper", this._scene)), this._rootMesh.rotation.y = this._options.backgroundYRotation;
                    var e = this._getSceneSize();
                    this._options.createGround && (this._setupGround(e), this._setupGroundMaterial(), this._setupGroundDiffuseTexture(), this._options.enableGroundMirror && this._setupGroundMirrorTexture(e), this._setupMirrorInGroundMaterial()), this._options.createSkybox && (this._setupSkybox(e), this._setupSkyboxMaterial(), this._setupSkyboxReflectionTexture()), this._rootMesh.position.x = e.rootPosition.x, this._rootMesh.position.z = e.rootPosition.z, this._rootMesh.position.y = e.rootPosition.y
                }, e.prototype._getSceneSize = function() {
                    var e = this,
                        t = this._options.groundSize,
                        i = this._options.skyboxSize,
                        r = this._options.rootPosition;
                    if (!this._scene.meshes || 1 === this._scene.meshes.length) return {
                        groundSize: t,
                        skyboxSize: i,
                        rootPosition: r
                    };
                    var n = this._scene.getWorldExtends(function(t) {
                            return t !== e._ground && t !== e._rootMesh && t !== e._skybox
                        }),
                        o = n.max.subtract(n.min);
                    if (this._options.sizeAuto) {
                        this._scene.activeCamera instanceof Na.ArcRotateCamera && this._scene.activeCamera.upperRadiusLimit && (i = t = 2 * this._scene.activeCamera.upperRadiusLimit);
                        var s = o.length();
                        t < s && (i = t = 2 * s), t *= 1.1, i *= 1.5, (r = n.min.add(o.scale(.5))).y = n.min.y - this._options.groundYBias
                    }
                    return {
                        groundSize: t,
                        skyboxSize: i,
                        rootPosition: r
                    }
                }, e.prototype._setupGround = function(e) {
                    var t = this;
                    this._ground && !this._ground.isDisposed() || (this._ground = Na.Mesh.CreatePlane("BackgroundPlane", e.groundSize, this._scene), this._ground.rotation.x = Math.PI / 2, this._ground.parent = this._rootMesh, this._ground.onDisposeObservable.add(function() {
                        t._ground = null
                    })), this._ground.receiveShadows = this._options.enableGroundShadow
                }, e.prototype._setupGroundMaterial = function() {
                    this._groundMaterial || (this._groundMaterial = new Na.BackgroundMaterial("BackgroundPlaneMaterial", this._scene)), this._groundMaterial.alpha = this._options.groundOpacity, this._groundMaterial.alphaMode = Na.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF, this._groundMaterial.shadowLevel = this._options.groundShadowLevel, this._groundMaterial.primaryColor = this._options.groundColor, this._groundMaterial.useRGBColor = !1, this._groundMaterial.enableNoise = !0, this._ground && (this._ground.material = this._groundMaterial)
                }, e.prototype._setupGroundDiffuseTexture = function() {
                    if (this._groundMaterial && !this._groundTexture)
                        if (this._options.groundTexture instanceof Na.BaseTexture) this._groundMaterial.diffuseTexture = this._options.groundTexture;
                        else {
                            var e = new Na.Texture(this._options.groundTexture, this._scene, void 0, void 0, void 0, void 0, this._errorHandler);
                            e.gammaSpace = !1, e.hasAlpha = !0, this._groundMaterial.diffuseTexture = e
                        }
                }, e.prototype._setupGroundMirrorTexture = function(e) {
                    var t = Na.Texture.CLAMP_ADDRESSMODE;
                    if (!this._groundMirror && (this._groundMirror = new Na.MirrorTexture("BackgroundPlaneMirrorTexture", {
                            ratio: this._options.groundMirrorSizeRatio
                        }, this._scene, !1, this._options.groundMirrorTextureType, Na.Texture.BILINEAR_SAMPLINGMODE, !0), this._groundMirror.mirrorPlane = new Na.Plane(0, -1, 0, e.rootPosition.y), this._groundMirror.anisotropicFilteringLevel = 1, this._groundMirror.wrapU = t, this._groundMirror.wrapV = t, this._groundMirror.gammaSpace = !1, this._groundMirror.renderList))
                        for (var i = 0; i < this._scene.meshes.length; i++) {
                            var r = this._scene.meshes[i];
                            r !== this._ground && r !== this._skybox && r !== this._rootMesh && this._groundMirror.renderList.push(r)
                        }
                    this._groundMirror.clearColor = new Na.Color4(this._options.groundColor.r, this._options.groundColor.g, this._options.groundColor.b, 1), this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel
                }, e.prototype._setupMirrorInGroundMaterial = function() {
                    this._groundMaterial && (this._groundMaterial.reflectionTexture = this._groundMirror, this._groundMaterial.reflectionFresnel = !0, this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount, this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight, this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance)
                }, e.prototype._setupSkybox = function(e) {
                    var t = this;
                    this._skybox && !this._skybox.isDisposed() || (this._skybox = Na.Mesh.CreateBox("BackgroundSkybox", e.skyboxSize, this._scene, void 0, Na.Mesh.BACKSIDE), this._skybox.onDisposeObservable.add(function() {
                        t._skybox = null
                    })), this._skybox.parent = this._rootMesh
                }, e.prototype._setupSkyboxMaterial = function() {
                    this._skybox && (this._skyboxMaterial || (this._skyboxMaterial = new Na.BackgroundMaterial("BackgroundSkyboxMaterial", this._scene)), this._skyboxMaterial.useRGBColor = !1, this._skyboxMaterial.primaryColor = this._options.skyboxColor, this._skyboxMaterial.enableNoise = !0, this._skybox.material = this._skyboxMaterial)
                }, e.prototype._setupSkyboxReflectionTexture = function() {
                    this._skyboxMaterial && (this._skyboxTexture || (this._options.skyboxTexture instanceof Na.BaseTexture ? this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture : (this._skyboxTexture = new Na.CubeTexture(this._options.skyboxTexture, this._scene, void 0, void 0, void 0, void 0, this._errorHandler), this._skyboxTexture.coordinatesMode = Na.Texture.SKYBOX_MODE, this._skyboxTexture.gammaSpace = !1, this._skyboxMaterial.reflectionTexture = this._skyboxTexture)))
                }, e.prototype.dispose = function() {
                    this._groundMaterial && this._groundMaterial.dispose(!0, !0), this._skyboxMaterial && this._skyboxMaterial.dispose(!0, !0), this._rootMesh.dispose(!1)
                }, e._groundTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundGround.png", e._skyboxTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundSkybox.dds", e._environmentTextureCDNUrl = "https://assets.babylonjs.com/environments/environmentSpecular.env", e
            }(), Na.EnvironmentHelper = Va, ka = $a || ($a = {}), Ua = function() {
                function e() {
                    this.systems = new Array
                }
                return Object.defineProperty(e.prototype, "emitterNode", {
                    get: function() {
                        return this._emitterNode
                    },
                    enumerable: !0,
                    configurable: !0
                }), e.prototype.setEmitterAsSphere = function(e, t, i) {
                    this._emitterNode && this._emitterNode.dispose(), this._emitterCreationOptions = {
                        kind: "Sphere",
                        options: e,
                        renderingGroupId: t
                    };
                    var r = ka.MeshBuilder.CreateSphere("emitterSphere", {
                        diameter: e.diameter,
                        segments: e.segments
                    }, i);
                    r.renderingGroupId = t;
                    var n = new ka.StandardMaterial("emitterSphereMaterial", i);
                    n.emissiveColor = e.color, r.material = n;
                    for (var o = 0, s = this.systems; o < s.length; o++) s[o].emitter = r;
                    this._emitterNode = r
                }, e.prototype.start = function(e) {
                    for (var t = 0, i = this.systems; t < i.length; t++) {
                        var r = i[t];
                        e && (r.emitter = e), r.start()
                    }
                }, e.prototype.dispose = function() {
                    for (var e = 0, t = this.systems; e < t.length; e++) t[e].dispose();
                    this.systems = [], this._emitterNode && (this._emitterNode.dispose(), this._emitterNode = null)
                }, e.prototype.serialize = function() {
                    for (var e = {
                            systems: []
                        }, t = 0, i = this.systems; t < i.length; t++) {
                        var r = i[t];
                        e.systems.push(r.serialize())
                    }
                    return this._emitterNode && (e.emitter = this._emitterCreationOptions), e
                }, e.Parse = function(t, i, r) {
                    void 0 === r && (r = !1);
                    var n = new e,
                        o = ka.ParticleHelper.BaseAssetsUrl + "/textures/";
                    i = i || ka.Engine.LastCreatedScene;
                    for (var s = 0, a = t.systems; s < a.length; s++) {
                        var l = a[s];
                        n.systems.push(r ? ka.GPUParticleSystem.Parse(l, i, o, !0) : ka.ParticleSystem.Parse(l, i, o, !0))
                    }
                    if (t.emitter) {
                        var u = t.emitter.options;
                        switch (t.emitter.kind) {
                            case "Sphere":
                                n.setEmitterAsSphere({
                                    diameter: u.diameter,
                                    segments: u.segments,
                                    color: ka.Color3.FromArray(u.color)
                                }, t.emitter.renderingGroupId, i)
                        }
                    }
                    return n
                }, e
            }(), ka.ParticleSystemSet = Ua, Ga = $a || ($a = {}), za = function() {
                function e() {}
                return e.CreateDefault = function(e, t, i, r) {
                    var n;
                    return void 0 === t && (t = 500), void 0 === r && (r = !1), (n = r ? new Ga.GPUParticleSystem("default system", {
                        capacity: t
                    }, i) : new Ga.ParticleSystem("default system", t, i)).emitter = e, n.particleTexture = new Ga.Texture("https://www.babylonjs.com/assets/Flare.png", n.getScene()), n.createConeEmitter(.1, Math.PI / 4), n.color1 = new Ga.Color4(1, 1, 1, 1), n.color2 = new Ga.Color4(1, 1, 1, 1), n.colorDead = new Ga.Color4(1, 1, 1, 0), n.minSize = .1, n.maxSize = .1, n.minEmitPower = 2, n.maxEmitPower = 2, n.updateSpeed = 1 / 60, n.emitRate = 30, n
                }, e.CreateAsync = function(t, i, r) {
                    void 0 === r && (r = !1), i || (i = Ga.Engine.LastCreatedScene);
                    var n = {};
                    return i._addPendingData(n), new Promise(function(o, s) {
                        if (r && !Ga.GPUParticleSystem.IsSupported) return i._removePendingData(n), s("Particle system with GPU is not supported.");
                        Ga.Tools.LoadFile(e.BaseAssetsUrl + "/systems/" + t + ".json", function(e, t) {
                            i._removePendingData(n);
                            var s = JSON.parse(e.toString());
                            return o(Ga.ParticleSystemSet.Parse(s, i, r))
                        }, void 0, void 0, void 0, function(e, r) {
                            return i._removePendingData(n), s("An error occured while the creation of your particle system. Check if your type '" + t + "' exists.")
                        })
                    })
                }, e.ExportSet = function(e) {
                    for (var t = new Ga.ParticleSystemSet, i = 0, r = e; i < r.length; i++) {
                        var n = r[i];
                        t.systems.push(n)
                    }
                    return t
                }, e.BaseAssetsUrl = "https://assets.babylonjs.com/particles", e
            }(), Ga.ParticleHelper = za, ja = $a || ($a = {}), Ha = function(e) {
                function t(t, i, r, n) {
                    var o = e.call(this, t, n) || this;
                    o._useDirectMapping = !1, t = t || "videoDome", r.resolution = 0 | Math.abs(r.resolution) || 32, r.clickToPlay = Boolean(r.clickToPlay), r.autoPlay = void 0 === r.autoPlay || Boolean(r.autoPlay), r.loop = void 0 === r.loop || Boolean(r.loop), r.size = Math.abs(r.size) || (n.activeCamera ? .48 * n.activeCamera.maxZ : 1e3), void 0 === r.useDirectMapping ? o._useDirectMapping = !0 : o._useDirectMapping = r.useDirectMapping, o._setReady(!1);
                    var s = {
                            loop: r.loop,
                            autoPlay: r.autoPlay,
                            autoUpdateTexture: !0,
                            poster: r.poster
                        },
                        a = o._material = new ja.BackgroundMaterial(t + "_material", n),
                        l = o._videoTexture = new ja.VideoTexture(t + "_texture", i, n, !1, o._useDirectMapping, ja.Texture.TRILINEAR_SAMPLINGMODE, s);
                    return o._mesh = ja.Mesh.CreateSphere(t + "_mesh", r.resolution, r.size, n, !1, ja.Mesh.BACKSIDE), l.onLoadObservable.addOnce(function() {
                        o._setReady(!0)
                    }), a.useEquirectangularFOV = !0, a.fovMultiplier = 1, a.opacityFresnel = !1, o._useDirectMapping ? (l.wrapU = ja.Texture.CLAMP_ADDRESSMODE, l.wrapV = ja.Texture.CLAMP_ADDRESSMODE, a.diffuseTexture = l) : (l.coordinatesMode = ja.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE, l.wrapV = ja.Texture.CLAMP_ADDRESSMODE, a.reflectionTexture = l), o._mesh.material = a, o._mesh.parent = o, r.clickToPlay && (n.onPointerUp = function() {
                        o._videoTexture.video.play()
                    }), o
                }
                return b(t, e), Object.defineProperty(t.prototype, "videoTexture", {
                    get: function() {
                        return this._videoTexture
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(t.prototype, "fovMultiplier", {
                    get: function() {
                        return this._material.fovMultiplier
                    },
                    set: function(e) {
                        this._material.fovMultiplier = e
                    },
                    enumerable: !0,
                    configurable: !0
                }), t.prototype.dispose = function(t, i) {
                    void 0 === i && (i = !1), this._videoTexture.dispose(), this._mesh.dispose(), this._material.dispose(), e.prototype.dispose.call(this, t, i)
                }, t
            }(ja.TransformNode), ja.VideoDome = Ha, Wa = $a || ($a = {}), Xa = function(e) {
                function t(t, i, r, n, o) {
                    void 0 === o && (o = null);
                    var s = e.call(this, t, n) || this;
                    s._useDirectMapping = !1, s.onLoadErrorObservable = new Wa.Observable, t = t || "photoDome", r.resolution = 0 | Math.abs(r.resolution) || 32, r.size = Math.abs(r.size) || (n.activeCamera ? .48 * n.activeCamera.maxZ : 1e3), void 0 === r.useDirectMapping ? s._useDirectMapping = !0 : s._useDirectMapping = r.useDirectMapping, s._setReady(!1);
                    var a = s._material = new Wa.BackgroundMaterial(t + "_material", n);
                    return s._mesh = Wa.Mesh.CreateSphere(t + "_mesh", r.resolution, r.size, n, !1, Wa.Mesh.BACKSIDE), a.opacityFresnel = !1, a.useEquirectangularFOV = !0, a.fovMultiplier = 1, s.photoTexture = new Wa.Texture(i, n, !0, !s._useDirectMapping, void 0, void 0, function(e, t) {
                        s.onLoadErrorObservable.notifyObservers(e || "Unknown error occured"), o && o(e, t)
                    }), s.photoTexture.onLoadObservable.addOnce(function() {
                        s._setReady(!0)
                    }), s._mesh.material = a, s._mesh.parent = s
                }
                return b(t, e), Object.defineProperty(t.prototype, "photoTexture", {
                    get: function() {
                        return this._photoTexture
                    },
                    set: function(e) {
                        this._photoTexture !== e && (this._photoTexture = e, this._useDirectMapping ? (this._photoTexture.wrapU = Wa.Texture.CLAMP_ADDRESSMODE, this._photoTexture.wrapV = Wa.Texture.CLAMP_ADDRESSMODE, this._material.diffuseTexture = this._photoTexture) : (this._photoTexture.coordinatesMode = Wa.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE, this._photoTexture.wrapV = Wa.Texture.CLAMP_ADDRESSMODE, this._material.reflectionTexture = this._photoTexture))
                    },
                    enumerable: !0,
                    configurable: !0
                }), Object.defineProperty(t.prototype, "fovMultiplier", {
                    get: function() {
                        return this._material.fovMultiplier
                    },
                    set: function(e) {
                        this._material.fovMultiplier = e
                    },
                    enumerable: !0,
                    configurable: !0
                }), t.prototype.dispose = function(t, i) {
                    void 0 === i && (i = !1), this._photoTexture.dispose(), this._mesh.dispose(), this._material.dispose(), this.onLoadErrorObservable.clear(), e.prototype.dispose.call(this, t, i)
                }, t
            }(Wa.TransformNode), Wa.PhotoDome = Xa, Ya = $a || ($a = {}), qa = function() {
                this.occlusionInternalRetryCounter = 0, this.isOcclusionQueryInProgress = !1, this.isOccluded = !1, this.occlusionRetryCount = -1, this.occlusionType = Ya.AbstractMesh.OCCLUSION_TYPE_NONE, this.occlusionQueryAlgorithmType = Ya.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE
            }, Ya.Engine.prototype.createQuery = function() {
                return this._gl.createQuery()
            }, Ya.Engine.prototype.deleteQuery = function(e) {
                return this._gl.deleteQuery(e), this
            }, Ya.Engine.prototype.isQueryResultAvailable = function(e) {
                return this._gl.getQueryParameter(e, this._gl.QUERY_RESULT_AVAILABLE)
            }, Ya.Engine.prototype.getQueryResult = function(e) {
                return this._gl.getQueryParameter(e, this._gl.QUERY_RESULT)
            }, Ya.Engine.prototype.beginOcclusionQuery = function(e, t) {
                var i = this._getGlAlgorithmType(e);
                return this._gl.beginQuery(i, t), this
            }, Ya.Engine.prototype.endOcclusionQuery = function(e) {
                var t = this._getGlAlgorithmType(e);
                return this._gl.endQuery(t), this
            }, Ya.Engine.prototype._createTimeQuery = function() {
                var e = this.getCaps().timerQuery;
                return e.createQueryEXT ? e.createQueryEXT() : this.createQuery()
            }, Ya.Engine.prototype._deleteTimeQuery = function(e) {
                var t = this.getCaps().timerQuery;
                t.deleteQueryEXT ? t.deleteQueryEXT(e) : this.deleteQuery(e)
            }, Ya.Engine.prototype._getTimeQueryResult = function(e) {
                var t = this.getCaps().timerQuery;
                return t.getQueryObjectEXT ? t.getQueryObjectEXT(e, t.QUERY_RESULT_EXT) : this.getQueryResult(e)
            }, Ya.Engine.prototype._getTimeQueryAvailability = function(e) {
                var t = this.getCaps().timerQuery;
                return t.getQueryObjectEXT ? t.getQueryObjectEXT(e, t.QUERY_RESULT_AVAILABLE_EXT) : this.isQueryResultAvailable(e)
            }, Ya.Engine.prototype.startTimeQuery = function() {
                var e = this.getCaps(),
                    t = e.timerQuery;
                if (!t) return null;
                var i = new Ya._TimeToken;
                if (this._gl.getParameter(t.GPU_DISJOINT_EXT), e.canUseTimestampForTimerQuery) i._startTimeQuery = this._createTimeQuery(), t.queryCounterEXT(i._startTimeQuery, t.TIMESTAMP_EXT);
                else {
                    if (this._currentNonTimestampToken) return this._currentNonTimestampToken;
                    i._timeElapsedQuery = this._createTimeQuery(), t.beginQueryEXT ? t.beginQueryEXT(t.TIME_ELAPSED_EXT, i._timeElapsedQuery) : this._gl.beginQuery(t.TIME_ELAPSED_EXT, i._timeElapsedQuery), this._currentNonTimestampToken = i
                }
                return i
            }, Ya.Engine.prototype.endTimeQuery = function(e) {
                var t = this.getCaps(),
                    i = t.timerQuery;
                if (!i || !e) return -1;
                if (t.canUseTimestampForTimerQuery) {
                    if (!e._startTimeQuery) return -1;
                    e._endTimeQuery || (e._endTimeQuery = this._createTimeQuery(), i.queryCounterEXT(e._endTimeQuery, i.TIMESTAMP_EXT))
                } else if (!e._timeElapsedQueryEnded) {
                    if (!e._timeElapsedQuery) return -1;
                    i.endQueryEXT ? i.endQueryEXT(i.TIME_ELAPSED_EXT) : this._gl.endQuery(i.TIME_ELAPSED_EXT), e._timeElapsedQueryEnded = !0
                }
                var r = this._gl.getParameter(i.GPU_DISJOINT_EXT),
                    n = !1;
                if (e._endTimeQuery ? n = this._getTimeQueryAvailability(e._endTimeQuery) : e._timeElapsedQuery && (n = this._getTimeQueryAvailability(e._timeElapsedQuery)), n && !r) {
                    var o = 0;
                    if (t.canUseTimestampForTimerQuery) {
                        if (!e._startTimeQuery || !e._endTimeQuery) return -1;
                        var s = this._getTimeQueryResult(e._startTimeQuery);
                        o = this._getTimeQueryResult(e._endTimeQuery) - s, this._deleteTimeQuery(e._startTimeQuery), this._deleteTimeQuery(e._endTimeQuery), e._startTimeQuery = null, e._endTimeQuery = null
                    } else {
                        if (!e._timeElapsedQuery) return -1;
                        o = this._getTimeQueryResult(e._timeElapsedQuery), this._deleteTimeQuery(e._timeElapsedQuery), e._timeElapsedQuery = null, e._timeElapsedQueryEnded = !1, this._currentNonTimestampToken = null
                    }
                    return o
                }
                return -1
            }, Ya.Engine.prototype._getGlAlgorithmType = function(e) {
                return e === Ya.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED
            }, Object.defineProperty(Ya.AbstractMesh.prototype, "isOcclusionQueryInProgress", {
                get: function() {
                    return this._occlusionDataStorage.isOcclusionQueryInProgress
                },
                enumerable: !1,
                configurable: !0
            }), Object.defineProperty(Ya.AbstractMesh.prototype, "_occlusionDataStorage", {
                get: function() {
                    return this.__occlusionDataStorage || (this.__occlusionDataStorage = new qa), this.__occlusionDataStorage
                },
                enumerable: !1,
                configurable: !0
            }), Object.defineProperty(Ya.AbstractMesh.prototype, "isOccluded", {
                get: function() {
                    return this._occlusionDataStorage.isOccluded
                },
                set: function(e) {
                    this._occlusionDataStorage.isOccluded = e
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(Ya.AbstractMesh.prototype, "occlusionQueryAlgorithmType", {
                get: function() {
                    return this._occlusionDataStorage.occlusionQueryAlgorithmType
                },
                set: function(e) {
                    this._occlusionDataStorage.occlusionQueryAlgorithmType = e
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(Ya.AbstractMesh.prototype, "occlusionType", {
                get: function() {
                    return this._occlusionDataStorage.occlusionType
                },
                set: function(e) {
                    this._occlusionDataStorage.occlusionType = e
                },
                enumerable: !0,
                configurable: !0
            }), Object.defineProperty(Ya.AbstractMesh.prototype, "occlusionRetryCount", {
                get: function() {
                    return this._occlusionDataStorage.occlusionRetryCount
                },
                set: function(e) {
                    this._occlusionDataStorage.occlusionRetryCount = e
                },
                enumerable: !0,
                configurable: !0
            }), Ya.AbstractMesh.prototype._checkOcclusionQuery = function() {
                var e = this._occlusionDataStorage;
                if (e.occlusionType === Ya.AbstractMesh.OCCLUSION_TYPE_NONE) return e.isOccluded = !1;
                var t = this.getEngine();
                if (t.webGLVersion < 2) return e.isOccluded = !1;
                if (!t.isQueryResultAvailable) return e.isOccluded = !1;
                if (this.isOcclusionQueryInProgress && this._occlusionQuery)
                    if (t.isQueryResultAvailable(this._occlusionQuery)) {
                        var i = t.getQueryResult(this._occlusionQuery);
                        e.isOcclusionQueryInProgress = !1, e.occlusionInternalRetryCounter = 0, e.isOccluded = 1 !== i
                    } else {
                        if (e.occlusionInternalRetryCounter++, !(-1 !== e.occlusionRetryCount && e.occlusionInternalRetryCounter > e.occlusionRetryCount)) return !1;
                        e.isOcclusionQueryInProgress = !1, e.occlusionInternalRetryCounter = 0, e.isOccluded = e.occlusionType !== Ya.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC && e.isOccluded
                    }
                var r = this.getScene();
                if (r.getBoundingBoxRenderer) {
                    var n = r.getBoundingBoxRenderer();
                    this._occlusionQuery || (this._occlusionQuery = t.createQuery()), t.beginOcclusionQuery(e.occlusionQueryAlgorithmType, this._occlusionQuery), n.renderOcclusionBoundingBox(this), t.endOcclusionQuery(e.occlusionQueryAlgorithmType), this._occlusionDataStorage.isOcclusionQueryInProgress = !0
                }
                return e.isOccluded
            }, Ka = $a || ($a = {}), Qa = function(e) {
                function t(t, i, r, n, o) {
                    void 0 === i && (i = 256), void 0 === r && (r = Ka.Engine.LastCreatedScene);
                    var s = e.call(this, t, i, "noise", r, n, o) || this;
                    return s._time = 0, s.brightness = .2, s.octaves = 3, s.persistence = .8, s.animationSpeedFactor = 1, s.autoClear = !1, s._updateShaderUniforms(), s
                }
                return b(t, e), t.prototype._updateShaderUniforms = function() {
                    var e = this.getScene();
                    e && (this._time += e.getAnimationRatio() * this.animationSpeedFactor * .01, this.setFloat("brightness", this.brightness), this.setFloat("persistence", this.persistence), this.setFloat("timeScale", this._time))
                }, t.prototype._getDefines = function() {
                    return "#define OCTAVES " + (0 | this.octaves)
                }, t.prototype.render = function(t) {
                    this._updateShaderUniforms(), e.prototype.render.call(this, t)
                }, t.prototype.serialize = function() {
                    var e = {
                        customType: "BABYLON.NoiseProceduralTexture"
                    };
                    return e.brightness = this.brightness, e.octaves = this.octaves, e.persistence = this.persistence, e.animationSpeedFactor = this.animationSpeedFactor, e.size = this.getSize().width, e.generateMipMaps = this._generateMipMaps, e
                }, t.Parse = function(e, i, r) {
                    var n = new t(e.name, e.size, i, void 0, e.generateMipMaps);
                    return n.brightness = e.brightness, n.octaves = e.octaves, n.persistence = e.persistence, n.animationSpeedFactor = e.animationSpeedFactor, n
                }, t
            }(Ka.ProceduralTexture), Ka.NoiseProceduralTexture = Qa;
            var Za, Ja, $a, el;
            ae = this && this.__assign || function() {
                return (ae = Object.assign || function(e) {
                    for (var t, i = 1, r = arguments.length; i < r; i++)
                        for (var n in t = arguments[i]) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
                    return e
                }).apply(this, arguments)
            }, Za = $a || ($a = {}), Ja = function() {
                function e(t, i) {
                    if (void 0 === i && (i = null), !e.IsSupported(t)) throw "Your browser does not support recording so far.";
                    var r = t.getRenderingCanvas();
                    if (!r) throw "The babylon engine must have a canvas to be recorded";
                    this._canvas = r, this._canvas.isRecording = !1, this._options = ae({}, e._defaultOptions, i);
                    var n = this._canvas.captureStream(this._options.fps);
                    this._mediaRecorder = new MediaRecorder(n, {
                        mimeType: this._options.mimeType
                    }), this._mediaRecorder.ondataavailable = this._handleDataAvailable.bind(this), this._mediaRecorder.onerror = this._handleError.bind(this), this._mediaRecorder.onstop = this._handleStop.bind(this)
                }
                return e.IsSupported = function(e) {
                    var t = e.getRenderingCanvas();
                    return !!t && "function" == typeof t.captureStream
                }, Object.defineProperty(e.prototype, "isRecording", {
                    get: function() {
                        return !!this._canvas && this._canvas.isRecording
                    },
                    enumerable: !0,
                    configurable: !0
                }), e.prototype.stopRecording = function() {
                    this._canvas && this._mediaRecorder && this.isRecording && (this._canvas.isRecording = !1, this._mediaRecorder.stop())
                }, e.prototype.startRecording = function(e, t) {
                    var i = this;
                    if (void 0 === e && (e = "babylonjs.webm"), void 0 === t && (t = 7), !this._canvas || !this._mediaRecorder) throw "Recorder has already been disposed";
                    if (this.isRecording) throw "Recording already in progress";
                    return 0 < t && setTimeout(function() {
                        i.stopRecording()
                    }, 1e3 * t), this._fileName = e, this._recordedChunks = [], this._resolve = null, this._reject = null, this._canvas.isRecording = !0, this._mediaRecorder.start(this._options.recordChunckSize), new Promise(function(e, t) {
                        i._resolve = e, i._reject = t
                    })
                }, e.prototype.dispose = function() {
                    this._canvas = null, this._mediaRecorder = null, this._recordedChunks = [], this._fileName = null, this._resolve = null, this._reject = null
                }, e.prototype._handleDataAvailable = function(e) {
                    0 < e.data.size && this._recordedChunks.push(e.data)
                }, e.prototype._handleError = function(e) {
                    if (this.stopRecording(), !this._reject) throw new e.error;
                    this._reject(e.error)
                }, e.prototype._handleStop = function() {
                    this.stopRecording();
                    var e = new Blob(this._recordedChunks);
                    this._resolve && this._resolve(e), window.URL.createObjectURL(e), this._fileName && Za.Tools.Download(e, this._fileName)
                }, e._defaultOptions = {
                    mimeType: "video/webm",
                    fps: 25,
                    recordChunckSize: 3e3
                }, e
            }(), Za.VideoRecorder = Ja, (el = $a || ($a = {})).Scene.prototype.createDefaultLight = function(e) {
                if (void 0 === e && (e = !1), e && this.lights)
                    for (var t = 0; t < this.lights.length; t++) this.lights[t].dispose();
                0 === this.lights.length && new el.HemisphericLight("default light", el.Vector3.Up(), this)
            }, el.Scene.prototype.createDefaultCamera = function(e, t, i) {
                if (void 0 === e && (e = !1), void 0 === t && (t = !1), void 0 === i && (i = !1), t && this.activeCamera && (this.activeCamera.dispose(), this.activeCamera = null), !this.activeCamera) {
                    var r, n = this.getWorldExtends(),
                        o = n.max.subtract(n.min),
                        s = n.min.add(o.scale(.5)),
                        a = 1.5 * o.length();
                    if (isFinite(a) || (a = 1, s.copyFromFloats(0, 0, 0)), e) {
                        var l = new el.ArcRotateCamera("default camera", -Math.PI / 2, Math.PI / 2, a, s, this);
                        l.lowerRadiusLimit = .01 * a, l.wheelPrecision = 100 / a, r = l
                    } else {
                        var u = new el.FreeCamera("default camera", new el.Vector3(s.x, s.y, -a), this);
                        u.setTarget(s), r = u
                    }
                    r.minZ = .01 * a, r.maxZ = 1e3 * a, r.speed = .2 * a, this.activeCamera = r;
                    var c = this.getEngine().getRenderingCanvas();
                    i && c && r.attachControl(c)
                }
            }, el.Scene.prototype.createDefaultCameraOrLight = function(e, t, i) {
                void 0 === e && (e = !1), void 0 === t && (t = !1), void 0 === i && (i = !1), this.createDefaultLight(t), this.createDefaultCamera(e, t, i)
            }, el.Scene.prototype.createDefaultSkybox = function(e, t, i, r, n) {
                if (void 0 === t && (t = !1), void 0 === i && (i = 1e3), void 0 === r && (r = 0), void 0 === n && (n = !0), !e) return el.Tools.Warn("Can not create default skybox without environment texture."), null;
                n && e && (this.environmentTexture = e);
                var o = el.Mesh.CreateBox("hdrSkyBox", i, this);
                if (t) {
                    var s = new el.PBRMaterial("skyBox", this);
                    s.backFaceCulling = !1, s.reflectionTexture = e.clone(), s.reflectionTexture && (s.reflectionTexture.coordinatesMode = el.Texture.SKYBOX_MODE), s.microSurface = 1 - r, s.disableLighting = !0, s.twoSidedLighting = !0, o.infiniteDistance = !0, o.material = s
                } else {
                    var a = new el.StandardMaterial("skyBox", this);
                    a.backFaceCulling = !1, a.reflectionTexture = e.clone(), a.reflectionTexture && (a.reflectionTexture.coordinatesMode = el.Texture.SKYBOX_MODE), a.disableLighting = !0, o.infiniteDistance = !0, o.material = a
                }
                return o
            }, el.Scene.prototype.createDefaultEnvironment = function(e) {
                return el.EnvironmentHelper ? new el.EnvironmentHelper(e, this) : null
            }, el.Scene.prototype.createDefaultVRExperience = function(e) {
                return void 0 === e && (e = {}), new el.VRExperienceHelper(this, e)
            }, $a.Effect.ShadersStore = {
                defaultVertexShader: "#include<__decl__defaultVertex>\n\n#define CUSTOM_VERTEX_BEGIN\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nvarying vec2 vDiffuseUV;\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nvarying vec2 vAmbientUV;\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nvarying vec2 vOpacityUV;\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nvarying vec2 vEmissiveUV;\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nvarying vec2 vLightmapUV;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nvarying vec2 vSpecularUV;\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nvarying vec2 vBumpUV;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef NORMAL \nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\n#ifdef REFLECTIONMAP_SKYBOX_TRANSFORMED\nvPositionUVW=(reflectionMatrix*vec4(position,1.0)).xyz;\n#else\nvPositionUVW=position;\n#endif\n#endif \n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uv;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nif (vSpecularInfos.x == 0.)\n{\nvSpecularUV=vec2(specularMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvSpecularUV=vec2(specularMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n#include<pointCloudVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n",
                defaultPixelShader: "#include<__decl__defaultFragment>\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n\n#define RECIPROCAL_PI2 0.15915494\nuniform vec3 vEyePosition;\nuniform vec3 vAmbientColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV == 1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV == 2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef AMBIENT\n#if AMBIENTDIRECTUV == 1\n#define vAmbientUV vMainUV1\n#elif AMBIENTDIRECTUV == 2\n#define vAmbientUV vMainUV2\n#else\nvarying vec2 vAmbientUV;\n#endif\nuniform sampler2D ambientSampler;\n#endif\n#ifdef OPACITY \n#if OPACITYDIRECTUV == 1\n#define vOpacityUV vMainUV1\n#elif OPACITYDIRECTUV == 2\n#define vOpacityUV vMainUV2\n#else\nvarying vec2 vOpacityUV;\n#endif\nuniform sampler2D opacitySampler;\n#endif\n#ifdef EMISSIVE\n#if EMISSIVEDIRECTUV == 1\n#define vEmissiveUV vMainUV1\n#elif EMISSIVEDIRECTUV == 2\n#define vEmissiveUV vMainUV2\n#else\nvarying vec2 vEmissiveUV;\n#endif\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\n#if LIGHTMAPDIRECTUV == 1\n#define vLightmapUV vMainUV1\n#elif LIGHTMAPDIRECTUV == 2\n#define vLightmapUV vMainUV2\n#else\nvarying vec2 vLightmapUV;\n#endif\nuniform sampler2D lightmapSampler;\n#endif\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nuniform samplerCube refractionCubeSampler;\n#else\nuniform sampler2D refraction2DSampler;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\n#if SPECULARDIRECTUV == 1\n#define vSpecularUV vMainUV1\n#elif SPECULARDIRECTUV == 2\n#define vSpecularUV vMainUV2\n#else\nvarying vec2 vSpecularUV;\n#endif\nuniform sampler2D specularSampler;\n#endif\n#ifdef ALPHATEST\nuniform float alphaCutOff;\n#endif\n\n#include<fresnelFunction>\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nuniform samplerCube reflectionCubeSampler;\n#else\nuniform sampler2D reflection2DSampler;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));\n#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);\n#ifdef ALPHATEST\nif (baseColor.a<alphaCutOff)\ndiscard;\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#include<depthPrePass>\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\n\nvec3 baseAmbientColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\n\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularColor=vSpecularColor.rgb;\n#ifdef SPECULAR\nvec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);\nspecularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#else\nfloat glossiness=0.;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\nfloat shadow=1.;\n#ifdef LIGHTMAP\nvec3 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset).rgb*vLightmapInfos.y;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n\nvec3 refractionColor=vec3(0.,0.,0.);\n#ifdef REFRACTION\nvec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nif (dot(refractionVector,viewDirectionW)<1.0) {\nrefractionColor=textureCube(refractionCubeSampler,refractionVector).rgb;\n}\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\nrefractionColor=texture2D(refraction2DSampler,refractionCoords).rgb;\n#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor=toGammaSpace(refractionColor);\n#endif\nrefractionColor*=vRefractionInfos.x;\n#endif\n\nvec3 reflectionColor=vec3(0.,0.,0.);\n#ifdef REFLECTION\nvec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nfloat bias=vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias).rgb;\n#else\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW).rgb;\n#endif\n#else\nvec2 coords=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;\nreflectionColor=texture2D(reflection2DSampler,coords).rgb;\n#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor=toGammaSpace(reflectionColor);\n#endif\nreflectionColor*=vReflectionInfos.x;\n#ifdef REFLECTIONFRESNEL\nfloat reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#else\nreflectionColor*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#else\nreflectionColor*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nfloat refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);\nrefractionColor*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nopacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);\nalpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;\n#else\nalpha*=opacityMap.a*vOpacityInfos.y;\n#endif\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef OPACITYFRESNEL\nfloat opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);\nalpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;\n#endif\n\nvec3 emissiveColor=vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nfloat emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);\nemissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;\n#endif\n\n#ifdef DIFFUSEFRESNEL\nfloat diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);\ndiffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor+emissiveColor+refractionColor,0.0,1.0),alpha);\n#else\nvec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor+refractionColor,alpha);\n#endif\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor.rgb*=lightmapColor;\n#else\ncolor.rgb+=lightmapColor;\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor.rgb=max(color.rgb,0.);\n#include<logDepthFragment>\n#include<fogFragment>\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#else\n#ifdef IMAGEPROCESSING\ncolor.rgb=toLinearSpace(color.rgb);\ncolor=applyImageProcessing(color);\n#endif\n#endif\n#ifdef PREMULTIPLYALPHA\n\ncolor.rgb*=color.a;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\ngl_FragColor=color;\n}\n",
                pbrVertexShader: "precision highp float;\n#include<__decl__pbrVertex>\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2; \n#endif \n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#if defined(ALBEDO) && ALBEDODIRECTUV == 0\nvarying vec2 vAlbedoUV;\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nvarying vec2 vAmbientUV;\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nvarying vec2 vOpacityUV;\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nvarying vec2 vEmissiveUV;\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nvarying vec2 vLightmapUV;\n#endif\n#if defined(REFLECTIVITY) && REFLECTIVITYDIRECTUV == 0\nvarying vec2 vReflectivityUV;\n#endif\n#if defined(MICROSURFACEMAP) && MICROSURFACEMAPDIRECTUV == 0\nvarying vec2 vMicroSurfaceSamplerUV;\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nvarying vec2 vBumpUV;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#include<harmonicsFunctions>\n#endif\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\nvoid main(void) {\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\n#ifdef REFLECTIONMAP_SKYBOX_TRANSFORMED\nvPositionUVW=(reflectionMatrix*vec4(positionUpdated,1.0)).xyz;\n#else\nvPositionUVW=positionUpdated;\n#endif\n#endif \n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvec3 reflectionVector=vec3(reflectionMatrix*vec4(vNormalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\nvEnvironmentIrradiance=environmentIrradianceJones(reflectionVector);\n#endif\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uv;\n#endif \n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif \n#if defined(ALBEDO) && ALBEDODIRECTUV == 0 \nif (vAlbedoInfos.x == 0.)\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0 \nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0 \nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0 \nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0 \nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(REFLECTIVITY) && REFLECTIVITYDIRECTUV == 0 \nif (vReflectivityInfos.x == 0.)\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(MICROSURFACEMAP) && MICROSURFACEMAPDIRECTUV == 0 \nif (vMicroSurfaceSamplerInfos.x == 0.)\n{\nvMicroSurfaceSamplerUV=vec2(microSurfaceSamplerMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvMicroSurfaceSamplerUV=vec2(microSurfaceSamplerMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0 \nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<bumpVertex>\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n\n#include<logDepthVertex>\n}",
                pbrPixelShader: "#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef LODBASEDMICROSFURACE\n#extension GL_EXT_shader_texture_lod : enable\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nprecision highp float;\n#include<__decl__pbrFragment>\nuniform vec4 vEyePosition;\nuniform vec3 vAmbientColor;\nuniform vec4 vCameraInfos;\n\nvarying vec3 vPositionW;\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif \n#ifdef MAINUV2 \nvarying vec2 vMainUV2;\n#endif \n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#endif\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n\n#ifdef ALBEDO\n#if ALBEDODIRECTUV == 1\n#define vAlbedoUV vMainUV1\n#elif ALBEDODIRECTUV == 2\n#define vAlbedoUV vMainUV2\n#else\nvarying vec2 vAlbedoUV;\n#endif\nuniform sampler2D albedoSampler;\n#endif\n#ifdef AMBIENT\n#if AMBIENTDIRECTUV == 1\n#define vAmbientUV vMainUV1\n#elif AMBIENTDIRECTUV == 2\n#define vAmbientUV vMainUV2\n#else\nvarying vec2 vAmbientUV;\n#endif\nuniform sampler2D ambientSampler;\n#endif\n#ifdef OPACITY\n#if OPACITYDIRECTUV == 1\n#define vOpacityUV vMainUV1\n#elif OPACITYDIRECTUV == 2\n#define vOpacityUV vMainUV2\n#else\nvarying vec2 vOpacityUV;\n#endif\nuniform sampler2D opacitySampler;\n#endif\n#ifdef EMISSIVE\n#if EMISSIVEDIRECTUV == 1\n#define vEmissiveUV vMainUV1\n#elif EMISSIVEDIRECTUV == 2\n#define vEmissiveUV vMainUV2\n#else\nvarying vec2 vEmissiveUV;\n#endif\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\n#if LIGHTMAPDIRECTUV == 1\n#define vLightmapUV vMainUV1\n#elif LIGHTMAPDIRECTUV == 2\n#define vLightmapUV vMainUV2\n#else\nvarying vec2 vLightmapUV;\n#endif\nuniform sampler2D lightmapSampler;\n#endif\n#ifdef REFLECTIVITY\n#if REFLECTIVITYDIRECTUV == 1\n#define vReflectivityUV vMainUV1\n#elif REFLECTIVITYDIRECTUV == 2\n#define vReflectivityUV vMainUV2\n#else\nvarying vec2 vReflectivityUV;\n#endif\nuniform sampler2D reflectivitySampler;\n#endif\n#ifdef MICROSURFACEMAP\n#if MICROSURFACEMAPDIRECTUV == 1\n#define vMicroSurfaceSamplerUV vMainUV1\n#elif MICROSURFACEMAPDIRECTUV == 2\n#define vMicroSurfaceSamplerUV vMainUV2\n#else\nvarying vec2 vMicroSurfaceSamplerUV;\n#endif\nuniform sampler2D microSurfaceSampler;\n#endif\n\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\n#define sampleRefraction(s,c) textureCube(s,c)\nuniform samplerCube refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube refractionSamplerLow;\nuniform samplerCube refractionSamplerHigh;\n#endif\n#else\n#define sampleRefraction(s,c) texture2D(s,c)\nuniform sampler2D refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform samplerCube refractionSamplerLow;\nuniform samplerCube refractionSamplerHigh;\n#endif\n#endif\n#endif\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#ifdef ENVIRONMENTBRDF\nuniform sampler2D environmentBrdfSampler;\n#endif\n\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE;\n#endif\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\n\n#include<shadowsFragmentFunctions>\n#include<pbrFunctions>\n#include<harmonicsFunctions>\n#include<pbrLightFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\n\n\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#endif\n#include<bumpFragment>\n#ifdef SPECULARAA\nvec3 nDfdx=dFdx(normalW.xyz);\nvec3 nDfdy=dFdy(normalW.xyz);\nfloat slopeSquare=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));\n\nfloat geometricRoughnessFactor=pow(clamp(slopeSquare ,0.,1.),0.333);\n\nfloat geometricAlphaGFactor=sqrt(slopeSquare);\n#else\nfloat geometricRoughnessFactor=0.;\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nvec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#if defined(TWOSIDEDLIGHTING)\nfaceNormal=gl_FrontFacing ? faceNormal : -faceNormal;\n#endif\nnormalW*=sign(dot(normalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n\n\nvec3 surfaceAlbedo=vAlbedoColor.rgb;\n\nfloat alpha=vAlbedoColor.a;\n#ifdef ALBEDO\nvec4 albedoTexture=texture2D(albedoSampler,vAlbedoUV+uvOffset);\n#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)\nalpha*=albedoTexture.a;\n#endif\nsurfaceAlbedo*=toLinearSpace(albedoTexture.rgb);\nsurfaceAlbedo*=vAlbedoInfos.y;\n#endif\n\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nalpha=getLuminance(opacityMap.rgb);\n#else\nalpha*=opacityMap.a;\n#endif\nalpha*=vOpacityInfos.y;\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#if !defined(LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)\n#ifdef ALPHATEST\nif (alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n#endif\n#include<depthPrePass>\n#ifdef VERTEXCOLOR\nsurfaceAlbedo*=vColor.rgb;\n#endif\n\nvec3 ambientOcclusionColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\n#ifdef AMBIENTINGRAYSCALE\nambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);\n#endif\nambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);\n#endif\n#ifdef UNLIT\nvec3 diffuseBase=vec3(1.,1.,1.);\n#else\n\nfloat microSurface=vReflectivityColor.a;\nvec3 surfaceReflectivityColor=vReflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvec2 metallicRoughness=surfaceReflectivityColor.rg;\n#ifdef REFLECTIVITY\nvec4 surfaceMetallicColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);\n#ifdef AOSTOREINMETALMAPRED\nvec3 aoStoreInMetalMap=vec3(surfaceMetallicColorMap.r,surfaceMetallicColorMap.r,surfaceMetallicColorMap.r);\nambientOcclusionColor=mix(ambientOcclusionColor,aoStoreInMetalMap,vReflectivityInfos.z);\n#endif\n#ifdef METALLNESSSTOREINMETALMAPBLUE\nmetallicRoughness.r*=surfaceMetallicColorMap.b;\n#else\nmetallicRoughness.r*=surfaceMetallicColorMap.r;\n#endif\n#ifdef ROUGHNESSSTOREINMETALMAPALPHA\nmetallicRoughness.g*=surfaceMetallicColorMap.a;\n#else\n#ifdef ROUGHNESSSTOREINMETALMAPGREEN\nmetallicRoughness.g*=surfaceMetallicColorMap.g;\n#endif\n#endif\n#endif\n#ifdef MICROSURFACEMAP\nvec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;\nmetallicRoughness.g*=microSurfaceTexel.r;\n#endif\n\nmicroSurface=1.0-metallicRoughness.g;\n\nvec3 baseColor=surfaceAlbedo;\n\n\nconst vec3 DefaultSpecularReflectanceDielectric=vec3(0.04,0.04,0.04);\n\nsurfaceAlbedo=mix(baseColor.rgb*(1.0-DefaultSpecularReflectanceDielectric.r),vec3(0.,0.,0.),metallicRoughness.r);\n\nsurfaceReflectivityColor=mix(DefaultSpecularReflectanceDielectric,baseColor,metallicRoughness.r);\n#else\n#ifdef REFLECTIVITY\nvec4 surfaceReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);\nsurfaceReflectivityColor*=toLinearSpace(surfaceReflectivityColorMap.rgb);\nsurfaceReflectivityColor*=vReflectivityInfos.y;\n#ifdef MICROSURFACEFROMREFLECTIVITYMAP\nmicroSurface*=surfaceReflectivityColorMap.a;\nmicroSurface*=vReflectivityInfos.z;\n#else\n#ifdef MICROSURFACEAUTOMATIC\nmicroSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);\n#endif\n#ifdef MICROSURFACEMAP\nvec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;\nmicroSurface*=microSurfaceTexel.r;\n#endif\n#endif\n#endif\n#endif\n\nmicroSurface=clamp(microSurface,0.,1.);\n\nfloat roughness=1.-microSurface;\n\n#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\n\n\n\nfloat opacityPerceptual=alpha;\n#ifdef LINEARALPHAFRESNEL\nfloat opacity0=opacityPerceptual;\n#else\nfloat opacity0=opacityPerceptual*opacityPerceptual;\n#endif\nfloat opacity90=fresnelGrazingReflectance(opacity0);\nvec3 normalForward=faceforward(normalW,-viewDirectionW,normalW);\n\nalpha=fresnelSchlickEnvironmentGGX(clamp(dot(viewDirectionW,normalForward),0.0,1.0),vec3(opacity0),vec3(opacity90),sqrt(microSurface)).x;\n#ifdef ALPHATEST\nif (alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n#endif\n#endif\n\n\nfloat NdotVUnclamped=dot(normalW,viewDirectionW);\nfloat NdotV=clamp(NdotVUnclamped,0.,1.)+0.00001;\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\n#ifdef SPECULARAA\n\n\nalphaG+=(0.75*geometricAlphaGFactor);\n#endif\n\n#ifdef REFRACTION\nvec4 environmentRefraction=vec4(0.,0.,0.,0.);\nvec3 refractionVector=refract(-viewDirectionW,normalW,vRefractionInfos.y);\n#ifdef REFRACTIONMAP_OPPOSITEZ\nrefractionVector.z*=-1.0;\n#endif\n\n#ifdef REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nvec3 refractionCoords=refractionVector;\nrefractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0));\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\n#endif\n#ifdef LODINREFRACTIONALPHA\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#else\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG,1.0);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nrefractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;\n#ifdef LODINREFRACTIONALPHA\n\n\n\n\n\n\n\n\n\nfloat automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);\nfloat requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD);\n#else\nfloat requestedRefractionLOD=refractionLOD;\n#endif\nenvironmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);\n#else\nfloat lodRefractionNormalized=clamp(refractionLOD/log2(vRefractionMicrosurfaceInfos.x),0.,1.);\nfloat lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;\nvec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);\nif(lodRefractionNormalizedDoubled<1.0){\nenvironmentRefraction=mix(\nsampleRefraction(refractionSamplerHigh,refractionCoords),\nenvironmentRefractionMid,\nlodRefractionNormalizedDoubled\n);\n}else{\nenvironmentRefraction=mix(\nenvironmentRefractionMid,\nsampleRefraction(refractionSamplerLow,refractionCoords),\nlodRefractionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef GAMMAREFRACTION\nenvironmentRefraction.rgb=fromRGBD(environmentRefraction);\n#endif\n#ifdef RGBDREFRACTION\nenvironmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);\n#endif\n\nenvironmentRefraction.rgb*=vRefractionInfos.x;\n#endif\n\n#ifdef REFLECTION\nvec4 environmentRadiance=vec4(0.,0.,0.,0.);\nvec3 environmentIrradiance=vec3(0.,0.,0.);\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=reflectionVector;\n#else\nvec2 reflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#else\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,1.);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef LODINREFLECTIONALPHA\n\n\n\n\n\n\n\n\n\nfloat automaticReflectionLOD=UNPACK_LOD(sampleReflection(reflectionSampler,reflectionCoords).a);\nfloat requestedReflectionLOD=max(automaticReflectionLOD,reflectionLOD);\n#else\nfloat requestedReflectionLOD=reflectionLOD;\n#endif\nenvironmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,requestedReflectionLOD);\n#else\nfloat lodReflectionNormalized=clamp(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x),0.,1.);\nfloat lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;\nvec4 environmentSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);\nif(lodReflectionNormalizedDoubled<1.0){\nenvironmentRadiance=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nenvironmentSpecularMid,\nlodReflectionNormalizedDoubled\n);\n}else{\nenvironmentRadiance=mix(\nenvironmentSpecularMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef RGBDREFLECTION\nenvironmentRadiance.rgb=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);\n#endif\n\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradiance;\n#else\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\nenvironmentIrradiance=environmentIrradianceJones(irradianceVector);\n#endif\n#endif\n\nenvironmentRadiance.rgb*=vReflectionInfos.x;\nenvironmentRadiance.rgb*=vReflectionColor.rgb;\nenvironmentIrradiance*=vReflectionColor.rgb;\n#endif\n\n\n\nfloat reflectance=max(max(surfaceReflectivityColor.r,surfaceReflectivityColor.g),surfaceReflectivityColor.b);\nfloat reflectance90=fresnelGrazingReflectance(reflectance);\nvec3 specularEnvironmentR0=surfaceReflectivityColor.rgb;\nvec3 specularEnvironmentR90=vec3(1.0,1.0,1.0)*reflectance90;\n\nvec3 diffuseBase=vec3(0.,0.,0.);\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#ifdef LIGHTMAP\nvec3 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset).rgb;\n#ifdef GAMMALIGHTMAP\nlightmapColor=toLinearSpace(lightmapColor);\n#endif\nlightmapColor*=vLightmapInfos.y;\n#endif\nlightingInfo info;\npointLightingInfo pointInfo;\nspotLightingInfo spotInfo;\nfloat shadow=1.; \nfloat NdotL=-1.;\n#include<lightFragment>[0..maxSimultaneousLights]\n\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n\nvec2 brdfSamplerUV=vec2(NdotV,roughness);\n\nvec4 environmentBrdf=texture2D(environmentBrdfSampler,brdfSamplerUV);\nvec3 specularEnvironmentReflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;\n#ifdef RADIANCEOCCLUSION\n#ifdef AMBIENTINGRAYSCALE\nfloat ambientMonochrome=ambientOcclusionColor.r;\n#else\nfloat ambientMonochrome=getLuminance(ambientOcclusionColor);\n#endif\nfloat seo=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);\nspecularEnvironmentReflectance*=seo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat eho=environmentHorizonOcclusion(-viewDirectionW,normalW);\nspecularEnvironmentReflectance*=eho;\n#endif\n#endif\n#endif\n#else\n\nvec3 specularEnvironmentReflectance=fresnelSchlickEnvironmentGGX(NdotV,specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));\n#endif\n\n#ifdef REFRACTION\nvec3 refractance=vec3(0.0,0.0,0.0);\nvec3 transmission=vec3(1.0,1.0,1.0);\n#ifdef LINKREFRACTIONTOTRANSPARENCY\n\ntransmission*=(1.0-alpha);\n\n\nvec3 mixedAlbedo=surfaceAlbedo;\nfloat maxChannel=max(max(mixedAlbedo.r,mixedAlbedo.g),mixedAlbedo.b);\nvec3 tint=clamp(maxChannel*mixedAlbedo,0.0,1.0);\n\nsurfaceAlbedo*=alpha;\n\nenvironmentIrradiance*=alpha;\n\nenvironmentRefraction.rgb*=tint;\n\nalpha=1.0;\n#endif\n\nvec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);\nspecularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,alpha);\n\ntransmission*=1.0-specularEnvironmentReflectance;\n\nrefractance=transmission;\n#endif\n\n\n\n\nsurfaceAlbedo.rgb=(1.-reflectance)*surfaceAlbedo.rgb;\n\n#ifdef REFLECTION\nvec3 finalIrradiance=environmentIrradiance;\nfinalIrradiance*=surfaceAlbedo.rgb;\n#endif\n\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase;\nfinalSpecular=max(finalSpecular,0.0);\n\nvec3 finalSpecularScaled=finalSpecular*vLightingIntensity.x*vLightingIntensity.w;\n#endif\n\n#ifdef REFLECTION\nvec3 finalRadiance=environmentRadiance.rgb;\nfinalRadiance*=specularEnvironmentReflectance;\n\nvec3 finalRadianceScaled=finalRadiance*vLightingIntensity.z;\n#endif\n\n#ifdef REFRACTION\nvec3 finalRefraction=environmentRefraction.rgb;\nfinalRefraction*=refractance;\n#endif\n\n#ifdef ALPHABLEND\nfloat luminanceOverAlpha=0.0;\n#if defined(REFLECTION) && defined(RADIANCEOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalRadianceScaled);\n#endif\n#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA)\nluminanceOverAlpha+=getLuminance(finalSpecularScaled);\n#endif\n#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA)\nalpha=clamp(alpha+luminanceOverAlpha*luminanceOverAlpha,0.,1.);\n#endif\n#endif\n#endif\n\nvec3 finalDiffuse=diffuseBase;\nfinalDiffuse.rgb+=vAmbientColor;\nfinalDiffuse*=surfaceAlbedo.rgb;\nfinalDiffuse=max(finalDiffuse,0.0);\n\nvec3 finalEmissive=vEmissiveColor;\n#ifdef EMISSIVE\nvec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb;\nfinalEmissive*=toLinearSpace(emissiveColorTex.rgb);\nfinalEmissive*=vEmissiveInfos.y;\n#endif\n\n#ifdef AMBIENT\nvec3 ambientOcclusionForDirectDiffuse=mix(vec3(1.),ambientOcclusionColor,vAmbientInfos.w);\n#else\nvec3 ambientOcclusionForDirectDiffuse=ambientOcclusionColor;\n#endif\n\n\n\nvec4 finalColor=vec4(\nfinalDiffuse*ambientOcclusionForDirectDiffuse*vLightingIntensity.x +\n#ifndef UNLIT\n#ifdef REFLECTION\nfinalIrradiance*ambientOcclusionColor*vLightingIntensity.z +\n#endif\n#ifdef SPECULARTERM\n\n\nfinalSpecularScaled +\n#endif\n#ifdef REFLECTION\n\n\nfinalRadianceScaled +\n#endif\n#ifdef REFRACTION\nfinalRefraction*vLightingIntensity.z +\n#endif\n#endif\nfinalEmissive*vLightingIntensity.y,\nalpha);\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\nfinalColor.rgb*=lightmapColor;\n#else\nfinalColor.rgb+=lightmapColor;\n#endif\n#endif\n#endif\n\nfinalColor=max(finalColor,0.0);\n#include<logDepthFragment>\n#include<fogFragment>(color,finalColor)\n#ifdef IMAGEPROCESSINGPOSTPROCESS\n\n\nfinalColor.rgb=clamp(finalColor.rgb,0.,30.0);\n#else\n\nfinalColor=applyImageProcessing(finalColor);\n#endif\n#ifdef PREMULTIPLYALPHA\n\nfinalColor.rgb*=finalColor.a;\n#endif\ngl_FragColor=finalColor;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n}",
                rgbdEncodePixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<helperFunctions>\nvoid main(void) \n{\ngl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);\n}",
                rgbdDecodePixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<helperFunctions>\nvoid main(void) \n{\ngl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);\n}",
                spritesVertexShader: "\nattribute vec4 position;\nattribute vec4 options;\nattribute vec4 cellInfo;\nattribute vec4 color;\n\nuniform vec2 textureInfos;\nuniform mat4 view;\nuniform mat4 projection;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#include<fogVertexDeclaration>\nvoid main(void) { \nvec3 viewPos=(view*vec4(position.xyz,1.0)).xyz; \nvec2 cornerPos;\nfloat angle=position.w;\nvec2 size=vec2(options.x,options.y);\nvec2 offset=options.zw;\nvec2 uvScale=textureInfos.xy;\ncornerPos=vec2(offset.x-0.5,offset.y-0.5)*size;\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\nviewPos+=rotatedCorner;\ngl_Position=projection*vec4(viewPos,1.0); \n\nvColor=color;\n\nvec2 uvOffset=vec2(abs(offset.x-cellInfo.x),1.0-abs(offset.y-cellInfo.y));\nvUV=(uvOffset+cellInfo.zw)*uvScale;\n\n#ifdef FOG\nvFogDistance=viewPos;\n#endif\n}",
                spritesPixelShader: "uniform bool alphaTest;\nvarying vec4 vColor;\n\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\nvec4 color=texture2D(diffuseSampler,vUV);\nif (alphaTest) \n{\nif (color.a<0.95)\ndiscard;\n}\ncolor*=vColor;\n#include<fogFragment>\ngl_FragColor=color;\n}",
                particlesVertexShader: "\nattribute vec3 position;\nattribute vec4 color;\nattribute float angle;\nattribute vec2 size;\n#ifdef ANIMATESHEET \nattribute float cellIndex;\n#endif\n#ifndef BILLBOARD \nattribute vec3 direction;\n#endif\n#ifdef BILLBOARDSTRETCHED\nattribute vec3 direction; \n#endif\n#ifdef RAMPGRADIENT\nattribute vec4 remapData;\n#endif\nattribute vec2 offset;\n\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\n#ifdef ANIMATESHEET \nuniform vec3 particlesInfos; \n#endif\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\n#endif\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration>\n#ifdef BILLBOARD\nuniform vec3 eyePosition; \n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner; \n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner; \n}\n#endif\nvoid main(void) { \nvec2 cornerPos;\ncornerPos=(vec2(offset.x-0.5,offset.y-0.5)-translationPivot)*size+translationPivot;\n#ifdef BILLBOARD \n\nvec3 rotatedCorner;\n#ifdef BILLBOARDY \nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=position-eyePosition;\nyaxis.y=0.;\nvec3 worldPos=rotate(normalize(yaxis),rotatedCorner);\nvec3 viewPos=(view*vec4(worldPos,1.0)).xyz; \n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=position-eyePosition; \nvec3 worldPos=rotateAlign(toCamera,rotatedCorner);\nvec3 viewPos=(view*vec4(worldPos,1.0)).xyz; \n#else\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner; \n#endif\n#ifdef RAMPGRADIENT\nremapRanges=remapData;\n#endif\n\ngl_Position=projection*vec4(viewPos,1.0); \n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=normalize(direction);\nvec3 worldPos=rotate(yaxis,rotatedCorner);\ngl_Position=projection*view*vec4(worldPos,1.0); \n#endif \nvColor=color;\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex/particlesInfos.z);\nfloat columnOffset=cellIndex-rowOffset*particlesInfos.z;\nvec2 uvScale=particlesInfos.xy;\nvec2 uvOffset=vec2(offset.x ,1.0-offset.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=offset;\n#endif\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4)\nvec4 worldPos=invView*vec4(viewPos,1.0);\n#endif\n#include<clipPlaneVertex>\n}",
                particlesPixelShader: "\nvarying vec2 vUV;\nvarying vec4 vColor;\nuniform vec4 textureMask;\nuniform sampler2D diffuseSampler;\n#include<clipPlaneFragmentDeclaration>\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\nuniform sampler2D rampSampler;\n#endif\nvoid main(void) {\n#include<clipPlaneFragment>\nvec4 textureColor=texture2D(diffuseSampler,vUV);\nvec4 baseColor=(textureColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;\n#ifdef RAMPGRADIENT\nfloat alpha=baseColor.a;\nfloat remappedColorIndex=clamp((alpha-remapRanges.x)/remapRanges.y,0.0,1.0);\nvec4 rampColor=texture2D(rampSampler,vec2(1.0-remappedColorIndex,0.));\nbaseColor.rgb*=rampColor.rgb;\n\nfloat finalAlpha=baseColor.a;\nbaseColor.a=clamp((alpha*rampColor.a-remapRanges.z)/remapRanges.w,0.0,1.0);\n#endif\n#ifdef BLENDMULTIPLYMODE\nfloat sourceAlpha=vColor.a*textureColor.a;\nbaseColor.rgb=baseColor.rgb*sourceAlpha+vec3(1.0)*(1.0-sourceAlpha);\n#endif\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\nbaseColor=applyImageProcessing(baseColor);\n#endif\n#endif\ngl_FragColor=baseColor;\n}",
                colorVertexShader: "\nattribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n}",
                colorPixelShader: "#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#else\nuniform vec4 color;\n#endif\nvoid main(void) {\n#ifdef VERTEXCOLOR\ngl_FragColor=vColor;\n#else\ngl_FragColor=color;\n#endif\n}",
                gpuRenderParticlesVertexShader: "#version 300 es\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\n\nin vec3 position;\nin float age;\nin float life;\nin vec3 size;\n#ifndef BILLBOARD\nin vec3 initialDirection;\n#endif\n#ifdef BILLBOARDSTRETCHED\nin vec3 direction;\n#endif\nin float angle;\n#ifdef ANIMATESHEET\nin float cellIndex;\n#endif\nin vec2 offset;\nin vec2 uv;\nout vec2 vUV;\nout vec4 vColor;\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration2>\n#ifdef COLORGRADIENTS\nuniform sampler2D colorGradientSampler;\n#else\nuniform vec4 colorDead;\nin vec4 color;\n#endif\n#ifdef ANIMATESHEET\nuniform vec3 sheetInfos;\n#endif\n#ifdef BILLBOARD\nuniform vec3 eyePosition; \n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner; \n}\n#endif\nvoid main() {\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex/sheetInfos.z);\nfloat columnOffset=cellIndex-rowOffset*sheetInfos.z;\nvec2 uvScale=sheetInfos.xy;\nvec2 uvOffset=vec2(uv.x ,1.0-uv.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else \nvUV=uv;\n#endif\nfloat ratio=age/life;\n#ifdef COLORGRADIENTS\nvColor=texture(colorGradientSampler,vec2(ratio,0));\n#else\nvColor=color*vec4(1.0-ratio)+colorDead*vec4(ratio);\n#endif\nvec2 cornerPos=(offset-translationPivot)*size.yz*size.x+translationPivot;\n#ifdef BILLBOARD\nvec4 rotatedCorner;\nrotatedCorner.w=0.;\n#ifdef BILLBOARDY \nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=position-eyePosition;\nyaxis.y=0.;\nvec3 worldPos=rotate(normalize(yaxis),rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(worldPos,1.0)); \n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=position-eyePosition; \nvec3 worldPos=rotateAlign(toCamera,rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(worldPos,1.0)); \n#else\n\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\nvec4 viewPosition=view*vec4(position,1.0)+rotatedCorner;\n#endif\n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=0.;\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nvec3 yaxis=normalize(initialDirection);\nvec3 worldPos=rotate(yaxis,rotatedCorner);\n\nvec4 viewPosition=view*vec4(worldPos,1.0); \n#endif\ngl_Position=projection*viewPosition;\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4)\nvec4 worldPos=invView*viewPosition;\n#endif \n#include<clipPlaneVertex>\n}",
                gpuRenderParticlesPixelShader: "#version 300 es\nuniform sampler2D textureSampler;\nin vec2 vUV;\nin vec4 vColor;\nout vec4 outFragColor;\n#include<clipPlaneFragmentDeclaration2> \n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\nvoid main() {\n#include<clipPlaneFragment> \nvec4 textureColor=texture(textureSampler,vUV);\noutFragColor=textureColor*vColor;\n#ifdef BLENDMULTIPLYMODE\nfloat alpha=vColor.a*textureColor.a;\noutFragColor.rgb=outFragColor.rgb*alpha+vec3(1.0)*(1.0-alpha); \n#endif \n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\noutFragColor.rgb=toLinearSpace(outFragColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\noutFragColor.rgb=toLinearSpace(outFragColor.rgb);\noutFragColor=applyImageProcessing(outFragColor);\n#endif\n#endif\n}\n",
                gpuUpdateParticlesVertexShader: "#version 300 es\n#define PI 3.14159\nuniform float currentCount;\nuniform float timeDelta;\nuniform float stopFactor;\nuniform mat4 emitterWM;\nuniform vec2 lifeTime;\nuniform vec2 emitPower;\nuniform vec2 sizeRange;\nuniform vec4 scaleRange;\n#ifndef COLORGRADIENTS\nuniform vec4 color1;\nuniform vec4 color2;\n#endif\nuniform vec3 gravity;\nuniform sampler2D randomSampler;\nuniform sampler2D randomSampler2;\nuniform vec4 angleRange;\n#ifdef BOXEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\nuniform vec3 minEmitBox;\nuniform vec3 maxEmitBox;\n#endif\n#ifdef POINTEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#endif\n#ifdef HEMISPHERICEMITTER\nuniform float radius;\nuniform float radiusRange;\nuniform float directionRandomizer;\n#endif\n#ifdef SPHEREEMITTER\nuniform float radius;\nuniform float radiusRange;\n#ifdef DIRECTEDSPHEREEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CYLINDEREMITTER\nuniform float radius;\nuniform float height;\nuniform float radiusRange;\n#ifdef DIRECTEDCYLINDEREMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CONEEMITTER\nuniform vec2 radius;\nuniform float coneAngle;\nuniform vec2 height;\nuniform float directionRandomizer;\n#endif\n\nin vec3 position;\nin float age;\nin float life;\nin vec4 seed;\nin vec3 size;\n#ifndef COLORGRADIENTS\nin vec4 color;\n#endif\nin vec3 direction;\n#ifndef BILLBOARD\nin vec3 initialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nin float angle;\n#else\nin vec2 angle;\n#endif\n#ifdef ANIMATESHEET\nin float cellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nin float cellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nin vec3 noiseCoordinates1;\nin vec3 noiseCoordinates2;\n#endif\n\nout vec3 outPosition;\nout float outAge;\nout float outLife;\nout vec4 outSeed;\nout vec3 outSize;\n#ifndef COLORGRADIENTS\nout vec4 outColor;\n#endif\nout vec3 outDirection;\n#ifndef BILLBOARD\nout vec3 outInitialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nout float outAngle;\n#else\nout vec2 outAngle;\n#endif\n#ifdef ANIMATESHEET\nout float outCellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nout float outCellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nout vec3 outNoiseCoordinates1;\nout vec3 outNoiseCoordinates2;\n#endif\n#ifdef SIZEGRADIENTS\nuniform sampler2D sizeGradientSampler;\n#endif \n#ifdef ANGULARSPEEDGRADIENTS\nuniform sampler2D angularSpeedGradientSampler;\n#endif \n#ifdef VELOCITYGRADIENTS\nuniform sampler2D velocityGradientSampler;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\nuniform sampler2D limitVelocityGradientSampler;\nuniform float limitVelocityDamping;\n#endif\n#ifdef DRAGGRADIENTS\nuniform sampler2D dragGradientSampler;\n#endif\n#ifdef NOISE\nuniform vec3 noiseStrength;\nuniform sampler2D noiseSampler;\n#endif\n#ifdef ANIMATESHEET\nuniform vec3 cellInfos;\n#endif\nvec3 getRandomVec3(float offset) {\nreturn texture(randomSampler2,vec2(float(gl_VertexID)*offset/currentCount,0)).rgb;\n}\nvec4 getRandomVec4(float offset) {\nreturn texture(randomSampler,vec2(float(gl_VertexID)*offset/currentCount,0));\n}\nvoid main() {\nfloat newAge=age+timeDelta; \n\nif (newAge>=life && stopFactor != 0.) {\nvec3 position;\nvec3 direction;\n\nvec4 randoms=getRandomVec4(seed.x);\n\noutLife=lifeTime.x+(lifeTime.y-lifeTime.x)*randoms.r;\noutAge=mod(newAge,outLife);\n\noutSeed=seed;\n\n#ifdef SIZEGRADIENTS \noutSize.x=texture(sizeGradientSampler,vec2(0,0)).r;\n#else\noutSize.x=sizeRange.x+(sizeRange.y-sizeRange.x)*randoms.g;\n#endif\noutSize.y=scaleRange.x+(scaleRange.y-scaleRange.x)*randoms.b;\noutSize.z=scaleRange.z+(scaleRange.w-scaleRange.z)*randoms.a; \n#ifndef COLORGRADIENTS\n\noutColor=color1+(color2-color1)*randoms.b;\n#endif\n\n#ifndef ANGULARSPEEDGRADIENTS \noutAngle.y=angleRange.x+(angleRange.y-angleRange.x)*randoms.a;\noutAngle.x=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#else\noutAngle=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#endif \n\n#ifdef POINTEMITTER\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\nposition=vec3(0,0,0);\ndirection=direction1+(direction2-direction1)*randoms3;\n#elif defined(BOXEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\nposition=minEmitBox+(maxEmitBox-minEmitBox)*randoms2;\ndirection=direction1+(direction2-direction1)*randoms3; \n#elif defined(HEMISPHERICEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat phi=2.0*PI*randoms2.x;\nfloat theta=acos(2.0*randoms2.y-1.0);\nfloat randX=cos(phi)*sin(theta);\nfloat randY=cos(theta);\nfloat randZ=sin(phi)*sin(theta);\nposition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,abs(randY),randZ);\ndirection=position+directionRandomizer*randoms3; \n#elif defined(SPHEREEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat phi=2.0*PI*randoms2.x;\nfloat theta=acos(2.0*randoms2.y-1.0);\nfloat randX=cos(phi)*sin(theta);\nfloat randY=cos(theta);\nfloat randZ=sin(phi)*sin(theta);\nposition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,randY,randZ);\n#ifdef DIRECTEDSPHEREEMITTER\ndirection=direction1+(direction2-direction1)*randoms3;\n#else\n\ndirection=position+directionRandomizer*randoms3;\n#endif\n#elif defined(CYLINDEREMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat yPos=(randoms2.x-0.5)*height;\nfloat angle=randoms2.y*PI*2.;\nfloat inverseRadiusRangeSquared=((1.-radiusRange)*(1.-radiusRange));\nfloat positionRadius=radius*sqrt(inverseRadiusRangeSquared+(randoms2.z*(1.-inverseRadiusRangeSquared)));\nfloat xPos=positionRadius*cos(angle);\nfloat zPos=positionRadius*sin(angle);\nposition=vec3(xPos,yPos,zPos);\n#ifdef DIRECTEDCYLINDEREMITTER\ndirection=direction1+(direction2-direction1)*randoms3;\n#else\n\nangle=angle+((randoms3.x-0.5)*PI);\ndirection=vec3(cos(angle),randoms3.y-0.5,sin(angle));\ndirection=normalize(direction);\n#endif\n#elif defined(CONEEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nfloat s=2.0*PI*randoms2.x;\n#ifdef CONEEMITTERSPAWNPOINT\nfloat h=0.00001;\n#else\nfloat h=randoms2.y*height.y;\n\nh=1.-h*h; \n#endif\nfloat lRadius=radius.x-radius.x*randoms2.z*radius.y;\nlRadius=lRadius*h;\nfloat randX=lRadius*sin(s);\nfloat randZ=lRadius*cos(s);\nfloat randY=h*height.x;\nposition=vec3(randX,randY,randZ); \n\nif (abs(cos(coneAngle)) == 1.0) {\ndirection=vec3(0.,1.0,0.);\n} else {\nvec3 randoms3=getRandomVec3(seed.z);\ndirection=position+directionRandomizer*randoms3;\n}\n#else \n\nposition=vec3(0.,0.,0.);\n\ndirection=2.0*(getRandomVec3(seed.w)-vec3(0.5,0.5,0.5));\n#endif\nfloat power=emitPower.x+(emitPower.y-emitPower.x)*randoms.a;\noutPosition=(emitterWM*vec4(position,1.)).xyz;\nvec3 initial=(emitterWM*vec4(direction,0.)).xyz;\noutDirection=initial*power;\n#ifndef BILLBOARD \noutInitialDirection=initial;\n#endif\n#ifdef ANIMATESHEET \noutCellIndex=cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=randoms.a*outLife;\n#endif \n#endif\n#ifdef NOISE\noutNoiseCoordinates1=noiseCoordinates1;\noutNoiseCoordinates2=noiseCoordinates2;\n#endif\n} else {\nfloat directionScale=timeDelta;\noutAge=newAge;\nfloat ageGradient=newAge/life;\n#ifdef VELOCITYGRADIENTS\ndirectionScale*=texture(velocityGradientSampler,vec2(ageGradient,0)).r;\n#endif\n#ifdef DRAGGRADIENTS\ndirectionScale*=1.0-texture(dragGradientSampler,vec2(ageGradient,0)).r;\n#endif\noutPosition=position+direction*directionScale;\noutLife=life;\noutSeed=seed;\n#ifndef COLORGRADIENTS \noutColor=color;\n#endif\n#ifdef SIZEGRADIENTS\noutSize.x=texture(sizeGradientSampler,vec2(ageGradient,0)).r;\noutSize.yz=size.yz;\n#else\noutSize=size;\n#endif \n#ifndef BILLBOARD \noutInitialDirection=initialDirection;\n#endif\nvec3 updatedDirection=direction+gravity*timeDelta;\n#ifdef LIMITVELOCITYGRADIENTS\nfloat limitVelocity=texture(limitVelocityGradientSampler,vec2(ageGradient,0)).r;\nfloat currentVelocity=length(updatedDirection);\nif (currentVelocity>limitVelocity) {\nupdatedDirection=updatedDirection*limitVelocityDamping;\n}\n#endif\noutDirection=updatedDirection;\n#ifdef NOISE\nvec3 localPosition=outPosition-emitterWM[3].xyz;\nfloat fetchedR=texture(noiseSampler,vec2(noiseCoordinates1.x,noiseCoordinates1.y)*vec2(0.5)+vec2(0.5)).r;\nfloat fetchedG=texture(noiseSampler,vec2(noiseCoordinates1.z,noiseCoordinates2.x)*vec2(0.5)+vec2(0.5)).r;\nfloat fetchedB=texture(noiseSampler,vec2(noiseCoordinates2.y,noiseCoordinates2.z)*vec2(0.5)+vec2(0.5)).r;\nvec3 force=vec3(2.*fetchedR-1.,2.*fetchedG-1.,2.*fetchedB-1.)*noiseStrength;\noutDirection=outDirection+force*timeDelta;\noutNoiseCoordinates1=noiseCoordinates1;\noutNoiseCoordinates2=noiseCoordinates2;\n#endif \n#ifdef ANGULARSPEEDGRADIENTS\nfloat angularSpeed=texture(angularSpeedGradientSampler,vec2(ageGradient,0)).r;\noutAngle=angle+angularSpeed*timeDelta;\n#else\noutAngle=vec2(angle.x+angle.y*timeDelta,angle.y);\n#endif\n#ifdef ANIMATESHEET \nfloat offsetAge=outAge;\nfloat dist=cellInfos.y-cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=cellStartOffset;\noffsetAge+=cellStartOffset;\n#endif \nfloat ratio=clamp(mod(offsetAge*cellInfos.z,life)/life,0.,1.0);\noutCellIndex=float(int(cellInfos.x+ratio*dist));\n#endif\n}\n}",
                gpuUpdateParticlesPixelShader: "#version 300 es\nvoid main() {\ndiscard;\n}\n",
                postprocessVertexShader: "\nattribute vec2 position;\nuniform vec2 scale;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) { \nvUV=(position*madd+madd)*scale;\ngl_Position=vec4(position,0.0,1.0);\n}",
                passPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nvoid main(void) \n{\ngl_FragColor=texture2D(textureSampler,vUV);\n}",
                shadowMapVertexShader: "\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\nuniform vec3 lightData;\n#endif\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\n#include<helperFunctions>\nuniform mat4 viewProjection;\nuniform vec3 biasAndScale;\nuniform vec2 depthValues;\nvarying float vDepthMetric;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvec3 worldNor=normalize(normalWorld*normal);\n#ifdef DIRECTIONINLIGHTDATA\nvec3 worldLightDir=normalize(-lightData.xyz);\n#else\nvec3 directionToLight=lightData.xyz-worldPos.xyz;\nvec3 worldLightDir=normalize(directionToLight);\n#endif\nfloat ndl=dot(worldNor,worldLightDir);\nfloat sinNL=sqrt(1.0-ndl*ndl);\nfloat normalBias=biasAndScale.y*sinNL;\nworldPos.xyz-=worldNor*normalBias;\n#endif\n\ngl_Position=viewProjection*worldPos;\n#ifdef DEPTHTEXTURE\n\ngl_Position.z+=biasAndScale.x*gl_Position.w;\n#endif\n\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y))+biasAndScale.x;\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}",
                shadowMapPixelShader: "#ifndef FLOAT\nvec4 pack(float depth)\n{\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(depth*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\n#endif\nvarying float vDepthMetric;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nuniform vec3 biasAndScale;\nuniform vec2 depthValues;\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\nfloat depth=vDepthMetric;\n#ifdef ESM\ndepth=clamp(exp(-min(87.,biasAndScale.z*depth)),0.,1.);\n#endif\n#ifdef FLOAT\ngl_FragColor=vec4(depth,1.0,1.0,1.0);\n#else\ngl_FragColor=pack(depth);\n#endif\n}",
                depthBoxBlurPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nvoid main(void)\n{\nvec4 colorDepth=vec4(0.0);\nfor (int x=-OFFSET; x<=OFFSET; x++)\nfor (int y=-OFFSET; y<=OFFSET; y++)\ncolorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);\ngl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));\n}",
                proceduralVertexShader: "\nattribute vec2 position;\n\nvarying vec2 vPosition;\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) { \nvPosition=position;\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}",
                depthVertexShader: "\nattribute vec3 position;\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nuniform vec2 depthValues;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvarying float vDepthMetric;\nvoid main(void)\n{\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}",
                depthPixelShader: "#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nvarying float vDepthMetric;\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\ngl_FragColor=vec4(vDepthMetric,vDepthMetric*vDepthMetric,0.0,1.0);\n}",
                geometryVertexShader: "precision highp float;\nprecision highp int;\n#include<bonesDeclaration>\n#include<instancesDeclaration>\nattribute vec3 position;\nattribute vec3 normal;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nvarying vec2 uv;\n#endif\n#ifdef UV2\nvarying vec2 uv2;\n#endif\n#endif\n\nuniform mat4 viewProjection;\nuniform mat4 view;\nvarying vec3 vNormalV;\nvarying vec4 vViewPos;\n#ifdef POSITION\nvarying vec3 vPosition;\n#endif\nvoid main(void)\n{\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 pos=vec4(finalWorld*vec4(position,1.0));\nvNormalV=normalize(vec3((view*finalWorld)*vec4(normal,0.0)));\nvViewPos=view*pos;\n#ifdef POSITION\nvPosition=pos.xyz/pos.w;\n#endif\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}",
                geometryPixelShader: "#extension GL_EXT_draw_buffers : require\nprecision highp float;\nprecision highp int;\nvarying vec3 vNormalV;\nvarying vec4 vViewPos;\n#ifdef POSITION\nvarying vec3 vPosition;\n#endif\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef POSITION\n#include<mrtFragmentDeclaration>[3]\n#else\n#include<mrtFragmentDeclaration>[2]\n#endif\nvoid main() {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\ngl_FragData[0]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);\n\ngl_FragData[1]=vec4(normalize(vNormalV),1.0);\n\n#ifdef POSITION\ngl_FragData[2]=vec4(vPosition,1.0);\n#endif\n}",
                ssaoPixelShader: "\nuniform sampler2D textureSampler;\nvarying vec2 vUV;\n#ifdef SSAO\nuniform sampler2D randomSampler;\nuniform float randTextureTiles;\nuniform float samplesFactor;\nuniform vec3 sampleSphere[SAMPLES];\nuniform float totalStrength;\nuniform float radius;\nuniform float area;\nuniform float fallOff;\nuniform float base;\nvec3 normalFromDepth(float depth,vec2 coords)\n{\nvec2 offset1=vec2(0.0,radius);\nvec2 offset2=vec2(radius,0.0);\nfloat depth1=texture2D(textureSampler,coords+offset1).r;\nfloat depth2=texture2D(textureSampler,coords+offset2).r;\nvec3 p1=vec3(offset1,depth1-depth);\nvec3 p2=vec3(offset2,depth2-depth);\nvec3 normal=cross(p1,p2);\nnormal.z=-normal.z;\nreturn normalize(normal);\n}\nvoid main()\n{\nvec3 random=normalize(texture2D(randomSampler,vUV*randTextureTiles).rgb);\nfloat depth=texture2D(textureSampler,vUV).r;\nvec3 position=vec3(vUV,depth);\nvec3 normal=normalFromDepth(depth,vUV);\nfloat radiusDepth=radius/depth;\nfloat occlusion=0.0;\nvec3 ray;\nvec3 hemiRay;\nfloat occlusionDepth;\nfloat difference;\nfor (int i=0; i<SAMPLES; i++)\n{\nray=radiusDepth*reflect(sampleSphere[i],random);\nhemiRay=position+sign(dot(ray,normal))*ray;\nocclusionDepth=texture2D(textureSampler,clamp(hemiRay.xy,vec2(0.001,0.001),vec2(0.999,0.999))).r;\ndifference=depth-occlusionDepth;\nocclusion+=step(fallOff,difference)*(1.0-smoothstep(fallOff,area,difference));\n}\nfloat ao=1.0-totalStrength*occlusion*samplesFactor;\nfloat result=clamp(ao+base,0.0,1.0);\ngl_FragColor.r=result;\ngl_FragColor.g=result;\ngl_FragColor.b=result;\ngl_FragColor.a=1.0;\n}\n#endif\n",
                ssao2PixelShader: "\nprecision highp float;\nuniform sampler2D textureSampler;\nuniform float near;\nuniform float far;\nuniform float radius;\nfloat scales[16]=float[16](\n0.1,\n0.11406250000000001,\n0.131640625,\n0.15625,\n0.187890625,\n0.2265625,\n0.272265625,\n0.325,\n0.384765625,\n0.4515625,\n0.525390625,\n0.60625,\n0.694140625,\n0.7890625,\n0.891015625,\n1.0\n);\nvarying vec2 vUV;\nfloat perspectiveDepthToViewZ( const in float invClipZ,const in float near,const in float far ) {\nreturn ( near*far )/( ( far-near )*invClipZ-far );\n}\nfloat viewZToPerspectiveDepth( const in float viewZ,const in float near,const in float far ) {\nreturn ( near*far/viewZ+far)/( far-near );\n}\nfloat viewZToOrthographicDepth( const in float viewZ,const in float near,const in float far ) {\nreturn ( viewZ+near )/( near-far );\n}\n#ifdef SSAO\nuniform sampler2D randomSampler;\nuniform sampler2D normalSampler;\nuniform float randTextureTiles;\nuniform float samplesFactor;\nuniform vec3 sampleSphere[SAMPLES];\nuniform float totalStrength;\nuniform float base;\nuniform float xViewport;\nuniform float yViewport;\nuniform float maxZ;\nuniform float minZAspect;\nuniform vec2 texelSize;\nuniform mat4 projection;\nvoid main()\n{\nvec3 random=texture2D(randomSampler,vUV*randTextureTiles).rgb;\nfloat depth=texture2D(textureSampler,vUV).r;\nfloat depthSign=depth/abs(depth);\ndepth=depth*depthSign;\nvec3 normal=texture2D(normalSampler,vUV).rgb; \nfloat occlusion=0.0;\nfloat correctedRadius=min(radius,minZAspect*depth/near);\nvec3 vViewRay=vec3((vUV.x*2.0-1.0)*xViewport,(vUV.y*2.0-1.0)*yViewport,depthSign);\nvec3 origin=vViewRay*depth;\nvec3 rvec=random*2.0-1.0;\nrvec.z=0.0;\n\nfloat dotProduct=dot(rvec,normal);\nrvec=1.0-abs(dotProduct)>1e-2 ? rvec : vec3(-rvec.y,0.0,rvec.x);\nvec3 tangent=normalize(rvec-normal*dot(rvec,normal));\nvec3 bitangent=cross(normal,tangent);\nmat3 tbn=mat3(tangent,bitangent,normal);\nfloat difference;\nfor (int i=0; i<SAMPLES; ++i) {\n\nvec3 samplePosition=scales[(i+int(random.x*16.0)) % 16]*tbn*sampleSphere[(i+int(random.y*16.0)) % 16];\nsamplePosition=samplePosition*correctedRadius+origin;\n\nvec4 offset=vec4(samplePosition,1.0);\noffset=projection*offset;\noffset.xyz/=offset.w;\noffset.xy=offset.xy*0.5+0.5;\nif (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {\ncontinue;\n}\n\nfloat sampleDepth=abs(texture2D(textureSampler,offset.xy).r);\n\ndifference=depthSign*samplePosition.z-sampleDepth;\nfloat rangeCheck=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);\nocclusion+=(difference>=0.0 ? 1.0 : 0.0)*rangeCheck;\n}\nocclusion=occlusion*(1.0-smoothstep(maxZ*0.75,maxZ,depth));\nfloat ao=1.0-totalStrength*occlusion*samplesFactor;\nfloat result=clamp(ao+base,0.0,1.0);\ngl_FragColor=vec4(vec3(result),1.0);\n}\n#endif\n#ifdef BILATERAL_BLUR\nuniform sampler2D depthSampler;\nuniform float outSize;\nuniform float samplerOffsets[SAMPLES];\nvec4 blur9(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.3846153846)*direction;\nvec2 off2=vec2(3.2307692308)*direction;\ncolor+=texture2D(image,uv)*0.2270270270;\ncolor+=texture2D(image,uv+(off1/resolution))*0.3162162162;\ncolor+=texture2D(image,uv-(off1/resolution))*0.3162162162;\ncolor+=texture2D(image,uv+(off2/resolution))*0.0702702703;\ncolor+=texture2D(image,uv-(off2/resolution))*0.0702702703;\nreturn color;\n}\nvec4 blur13(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.411764705882353)*direction;\nvec2 off2=vec2(3.2941176470588234)*direction;\nvec2 off3=vec2(5.176470588235294)*direction;\ncolor+=texture2D(image,uv)*0.1964825501511404;\ncolor+=texture2D(image,uv+(off1/resolution))*0.2969069646728344;\ncolor+=texture2D(image,uv-(off1/resolution))*0.2969069646728344;\ncolor+=texture2D(image,uv+(off2/resolution))*0.09447039785044732;\ncolor+=texture2D(image,uv-(off2/resolution))*0.09447039785044732;\ncolor+=texture2D(image,uv+(off3/resolution))*0.010381362401148057;\ncolor+=texture2D(image,uv-(off3/resolution))*0.010381362401148057;\nreturn color;\n}\nvec4 blur13Bilateral(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.411764705882353)*direction;\nvec2 off2=vec2(3.2941176470588234)*direction;\nvec2 off3=vec2(5.176470588235294)*direction;\nfloat compareDepth=abs(texture2D(depthSampler,uv).r);\nfloat sampleDepth;\nfloat weight;\nfloat weightSum=30.0;\ncolor+=texture2D(image,uv)*30.0;\nsampleDepth=abs(texture2D(depthSampler,uv+(off1/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off1/resolution))*weight;\nsampleDepth=abs(texture2D(depthSampler,uv-(off1/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off1/resolution))*weight;\nsampleDepth=abs(texture2D(depthSampler,uv+(off2/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off2/resolution))*weight;\nsampleDepth=abs(texture2D(depthSampler,uv-(off2/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off2/resolution))*weight;\nsampleDepth=abs(texture2D(depthSampler,uv+(off3/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off3/resolution))*weight;\nsampleDepth=abs(texture2D(depthSampler,uv-(off3/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off3/resolution))*weight;\nreturn color/weightSum;\n}\nvoid main()\n{\n#if EXPENSIVE\nfloat compareDepth=abs(texture2D(depthSampler,vUV).r);\nfloat texelsize=1.0/outSize;\nfloat result=0.0;\nfloat weightSum=0.0;\nfor (int i=0; i<SAMPLES; ++i)\n{\n#ifdef BILATERAL_BLUR_H\nvec2 direction=vec2(1.0,0.0);\nvec2 sampleOffset=vec2(texelsize*samplerOffsets[i],0.0);\n#else\nvec2 direction=vec2(0.0,1.0);\nvec2 sampleOffset=vec2(0.0,texelsize*samplerOffsets[i]);\n#endif\nvec2 samplePos=vUV+sampleOffset;\nfloat sampleDepth=abs(texture2D(depthSampler,samplePos).r);\nfloat weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30000.0);\nresult+=texture2D(textureSampler,samplePos).r*weight;\nweightSum+=weight;\n}\nresult/=weightSum;\ngl_FragColor.rgb=vec3(result);\ngl_FragColor.a=1.0;\n#else\nvec4 color;\n#ifdef BILATERAL_BLUR_H\nvec2 direction=vec2(1.0,0.0);\ncolor=blur13Bilateral(textureSampler,vUV,outSize,direction);\n#else\nvec2 direction=vec2(0.0,1.0);\ncolor=blur13Bilateral(textureSampler,vUV,outSize,direction);\n#endif\ngl_FragColor.rgb=vec3(color.r);\ngl_FragColor.a=1.0;\n#endif\n}\n#endif\n",
                ssaoCombinePixelShader: "uniform sampler2D textureSampler;\nuniform sampler2D originalColor;\nuniform vec4 viewport;\nvarying vec2 vUV;\nvoid main(void) {\nvec4 ssaoColor=texture2D(textureSampler,viewport.xy+vUV*viewport.zw);\nvec4 sceneColor=texture2D(originalColor,vUV);\ngl_FragColor=sceneColor*ssaoColor;\n}\n",
                lensHighlightsPixelShader: "\nuniform sampler2D textureSampler; \n\nuniform float gain;\nuniform float threshold;\nuniform float screen_width;\nuniform float screen_height;\n\nvarying vec2 vUV;\n\nvec4 highlightColor(vec4 color) {\nvec4 highlight=color;\nfloat luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));\nfloat lum_threshold;\nif (threshold>1.0) { lum_threshold=0.94+0.01*threshold; }\nelse { lum_threshold=0.5+0.44*threshold; }\nluminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);\nhighlight*=luminance*gain;\nhighlight.a=1.0;\nreturn highlight;\n}\nvoid main(void)\n{\nvec4 original=texture2D(textureSampler,vUV);\n\nif (gain == -1.0) {\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\nreturn;\n}\nfloat w=2.0/screen_width;\nfloat h=2.0/screen_height;\nfloat weight=1.0;\n\nvec4 blurred=vec4(0.0,0.0,0.0,0.0);\n#ifdef PENTAGON\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));\n#else\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));\n#endif\nblurred/=39.0;\ngl_FragColor=blurred;\n\n}",
                depthOfFieldPixelShader: "\n\n\n\n\nuniform sampler2D textureSampler;\nuniform sampler2D highlightsSampler;\nuniform sampler2D depthSampler;\nuniform sampler2D grainSampler;\n\nuniform float grain_amount;\nuniform bool blur_noise;\nuniform float screen_width;\nuniform float screen_height;\nuniform float distortion;\nuniform bool dof_enabled;\n\nuniform float screen_distance; \nuniform float aperture;\nuniform float darken;\nuniform float edge_blur;\nuniform bool highlights;\n\nuniform float near;\nuniform float far;\n\nvarying vec2 vUV;\n\n#define PI 3.14159265\n#define TWOPI 6.28318530\n#define inverse_focal_length 0.1 \n\nvec2 centered_screen_pos;\nvec2 distorted_coords;\nfloat radius2;\nfloat radius;\n\nvec2 rand(vec2 co)\n{\nfloat noise1=(fract(sin(dot(co,vec2(12.9898,78.233)))*43758.5453));\nfloat noise2=(fract(sin(dot(co,vec2(12.9898,78.233)*2.0))*43758.5453));\nreturn clamp(vec2(noise1,noise2),0.0,1.0);\n}\n\nvec2 getDistortedCoords(vec2 coords) {\nif (distortion == 0.0) { return coords; }\nvec2 direction=1.0*normalize(centered_screen_pos);\nvec2 dist_coords=vec2(0.5,0.5);\ndist_coords.x=0.5+direction.x*radius2*1.0;\ndist_coords.y=0.5+direction.y*radius2*1.0;\nfloat dist_amount=clamp(distortion*0.23,0.0,1.0);\ndist_coords=mix(coords,dist_coords,dist_amount);\nreturn dist_coords;\n}\n\nfloat sampleScreen(inout vec4 color,const in vec2 offset,const in float weight) {\n\nvec2 coords=distorted_coords;\nfloat angle=rand(coords*100.0).x*TWOPI;\ncoords+=vec2(offset.x*cos(angle)-offset.y*sin(angle),offset.x*sin(angle)+offset.y*cos(angle));\ncolor+=texture2D(textureSampler,coords)*weight;\nreturn weight;\n}\n\nfloat getBlurLevel(float size) {\nreturn min(3.0,ceil(size/1.0));\n}\n\nvec4 getBlurColor(float size) {\nvec4 col=texture2D(textureSampler,distorted_coords);\nif (size == 0.0) { return col; }\n\n\nfloat blur_level=getBlurLevel(size);\nfloat w=(size/screen_width);\nfloat h=(size/screen_height);\nfloat total_weight=1.0;\nvec2 sample_coords;\ntotal_weight+=sampleScreen(col,vec2(-0.50*w,0.24*h),0.93);\ntotal_weight+=sampleScreen(col,vec2(0.30*w,-0.75*h),0.90);\ntotal_weight+=sampleScreen(col,vec2(0.36*w,0.96*h),0.87);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,-0.55*h),0.85);\ntotal_weight+=sampleScreen(col,vec2(1.33*w,-0.37*h),0.83);\ntotal_weight+=sampleScreen(col,vec2(-0.82*w,1.31*h),0.80);\ntotal_weight+=sampleScreen(col,vec2(-0.31*w,-1.67*h),0.78);\ntotal_weight+=sampleScreen(col,vec2(1.47*w,1.11*h),0.76);\ntotal_weight+=sampleScreen(col,vec2(-1.97*w,0.19*h),0.74);\ntotal_weight+=sampleScreen(col,vec2(1.42*w,-1.57*h),0.72);\nif (blur_level>1.0) {\ntotal_weight+=sampleScreen(col,vec2(0.01*w,2.25*h),0.70);\ntotal_weight+=sampleScreen(col,vec2(-1.62*w,-1.74*h),0.67);\ntotal_weight+=sampleScreen(col,vec2(2.49*w,0.20*h),0.65);\ntotal_weight+=sampleScreen(col,vec2(-2.07*w,1.61*h),0.63);\ntotal_weight+=sampleScreen(col,vec2(0.46*w,-2.70*h),0.61);\ntotal_weight+=sampleScreen(col,vec2(1.55*w,2.40*h),0.59);\ntotal_weight+=sampleScreen(col,vec2(-2.88*w,-0.75*h),0.56);\ntotal_weight+=sampleScreen(col,vec2(2.73*w,-1.44*h),0.54);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,3.02*h),0.52);\ntotal_weight+=sampleScreen(col,vec2(-1.28*w,-3.05*h),0.49);\n}\nif (blur_level>2.0) {\ntotal_weight+=sampleScreen(col,vec2(3.11*w,1.43*h),0.46);\ntotal_weight+=sampleScreen(col,vec2(-3.36*w,1.08*h),0.44);\ntotal_weight+=sampleScreen(col,vec2(1.80*w,-3.16*h),0.41);\ntotal_weight+=sampleScreen(col,vec2(0.83*w,3.65*h),0.38);\ntotal_weight+=sampleScreen(col,vec2(-3.16*w,-2.19*h),0.34);\ntotal_weight+=sampleScreen(col,vec2(3.92*w,-0.53*h),0.31);\ntotal_weight+=sampleScreen(col,vec2(-2.59*w,3.12*h),0.26);\ntotal_weight+=sampleScreen(col,vec2(-0.20*w,-4.15*h),0.22);\ntotal_weight+=sampleScreen(col,vec2(3.02*w,3.00*h),0.15);\n}\ncol/=total_weight; \n\nif (darken>0.0) {\ncol.rgb*=clamp(0.3,1.0,1.05-size*0.5*darken);\n}\n\n\n\n\nreturn col;\n}\nvoid main(void)\n{\n\ncentered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);\nradius2=centered_screen_pos.x*centered_screen_pos.x+centered_screen_pos.y*centered_screen_pos.y;\nradius=sqrt(radius2);\ndistorted_coords=getDistortedCoords(vUV); \nvec2 texels_coords=vec2(vUV.x*screen_width,vUV.y*screen_height); \nfloat depth=texture2D(depthSampler,distorted_coords).r; \nfloat distance=near+(far-near)*depth; \nvec4 color=texture2D(textureSampler,vUV); \n\n\nfloat coc=abs(aperture*(screen_distance*(inverse_focal_length-1.0/distance)-1.0));\n\nif (dof_enabled == false || coc<0.07) { coc=0.0; }\n\nfloat edge_blur_amount=0.0;\nif (edge_blur>0.0) {\nedge_blur_amount=clamp((radius*2.0-1.0+0.15*edge_blur)*1.5,0.0,1.0)*1.3;\n}\n\nfloat blur_amount=max(edge_blur_amount,coc);\n\nif (blur_amount == 0.0) {\ngl_FragColor=texture2D(textureSampler,distorted_coords);\n}\nelse {\n\ngl_FragColor=getBlurColor(blur_amount*1.7);\n\nif (highlights) {\ngl_FragColor.rgb+=clamp(coc,0.0,1.0)*texture2D(highlightsSampler,distorted_coords).rgb;\n}\nif (blur_noise) {\n\nvec2 noise=rand(distorted_coords)*0.01*blur_amount;\nvec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);\ngl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;\n}\n}\n\nif (grain_amount>0.0) {\nvec4 grain_color=texture2D(grainSampler,texels_coords*0.003);\ngl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;\n}\n}\n",
                standardPixelShader: "uniform sampler2D textureSampler;\nvarying vec2 vUV;\n#if defined(PASS_POST_PROCESS)\nvoid main(void)\n{\nvec4 color=texture2D(textureSampler,vUV);\ngl_FragColor=color;\n}\n#endif\n#if defined(DOWN_SAMPLE_X4)\nuniform vec2 dsOffsets[16];\nvoid main(void)\n{\nvec4 average=vec4(0.0,0.0,0.0,0.0);\naverage=texture2D(textureSampler,vUV+dsOffsets[0]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[1]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[2]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[3]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[4]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[5]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[6]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[7]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[8]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[9]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[10]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[11]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[12]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[13]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[14]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[15]);\naverage/=16.0;\ngl_FragColor=average;\n}\n#endif\n#if defined(BRIGHT_PASS)\nuniform vec2 dsOffsets[4];\nuniform float brightThreshold;\nvoid main(void)\n{\nvec4 average=vec4(0.0,0.0,0.0,0.0);\naverage=texture2D(textureSampler,vUV+vec2(dsOffsets[0].x,dsOffsets[0].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[1].x,dsOffsets[1].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[2].x,dsOffsets[2].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[3].x,dsOffsets[3].y));\naverage*=0.25;\nfloat luminance=length(average.rgb);\nif (luminance<brightThreshold) {\naverage=vec4(0.0,0.0,0.0,1.0);\n}\ngl_FragColor=average;\n}\n#endif\n#if defined(TEXTURE_ADDER)\nuniform sampler2D otherSampler;\nuniform sampler2D lensSampler;\nuniform float exposure;\nvoid main(void)\n{\nvec3 colour=texture2D(textureSampler,vUV).rgb;\ncolour*=exposure;\nvec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);\nvec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);\ncolour=retColor*retColor;\ncolour+=colour*texture2D(lensSampler,vUV).rgb;\nvec4 finalColor=vec4(colour.rgb,1.0)+texture2D(otherSampler,vUV);\ngl_FragColor=finalColor;\n}\n#endif\n#if defined(VLS)\n#define PI 3.1415926535897932384626433832795\nuniform mat4 shadowViewProjection;\nuniform mat4 lightWorld;\nuniform vec3 cameraPosition;\nuniform vec3 sunDirection;\nuniform vec3 sunColor;\nuniform vec2 depthValues;\nuniform float scatteringCoefficient;\nuniform float scatteringPower;\nuniform sampler2D shadowMapSampler;\nuniform sampler2D positionSampler;\nfloat computeScattering(float lightDotView)\n{\nfloat result=1.0-scatteringCoefficient*scatteringCoefficient;\nresult/=(4.0*PI*pow(1.0+scatteringCoefficient*scatteringCoefficient-(2.0*scatteringCoefficient)*lightDotView,1.5));\nreturn result;\n}\nvoid main(void)\n{\n\nvec3 worldPos=texture2D(positionSampler,vUV).rgb;\nvec3 startPosition=cameraPosition;\nvec3 rayVector=worldPos-startPosition;\nfloat rayLength=length(rayVector);\nvec3 rayDirection=rayVector/rayLength;\nfloat stepLength=rayLength/NB_STEPS;\nvec3 stepL=rayDirection*stepLength;\nvec3 currentPosition=startPosition;\nvec3 accumFog=vec3(0.0);\nfor (int i=0; i<int(NB_STEPS); i++)\n{\nvec4 worldInShadowCameraSpace=shadowViewProjection*vec4(currentPosition,1.0);\nfloat depthMetric=(worldInShadowCameraSpace.z+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depthMetric,0.0,1.0);\nworldInShadowCameraSpace.xyz/=worldInShadowCameraSpace.w;\nworldInShadowCameraSpace.xyz=0.5*worldInShadowCameraSpace.xyz+vec3(0.5);\nfloat shadowMapValue=texture2D(shadowMapSampler,worldInShadowCameraSpace.xy).r;\nif (shadowMapValue>shadowPixelDepth)\naccumFog+=sunColor*computeScattering(dot(rayDirection,sunDirection));\ncurrentPosition+=stepL;\n}\naccumFog/=NB_STEPS;\nvec3 color=accumFog*scatteringPower;\ngl_FragColor=vec4(color*exp(color) ,1.0);\n}\n#endif\n#if defined(VLSMERGE)\nuniform sampler2D originalSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(originalSampler,vUV)+texture2D(textureSampler,vUV);\n}\n#endif\n#if defined(LUMINANCE)\nuniform vec2 lumOffsets[4];\nvoid main()\n{\nfloat average=0.0;\nvec4 color=vec4(0.0);\nfloat maximum=-1e20;\nvec3 weight=vec3(0.299,0.587,0.114);\nfor (int i=0; i<4; i++)\n{\ncolor=texture2D(textureSampler,vUV+ lumOffsets[i]);\n\nfloat GreyValue=dot(color.rgb,vec3(0.33,0.33,0.33));\n\n#ifdef WEIGHTED_AVERAGE\nfloat GreyValue=dot(color.rgb,weight);\n#endif\n#ifdef BRIGHTNESS\nfloat GreyValue=max(color.r,max(color.g,color.b));\n#endif\n#ifdef HSL_COMPONENT\nfloat GreyValue=0.5*(max(color.r,max(color.g,color.b))+min(color.r,min(color.g,color.b)));\n#endif\n#ifdef MAGNITUDE\nfloat GreyValue=length(color.rgb);\n#endif\nmaximum=max(maximum,GreyValue);\naverage+=(0.25*log(1e-5+GreyValue));\n}\naverage=exp(average);\ngl_FragColor=vec4(average,maximum,0.0,1.0);\n}\n#endif\n#if defined(LUMINANCE_DOWN_SAMPLE)\nuniform vec2 dsOffsets[9];\nuniform float halfDestPixelSize;\n#ifdef FINAL_DOWN_SAMPLER\nvec4 pack(float value) {\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(value*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\n#endif\nvoid main()\n{\nvec4 color=vec4(0.0);\nfloat average=0.0;\nfor (int i=0; i<9; i++)\n{\ncolor=texture2D(textureSampler,vUV+vec2(halfDestPixelSize,halfDestPixelSize)+dsOffsets[i]);\naverage+=color.r;\n}\naverage/=9.0;\n#ifdef FINAL_DOWN_SAMPLER\ngl_FragColor=pack(average);\n#else\ngl_FragColor=vec4(average,average,0.0,1.0);\n#endif\n}\n#endif\n#if defined(HDR)\nuniform sampler2D textureAdderSampler;\nuniform float averageLuminance;\nvoid main()\n{\nvec4 color=texture2D(textureAdderSampler,vUV);\nvec4 adjustedColor=color/averageLuminance;\ncolor=adjustedColor;\ncolor.a=1.0;\ngl_FragColor=color;\n}\n#endif\n#if defined(LENS_FLARE)\n#define GHOSTS 3\nuniform sampler2D lensColorSampler;\nuniform float strength;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform vec2 resolution;\nuniform float distortionStrength;\nfloat hash(vec2 p)\n{\nfloat h=dot(p,vec2(127.1,311.7));\nreturn -1.0+2.0*fract(sin(h)*43758.5453123);\n}\nfloat noise(in vec2 p)\n{\nvec2 i=floor(p);\nvec2 f=fract(p);\nvec2 u=f*f*(3.0-2.0*f);\nreturn mix(mix(hash(i+vec2(0.0,0.0)),\nhash(i+vec2(1.0,0.0)),u.x),\nmix(hash(i+vec2(0.0,1.0)),\nhash(i+vec2(1.0,1.0)),u.x),u.y);\n}\nfloat fbm(vec2 p)\n{\nfloat f=0.0;\nf+=0.5000*noise(p); p*=2.02;\nf+=0.2500*noise(p); p*=2.03;\nf+=0.1250*noise(p); p*=2.01;\nf+=0.0625*noise(p); p*=2.04;\nf/=0.9375;\nreturn f;\n}\nvec3 pattern(vec2 uv)\n{\nvec2 p=-1.0+2.0*uv;\nfloat p2=dot(p,p);\nfloat f=fbm(vec2(15.0*p2))/2.0;\nfloat r=0.2+0.6*sin(12.5*length(uv-vec2(0.5)));\nfloat g=0.2+0.6*sin(20.5*length(uv-vec2(0.5)));\nfloat b=0.2+0.6*sin(17.2*length(uv-vec2(0.5)));\nreturn (1.0-f)*vec3(r,g,b);\n}\nfloat luminance(vec3 color)\n{\nreturn dot(color.rgb,vec3(0.2126,0.7152,0.0722));\n}\nvec4 textureDistorted(sampler2D tex,vec2 texcoord,vec2 direction,vec3 distortion)\n{\nreturn vec4(\ntexture2D(tex,texcoord+direction*distortion.r).r,\ntexture2D(tex,texcoord+direction*distortion.g).g,\ntexture2D(tex,texcoord+direction*distortion.b).b,\n1.0\n);\n}\nvoid main(void)\n{\nvec2 uv=-vUV+vec2(1.0);\nvec2 ghostDir=(vec2(0.5)-uv)*ghostDispersal;\nvec2 texelSize=1.0/resolution;\nvec3 distortion=vec3(-texelSize.x*distortionStrength,0.0,texelSize.x*distortionStrength);\nvec4 result=vec4(0.0);\nfloat ghostIndice=1.0;\nfor (int i=0; i<GHOSTS; ++i)\n{\nvec2 offset=fract(uv+ghostDir*ghostIndice);\nfloat weight=length(vec2(0.5)-offset)/length(vec2(0.5));\nweight=pow(1.0-weight,10.0);\nresult+=textureDistorted(textureSampler,offset,normalize(ghostDir),distortion)*weight*strength;\nghostIndice+=1.0;\n}\nvec2 haloVec=normalize(ghostDir)*haloWidth;\nfloat weight=length(vec2(0.5)-fract(uv+haloVec))/length(vec2(0.5));\nweight=pow(1.0-weight,10.0);\nresult+=textureDistorted(textureSampler,fract(uv+haloVec),normalize(ghostDir),distortion)*weight*strength;\nresult*=texture2D(lensColorSampler,vec2(length(vec2(0.5)-uv)/length(vec2(0.5))));\ngl_FragColor=result;\n}\n#endif\n#if defined(LENS_FLARE_COMPOSE)\nuniform sampler2D otherSampler;\nuniform sampler2D lensDirtSampler;\nuniform sampler2D lensStarSampler;\nuniform mat4 lensStarMatrix;\nvoid main(void)\n{\nvec2 lensFlareCoords=(lensStarMatrix*vec4(vUV,1.0,1.0)).xy;\nvec4 lensMod=texture2D(lensDirtSampler,vUV);\nlensMod+=texture2D(lensStarSampler,vUV);\nvec4 result=texture2D(textureSampler,vUV)*lensMod;\ngl_FragColor=texture2D(otherSampler,vUV)+result;\n}\n#endif\n#if defined(DEPTH_OF_FIELD)\nuniform sampler2D otherSampler;\nuniform sampler2D depthSampler;\nuniform float distance;\nvoid main(void)\n{\nvec4 sharp=texture2D(otherSampler,vUV);\nvec4 blur=texture2D(textureSampler,vUV);\nfloat dist=clamp(texture2D(depthSampler,vUV).r*distance,0.0,1.0);\nfloat factor=0.0;\nif (dist<0.05)\nfactor=1.0;\nelse if (dist<0.1)\nfactor=20.0*(0.1-dist);\nelse if (dist<0.5)\nfactor=0.0;\nelse\nfactor=2.0*(dist-0.5);\nfactor=clamp(factor,0.0,0.90);\ngl_FragColor=mix(sharp,blur,factor);\n}\n#endif\n#if defined(MOTION_BLUR)\nuniform mat4 inverseViewProjection;\nuniform mat4 prevViewProjection;\nuniform vec2 screenSize;\nuniform float motionScale;\nuniform float motionStrength;\nuniform sampler2D depthSampler;\nvoid main(void)\n{\nvec2 texelSize=1.0/screenSize;\nfloat depth=texture2D(depthSampler,vUV).r;\nvec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);\ncpos=cpos*inverseViewProjection;\nvec4 ppos=cpos*prevViewProjection;\nppos.xyz/=ppos.w;\nppos.xy=ppos.xy*0.5+0.5;\nvec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint nSamples=int(clamp(speed,1.0,MAX_MOTION_SAMPLES));\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(MAX_MOTION_SAMPLES); ++i) {\nif (i>=nSamples)\nbreak;\nvec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);\nresult+=texture2D(textureSampler,offset1);\n}\ngl_FragColor=result/float(nSamples);\n}\n#endif\n",
                fxaaVertexShader: "\nattribute vec2 position;\nuniform vec2 texelSize;\n\nvarying vec2 vUV;\nvarying vec2 sampleCoordS;\nvarying vec2 sampleCoordE;\nvarying vec2 sampleCoordN;\nvarying vec2 sampleCoordW;\nvarying vec2 sampleCoordNW;\nvarying vec2 sampleCoordSE;\nvarying vec2 sampleCoordNE;\nvarying vec2 sampleCoordSW;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) { \nvUV=(position*madd+madd);\nsampleCoordS=vUV+vec2( 0.0,1.0)*texelSize;\nsampleCoordE=vUV+vec2( 1.0,0.0)*texelSize;\nsampleCoordN=vUV+vec2( 0.0,-1.0)*texelSize;\nsampleCoordW=vUV+vec2(-1.0,0.0)*texelSize;\nsampleCoordNW=vUV+vec2(-1.0,-1.0)*texelSize;\nsampleCoordSE=vUV+vec2( 1.0,1.0)*texelSize;\nsampleCoordNE=vUV+vec2( 1.0,-1.0)*texelSize;\nsampleCoordSW=vUV+vec2(-1.0,1.0)*texelSize;\ngl_Position=vec4(position,0.0,1.0);\n}",
                fxaaPixelShader: "uniform sampler2D textureSampler;\nuniform vec2 texelSize;\nvarying vec2 vUV;\nvarying vec2 sampleCoordS;\nvarying vec2 sampleCoordE;\nvarying vec2 sampleCoordN;\nvarying vec2 sampleCoordW;\nvarying vec2 sampleCoordNW;\nvarying vec2 sampleCoordSE;\nvarying vec2 sampleCoordNE;\nvarying vec2 sampleCoordSW;\nconst float fxaaQualitySubpix=1.0;\nconst float fxaaQualityEdgeThreshold=0.166;\nconst float fxaaQualityEdgeThresholdMin=0.0833;\nconst vec3 kLumaCoefficients=vec3(0.2126,0.7152,0.0722);\n#define FxaaLuma(rgba) dot(rgba.rgb,kLumaCoefficients)\nvoid main(){\nvec2 posM;\nposM.x=vUV.x;\nposM.y=vUV.y;\nvec4 rgbyM=texture2D(textureSampler,vUV,0.0);\nfloat lumaM=FxaaLuma(rgbyM);\nfloat lumaS=FxaaLuma(texture2D(textureSampler,sampleCoordS,0.0));\nfloat lumaE=FxaaLuma(texture2D(textureSampler,sampleCoordE,0.0));\nfloat lumaN=FxaaLuma(texture2D(textureSampler,sampleCoordN,0.0));\nfloat lumaW=FxaaLuma(texture2D(textureSampler,sampleCoordW,0.0));\nfloat maxSM=max(lumaS,lumaM);\nfloat minSM=min(lumaS,lumaM);\nfloat maxESM=max(lumaE,maxSM);\nfloat minESM=min(lumaE,minSM);\nfloat maxWN=max(lumaN,lumaW);\nfloat minWN=min(lumaN,lumaW);\nfloat rangeMax=max(maxWN,maxESM);\nfloat rangeMin=min(minWN,minESM);\nfloat rangeMaxScaled=rangeMax*fxaaQualityEdgeThreshold;\nfloat range=rangeMax-rangeMin;\nfloat rangeMaxClamped=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);\n#ifndef MALI\nif(range<rangeMaxClamped) \n{\ngl_FragColor=rgbyM;\nreturn;\n}\n#endif\nfloat lumaNW=FxaaLuma(texture2D(textureSampler,sampleCoordNW,0.0));\nfloat lumaSE=FxaaLuma(texture2D(textureSampler,sampleCoordSE,0.0));\nfloat lumaNE=FxaaLuma(texture2D(textureSampler,sampleCoordNE,0.0));\nfloat lumaSW=FxaaLuma(texture2D(textureSampler,sampleCoordSW,0.0));\nfloat lumaNS=lumaN+lumaS;\nfloat lumaWE=lumaW+lumaE;\nfloat subpixRcpRange=1.0/range;\nfloat subpixNSWE=lumaNS+lumaWE;\nfloat edgeHorz1=(-2.0*lumaM)+lumaNS;\nfloat edgeVert1=(-2.0*lumaM)+lumaWE;\nfloat lumaNESE=lumaNE+lumaSE;\nfloat lumaNWNE=lumaNW+lumaNE;\nfloat edgeHorz2=(-2.0*lumaE)+lumaNESE;\nfloat edgeVert2=(-2.0*lumaN)+lumaNWNE;\nfloat lumaNWSW=lumaNW+lumaSW;\nfloat lumaSWSE=lumaSW+lumaSE;\nfloat edgeHorz4=(abs(edgeHorz1)*2.0)+abs(edgeHorz2);\nfloat edgeVert4=(abs(edgeVert1)*2.0)+abs(edgeVert2);\nfloat edgeHorz3=(-2.0*lumaW)+lumaNWSW;\nfloat edgeVert3=(-2.0*lumaS)+lumaSWSE;\nfloat edgeHorz=abs(edgeHorz3)+edgeHorz4;\nfloat edgeVert=abs(edgeVert3)+edgeVert4;\nfloat subpixNWSWNESE=lumaNWSW+lumaNESE;\nfloat lengthSign=texelSize.x;\nbool horzSpan=edgeHorz>=edgeVert;\nfloat subpixA=subpixNSWE*2.0+subpixNWSWNESE;\nif (!horzSpan)\n{\nlumaN=lumaW;\n}\nif (!horzSpan) \n{\nlumaS=lumaE;\n}\nif (horzSpan) \n{\nlengthSign=texelSize.y;\n}\nfloat subpixB=(subpixA*(1.0/12.0))-lumaM;\nfloat gradientN=lumaN-lumaM;\nfloat gradientS=lumaS-lumaM;\nfloat lumaNN=lumaN+lumaM;\nfloat lumaSS=lumaS+lumaM;\nbool pairN=abs(gradientN)>=abs(gradientS);\nfloat gradient=max(abs(gradientN),abs(gradientS));\nif (pairN)\n{\nlengthSign=-lengthSign;\n}\nfloat subpixC=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);\nvec2 posB;\nposB.x=posM.x;\nposB.y=posM.y;\nvec2 offNP;\noffNP.x=(!horzSpan) ? 0.0 : texelSize.x;\noffNP.y=(horzSpan) ? 0.0 : texelSize.y;\nif (!horzSpan) \n{\nposB.x+=lengthSign*0.5;\n}\nif (horzSpan)\n{\nposB.y+=lengthSign*0.5;\n}\nvec2 posN;\nposN.x=posB.x-offNP.x*1.5;\nposN.y=posB.y-offNP.y*1.5;\nvec2 posP;\nposP.x=posB.x+offNP.x*1.5;\nposP.y=posB.y+offNP.y*1.5;\nfloat subpixD=((-2.0)*subpixC)+3.0;\nfloat lumaEndN=FxaaLuma(texture2D(textureSampler,posN,0.0));\nfloat subpixE=subpixC*subpixC;\nfloat lumaEndP=FxaaLuma(texture2D(textureSampler,posP,0.0));\nif (!pairN) \n{\nlumaNN=lumaSS;\n}\nfloat gradientScaled=gradient*1.0/4.0;\nfloat lumaMM=lumaM-lumaNN*0.5;\nfloat subpixF=subpixD*subpixE;\nbool lumaMLTZero=lumaMM<0.0;\nlumaEndN-=lumaNN*0.5;\nlumaEndP-=lumaNN*0.5;\nbool doneN=abs(lumaEndN)>=gradientScaled;\nbool doneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN) \n{\nposN.x-=offNP.x*3.0;\n}\nif (!doneN) \n{\nposN.y-=offNP.y*3.0;\n}\nbool doneNP=(!doneN) || (!doneP);\nif (!doneP) \n{\nposP.x+=offNP.x*3.0;\n}\nif (!doneP)\n{\nposP.y+=offNP.y*3.0;\n}\nif (doneNP)\n{\nif (!doneN) lumaEndN=FxaaLuma(texture2D(textureSampler,posN.xy,0.0));\nif (!doneP) lumaEndP=FxaaLuma(texture2D(textureSampler,posP.xy,0.0));\nif (!doneN) lumaEndN=lumaEndN-lumaNN*0.5;\nif (!doneP) lumaEndP=lumaEndP-lumaNN*0.5;\ndoneN=abs(lumaEndN)>=gradientScaled;\ndoneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN) posN.x-=offNP.x*12.0;\nif (!doneN) posN.y-=offNP.y*12.0;\ndoneNP=(!doneN) || (!doneP);\nif (!doneP) posP.x+=offNP.x*12.0;\nif (!doneP) posP.y+=offNP.y*12.0;\n}\nfloat dstN=posM.x-posN.x;\nfloat dstP=posP.x-posM.x;\nif (!horzSpan)\n{\ndstN=posM.y-posN.y;\n}\nif (!horzSpan) \n{\ndstP=posP.y-posM.y;\n}\nbool goodSpanN=(lumaEndN<0.0) != lumaMLTZero;\nfloat spanLength=(dstP+dstN);\nbool goodSpanP=(lumaEndP<0.0) != lumaMLTZero;\nfloat spanLengthRcp=1.0/spanLength;\nbool directionN=dstN<dstP;\nfloat dst=min(dstN,dstP);\nbool goodSpan=directionN ? goodSpanN : goodSpanP;\nfloat subpixG=subpixF*subpixF;\nfloat pixelOffset=(dst*(-spanLengthRcp))+0.5;\nfloat subpixH=subpixG*fxaaQualitySubpix;\nfloat pixelOffsetGood=goodSpan ? pixelOffset : 0.0;\nfloat pixelOffsetSubpix=max(pixelOffsetGood,subpixH);\nif (!horzSpan)\n{\nposM.x+=pixelOffsetSubpix*lengthSign;\n}\nif (horzSpan)\n{\nposM.y+=pixelOffsetSubpix*lengthSign;\n}\n#ifdef MALI\nif(range<rangeMaxClamped) \n{\ngl_FragColor=rgbyM;\n}\nelse\n{\ngl_FragColor=texture2D(textureSampler,posM,0.0);\n}\n#else\ngl_FragColor=texture2D(textureSampler,posM,0.0);\n#endif\n}",
                chromaticAberrationPixelShader: "\nuniform sampler2D textureSampler; \n\nuniform float chromatic_aberration;\nuniform float radialIntensity;\nuniform vec2 direction;\nuniform vec2 centerPosition;\nuniform float screen_width;\nuniform float screen_height;\n\nvarying vec2 vUV;\nvoid main(void)\n{\nvec2 centered_screen_pos=vec2(vUV.x-centerPosition.x,vUV.y-centerPosition.y);\nvec2 directionOfEffect=direction;\nif(directionOfEffect.x == 0. && directionOfEffect.y == 0.){\ndirectionOfEffect=normalize(centered_screen_pos);\n}\nfloat radius2=centered_screen_pos.x*centered_screen_pos.x\n+centered_screen_pos.y*centered_screen_pos.y;\nfloat radius=sqrt(radius2);\nvec4 original=texture2D(textureSampler,vUV);\n\nvec3 ref_indices=vec3(-0.3,0.0,0.3);\nfloat ref_shiftX=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.x/screen_width;\nfloat ref_shiftY=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.y/screen_height;\n\nvec2 ref_coords_r=vec2(vUV.x+ref_indices.r*ref_shiftX,vUV.y+ref_indices.r*ref_shiftY*0.5);\nvec2 ref_coords_g=vec2(vUV.x+ref_indices.g*ref_shiftX,vUV.y+ref_indices.g*ref_shiftY*0.5);\nvec2 ref_coords_b=vec2(vUV.x+ref_indices.b*ref_shiftX,vUV.y+ref_indices.b*ref_shiftY*0.5);\noriginal.r=texture2D(textureSampler,ref_coords_r).r;\noriginal.g=texture2D(textureSampler,ref_coords_g).g;\noriginal.b=texture2D(textureSampler,ref_coords_b).b;\noriginal.a=clamp(texture2D(textureSampler,ref_coords_r).a+texture2D(textureSampler,ref_coords_g).a+texture2D(textureSampler,ref_coords_b).a,0.,1.);\ngl_FragColor=original;\n}",
                grainPixelShader: "#include<helperFunctions>\n\nuniform sampler2D textureSampler; \n\nuniform float intensity;\nuniform float animatedSeed;\n\nvarying vec2 vUV;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec2 seed=vUV*(animatedSeed);\nfloat grain=dither(seed,intensity);\n\nfloat lum=getLuminance(gl_FragColor.rgb);\nfloat grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;\ngl_FragColor.rgb+=grain*grainAmount;\ngl_FragColor.rgb=max(gl_FragColor.rgb,0.0);\n}",
                sharpenPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform vec2 sharpnessAmounts;\nvoid main(void)\n{\nvec2 onePixel=vec2(1.0,1.0)/screenSize;\nvec4 color=texture2D(textureSampler,vUV);\nvec4 edgeDetection=texture2D(textureSampler,vUV+onePixel*vec2(0,-1)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1)) -\ncolor*4.0;\ngl_FragColor=max(vec4(color.rgb*sharpnessAmounts.y,color.a)-(sharpnessAmounts.x*vec4(edgeDetection.rgb,0)),0.);\n}",
                kernelBlurVertexShader: "\nattribute vec2 position;\n\nuniform vec2 delta;\n\nvarying vec2 sampleCenter;\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) { \nsampleCenter=(position*madd+madd);\n#include<kernelBlurVertex>[0..varyingCount]\ngl_Position=vec4(position,0.0,1.0);\n}",
                kernelBlurPixelShader: "\nuniform sampler2D textureSampler;\nuniform vec2 delta;\n\nvarying vec2 sampleCenter;\n#ifdef DOF\nuniform sampler2D circleOfConfusionSampler;\nuniform vec2 cameraMinMaxZ;\nfloat sampleDistance(const in vec2 offset) {\nfloat depth=texture2D(circleOfConfusionSampler,offset).g; \nreturn cameraMinMaxZ.x+(cameraMinMaxZ.y-cameraMinMaxZ.x)*depth; \n}\nfloat sampleCoC(const in vec2 offset) {\nfloat coc=texture2D(circleOfConfusionSampler,offset).r; \nreturn coc; \n}\n#endif\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\n#ifdef PACKEDFLOAT\nvec4 pack(float depth)\n{\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(depth*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}\n#endif\nvoid main(void)\n{\nfloat computedWeight=0.0;\n#ifdef PACKEDFLOAT \nfloat blend=0.;\n#else\nvec4 blend=vec4(0.);\n#endif\n#ifdef DOF\nfloat sumOfWeights=CENTER_WEIGHT; \nfloat factor=0.0;\n\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT;\n#else\nblend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT;\n#endif\n#endif\n#include<kernelBlurFragment>[0..varyingCount]\n#include<kernelBlurFragment2>[0..depCount]\n#ifdef PACKEDFLOAT\ngl_FragColor=pack(blend);\n#else\ngl_FragColor=blend;\n#endif\n#ifdef DOF\ngl_FragColor/=sumOfWeights;\n#endif\n}",
                depthOfFieldMergePixelShader: "uniform sampler2D textureSampler;\nvarying vec2 vUV;\nuniform sampler2D circleOfConfusionSampler;\nuniform sampler2D blurStep0;\n#if BLUR_LEVEL>0\nuniform sampler2D blurStep1;\n#endif\n#if BLUR_LEVEL>1\nuniform sampler2D blurStep2;\n#endif\nvoid main(void)\n{\nfloat coc=texture2D(circleOfConfusionSampler,vUV).r;\n#if BLUR_LEVEL == 0\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred0=texture2D(blurStep0,vUV);\ngl_FragColor=mix(original,blurred0,coc);\n#endif\n#if BLUR_LEVEL == 1\nif(coc<0.5){\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(original,blurred1,coc/0.5);\n}else{\nvec4 blurred0=texture2D(blurStep0,vUV); \nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(blurred1,blurred0,(coc-0.5)/0.5);\n}\n#endif\n#if BLUR_LEVEL == 2\nif(coc<0.33){\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred2=texture2D(blurStep2,vUV);\ngl_FragColor=mix(original,blurred2,coc/0.33);\n}else if(coc<0.66){\nvec4 blurred1=texture2D(blurStep1,vUV);\nvec4 blurred2=texture2D(blurStep2,vUV);\ngl_FragColor=mix(blurred2,blurred1,(coc-0.33)/0.33);\n}else{\nvec4 blurred0=texture2D(blurStep0,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(blurred1,blurred0,(coc-0.66)/0.34);\n}\n#endif\n}\n",
                circleOfConfusionPixelShader: "\nuniform sampler2D depthSampler;\n\nvarying vec2 vUV;\n\nuniform vec2 cameraMinMaxZ;\n\nuniform float focusDistance;\nuniform float cocPrecalculation;\nvoid main(void)\n{\nfloat depth=texture2D(depthSampler,vUV).r;\nfloat pixelDistance=(cameraMinMaxZ.x+(cameraMinMaxZ.y-cameraMinMaxZ.x)*depth)*1000.0; \nfloat coc=abs(cocPrecalculation* ((focusDistance-pixelDistance)/pixelDistance));\ncoc=clamp(coc,0.0,1.0);\ngl_FragColor=vec4(coc,depth,coc,1.0);\n}\n",
                bloomMergePixelShader: "uniform sampler2D textureSampler;\nuniform sampler2D bloomBlur;\nvarying vec2 vUV;\nuniform float bloomWeight;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec3 blurred=texture2D(bloomBlur,vUV).rgb;\ngl_FragColor.rgb=gl_FragColor.rgb+(blurred.rgb*bloomWeight); \n}\n",
                extractHighlightsPixelShader: "#include<helperFunctions>\n\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float threshold;\nuniform float exposure;\nvoid main(void) \n{\ngl_FragColor=texture2D(textureSampler,vUV);\nfloat luma=getLuminance(gl_FragColor.rgb*exposure);\ngl_FragColor.rgb=step(threshold,luma)*gl_FragColor.rgb;\n}",
                refractionPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D refractionSampler;\n\nuniform vec3 baseColor;\nuniform float depth;\nuniform float colorLevel;\nvoid main() {\nfloat ref=1.0-texture2D(refractionSampler,vUV).r;\nvec2 uv=vUV-vec2(0.5);\nvec2 offset=uv*depth*ref;\nvec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;\ngl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);\n}",
                blackAndWhitePixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float degree;\nvoid main(void) \n{\nvec3 color=texture2D(textureSampler,vUV).rgb;\nfloat luminance=dot(color,vec3(0.3,0.59,0.11)); \nvec3 blackAndWhite=vec3(luminance,luminance,luminance);\ngl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);\n}",
                convolutionPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform float kernel[9];\nvoid main(void)\n{\nvec2 onePixel=vec2(1.0,1.0)/screenSize;\nvec4 colorSum =\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,-1))*kernel[0] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,-1))*kernel[1] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,-1))*kernel[2] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0))*kernel[3] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,0))*kernel[4] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0))*kernel[5] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,1))*kernel[6] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1))*kernel[7] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,1))*kernel[8];\nfloat kernelWeight =\nkernel[0] +\nkernel[1] +\nkernel[2] +\nkernel[3] +\nkernel[4] +\nkernel[5] +\nkernel[6] +\nkernel[7] +\nkernel[8];\nif (kernelWeight<=0.0) {\nkernelWeight=1.0;\n}\ngl_FragColor=vec4((colorSum/kernelWeight).rgb,1);\n}",
                filterPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform mat4 kernelMatrix;\nvoid main(void)\n{\nvec3 baseColor=texture2D(textureSampler,vUV).rgb;\nvec3 updatedColor=(kernelMatrix*vec4(baseColor,1.0)).rgb;\ngl_FragColor=vec4(updatedColor,1.0);\n}",
                volumetricLightScatteringPixelShader: "uniform sampler2D textureSampler;\nuniform sampler2D lightScatteringSampler;\nuniform float decay;\nuniform float exposure;\nuniform float weight;\nuniform float density;\nuniform vec2 meshPositionOnScreen;\nvarying vec2 vUV;\nvoid main(void) {\nvec2 tc=vUV;\nvec2 deltaTexCoord=(tc-meshPositionOnScreen.xy);\ndeltaTexCoord*=1.0/float(NUM_SAMPLES)*density;\nfloat illuminationDecay=1.0;\nvec4 color=texture2D(lightScatteringSampler,tc)*0.4;\nfor(int i=0; i<NUM_SAMPLES; i++) {\ntc-=deltaTexCoord;\nvec4 dataSample=texture2D(lightScatteringSampler,tc)*0.4;\ndataSample*=illuminationDecay*weight;\ncolor+=dataSample;\nilluminationDecay*=decay;\n}\nvec4 realColor=texture2D(textureSampler,vUV);\ngl_FragColor=((vec4((vec3(color.r,color.g,color.b)*exposure),1))+(realColor*(1.5-0.4)));\n}\n",
                volumetricLightScatteringPassPixelShader: "#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\n#endif\n#if defined(ALPHATEST)\nuniform sampler2D diffuseSampler;\n#endif\nvoid main(void)\n{\n#if defined(ALPHATEST)\nvec4 diffuseColor=texture2D(diffuseSampler,vUV);\nif (diffuseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\n}\n",
                colorCorrectionPixelShader: "\nuniform sampler2D textureSampler; \nuniform sampler2D colorTable; \n\nvarying vec2 vUV;\n\nconst float SLICE_COUNT=16.0; \n\nvec4 sampleAs3DTexture(sampler2D textureSampler,vec3 uv,float width) {\nfloat sliceSize=1.0/width; \nfloat slicePixelSize=sliceSize/width; \nfloat sliceInnerSize=slicePixelSize*(width-1.0); \nfloat zSlice0=min(floor(uv.z*width),width-1.0);\nfloat zSlice1=min(zSlice0+1.0,width-1.0);\nfloat xOffset=slicePixelSize*0.5+uv.x*sliceInnerSize;\nfloat s0=xOffset+(zSlice0*sliceSize);\nfloat s1=xOffset+(zSlice1*sliceSize);\nvec4 slice0Color=texture2D(textureSampler,vec2(s0,uv.y));\nvec4 slice1Color=texture2D(textureSampler,vec2(s1,uv.y));\nfloat zOffset=mod(uv.z*width,1.0);\nvec4 result=mix(slice0Color,slice1Color,zOffset);\nreturn result;\n}\nvoid main(void)\n{\nvec4 screen_color=texture2D(textureSampler,vUV);\ngl_FragColor=sampleAs3DTexture(colorTable,screen_color.rgb,SLICE_COUNT);\n}",
                tonemapPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform float _ExposureAdjustment;\n#if defined(HABLE_TONEMAPPING)\nconst float A=0.15;\nconst float B=0.50;\nconst float C=0.10;\nconst float D=0.20;\nconst float E=0.02;\nconst float F=0.30;\nconst float W=11.2;\n#endif\nfloat Luminance(vec3 c)\n{\nreturn dot(c,vec3(0.22,0.707,0.071));\n}\nvoid main(void) \n{\nvec3 colour=texture2D(textureSampler,vUV).rgb;\n#if defined(REINHARD_TONEMAPPING)\nfloat lum=Luminance(colour.rgb); \nfloat lumTm=lum*_ExposureAdjustment;\nfloat scale=lumTm/(1.0+lumTm); \ncolour*=scale/lum;\n#elif defined(HABLE_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nconst float ExposureBias=2.0;\nvec3 x=ExposureBias*colour;\nvec3 curr=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\nx=vec3(W,W,W);\nvec3 whiteScale=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);\ncolour=curr*whiteScale;\n#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nvec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);\nvec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);\ncolour=retColor*retColor;\n#elif defined(PHOTOGRAPHIC_TONEMAPPING)\ncolour=vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour);\n#endif\ngl_FragColor=vec4(colour.rgb,1.0);\n}",
                displayPassPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D passSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(passSampler,vUV);\n}",
                highlightsPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nconst vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);\nvoid main(void) \n{\nvec4 tex=texture2D(textureSampler,vUV);\nvec3 c=tex.rgb;\nfloat luma=dot(c.rgb,RGBLuminanceCoefficients);\n\n\ngl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a); \n}",
                imageProcessingPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\nvoid main(void)\n{\nvec4 result=texture2D(textureSampler,vUV);\n#ifdef IMAGEPROCESSING\n#ifndef FROMLINEARSPACE\n\nresult.rgb=toLinearSpace(result.rgb);\n#endif\nresult=applyImageProcessing(result);\n#else\n\n#ifdef FROMLINEARSPACE\nresult=applyImageProcessing(result);\n#endif\n#endif\ngl_FragColor=result;\n}",
                lensFlareVertexShader: "\nattribute vec2 position;\n\nuniform mat4 viewportMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) { \nvUV=position*madd+madd;\ngl_Position=viewportMatrix*vec4(position,0.0,1.0);\n}",
                lensFlarePixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\ngl_FragColor=baseColor*color;\n}",
                anaglyphPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D leftSampler;\nvoid main(void)\n{\nvec4 leftFrag=texture2D(leftSampler,vUV);\nleftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);\nvec4 rightFrag=texture2D(textureSampler,vUV);\nrightFrag=vec4(rightFrag.r,1.0,1.0,1.0);\ngl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);\n}",
                stereoscopicInterlacePixelShader: "const vec3 TWO=vec3(2.0,2.0,2.0);\nvarying vec2 vUV;\nuniform sampler2D camASampler;\nuniform sampler2D textureSampler;\nuniform vec2 stepSize;\nvoid main(void)\n{\nbool useCamB;\nvec2 texCoord1;\nvec2 texCoord2;\nvec3 frag1;\nvec3 frag2;\n#ifdef IS_STEREOSCOPIC_HORIZ\nuseCamB=vUV.x>0.5;\ntexCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);\ntexCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);\n#else\nuseCamB=vUV.y>0.5;\ntexCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);\ntexCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);\n#endif\n\nif (useCamB){\nfrag1=texture2D(textureSampler,texCoord1).rgb;\nfrag2=texture2D(textureSampler,texCoord2).rgb;\n}else{\nfrag1=texture2D(camASampler ,texCoord1).rgb;\nfrag2=texture2D(camASampler ,texCoord2).rgb;\n}\ngl_FragColor=vec4((frag1+frag2)/TWO,1.0);\n}",
                vrDistortionCorrectionPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 LensCenter;\nuniform vec2 Scale;\nuniform vec2 ScaleIn;\nuniform vec4 HmdWarpParam;\nvec2 HmdWarp(vec2 in01) {\nvec2 theta=(in01-LensCenter)*ScaleIn; \nfloat rSq=theta.x*theta.x+theta.y*theta.y;\nvec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);\nreturn LensCenter+Scale*rvector;\n}\nvoid main(void)\n{\nvec2 tc=HmdWarp(vUV);\nif (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0)\ngl_FragColor=vec4(0.0,0.0,0.0,0.0);\nelse{\ngl_FragColor=texture2D(textureSampler,tc);\n}\n}",
                glowBlurPostProcessPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nuniform vec2 direction;\nuniform float blurWidth;\n\nfloat getLuminance(vec3 color)\n{\nreturn dot(color,vec3(0.2126,0.7152,0.0722));\n}\nvoid main(void)\n{\nfloat weights[7];\nweights[0]=0.05;\nweights[1]=0.1;\nweights[2]=0.2;\nweights[3]=0.3;\nweights[4]=0.2;\nweights[5]=0.1;\nweights[6]=0.05;\nvec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);\nvec2 texelStep=texelSize*direction*blurWidth;\nvec2 start=vUV-3.0*texelStep;\nvec4 baseColor=vec4(0.,0.,0.,0.);\nvec2 texelOffset=vec2(0.,0.);\nfor (int i=0; i<7; i++)\n{\n\nvec4 texel=texture2D(textureSampler,start+texelOffset);\nbaseColor.a+=texel.a*weights[i];\n\nfloat luminance=getLuminance(baseColor.rgb);\nfloat luminanceTexel=getLuminance(texel.rgb);\nfloat choice=step(luminanceTexel,luminance);\nbaseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;\ntexelOffset+=texelStep;\n}\ngl_FragColor=baseColor;\n}",
                glowMapGenerationPixelShader: "#ifdef ALPHATEST\nvarying vec2 vUVDiffuse;\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform sampler2D emissiveSampler;\n#endif\nuniform vec4 color;\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUVDiffuse).a<0.4)\ndiscard;\n#endif\n#ifdef EMISSIVE\ngl_FragColor=texture2D(emissiveSampler,vUVEmissive)*color;\n#else\ngl_FragColor=color;\n#endif\n}",
                glowMapGenerationVertexShader: "\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nvarying vec4 vPosition;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef ALPHATEST\nvarying vec2 vUVDiffuse;\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform mat4 emissiveMatrix;\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef CUBEMAP\nvPosition=finalWorld*vec4(positionUpdated,1.0);\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#else\nvPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\ngl_Position=vPosition;\n#endif\n#ifdef ALPHATEST\n#ifdef DIFFUSEUV1\nvUVDiffuse=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef DIFFUSEUV2\nvUVDiffuse=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef EMISSIVE\n#ifdef EMISSIVEUV1\nvUVEmissive=vec2(emissiveMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef EMISSIVEUV2\nvUVEmissive=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}",
                glowMapMergePixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#ifdef EMISSIVE\nuniform sampler2D textureSampler2;\n#endif\n\nuniform float offset;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef EMISSIVE\nbaseColor+=texture2D(textureSampler2,vUV);\nbaseColor*=offset;\n#else\nbaseColor.a=abs(offset-baseColor.a);\n#ifdef STROKE\nfloat alpha=smoothstep(.0,.1,baseColor.a);\nbaseColor.a=alpha;\nbaseColor.rgb=baseColor.rgb*alpha;\n#endif\n#endif\ngl_FragColor=baseColor;\n}",
                glowMapMergeVertexShader: "\nattribute vec2 position;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}",
                lineVertexShader: "\nattribute vec3 position;\nattribute vec4 normal;\n\nuniform mat4 worldViewProjection;\nuniform float width;\nuniform float aspectRatio;\nvoid main(void) {\nvec4 viewPosition=worldViewProjection*vec4(position,1.0);\nvec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);\nvec2 currentScreen=viewPosition.xy/viewPosition.w;\nvec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;\ncurrentScreen.x*=aspectRatio;\nnextScreen.x*=aspectRatio;\nvec2 dir=normalize(nextScreen-currentScreen);\nvec2 normalDir=vec2(-dir.y,dir.x);\nnormalDir*=width/2.0;\nnormalDir.x/=aspectRatio;\nvec4 offset=vec4(normalDir*normal.w,0.0,0.0);\ngl_Position=viewPosition+offset;\n}",
                linePixelShader: "uniform vec4 color;\nvoid main(void) {\ngl_FragColor=color;\n}",
                outlineVertexShader: "\nattribute vec3 position;\nattribute vec3 normal;\n#include<bonesDeclaration>\n\nuniform float offset;\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#include<logDepthDeclaration>\nvoid main(void)\n{\nvec3 offsetPosition=position+normal*offset;\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(offsetPosition,1.0);\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#include<logDepthVertex>\n}\n",
                outlinePixelShader: "#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform vec4 color;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include<logDepthDeclaration>\nvoid main(void) {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#include<logDepthFragment>\ngl_FragColor=color;\n}",
                layerVertexShader: "\nattribute vec2 position;\n\nuniform vec2 scale;\nuniform vec2 offset;\nuniform mat4 textureMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) { \nvec2 shiftedPosition=position*scale+offset;\nvUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));\ngl_Position=vec4(shiftedPosition,0.0,1.0);\n}",
                layerPixelShader: "\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=baseColor*color;\n}",
                backgroundVertexShader: "precision highp float;\n#include<__decl__backgroundVertex>\n#include<helperFunctions>\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2; \n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nvarying vec2 vDiffuseUV;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\nvoid main(void) {\n#ifdef REFLECTIONMAP_SKYBOX\n#ifdef REFLECTIONMAP_SKYBOX_TRANSFORMED\nvPositionUVW=(reflectionMatrix*vec4(position,1.0)).xyz;\n#else\nvPositionUVW=position;\n#endif\n#endif \n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\nvec4 worldPos=finalWorld*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normal);\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));\n#ifdef EQUIRECTANGULAR_RELFECTION_FOV\nmat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));\nvec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));\nif (fFovMultiplier<=1.0) {\nvDirectionW=normalize(segment);\n} else {\nvDirectionW=normalize(vDirectionW+(vDirectionW-segment));\n}\n#endif\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uv;\n#endif \n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0 \nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n",
                backgroundPixelShader: "#ifdef TEXTURELODSUPPORT\n#extension GL_EXT_shader_texture_lod : enable\n#endif\nprecision highp float;\n#include<__decl__backgroundFragment>\n#define RECIPROCAL_PI2 0.15915494\n\nuniform vec3 vEyePosition;\n\nvarying vec3 vPositionW;\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif \n#ifdef MAINUV2 \nvarying vec2 vMainUV2; \n#endif \n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV == 1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV == 2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE;\n#endif\n\n#ifndef SHADOWONLY\n#define SHADOWONLY;\n#endif\n#include<imageProcessingDeclaration>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<helperFunctions>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<imageProcessingFunctions>\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\n#ifdef REFLECTIONFRESNEL\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\nvec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{\n\nfloat weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);\nreturn reflectance0+weight*(reflectance90-reflectance0)*pow(clamp(1.0-VdotN,0.,1.),5.0);\n}\n#endif\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(0.0,1.0,0.0);\n#endif\n\nfloat shadow=1.;\nfloat globalShadow=0.;\nfloat shadowLightCount=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef SHADOWINUSE\nglobalShadow/=shadowLightCount;\n#else\nglobalShadow=1.0;\n#endif\n\nvec4 reflectionColor=vec4(1.,1.,1.,1.);\n#ifdef REFLECTION\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=reflectionVector;\n#else\nvec2 reflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n#ifdef REFLECTIONBLUR\nfloat reflectionLOD=vReflectionInfos.y;\n#ifdef TEXTURELODSUPPORT\n\nreflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\nreflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#else\nfloat lodReflectionNormalized=clamp(reflectionLOD,0.,1.);\nfloat lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;\nvec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);\nif(lodReflectionNormalizedDoubled<1.0){\nreflectionColor=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nreflectionSpecularMid,\nlodReflectionNormalizedDoubled\n);\n} else {\nreflectionColor=mix(\nreflectionSpecularMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#else\nvec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);\nreflectionColor=reflectionSample;\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef GAMMAREFLECTION\nreflectionColor.rgb=toLinearSpace(reflectionColor.rgb);\n#endif\n#ifdef REFLECTIONBGR\nreflectionColor.rgb=reflectionColor.bgr;\n#endif\n\nreflectionColor.rgb*=vReflectionInfos.x;\n#endif\n\nvec3 diffuseColor=vec3(1.,1.,1.);\nfloat finalAlpha=alpha;\n#ifdef DIFFUSE\nvec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef GAMMADIFFUSE\ndiffuseMap.rgb=toLinearSpace(diffuseMap.rgb);\n#endif\n\ndiffuseMap.rgb*=vDiffuseInfos.y;\n#ifdef DIFFUSEHASALPHA\nfinalAlpha*=diffuseMap.a;\n#endif\ndiffuseColor=diffuseMap.rgb;\n#endif\n\n#ifdef REFLECTIONFRESNEL\nvec3 colorBase=diffuseColor;\n#else\nvec3 colorBase=reflectionColor.rgb*diffuseColor;\n#endif\ncolorBase=max(colorBase,0.0);\n\n#ifdef USERGBCOLOR\nvec3 finalColor=colorBase;\n#else\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nvec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase);\n#else\nvec3 mainColor=vPrimaryColor.rgb;\n#endif\nvec3 finalColor=colorBase*mainColor;\n#endif\n\n#ifdef REFLECTIONFRESNEL\nvec3 reflectionAmount=vReflectionControl.xxx;\nvec3 reflectionReflectance0=vReflectionControl.yyy;\nvec3 reflectionReflectance90=vReflectionControl.zzz;\nfloat VdotN=dot(normalize(vEyePosition),normalW);\nvec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(clamp(VdotN,0.0,1.0),reflectionReflectance0,reflectionReflectance90,1.0);\nreflectionAmount*=planarReflectionFresnel;\n#ifdef REFLECTIONFALLOFF\nfloat reflectionDistanceFalloff=1.0-clamp(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w,0.0,1.0);\nreflectionDistanceFalloff*=reflectionDistanceFalloff;\nreflectionAmount*=reflectionDistanceFalloff;\n#endif\nfinalColor=mix(finalColor,reflectionColor.rgb,clamp(reflectionAmount,0.,1.));\n#endif\n#ifdef OPACITYFRESNEL\nfloat viewAngleToFloor=dot(normalW,normalize(vEyePosition-vBackgroundCenter));\n\nconst float startAngle=0.1;\nfloat fadeFactor=clamp(viewAngleToFloor/startAngle,0.0,1.0);\nfinalAlpha*=fadeFactor*fadeFactor;\n#endif\n\n#ifdef SHADOWINUSE\nfinalColor=mix(finalColor*shadowLevel,finalColor,globalShadow);\n#endif\n\nvec4 color=vec4(finalColor,finalAlpha);\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\n\n\ncolor.rgb=clamp(color.rgb,0.,30.0);\n#else\n\ncolor=applyImageProcessing(color);\n#endif\n#ifdef PREMULTIPLYALPHA\n\ncolor.rgb*=color.a;\n#endif\n#ifdef NOISE\ncolor.rgb+=dither(vPositionW.xy,0.5);\ncolor=max(color,0.0);\n#endif\ngl_FragColor=color;\n}\n",
                noisePixelShader: "\n\nuniform float brightness;\nuniform float persistence;\nuniform float timeScale;\n\nvarying vec2 vUV;\n\nvec2 hash22(vec2 p)\n{\np=p*mat2(127.1,311.7,269.5,183.3);\np=-1.0+2.0*fract(sin(p)*43758.5453123);\nreturn sin(p*6.283+timeScale);\n}\nfloat interpolationNoise(vec2 p)\n{\nvec2 pi=floor(p);\nvec2 pf=p-pi;\nvec2 w=pf*pf*(3.-2.*pf);\nfloat f00=dot(hash22(pi+vec2(.0,.0)),pf-vec2(.0,.0));\nfloat f01=dot(hash22(pi+vec2(.0,1.)),pf-vec2(.0,1.));\nfloat f10=dot(hash22(pi+vec2(1.0,0.)),pf-vec2(1.0,0.));\nfloat f11=dot(hash22(pi+vec2(1.0,1.)),pf-vec2(1.0,1.));\nfloat xm1=mix(f00,f10,w.x);\nfloat xm2=mix(f01,f11,w.x);\nfloat ym=mix(xm1,xm2,w.y); \nreturn ym;\n}\nfloat perlinNoise2D(float x,float y)\n{\nfloat sum=0.0;\nfloat frequency=0.0;\nfloat amplitude=0.0;\nfor(int i=0; i<OCTAVES; i++)\n{\nfrequency=pow(2.0,float(i));\namplitude=pow(persistence,float(i));\nsum=sum+interpolationNoise(vec2(x*frequency,y*frequency))*amplitude;\n}\nreturn sum;\n}\n\nvoid main(void)\n{\nfloat x=abs(vUV.x);\nfloat y=abs(vUV.y);\nfloat noise=brightness+(1.0-brightness)*perlinNoise2D(x,y);\ngl_FragColor=vec4(noise,noise,noise,1.0);\n}\n"
            }, $a.Effect.IncludesShadersStore = {
                depthPrePass: "#ifdef DEPTHPREPASS\ngl_FragColor=vec4(0.,0.,0.,1.0);\nreturn;\n#endif",
                bonesDeclaration: "#if NUM_BONE_INFLUENCERS>0\nuniform mat4 mBones[BonesPerMesh];\nattribute vec4 matricesIndices;\nattribute vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nattribute vec4 matricesIndicesExtra;\nattribute vec4 matricesWeightsExtra;\n#endif\n#endif",
                instancesDeclaration: "#ifdef INSTANCES\nattribute vec4 world0;\nattribute vec4 world1;\nattribute vec4 world2;\nattribute vec4 world3;\n#else\nuniform mat4 world;\n#endif",
                pointCloudVertexDeclaration: "#ifdef POINTSIZE\nuniform float pointSize;\n#endif",
                bumpVertexDeclaration: "#if defined(BUMP) || defined(PARALLAX)\n#if defined(TANGENT) && defined(NORMAL) \nvarying mat3 vTBN;\n#endif\n#endif\n",
                clipPlaneVertexDeclaration: "#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nvarying float fClipDistance4;\n#endif",
                fogVertexDeclaration: "#ifdef FOG\nvarying vec3 vFogDistance;\n#endif",
                morphTargetsVertexGlobalDeclaration: "#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#endif",
                morphTargetsVertexDeclaration: "#ifdef MORPHTARGETS\nattribute vec3 position{X};\n#ifdef MORPHTARGETS_NORMAL\nattribute vec3 normal{X};\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute vec3 tangent{X};\n#endif\n#endif",
                logDepthDeclaration: "#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;\nvarying float vFragmentDepth;\n#endif",
                morphTargetsVertex: "#ifdef MORPHTARGETS\npositionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];\n#endif\n#endif",
                instancesVertex: "#ifdef INSTANCES\nmat4 finalWorld=mat4(world0,world1,world2,world3);\n#else\nmat4 finalWorld=world;\n#endif",
                bonesVertex: "#if NUM_BONE_INFLUENCERS>0\nmat4 influence;\ninfluence=mBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=mBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence+=mBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence+=mBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif \nfinalWorld=finalWorld*influence;\n#endif",
                bumpVertex: "#if defined(BUMP) || defined(PARALLAX)\n#if defined(TANGENT) && defined(NORMAL)\nvec3 tbnNormal=normalize(normalUpdated);\nvec3 tbnTangent=normalize(tangentUpdated.xyz);\nvec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;\nvTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);\n#endif\n#endif",
                clipPlaneVertex: "#ifdef CLIPPLANE\nfClipDistance=dot(worldPos,vClipPlane);\n#endif\n#ifdef CLIPPLANE2\nfClipDistance2=dot(worldPos,vClipPlane2);\n#endif\n#ifdef CLIPPLANE3\nfClipDistance3=dot(worldPos,vClipPlane3);\n#endif\n#ifdef CLIPPLANE4\nfClipDistance4=dot(worldPos,vClipPlane4);\n#endif",
                fogVertex: "#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif",
                shadowsVertex: "#ifdef SHADOWS\n#if defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvPositionFromLight{X}=lightMatrix{X}*worldPos;\nvDepthMetric{X}=((vPositionFromLight{X}.z+light{X}.depthValues.x)/(light{X}.depthValues.y));\n#endif\n#endif",
                pointCloudVertex: "#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif",
                logDepthVertex: "#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;\ngl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif",
                helperFunctions: "const float PI=3.1415926535897932384626433832795;\nconst float LinearEncodePowerApprox=2.2;\nconst float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;\nconst vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);\nmat3 transposeMat3(mat3 inMatrix) {\nvec3 i0=inMatrix[0];\nvec3 i1=inMatrix[1];\nvec3 i2=inMatrix[2];\nmat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);\nreturn outMatrix;\n}\n\nmat3 inverseMat3(mat3 inMatrix) {\nfloat a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];\nfloat a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];\nfloat a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];\nfloat b01=a22*a11-a12*a21;\nfloat b11=-a22*a10+a12*a20;\nfloat b21=a21*a10-a11*a20;\nfloat det=a00*b01+a01*b11+a02*b21;\nreturn mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;\n}\nfloat computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)\n{\nfloat mask=smoothstep(1.0-frustumEdgeFalloff,1.0,clamp(dot(clipSpace,clipSpace),0.,1.));\nreturn mix(value,1.0,mask);\n}\nvec3 applyEaseInOut(vec3 x){\nreturn x*x*(3.0-2.0*x);\n}\nvec3 toLinearSpace(vec3 color)\n{\nreturn pow(color,vec3(LinearEncodePowerApprox));\n}\nvec3 toGammaSpace(vec3 color)\n{\nreturn pow(color,vec3(GammaEncodePowerApprox));\n}\nfloat square(float value)\n{\nreturn value*value;\n}\nfloat getLuminance(vec3 color)\n{\nreturn clamp(dot(color,LuminanceEncodeApprox),0.,1.);\n}\n\nfloat getRand(vec2 seed) {\nreturn fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);\n}\nfloat dither(vec2 seed,float varianceAmount) {\nfloat rand=getRand(seed);\nfloat dither=mix(-varianceAmount/255.0,varianceAmount/255.0,rand);\nreturn dither;\n}\n\nconst float rgbdMaxRange=255.0;\nvec4 toRGBD(vec3 color) {\nfloat maxRGB=max(0.0000001,max(color.r,max(color.g,color.b)));\nfloat D=max(rgbdMaxRange/maxRGB,1.);\nD=clamp(floor(D)/255.0,0.,1.);\n\nvec3 rgb=color.rgb*D;\n\nrgb=toGammaSpace(rgb);\nreturn vec4(rgb,D); \n}\nvec3 fromRGBD(vec4 rgbd) {\n\nrgbd.rgb=toLinearSpace(rgbd.rgb);\n\nreturn rgbd.rgb/rgbd.a;\n}",
                lightFragmentDeclaration: "#ifdef LIGHT{X}\nuniform vec4 vLightData{X};\nuniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec3 vLightSpecular{X};\n#else\nvec3 vLightSpecular{X}=vec3(0.);\n#endif\n#ifdef SHADOW{X}\n#if defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};\nuniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};\nuniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#endif",
                lightsFragmentFunctions: "\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};\nlightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 lightVectorW;\nfloat attenuation=1.0;\nif (lightData.w == 0.)\n{\nvec3 direction=lightData.xyz-vPositionW;\nattenuation=max(0.,1.0-length(direction)/range);\nlightVectorW=normalize(direction);\n}\nelse\n{\nlightVectorW=normalize(-lightData.xyz);\n}\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 direction=lightData.xyz-vPositionW;\nvec3 lightVectorW=normalize(direction);\nfloat attenuation=max(0.,1.0-length(direction)/range);\n\nfloat cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));\nif (cosAngle>=lightDirection.w)\n{\ncosAngle=max(0.,pow(cosAngle,lightData.w));\nattenuation*=cosAngle;\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;\n}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {\nlightingInfo result;\n\nfloat ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor;\n#endif\nreturn result;\n}\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn textureColor;\n}",
                lightUboDeclaration: "#ifdef LIGHT{X}\nuniform Light{X}\n{\nvec4 vLightData;\nvec4 vLightDiffuse;\nvec3 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;\nvec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\nvec4 shadowsInfo;\nvec2 depthValues;\n} light{X};\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#ifdef SHADOW{X}\n#if defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X}; \n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif",
                defaultVertexDeclaration: "\nuniform mat4 viewProjection;\nuniform mat4 view;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\nuniform mat4 specularMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef REFLECTION\nuniform mat4 reflectionMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n",
                defaultFragmentDeclaration: "uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nuniform vec3 vEmissiveColor;\n\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY \nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifndef REFRACTIONMAP_3D\nuniform mat4 refractionMatrix;\n#endif\n#ifdef REFRACTIONFRESNEL\nuniform vec4 refractionLeftColor;\nuniform vec4 refractionRightColor;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\n#endif\n#ifdef DIFFUSEFRESNEL\nuniform vec4 diffuseLeftColor;\nuniform vec4 diffuseRightColor;\n#endif\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;\nuniform vec4 emissiveRightColor;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#ifdef REFLECTIONMAP_SKYBOX\n#else\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION)\nuniform mat4 reflectionMatrix;\n#endif\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize; \n#endif\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 reflectionLeftColor;\nuniform vec4 reflectionRightColor;\n#endif\n#endif",
                defaultUboDeclaration: "layout(std140,column_major) uniform;\nuniform Material\n{\nvec4 diffuseLeftColor;\nvec4 diffuseRightColor;\nvec4 opacityParts;\nvec4 reflectionLeftColor;\nvec4 reflectionRightColor;\nvec4 refractionLeftColor;\nvec4 refractionRightColor;\nvec4 emissiveLeftColor; \nvec4 emissiveRightColor;\nvec2 vDiffuseInfos;\nvec2 vAmbientInfos;\nvec2 vOpacityInfos;\nvec2 vReflectionInfos;\nvec3 vReflectionPosition;\nvec3 vReflectionSize;\nvec2 vEmissiveInfos;\nvec2 vLightmapInfos;\nvec2 vSpecularInfos;\nvec3 vBumpInfos;\nmat4 diffuseMatrix;\nmat4 ambientMatrix;\nmat4 opacityMatrix;\nmat4 reflectionMatrix;\nmat4 emissiveMatrix;\nmat4 lightmapMatrix;\nmat4 specularMatrix;\nmat4 bumpMatrix; \nvec4 vTangentSpaceParams;\nmat4 refractionMatrix;\nvec4 vRefractionInfos;\nvec4 vSpecularColor;\nvec3 vEmissiveColor;\nvec4 vDiffuseColor;\nfloat pointSize; \n};\nuniform Scene {\nmat4 viewProjection;\nmat4 view;\n};",
                shadowsFragmentFunctions: "#ifdef SHADOWS\n#ifndef SHADOWFLOAT\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}\n#endif\nfloat computeShadowCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadow=textureCube(shadowSampler,directionToLight).x;\n#endif\nif (depth>shadow)\n{\nreturn darkness;\n}\nreturn 1.0;\n}\nfloat computeShadowWithPoissonSamplingCube(vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\nfloat visibility=1.;\nvec3 poissonDisk[4];\npoissonDisk[0]=vec3(-1.0,1.0,-1.0);\npoissonDisk[1]=vec3(1.0,-1.0,-1.0);\npoissonDisk[2]=vec3(-1.0,-1.0,-1.0);\npoissonDisk[3]=vec3(1.0,-1.0,1.0);\n\n#ifndef SHADOWFLOAT\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) visibility-=0.25;\n#else\nif (textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) visibility-=0.25;\n#endif\nreturn min(1.0,visibility+darkness);\n}\nfloat computeShadowWithESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness); \nreturn esm;\n}\nfloat computeShadowWithCloseESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn esm;\n}\nfloat computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadow=texture2D(shadowSampler,uv).x;\n#endif\nif (shadowPixelDepth>shadow)\n{\nreturn computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff);\n}\nreturn 1.;\n}\nfloat computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\nfloat visibility=1.;\nvec2 poissonDisk[4];\npoissonDisk[0]=vec2(-0.94201624,-0.39906216);\npoissonDisk[1]=vec2(0.94558609,-0.76890725);\npoissonDisk[2]=vec2(-0.094184101,-0.92938870);\npoissonDisk[3]=vec2(0.34495938,0.29387760);\n\n#ifndef SHADOWFLOAT\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[0]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[1]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[2]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[3]*mapSize))<shadowPixelDepth) visibility-=0.25;\n#else\nif (texture2D(shadowSampler,uv+poissonDisk[0]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[1]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[2]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[3]*mapSize).x<shadowPixelDepth) visibility-=0.25;\n#endif\nreturn computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);\n}\nfloat computeShadowWithESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\nfloat computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0); \n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n#ifdef WEBGL2\n\nfloat computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nfloat shadow=texture2D(shadowSampler,uvDepth);\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n\n\nfloat computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \n\n\n\n\nvec2 uvw0=3.-2.*st;\nvec2 uvw1=1.+2.*st;\nvec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;\nvec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z));\nshadow=shadow/16.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n\n\nfloat computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \n\n\nvec2 uvw0=4.-3.*st;\nvec2 uvw1=vec2(7.);\nvec2 uvw2=1.+3.*st;\nvec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;\nvec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z));\nshadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z));\nshadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z));\nshadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z));\nshadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z));\nshadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z));\nshadow=shadow/144.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\nconst vec3 PoissonSamplers32[64]=vec3[64](\nvec3(0.06407013,0.05409927,0.),\nvec3(0.7366577,0.5789394,0.),\nvec3(-0.6270542,-0.5320278,0.),\nvec3(-0.4096107,0.8411095,0.),\nvec3(0.6849564,-0.4990818,0.),\nvec3(-0.874181,-0.04579735,0.),\nvec3(0.9989998,0.0009880066,0.),\nvec3(-0.004920578,-0.9151649,0.),\nvec3(0.1805763,0.9747483,0.),\nvec3(-0.2138451,0.2635818,0.),\nvec3(0.109845,0.3884785,0.),\nvec3(0.06876755,-0.3581074,0.),\nvec3(0.374073,-0.7661266,0.),\nvec3(0.3079132,-0.1216763,0.),\nvec3(-0.3794335,-0.8271583,0.),\nvec3(-0.203878,-0.07715034,0.),\nvec3(0.5912697,0.1469799,0.),\nvec3(-0.88069,0.3031784,0.),\nvec3(0.5040108,0.8283722,0.),\nvec3(-0.5844124,0.5494877,0.),\nvec3(0.6017799,-0.1726654,0.),\nvec3(-0.5554981,0.1559997,0.),\nvec3(-0.3016369,-0.3900928,0.),\nvec3(-0.5550632,-0.1723762,0.),\nvec3(0.925029,0.2995041,0.),\nvec3(-0.2473137,0.5538505,0.),\nvec3(0.9183037,-0.2862392,0.),\nvec3(0.2469421,0.6718712,0.),\nvec3(0.3916397,-0.4328209,0.),\nvec3(-0.03576927,-0.6220032,0.),\nvec3(-0.04661255,0.7995201,0.),\nvec3(0.4402924,0.3640312,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.)\n);\nconst vec3 PoissonSamplers64[64]=vec3[64](\nvec3(-0.613392,0.617481,0.),\nvec3(0.170019,-0.040254,0.),\nvec3(-0.299417,0.791925,0.),\nvec3(0.645680,0.493210,0.),\nvec3(-0.651784,0.717887,0.),\nvec3(0.421003,0.027070,0.),\nvec3(-0.817194,-0.271096,0.),\nvec3(-0.705374,-0.668203,0.),\nvec3(0.977050,-0.108615,0.),\nvec3(0.063326,0.142369,0.),\nvec3(0.203528,0.214331,0.),\nvec3(-0.667531,0.326090,0.),\nvec3(-0.098422,-0.295755,0.),\nvec3(-0.885922,0.215369,0.),\nvec3(0.566637,0.605213,0.),\nvec3(0.039766,-0.396100,0.),\nvec3(0.751946,0.453352,0.),\nvec3(0.078707,-0.715323,0.),\nvec3(-0.075838,-0.529344,0.),\nvec3(0.724479,-0.580798,0.),\nvec3(0.222999,-0.215125,0.),\nvec3(-0.467574,-0.405438,0.),\nvec3(-0.248268,-0.814753,0.),\nvec3(0.354411,-0.887570,0.),\nvec3(0.175817,0.382366,0.),\nvec3(0.487472,-0.063082,0.),\nvec3(-0.084078,0.898312,0.),\nvec3(0.488876,-0.783441,0.),\nvec3(0.470016,0.217933,0.),\nvec3(-0.696890,-0.549791,0.),\nvec3(-0.149693,0.605762,0.),\nvec3(0.034211,0.979980,0.),\nvec3(0.503098,-0.308878,0.),\nvec3(-0.016205,-0.872921,0.),\nvec3(0.385784,-0.393902,0.),\nvec3(-0.146886,-0.859249,0.),\nvec3(0.643361,0.164098,0.),\nvec3(0.634388,-0.049471,0.),\nvec3(-0.688894,0.007843,0.),\nvec3(0.464034,-0.188818,0.),\nvec3(-0.440840,0.137486,0.),\nvec3(0.364483,0.511704,0.),\nvec3(0.034028,0.325968,0.),\nvec3(0.099094,-0.308023,0.),\nvec3(0.693960,-0.366253,0.),\nvec3(0.678884,-0.204688,0.),\nvec3(0.001801,0.780328,0.),\nvec3(0.145177,-0.898984,0.),\nvec3(0.062655,-0.611866,0.),\nvec3(0.315226,-0.604297,0.),\nvec3(-0.780145,0.486251,0.),\nvec3(-0.371868,0.882138,0.),\nvec3(0.200476,0.494430,0.),\nvec3(-0.494552,-0.711051,0.),\nvec3(0.612476,0.705252,0.),\nvec3(-0.578845,-0.768792,0.),\nvec3(-0.772454,-0.090976,0.),\nvec3(0.504440,0.372295,0.),\nvec3(0.155736,0.065157,0.),\nvec3(0.391522,0.849605,0.),\nvec3(-0.620106,-0.328104,0.),\nvec3(0.789239,-0.419965,0.),\nvec3(-0.545396,0.538133,0.),\nvec3(-0.178564,-0.596057,0.)\n);\n\n\n\n\n\nfloat computeShadowWithPCSS(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nfloat blockerDepth=0.0;\nfloat sumBlockerDepth=0.0;\nfloat numBlocker=0.0;\nfor (int i=0; i<searchTapCount; i ++) {\nblockerDepth=texture(depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy)).r;\nif (blockerDepth<depthMetric) {\nsumBlockerDepth+=blockerDepth;\nnumBlocker++;\n}\n}\nif (numBlocker<1.0) {\nreturn 1.0;\n}\nfloat avgBlockerDepth=sumBlockerDepth/numBlocker;\n\nfloat AAOffset=shadowMapSizeInverse*10.;\n\n\nfloat penumbraRatio=((depthMetric-avgBlockerDepth)+AAOffset);\nfloat filterRadius=penumbraRatio*lightSizeUV*shadowMapSizeInverse;\nfloat random=getRand(vPositionFromLight.xy);\nfloat rotationAngle=random*3.1415926;\nvec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));\nfloat shadow=0.;\nfor (int i=0; i<pcfTapCount; i++) {\nvec3 offset=poissonSamplers[i];\n\noffset=vec3(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);\nshadow+=texture2D(shadowSampler,uvDepth+offset*filterRadius);\n}\nshadow/=float(pcfTapCount);\n\nshadow=mix(shadow,1.,depthMetric-avgBlockerDepth);\n\nshadow=mix(darkness,1.,shadow);\n\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\nfloat computeShadowWithPCSS16(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);\n}\nfloat computeShadowWithPCSS32(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);\n}\nfloat computeShadowWithPCSS64(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);\n}\n#endif\n#endif\n",
                fresnelFunction: "#ifdef FRESNEL\nfloat computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power)\n{\nfloat fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);\nreturn clamp(fresnelTerm,0.,1.);\n}\n#endif",
                reflectionFunction: "#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC\nvec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {\n\nvec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;\nvec3 halfSize=cubeSize*0.5;\nvec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;\nvec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;\n\nvec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);\n\nfloat distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);\n\nvec3 intersectPositionWS=vertexPos+origVec*distance;\n\nreturn intersectPositionWS-cubePos;\n}\n#endif\nvec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)\n{\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvec3 direction=normalize(vDirectionW);\nfloat lon=atan(direction.z,direction.x);\nfloat lat=acos(direction.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y; \n#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\nreturn vec3(1.0-s,t,0);\n#else\nreturn vec3(s,t,0);\n#endif\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR\nvec3 cameraToVertex=normalize(worldPos.xyz-vEyePosition.xyz);\nvec3 r=normalize(reflect(cameraToVertex,worldNormal));\nfloat lon=atan(r.z,r.x);\nfloat lat=acos(r.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y; \nreturn vec3(s,t,0);\n#endif\n#ifdef REFLECTIONMAP_SPHERICAL\nvec3 viewDir=normalize(vec3(view*worldPos));\nvec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));\nvec3 r=reflect(viewDir,viewNormal);\nr.z=r.z-1.0;\nfloat m=2.0*length(r);\nreturn vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);\n#endif\n#ifdef REFLECTIONMAP_PLANAR\nvec3 viewDir=worldPos.xyz-vEyePosition.xyz;\nvec3 coords=normalize(reflect(viewDir,worldNormal));\nreturn vec3(reflectionMatrix*vec4(coords,1));\n#endif\n#ifdef REFLECTIONMAP_CUBIC\nvec3 viewDir=normalize(worldPos.xyz-vEyePosition.xyz);\n\nvec3 coords=reflect(viewDir,worldNormal);\n#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC\ncoords=parallaxCorrectNormal(worldPos.xyz,coords,vReflectionSize,vReflectionPosition);\n#endif\ncoords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;\n#endif\n#ifdef REFLECTIONMAP_PROJECTION\nreturn vec3(reflectionMatrix*(view*worldPos));\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nreturn vPositionUVW;\n#endif\n#ifdef REFLECTIONMAP_EXPLICIT\nreturn vec3(0,0,0);\n#endif\n}",
                imageProcessingDeclaration: "#ifdef EXPOSURE\nuniform float exposureLinear;\n#endif\n#ifdef CONTRAST\nuniform float contrast;\n#endif\n#ifdef VIGNETTE\nuniform vec2 vInverseScreenSize;\nuniform vec4 vignetteSettings1;\nuniform vec4 vignetteSettings2;\n#endif\n#ifdef COLORCURVES\nuniform vec4 vCameraColorCurveNegative;\nuniform vec4 vCameraColorCurveNeutral;\nuniform vec4 vCameraColorCurvePositive;\n#endif\n#ifdef COLORGRADING\n#ifdef COLORGRADING3D\nuniform highp sampler3D txColorTransform;\n#else\nuniform sampler2D txColorTransform;\n#endif\nuniform vec4 colorTransformSettings;\n#endif",
                imageProcessingFunctions: "#if defined(COLORGRADING) && !defined(COLORGRADING3D)\n\nvec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting)\n{\nfloat sliceSize=2.0*sampler3dSetting.x; \n#ifdef SAMPLER3DGREENDEPTH\nfloat sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y;\n#else\nfloat sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y;\n#endif\nfloat sliceInteger=floor(sliceContinuous);\n\n\nfloat sliceFraction=sliceContinuous-sliceInteger;\n#ifdef SAMPLER3DGREENDEPTH\nvec2 sliceUV=color.rb;\n#else\nvec2 sliceUV=color.rg;\n#endif\nsliceUV.x*=sliceSize;\nsliceUV.x+=sliceInteger*sliceSize;\nsliceUV=clamp(sliceUV,0.,1.);\nvec4 slice0Color=texture2D(colorTransform,sliceUV);\nsliceUV.x+=sliceSize;\nsliceUV=clamp(sliceUV,0.,1.);\nvec4 slice1Color=texture2D(colorTransform,sliceUV);\nvec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);\n#ifdef SAMPLER3DBGRMAP\ncolor.rgb=result.rgb;\n#else\ncolor.rgb=result.bgr;\n#endif\nreturn color;\n}\n#endif\n#ifdef TONEMAPPING_ACES\n\n\n\n\n\nconst mat3 ACESInputMat=mat3(\nvec3(0.59719,0.07600,0.02840),\nvec3(0.35458,0.90834,0.13383),\nvec3(0.04823,0.01566,0.83777)\n);\n\nconst mat3 ACESOutputMat=mat3(\nvec3( 1.60475,-0.10208,-0.00327),\nvec3(-0.53108,1.10813,-0.07276),\nvec3(-0.07367,-0.00605,1.07602)\n);\nvec3 RRTAndODTFit(vec3 v)\n{\nvec3 a=v*(v+0.0245786)-0.000090537;\nvec3 b=v*(0.983729*v+0.4329510)+0.238081;\nreturn a/b;\n}\nvec3 ACESFitted(vec3 color)\n{\ncolor=ACESInputMat*color;\n\ncolor=RRTAndODTFit(color);\ncolor=ACESOutputMat*color;\n\ncolor=clamp(color,0.0,1.0);\nreturn color;\n}\n#endif\nvec4 applyImageProcessing(vec4 result) {\n#ifdef EXPOSURE\nresult.rgb*=exposureLinear;\n#endif\n#ifdef VIGNETTE\n\nvec2 viewportXY=gl_FragCoord.xy*vInverseScreenSize;\nviewportXY=viewportXY*2.0-1.0;\nvec3 vignetteXY1=vec3(viewportXY*vignetteSettings1.xy+vignetteSettings1.zw,1.0);\nfloat vignetteTerm=dot(vignetteXY1,vignetteXY1);\nfloat vignette=pow(vignetteTerm,vignetteSettings2.w);\n\nvec3 vignetteColor=vignetteSettings2.rgb;\n#ifdef VIGNETTEBLENDMODEMULTIPLY\nvec3 vignetteColorMultiplier=mix(vignetteColor,vec3(1,1,1),vignette);\nresult.rgb*=vignetteColorMultiplier;\n#endif\n#ifdef VIGNETTEBLENDMODEOPAQUE\nresult.rgb=mix(vignetteColor,result.rgb,vignette);\n#endif\n#endif\n#ifdef TONEMAPPING\n#ifdef TONEMAPPING_ACES\nresult.rgb=ACESFitted(result.rgb);\n#else\nconst float tonemappingCalibration=1.590579;\nresult.rgb=1.0-exp2(-tonemappingCalibration*result.rgb);\n#endif\n#endif\n\nresult.rgb=toGammaSpace(result.rgb);\nresult.rgb=clamp(result.rgb,0.0,1.0);\n#ifdef CONTRAST\n\nvec3 resultHighContrast=applyEaseInOut(result.rgb);\nif (contrast<1.0) {\n\nresult.rgb=mix(vec3(0.5,0.5,0.5),result.rgb,contrast);\n} else {\n\nresult.rgb=mix(result.rgb,resultHighContrast,contrast-1.0);\n}\n#endif\n\n#ifdef COLORGRADING\nvec3 colorTransformInput=result.rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;\n#ifdef COLORGRADING3D\nvec3 colorTransformOutput=texture(txColorTransform,colorTransformInput).rgb;\n#else\nvec3 colorTransformOutput=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;\n#endif\nresult.rgb=mix(result.rgb,colorTransformOutput,colorTransformSettings.www);\n#endif\n#ifdef COLORCURVES\n\nfloat luma=getLuminance(result.rgb);\nvec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0),vec2(1.0));\nvec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;\nresult.rgb*=colorCurve.rgb;\nresult.rgb=mix(vec3(luma),result.rgb,colorCurve.a);\n#endif\nreturn result;\n}",
                bumpFragmentFunctions: "#ifdef BUMP\n#if BUMPDIRECTUV == 1\n#define vBumpUV vMainUV1\n#elif BUMPDIRECTUV == 2\n#define vBumpUV vMainUV2\n#else\nvarying vec2 vBumpUV;\n#endif\nuniform sampler2D bumpSampler;\n#if defined(TANGENT) && defined(NORMAL) \nvarying mat3 vTBN;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nuniform mat4 normalMatrix;\n#endif\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{\n\nuv=gl_FrontFacing ? uv : -uv;\n\nvec3 dp1=dFdx(p);\nvec3 dp2=dFdy(p);\nvec2 duv1=dFdx(uv);\nvec2 duv2=dFdy(uv);\n\nvec3 dp2perp=cross(dp2,normal);\nvec3 dp1perp=cross(normal,dp1);\nvec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;\nvec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;\n\ntangent*=vTangentSpaceParams.x;\nbitangent*=vTangentSpaceParams.y;\n\nfloat invmax=inversesqrt(max(dot(tangent,tangent),dot(bitangent,bitangent)));\nreturn mat3(tangent*invmax,bitangent*invmax,normal);\n}\nvec3 perturbNormal(mat3 cotangentFrame,vec2 uv)\n{\nvec3 map=texture2D(bumpSampler,uv).xyz;\nmap=map*2.0-1.0;\n#ifdef NORMALXYSCALE\nmap=normalize(map*vec3(vBumpInfos.y,vBumpInfos.y,1.0));\n#endif\nreturn normalize(cotangentFrame*map);\n}\n#ifdef PARALLAX\nconst float minSamples=4.;\nconst float maxSamples=15.;\nconst int iMaxSamples=15;\n\nvec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {\nfloat parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;\nparallaxLimit*=parallaxScale;\nvec2 vOffsetDir=normalize(vViewDirCoT.xy);\nvec2 vMaxOffset=vOffsetDir*parallaxLimit;\nfloat numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));\nfloat stepSize=1.0/numSamples;\n\nfloat currRayHeight=1.0;\nvec2 vCurrOffset=vec2(0,0);\nvec2 vLastOffset=vec2(0,0);\nfloat lastSampledHeight=1.0;\nfloat currSampledHeight=1.0;\nfor (int i=0; i<iMaxSamples; i++)\n{\ncurrSampledHeight=texture2D(bumpSampler,vBumpUV+vCurrOffset).w;\n\nif (currSampledHeight>currRayHeight)\n{\nfloat delta1=currSampledHeight-currRayHeight;\nfloat delta2=(currRayHeight+stepSize)-lastSampledHeight;\nfloat ratio=delta1/(delta1+delta2);\nvCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;\n\nbreak;\n}\nelse\n{\ncurrRayHeight-=stepSize;\nvLastOffset=vCurrOffset;\nvCurrOffset+=stepSize*vMaxOffset;\nlastSampledHeight=currSampledHeight;\n}\n}\nreturn vCurrOffset;\n}\nvec2 parallaxOffset(vec3 viewDir,float heightScale)\n{\n\nfloat height=texture2D(bumpSampler,vBumpUV).w;\nvec2 texCoordOffset=heightScale*viewDir.xy*height;\nreturn -texCoordOffset;\n}\n#endif\n#endif",
                clipPlaneFragmentDeclaration: "#ifdef CLIPPLANE\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nvarying float fClipDistance4;\n#endif",
                fogFragmentDeclaration: "#ifdef FOG\n#define FOGMODE_NONE 0.\n#define FOGMODE_EXP 1.\n#define FOGMODE_EXP2 2.\n#define FOGMODE_LINEAR 3.\n#define E 2.71828\nuniform vec4 vFogInfos;\nuniform vec3 vFogColor;\nvarying vec3 vFogDistance;\nfloat CalcFogFactor()\n{\nfloat fogCoeff=1.0;\nfloat fogStart=vFogInfos.y;\nfloat fogEnd=vFogInfos.z;\nfloat fogDensity=vFogInfos.w;\nfloat fogDistance=length(vFogDistance);\nif (FOGMODE_LINEAR == vFogInfos.x)\n{\nfogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);\n}\nelse if (FOGMODE_EXP == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDensity);\n}\nelse if (FOGMODE_EXP2 == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);\n}\nreturn clamp(fogCoeff,0.0,1.0);\n}\n#endif",
                clipPlaneFragment: "#ifdef CLIPPLANE\nif (fClipDistance>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE2\nif (fClipDistance2>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE3\nif (fClipDistance3>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE4\nif (fClipDistance4>0.0)\n{\ndiscard;\n}\n#endif",
                bumpFragment: "vec2 uvOffset=vec2(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX)\n#ifdef NORMALXYSCALE\nfloat normalScale=1.0;\n#else \nfloat normalScale=vBumpInfos.y;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#else\nmat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,vBumpUV);\n#endif\n#endif\n#ifdef PARALLAX\nmat3 invTBN=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);\n#endif\n#endif\n#ifdef BUMP\n#ifdef OBJECTSPACE_NORMALMAP\nnormalW=normalize(texture2D(bumpSampler,vBumpUV).xyz*2.0-1.0);\nnormalW=normalize(mat3(normalMatrix)*normalW); \n#else\nnormalW=perturbNormal(TBN,vBumpUV+uvOffset);\n#endif\n#endif",
                lightFragment: "#ifdef LIGHT{X}\n#if defined(SHADOWONLY) || (defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X}))\n\n#else\n#ifdef PBR\n#ifdef SPOTLIGHT{X}\nspotInfo=computeSpotLightingInfo(light{X}.vLightData);\n#ifdef LIGHT_FALLOFF_GLTF{X}\nspotInfo.attenuation=computeDistanceLightFalloff_GLTF(spotInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\nspotInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,spotInfo.directionToLightCenterW,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\nspotInfo.attenuation=computeDistanceLightFalloff_Physical(spotInfo.lightDistanceSquared);\nspotInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,spotInfo.directionToLightCenterW,light{X}.vLightDirection.w);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\nspotInfo.attenuation=computeDistanceLightFalloff_Standard(spotInfo.lightOffset,light{X}.vLightFalloff.x);\nspotInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,spotInfo.directionToLightCenterW,light{X}.vLightDirection.w,light{X}.vLightData.w);\n#else\nspotInfo.attenuation=computeDistanceLightFalloff(spotInfo.lightOffset,spotInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\nspotInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,spotInfo.directionToLightCenterW,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#endif\ninfo=computeSpotLighting(spotInfo,viewDirectionW,normalW,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightDiffuse.a,roughness,NdotV,specularEnvironmentR0,specularEnvironmentR90,geometricRoughnessFactor,NdotL);\n#elif defined(POINTLIGHT{X})\npointInfo=computePointLightingInfo(light{X}.vLightData);\n#ifdef LIGHT_FALLOFF_GLTF{X}\npointInfo.attenuation=computeDistanceLightFalloff_GLTF(pointInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npointInfo.attenuation=computeDistanceLightFalloff_Physical(pointInfo.lightDistanceSquared);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npointInfo.attenuation=computeDistanceLightFalloff_Standard(pointInfo.lightOffset,light{X}.vLightFalloff.x);\n#else\npointInfo.attenuation=computeDistanceLightFalloff(pointInfo.lightOffset,pointInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\n#endif\ninfo=computePointLighting(pointInfo,viewDirectionW,normalW,light{X}.vLightDiffuse.rgb,light{X}.vLightDiffuse.a,roughness,NdotV,specularEnvironmentR0,specularEnvironmentR90,geometricRoughnessFactor,NdotL);\n#elif defined(HEMILIGHT{X})\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,light{X}.vLightGround,roughness,NdotV,specularEnvironmentR0,specularEnvironmentR90,geometricRoughnessFactor,NdotL);\n#elif defined(DIRLIGHT{X})\ninfo=computeDirectionalLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,light{X}.vLightDiffuse.a,roughness,NdotV,specularEnvironmentR0,specularEnvironmentR90,geometricRoughnessFactor,NdotL);\n#endif\n#else\n#ifdef SPOTLIGHT{X}\ninfo=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,light{X}.vLightDiffuse.a,glossiness);\n#elif defined(HEMILIGHT{X})\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,light{X}.vLightGround,glossiness);\n#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,light{X}.vLightDiffuse.a,glossiness);\n#endif\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\ninfo.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightSampler{X},textureProjectionMatrix{X});\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCLOSEESM{X}\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithCloseESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPOISSON{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithPoissonSamplingCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#else\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#endif\n#ifdef SHADOWONLY\n#ifndef SHADOWINUSE\n#define SHADOWINUSE\n#endif\nglobalShadow+=shadow;\nshadowLightCount+=1.0;\n#endif\n#else\nshadow=1.;\n#endif\n#ifndef SHADOWONLY\n#ifdef CUSTOMUSERLIGHTING\ndiffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);\n#ifdef SPECULARTERM\nspecularBase+=computeCustomSpecularLighting(info,specularBase,shadow);\n#endif\n#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\ndiffuseBase+=lightmapColor*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor;\n#endif\n#endif\n#else\ndiffuseBase+=info.diffuse*shadow;\n#ifdef SPECULARTERM\nspecularBase+=info.specular*shadow;\n#endif\n#endif\n#endif\n#endif",
                logDepthFragment: "#ifdef LOGARITHMICDEPTH\ngl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;\n#endif",
                fogFragment: "#ifdef FOG\nfloat fog=CalcFogFactor();\ncolor.rgb=fog*color.rgb+(1.0-fog)*vFogColor;\n#endif",
                pbrVertexDeclaration: "uniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef ALBEDO\nuniform mat4 albedoMatrix;\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;\nuniform vec4 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#ifdef REFLECTIVITY \nuniform vec3 vReflectivityInfos;\nuniform mat4 reflectivityMatrix;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;\nuniform mat4 microSurfaceSamplerMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\nuniform vec3 vRefractionMicrosurfaceInfos;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#endif\n",
                pbrFragmentDeclaration: "uniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\n\nuniform vec4 vLightingIntensity;\nuniform vec4 vReflectivityColor;\nuniform vec3 vEmissiveColor;\n\n#ifdef ALBEDO\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nuniform vec4 vAmbientInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#ifdef OPACITY \nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef REFLECTIVITY\nuniform vec3 vReflectivityInfos;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;\n#endif\n\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\nuniform vec3 vRefractionMicrosurfaceInfos;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize; \n#endif\n#endif",
                pbrUboDeclaration: "layout(std140,column_major) uniform;\nuniform Material\n{\nuniform vec2 vAlbedoInfos;\nuniform vec4 vAmbientInfos;\nuniform vec2 vOpacityInfos;\nuniform vec2 vEmissiveInfos;\nuniform vec2 vLightmapInfos;\nuniform vec3 vReflectivityInfos;\nuniform vec2 vMicroSurfaceSamplerInfos;\nuniform vec4 vRefractionInfos;\nuniform vec2 vReflectionInfos;\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize; \nuniform vec3 vBumpInfos;\nuniform mat4 albedoMatrix;\nuniform mat4 ambientMatrix;\nuniform mat4 opacityMatrix;\nuniform mat4 emissiveMatrix;\nuniform mat4 lightmapMatrix;\nuniform mat4 reflectivityMatrix;\nuniform mat4 microSurfaceSamplerMatrix;\nuniform mat4 bumpMatrix;\nuniform vec2 vTangentSpaceParams;\nuniform mat4 refractionMatrix;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\nuniform vec4 vLightingIntensity;\nuniform vec3 vRefractionMicrosurfaceInfos;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform vec4 vReflectivityColor;\nuniform vec3 vEmissiveColor;\nuniform float pointSize;\n};\nuniform Scene {\nmat4 viewProjection;\nmat4 view;\n};",
                pbrFunctions: "\n#define RECIPROCAL_PI2 0.15915494\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\n\nconst float kRougnhessToAlphaScale=0.1;\nconst float kRougnhessToAlphaOffset=0.29248125;\nfloat convertRoughnessToAverageSlope(float roughness)\n{\n\nconst float kMinimumVariance=0.0005;\nfloat alphaG=square(roughness)+kMinimumVariance;\nreturn alphaG;\n}\n\nfloat smithVisibilityG1_TrowbridgeReitzGGX(float dot,float alphaG)\n{\nfloat tanSquared=(1.0-dot*dot)/(dot*dot);\nreturn 2.0/(1.0+sqrt(1.0+alphaG*alphaG*tanSquared));\n}\nfloat smithVisibilityG_TrowbridgeReitzGGX_Walter(float NdotL,float NdotV,float alphaG)\n{\nreturn smithVisibilityG1_TrowbridgeReitzGGX(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGX(NdotV,alphaG);\n}\n\n\nfloat normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)\n{\n\n\n\nfloat a2=square(alphaG);\nfloat d=NdotH*NdotH*(a2-1.0)+1.0;\nreturn a2/(PI*d*d);\n}\nvec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)\n{\nreturn reflectance0+(reflectance90-reflectance0)*pow(clamp(1.0-VdotH,0.,1.),5.0);\n}\nvec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{\n\nfloat weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);\nreturn reflectance0+weight*(reflectance90-reflectance0)*pow(clamp(1.0-VdotN,0.,1.),5.0);\n}\n\nvec3 computeSpecularTerm(float NdotH,float NdotL,float NdotV,float VdotH,float roughness,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor)\n{\nroughness=max(roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\nfloat distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);\nfloat visibility=smithVisibilityG_TrowbridgeReitzGGX_Walter(NdotL,NdotV,alphaG);\nvisibility/=(4.0*NdotL*NdotV); \nfloat specTerm=max(0.,visibility*distribution)*NdotL;\nvec3 fresnel=fresnelSchlickGGX(VdotH,reflectance0,reflectance90);\nreturn fresnel*specTerm;\n}\nfloat computeDiffuseTerm(float NdotL,float NdotV,float VdotH,float roughness)\n{\n\n\nfloat diffuseFresnelNV=pow(clamp(1.0-NdotL,0.000001,1.),5.0);\nfloat diffuseFresnelNL=pow(clamp(1.0-NdotV,0.000001,1.),5.0);\nfloat diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;\nfloat fresnel =\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);\nreturn fresnel*NdotL/PI;\n}\nfloat adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance)\n{\n#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)\n\nfloat lightRoughness=lightRadius/lightDistance;\n\nfloat totalRoughness=clamp(lightRoughness+roughness,0.,1.);\nreturn totalRoughness;\n#else\nreturn roughness;\n#endif\n}\nfloat computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor)\n{\nconst float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;\nfloat reflectivityLuminance=getLuminance(reflectivityColor);\nfloat reflectivityLuma=sqrt(reflectivityLuminance);\nmicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;\nreturn microSurface;\n}\n\n\nfloat fresnelGrazingReflectance(float reflectance0) {\nfloat reflectance90=clamp(reflectance0*25.0,0.0,1.0);\nreturn reflectance90;\n}\n\n\n#define UNPACK_LOD(x) (1.0-x)*255.0\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {\nfloat microsurfaceAverageSlope=alphaG;\n\n\n\n\n\n\nmicrosurfaceAverageSlope*=sqrt(abs(NdotV));\nfloat microsurfaceAverageSlopeTexels=microsurfaceAverageSlope*cubeMapDimensionPixels;\nfloat lod=log2(microsurfaceAverageSlopeTexels);\nreturn lod;\n}\nfloat environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {\n\n\nfloat temp=NdotVUnclamped+ambientOcclusion;\nreturn clamp(square(temp)-1.0+ambientOcclusion,0.0,1.0);\n}\nfloat environmentHorizonOcclusion(vec3 view,vec3 normal) {\n\nvec3 reflection=reflect(view,normal);\nfloat temp=clamp( 1.0+1.1*dot(reflection,normal),0.0,1.0);\nreturn square(temp);\n}",
                harmonicsFunctions: "#ifdef USESPHERICALFROMREFLECTIONMAP\nuniform vec3 vSphericalX;\nuniform vec3 vSphericalY;\nuniform vec3 vSphericalZ;\nuniform vec3 vSphericalXX_ZZ;\nuniform vec3 vSphericalYY_ZZ;\nuniform vec3 vSphericalZZ;\nuniform vec3 vSphericalXY;\nuniform vec3 vSphericalYZ;\nuniform vec3 vSphericalZX;\nvec3 quaternionVectorRotation_ScaledSqrtTwo(vec4 Q,vec3 V){\nvec3 T=cross(Q.xyz,V);\nT+=Q.www*V;\nreturn cross(Q.xyz,T)+V;\n}\nvec3 environmentIrradianceJones(vec3 normal)\n{\n\n\n\n\n\n\n\n\n\nfloat Nx=normal.x;\nfloat Ny=normal.y;\nfloat Nz=normal.z;\nvec3 C1=vSphericalZZ.rgb;\nvec3 Cx=vSphericalX.rgb;\nvec3 Cy=vSphericalY.rgb;\nvec3 Cz=vSphericalZ.rgb;\nvec3 Cxx_zz=vSphericalXX_ZZ.rgb;\nvec3 Cyy_zz=vSphericalYY_ZZ.rgb;\nvec3 Cxy=vSphericalXY.rgb;\nvec3 Cyz=vSphericalYZ.rgb;\nvec3 Czx=vSphericalZX.rgb;\nvec3 a1=Cyy_zz*Ny+Cy;\nvec3 a2=Cyz*Nz+a1;\nvec3 b1=Czx*Nz+Cx;\nvec3 b2=Cxy*Ny+b1;\nvec3 b3=Cxx_zz*Nx+b2;\nvec3 t1=Cz*Nz+C1;\nvec3 t2=a2*Ny+t1;\nvec3 t3=b3*Nx+t2;\nreturn t3;\n}\n#endif",
                pbrLightFunctions: "\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n};\nstruct pointLightingInfo\n{\nvec3 lightOffset;\nfloat lightDistanceSquared;\nfloat attenuation;\n};\nstruct spotLightingInfo\n{\nvec3 lightOffset;\nfloat lightDistanceSquared;\nvec3 directionToLightCenterW;\nfloat attenuation;\n};\nfloat computeDistanceLightFalloff_Standard(vec3 lightOffset,float range)\n{\nreturn max(0.,1.0-length(lightOffset)/range);\n}\nfloat computeDistanceLightFalloff_Physical(float lightDistanceSquared)\n{\nreturn 1.0/((lightDistanceSquared+0.001));\n}\nfloat computeDistanceLightFalloff_GLTF(float lightDistanceSquared,float inverseSquaredRange)\n{\nconst float minDistanceSquared=0.01*0.01;\nfloat lightDistanceFalloff=1.0/(max(lightDistanceSquared,minDistanceSquared));\nfloat factor=lightDistanceSquared*inverseSquaredRange;\nfloat attenuation=clamp(1.0-factor*factor,0.,1.);\nattenuation*=attenuation;\n\nlightDistanceFalloff*=attenuation;\nreturn lightDistanceFalloff;\n}\nfloat computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range,float inverseSquaredRange)\n{ \n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDistanceLightFalloff_Physical(lightDistanceSquared);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);\n#else\nreturn computeDistanceLightFalloff_Standard(lightOffset,range);\n#endif\n}\nfloat computeDirectionalLightFalloff_Standard(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent)\n{\nfloat falloff=0.0;\nfloat cosAngle=max(0.000000000000001,dot(-lightDirection,directionToLightCenterW));\nif (cosAngle>=cosHalfAngle)\n{\nfalloff=max(0.,pow(cosAngle,exponent));\n}\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff_Physical(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle)\n{\nconst float kMinusLog2ConeAngleIntensityRatio=6.64385618977; \n\n\n\n\n\nfloat concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);\n\n\nvec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);\nfloat falloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff_GLTF(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngleScale,float lightAngleOffset)\n{\n\n\n\nfloat cd=dot(-lightDirection,directionToLightCenterW);\nfloat falloff=clamp(cd*lightAngleScale+lightAngleOffset,0.,1.);\n\nfalloff*=falloff;\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent,float lightAngleScale,float lightAngleOffset)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);\n#else\nreturn computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);\n#endif\n}\npointLightingInfo computePointLightingInfo(vec4 lightData) {\npointLightingInfo result;\nresult.lightOffset=lightData.xyz-vPositionW;\nresult.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);\nreturn result;\n}\nspotLightingInfo computeSpotLightingInfo(vec4 lightData) {\nspotLightingInfo result;\nresult.lightOffset=lightData.xyz-vPositionW;\nresult.directionToLightCenterW=normalize(result.lightOffset);\nresult.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);\nreturn result;\n}\nlightingInfo computePointLighting(pointLightingInfo info,vec3 viewDirectionW,vec3 vNormal,vec3 diffuseColor,float lightRadius,float roughness,float NdotV,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,out float NdotL) {\nlightingInfo result;\nfloat lightDistance=sqrt(info.lightDistanceSquared);\nvec3 lightDirection=normalize(info.lightOffset);\n\nroughness=adjustRoughnessFromLightProperties(roughness,lightRadius,lightDistance);\n\nvec3 H=normalize(viewDirectionW+lightDirection);\nNdotL=clamp(dot(vNormal,lightDirection),0.00000000001,1.0);\nfloat VdotH=clamp(dot(viewDirectionW,H),0.0,1.0);\nfloat diffuseTerm=computeDiffuseTerm(NdotL,NdotV,VdotH,roughness);\nresult.diffuse=diffuseTerm*diffuseColor*info.attenuation;\n#ifdef SPECULARTERM\n\nfloat NdotH=clamp(dot(vNormal,H),0.000000000001,1.0);\nvec3 specTerm=computeSpecularTerm(NdotH,NdotL,NdotV,VdotH,roughness,reflectance0,reflectance90,geometricRoughnessFactor);\nresult.specular=specTerm*diffuseColor*info.attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeSpotLighting(spotLightingInfo info,vec3 viewDirectionW,vec3 vNormal,vec4 lightDirection,vec3 diffuseColor,float lightRadius,float roughness,float NdotV,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,out float NdotL) {\nlightingInfo result;\n\nfloat lightDistance=sqrt(info.lightDistanceSquared);\nroughness=adjustRoughnessFromLightProperties(roughness,lightRadius,lightDistance);\n\nvec3 H=normalize(viewDirectionW+info.directionToLightCenterW);\nNdotL=clamp(dot(vNormal,info.directionToLightCenterW),0.000000000001,1.0);\nfloat VdotH=clamp(dot(viewDirectionW,H),0.0,1.0);\nfloat diffuseTerm=computeDiffuseTerm(NdotL,NdotV,VdotH,roughness);\nresult.diffuse=diffuseTerm*diffuseColor*info.attenuation;\n#ifdef SPECULARTERM\n\nfloat NdotH=clamp(dot(vNormal,H),0.000000000001,1.0);\nvec3 specTerm=computeSpecularTerm(NdotH,NdotL,NdotV,VdotH,roughness,reflectance0,reflectance90,geometricRoughnessFactor);\nresult.specular=specTerm*diffuseColor*info.attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeDirectionalLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float lightRadius,float roughness,float NdotV,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,out float NdotL) {\nlightingInfo result;\nfloat lightDistance=length(-lightData.xyz);\nvec3 lightDirection=normalize(-lightData.xyz);\n\nroughness=adjustRoughnessFromLightProperties(roughness,lightRadius,lightDistance);\n\nvec3 H=normalize(viewDirectionW+lightDirection);\nNdotL=clamp(dot(vNormal,lightDirection),0.00000000001,1.0);\nfloat VdotH=clamp(dot(viewDirectionW,H),0.0,1.0);\nfloat diffuseTerm=computeDiffuseTerm(NdotL,NdotV,VdotH,roughness);\nresult.diffuse=diffuseTerm*diffuseColor;\n#ifdef SPECULARTERM\n\nfloat NdotH=clamp(dot(vNormal,H),0.000000000001,1.0);\nvec3 specTerm=computeSpecularTerm(NdotH,NdotL,NdotV,VdotH,roughness,reflectance0,reflectance90,geometricRoughnessFactor);\nresult.specular=specTerm*diffuseColor;\n#endif\nreturn result;\n}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float roughness,float NdotV,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,out float NdotL) {\nlightingInfo result;\n\n\n\nNdotL=dot(vNormal,lightData.xyz)*0.5+0.5;\nresult.diffuse=mix(groundColor,diffuseColor,NdotL);\n#ifdef SPECULARTERM\n\nvec3 lightVectorW=normalize(lightData.xyz);\nvec3 H=normalize(viewDirectionW+lightVectorW);\nfloat NdotH=clamp(dot(vNormal,H),0.000000000001,1.0);\nNdotL=clamp(NdotL,0.000000000001,1.0);\nfloat VdotH=clamp(dot(viewDirectionW,H),0.0,1.0);\nvec3 specTerm=computeSpecularTerm(NdotH,NdotL,NdotV,VdotH,roughness,reflectance0,reflectance90,geometricRoughnessFactor);\nresult.specular=specTerm*diffuseColor;\n#endif\nreturn result;\n}\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn toLinearSpace(textureColor);\n}",
                clipPlaneVertexDeclaration2: "#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nout float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nout float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nout float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nout float fClipDistance4;\n#endif",
                clipPlaneFragmentDeclaration2: "#ifdef CLIPPLANE\nin float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nin float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nin float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nin float fClipDistance4;\n#endif",
                mrtFragmentDeclaration: "#if __VERSION__>=200\nlayout(location=0) out vec4 glFragData[{X}];\n#endif\n",
                bones300Declaration: "#if NUM_BONE_INFLUENCERS>0\nuniform mat4 mBones[BonesPerMesh];\nin vec4 matricesIndices;\nin vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nin vec4 matricesIndicesExtra;\nin vec4 matricesWeightsExtra;\n#endif\n#endif",
                instances300Declaration: "#ifdef INSTANCES\nin vec4 world0;\nin vec4 world1;\nin vec4 world2;\nin vec4 world3;\n#else\nuniform mat4 world;\n#endif",
                kernelBlurFragment: "#ifdef DOF\nfactor=sampleCoC(sampleCoord{X}); \ncomputedWeight=KERNEL_WEIGHT{X}*factor;\nsumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCoord{X})*computedWeight;\n#endif",
                kernelBlurFragment2: "#ifdef DOF\nfactor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});\ncomputedWeight=KERNEL_DEP_WEIGHT{X}*factor;\nsumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_DEP_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight;\n#endif",
                kernelBlurVaryingDeclaration: "varying vec2 sampleCoord{X};",
                kernelBlurVertex: "sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};",
                backgroundVertexDeclaration: "uniform mat4 view;\nuniform mat4 viewProjection;\nuniform float shadowLevel;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif",
                backgroundFragmentDeclaration: " uniform vec4 vPrimaryColor;\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nuniform vec4 vPrimaryColorShadow;\n#endif\nuniform float shadowLevel;\nuniform float alpha;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#endif\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif",
                backgroundUboDeclaration: "layout(std140,column_major) uniform;\nuniform Material\n{\nuniform vec4 vPrimaryColor;\nuniform vec4 vPrimaryColorShadow;\nuniform vec2 vDiffuseInfos;\nuniform vec2 vReflectionInfos;\nuniform mat4 diffuseMatrix;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\nuniform float pointSize;\nuniform float shadowLevel;\nuniform float alpha;\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n};\nuniform Scene {\nmat4 viewProjection;\nmat4 view;\n};"
            };
            var tl = "undefined" != typeof global ? global : "undefined" != typeof window ? window : this;
            return tl.BABYLON = $a, void 0 !== i && (tl.Earcut = {
                earcut: i
            }), $a
        }), define("babylonjs", function(e) {
            return function() {
                return e.BABYLON
            }
        }(this)), define("game/components/bonusWheel/arrowController", ["require", "com/gsap/TweenMax", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "com/pixijs/pixi", "game/utils/miscUtils", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            "use strict";
            var t = e("com/gsap/TweenMax"),
                i = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                r = (e("com/pixijs/pixi"), e("game/utils/miscUtils"), e("game/components/createJsAudioPlayer/SoundManager")),
                n = function() {
                    var e = !1,
                        n = null,
                        o = null,
                        s = 0,
                        a = 0,
                        l = null;
                    this.init = function() {
                        o = i.lib._bwArrowInner.pixiContainer, o.visible = e, n = i.lib._bwArrowOutter.pixiContainer, n.visible = e
                    }, this.setLastTickCallback = function(e) {
                        l = e
                    };
                    var u = null;
                    this.update = function(e) {
                        var i = (e % 18 + 18) % 18 - 9;
                        i > -1 && i < 1 ? (0 === a && (a = e - s), null !== u && (u.kill(), u = null), o.rotation = a < 0 && i < 0 ? i : a > 0 && i > 0 ? i : 0) : 0 !== a && (null === u && (u = t.to(o, .1, {
                            rotation: 0
                        })), a = 0, r().execute("onPreBonusWheelIndex"), void 0 !== l && null !== l && l()), s = e
                    }, Object.defineProperty(this, "visible", {
                        get: function() {
                            return e
                        },
                        set: function(t) {
                            t !== e && (e = t, null != o && (o.visible = e), null != n && (n.visible = e))
                        }
                    })
                };
            return n.prototype.constructor = n, n
        }), define("game/components/bonusWheel/bonusWheel3d", ["require", "babylonjs", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "com/gsap/TweenMax", "com/pixijs/pixi", "game/components/bonusWheel/arrowController", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            var t = e("babylonjs"),
                i = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                r = e("com/gsap/TweenMax"),
                n = e("com/pixijs/pixi"),
                o = e("game/components/bonusWheel/arrowController"),
                s = e("game/components/createJsAudioPlayer/SoundManager"),
                a = function() {
                    function e() {
                        var e = (N % 18 + 18) % 18,
                            t = 18 - e;
                        F = !1;
                        var i = 9,
                            n = 15 * Math.random() - 7.5,
                            o = Math.round(N + t - 18 * D.length * 2 + n),
                            u = 3;
                        "en-PA" === R && (i = 35, u = 2);
                        var h = o + 20 * u,
                            p = !1,
                            f = o + 20;
                        A.push("[StopSpin] currentAng:" + N + ", angToMidWedge:" + t + ", rnd:" + n + ", stopAng : " + o);
                        var _ = {
                            ang: N
                        };
                        r.to(_, i, {
                            ang: o,
                            ease: Power2.easeOut,
                            onUpdate: function() {
                                N = _.ang, N <= h && !p && (s().execute("onPreBonusAnticipation"), p = !0), N <= f && !P && (P = !0)
                            },
                            onComplete: function() {
                                V = 0;
                                var e = d(Q.rotationQuaternion.toEulerAngles().x),
                                    t = e - n;
                                A.push("[StopSpin onComplete] stopAng:" + o + ", currentAng:" + N), A.push("[StopSpin onComplete] : stopWedgeAng:" + e + ", rnd:" + n + ", dif:" + t), N = o - t, c(N), A.push("[StopSpin onComplete] _currentAng = stopAng - dif = " + N), Math.abs(t) > .5 && a(), l()
                            }
                        })
                    }

                    function a() {
                        for (var e = 0; e < A.length; e++);
                    }

                    function l() {
                        if (Q) {
                            for (var e = 0; e < S.length; e++) S[e] !== Q && (S[e].material.diffuseColor = new t.Color3(.07, .07, .07));
                            i.lib._bwWheelFrameTop.pixiContainer.$sprite.tint = 4210752, i.lib._bwWheelFrameBottom.pixiContainer.$sprite.tint = 5263440, G.rotationQuaternion = Q.rotationQuaternion, z = 0, J && J()
                        }
                        setTimeout(function() {
                            Z && (G.setEnabled(!1), z = -1, Z())
                        }, 2500)
                    }

                    function u() {
                        if (E) {
                            if (E.render(), v ? b.texture = n.Texture.fromImage(x.toDataURL()) : b.texture.update(), F) {
                                var i = V * E.getAnimationRatio();
                                i = Math.max(i, -17), N = ((N + i) % 360 + 360) % 360;
                                (N % 18 + 18) % 18 <= 1 && (N -= 1);
                                var r = O;
                                c(N);
                                var o = Math.abs(r - O);
                                if (o > 1 && D.length, D === w) V < 0 && O === w.length - 1 && (D = I, O = I.length - 1);
                                else if (null !== K && q) {
                                    var s = ((K - O - 6) % D.length + D.length) % D.length;
                                    0 === s && e()
                                }
                            } else c(N);
                            if (G && z >= 0) {
                                if (Date.now() - j >= 1e3 / 30) {
                                    G.setVerticesData(t.VertexBuffer.UVKind, B[z].uvs);
                                    G.isEnabled(!0) || G.setEnabled(!0), z++, z >= B.length && (z = 0), j = Date.now()
                                }
                            }
                        }
                    }

                    function c(e) {
                        U.update(e);
                        var i = h($, e);
                        i < 0 ? i = -1 : i > 0 && (i = 1);
                        for (var r = 0; r < S.length; r++) {
                            var n = p((e + 18 * r) % 360),
                                o = new t.Vector3(1, 0, 0),
                                s = new t.Quaternion.RotationAxis(o, n);
                            S[r].rotationQuaternion = s;
                            var a = S[r].rotationQuaternion.toEulerAngles(),
                                l = S[r].isEnabled(!1),
                                u = 0 === a.z;
                            if (u && !l) {
                                var c = O;
                                i > 0 && (c = ee), S[r].setEnabled(!0), S[r].setVerticesData(t.VertexBuffer.UVKind, L[D[c]].uvs), null !== K && K === c && (Q = S[r]), i < 0 ? (O -= 1, O = (O % D.length + D.length) % D.length) : (ee += 1, ee = (ee % D.length + D.length) % D.length), O = (O % D.length + D.length) % D.length
                            } else !u && l && (S[r].setEnabled(!1), i < 0 ? (ee -= 1, ee = (ee % D.length + D.length) % D.length) : (O += 1, O = (O % D.length + D.length) % D.length))
                        }
                        $ = e
                    }

                    function h(e, t) {
                        var i = Math.abs(t - e) % 360,
                            r = i > 180 ? 360 - i : i;
                        return r *= t - e >= 0 && t - e <= 180 || t - e <= -180 && t - e >= -360 ? 1 : -1
                    }

                    function d(e) {
                        return e * (180 / Math.PI)
                    }

                    function p(e) {
                        return e * (Math.PI / 180)
                    }

                    function f() {
                        E = new t.Scene(T), E.clearColor = new t.Color4(0, 0, 0, 0), new t.UniversalCamera("UniversalCamera", new t.Vector3(0, 0, -6.4), E).setTarget(t.Vector3.Zero()), new t.HemisphericLight("light1", new t.Vector3(1, 1, 0), E).intensity = 10, new t.PointLight("light2", new t.Vector3(0, 7, -1), E).intensity = .4, new t.PointLight("light2", new t.Vector3(0, 0, -5), E).intensity = .1
                    }

                    function _() {
                        if (null != S)
                            for (var e = 0; e < S.length; e++) S[e].dispose();
                        S = [], O = 1;
                        for (var i = -90, r = new t.Vector3(0, 0, 3.157), n = 0; n < 20; n++) {
                            var o = t.MeshBuilder.CreatePlane("plane", {
                                height: 1,
                                width: 2.4,
                                sideOrientation: t.Mesh.FRONTSIDE
                            }, E);
                            o.material = new t.StandardMaterial("mat", E), o.material.diffuseTexture = t.Texture.CreateFromBase64String(W, w[O] + "_" + n, E), o.setVerticesData(t.VertexBuffer.UVKind, L[w[O]].uvs), S.push(o);
                            var s = r.subtract(o.position);
                            o.setPivotPoint(s), S[n].rotate(t.Axis.X, i * (Math.PI / 180), t.Space.WORLD), S[n].setEnabled(0 === S[n].rotationQuaternion.toEulerAngles().z), i += 18, O = ((O - 1) % w.length + w.length) % w.length
                        }
                        G = t.MeshBuilder.CreatePlane("plane", {
                            height: 1.1,
                            width: 2.55,
                            sideOrientation: t.Mesh.FRONTSIDE
                        }, E), r = new t.Vector3(0, 0, 3.207);
                        var s = r.subtract(G.position);
                        G.setPivotPoint(s), G.rotate(t.Axis.X, Math.PI / 180, t.Space.WORLD), G.setEnabled(!1);
                        var a = new t.StandardMaterial("mat", E);
                        a.diffuseTexture = t.Texture.CreateFromBase64String(X, "winFrame", E), a.opacityTexture = t.Texture.CreateFromBase64String(X, "winFrameOp", E), G.material = a, N = i, O = 4, ee = 2
                    }

                    function m() {
                        var e = ["Black", "S", "U", "N", "O", "B", "Black", "25x", "45x", "50x", "60x", "65x", "75x", "80x", "85x", "90x", "1000x", "cliffHanger", "plinko"];
                        "en-PA" === R && (e = ["Black", "S", "U", "N", "O", "B", "Black", "25x", "45x", "50x", "60x", "65x", "75x", "80x", "85x", "90x", "1000x", "cliffHanger", "plinko", "100x", "130x", "170x", "190x", "192x", "200x", "210x", "230x", "260x", "280x", "300x", "320x", "340x", "360x", "380x", "400x", "420x", "440x", "460x", "480x", "500x", "520x", "560x", "600x", "640x", "680x", "720x", "760x", "800x", "840x", "880x", "900x", "920x", "960x"]), L = {};
                        for (var t = 0; t < e.length; t++) {
                            var i = e[t],
                                r = n.Texture.fromFrame("BonusWheelWedge_" + i);
                            L[i] = {
                                imgUrl: W,
                                uvs: [r._uvs.x0, 1 - r._uvs.y2, r._uvs.x1, 1 - r._uvs.y3, r._uvs.x2, 1 - r._uvs.y0, r._uvs.x3, 1 - r._uvs.y1]
                            }
                        }
                        B = [];
                        for (var t = 0; t < 9; t++) {
                            var r = n.Texture.fromFrame("BonusWheel_winBox_00" + t);
                            B.push({
                                imgUrl: X,
                                uvs: [r._uvs.x0, 1 - r._uvs.y2, r._uvs.x1, 1 - r._uvs.y3, r._uvs.x2, 1 - r._uvs.y0, r._uvs.x3, 1 - r._uvs.y1]
                            })
                        }
                    }

                    function g() {
                        var e = window.navigator.userAgent;
                        return e.indexOf("MSIE ") > 0 || (e.indexOf("Trident/") > 0 || e.indexOf("Edge/") > 0)
                    }
                    var v, y, b, x, T, E, S, P, A = [],
                        C = this,
                        M = !1,
                        R = window.location.search.match(/&?language=([^&]+)&?/)[1],
                        O = 0,
                        w = ["Black", "B", "O", "N", "U", "S", "Black"],
                        I = ["25x", "45x", "50x", "60x", "65x", "75x", "80x", "85x", "90x", "1000x", "cliffHanger", "plinko"],
                        D = null,
                        L = null,
                        B = null,
                        F = !1,
                        N = 0,
                        V = 0,
                        k = null,
                        U = null,
                        G = null,
                        z = -1,
                        j = 0,
                        H = null,
                        W = null,
                        X = null,
                        Y = !1;
                    this.initTexture = function() {
                        var e = n.Texture.fromFrame("BonusWheelWedge_S"),
                            r = n.Texture.fromImage(e.baseTexture.imageUrl),
                            o = new n.Sprite(r);
                        W = i.getPixiRenderer().plugins.extract.image(o);
                        var s = n.Texture.fromFrame("BonusWheel_winBox_000"),
                            a = n.Texture.fromImage(s.baseTexture.imageUrl),
                            l = new n.Sprite(a);
                        X = i.getPixiRenderer().plugins.extract.image(l), setTimeout(function() {
                            Y = !0
                        }, 300), x = document.createElement("canvas"), x.style.width = "405px", x.style.height = "720px", document.body.appendChild(x), T = new t.Engine(x), document.body.removeChild(x)
                    }, this.init = function() {
                        A = [], v = g(), S = [], y = i.lib._bwWheelContainer.pixiContainer, D = w, O = 0, m(), f(), b = v ? new n.Sprite(n.Texture.fromImage(x.toDataURL())) : new n.Sprite(n.Texture.fromCanvas(x)), b.width = 405, b.height = 720, y.addChild(b), U = new o, U.init(), U.setLastTickCallback(function() {
                            P && !isNaN(parseFloat(H)) ? s().execute("onPreBonusPrize") : P && "CliffHangersFreeSpinActive" === H ? s().execute("onPrebonusToBonus2Transition") : P && "PlinkoActive" === H && s().execute("onPrebonusToBonus1Transition")
                        }), U.visible = M, b.visible = M, M && T.runRenderLoop(u), P = !1
                    };
                    var q = !1,
                        K = null,
                        Q = null,
                        Z = null,
                        J = null;
                    this.startSpin = function(e) {
                        q = !1, K = null, Q = null, Z = null, k = null, V = Math.max(Math.min(V, 0), -5), F = !0;
                        var t = Math.abs(V + -4) / 2;
                        A.push("[StartSpin] currentSpeed :" + V + ", currentAng : " + N);
                        var i = {
                            speed: V
                        };
                        r.to(i, t, {
                            speed: -4,
                            onUpdate: function() {
                                V = i.speed
                            },
                            onComplete: function() {
                                q = !0, e && e()
                            }
                        })
                    }, this.stopSpin = function(e, t, i) {
                        K = e, Z = t, J = i
                    }, this.setStopText = function(e) {
                        H = e
                    }, this.forceStop = function() {
                        F = !1
                    }, this.reset = function() {
                        Y ? (D = w, O = 0, i.lib._bwWheelFrameTop.pixiContainer.$sprite.tint = 16777215, i.lib._bwWheelFrameBottom.pixiContainer.$sprite.tint = 16777215, _()) : setTimeout(C.reset, 30)
                    };
                    var $ = 0,
                        ee = 2;
                    this.setStrip = function(e) {
                        var t = {
                                CliffHangersFreeSpinActive: "cliffHanger",
                                PlinkoActive: "plinko"
                            },
                            i = e.StripInfo;
                        Array.isArray(i) || (i = [i]);
                        for (var r = null, n = [], o = 0; o < i.length; o++)
                            if ("BonusWheel.BonusSelect" === i[o]["@name"]) {
                                r = i[o].Strip;
                                for (var s = 0; s < r.Stop.length; s++) {
                                    var a = r.Stop[s]["@symbolID"],
                                        a = t[a] ? t[a] : a.toLowerCase();
                                    n.push(a)
                                }
                                break
                            }
                        I = n
                    }, this.addAng = function(e) {
                        if (e = e < 0 ? Math.max(e, -5) : Math.min(e, Math.abs(-4) + 1), N += e, null != k) {
                            var t = (Date.now() - k) / 1e3;
                            V = e / (t / (1 / 60))
                        } else V = 0;
                        k = Date.now()
                    }, Object.defineProperty(this, "visible", {
                        get: function() {
                            return M
                        },
                        set: function(e) {
                            e !== M && (M = e, null != b && (b.visible = M), null != U && (U.visible = M), M ? T.runRenderLoop(u) : T.stopRenderLoop(u))
                        }
                    }), this.clear = function() {
                        T.stopRenderLoop(u), y && y.removeChildren(), y = null, b = null, E = null, S = null, D = null, L = null, B = null, U = null, G = null
                    }
                };
            return a.prototype.constructor = a, a
        }), define("game/components/chaseLight/chaseLightBWArrowSpec", [], function() {
            return {
                spec: {
                    sprites: [{
                        index: "0",
                        posX: 536.6,
                        posY: 545.6
                    }, {
                        index: "1",
                        posX: 550.6,
                        posY: 517.1
                    }, {
                        index: "2",
                        posX: 516.1,
                        posY: 528.6
                    }, {
                        index: "3",
                        posX: 496.1,
                        posY: 510.6
                    }, {
                        index: "4",
                        posX: 559.1,
                        posY: 489.1
                    }, {
                        index: "5",
                        posX: 567.6,
                        posY: 461.1
                    }, {
                        index: "6",
                        posX: 476.6,
                        posY: 491.6
                    }, {
                        index: "7",
                        posX: 457.6,
                        posY: 466.6
                    }, {
                        index: "8",
                        posX: 572.6,
                        posY: 434.1
                    }, {
                        index: "9",
                        posX: 549.1,
                        posY: 433.1
                    }, {
                        index: "10",
                        posX: 479.1,
                        posY: 453.1
                    }, {
                        index: "11",
                        posX: 467.6,
                        posY: 416.1
                    }, {
                        index: "12",
                        posX: 549.1,
                        posY: 398.1
                    }, {
                        index: "13",
                        posX: 551.1,
                        posY: 361.6
                    }, {
                        index: "14",
                        posX: 458.1,
                        posY: 374.6
                    }, {
                        index: "15",
                        posX: 450.6,
                        posY: 331.6
                    }, {
                        index: "16",
                        posX: 555.1,
                        posY: 320.6
                    }, {
                        index: "17",
                        posX: 562.1,
                        posY: 283.1
                    }, {
                        index: "18",
                        posX: 448.1,
                        posY: 287.6
                    }, {
                        index: "19",
                        posX: 448.6,
                        posY: 246.1
                    }, {
                        index: "20",
                        posX: 572.6,
                        posY: 249.6
                    }, {
                        index: "21",
                        posX: 574.6,
                        posY: 212.1
                    }, {
                        index: "22",
                        posX: 537.6,
                        posY: 209.6
                    }, {
                        index: "23",
                        posX: 499.6,
                        posY: 207.6
                    }, {
                        index: "24",
                        posX: 458.1,
                        posY: 206.1
                    }],
                    animations: {
                        spinPlaqueAnim: [
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .25, .25],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, .5, .5],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, 1, 1, 1, 1],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75, .75, .75],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, 1, 1, .5, .5, .5, .5],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75, .25, .25, .25, .25],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, 1, 1, .5, .5, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, .25, .25, .25, .25, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, .5, .5, .5, .5, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, .5, .5, 1, 1, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, .25, .25, .75, .75, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, .5, .5, 1, 1, .5, .5, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, .25, .25, .75, .75, .75, .75, .25, .25, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .25, .25],
                            [0, .5, .5, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, .5, .5],
                            [.25, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75],
                            [.5, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, 1, 1, 1, 1],
                            [.75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75, .75, .75],
                            [1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, 1, 1, .5, .5, .5, .5],
                            [.75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75, .25, .25, .25, .25],
                            [.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, 1, 1, .5, .5, 0, 0, 0, 0],
                            [.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, .5, .5, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, .25, .25, .25, .25, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, .5, .5, .5, .5, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, .25, .25, .75, .75, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, .5, .5, 1, 1, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, .25, .25, .75, .75, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, .5, .5, 1, 1, .5, .5, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, .25, .25, .75, .75, .75, .75, .25, .25, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, .5, .5, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [.25, .75, .75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [.5, 1, 1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [.75, .75, .75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [1, .5, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [.75, .25, .25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                            [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
                        ]
                    }
                }
            }
        }), define("game/views/bonusWheelSVC", ["require", "com/pixijs/pixi", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/views/core/gameSVC", "game/data/stateEvents", "game/data/gameEvents", "game/commonUI/slot/betData", "game/core/PlatformManager", "game/utils/miscUtils", "game/components/bonusWheel/bonusWheel3d", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "game/utils/textUtils", "game/components/plaque/genericPlaque", "game/data/setupData", "game/components/chaseLight/chaseLightsController", "game/components/chaseLight/chaseLightBWArrowSpec", "com/gsap/TweenMax", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                r = e("game/views/core/gameSVC"),
                n = e("game/data/stateEvents"),
                o = e("game/data/gameEvents"),
                s = e("game/commonUI/slot/betData"),
                a = e("game/core/PlatformManager"),
                l = e("game/utils/miscUtils"),
                u = e("game/components/bonusWheel/bonusWheel3d"),
                c = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                h = e("game/utils/textUtils"),
                d = e("game/components/plaque/genericPlaque"),
                p = e("game/data/setupData"),
                f = e("game/components/chaseLight/chaseLightsController"),
                _ = e("game/components/chaseLight/chaseLightBWArrowSpec"),
                m = e("com/gsap/TweenMax"),
                g = e("game/components/createJsAudioPlayer/SoundManager"),
                v = function() {
                    function e(e) {
                        "mouse" === e.data.pointerType && 0 !== e.data.button || (i.lib._GameScene.pixiContainer.removeAllListeners(), i.lib._GameScene.pixiContainer.on("pointerout", y, E), i.lib._GameScene.pixiContainer.on("pointerup", y, E), i.lib._GameScene.pixiContainer.on("touchend", y, E), i.lib._GameScene.pixiContainer.on("pointermove", v, E), N = {
                            x: e.data.global.x,
                            y: e.data.global.y
                        })
                    }

                    function v(e) {
                        var t = {
                            x: e.data.global.x,
                            y: e.data.global.y
                        };
                        if (t.x > 2 && t.x < M.width - 2 && t.y > 2 && t.y < M.height - 2) {
                            var i = {
                                x: t.x - N.x,
                                y: t.y - N.y
                            };
                            A.addAng(-i.y / M.width * 180), N = {
                                x: e.data.global.x,
                                y: e.data.global.y
                            }
                        } else y()
                    }

                    function y() {
                        i.lib._GameScene.pixiContainer.removeAllListeners(), i.lib._GameScene.pixiContainer.buttonMode = !1, i.lib._GameScene.pixiContainer.interactive = !1, T()
                    }

                    function b() {
                        i.lib._bwTriggerAnimContainer.pixiContainer.removeChild(C), n.publish(n.FROM_EXIT_STAGE)
                    }

                    function x() {
                        A.visible = O.visible = !0, R.alpha = 0, R.visible = !0, m.to(R, .5, {
                            alpha: 1
                        }), I.visible = !0, I.scaleX = I.scaleY = .3, m.to(I, .3, {
                            scaleX: 1,
                            scaleY: 1,
                            ease: window.Back.easeOut.config(2.5)
                        }), F.startAnimation("spinPlaqueAnim", 0)
                    }

                    function T() {
                        I.visible = !0, I.scaleX = I.scaleY = 1, m.to(I, .3, {
                            scaleX: .3,
                            scaleY: .3,
                            ease: window.Back.easeIn.config(2.5),
                            onComplete: function() {
                                I.visible = !1, F.endCurrentAnimation(!0)
                            }
                        }), g().execute("onPreBonusButtonSpin"), A.startSpin(), S.playDataPayload = {
                            ActionInput: {
                                Action: "play"
                            },
                            PatternSliderInput: {
                                BetPerPattern: s.betPerPattern,
                                PatternsBet: s.patternsBet
                            }
                        }, n.publish(n.FROM_BEFORE_REQUEST)
                    }
                    r.call(this);
                    var E = this,
                        S = null,
                        P = null,
                        A = null,
                        C = null,
                        M = null,
                        R = null,
                        O = null,
                        w = null,
                        I = null,
                        D = null,
                        L = null,
                        B = null,
                        F = null;
                    this.systemInit = function(e, n) {
                        r.prototype.systemInit(e), L = e.PaytableResponse, w = n, S = a(), D = new d, D.systemInit(), R = i.lib._bwBackGroundFade.pixiContainer, R.visible = !1, O = i.lib._bwWheelFrame.pixiContainer, O.visible = !1, I = i.lib._bwSpinPlaque.pixiContainer, I.visible = !1, i.lib._bwArrowInner.pixiContainer.visible = !1, i.lib._bwArrowOutter.pixiContainer.visible = !1;
                        var o = h.addBasicText(i.lib._bwSpinPlaqueTxtContainer.pixiContainer, c.i18n.BonusWheel.Spin, [0, 0], 68, 16777215, "OswaldLocCurrency-Medium", "center", 5, 0);
                        o.anchor = new t.Point(.5, .5), h.textFitWidth(o, 150, !1), M = i.getPixiRenderer(), F = new f, F.init(_, i.lib._bwSpinPlaqueArrowLights.pixiContainer), A = new u, A.initTexture()
                    }, this.stageInit = function(e, t, i) {
                        r.prototype.stageInit(e), A.init(), A.setStrip(L), A.reset(), B = 2, "portrait" === i && (B = 3), t || (x(), g().execute("onPreBonusRefresh")), this.subscribeToMsgBus()
                    }, this.subscribeToMsgBus = function() {
                        r.prototype.subscribeToMsgBus.bind(this)()
                    }, this.unsubscribeToMsgBus = function() {
                        r.prototype.unsubscribeToMsgBus.bind(this)()
                    }, this.onBeforeRequest = function() {
                        i.lib._GameScene.pixiContainer.buttonMode = !0, i.lib._GameScene.pixiContainer.interactive = !0, i.lib._GameScene.pixiContainer.on("pointerdown", e, this)
                    };
                    var N = {
                        x: 0,
                        y: 0
                    };
                    this.stopInfo = null, this.onResolveStage = function(e) {
                        if (E.isMaxAwardReached(e), P = e, E.stopInfo = null, P.response.PopulationOutcome) {
                            var t = P.response.PopulationOutcome;
                            Array.isArray(t) || (t = [t]);
                            for (var i = 0; i < t.length; i++)
                                if ("BonusWheel.BonusSelect" === t[i]["@name"]) {
                                    E.stopInfo = {
                                        stopIndex: parseInt(t[i].Entry["@stripIndex"]),
                                        text: t[i].Entry.Cell["#text"]
                                    };
                                    break
                                }
                        }
                        if (P.response.PrizeOutcome) {
                            var r = P.response.PrizeOutcome;
                            Array.isArray(r) || (r = [r]);
                            for (var i = 0; i < r.length; i++)
                                if ("BonusWheel.Prize" === r[i]["@name"]) {
                                    E.stopInfo.totalPay = r[i]["@totalPay"];
                                    break
                                }
                        }
                        A.setStopText(E.stopInfo.text), A.stopSpin(E.stopInfo.stopIndex, function() {
                            E.playOutro()
                        }, function() {
                            E.playWedge()
                        })
                    }, this.onAbortNextStage = function(e) {
                        r.prototype.onAbortNextStage(e), A && (A.forceStop(), w.endCurrentAnimation(!0), F.endCurrentAnimation(!0), A.clear()), E.stageInit(e)
                    }, this.onResetNextStage = function(e) {
                        r.prototype.onResetNextStage(e)
                    }, this.onExitStage = function(e) {
                        e.response.OutcomeDetail.Stage === p.BONUS_WHEEL && (E.unsubscribeToMsgBus(), o.publish(o.ON_STAGE_CHANGE, P))
                    }, this.onTransitionDone = function() {
                        setTimeout(function() {
                            E.playIntro(), r.prototype.onTransitionDone()
                        }, 1e3)
                    }, this.hide = function() {
                        A && (A.forceStop(), A.visible = O.visible = R.visible = !1, I.visible = !1, w.endCurrentAnimation(!0), F.endCurrentAnimation(!0), A.clear())
                    }, this.playIntro = function() {
                        var e = i.lib._bwViewContainer.pixiContainer;
                        e.alpha = 1, e.visible = !0, C = l.createMovieClip("BonusWheel_TriggerAnim_", 20, 50, 3, .5), C.scaleX = C.scaleY = B, C.loop = !1, C.onComplete = b, i.lib._bwTriggerAnimContainer.pixiContainer.addChild(C), C.play(), setTimeout(function() {
                            x()
                        }, 900)
                    }, this.playOutro = function() {
                        var e = i.lib._bwViewContainer.pixiContainer;
                        e.alpha = 1, m.to(e, .5, {
                            alpha: 0,
                            onComplete: function() {
                                e.visible = !1, e.alpha = 1
                            }
                        }), w.turnOff(500), E.isMaxAward || P.response.OutcomeDetail.NextStage !== p.BASE_GAME ? n.publish(n.FROM_RESOLVE_STAGE) : D.showPlaque("bwAward", !0, function() {
                            setTimeout(function() {
                                D.hidePlaque(!0, function() {
                                    n.publish(n.FROM_RESOLVE_STAGE)
                                })
                            }, 3e3)
                        }, E.stopInfo)
                    }, this.playWedge = function() {
                        P.response.OutcomeDetail.NextStage, p.FREE_SPINS
                    }, this.orientationChanged = function(e) {
                        null !== D && D.orientationChanged(e)
                    }
                };
            return v.prototype = Object.create(r.prototype), v.prototype.constructor = v, v
        }), define("game/components/plinko/plinkoChip", ["require", "game/components/createJsAudioPlayer/SoundManager", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "com/pixijs/pixi", "com/gsap/TweenMax", "game/utils/miscUtils"], function(e) {
            "use strict";
            var t = e("game/components/createJsAudioPlayer/SoundManager"),
                i = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                r = e("com/pixijs/pixi"),
                n = (e("com/gsap/TweenMax"), e("game/utils/miscUtils"), function() {
                    function e() {
                        f = [];
                        for (var e = _.wSpace, t = _.hSpace, n = 0; n < 11; n++)
                            for (var o = 0; o < (n + 1) % 2 + 9; o++) {
                                var s = n % 2 * e / 2,
                                    a = o * e + s,
                                    l = n * t;
                                if (f.push({
                                        x: a,
                                        y: l
                                    }), v) {
                                    var u = new r.Graphics;
                                    u.lineStyle(1, 16711680, 1), u.drawCircle(0, 0, 3), u.x = a, u.y = l, i.lib._pkChipContainer.pixiContainer.addChild(u)
                                }
                            }
                    }

                    function n() {
                        if (d.y += p * u.deltaTime, s.y += d.y * u.deltaTime, s.x += d.x * u.deltaTime, s.y < .9 * _.finalY) {
                            for (var e = 0; e < f.length; e++) {
                                var i = f[e],
                                    r = s.x - i.x,
                                    a = s.y - i.y,
                                    l = Math.hypot(r, a);
                                if (l < c.width / 2) {
                                    o();
                                    var h = Math.atan2(a, r);
                                    s.x = Math.cos(h) * (1.1 * l) + i.x, s.y = Math.sin(h) * (1.1 * l) + i.y;
                                    var v = Math.hypot(d.x, d.y);
                                    d.x = Math.cos(h) * v * .7, d.y = Math.sin(h) * v * .7, d.r = d.x / 10;
                                    break
                                }
                            }
                            var b = (s.x - _.xMin) / _.wSpace,
                                x = s.y / _.hSpace,
                                T = m - b,
                                E = (10 - x) / 2,
                                S = _.xMin,
                                P = _.xMax;
                            Math.abs(T) >= Math.abs(E) && (T > 0 ? (S = b * _.wSpace + _.xMin, P = _.xMax, d.x = 1) : (S = _.xMin, P = b * _.wSpace + _.xMin, d.x = -1)), s.x <= S ? (s.x = S, d.x = 1) : s.x >= P && (s.x = P, d.x = -1), 0 !== d.x && Math.abs(d.x) < .3 && (d.x = Math.abs(d.x) / d.x * .3), d.r = d.x / 10, c.rotation += d.r
                        } else d.x = 0, s.y > _.finalY && (d.x = 0, d.y = 0, s.x = m * (_.wSpace + 2.22) + (_.xMin - 10), s.y = _.finalY, c.rotation = 0, y = !1, 4 === m ? t().execute("onBonus1ChipLand1000") : t().execute("onBonus1ChipLand"), u.remove(n), g && g())
                    }

                    function o() {
                        var e = Date.now();
                        e - x >= 200 && (t().execute("onBonus1ChipBounce"), x = e)
                    }
                    r.Container.call(this);
                    var s, a = null,
                        l = null,
                        u = null,
                        c = null,
                        h = null,
                        d = {
                            x: 0,
                            y: 0,
                            r: 0
                        },
                        p = .9,
                        f = [],
                        _ = {
                            wSpace: 46,
                            hSpace: 37.2,
                            xMin: 23,
                            xMax: 391,
                            finalY: 415
                        },
                        m = null,
                        g = null,
                        v = !1,
                        y = !1,
                        b = !1;
                    this.init = function(t, n) {
                        s = this, a = t, l = n, u = i.getTicker();
                        var o = i.lib._pkChipContainer.pixiContainer;
                        _.wSpace = o.width / 9, _.hSpace = o.height / 10, _.xMin = _.wSpace / 2, _.xMax = 9 * _.wSpace - _.xMin, _.finalY = o.height + .98 * _.wSpace;
                        var d = r.Texture.fromFrame("PlinkoChipSmall_" + l.toLowerCase());
                        c = new r.Sprite(d), c.anchor.set(.5, .5), c.width = c.height = Math.round(.78 * _.wSpace), h = new r.Graphics, h.beginFill(0, .5), h.drawCircle(0, 0, c.width / 2), h.x = 0, h.y = 4, s.addChild(h), s.addChild(c), e()
                    }, this.startDrop = function(e, t, i) {
                        m = t, s.y = -23, s.x = e * _.wSpace + _.xMin, g = i, d = {
                            x: .1,
                            y: 0,
                            r: 0
                        }, y = !0, b || u.add(n)
                    };
                    var x = 0;
                    this.pause = function() {
                        !b && y && (b = !0, u.remove(n))
                    }, this.resume = function() {
                        b && y && u.add(n)
                    }, Object.defineProperty(this, "name", {
                        get: function() {
                            return a
                        }
                    }), Object.defineProperty(this, "multiplierValue", {
                        get: function() {
                            return l
                        }
                    })
                });
            return n.prototype = Object.create(r.Container.prototype), n.prototype.constructor = n, n
        }), define("game/components/plinko/plinkoRevealAnim", ["require", "game/components/createJsAudioPlayer/SoundManager", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "com/pixijs/pixi", "game/utils/miscUtils", "com/gsap/TweenMax", "com/gsap/TimelineMax"], function(e) {
            "use strict";
            var t = e("game/components/createJsAudioPlayer/SoundManager"),
                i = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                r = e("com/pixijs/pixi"),
                n = e("game/utils/miscUtils"),
                o = (e("com/gsap/TweenMax"), e("com/gsap/TimelineMax")),
                s = function() {
                    function e() {
                        (x += i.getTicker().elapsedMS) >= 1e3 / 30 && (x = 0, T <= 16 ? (m.visible = !0, m.gotoAndStop(T + 1)) : m.visible && (m.stop(), m.visible = !1), T >= 41 ? (t().execute("onBonus1ChipReveal" + P.toLowerCase()), f.scaleX = f.scaleY = 1.2, f.visible = !0) : f.visible && (f.visible = !1), T >= 3 && T <= 44 ? (p.visible = !0, p.gotoAndStop(T - 3)) : p.visible && (p.visible = !1, p.stop()), T >= 42 && T <= 54 ? (d.visible = !0, c.gotoAndStop(T - 42), h.gotoAndStop(T - 42)) : d.visible && (d.visible = !1, c.stop(), h.stop()), T >= 56 && (i.getTicker().remove(e), s()), T++)
                    }

                    function s() {
                        var e = {
                                x: u.x,
                                y: u.y,
                                scaleX: u.scaleX,
                                scaleY: u.scaleY
                            },
                            t = E.toGlobal(new r.Point(u.width / 4, u.height / 4));
                        t = u.toLocal(t);
                        var n = new o({
                                paused: !0,
                                onUpdate: function() {
                                    u.x = e.x, u.y = e.y, u.scaleX = e.scaleX, u.scaleY = e.scaleY
                                },
                                onComplete: function() {
                                    g && (u.show(), g())
                                }
                            }),
                            s = -100;
                        S && "portrait" === S.orientation && (s = -300);
                        var a = .5,
                            l = i.lib._pkInfoLayer;
                        l && (a = .5 * l.scaleX), n.to(e, .5, {
                            x: t.x,
                            scaleX: a,
                            scaleY: a
                        }, 0).to(e, .25, {
                            ease: window.Power1.easeOut,
                            y: u.y + s
                        }, 0).to(e, .25, {
                            ease: window.Power1.easeIn,
                            y: t.y
                        }, .25), n.play()
                    }

                    function a() {
                        v && v(u)
                    }

                    function l() {
                        u.stopIdle(), A && A()
                    }
                    r.Container.call(this);
                    var u, c = null,
                        h = null,
                        d = null,
                        p = null,
                        f = null,
                        _ = null,
                        m = null,
                        g = null,
                        v = null,
                        y = null,
                        b = !0,
                        x = 0,
                        T = 0,
                        E = null,
                        S = null,
                        P = null;
                    this.init = function(e, t, i, o, s) {
                        P = i, u = this, y = e, E = o, v = s, m = n.createMovieClip("Plinko_StreakParticlesUp_", 1, 17, 3, .5), m.scaleX = m.scaleY = 2, m.x = -266, m.y = -144, m.loop = !1, u.addChild(m), f = n.spriteFromTexture("PlinkoChip_" + P.toLowerCase()), f.anchor = new r.Point(.5, .5), f.visible = !1, u.addChild(f), _ = n.createMovieClip("Plinko_idleAnim_", 2, 10, 3, .5), _.anchor = new r.Point(.5, .5), _.visible = !1, _.loop = !1, _.onComplete = l, this.addChild(_);
                        var a = ["Plinko_ChipSpinReveal_1x2x_", "Plinko_ChipSpinReveal_2x3x_", "Plinko_ChipSpinReveal_3x5x_"],
                            g = a[t];
                        p = n.createMovieClip(g, 6, 47, 3, .5), p.scaleX = p.scaleY = 2, p.x = -157, p.y = -244, p.visible = !1, p.loop = !1, u.addChild(p), d = new r.Container, d.x = -473, d.y = -177, d.visible = !1, u.addChild(d), c = n.createMovieClip("multiplierParticlesExplode_", 0, 14, 3, .5), c.scaleX = c.scaleY = 2, c.loop = !1, d.addChild(c), h = n.createMovieClip("multiplierParticlesExplode_", 0, 14, 3, .5), h.x = 948, h.scaleX = -2, h.scaleY = 2, h.loop = !1, d.addChild(h)
                    }, this.play = function(t, r) {
                        g = t, S = r, x = 0, T = 0, i.getTicker().add(e)
                    }, this.show = function() {
                        m.visible = d.visible = p.visible = !1, f.visible = !0, f.scaleX = f.scaleY = 1, u.scaleX = u.scaleY = .5, u.x = u.width / 2, u.y = u.height / 2, E.addChild(u), u.interactive = b, u.buttonMode = b, u.on("click", a, u), u.on("touchend", a, u)
                    }, Object.defineProperty(this, "name", {
                        get: function() {
                            return y
                        }
                    }), this.setEnabled = function(e, t) {
                        if (e !== b && (b = e, b ? (u.interactive = !0, u.buttonMode = !0) : (u.interactive = !1, u.buttonMode = !1)), t !== (null !== u.filters))
                            if (t) {
                                var i = new r.filters.ColorMatrixFilter;
                                i.greyscale(.3, !1), u.filters = [i]
                            } else this.filters = null
                    }, this.getEnabled = function() {
                        return b
                    };
                    var A = null;
                    this.playIdle = function(e) {
                        A = e, _.visible = !0, _.gotoAndPlay(0)
                    }, this.stopIdle = function() {
                        _ && (_.stop(), _.visible = !1)
                    }
                };
            return s.prototype = Object.create(r.Container.prototype), s.prototype.constructor = s, s
        }), define("game/components/plinko/arrowsController", ["require", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "com/pixijs/pixi", "com/gsap/TweenMax", "game/utils/miscUtils", "com/gsap/TimelineMax"], function(e) {
            var t = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                i = (e("com/pixijs/pixi"), e("com/gsap/TweenMax"), e("game/utils/miscUtils"), e("com/gsap/TimelineMax")),
                r = function() {
                    function e() {
                        this.scaleX = this.scaleY = 1.3, this.y = u + 10, l.pause(0)
                    }

                    function r() {
                        this.scaleX = this.scaleY = 1, this.y = u, l.restart(!0)
                    }

                    function n() {
                        null !== c && c(parseInt(this.name.substr(8, 1)))
                    }
                    var o = !0,
                        s = null,
                        a = [],
                        l = null,
                        u = null,
                        c = null;
                    this.init = function(h) {
                        c = h, s = t.lib._pkArrowsContainer.pixiContainer, s.visible = o, l = new i({
                            paused: !0,
                            repeat: -1,
                            delay: 2,
                            repeatDelay: 5,
                            onUpdate: function() {},
                            onComplete: function() {}
                        });
                        for (var d = 0; d < 9; d++) {
                            var p = t.lib["_pkArrow" + d].pixiContainer;
                            null === u && (u = p.y), a.push(p), p.buttonMode = !0, p.interactive = !0, p.on("pointerover", e, p), p.on("pointerout", r, p), p.on("click", n, p), p.on("touchend", n, p), l.to(p, .2, {
                                y: u + 20
                            }, .2 * d).to(p, .2, {
                                y: u
                            }, .2 * d + .2)
                        }
                        l.play()
                    }, this.showOnly = function(e) {
                        l.pause(0);
                        for (var t = 0; t < a.length; t++) a[t].visible = t === e, a[t].buttonMode = !1, a[t].interactive = !1
                    }, this.showAll = function() {
                        for (var e = 0; e < a.length; e++) a[e].visible = !0, a[e].buttonMode = !0, a[e].interactive = !0;
                        l.restart()
                    }, Object.defineProperty(this, "visible", {
                        set: function(e) {
                            e !== o && (o = e, null !== s && (s.visible = o))
                        },
                        get: function() {
                            return o
                        }
                    })
                };
            return r.prototype.constructor = r, r
        }), define("game/components/plinko/digitAnimation", ["require", "com/pixijs/pixi", "game/utils/miscUtils"], function(e) {
            "use strict";
            var t = e("com/pixijs/pixi"),
                i = e("game/utils/miscUtils"),
                r = function() {
                    t.Container.call(this);
                    var e = {
                            digits_100Glow_: -12,
                            digits_200Glow_: -40,
                            digits_500Glow_: -50,
                            digits_50Glow_: -57,
                            digits_1000Glow_: -45
                        },
                        r = null,
                        n = null;
                    this.init = function(t) {
                        r = i.createMovieClip(t, 0, 11, 3, .5), r.loop = !0, this.addChild(r), n = i.createMovieClip("Plinko_flowerParticles_", 1, 13, 3, .5), n.loop = !1, n.x = -r.width / 2;
                        var o = -16;
                        "desktop" === window.location.search.match(/&?assetPack=([^&]+)&?/)[1] && (o = e[t]), n.y = o, this.addChild(n)
                    }, this.play = function() {
                        n.play(), r.play()
                    }, this.stop = function() {
                        n.stop(), r.stop()
                    }
                };
            return r.prototype = Object.create(t.Container.prototype), r.prototype.constructor = r, r
        }), define("game/views/plinkoSVC", ["require", "game/components/createJsAudioPlayer/SoundManager", "game/views/core/gameSVC", "game/utils/textUtils", "skbJet/component/currencyHelper/currencyHelper", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "com/pixijs/pixi", "com/gsap/TweenMax", "game/commonUI/slot/betData", "game/data/gameEvents", "game/data/stateEvents", "game/data/setupData", "game/utils/miscUtils", "game/core/PlatformManager", "game/components/plinko/plinkoChip", "game/components/plinko/plinkoRevealAnim", "game/components/plinko/arrowsController", "game/components/winSequence/rollUpController", "game/components/plaque/genericPlaque", "game/components/plinko/digitAnimation"], function(e) {
            "use strict";
            var t = e("game/components/createJsAudioPlayer/SoundManager"),
                i = e("game/views/core/gameSVC"),
                r = e("game/utils/textUtils"),
                n = e("skbJet/component/currencyHelper/currencyHelper"),
                o = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                s = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                a = e("com/pixijs/pixi"),
                l = e("com/gsap/TweenMax"),
                u = e("game/commonUI/slot/betData"),
                c = e("game/data/gameEvents"),
                h = e("game/data/stateEvents"),
                d = e("game/data/setupData"),
                p = e("game/utils/miscUtils"),
                f = e("game/core/PlatformManager"),
                _ = e("game/components/plinko/plinkoChip"),
                m = e("game/components/plinko/plinkoRevealAnim"),
                g = e("game/components/plinko/arrowsController"),
                v = e("game/components/winSequence/rollUpController"),
                y = e("game/components/plaque/genericPlaque"),
                b = e("game/components/plinko/digitAnimation"),
                x = function() {
                    function e() {
                        if (ue = s.lib._blackTintContainer.pixiContainer, 0 === ue.children.length) {
                            var e = new a.Graphics;
                            e.beginFill(0), e.drawRect(0, 0, 10, 10), ue = new a.Container, ue.addChild(e)
                        }
                        var t = s.getPixiRenderer();
                        ue.width = t.view.width, ue.height = t.view.height, ue.alpha = 0, ue.visible = !1
                    }

                    function x() {
                        le && !W.isMaxAward ? (le = !1, J.interactive = !1, J.buttonMode = !1, se.skip()) : W.isMaxAward && F()
                    }

                    function T() {
                        s.lib._pkWinMetterLabel.setText(o.i18n.UI.bonusWin), s.lib._pkWinMetterValue.setText("")
                    }

                    function E() {
                        for (var e in he) s.lib._pkAnimLayer.pixiContainer.addChild(he[e].anim), he[e].anim.show();
                        M()
                    }

                    function S() {
                        q.onClick = P
                    }

                    function P() {
                        q.onClick = null, q.hidePlaque(!0, function() {
                            _e = !0, A()
                        }), t().execute("onBonus1ButtonReveal"), X = null, Y = null, Z.playDataPayload = {
                            ActionInput: {
                                Action: "play"
                            },
                            PatternSliderInput: {
                                BetPerPattern: u.betPerPattern,
                                PatternsBet: u.patternsBet
                            }
                        }, h.publish(h.FROM_BEFORE_REQUEST)
                    }

                    function A() {
                        X && _e && (w(), C(0), h.publish(h.FROM_RESOLVE_STAGE))
                    }

                    function C(e) {
                        var i = de[e],
                            r = he[i].anim;
                        s.lib._pkAnimLayer.pixiContainer.addChild(r), t().execute("onBonus1ChipReveal"), r.play(function() {
                            setTimeout(function() {
                                if (e < de.length - 1) {
                                    C(e + 1)
                                } else {
                                    for (var t in he) he[t].anim.setEnabled(!0, !1);
                                    M()
                                }
                            }, 500)
                        }, ae)
                    }

                    function M() {
                        1 === Object.keys(he).length ? t().execute("onBonus1VoLastOne") : t().execute("onBonus1PlaquePrompt"), re.setText(o.i18n.Plinko.SelectChip), r.autoFit(re), te.visible = !0, te.scaleX = te.scaleY = .5 * ie, l.to(te, .5, {
                            scaleX: ie,
                            scaleY: ie,
                            ease: window.Back.easeOut.config(1.7)
                        }), G()
                    }

                    function R() {
                        te.visible = !0, te.scaleX = te.scaleY = ie, l.to(te, .5, {
                            scaleX: .5 * ie,
                            scaleY: .5 * ie,
                            ease: window.Back.easeIn.config(1.7),
                            onComplete: function() {
                                te.visible = !1
                            }
                        })
                    }

                    function O(e) {
                        var t = new a.filters.ColorMatrixFilter;
                        e ? (t.matrix[0] = .4, t.matrix[6] = .4, t.matrix[12] = .4) : (t.matrix[0] = 1, t.matrix[6] = 1, t.matrix[12] = 1), l.to(s.lib._pkBottomLayer.pixiContainer, .5, {
                            pixi: {
                                colorMatrixFilter: t
                            }
                        })
                    }

                    function w() {
                        var e = [],
                            t = [],
                            i = X.response.TriggerOutcome;
                        Array.isArray(i) || (i = [i]);
                        for (var r = 0; r < i.length; r++) {
                            if ("PlinkoPickReveal.Multipliers" === i[r]["@name"]) {
                                var n = i[r].Trigger;
                                Array.isArray(n) || (n = [n]);
                                for (var o = 0; o < n.length; o++) e.push(n[o]["@name"])
                            }
                            if ("PlinkoPositionPicker.PrevPuckChoice" === i[r]["@name"]) {
                                var n = i[r].Trigger;
                                if (null !== n && void 0 !== n) {
                                    Array.isArray(n) || (n = [n]);
                                    for (var o = 0; o < n.length; o++) t.push(n[o]["@name"])
                                }
                            }
                        }
                        for (var a = 0; a < 3; a++) {
                            var l = s.lib["_pkChipPositionRef_" + a.toString()].pixiContainer;
                            l.removeChildren()
                        }
                        for (var a = 0; a < e.length; a++)
                            if (t.indexOf(e[a].split("_")[0]) < 0) {
                                var u = e[a].split("_"),
                                    c = u[0],
                                    h = u[1],
                                    d = new m,
                                    p = parseInt(c.substr(4, 1)) - 1,
                                    l = s.lib["_pkChipPositionRef_" + p.toString()].pixiContainer;
                                d.init(c, a, h, l, I), d.setEnabled(!1, !1), he[c] = {
                                    name: c,
                                    multiplierValue: h,
                                    anim: d
                                }
                            }
                    }

                    function I(e) {
                        H(), t().execute("onBonus1ChipSelect"), re.setText(o.i18n.Plinko.SelectPosition), r.autoFit(re), e.parent.removeChild(e), oe = {
                            chip: he[e.name],
                            startIndex: null,
                            endIndex: null
                        }, delete he[e.name];
                        for (var i in he) he[i].anim.setEnabled(!1, !0);
                        ee.visible = !0, l.to(ee, .3, {
                            alpha: 0,
                            onComplete: function() {
                                ee.visible = !1
                            }
                        }), O(!1), ne.showAll(), ne.visible = !0
                    }

                    function D(e) {
                        X = null, Y = null, oe.startIndex = e, ne.showOnly(e), R(), Z.playDataPayload = {
                            ActionInput: {
                                Action: oe.chip.name
                            },
                            PatternSliderInput: {
                                BetPerPattern: u.betPerPattern,
                                PatternsBet: u.patternsBet
                            },
                            PickerInput: {
                                Pick: {
                                    "@name": "L0C0R" + oe.startIndex.toString()
                                }
                            }
                        }, h.publish(h.FROM_BEFORE_REQUEST)
                    }

                    function L() {
                        if (null !== Y) {
                            var e = s.lib[pe[oe.endIndex].name].pixiContainer,
                                t = e.children[0].scaleX;
                            e.removeChildren();
                            var i = new b;
                            i.scaleX = i.scaleY = t, i.init(pe[oe.endIndex].txtOn), e.addChild(i), i.play(), W.isMaxAward ? setTimeout(function() {
                                B()
                            }, 1e3) : (se.customRollupName = "onBonus1Rollup", se.rollUp(Y.landTotalPay), le = !0), J.interactive = !0, J.buttonMode = !0
                        }
                    }

                    function B() {
                        le = !1, s.lib._pkWinMetterValue.setText(W.awardCap), H();
                        var e = s.lib[pe[oe.endIndex].name].pixiContainer,
                            i = e.children[0].scaleX;
                        e.removeChildren();
                        var r = p.spriteFromTexture(pe[oe.endIndex].txtOff);
                        r.scaleX = r.scaleY = i, e.addChild(r), $.removeChild(Y.chip), ne.visible = !1;
                        for (var n in he) he[n].anim.parent.removeChild(he[n].anim);
                        he = {}, t().execute("onAwardCap"), s.lib._maLabel2.setText(W.awardCap), q.showPlaque("maxAwardBonus", !0, F, null, 0, !0), t().execute("onBonus1End")
                    }

                    function F() {
                        J.interactive = !1, J.buttonMode = !1, W.isMaxAward = !1, q.hidePlaque(!0, function() {}), h.publish(h.FROM_RESOLVE_STAGE)
                    }

                    function N() {}

                    function V() {
                        le = !1, J.interactive = !1, J.buttonMode = !1;
                        var e = s.lib[pe[oe.endIndex].name].pixiContainer,
                            t = e.children[0].scaleX;
                        e.removeChildren();
                        var i = p.spriteFromTexture(pe[oe.endIndex].txtOff);
                        i.scaleX = i.scaleY = t, e.addChild(i), $.removeChild(Y.chip), ne.visible = !1;
                        var r = Y.bonusTotalPay + Y.scatterPay;
                        r > 0 ? s.lib._pkWinMetterValue.setText(n.formatBalance(n.fromStakeUnits(r))) : s.lib._pkWinMetterValue.setText(""), Q !== d.BASE_GAME ? (ee.visible = !0, l.to(ee, .3, {
                            alpha: 1
                        }), O(!0), M(), h.publish(h.FROM_RESOLVE_STAGE)) : (setTimeout(function() {
                            q.hidePlaque(!0, function() {
                                h.publish(h.FROM_RESOLVE_STAGE)
                            })
                        }, 3e3), O(!0), q.showPlaque("pkWin", !0, null, Y.bonusTotalPay + Y.scatterPay))
                    }

                    function k(e) {
                        var t = null;
                        if (e.response.TriggerOutcome) {
                            var i = e.response.TriggerOutcome;
                            Array.isArray(i) || (i = [i]);
                            for (var r = 0; r < i.length; r++)
                                if ("PlinkoPositionPicker.PuckLanding" === i[r]["@name"]) {
                                    var n = i[r].Trigger;
                                    t = n["@name"];
                                    break
                                }
                        }
                        var o = 0,
                            s = 0,
                            a = 0;
                        if (e.response.PrizeOutcome) {
                            var l = e.response.PrizeOutcome;
                            Array.isArray(l) || (l = [l]);
                            for (var u = 0; u < l.length; u++) "PlinkoPositionPicker.Award" === l[u]["@name"] ? o = parseInt(l[u]["@totalPay"]) : "PlinkoPositionPicker.Total" === l[u]["@name"] ? s = parseInt(l[u]["@totalPay"]) : "BaseGame.Scatter" === l[u]["@name"] && (a = parseInt(l[u]["@totalPay"]))
                        }
                        return isNaN(s) && (s = 0), isNaN(o) && (o = 0), {
                            landCell: t,
                            landTotalPay: o,
                            bonusTotalPay: s,
                            scatterPay: a,
                            chip: null
                        }
                    }

                    function U(e) {
                        Q !== d.BASE_GAME && i.prototype.onExitStage(e), W.unsubscribeToMsgBus(), c.publish(c.ON_STAGE_CHANGE, X)
                    }

                    function G() {
                        H(), me = setTimeout(z, 2e3 * Math.random() + 1e3)
                    }

                    function z() {
                        var e = 0;
                        for (var t in he) j(t, e), e += 280;
                        me = setTimeout(z, e + 2e3 + 3e3 * Math.random())
                    }

                    function j(e, t) {
                        setTimeout(function() {
                            he[e].anim.playIdle(null)
                        }, t)
                    }

                    function H() {
                        null != me && (clearInterval(me), me = null);
                        for (var e in he) he[e].anim.stopIdle()
                    }
                    i.call(this);
                    var W = this,
                        X = null,
                        Y = null,
                        q = null,
                        K = null,
                        Q = null,
                        Z = null,
                        J = null,
                        $ = null,
                        ee = null,
                        te = null,
                        ie = 1,
                        re = null,
                        ne = null,
                        oe = null,
                        se = null,
                        ae = null,
                        le = !1,
                        ue = null,
                        ce = !1,
                        he = {},
                        de = ["puck1", "puck2", "puck3"],
                        pe = [{
                            name: "_pk100L",
                            txtOff: "digits_100",
                            txtOn: "digits_100Glow_"
                        }, {
                            name: "_pk200L",
                            txtOff: "digits_200",
                            txtOn: "digits_200Glow_"
                        }, {
                            name: "_pk500L",
                            txtOff: "digits_500",
                            txtOn: "digits_500Glow_"
                        }, {
                            name: "_pk50L",
                            txtOff: "digits_50",
                            txtOn: "digits_50Glow_"
                        }, {
                            name: "_pk1000",
                            txtOff: "digits_1000",
                            txtOn: "digits_1000Glow_"
                        }, {
                            name: "_pk50R",
                            txtOff: "digits_50",
                            txtOn: "digits_50Glow_"
                        }, {
                            name: "_pk500R",
                            txtOff: "digits_500",
                            txtOn: "digits_500Glow_"
                        }, {
                            name: "_pk200R",
                            txtOff: "digits_200",
                            txtOn: "digits_200Glow_"
                        }, {
                            name: "_pk100R",
                            txtOff: "digits_100",
                            txtOn: "digits_100Glow_"
                        }],
                        fe = {
                            rollUpStepCount: 20,
                            midWinThreshold: 2,
                            bigWinMin: 1e9,
                            bigWinThreshold: 15,
                            bigWinTiers: [{
                                threshold: 15,
                                text: o.i18n.BigWin.bigWin,
                                speed: 1,
                                scale: 2,
                                time: [3e3]
                            }, {
                                threshold: 30,
                                text: o.i18n.BigWin.hugeWin,
                                speed: 1,
                                scale: 2.25,
                                time: [2400, 3600]
                            }, {
                                threshold: 60,
                                text: o.i18n.BigWin.epicWin,
                                speed: 1,
                                scale: 2.5,
                                time: [3e3, 3600, 5400]
                            }, {
                                threshold: 120,
                                text: o.i18n.BigWin.massiveWin,
                                speed: 1,
                                scale: 2.75,
                                time: [2e3, 4e3, 6e3, 8e3]
                            }, {
                                threshold: 300,
                                text: o.i18n.BigWin.colossalWin,
                                speed: 1,
                                scale: 3,
                                time: [2400, 3600, 5400, 7800, 10800]
                            }],
                            rollupTiers: [{
                                threshold: 2,
                                time: [1e3]
                            }, {
                                threshold: 4,
                                time: [2e3]
                            }, {
                                threshold: 6,
                                time: [3e3]
                            }]
                        };
                    this.systemInit = function(t) {
                        i.prototype.systemInit(t), e(), T(), q = new y, q.systemInit(), J = s.lib._pkViewContainer.pixiContainer, J.visible = !1, $ = s.lib._pkChipContainer.pixiContainer, ee = s.lib._pkChipPlaque.pixiContainer, te = s.lib._pkInfoPlaque.pixiContainer, ie = te.scaleX, te.visible = !1, re = s.lib._pkInfoPlaqueText, re.setText(""), Z = f(), se = new v, se.init(s.lib._pkRollupContainer.pixiContainer, V, N, fe), se.customRollupName = "onBonus1Rollup", ne = new g, ne.init(D), ne.visible = !1, J.interactive = !1, J.buttonMode = !1, J.on("click", x, this), J.on("touchend", x, this)
                    }, this.stageInit = function(e, r) {
                        i.prototype.stageInit(e);
                        var o = r || !1;
                        ce = !o, le = !1, J.interactive = !1, J.buttonMode = !1, he = {}, X = e, Y = null, K = e.response.OutcomeDetail.Stage, Q = e.response.OutcomeDetail.NextStage, Y = k(X);
                        var a = Y.bonusTotalPay + Y.scatterPay;
                        a > 0 ? s.lib._pkWinMetterValue.setText(n.formatBalance(n.fromStakeUnits(a))) : s.lib._pkWinMetterValue.setText(""), ne.visible = !1, ee.visible = !0, ee.alpha = 1, o || (t().execute("onBonus1Refresh"), J.visible = !0, J.alpha = 1, Q === d.PLINKO_PICK_REVEAL ? this.playIntro() : (w(), E()), Z.enableGameInfo(!1)), null !== e.orientation && void 0 !== e.orientation && W.orientationChanged(e), this.subscribeToMsgBus()
                    };
                    var _e = !1;
                    this.playIntro = function() {
                        O(!0), _e = !1, q.showPlaque("pkReveal", !0, function() {})
                    }, this.subscribeToMsgBus = function() {
                        i.prototype.subscribeToMsgBus.bind(this)()
                    }, this.unsubscribeToMsgBus = function() {
                        if (Q !== d.PLINKO_POSITION_PICKER && Q !== d.PLINKO_PICK_REVEAL) {
                            i.prototype.unsubscribeToMsgBus.bind(this)()
                        }
                    }, this.onBeforeRequest = function() {
                        if (K === d.PLINKO_POSITION_PICKER || K === d.PLINKO_PICK_REVEAL && ce)
                            for (var e in he) he[e].anim.setEnabled(!0, !1);
                        K === d.BONUS_WHEEL && S(), ce && (ce = !1)
                    }, this.onResolveStage = function(e) {
                        if (X = e, Y = k(X), K = e.response.OutcomeDetail.Stage, Q = e.response.OutcomeDetail.NextStage, K === d.PLINKO_PICK_REVEAL && Q === d.PLINKO_POSITION_PICKER) A();
                        else {
                            W.isMaxAwardReached(e), oe.endIndex = parseInt(Y.landCell.substr(3, 1));
                            var i = new _;
                            i.init(oe.chip.name, oe.chip.multiplierValue), Y.chip = i, t().execute("onBonus1ChipDrop"), $.addChild(i), i.startDrop(oe.startIndex, oe.endIndex, function() {
                                L()
                            })
                        }
                    }, this.onAbortNextStage = function(e) {
                        i.prototype.onAbortNextStage(e), le = !1, J.interactive = !1, J.buttonMode = !1, ne.visible = !1, ee.visible = !0, ee.alpha = 1, J.visible = !0, J.alpha = 1, X = e, Y = k(X), K = e.response.OutcomeDetail.Stage, Q = e.response.OutcomeDetail.NextStage, ce = !0, he = {}, Q === d.PLINKO_PICK_REVEAL ? W.playIntro() : (O(!0), w(), E())
                    }, this.onResetNextStage = function(e) {
                        i.prototype.onResetNextStage(e)
                    }, this.onExitStage = function(e) {
                        var t = e.response.OutcomeDetail.Stage;
                        t !== d.PLINKO_POSITION_PICKER && t !== d.PLINKO_PICK_REVEAL || U(e)
                    }, this.onEnterNextStage = function(e) {
                        i.prototype.onEnterNextStage(e)
                    }, this.onTransitionDone = function(e) {
                        i.prototype.onTransitionDone(e), s.lib._rollupContainer.pixiContainer.visible = !0, Q === d.PLINKO_PICK_REVEAL ? W.playIntro() : (w(), E()), h.publish(h.FROM_EXIT_STAGE)
                    }, this.hide = function(e, t) {
                        var i = !0;
                        t && (i = t), i ? (ue.alpha = 0, ue.visible = !0, J.visible = !0, l.to(ue, 1, {
                            alpha: 1,
                            onComplete: function() {
                                J.visible = !1, e && e()
                            }
                        })) : (J.visible = !1, ue.alpha = 1, ue.visible = !0)
                    }, this.show = function(e, t) {
                        ue.alpha = 1, ue.visible = !0, J.visible = !0;
                        var i = !0;
                        t && (i = t), i ? l.to(ue, 1, {
                            alpha: 0,
                            onComplete: function() {
                                ue.visible = !1, e && e()
                            }
                        }) : (ue.alpha = 0, ue.visible = !1)
                    }, this.orientationChanged = function(e) {
                        ae = e, se && se.orientationChanged(e), q && q.orientationChanged(e);
                        var t = s.getPixiRenderer();
                        ue.width = t.view.width, ue.height = t.view.height
                    };
                    var me = null
                };
            return x.prototype = Object.create(i.prototype), x.prototype.constructor = x, x
        }), define("game/transitions/baseGameToPunchABunch", ["require", "game/data/setupData", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            "use strict";
            var t = e("game/data/setupData"),
                i = e("game/components/createJsAudioPlayer/SoundManager"),
                r = function(e, r, n) {
                    function o() {
                        l.hidePlaque(!0), s.openDoors(function() {
                            u()
                        }), a.playIntro(), i().execute("onFeature1Transition1")
                    }
                    var s = r,
                        a = n,
                        l = e,
                        u = null,
                        c = null;
                    this.startTransition = function(e, r, n) {
                        u = r, c = n, a.playChaseLight(function() {
                            s.closeDoors(function() {
                                s.switchStage(t.PUNCH_A_BUNCH), a.stageInit(e, !0, c)
                            });
                            var i = {
                                orientation: c
                            };
                            l.orientationChanged(i), setTimeout(l.showPlaque("pbIntro", !0, o), 500)
                        }), i().execute("onFeature1Start")
                    }
                };
            return r.prototype.constructor = r, r
        }), define("game/transitions/punchABunchToAcceptReject", ["require", "game/data/setupData"], function(e) {
            "use strict";
            var t = (e("game/data/setupData"), function(e, t, i) {
                var r = t,
                    n = i,
                    o = null;
                this.startTransition = function(e, t) {
                    o = t, n.subscribeToMsgBus(), n.playIntro(e, function() {
                        n.stageInit(e, r.getCurrentPickButton(), r.getOptimalStrategy(e)), o()
                    }, !0, r.getCurrentPickButton())
                }
            });
            return t.prototype.constructor = t, t
        }), define("game/transitions/acceptRejectToBaseGame", ["require", "game/data/setupData", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            "use strict";
            var t = e("game/data/setupData"),
                i = e("game/components/createJsAudioPlayer/SoundManager"),
                r = function(e, r, n) {
                    var o = e,
                        s = r,
                        a = n,
                        l = null;
                    this.startTransition = function(e, r) {
                        l = r, a.playOutro(function() {
                            s.revealAllValues(e, function() {
                                s.playOutro(function() {
                                    o.closeDoors(function() {
                                        o.switchStage(t.BASE_GAME), o.stageInit(e), setTimeout(function() {
                                            o.openDoors(function() {
                                                l()
                                            })
                                        }, 300)
                                    }), i().execute("onFeature1Transition2")
                                })
                            })
                        })
                    }
                };
            return r.prototype.constructor = r, r
        }), define("game/transitions/acceptRejectToPunchABunch", ["require"], function(e) {
            "use strict";
            var t = function(e, t) {
                var i = e,
                    r = t,
                    n = null;
                this.startTransition = function(e, t) {
                    n = t, i.subscribeToMsgBus(), r.playOutro(function() {
                        i.setEnable(!0, !0, function() {
                            i.stageInit(e), n()
                        })
                    })
                }
            };
            return t.prototype.constructor = t, t
        }), define("game/transitions/punchABunchToBaseGame", ["require", "game/data/setupData", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            "use strict";
            var t = e("game/data/setupData"),
                i = e("game/components/createJsAudioPlayer/SoundManager"),
                r = function(e, r) {
                    var n = e,
                        o = r,
                        s = null;
                    this.startTransition = function(e, r) {
                        s = r, o.revealAllValues(e, function() {
                            o.playOutro(function() {
                                n.closeDoors(function() {
                                    n.switchStage(t.BASE_GAME), n.stageInit(e), setTimeout(function() {
                                        n.openDoors(function() {
                                            s()
                                        })
                                    }, 300)
                                }), i().execute("onFeature1Transition2")
                            })
                        })
                    }
                };
            return r.prototype.constructor = r, r
        }), define("game/transitions/bonusTransitionAnim", ["require", "com/pixijs/pixi", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "com/gsap/TweenMax", "com/gsap/TimelineMax", "game/utils/miscUtils"], function(e) {
            "use strict";
            var t = (e("com/pixijs/pixi"), e("skbJet/component/gladPixiRenderer/gladPixiRenderer")),
                i = e("com/gsap/TweenMax"),
                r = (e("com/gsap/TimelineMax"), e("game/utils/miscUtils")),
                n = function() {
                    function e() {
                        var e = "TransitionSquare_01_";
                        Math.random() > .5 && (e = "TransitionSquare_02_");
                        var i = r.createMovieClip(e, 0, 3, 3, 1),
                            n = t.getPixiRenderer(),
                            o = n.width + i.width,
                            s = Math.random() * n.height;
                        i.x = o, i.y = s;
                        var a = Math.random() + 1.5;
                        return i.scaleX = i.scaleY = a, {
                            currentFrame: 0,
                            mc: i,
                            x: o,
                            y: s
                        }
                    }
                    var n = null,
                        o = [],
                        s = null,
                        a = null;
                    this.playIntro = function(r) {
                        n = t.lib._transitionAnimLayer.pixiContainer, a = null;
                        var l = t.getPixiRenderer(),
                            u = Number(l.view.width);
                        o = [];
                        var c = 0,
                            h = 0;
                        s = setInterval(function() {
                            var t = e();
                            t.mc.x = t.x, t.mc.y = t.y, n.addChild(t.mc);
                            var a = Math.random() * u,
                                l = a - t.mc.x;
                            i.to(t, Math.random() + 1, {
                                x: a,
                                ease: window.Power1.easeOut,
                                onUpdate: function() {
                                    this.target.mc.x = this.target.x, this.target.mc.y = this.target.y;
                                    var e = Math.ceil((a - t.x) / l * 4);
                                    this.target.mc.gotoAndStop(e)
                                },
                                onComplete: function() {
                                    ++h >= c && null !== r && void 0 !== r && r()
                                }
                            }), c++, c > 40 && (clearInterval(s), s = null), o.push(t)
                        }, 33)
                    }, this.playOutro = function(e) {
                        for (var t = 0; t < o.length; t++) {
                            var r = o[t],
                                s = -r.mc.width,
                                a = s - r.x;
                            i.to(r, Math.random() + 1, {
                                x: s,
                                ease: window.Power1.easeIn,
                                onUpdate: function() {
                                    this.target.mc.x = this.target.x, this.target.mc.y = this.target.y;
                                    var e = Math.ceil((s - r.x) / a * 4);
                                    this.target.mc.gotoAndStop(4 - e)
                                },
                                onComplete: function() {
                                    var t = o.indexOf(this.target);
                                    t >= 0 && (o.splice(t, 1), n.removeChild(this.target.mc)), null !== e && void 0 !== e && o.length <= 0 && e()
                                }
                            })
                        }
                    }
                };
            return n.prototype.constructor = n, n
        }), define("game/transitions/bonusWheelToCliffHanger", ["require", "game/transitions/bonusTransitionAnim"], function(e) {
            "use strict";
            var t = e("game/transitions/bonusTransitionAnim"),
                i = function(e, i, r) {
                    function n() {
                        a.hidePlaque(!0), l()
                    }
                    var o = i,
                        s = r,
                        a = e,
                        l = null,
                        u = null;
                    this.startTransition = function(e, i, r) {
                        l = i, u = r;
                        var c = new t;
                        o.hide(), setTimeout(function() {
                            c.playIntro(function() {
                                s.stageInit(e, !0), setTimeout(function() {
                                    c.playOutro(function() {
                                        a.showPlaque("chIntro", !0, n)
                                    }), setTimeout(function() {
                                        s.show()
                                    }, 700)
                                }, 100)
                            }, 500)
                        })
                    }
                };
            return i.prototype.constructor = i, i
        }), define("game/transitions/cliffHangerToBaseGame", ["require", "game/data/setupData", "game/transitions/bonusTransitionAnim"], function(e) {
            "use strict";
            var t = e("game/data/setupData"),
                i = e("game/transitions/bonusTransitionAnim"),
                r = function(e, r, n) {
                    function o() {
                        p ? p = !1 : u.hidePlaque(!0);
                        var e = new i;
                        l.hide(), setTimeout(function() {
                            e.playIntro(function() {
                                a.stageInit(d, !0), setTimeout(function() {
                                    e.playOutro(function() {
                                        c()
                                    }), setTimeout(function() {
                                        a.show()
                                    }, 700)
                                }, 100)
                            }, 500)
                        })
                    }

                    function s(e) {
                        null !== e && void 0 !== e && "true" === e.response.AwardCapOutcome.AwardCapExceeded && (p = !0)
                    }
                    var a = r,
                        l = n,
                        u = e,
                        c = null,
                        h = null,
                        d = null,
                        p = !1;
                    this.startTransition = function(e, i, r) {
                        if (c = i, h = r, d = e, l.darken(), l.switchStage(t.BASE_GAME), s(e), p) o();
                        else {
                            var n = {
                                orientation: h
                            };
                            u.orientationChanged(n), u.showPlaque("chOutro", !0, o)
                        }
                    }
                };
            return r.prototype.constructor = r, r
        }), define("game/transitions/transitionManager", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "game/data/gameEvents", "game/data/setupData", "game/transitions/baseGameToPunchABunch", "game/transitions/punchABunchToAcceptReject", "game/transitions/acceptRejectToBaseGame", "game/transitions/acceptRejectToPunchABunch", "game/transitions/punchABunchToBaseGame", "game/transitions/bonusWheelToCliffHanger", "game/transitions/cliffHangerToBaseGame", "game/components/plaque/genericPlaque", "game/transitions/bonusTransitionAnim"], function(e) {
            "use strict";
            var t = e("skbJet/component/gameMsgBus/GameMsgBus"),
                i = e("game/data/gameEvents"),
                r = e("game/data/setupData"),
                n = e("game/transitions/baseGameToPunchABunch"),
                o = e("game/transitions/punchABunchToAcceptReject"),
                s = e("game/transitions/acceptRejectToBaseGame"),
                a = e("game/transitions/acceptRejectToPunchABunch"),
                l = e("game/transitions/punchABunchToBaseGame"),
                u = e("game/transitions/bonusWheelToCliffHanger"),
                c = e("game/transitions/cliffHangerToBaseGame"),
                h = e("game/components/plaque/genericPlaque"),
                d = e("game/transitions/bonusTransitionAnim"),
                p = function() {
                    function e(e) {
                        var t = e.response.OutcomeDetail.Stage,
                            n = e.response.OutcomeDetail.NextStage;
                        e.orientation = C, t === r.BASE_GAME && n === r.BONUS_WHEEL ? (f.switchStage(r.BONUS_WHEEL), _.stageInit(e, !0, C), i.publish(i.ON_TRASITION_DONE)) : t === r.BONUS_WHEEL && n === r.BASE_GAME ? (_.hide(), f.switchStage(r.BASE_GAME), f.stageInit(e), i.publish(i.ON_TRASITION_DONE)) : t === r.BONUS_WHEEL && n === r.FREE_SPINS ? P.startTransition(e, function() {
                            i.publish(i.ON_TRASITION_DONE)
                        }, C) : t === r.BONUS_WHEEL && n === r.PLINKO_PICK_REVEAL ? (f.hide(), setTimeout(function() {
                            M.playIntro(function() {
                                y.stageInit(e, !0), setTimeout(function() {
                                    M.playOutro(function() {
                                        i.publish(i.ON_TRASITION_DONE)
                                    }), setTimeout(function() {
                                        y.show()
                                    }, 700)
                                }, 100)
                            }, 500)
                        })) : t === r.PLINKO_POSITION_PICKER && n === r.BASE_GAME ? (y.hide(), setTimeout(function() {
                            M.playIntro(function() {
                                f.stageInit(e, !0), setTimeout(function() {
                                    M.playOutro(function() {
                                        i.publish(i.ON_TRASITION_DONE)
                                    }), setTimeout(function() {
                                        f.show()
                                    }, 700)
                                }, 100)
                            }, 500)
                        })) : t === r.FREE_SPINS && n === r.BASE_GAME ? A.startTransition(e, function() {
                            i.publish(i.ON_TRASITION_DONE)
                        }, C) : t === r.BASE_GAME && n === r.PUNCH_A_BUNCH ? b.startTransition(e, function() {
                            i.publish(i.ON_TRASITION_DONE)
                        }, C) : t === r.PUNCH_A_BUNCH && n === r.PUNCH_A_BUNCH_ACCEPT_REJECT ? x.startTransition(e, function() {
                            i.publish(i.ON_TRASITION_DONE)
                        }) : t === r.PUNCH_A_BUNCH_ACCEPT_REJECT && n === r.BASE_GAME ? T.startTransition(e, function() {
                            i.publish(i.ON_TRASITION_DONE)
                        }) : t === r.PUNCH_A_BUNCH_ACCEPT_REJECT && n === r.PUNCH_A_BUNCH ? E.startTransition(e, function() {
                            i.publish(i.ON_TRASITION_DONE)
                        }) : t === r.PUNCH_A_BUNCH && n === r.BASE_GAME && S.startTransition(e, function() {
                            i.publish(i.ON_TRASITION_DONE)
                        })
                    }

                    function p(e) {
                        C = e.orientation, R.orientationChanged(e)
                    }
                    var f = null,
                        _ = null,
                        m = null,
                        g = null,
                        v = null,
                        y = null,
                        b = null,
                        x = null,
                        T = null,
                        E = null,
                        S = null,
                        P = null,
                        A = null,
                        C = null,
                        M = null,
                        R = null;
                    this.systemInit = function(r, C, O, w, I, D) {
                        R = new h, R.systemInit(), _ = C, f = r, m = O, g = w, v = I, y = D, b = new n(R, f, g), x = new o(f, g, v), T = new s(f, g, v), E = new a(g, v), S = new l(f, g), P = new u(R, f, m), A = new c(R, f, m), M = new d, t.subscribe(i.ON_STAGE_CHANGE, e), t.subscribe(i.ORIENTATION_CHANGED, p)
                    }
                };
            return p.prototype.constructor = p, p
        }), define("game/components/serverWaitHandler", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "game/data/gameEvents", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/data/setupData", "com/pixijs/pixi", "game/utils/miscUtils"], function(e) {
            "use strict";
            var t = e("skbJet/component/gameMsgBus/GameMsgBus"),
                i = e("game/data/gameEvents"),
                r = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                n = e("game/data/setupData"),
                o = e("com/pixijs/pixi"),
                s = e("game/utils/miscUtils"),
                a = function() {
                    function e(e) {
                        p = e.response.OutcomeDetail.NextStage, d = e.response.OutcomeDetail.Stage, p !== n.BASE_GAME && p !== n.FREE_SPINS && (f = setTimeout(l, _))
                    }

                    function a() {
                        null != f && (clearTimeout(f), f = null), m.visible = !1, g.stop()
                    }

                    function l() {
                        m.visible = !0, g.play()
                    }

                    function u() {
                        h()
                    }

                    function c() {
                        a()
                    }

                    function h() {
                        var e = r.getPixiRenderer();
                        m.x = e.view.width / 2, m.y = e.view.height / 2
                    }
                    var d = null,
                        p = null,
                        f = null,
                        _ = 2e3,
                        m = null,
                        g = null;
                    this.init = function() {
                        t.subscribe(i.ON_MAKE_REQUEST, e), t.subscribe(i.ON_RESOLVE_STAGE, a), t.subscribe(i.ORIENTATION_CHANGED, u), t.subscribe(i.ON_RESET_NEXT_STAGE, c), m = r.lib._serverWaitContainer.pixiContainer, m.visible = !1, g = s.createMovieClip("activityAnim0", 1, 40, 3, .5), g.anchor = new o.Point(.5, .5);
                        var n = s.spriteFromTexture("activityBackground", "centre");
                        m.addChild(n), m.addChild(g), h()
                    }
                };
            return a.prototype.constructor = a, a
        }), define("game/setup/setupGame", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "game/data/setupData", "game/data/stateEvents", "game/data/gameEvents", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "com/pixijs/pixi", "game/stateMachine/SMController", "game/core/PlatformManager", "game/core/ConsoleManager", "game/views/baseGameSVC", "game/views/freeSpinSVC", "game/views/punchABunchSVC", "game/views/PABAcceptRejectSVC", "game/views/bonusWheelSVC", "game/views/plinkoSVC", "game/transitions/transitionManager", "game/components/chaseLight/chaseLightsController", "game/components/chaseLight/chaseLightManager", "game/components/serverWaitHandler"], function(e) {
            "use strict";

            function t(e) {
                i(e), g.publish(g.GAME_INIT, e)
            }

            function i(e) {
                d(), r();
                var t = v.getPixiRenderer();
                t.roundPixels = !1, D = new b, D.init(), x().initConsole(e), x().subscribeToMsgBus(), T().subscribeToMsgBus();
                var i = new y.Graphics;
                i.beginFill(0), i.drawRect(0, 0, 10, 10);
                var n = v.lib._backPlate.pixiContainer,
                    t = v.getPixiRenderer();
                n.addChild(i), n.width = t.view.width, n.height = t.view.height, z = new O, z.init(w().GetSpec("BaseSpec"), v.lib._chaseLightContainer.pixiContainer), L = new E, L.systemInit(e, z, H), B = new S, B.systemInit(e, H), F = new P, F.systemInit(e, z), N = new A, N.systemInit(e, F), k = new M, k.systemInit(e), V = new C, V.systemInit(e, z), G = new R, G.systemInit(L, V, B, F, N, k);
                var o = e.GameLogicResponse.OutcomeDetail.NextStage,
                    s = {
                        response: e.GameLogicResponse
                    };
                switch (o) {
                    case _.BASE_GAME:
                        L.stageInit(s);
                        break;
                    case _.FREE_SPINS:
                        B.stageInit(s);
                        break;
                    case _.PUNCH_A_BUNCH:
                        L.stageInit(s), F.stageInit(s, null, j), N.stageInit(s);
                        break;
                    case _.PUNCH_A_BUNCH_ACCEPT_REJECT:
                        L.stageInit(s), F.stageInit(s, null, j), N.stageInit(s, F.getCurrentPickButton(), F.getOptimalStrategy(s));
                        break;
                    case _.BONUS_WHEEL:
                        L.stageInit(s), V.stageInit(s);
                        break;
                    case _.PLINKO_PICK_REVEAL:
                    case _.PLINKO_POSITION_PICKER:
                        k.stageInit(s)
                }
                U = new I, U.init()
            }

            function r() {
                if (!n())
                    for (var e in y.utils.BaseTextureCache)
                        if (y.utils.BaseTextureCache[e].source instanceof HTMLImageElement) try {
                            v.getPixiRenderer().bindTexture(y.utils.BaseTextureCache[e])
                        } catch (e) {}
            }

            function n() {
                var e = window.navigator.userAgent;
                return e.indexOf("MSIE ") > 0 || (e.indexOf("Trident/") > 0 || e.indexOf("Edge/") > 0)
            }

            function o(e) {
                e && e.gameConfig && (H = !!e.gameConfig.rgPresentation && e.gameConfig.rgPresentation)
            }

            function s() {
                v.lib._GameScene.pixiContainer.alpha = 1, m.publish(m.FROM_BEFORE_SHOW_STAGE)
            }

            function a() {
                m.publish(m.FROM_START_GAME_INITIAL)
            }

            function l() {
                m.publish(m.FROM_RECOVERY_GAME_IN_PROGRESS)
            }

            function u(e) {
                e.response.OutcomeDetail.Stage, e.response.OutcomeDetail.NextStage
            }

            function c(e) {
                j !== e.orientation && (j = e.orientation, "portrait" === j ? z.orientationChange(w().GetSpec("BaseSpec_portrait")) : z.orientationChange(w().GetSpec("BaseSpec")));
                var t = v.lib._backPlate.pixiContainer,
                    i = v.getPixiRenderer();
                t.width = i.view.width, t.height = i.view.height
            }

            function h(e) {}

            function d() {
                p("Sprite"), p("Container")
            }

            function p(e) {
                Object.defineProperties(y[e].prototype, {
                    scaleX: {
                        get: function() {
                            return this.scale.x
                        },
                        set: function(e) {
                            this.scale.x = e
                        }
                    },
                    scaleY: {
                        get: function() {
                            return this.scale.y
                        },
                        set: function(e) {
                            this.scale.y = e
                        }
                    }
                })
            }
            var f = e("skbJet/component/gameMsgBus/GameMsgBus"),
                _ = e("game/data/setupData"),
                m = e("game/data/stateEvents"),
                g = e("game/data/gameEvents"),
                v = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                y = e("com/pixijs/pixi"),
                b = e("game/stateMachine/SMController"),
                x = e("game/core/PlatformManager"),
                T = e("game/core/ConsoleManager"),
                E = e("game/views/baseGameSVC"),
                S = e("game/views/freeSpinSVC"),
                P = e("game/views/punchABunchSVC"),
                A = e("game/views/PABAcceptRejectSVC"),
                C = e("game/views/bonusWheelSVC"),
                M = e("game/views/plinkoSVC"),
                R = e("game/transitions/transitionManager"),
                O = e("game/components/chaseLight/chaseLightsController"),
                w = e("game/components/chaseLight/chaseLightManager"),
                I = e("game/components/serverWaitHandler"),
                D = null,
                L = null,
                B = null,
                F = null,
                N = null,
                V = null,
                k = null,
                U = null,
                G = null,
                z = null,
                j = null,
                H = !1;
            ! function() {
                f.subscribe(g.ON_BEFORE_SHOW_STAGE, s), f.subscribe(g.ON_START_GAME_INITIAL, a), f.subscribe(g.ON_START_PROGRESS_STAGE, l), f.subscribe(g.PLATFORM_GAME_INIT, t), f.subscribe(g.PLATFORM_SYSTEM_INIT, o), f.subscribe(g.ON_RESOLVE_STAGE, u), f.subscribe(g.ORIENTATION_CHANGED, c), f.subscribe(m.FROM_START_ROLLUP, h)
            }()
        }), define("game/setup/gameSizeController", ["require", "skbJet/component/gameMsgBus/GameMsgBus", "skbJet/component/gladPixiRenderer/gladPixiRenderer", "game/data/gameEvents", "game/data/setupData"], function(e) {
            function t() {
                var e = Number(window.innerWidth),
                    t = Number(window.innerHeight);
                if (document.documentElement.style.width = e + "px", document.documentElement.style.height = t + "px", document.body.style.width = e + "px", document.body.style.height = t + "px", l.style.width = e + "px", l.style.height = t + "px", u) {
                    var i = o.animMap._landscape2portrait;
                    e < t ? (o.setSize(c.portrait.w, c.portrait.h), i.updateStyleToTime(i.maxTime), s.publish(s.ORIENTATION_CHANGED, {
                        orientation: a.PORTRAIT,
                        width: c.portrait.w,
                        height: c.portrait.h
                    })) : (o.setSize(c.landscape.w, c.landscape.h), i.updateStyleToTime(0), s.publish(s.ORIENTATION_CHANGED, {
                        orientation: a.LANDSCAPE,
                        width: c.portrait.w,
                        height: c.portrait.h
                    }));
                    for (var r = 0; r < h.length; r++);
                    n.publish("changeBackgroundBGIfPortrait", e < t)
                }
                o.fitSize(e, t)
            }

            function i() {
                if (u = u && !!o.animMap._landscape2portraitTemplate) {
                    var e = o.getPixiRenderer(),
                        i = Number(e.view.height),
                        r = Number(e.view.width);
                    c.landscape = {
                        w: r,
                        h: i
                    }, c.portrait = {
                        w: i,
                        h: Math.floor(.9 * r)
                    }, h = [];
                    for (var n = o.animMap._landscape2portraitTemplate._spritesNameList, s = 0; s < n.length; s++) {
                        var a = n[s].match(/^_portrait_(.*)$/);
                        a ? h.push("_" + a[1]) : h.push(n[s])
                    }
                    o.animMap._landscape2portraitTemplate.clone(h, "_landscape2portrait")
                }
                l.width = 2 * window._gladData._width, l.height = 2 * window._gladData._height, window.addEventListener("resize", t), t()
            }

            function r(e) {
                "INT" !== e.serverConfig.channel && "STD" === e.serverConfig.presenttype && (u = !0)
            }
            var n = e("skbJet/component/gameMsgBus/GameMsgBus"),
                o = e("skbJet/component/gladPixiRenderer/gladPixiRenderer"),
                s = e("game/data/gameEvents"),
                a = e("game/data/setupData"),
                l = document.getElementById("game"),
                u = !1,
                c = {},
                h = [];
            return n.subscribe("platformMsg/Kernel/System.Init", r), n.subscribe("onBeforeShowStage", i), {}
        }), define("game/setup/paytableHelperFile", ["require", "skbJet/component/currencyHelper/currencyHelper", "skbJet/component/gameMsgBus/GameMsgBus", "skbJet/component/pixiResourceLoader/pixiResourceLoader", "game/commonUI/slot/slotUI", "game/components/createJsAudioPlayer/SoundManager"], function(e) {
            function t() {
                T = window.location.search.match(/&?language=([^&]+)&?/)[1]
            }

            function i(e) {
                E = parseInt(e.PaytableResponse.DenominationList.Denomination["#text"]), S = parseInt(e.PaytableResponse.AwardCapInfo.CurrencyCap.AwardCap), "true" === e.PaytableResponse.PaytableStatistics["@singleRTP"].toLowerCase() ? (P = e.PaytableResponse.PaytableStatistics["@minSingleRTP"], A = e.PaytableResponse.PaytableStatistics["@maxSingleRTP"]) : (P = e.PaytableResponse.PaytableStatistics["@minRTP"], A = e.PaytableResponse.PaytableStatistics["@maxRTP"])
            }

            function r() {
                o(), l()
            }

            function n() {
                y.baseGame.autoSpin.active || g.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.Control",
                    data: {
                        name: "paytable",
                        event: "enable",
                        params: [1]
                    }
                })
            }

            function o() {
                var e = document.getElementsByClassName("closeBtn");
                Array.prototype.forEach.call(e, function(e) {
                    e.innerHTML = v.i18n.Game.buttonClose, e.onclick = function() {
                        c("game")
                    }
                })
            }

            function s() {
                var e = "awardcap=" + encodeURIComponent(m.formatBalance(S)) + "&maxRTP=" + A + "&minRTP=" + P;
                document.getElementById("paytable_iframe").src = "i18n/" + T + "/default/" + T + ".html?" + e
            }

            function a() {
                document.getElementById("gameRules_iframe").src = "i18n/" + T + "/default/help.html"
            }

            function l() {
                var e = document.getElementById("gameRulesHeader"),
                    t = document.getElementById("paytableHeader");
                e.innerHTML = v.i18n.MenuCommand.howToPlay, t.innerHTML = v.i18n.MenuCommand.payTable
            }

            function u() {
                g.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.Control",
                    data: {
                        name: "paytable",
                        event: "enable",
                        params: [0]
                    }
                })
            }

            function c(e) {
                "paytable" === e ? (b().execute("onUiPaytableOpen"), s()) : "gameRules" === e && (b().execute("onUiHelpOpen"), a());
                for (var t = document.getElementsByClassName("tab"), i = 0; i < t.length; i++) t[i].style.display = "none";
                document.getElementById(e).style.display = "block", "game" === e && ("paytable" === C ? b().execute("onUiPaytableClose") : "gameRules" === C && b().execute("onUiHelpClose")), C = e
            }

            function h(e) {
                if ("paytable" === e.option || "howToPlay" === e.option) {
                    var t = "howToPlay" === e.option ? "gameRules" : "paytable";
                    c("block" === document.getElementById(t).style.display ? "game" : t)
                }
            }

            function d() {
                u()
            }

            function p(e) {
                "BaseGame" === e.response.OutcomeDetail.NextStage && (x = !0, n())
            }

            function f() {
                u()
            }

            function _() {
                x && n()
            }
            var m = e("skbJet/component/currencyHelper/currencyHelper"),
                g = e("skbJet/component/gameMsgBus/GameMsgBus"),
                v = e("skbJet/component/pixiResourceLoader/pixiResourceLoader"),
                y = e("game/commonUI/slot/slotUI"),
                b = e("game/components/createJsAudioPlayer/SoundManager"),
                x = !0,
                T = null,
                E = null,
                S = null,
                P = null,
                A = null,
                C = "game";
            return g.subscribe("platformMsg/Kernel/System.Init", t), g.subscribe("platformMsg/ClientService/Game.Init", i), g.subscribe("onBeforeShowStage", r), g.subscribe("onAbortNextStage", d), g.subscribe("onResetNextStage", p), g.subscribe("platformMsg/ConsoleService/Game.Control", h), g.subscribe("AutoSpin.enabled", f), g.subscribe("AutoSpin.disabled", _), g.subscribe("helpFiles.enableConsole", n), g.subscribe("UI.AutoSpinDialogueOpen", u), g.subscribe("UI.AutoSpinDialogueClose", n), {}
        }), define("game", ["require", "skbJet/component/gameMsgBus/PlatformMsgBusAdapter", "skbJet/component/gameMsgBus/GameMsgBus", "game/data/gameEvents", "game/loaders/loadController", "game/setup/setupGame", "game/setup/gameSizeController", "game/setup/paytableHelperFile", "skbJet/component/resourceLoader/resourceLib"], function(e) {
            "use strict";

            function t() {
                if (window.WebGLRenderingContext) {
                    var e = document.createElement("canvas"),
                        t = ["webgl", "experimental-webgl", "moz-webgl", "webkit-3d"],
                        i = !1;
                    for (var r in t) try {
                        if (null !== (i = e.getContext(t[r])) && i instanceof WebGLRenderingContext) return !0
                    } catch (e) {
                        return !1
                    }
                    return !1
                }
                return !1
            }

            function i(e) {
                var t = e.PaytableResponse.VersionInfo;
                s.publish("toPlatform", {
                    channel: "Game",
                    topic: "Game.InitDone",
                    data: {
                        version: {
                            gameVersion: window._cacheFlag.gameVersion,
                            gleVersion: t && t.GameLogicVersion || "dev"
                        }
                    }
                }), l = !0, o = window.location.search.match(/&?assetPack=([^&]+)&?/)[1], n()
            }

            function r(e) {
                n()
            }

            function n() {
                "desktop" !== o && (window.innerHeight > window.innerWidth ? document.body.style.backgroundImage = "url('assetPacks/" + o + "/sprites/BaseGameBG_port.png')" : document.body.style.backgroundImage = "url('assetPacks/" + o + "/sprites/BaseGameBG_land.png')")
            }
            e("skbJet/component/gameMsgBus/PlatformMsgBusAdapter");
            var o, s = e("skbJet/component/gameMsgBus/GameMsgBus"),
                a = e("game/data/gameEvents"),
                l = (e("game/loaders/loadController"), e("game/setup/setupGame"), e("game/setup/gameSizeController"), e("game/setup/paytableHelperFile"), e("skbJet/component/resourceLoader/resourceLib"), !1);
            ! function() {
                t() && (s.subscribe(a.PLATFORM_GAME_INIT, i), s.subscribe(a.ORIENTATION_CHANGED, r))
            }()
        })
}();