<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">! function() {
    "use strict";
    class e extends Laya.Script {
        constructor() {
            super(...arguments), this.awaits_ = []
        }
        onDisable() {
            for (const e of this.awaits_) e();
            this.awaits_ = []
        }
        match(e, t) {
            const s = [];
            if (null == e) return null;
            t || (t = this.owner);
            for (var a = t, i = "/" !== e[0] ? 0 : 1, o = e.split("/"), n = i; n &lt; o.length; n++) {
                var r = o[n],
                    h = a._children;
                a = null;
                for (var l = 0, c = h.length; l &lt; c; ++l) {
                    var d = h[l];
                    d.name.indexOf(r) &gt; -1 &amp;&amp; s.push(d), s.push(...this.match(e, d))
                }
            }
            return s
        }
        find(e, t) {
            if (null == e) return null;
            t || (t = this.owner);
            for (var s = t, a = "/" !== e[0] ? 0 : 1, i = e.split("/"), o = a; o &lt; i.length; o++) {
                var n = i[o],
                    r = s._children;
                s = null;
                for (var h = 0, l = r.length; h &lt; l; ++h) {
                    var c = r[h];
                    if (c.name === n) {
                        s = c;
                        break
                    }
                }
                if (!s) return null
            }
            return s
        }
        findComponents(e, t, s) {
            if (void 0 === e) return [];
            t || (t = this.owner), s || (s = []);
            var a = t._components;
            if (a)
                for (var i = 0; i &lt; a.length; i++) {
                    const t = a[i];
                    t instanceof e &amp;&amp; s.push(t)
                }
            for (var o = t._children, n = 0, r = o.length; n &lt; r; ++n) {
                var h = o[n];
                this.findComponents(e, h, s)
            }
            return s
        }
    }

    function __decorate(e, t, s, a) {
        var i, o = arguments.length,
            n = o &lt; 3 ? t : null === a ? a = Object.getOwnPropertyDescriptor(t, s) : a;
        if ("object" == typeof Reflect &amp;&amp; "function" == typeof Reflect.decorate) n = Reflect.decorate(e, t, s, a);
        else
            for (var r = e.length - 1; r &gt;= 0; r--)(i = e[r]) &amp;&amp; (n = (o &lt; 3 ? i(n) : o &gt; 3 ? i(t, s, n) : i(t, s)) || n);
        return o &gt; 3 &amp;&amp; n &amp;&amp; Object.defineProperty(t, s, n), n
    }

    function __awaiter(e, t, s, a) {
        return new(s || (s = Promise))(function(i, o) {
            function fulfilled(e) {
                try {
                    step(a.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function rejected(e) {
                try {
                    step(a.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function step(e) {
                var t;
                e.done ? i(e.value) : (t = e.value, t instanceof s ? t : new s(function(e) {
                    e(t)
                })).then(fulfilled, rejected)
            }
            step((a = a.apply(e, t || [])).next())
        })
    }
    Object.create;
    var t;
    Object.create;
    class s {}
    s.MAX_ENERGY = 7, s.RECOVER_ENERGY = 300, s.WHELL_ANGLE_OFFSET = 35,
        function(e) {
            e.WEB = "web", e.MINIFACEBOOK = "minfacebook"
        }(t || (t = {}));
    var a = new class {};
    class i {
        constructor() {
            this._dispatcher = new Laya.EventDispatcher, this.initValue = void 0
        }
        get beforValue() {
            return this._beforeValue
        }
        get value() {
            return this._value
        }
        set value(e) {
            this._value !== e &amp;&amp; (this._beforeValue = this._value, this._value = e, this.event([this._value, this._beforeValue]))
        }
        offAllCaller(e) {
            this._dispatcher.offAllCaller(e)
        }
        toDefault() {
            this._value = this._beforeValue = this.initValue
        }
        event(e) {
            this._dispatcher.event(Laya.Event.CHANGED, e)
        }
        on(e, t, s) {
            this._dispatcher.on(Laya.Event.CHANGED, e, t, s)
        }
        off(e, t) {
            this._dispatcher.off(Laya.Event.CHANGED, e, t, !1)
        }
        static Define() {
            return function(e, t) {
                e[t];
                delete e[t] &amp;&amp; Object.defineProperty(e, t, {
                    get: function() {
                        return this.define(t, this.storageData[t])
                    },
                    set: function(e) {
                        e
                    },
                    enumerable: !0,
                    configurable: !0
                })
            }
        }
        static Map() {
            return function(e, t) {
                var s = e[t];
                delete e[t] &amp;&amp; Object.defineProperty(e, t, {
                    get: function() {
                        if (!this.baseValueMap.has(t)) {
                            const e = this.storageData[t],
                                s = new Map;
                            if (e instanceof Array &amp;&amp; e[0] instanceof Array)
                                for (const [t, a] of e) s.set(t, a);
                            return this.define(t, s)
                        }
                        return this.define(t, this.storageData[t] || s)
                    },
                    set: function(e) {
                        s = e
                    },
                    enumerable: !0,
                    configurable: !0
                })
            }
        }
    }
    const o = "YYGGames_CAR_MASTER_DBInstance";
    class n {
        constructor() {
            this.baseValueMap = new Map
        }
        toDefault() {
            const e = this.baseValueMap.values();
            for (const t of e) t.toDefault()
        }
        offAllCaller(e) {
            const t = this.baseValueMap.values();
            for (const s of t) s.offAllCaller(e)
        }
        define(e, t = null) {
            if (!this.baseValueMap.has(e)) {
                const s = new i;
                s.value = t, s.initValue = t, this.baseValueMap.set(e, s)
            }
            return this.baseValueMap.get(e)
        }
        getDataAsync() {
            return new Promise((e, s) =&gt; {
                const i = a.appConfig.platform;
                if (console.log("platform", i), i === t.WEB) try {
                    const t = Laya.LocalStorage.getItem(o),
                        s = JSON.parse(t);
                    e(s)
                } catch (t) {
                    e(null)
                } else if (i === t.MINIFACEBOOK) {
                    const t = Object.keys(this.storageData);
                    FBInstant.player.getDataAsync(t).then(t =&gt; {
                        console.log("MINIFACEBOOK_DB_data", t), e(t)
                    })
                }
            })
        }
        save() {
            const e = this.baseValueMap.entries();
            for (const [t, s] of e) s.value instanceof Map ? this.storageData[t] = Array.from(s.value) : this.storageData[t] = s.value;
            const s = a.appConfig.platform;
            s === t.WEB ? Laya.LocalStorage.setItem(o, JSON.stringify(this.storageData)) : s === t.MINIFACEBOOK &amp;&amp; FBInstant.player.setDataAsync(this.storageData)
        }
    }
    class r extends n {
        constructor() {
            super(...arguments), this.isNewToday = !1
        }
        get myCarData() {
            if (!this.carData) {
                let e = Laya.LocalStorage.getJSON("CarMaster-carData");
                e || (e = {
                    myCars: [1],
                    useCar: 1
                }), e.myCars = e.myCars.sort((e, t) =&gt; e - t), this.carData = e
            }
            return this.carData
        }
        saveCarData() {
            Laya.LocalStorage.setJSON("CarMaster-carData", this.carData)
        }
        initStorageData() {
            this.storageData = {}, this.storageData.level = 1, this.storageData.logintimeStamp = 0, this.storageData.musicMuted = !1, this.storageData.soundMuted = !1, this.storageData.playerId = "-1", this.storageData.loginType = 9, this.storageData.dailyRewardDrawTimes = 2, this.storageData.todayGameTimes = 0, this.storageData.todayFriendGameTimes = 0, this.storageData.todayWinGameTimes = 0, this.storageData.todayGuessedTimes = 0, this.storageData.todayLikedTimes = 0
        }
        dbAsyncInit() {
            return new Promise((e, t) =&gt; {
                this.initStorageData(), this.getDataAsync().then(t =&gt; {
                    t &amp;&amp; (this.storageData = t), this.initData(), e(!0)
                })
            })
        }
        onNewToday() {
            console.log("æ–°çš„ä¸€å¤©")
        }
        clear() {
            this.storageData = null, this.initData()
        }
        initData() {
            this.storageData || (this.storageData = {}, this.storageData.level = 1, this.storageData.logintimeStamp = 0, this.storageData.musicMuted = !1, this.storageData.soundMuted = !1, this.storageData.playerId = "-1", this.storageData.loginType = 9, this.storageData.coin = 0, this.storageData.energy = 7);
            const e = Date.now(),
                t = this.storageData.logintimeStamp;
            this.storageData.logintimeStamp = e, this.isNewToday = !(new Date(e).setHours(0, 0, 0, 0) === new Date(t).setHours(0, 0, 0, 0)), this.isNewToday &amp;&amp; (this.onNewToday(), this.save()), this.energy.on(this, this.onEnergyChange)
            
        }
        onEnergyChange(e, t) {
            t === s.MAX_ENERGY &amp;&amp; e == t - 1 &amp;&amp; (this.energytimestamp.value = (new Date).getTime() / 1e3, this.save())
        }
        static flyTips() {
            r.textTips || (r.textTips = new Laya.Label, r.textTips.text = "Failed to get the reward, please watch the ads to the end.", r.textTips.wordWrap = !0, r.textTips.size(Laya.stage.width - 200, 100), r.textTips.align = "center", r.textTips.valign = "middle", r.textTips.centerX = 0, r.textTips.zOrder = 10001, r.textTips.fontSize = 32, r.textTips.color = "#ffffff", r.textTips.bgColor = "#000000", Laya.stage.addChild(r.textTips)), r.textTips.visible = !0, r.textTips.centerY = 0, Laya.Tween.to(r.textTips, {
                centerY: -100
            }, 1e3, null, Laya.Handler.create(r, r.flyTipsEnd), 0, !0)
        }
        static flyTipsEnd() {
            r.textTips.visible = !1
        }
        getUserUseCar(e = null) {
            let t = null != e ? e : this.myCarData.useCar,
                s = "001";
            return s = t &lt; 10 ? "00" + t : t &gt;= 10 &amp;&amp; t &lt; 100 ? "0" + t : "" + t
        }
    }
    __decorate([i.Define()], r.prototype, "playerId", void 0), __decorate([i.Define()], r.prototype, "loginType", void 0), __decorate([i.Define()], r.prototype, "musicMuted", void 0), __decorate([i.Define()], r.prototype, "soundMuted", void 0), __decorate([i.Define()], r.prototype, "coin", void 0), __decorate([i.Define()], r.prototype, "energy", void 0), __decorate([i.Define()], r.prototype, "energytimestamp", void 0), __decorate([i.Map()], r.prototype, "cars", void 0), __decorate([i.Define()], r.prototype, "currentCarId", void 0), __decorate([i.Define()], r.prototype, "level", void 0);
    var h = new r;
    class l {}
    class c {
        constructor() {
            this.volume = 100, this._audioInstances = new Map, this._musicVolume = 100, window.AudioContext = window.AudioContext || window.webkitAudioContext, this.context = new AudioContext
        }
        getContext() {
            return this.context
        }
        isSuspend() {
            return "suspended" === this.context.state
        }
        suspend() {
            this.context.suspend()
        }
        resume() {
            this.context.resume()
        }
        stopAll() {
            const e = this._audioInstances.values();
            for (const t of e) {
                const e = t.instance;
                if (e.source.buffer) {
                    try {
                        e.source.stop(this.context.currentTime)
                    } catch (t) {
                        e.source.disconnect()
                    }
                    e.source.onended = function() {}, e.setup()
                }
            }
        }
        stop(e) {
            if (this._audioInstances.has(e)) {
                const t = this._audioInstances.get(e);
                this._stopSound(t)
            }
        }
        _stopSound(e) {
            const t = e.instance;
            if (t.source.buffer) {
                try {
                    t.source.stop(this.context.currentTime)
                } catch (e) {
                    t.source.disconnect()
                }
                t.source.onended = function() {}, t.setup()
            }
        }
        playMusic(e) {
            this._music &amp;&amp; this._stopSound(this._music), this._audioInstances.has(e) ? (this._music = this._audioInstances.get(e), this.musicVolume = this._musicVolume, this.play(e, !0)) : this.downloadArrayBuffer(e, () =&gt; {
                this.playMusic(e)
            })
        }
        stopMusic() {
            this._music &amp;&amp; this._stopSound(this._music)
        }
        set musicVolume(e) {
            this._musicVolume = e, this._music &amp;&amp; (this._music.instance.gain.gain.value = this._musicVolume / 100)
        }
        get musicVolume() {
            return this._musicVolume
        }
        play(e, t = !1, s = !1) {
            if (this._audioInstances.has(e)) {
                const a = this._audioInstances.get(e),
                    i = a.instance;
                if (s &amp;&amp; !i.ended) return;
                if (this.stop(e), a.buffer) try {
                    i.playBuffer(this.context.currentTime, a.buffer), i.source.loop = t
                } catch (e) {
                    console.error("playBuffer error. Exception: " + e)
                }
            } else this.downloadArrayBuffer(e, () =&gt; {
                this.play(e, t)
            })
        }
        load(e, t) {
            let s = e.length,
                a = 0;
            for (let i = 0; i &lt; e.length; i++) {
                const o = e[i];
                this.downloadArrayBuffer(o, () =&gt; {
                    ++a &gt;= s &amp;&amp; t &amp;&amp; t()
                })
            }
        }
        setThreeD(e) {
            if (this._audioInstances.has(e)) {
                this._audioInstances.get(e).instance.threeD = !0
            }
        }
        createSoundInstance() {
            let e = this.context;
            const t = {
                gain: e.createGain(),
                panner: e.createPanner(),
                threeD: !1,
                ended: !1,
                playBuffer: function(e, t, s) {
                    this.source.buffer = t;
                    var a = this;
                    this.ended = !1, this.source.onended = function() {
                        a.setup(), a.ended = !0
                    }, this.source.start(e, s)
                },
                setup: function() {
                    this.source = e.createBufferSource(), this.setupPanning()
                },
                setupPanning: function() {
                    this.threeD ? (this.source.disconnect(), this.source.connect(this.panner), this.panner.connect(this.gain)) : (this.panner.disconnect(), this.source.connect(this.gain))
                }
            };
            return t.panner.rolloffFactor = 0, t.gain.connect(this.context.destination), t.setup(), t
        }
        parse(e, t, s) {
            const a = new l;
            a.url = e, a.instance = this.createSoundInstance(), this._audioInstances.set(e, a), this.context.decodeAudioData(t, function(e) {
                a.buffer = e, s &amp;&amp; s()
            }, function() {
                a.error = !0, s &amp;&amp; s(), console.log("Decode error." + a.url)
            })
        }
        downloadArrayBuffer(e, t) {
            if (this._audioInstances.has(e)) return void(t &amp;&amp; t());
            const s = this;
            var a = new XMLHttpRequest;
            a.open("GET", e, !0), a.responseType = "arraybuffer", a.onload = function() {
                if (200 !== a.status &amp;&amp; 0 !== a.status) throw "no response";
                s.parse(e, a.response, t)
            }, a.onerror = function() {
                throw t &amp;&amp; t(), "no response"
            }, a.ontimeout = function() {
                t &amp;&amp; t()
            }, a.onabort = function() {
                t &amp;&amp; t()
            }, a.send(null)
        }
    }
    var d = new class {
        constructor() {
            this.beEnabled = !1, this.isMuted = !1, this.bePauseSound = !1, this.bePauseMusic = !1, this.tryToResumeIntervalId = -1, this.isVisibilityMuted = !1
        }
        init() {
            return new Promise((e, t) =&gt; {
                try {
                    this.musicAudio = new c, this.soundAudio = new c, window.document.addEventListener("mousedown", this.tryToResumeAudioContext.bind(this), !0), window.document.addEventListener("touchstart", this.tryToResumeAudioContext.bind(this), !0), window.document.addEventListener("visibilitychange", this.onVisibilitychange.bind(this)), this.tryToResumeIntervalId = setInterval(this.tryToResumeAudioContext.bind(this), 200), this.musicAudio.getContext().onstatechange = this.onMusicStatechange.bind(this), this.soundAudio.getContext().onstatechange = this.onSoundStatechange.bind(this), this.beEnabled = !0, this.musicVolume = 60, h &amp;&amp; (h.musicMuted.on(this, this.onDBInstanceMuted), h.soundMuted.on(this, this.onDBInstanceMuted), this.onDBInstanceMuted()), e(!0)
                } catch (t) {
                    alert("Web Audio API is not supported in this browser"), e(!1)
                }
            })
        }
        onVisibilitychange() {
            "hidden" == document.visibilityState ? this.isMuted || (this.isVisibilityMuted = this.muted = !0) : "visible" == document.visibilityState &amp;&amp; this.isVisibilityMuted &amp;&amp; (this.isVisibilityMuted = this.muted = !1)
        }
        onDBInstanceMuted() {
            this.pauseMusic = h.musicMuted.value, this.pauseSound = h.soundMuted.value
        }
        tryToResumeAudioContext() {
            if (!this.isMuted) {
                if (this.bePauseSound || this.bePauseMusic) return window.document.removeEventListener("mousedown", this.tryToResumeAudioContext.bind(this), !0), window.document.removeEventListener("touchstart", this.tryToResumeAudioContext.bind(this), !0), clearInterval(this.tryToResumeIntervalId), void(this.tryToResumeIntervalId = -1);
                this.musicAudio.isSuspend() &amp;&amp; this.musicAudio.resume(), this.soundAudio.isSuspend() &amp;&amp; this.musicAudio.resume(), this.musicAudio.isSuspend() &amp;&amp; this.soundAudio.isSuspend() || (window.document.removeEventListener("mousedown", this.tryToResumeAudioContext.bind(this), !0), window.document.removeEventListener("touchstart", this.tryToResumeAudioContext.bind(this), !0), clearInterval(this.tryToResumeIntervalId), this.tryToResumeIntervalId = -1)
            }
        }
        onMusicStatechange() {
            !this.musicAudio.isSuspend() || this.isMuted || this.bePauseMusic || -1 !== this.tryToResumeIntervalId || (window.document.addEventListener("mousedown", this.tryToResumeAudioContext.bind(this), !0), window.document.addEventListener("touchstart", this.tryToResumeAudioContext.bind(this), !0), this.tryToResumeIntervalId = setInterval(this.tryToResumeAudioContext.bind(this), 200))
        }
        onSoundStatechange() {
            !this.soundAudio.isSuspend() || this.isMuted || this.bePauseSound || -1 !== this.tryToResumeIntervalId || (window.document.addEventListener("mousedown", this.tryToResumeAudioContext.bind(this), !0), window.document.addEventListener("touchstart", this.tryToResumeAudioContext.bind(this), !0), this.tryToResumeIntervalId = setInterval(this.tryToResumeAudioContext.bind(this), 200))
        }
        set muted(e) {
            this.isMuted = e, this.isMuted ? (this.musicAudio.suspend(), this.soundAudio.suspend()) : (this.bePauseMusic || this.musicAudio.resume(), this.bePauseSound || this.soundAudio.resume())
        }
        get muted() {
            return this.isMuted
        }
        set pauseSound(e) {
            if (this.bePauseSound = e, this.bePauseSound) this.soundAudio.suspend();
            else {
                if (this.isMuted) return;
                this.soundAudio.resume()
            }
        }
        get pauseSound() {
            return this.bePauseSound
        }
        get pauseMusic() {
            return this.bePauseMusic
        }
        set pauseMusic(e) {
            if (this.bePauseMusic = e, this.bePauseMusic) this.musicAudio.suspend();
            else {
                if (this.isMuted) return;
                this.musicAudio.resume()
            }
        }
        stopAll() {
            this.musicAudio.stopAll(), this.soundAudio.stopAll()
        }
        parse(e, t, s) {
            this.soundAudio.parse(e, t)
        }
        playMusic(e) {
            this.musicAudio.stopAll(), this.musicAudio.playMusic(e)
        }
        stopMusic() {
            this.musicAudio.stopAll()
        }
        stopSound(e) {
            this.soundAudio.stop(e)
        }
        set musicVolume(e) {
            this.musicAudio.musicVolume = e
        }
        get musicVolume() {
            return this.musicAudio.musicVolume
        }
        playSound(e, t = !1, s = !1) {
            this.beEnabled &amp;&amp; this.soundAudio.play(e, t, s)
        }
    };
    const u = "GamemonetizeAdsInstance_AD_WEB";
    class g {
        constructor() {
            this.isInited = !1
        }
        adsAsyncInit(e, t, s) {
            return this.route = ["https://www.yad.com/", "https://www.yiv.com/", "https://www.babygames.com/", "https://www.bestgames.com/", "https://cargames.com/", "https://www.yad.com/", "https://www.yad.com/", "https://www.yad.com/"][t], this.getForgames(), this.appName = e, new Promise((e, t) =&gt; {
                window.SDK_OPTIONS = {
                    gameId: s,
                    onEvent: t =&gt; {
                        switch (console.log("event.name ====", t), t.name) {
                            case "SDK_GAME_PAUSE":
                                break;
                            case "SDK_GAME_START":
                                this.onSuccess &amp;&amp; (this.onSuccess(!1), this.onSuccess = null), this.onComplete();
                                break;
                            case "SDK_READY":
                                e(this.isInited)
                        }
                    }
                }, this.init().then(e =&gt; {
                    this.isInited = e
                })
            })
        }
        init() {
            return new Promise((e, t) =&gt; {
                var s = document.getElementById(u);
                if (s &amp;&amp; !this.isInited &amp;&amp; (s = null), s) e(!0);
                else {
                    const s = document.createElement("script");
                    s.onload = function() {
                        e(!0)
                    }.bind(this), s.onerror = function(e) {
                        console.log("onError", e), t(!1)
                    }.bind(this), s.type = "text/javascript", s.async = !1, s.src = "https://api.gamemonetize.com/sdk.js", s.id = u, document.head.appendChild(s)
                }
            })
        }
        onComplete() {
            d.muted = !1
        }
        request(e) {
            return new Promise((e, t) =&gt; {
                this.isInited ? (this.onSuccess = e, window.sdk.showBanner()) : e(!1)
            })
        }
        showInterstitial() {
            return d.muted = !0, this.request(!1)
        }
        showReward() {
            return d.muted = !0, this.request(!0)
        }
        getForgames() {
            const e = new XMLHttpRequest;
            e.open("GET", this.route + "forgame/games.json", !0), e.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"), e.responseType = "text", e.onerror = function(e) {}, e.onabort = function(e) {}, e.onprogress = function(e) {}, e.onload = (t =&gt; {
                var s = void 0 !== e.status ? e.status : 200;
                200 !== s &amp;&amp; 204 !== s &amp;&amp; 0 !== s || (this.forgames = JSON.parse(e.responseText))
            }), e.send()
        }
        navigateTo(e, t, s, a) {
            a = a || "";
            let i = document.referrer;
            var o = this.route;
            void 0 === a || "" == a || "undefined" == a || (o = o + "?pic=" + a), i = void 0 === i || "" == i || "undefined" == i ? "unknown" : i.split("/")[2], o.indexOf("?") &gt; -1 ? o += "&amp;" : o += "?", o = o + "utm_source=" + i + "&amp;utm_medium=" + t + "-" + s + "&amp;utm_campaign=game-" + e
        }
        navigate(e, t, s) {
            s = s || "";
            let a = document.referrer;
            var i = this.route;
            void 0 === s || "" == s || "undefined" == s || (i = i + "?pic=" + s), a = void 0 === a || "" == a || "undefined" == a ? "unknown" : a.split("/")[2], i.indexOf("?") &gt; -1 ? i += "&amp;" : i += "?", i = i + "utm_source=" + a + "&amp;utm_medium=" + e + "-" + t + "&amp;utm_campaign=game-" + this.appName;
            try {
                window.open(i)
            } catch (e) {}
        }
    }
    var m, y = new class {
        constructor() {
            this.canNavigateActive_ = !1, this.screen_ = "", this.action_ = "", this.to_ = "", this.prompt_ = null
        }
        adsAsyncInit(e) {
            return new Promise((t, s) =&gt; {
                Laya.loader.create("cnf.json", Laya.Handler.create(this, s =&gt; {
                    this.initData(), t(!0)
                        
                    
                }))
            })
        }
        navigate(e, t, s) {
            console.log("navigate", e, t, s), !1 === this.canNavigateActive_ &amp;&amp; (this.screen_ = e, this.action_ = t, this.to_ = s, this.canNavigateActive_ = !0)
        }
        showInterstitial() {
            return window.document.getElementById("advertisement") &amp;&amp; (window.document.getElementById("advertisement").style.display = ""), this.onblur(), this.instance ? this.instance.showInterstitial() : new Promise((e, t) =&gt; {
                window.document.getElementById("advertisement") &amp;&amp; (window.document.getElementById("advertisement").style.display = "none"), window.focus(), this.onfocus(), e(!0)

                window.adsGameCon.showAd({
                    beforeShowAd: () =&gt; {
                       
                    },
                    afterShowAd: () =&gt; {

    
                    }
                });
            })



        }
        showReward() {
            return window.document.getElementById("advertisement") &amp;&amp; (window.document.getElementById("advertisement").style.display = ""), this.onblur(), this.instance ? this.instance.showReward() : new Promise((e, t) =&gt; {
                window.document.getElementById("advertisement") &amp;&amp; (window.document.getElementById("advertisement").style.display = "none"), window.focus(), this.onfocus()

                window.adsGameCon.showAdOfEvent({
                    beforeShowAd: () =&gt; {
                       
                       
                    },
                    afterShowAd: () =&gt; {
                        e(!0)
    
                    }
                });
            })
        }
        prompt(e, t) {
            this.prompt_ || (this.prompt_ = document.createElement("div"), this.prompt_.style.cssText = "font-family:siyuan;max-width:80%;min-width:320px;padding:10px 10px 10px 10px;min-height:40px;color: rgb(255, 255, 255);line-height: 20px;text-align:center;border-radius: 4px;position: fixed;top: 40%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 16px;", document.body.appendChild(this.prompt_)), this.prompt_.innerHTML = e, t = isNaN(t) ? 2e3 : t, this.prompt_.style.display = "inline", this.prompt_.style.opacity = "1", setTimeout(function() {
                this.prompt_.style.webkitTransition = "-webkit-transform 0.5s ease-in, opacity 0.5s ease-in", this.prompt_.style.opacity = "0", this.prompt_.style.display = "none"
            }.bind(this), t)
            
        }
        onblur() {
            d &amp;&amp; (d.muted = !0)
        }
        onfocus() {
            d &amp;&amp; (d.muted = !1)
        }
        readFile(e) {
            return new Promise((t, s) =&gt; {
                var a = Laya.loader.getRes(e);
                a ? t(a) : Laya.loader.create(e, Laya.Handler.create(this, t))
            })
        }
        initData() {
            initAdsGame("layaCanvas","8euguy6n677497qy4t54bhipdvf7jnic")
            document.addEventListener("mouseup", this.onNavigate_.bind(this)), document.addEventListener("touchstart", this.onNavigate_.bind(this))
            
        }
        onNavigate_() {
             (this.canNavigateActive_ &amp;&amp; (this.instance ? this.instance.navigate(this.screen_, this.action_, this.to_) : window.adsGameCon.moreGame()), this.canNavigateActive_ = !1)
        }
    };
    class p extends e {
        constructor() {
            super()
        }
        onAwake() {
            super.onAwake(), this.claim = this.owner.getChildByName("Claim"), this.give_Up = this.owner.getChildByName("Give_Up"), this.claim.on(Laya.Event.CLICK, this, this.getTL), this.give_Up.on(Laya.Event.CLICK, this, this.closeOwner)
        }
        closeOwner() {
            this.owner.close()
        }
        onEnable() {
            window.carLogo.visible = !1, super.onEnable(), this.refreshUI()
        }
        refreshUI() {}
        getTL() {
            y.showReward().then(e =&gt; {
                e &amp;&amp; (h.energy.value += 2, this.owner.param.handlerFun.run(), this.owner.close())
            })
        }
        onDisable() {
            super.onDisable(), window.carLogo.visible = !0
        }
    }! function(e) {
        e.LoadingScene = "scenes/LoadingScene.scene", e.GameScene = "scenes/GameScene.scene", e.HomeScene = "scenes/HomeScene.scene", e.HomeDialog = "dialogs/HomeDialog.scene", e.GarageDialog = "dialogs/GarageDialog.scene", e.LevelsDialog = "dialogs/LevelsDialog.scene", e.LoadingDialog = "dialogs/LoadingDialog.scene", e.WinDialog = "dialogs/WinDialog.scene", e.LoseDialog = "dialogs/LoseDialog.scene", e.GetItemDialog = "dialogs/GetItemDialog.scene", e.EnergyRewardDialog = "dialogs/EnergyRewardDialog.scene"
    }(m || (m = {}));
    class f {
        static Property(e) {
            return function(t, s) {
                delete t[s] &amp;&amp; Object.defineProperty(t, s, {
                    get: function() {
                        return this["__" + s] || (this["__" + s] = e ? f.find(e, this.owner) : f.find(s, this.owner)), this["__" + s]
                    },
                    set: function(e) {
                        this["__" + s] = e
                    },
                    enumerable: !0,
                    configurable: !0
                })
            }
        }
        static find(e, t) {
            if (null == e) return null;
            if (!t) return null;
            for (var s = t, a = "/" !== e[0] ? 0 : 1, i = e.split("/"), o = a; o &lt; i.length; o++) {
                var n = i[o],
                    r = s._children;
                s = null;
                for (var h = 0, l = r.length; h &lt; l; ++h) {
                    var c = r[h];
                    if (c.name === n) {
                        s = c;
                        break
                    }
                }
                if (!s) return null
            }
            return s
        }
    }
    var w = new class {
        constructor() {
            this.resources = new Map, this.resourcePromises = [], this.completCount = 0, this.totalCount = 0, this.isCompleted = !1, this.percent = 0
        }
        getResource(e) {
            const t = Laya.URL.formatURL(e),
                s = this.resources.get(t),
                a = this.extname(e);
            if (!s) return console.warn(e + " is not find"), null;
            switch (a) {
                case ".lh":
                    return Laya.Sprite3D.instantiate(s);
                default:
                    return s
            }
        }
        clearResource(e) {
            const t = Laya.URL.formatURL(e);
            this.resources.delete(t)
        }
        push(e) {
            if (e)
                if ("string" == typeof e) this.resourcePromises.push(this.createAssetBundle(e));
                else if (e instanceof Array)
                for (const t of e) this.resourcePromises.push(this.createAssetBundle(t));
            else this.resourcePromises.push(e)
        }
        process(e) {
            return new Promise((t, s) =&gt; {
                this.push(e), Promise.all(this.resourcePromises).then(() =&gt; {
                    t(!0)
                })
            })
        }
        resourcesAsync() {
            return new Promise((e, t) =&gt; {
                this.resourceFiles = [], this.isCompleted = !1, this.percent = 0, Laya.loader.create("resources.json", Laya.Handler.create(this, t =&gt; __awaiter(this, void 0, void 0, function*() {
                    if (t) {
                        this.resourceFiles.push(...t.sounds), this.resourceFiles.push(...t.fonts), this.resourceFiles.push(...t.images), this.resourceFiles.push(...t.atlas), this.resourceFiles.push(...t.jsons), this.resourceFiles.push(...t.scenes), this.totalCount = this.resourceFiles.length;
                        for (const e of this.resourceFiles) {
                            const t = new Promise((t, s) =&gt; {
                                this.createAssetBundle(e).then(e =&gt; {
                                    this.completCount++, this.percent = Math.floor(this.completCount / this.totalCount * 100), t(!0)
                                })
                            });
                            this.resourcePromises.push(t)
                        }
                        Promise.all(this.resourcePromises).then(() =&gt; {
                            this.resourcePromises.length = 0, this.percent = 100, this.isCompleted = !0, e(!0)
                        })
                    } else console.log("æ²¡æ‰¾åˆ°èµ„æºé…ç½®æ–‡ä»¶ resources.json"), e(!0)
                })))
            })
        }
        createAssetBundle(e) {
            return new Promise((t, s) =&gt; {
                const a = Laya.URL.formatURL(e),
                    i = this.getResource(e);
                if (i) t(i);
                else {
                    const s = e =&gt; {
                        this.resources.set(a, e), t(this.getResource(a))
                    };
                    switch (this.extname(e)) {
                        case ".scene":
                            Laya.Scene.load(e, Laya.Handler.create(this, s));
                            break;
                        case ".ls":
                            Laya.Scene3D.load(e, Laya.Handler.create(this, s));
                            break;
                        default:
                            Laya.loader.create(e, Laya.Handler.create(this, s))
                    }
                }
            })
        }
        extname(e) {
            var t = /(\.[^\.\/\?\\]*)(\?.*)?$/.exec(e);
            return t ? t[1] : ""
        }
    };
    var v, b = new class {
        init() {
            this.timer3D = new Laya.Timer, this.backgroundRoot = new Laya.Image, this.sceneRoot = new Laya.Sprite, this.sceneRoot.name = "sceneRoot", this.dialogRoot = new Laya.Sprite, this.dialogRoot.name = "dialogRoot", this.dialogRoot.mouseThrough = !0, this.dialogMask = new Laya.Sprite, this.dialogMask.name = "dialogMask", this.dialogMask.zOrder = -1, this.dialogMask.mouseEnabled = !0, this.dialogMask.alpha = .8, this.loadingRoot = new Laya.Sprite, this.loadingRoot.name = "loadingRoot", this.loadingCount = 0, this.loadingMask = new Laya.Sprite, this.loadingMask.name = "loadingMask", this.loadingMask.alpha = .8, this.scene3DRoot = new Laya.Sprite, this.sceneRoot.name = "scene3DRoot", Laya.stage.addChild(this.backgroundRoot), Laya.stage.addChild(this.scene3DRoot), Laya.stage.addChild(this.sceneRoot), Laya.stage.addChild(this.dialogRoot), Laya.stage.addChild(this.loadingRoot), this.backgroundRoot.size(Laya.stage.width, Laya.stage.height), this.sceneRoot.size(Laya.stage.width, Laya.stage.height), this.dialogRoot.size(Laya.stage.width, Laya.stage.height), this.loadingRoot.size(Laya.stage.width, Laya.stage.height), this.dialogMask.size(Laya.stage.width, Laya.stage.height), this.background = new Laya.Image, this.background.left = this.background.right = this.background.top = this.background.bottom = 0, this.backgroundRoot.addChild(this.background), this.frontground = new Laya.Image, this.backgroundRoot.addChild(this.frontground), this.centerUi(this.frontground), this.loadingMask.graphics.clear(!0), this.loadingMask.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000"), this.dialogMask.graphics.clear(!0), this.dialogMask.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000"), this.dialogs = [], Laya.stage.on(Laya.Event.RESIZE, this, this.onStageResize), Laya.stage.offAllCaller(Laya.Dialog.manager), Laya.Dialog.manager.destroy(), Laya.Dialog.manager = null, Laya.Dialog.manager = this, this.setLoadingDialog(m.LoadingDialog)
        }
        onDialogMaskClick() {
            console.log("onDialogMaskClick", "onDialogMaskClick")
        }
        open(e, t) {
            return new Promise((s, a) =&gt; {
                this.showLoading(), w.createAssetBundle(e).then(e =&gt; {
                    e.param = t;
                    const a = this.findComponents(Laya.Script, e),
                        i = [];
                    if (a)
                        for (var o = 0, n = a.length; o &lt; n; o++) {
                            var r = a[o];
                            if (r.onBeforeAwake) {
                                const e = r.onBeforeAwake(t);
                                e instanceof Promise &amp;&amp; i.push(e)
                            }
                        }
                    Promise.all(i).then(() =&gt; {
                        if (e instanceof Laya.Dialog) this.openDialog(e, t);
                        else if (e instanceof Laya.Scene3D) {
                            const t = this.runingScene3D;
                            this.runingScene3D = e, this.runingScene3D.timer = this.timer3D, this.scene3DRoot.addChild(e), t &amp;&amp; (t.active = !1, this.clearUnDestroyedScenes(t))
                        } else {
                            const s = this.runingScene;
                            this.openScene(e, t), s &amp;&amp; (s.close(), this.clearUnDestroyedScenes(s))
                        }
                        this.hideLoading(), s(e)
                    })
                })
            })
        }
        showLoading(e = .3) {
            this.loadingMask.parent || (this.loadingRoot.mouseEnabled = !0, Laya.Tween.clearAll(this.loadingMask), Laya.Tween.to(this.loadingMask, {
                alpha: .8
            }, 200, null, null, 1e3 * e), this.loadingRoot.addChild(this.loadingMask))
        }
        hideLoading() {
            Laya.Tween.clearAll(this.loadingMask), this.loadingMask.alpha = 0, this.loadingMask.removeSelf(), this.loadingRoot.mouseEnabled = !1
        }
        setLoadingDialog(e) {
            new Promise(t =&gt; {
                Laya.Scene.load(e, Laya.Handler.create(this, t))
            }).then(e =&gt; {
                e.width = Laya.stage.width, e.height = Laya.stage.height, this.loadingDialog = e, this.loadingMask.addChild(e)
            })
        }
        closeAllDialogs() {
            for (var e = this.dialogs.length - 1; e &gt; -1; --e) this.close(this.dialogs[e])
        }
        closeDialog(e) {
            for (var t = this.dialogs.length - 1; t &gt; -1; --t) this.dialogs[t].url === e &amp;&amp; this.close(this.dialogs[t])
        }
        openScene(e, t) {
            this.frontground.width = e.width, this.frontground.height = e.height, this.centerUi(e), this.centerUi(this.frontground), this.sceneRoot.addChild(e), e.onOpened(t), this.runingScene = e
        }
        openDialog(e, t) {
            this.centerUi(e);
            for (let e = 0; e &lt; this.dialogs.length; e++) this.dialogs[e].zOrder = e;
            this.dialogs.push(e), e.isModal &amp;&amp; (e.addChild(this.dialogMask), this.dialogRoot.addChild(this.dialogMask)), this.dialogRoot.addChild(e), e.isShowEffect &amp;&amp; (Laya.Tween.clearAll(e), Laya.Tween.from(e, {
                x: Laya.stage.width / 2,
                y: Laya.stage.height / 2,
                scaleX: 0,
                scaleY: 0
            }, 300, Laya.Ease.strongOut)), e.onOpened(t)
        }
        clearUnDestroyedScenes(e) {
            for (var t = Laya.Scene.unDestroyedScenes, s = t.length - 1; s &gt; -1; s--) t[s] === e &amp;&amp; t.splice(s, 1);
            w.clearResource(e.url), e.removeSelf(), e.destroy()
        }
        centerUi(e) {
            e &amp;&amp; (e.x = Math.round((Laya.stage.width - e.width &gt;&gt; 1) + e.pivotX), e.y = Math.round((Laya.stage.height - e.height &gt;&gt; 1) + e.pivotY))
        }
        close(e) {
            const t = this.dialogs.indexOf(e);
            if (t &gt; -1) {
                this.dialogs.splice(t, 1), this.dialogMask.removeSelf();
                for (let e = this.dialogs.length; e &lt; this.dialogs.length; e++) this.dialogs[e].isModal &amp;&amp; this.dialogs[e].addChild(this.dialogMask);
                Laya.Tween.clearAll(e), e.removeSelf(), e.onClosed(e.closeType), this.clearUnDestroyedScenes(e)
            }
        }
        onStageResize() {
            this.backgroundRoot.size(Laya.stage.width, Laya.stage.height), this.sceneRoot.size(Laya.stage.width, Laya.stage.height), this.dialogRoot.size(Laya.stage.width, Laya.stage.height), this.loadingRoot.size(Laya.stage.width, Laya.stage.height), this.dialogMask.size(Laya.stage.width, Laya.stage.height);
            for (const e of this.dialogs) this.centerUi(e);
            this.centerUi(this.runingScene), this.centerUi(this.frontground), this.centerUi(this.loadingDialog), this.dialogMask.graphics.clear(!0), this.dialogMask.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000"), this.loadingMask.graphics.clear(!0), this.loadingMask.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000")
        }
        find(e) {}
        findComponents(e, t, s) {
            if (void 0 === e) return [];
            if (!t) return [];
            s || (s = []);
            var a = t._components;
            if (a)
                for (var i = 0; i &lt; a.length; i++) {
                    const t = a[i];
                    t instanceof e &amp;&amp; s.push(t)
                }
            for (var o = t._children, n = 0, r = o.length; n &lt; r; ++n) {
                var h = o[n];
                this.findComponents(e, h, s)
            }
            return s
        }
        _checkMask() {}
        extname(e) {
            var t = /(\.[^\.\/\?\\]*)(\?.*)?$/.exec(e);
            return t ? t[1] : ""
        }
    };
    ! function(e) {
        class t {
            constructor() {}
        }
        t.tableData = [], e.TableTool = t
    }(v || (v = {}));
    var L, C, _ = v.TableTool;
    class D {
        static shuffle(e) {
            for (let t = 0, s = e.length; t &lt; s; t++) {
                const s = Math.floor(Math.random() * (t + 1)),
                    a = e[s];
                e[s] = e[t], e[t] = a
            }
            return e
        }
        static random(e, t) {
            return Math.floor(Math.random() * (t - e)) + e
        }
        static randomByWeights(e) {
            var t = 0;
            for (const s of e) t += s.weights;
            for (var s = this.random(1, t), a = 0; t &gt; 0;) {
                if ((t -= e[a].weights) &lt; s) return a;
                a++
            }
            return null
        }
        static secondsTommss(e) {
            let t = Math.floor(e / 60).toString(),
                s = Math.floor(e % 60).toString();
            return s.length &lt; 2 &amp;&amp; (s = "0" + s), t.length &lt; 2 &amp;&amp; (t = "0" + t), t + ":" + s
        }
        static timestampToddhhmmss(e) {
            const t = e % 864e5,
                s = t % 36e5,
                a = s % 6e4;
            return {
                dd: Math.floor(e / 864e5),
                hh: Math.floor(t / 36e5),
                mm: Math.floor(s / 6e4),
                ss: Math.round(a / 1e3)
            }
        }
        static degressToRadians(e) {
            return e * Math.PI / 180
        }
        static radiansToDegress(e) {
            return 180 * e / Math.PI
        }
        static mathsDegrees(e) {
            0 === e.x &amp;&amp; (e.x = 1.192092896e-7);
            let t = Math.atan(e.y / e.x);
            return t = this.radiansToDegress(t), e.x &lt; 0 &amp;&amp; (t += 180), e.x &gt; 0 &amp;&amp; e.y &lt; 0 &amp;&amp; (t += 360), t
        }
        static clampf(e, t, s) {
            if (t &gt; s) {
                var a = t;
                t = s, s = a
            }
            return e &lt; t ? t : e &lt; s ? e : s
        }
        static lerp(e, t, s) {
            return e * (1 - s) + t * s
        }
        static rgbToHexColor(e, t, s) {
            return "#" + ((1 &lt;&lt; 24) + (e &lt;&lt; 16) + (t &lt;&lt; 8) + s).toString(16).slice(1)
        }
        static readFile(e) {
            return __awaiter(this, void 0, void 0, function*() {
                return new Promise((t, s) =&gt; {
                    var a = Laya.loader.getRes(e);
                    a ? t(a) : Laya.loader.create(e, Laya.Handler.create(this, t))
                })
            })
        }
        static createPrefab(e) {
            return __awaiter(this, void 0, void 0, function*() {
                const t = e.create();
                yield function(e) {
                    return new Promise((t, s) =&gt; {
                        console.log("sprite._getBit(Laya.Const.NOT_READY)", e._getBit(Laya.Const.NOT_READY)), e._getBit(Laya.Const.NOT_READY) ? e.on("onViewCreated", this, function() {
                            console.log("onViewCreated"), t(e)
                        }) : t(e)
                    })
                }(t);
                for (var s = t.numChildren - 1; s &gt; -1; s--) {
                    var a = t.getChildAt(s);
                    if (a instanceof Laya.Skeleton) {
                        if (a.player) continue;
                        yield new Promise((e, t) =&gt; {
                            a.on(Laya.Event.PLAYED, this, e)
                        })
                    }
                }
                return t
            })
        }
        static clipboard(e) {
            var t = document.createElement("textarea");
            t.value = e, document.body.appendChild(t), t.select();
            let s = document.execCommand("copy");
            return document.body.removeChild(t), s
        }
        static tweenBezier(e, t, s, a, i) {
            const o = e.x,
                n = e.y,
                r = {
                    x: 0,
                    y: 0
                };
            var h;
            r.x = e.x + (t.x - e.x) / 2, r.y = e.y + (t.y - e.y) / 2 - 100;
            const l = new Laya.Handler(e, function() {
                const s = D.clampf(h._usedTimer / h._duration, 0, 1),
                    a = (1 - s) * (1 - s) * o + 2 * s * (1 - s) * r.x + s * s * t.x,
                    i = (1 - s) * (1 - s) * n + 2 * s * (1 - s) * r.y + s * s * t.y;
                e.x = a, e.y = i
            });
            h = Laya.Tween.to(e, {
                update: l
            }, s, a, Laya.Handler.create(this, () =&gt; {
                l.recover(), i &amp;&amp; i.run()
            }))
        }
        static rotationEuler(e, t, s, a) {
            const i = Math.PI / 180;
            var o = .5 * s * i,
                n = .5 * e * i,
                r = .5 * t * i,
                h = Math.sin(o),
                l = Math.cos(o),
                c = Math.sin(n),
                d = Math.cos(n),
                u = Math.sin(r),
                g = Math.cos(r);
            return a || (a = new Laya.Quaternion), a.x = g * d * h - u * c * l, a.y = g * d * l + u * c * h, a.z = g * c * l + u * d * h, a.w = u * d * l - g * c * h, a
        }
        static creatShape(e) {
            var t;
            switch (e.type) {
                case "BoxColliderShape":
                    var s = e.size;
                    t = s ? new Laya.BoxColliderShape(s[0], s[1], s[2]) : new Laya.BoxColliderShape;
                    break;
                case "SphereColliderShape":
                    t = new Laya.SphereColliderShape(e.radius);
                    break;
                case "CapsuleColliderShape":
                    t = new Laya.CapsuleColliderShape(e.radius, e.height, e.orientation);
                    break;
                case "MeshColliderShape":
                    var a = new Laya.MeshColliderShape;
                    e.mesh &amp;&amp; (a.mesh = Laya.Loader.getRes(e.mesh)), t = a;
                    break;
                case "ConeColliderShape":
                    t = new Laya.ConeColliderShape(e.radius, e.height, e.orientation);
                    break;
                case "CylinderColliderShape":
                    t = new Laya.CylinderColliderShape(e.radius, e.height, e.orientation);
                    break;
                default:
                    throw "unknown shape type."
            }
            if (e.center) {
                var i = t.localOffset;
                i.fromArray(e.center), t.localOffset = i
            }
            return t
        }
    }
    class E extends e {
        onBeforeAwake() {
            return w.process(["configs/cars_config.json"])
        }
        onAwake() {
            this.lab_cost = this.btn_unlock.getChildByName("lab_cost")
        }
        onEnable() {
            const e = b.runingScene3D,
                t = this.find("Main Camera", e),
                s = t.getComponent(Laya.Animator),
                a = t.transform.localRotation;
            s.speed = 0, D.rotationEuler(.452, 37.36, 0, a), t.transform.localRotationX, Laya.Tween.to(t.transform, {
                localPositionX: .491,
                localPositionY: .09,
                localPositionZ: -.698,
                localRotationX: a.x,
                localRotationY: a.y,
                localRotationZ: a.z,
                localRotationW: a.w
            }, 500), this.listCar.renderHandler = Laya.Handler.create(this, this.listCarItem, null, !1), this.cars_config = Laya.loader.getRes("configs/cars_config.json"), this.refreshData(), this.btnBack.on(Laya.Event.CLICK, this, this.onbtnBack), this.btn_unlock.on(Laya.Event.CLICK, this, this.unlockCar), this.btn_use.on(Laya.Event.CLICK, this, this.unUse), Laya.Tween.from(this.owner, {
                y: this.owner.y + 200
            }, 200)
        }
        unUse() {
            let e = _.tableData[this.listCar.selectedIndex];
            h.myCarData.useCar = e.id, h.saveCarData(), this.btn_use.visible = this.btn_unlock.visible = !1, this.listCar.refresh()
        }
        onDisable() {
            super.onDisable()
        }
        unlockCar() {
            let e = _.tableData[this.listCar.selectedIndex];
            h.coin.value &lt; e.coin ? b.open(m.GetItemDialog, {
                type: 1
            }) : (h.coin.value -= e.coin, h.myCarData.myCars.push(e.id), h.saveCarData(), this.btn_use.visible = !0, this.btn_unlock.visible = !1, this.listCar.refresh())
        }
        refreshData() {
            this.listCar.array = _.tableData, this.listCar.selectEnable = !0, this.listCar.selectHandler = Laya.Handler.create(this, this.selectItem, null, !1), Laya.timer.frameOnce(2, this, this.selectOneItem)
        }
        selectOneItem() {
            this.listCar.selectedIndex = -1;
            let e = 0;
            for (let t = 0; t &lt; _.tableData.length; t++)
                if (_.tableData[t].id == h.myCarData.useCar) {
                    e = t;
                    break
                }
            this.listCar.selectedIndex = e, this.listCar.scrollTo(e)
        }
        selectItem(e) {
            if (-1 == e) return;
            this.lab_cost.text = _.tableData[e].coin, h.myCarData.useCar == _.tableData[e].id ? this.btn_use.visible = this.btn_unlock.visible = !1 : h.myCarData.myCars.indexOf(_.tableData[e].id) &gt; -1 ? (this.btn_use.visible = !0, this.btn_unlock.visible = !1) : (this.btn_use.visible = !1, this.btn_unlock.visible = !0);
            let t = h.getUserUseCar(_.tableData[e].id);
            Laya.stage.event("changeCar", [t])
        }
        listCarItem(e, t) {
            let s = e.getChildByName("background"),
                a = e.getChildByName("icon"),
                i = e.getChildByName("unlock"),
                o = e.getChildByName("isUsing"),
                n = e.dataSource.id;
            s.skin = "icons/unlock.png";
            let r = h.getUserUseCar(n);
            o.visible = i.visible = !1, a.skin = "carIcon/car_" + r + ".png", h.myCarData.useCar == n ? o.visible = !0 : h.myCarData.myCars.indexOf(n) &gt; -1 || (i.visible = !0, s.skin = "icons/lock.png")
        }
        onbtnBack() {
            Laya.timer.clearAll(this);
            let e = h.getUserUseCar();
            Laya.stage.event("changeCar", [e]), b.open(m.HomeDialog), this.owner.close()
        }
    }
    __decorate([f.Property()], E.prototype, "listCar", void 0), __decorate([f.Property()], E.prototype, "btnBack", void 0), __decorate([f.Property()], E.prototype, "btn_use", void 0), __decorate([f.Property()], E.prototype, "btn_unlock", void 0),
        function(e) {
            e.bgm = "sounds/bgm.mp3", e.BUTTON = ""
        }(L || (L = {}));
    class A extends Laya.Script {
        constructor() {
            super(...arguments), this.canSound = !0, this.soundPath = L.BUTTON, this.scaleX = 1, this.scaleY = 1, this.scale = .95
        }
        onAwake() {
            this.scaleX = this.owner.scaleX, this.scaleY = this.owner.scaleY
        }
        onEnable() {
            Laya.Tween.from(this.owner, {
                scaleX: 0,
                scaleY: 0
            }, 400, Laya.Ease.backOut)
        }
        onMouseDown() {
            this._onPressed()
        }
        onMouseOut() {
            this._onLeaved()
        }
        onMouseUp() {
            this._onLeaved()
        }
        _onPressed() {
            this.canSound &amp;&amp; d.playSound(this.soundPath), this.owner.scale(this.scaleX * this.scale, this.scaleY * this.scale)
        }
        _onLeaved() {
            this.owner.scale(this.scaleX, this.scaleY)
        }
    }
    class S extends e {
        constructor() {
            super()
        }
        onAwake() {
            super.onAwake(), this.btn_close = this.owner.getChildByName("btn_close"), this.lab_getTips = this.owner.getChildByName("lab_getTips"), this.btn_getItem = this.owner.getChildByName("btn_getItem"), this.btn_close.on(Laya.Event.CLICK, this, this.closeOwner)
        }
        closeOwner() {
            this.owner.close()
        }
        onEnable() {
            super.onEnable(), this.refreshUI()
        }
        refreshUI() {
            0 == this.owner.param.type ? (this.lab_getTips.text = "Pow +2", this.btn_getItem.on(Laya.Event.CLICK, this, this.getTL)) : 1 == this.owner.param.type &amp;&amp; (this.lab_getTips.text = "Coin +500", this.btn_getItem.on(Laya.Event.CLICK, this, this.getCoin))
        }
        getTL() {
            y.showReward().then(e =&gt; {
                e &amp;&amp; (h.energy.value += 2, h.save(), this.owner.close())
            })
        }
        getCoin() {
            y.showReward().then(e =&gt; {
                e &amp;&amp; (h.coin.value += 500, h.save(), this.owner.close())
            })
        }
        onDisable() {}
    }
    class T extends e {
        onAwake() {
            this.lab_level = this.owner.getChildByName("lab_level")
        }
        onEnable() {
            super.onEnable();
            const e = b.runingScene3D,
                t = this.find("Main Camera", e),
                s = t.getComponent(Laya.Animator),
                a = t.transform.localRotation;
            D.rotationEuler(-.41, 36.89, 0, a), 0 == s.speed &amp;&amp; Laya.Tween.to(t.transform, {
                localPositionX: .532,
                localPositionY: .161,
                localPositionZ: -.888,
                localRotationX: a.x,
                localRotationY: a.y,
                localRotationZ: a.z,
                localRotationW: a.w
            }, 500, null, Laya.Handler.create(this, () =&gt; {
                s.speed = 1, s.play("camera", 0, 0)
            })), this.lab_level.text = "Level " + h.level.value, this.btnStart.on(Laya.Event.CLICK, this, this.onbtnStart), this.btnLevels.on(Laya.Event.CLICK, this, this.onbtnLevels), this.btnGarage.on(Laya.Event.CLICK, this, this.onbtnGarage)
        }
        onDisable() {
            super.onDisable(), h.save()
        }
        onbtnStart() {
            h.energy.value &lt;= 0 ? b.open(m.EnergyRewardDialog, {
                handlerFun: Laya.Handler.create(this, () =&gt; {
                    h.energy.value--, h.save(), b.open(m.GameScene), this.owner.close()
                })
            }) : y.showInterstitial().then(() =&gt; {
                h.energy.value--, h.save(), b.open(m.GameScene), this.owner.close()
            })
        }
        onbtnLevels() {
            b.open(m.LevelsDialog)
        }
        onbtnGarage() {
            b.open(m.GarageDialog), this.owner.close()
        }
    }
    __decorate([f.Property("btnStart")], T.prototype, "btnStart", void 0), __decorate([f.Property("btnLevels")], T.prototype, "btnLevels", void 0), __decorate([f.Property("btnGarage")], T.prototype, "btnGarage", void 0);
    class M extends e {
        constructor() {
            super(...arguments), this.listIndex = 0
        }
        onBeforeAwake() {
            return w.process(["configs/levels_config.json"])
        }
        onAwake() {
            this.list.selectEnable = !1, this.list.renderHandler = new Laya.Handler(this, this.onList2Render)
        }
        onEnable() {
            var e = new Array(30),
                t = [],
                s = [];
            for (let a = 0; a &lt; e.length; a++) a % 10 == 0 &amp;&amp; (s = [], t.push(s)), s.push({
                level: a + 1
            });
            this.list.array = t, this.list.hScrollBarSkin = "", this.list.scrollBar.touchScrollEnable = !1, this.btnClose.on(Laya.Event.CLICK, this, this.onbtnClose), this.btnFront.on(Laya.Event.CLICK, this, this.onbtnFront), this.btnBack.on(Laya.Event.CLICK, this, this.onbtnBack), this.levels_config = Laya.loader.getRes("configs/levels_config.json"), Laya.timer.callLater(this, () =&gt; {
                this.listIndex = parseInt("" + (h.level.value - 1) / 10), this.list.scrollTo(this.listIndex)
            })
        }
        onDisable() {
            super.onDisable(), Laya.timer.clearAll(this)
        }
        onList2Render(e, t) {
            const s = e.getChildByName("list2");
            s.array = this.list.array[t], s.selectEnable = !0, s.renderHandler = new Laya.Handler(this, this.onList3Render), s.selectHandler = new Laya.Handler(this, this.onLevelSelected)
        }
        onList3Render(e, t) {
            e.getChildByName("level").text = "" + e.dataSource.level, e.dataSource.level &gt; h.level.value ? e.disabled = !0 : e.disabled = !1
        }
        onLevelSelected(e) {
            let t = this.list.array[this.listIndex][e].level;
            if (h.energy.value &lt;= 0) return this.owner.close(), void b.open(m.EnergyRewardDialog, {
                handlerFun: Laya.Handler.create(this, () =&gt; {
                    h.energy.value--, h.save(), b.closeAllDialogs(), b.open(m.GameScene, {
                        level: t
                    })
                })
            });
            this.levels_config.map(function(e) {
                e.id - 1999 === t &amp;&amp; console.log(e.name)
            }), y.showInterstitial().then(() =&gt; {
                h.energy.value--, h.save(), b.closeAllDialogs(), b.open(m.GameScene, {
                    level: t
                })
            })
        }
        onbtnClose() {
            this.owner.close()
        }
        onbtnFront() {
            this.listIndex++, this.listIndex = Math.min(this.listIndex, this.list.array.length - 1), this.list.tweenTo(this.listIndex, 200)
        }
        onbtnBack() {
            this.listIndex--, this.listIndex = Math.max(0, this.listIndex), this.list.tweenTo(this.listIndex, 200)
        }
    }
    __decorate([f.Property()], M.prototype, "list", void 0), __decorate([f.Property()], M.prototype, "list2", void 0), __decorate([f.Property()], M.prototype, "btnBack", void 0), __decorate([f.Property()], M.prototype, "btnFront", void 0), __decorate([f.Property()], M.prototype, "btnClose", void 0);
    class R extends e {
        constructor() {
            super(...arguments), this.resolve = null, this.reject = null
        }
        onEnable() {
            super.onEnable(), window.carLogo.visible = !1, this.btnRevive.on(Laya.Event.CLICK, this, this.onbtnRevive), this.btnGiveup.on(Laya.Event.CLICK, this, this.onbtnGiveup)
        }
        onDisable() {
            super.onDisable(), window.carLogo.visible = !0, h.save()
        }
        onbtnRevive() {
            y.showReward().then(e =&gt; {
                e &amp;&amp; this.onbtnClose(!0)
            })
        }
        onbtnGiveup() {
            this.owner.close(), b.timer3D.resume(), b.open(m.HomeScene)
        }
        onbtnClose(e) {
            this.resolve &amp;&amp; this.resolve(e), this.resolve = null, this.reject = null, this.owner.close()
        }
        result() {
            return new Promise((e, t) =&gt; {
                this.resolve = e, this.reject = t
            })
        }
    }
    __decorate([f.Property()], R.prototype, "btnRevive", void 0), __decorate([f.Property()], R.prototype, "btnGiveup", void 0),
        function(e) {
            e.COIN = "carma_coin", e.MAINCAR = "car_main", e.WIN = "finish", e.OBSTACLE = "key_obstruct_", e.SAVEPOS = "save_box"
        }(C || (C = {}));
    class k extends Laya.Script3D {
        constructor() {
            super(...arguments), this.awaits_ = []
        }
        onDisable() {
            for (const e of this.awaits_) e();
            this.awaits_ = []
        }
        find(e, t) {
            if (null == e) return null;
            t || (t = this.owner);
            for (var s = t, a = "/" !== e[0] ? 0 : 1, i = e.split("/"), o = a; o &lt; i.length; o++) {
                var n = i[o],
                    r = s._children;
                s = null;
                for (var h = 0, l = r.length; h &lt; l; ++h) {
                    var c = r[h];
                    if (c.name === n) {
                        s = c;
                        break
                    }
                }
                if (!s) return null
            }
            return s
        }
        findComponents(e, t, s) {
            if (void 0 === e) return [];
            t || (t = this.owner), s || (s = []);
            var a = t._components;
            if (a)
                for (var i = 0; i &lt; a.length; i++) {
                    const t = a[i];
                    t instanceof e &amp;&amp; s.push(t)
                }
            for (var o = t._children, n = 0, r = o.length; n &lt; r; ++n) {
                var h = o[n];
                this.findComponents(e, h, s)
            }
            return s
        }
    }
    class x extends k {
        onAwake() {
            this.owner.name = C.MAINCAR
        }
        onEnable() {}
        onCollisionEnter(e) {
            this.collisionEnterHandler &amp;&amp; this.collisionEnterHandler.runWith(e)
        }
        onTriggerEnter(e) {
            this.triggerEnter &amp;&amp; this.triggerEnter.runWith(e)
        }
    }
    class I extends k {
        constructor() {
            super(...arguments), this.rotate = new Laya.Vector3(.05, 0, 0)
        }
        onAwake() {
            this.owner.name = C.COIN
        }
        onEnable() {
            b.timer3D.frameLoop(1, this, this.onGameUpdate)
        }
        onDisable() {
            super.onDisable(), b.timer3D.clearAll(this)
        }
        onGameUpdate() {
            this.owner.transform.rotate(this.rotate)
        }
        initData(e) {}
        onTriggerEnter(e) {
            e.owner.name === C.MAINCAR &amp;&amp; this.onCollect()
        }
        onCollect() {
            this.owner.active = !1
        }
    }
    var P, N = new class extends e {
        init() {
            this.timer = new Laya.Timer
        }
    };
    class O extends k {
        setAnimator() {
            for (const e of this._animators) {
                if (!e) return;
                e.speed = 0;
                const t = e.getControllerLayer();
                if (!t) return;
                t.getAnimatorState("CINEMA_4D___").clip.islooping = !1, e.on(Laya.Event.COMPLETE, this, () =&gt; {
                    Laya.timer.once(this._iDua, this, () =&gt; {
                        e.play(null, 0, 0), e.speed = this._iSpeed / 100
                    })
                }), Laya.timer.once(this._iAwakeup, this, () =&gt; {
                    e.play(null, 0, 0), e.speed = this._iSpeed / 100
                })
            }
        }
        activityFalse() {
            this.fire.getComponent(Laya.PhysicsCollider).enabled = !1, Laya.timer.once(this._iSpeed, this, () =&gt; {
                this.fire.getComponent(Laya.PhysicsCollider).enabled = !1, this.fire.active = !1, this.activityTrue()
            })
        }
        activityTrue() {
            this.fire.getComponent(Laya.PhysicsCollider).enabled = !1, Laya.timer.once(this._iDua, this, () =&gt; {
                this.fire.getComponent(Laya.PhysicsCollider).enabled = !1, this.fire.active = !0, Laya.timer.once(800, this, () =&gt; {
                    this.fire.getComponent(Laya.PhysicsCollider).enabled = !0
                }), this.activityFalse()
            })
        }
        onAwake() {
            const e = this.owner.name.split("_").slice(3, 6);
            if (this._iSpeed = e[0] &amp;&amp; parseFloat(e[0]) ? parseFloat(e[0]) : 0, this._iAwakeup = e[1] &amp;&amp; parseFloat(e[1]) ? parseFloat(e[1]) : 0, this._iDua = e[2] &amp;&amp; parseFloat(e[2]) ? parseFloat(e[2]) : 0, console.log("åŠ¨ç”»ï¼š" + this.owner.name), -1 == this.owner.name.indexOf("key_obstruct_1010")) {
                console.log("åŠ¨ç”»é€Ÿåº¦ï¼š" + this._iSpeed + "åŠ¨ç”»é—´éš”ï¼š" + this._iDua + "å”¤é†’æ—¶é—´ï¼š" + this._iAwakeup);
                const e = this.findComponents(Laya.Animator);
                if (this._animators = [], e &amp;&amp; e.length) {
                    for (const t of e) this._animators.push(t);
                    this.setAnimator()
                }
            } else console.log("ç²’å­é€Ÿåº¦ï¼š" + this._iSpeed + "ç²’å­é—´éš”ï¼š" + this._iDua + "ç²’å­æ—¶é—´ï¼š" + this._iAwakeup), this.fire = this.owner.getChildByName("Fire"), this.fire &amp;&amp; (this.fire.active = !1, Laya.timer.once(this._iAwakeup, this, () =&gt; {
                this.activityTrue()
            }));
            this.owner.name = C.OBSTACLE
        }
        aniComplete() {}
        onEnable() {
            N.timer.frameLoop(1, this, this.onGameUpdate)
        }
        onDisable() {
            super.onDisable(), Laya.timer.clearAll(this), N.timer.clearAll(this)
        }
        onGameUpdate() {}
        initData(e) {}
        onTriggerEnter(e) {
            e.owner.name
        }
        onCollect() {}
    }! function(e) {
        e[e.None = 0] = "None", e[e.Left = 1] = "Left", e[e.Right = 2] = "Right"
    }(P || (P = {}));
    class U extends e {
        constructor() {
            super(...arguments), this.changeVec = new Laya.Vector3(0, 0, 0), this.gameEnd = !1, this.startLocal = new Laya.Vector3(0, 0, 0), this.startRotati = new Laya.Vector3(0, 0, 0), this.cameroPos = new Laya.Vector3(0, 3, -5.5), this.carAndSideRo = new Laya.Vector3(0, 0, 0), this.obj = {}, this.keyCodeArr = [], this.speedChangeNum = .02
        }
        onAwake() {
            this.lab_level = this.owner.getChildByName("lab_level")
        }
        onBeforeAwake() {
            U.coinNum = 0, this.owner.param &amp;&amp; this.owner.param.level ? U.levelNum = this.owner.param.level : U.levelNum = h.level.value;
            let e = "" + U.levelNum;
            return U.levelNum &lt; 10 &amp;&amp; (e = "0" + U.levelNum), w.process(["LayaScene_game/Conventional/game.ls", "LayaScene_cars/Conventional/car_001.lh", "LayaScene_levels/Conventional/level" + e + ".lh"])
        }
        clearData() {
            this.forward = new Laya.Vector3(0, 0, 0), this.keyCodeArr = [], this.wheelTurnType = P.None, this.isBrake = this.isAccelerate = !1
        }
        onEnable() {
            b.open("LayaScene_game/Conventional/game.ls").then(() =&gt; {
                this.upVector = new Laya.Vector3(0, 1, 0), this.lookAtVector = new Laya.Vector3, this.wheelRotate = new Laya.Vector3, this.cameraPosition = new Laya.Vector3, this.forward = new Laya.Vector3, this.maxMoveSpeed = .15, this.accelerateRatio = .01, this.brakeRatio = .02, this.wheelAngle = 0, this.cellWheelAngle = 35;
                const e = b.runingScene3D;
                this.find("Light_main", e).shadowMode = Laya.ShadowMode.Hard;
                let t = "" + U.levelNum;
                U.levelNum &lt; 10 &amp;&amp; (t = "0" + U.levelNum), this.lab_level.text = "Level " + U.levelNum, this.levelScene = null;
                const s = w.getResource("LayaScene_levels/Conventional/level" + t + ".lh");
                this.levelScene = s;
                const a = this.find("bornPosition", s);
                this.currentSave = a;
                let i = h.getUserUseCar();
                this.car = w.getResource("LayaScene_cars/Conventional/car_" + i + ".lh"), this.carMain = this.find("car_main", this.car), this.camera = this.find("Main Camera", e), this.cameraTransform = this.camera.transform, this.carTransform = this.car.transform, this.carMain.transform.localPosition.cloneTo(this.startLocal), this.carMain.transform.localRotation.cloneTo(this.startRotati), this.obj.rotate = this.carMain.transform.localRotation.clone(), this.obj.position = this.carMain.transform.localPosition.clone(), this.changeVec.x = this.carTransform.position.x - this.cameraTransform.position.x, this.changeVec.y = this.carTransform.position.y - this.cameraTransform.position.y, this.changeVec.z = this.carTransform.position.z - this.cameraTransform.position.z, this.carComponent = this.carMain.addComponent(x), this.carComponent.triggerEnter = new Laya.Handler(this, this.onCarTriggerEnter), this.carComponent.collisionEnterHandler = new Laya.Handler(this, this.isCollisionEnter), this.cameraTransform.position = new Laya.Vector3(this.cameroPos.x + this.car.transform.position.x, this.car.transform.position.y + this.cameroPos.y, this.car.transform.position.z + this.cameroPos.z), this.carMain.addChild(this.camera), this.cameraTransform.position = this.cameroPos, this.cameraTransform.localPosition.cloneTo(this.cameroPos), this.cameraTransform.lookAt(new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y + 1, this.car.transform.position.z), this.upVector), this.frontWheelLeft = this.find("front_wheel_left", this.carMain), this.frontWheelRight = this.find("front_wheel_right", this.carMain), this.wheels = [this.find("wheel", this.frontWheelLeft), this.find("wheel", this.frontWheelRight), this.find("rear_wheel_left", this.carMain), this.find("rear_wheel_right", this.carMain)];
                const o = this.match(C.COIN, s);
                for (const e of o) {
                    e.addComponent(I).initData({})
                }
                const n = this.match(C.OBSTACLE, s);
                console.log("obstacle", n);
                for (const e of n) {
                    e.addComponent(O).initData({})
                }
                const r = this.match(C.SAVEPOS, s);
                for (const e of r) e.name = C.SAVEPOS;
                a.transform.localPosition.y += .02, this.carTransform.localPosition = a.transform.localPosition, this.carTransform.position.cloneTo(this.lookAtVector), s.addChild(this.car), e.addChild(s), Laya.stage.on(Laya.Event.KEY_DOWN, this, this.onKeybordDown), Laya.stage.on(Laya.Event.KEY_UP, this, this.onKeybordUp), b.timer3D.frameLoop(1, this, this.onGameUpdate), this.btnTurnLeft = this.owner.getChildByName("btnTurnLeft"), this.btnTurnRight = this.owner.getChildByName("btnTurnRight"), this.button_brake = this.owner.getChildByName("button_brake"), this.btnAccelerate = this.owner.getChildByName("btnAccelerate"), this.button_pause = this.owner.getChildByName("button_pause"), this.btnTurnLeft.on(Laya.Event.MOUSE_DOWN, this, this.onKeybordDown, [{
                    keyCode: Laya.Keyboard.LEFT
                }]), this.btnTurnRight.on(Laya.Event.MOUSE_DOWN, this, this.onKeybordDown, [{
                    keyCode: Laya.Keyboard.RIGHT
                }]), this.button_brake.on(Laya.Event.MOUSE_DOWN, this, this.onKeybordDown, [{
                    keyCode: Laya.Keyboard.DOWN
                }]), this.btnAccelerate.on(Laya.Event.MOUSE_DOWN, this, this.onKeybordDown, [{
                    keyCode: Laya.Keyboard.UP
                }]), this.button_pause.on(Laya.Event.MOUSE_DOWN, this, this.pauseGame), this.btnTurnLeft.on(Laya.Event.MOUSE_UP, this, this.onKeybordUp, [{
                    keyCode: Laya.Keyboard.LEFT
                }]), this.btnTurnRight.on(Laya.Event.MOUSE_UP, this, this.onKeybordUp, [{
                    keyCode: Laya.Keyboard.RIGHT
                }]), this.button_brake.on(Laya.Event.MOUSE_UP, this, this.onKeybordUp, [{
                    keyCode: Laya.Keyboard.DOWN
                }]), this.btnAccelerate.on(Laya.Event.MOUSE_UP, this, this.onKeybordUp, [{
                    keyCode: Laya.Keyboard.UP
                }]), this.btnTurnLeft.on(Laya.Event.MOUSE_OUT, this, this.onKeybordUp, [{
                    keyCode: Laya.Keyboard.LEFT
                }]), this.btnTurnRight.on(Laya.Event.MOUSE_OUT, this, this.onKeybordUp, [{
                    keyCode: Laya.Keyboard.RIGHT
                }]), this.button_brake.on(Laya.Event.MOUSE_OUT, this, this.onKeybordUp, [{
                    keyCode: Laya.Keyboard.DOWN
                }]), this.btnAccelerate.on(Laya.Event.MOUSE_OUT, this, this.onKeybordUp, [{
                    keyCode: Laya.Keyboard.UP
                }]), this.button_pause.skin = "buttons/button_pause.png"
            })
        }
        onRevive() {
            this.gameEnd = !1, this.levelScene.removeChild(this.car), Laya.stage.on(Laya.Event.KEY_DOWN, this, this.onKeybordDown), Laya.stage.on(Laya.Event.KEY_UP, this, this.onKeybordUp), this.clearData(), Laya.timer.callLater(this, () =&gt; {
                this.carMain.getComponent(Laya.Rigidbody3D).clearForces(), this.carTransform.position = this.currentSave.transform.position
            }), this.carMain.transform.localRotation = this.obj.rotate, this.carMain.transform.localPosition = this.obj.position, this.carTransform.rotation = this.currentSave.transform.rotation, this.levelScene.addChild(this.car), b.timer3D.resume()
        }
        pauseGame() {
            b.timer3D.scale ? b.timer3D.pause() : b.timer3D.resume(), this.button_pause.skin = b.timer3D.scale ? "buttons/button_pause.png" : "buttons/button_play.png"
        }
        onKeybordDown(e) {
            switch (e.keyCode) {
                case Laya.Keyboard.DOWN:
                    -1 == this.keyCodeArr.indexOf(Laya.Keyboard.DOWN) &amp;&amp; this.keyCodeArr.push(Laya.Keyboard.DOWN);
                    break;
                case Laya.Keyboard.UP:
                    -1 == this.keyCodeArr.indexOf(Laya.Keyboard.UP) &amp;&amp; this.keyCodeArr.push(Laya.Keyboard.UP);
                    break;
                case Laya.Keyboard.RIGHT:
                    this.wheelTurnType = P.Right;
                    break;
                case Laya.Keyboard.LEFT:
                    this.wheelTurnType = P.Left
            }
            if (this.keyCodeArr.length) {
                let e = this.keyCodeArr[this.keyCodeArr.length - 1];
                e == Laya.Keyboard.DOWN &amp;&amp; (this.isBrake, this.isAccelerate = !1, this.isBrake = !0), e == Laya.Keyboard.UP &amp;&amp; (this.isBrake = !1, this.isAccelerate = !0)
            }
        }
        onKeybordUp(e) {
            switch (e.keyCode) {
                case Laya.Keyboard.DOWN:
                    -1 != this.keyCodeArr.indexOf(Laya.Keyboard.DOWN) &amp;&amp; this.keyCodeArr.splice(this.keyCodeArr.indexOf(Laya.Keyboard.DOWN), 1), this.isBrake = !1;
                    break;
                case Laya.Keyboard.UP:
                    -1 != this.keyCodeArr.indexOf(Laya.Keyboard.UP) &amp;&amp; this.keyCodeArr.splice(this.keyCodeArr.indexOf(Laya.Keyboard.UP), 1), this.isAccelerate = !1;
                    break;
                case Laya.Keyboard.RIGHT:
                case Laya.Keyboard.LEFT:
                    this.wheelTurnType = P.None
            }
            if (this.keyCodeArr.length) {
                let e = this.keyCodeArr[this.keyCodeArr.length - 1];
                e == Laya.Keyboard.DOWN &amp;&amp; (this.isBrake, this.isAccelerate = !1, this.isBrake = !0), e == Laya.Keyboard.UP &amp;&amp; (this.isBrake = !1, this.isAccelerate = !0)
            }
        }
        onGameUpdate() {
            this.gameEnd || (this.isBrake || this.isAccelerate || 0 == this.forward.z || (this.forward.z &lt; 0 ? (this.forward.z += this.speedChangeNum, this.forward.z + this.speedChangeNum &gt; 0 &amp;&amp; (this.forward.z = 0)) : (this.forward.z -= this.speedChangeNum, this.forward.z - this.speedChangeNum &lt; 0 &amp;&amp; (this.forward.z = 0)), this.car.transform.translate(this.forward)), this.onAccelerate(), this.onBrake(), this.onWheelTurn(), this.onCarTurn(), this.onCameraFollow(), this.onWheelRotate(), this.onGround())
        }
        onAccelerate() {
            this.isAccelerate &amp;&amp; (this.forward.z += this.accelerateRatio, this.forward.z = Math.min(this.maxMoveSpeed, this.forward.z), this.car.transform.translate(this.forward))
        }
        onBrake() {
            this.isBrake &amp;&amp; (this.forward.z -= this.brakeRatio / 2, this.forward.z = Math.max(-.05, this.forward.z), this.car.transform.translate(this.forward))
        }
        onCarTurn() {
            0 !== this.forward.z &amp;&amp; this.car.transform.rotate(new Laya.Vector3(0, this.wheelAngle * this.forward.z / 60, 0))
        }
        onShake() {}
        onWheelTurn() {
            if (this.wheelTurnType == P.None) {
                if (0 != this.wheelAngle) {
                    this.wheelAngle = 0;
                    const e = this.car.transform.rotationEuler.y + this.wheelAngle;
                    this.frontWheelLeft.transform.rotation.y != e &amp;&amp; (this.frontWheelLeft.transform.rotationEuler.setValue(0, e, 0), this.frontWheelLeft.transform.rotationEuler = this.frontWheelLeft.transform.rotationEuler, this.frontWheelRight.transform.rotationEuler.setValue(0, e, 0), this.frontWheelRight.transform.rotationEuler = this.frontWheelRight.transform.rotationEuler)
                }
                return
            }
            switch (this.wheelTurnType) {
                case P.Left:
                    this.wheelAngle++;
                    break;
                case P.Right:
                    this.wheelAngle--;
                    break;
                default:
                    this.wheelAngle = 0
            }
            this.wheelAngle = D.clampf(this.wheelAngle, -30, 30);
            const e = this.car.transform.rotationEuler.y + this.wheelAngle;
            this.frontWheelLeft.transform.rotationEuler.y !== e &amp;&amp; (this.frontWheelLeft.transform.rotationEuler.setValue(0, e, 0), this.frontWheelLeft.transform.rotationEuler = this.frontWheelLeft.transform.rotationEuler), this.frontWheelRight.transform.rotationEuler.y !== e &amp;&amp; (this.frontWheelRight.transform.rotationEuler.setValue(0, e, 0), this.frontWheelRight.transform.rotationEuler = this.frontWheelRight.transform.rotationEuler)
        }
        onWheelRotate() {
            if (0 !== this.forward.z) {
                this.wheelRotate.x = 20 * this.forward.z;
                for (const e of this.wheels) e.transform.rotate(this.wheelRotate)
            }
        }
        isCollisionEnter(e) {
            if (this.gameEnd) return;
            const t = e.other.owner.name;
            console.log("onCarTriggerEnter", t), t === C.WIN ? this.onWin() : t === C.COIN ? (e.other.owner.active = !1, h.coin.value += 5 * U.levelNum + 10, U.coinNum += 5 * U.levelNum + 10) : t === C.OBSTACLE || C.SAVEPOS, (t.indexOf("obstruct_") &gt; -1 || t.indexOf("Fire") &gt; -1) &amp;&amp; (this.gameEnd = !0, this.onDeath())
        }
        onCarTriggerEnter(e) {
            if (this.gameEnd) return;
            const t = e.owner.name;
            if (console.log("onCarTriggerEnter", t), t === C.WIN) this.onWin();
            else if (t === C.COIN) console.log(e), e.owner.active = !1, h.coin.value += 5 * U.levelNum + 10, U.coinNum += 5 * U.levelNum + 10;
            else if (t === C.SAVEPOS) {
                let t = this.find("revive", e.owner);
                this.currentSave = t
            }(t.indexOf("obstruct_") &gt; -1 || t.indexOf("Fire") &gt; -1) &amp;&amp; (this.gameEnd = !0, this.onDeath())
        }
        onWin() {
            Laya.stage.off(Laya.Event.KEY_DOWN, this, this.onKeybordDown), Laya.stage.off(Laya.Event.KEY_UP, this, this.onKeybordUp), this.gameEnd = !0, b.timer3D.pause(), b.open(m.WinDialog)
        }
        onDeath() {
            return __awaiter(this, void 0, void 0, function*() {
                Laya.stage.off(Laya.Event.KEY_DOWN, this, this.onKeybordDown), Laya.stage.off(Laya.Event.KEY_UP, this, this.onKeybordUp), this.gameEnd = !0, b.timer3D.pause();
                const e = (yield b.open(m.LoseDialog)).getComponent(R);
                yield e.result();
                this.onRevive()
            })
        }
        onGround() {
            this.carMain.transform.position.y &lt; -3 &amp;&amp; (this.carMain.transform.position.y = 0, this.onDeath())
        }
        onCameraFollow() {
            this.cameraTransform &amp;&amp; this.carTransform
        }
    }
    class B extends e {
        onAwake() {
            this.win_gold = this.owner.getChildByName("win_gold")
        }
        onEnable() {
            super.onEnable(), window.carLogo.visible = !1, this.btnVedioClaim.on(Laya.Event.CLICK, this, this.onbtnVedioClaim), this.btnClaim.on(Laya.Event.CLICK, this, this.onbtnClaim), h.level.value &lt;= U.levelNum &amp;&amp; h.level.value++, h.level.value &gt; 30 &amp;&amp; (h.level.value = 30), this.win_gold.text = "+ " + U.coinNum
        }
        onDisable() {
            super.onDisable(), window.carLogo.visible = !0, h.save()
        }
        onbtnVedioClaim() {
            y.showReward().then(e =&gt; {
                e &amp;&amp; (h.coin.value += 4 * U.coinNum, U.coinNum = 0, this.owner.close(), b.timer3D.resume(), b.open(m.HomeScene))
            })
        }
        onbtnClaim() {
            U.coinNum = 0, this.owner.close(), b.timer3D.resume(), b.open(m.HomeScene)
        }
    }
    __decorate([f.Property()], B.prototype, "btnVedioClaim", void 0), __decorate([f.Property()], B.prototype, "btnClaim", void 0);
    class K extends e {
        onEnable() {
            super.onEnable(), this.btnMusic.on(Laya.Event.CLICK, this, this.onbtnMusic), h.musicMuted.on(this, this.onRefresh), h.energy.on(this, this.onRefresh), h.coin.on(this, this.onRefresh), this.onRefresh()
        }
        onDisable() {
            super.onDisable(), h.offAllCaller(this)
        }
        onbtnMusic() {
            h.musicMuted.value = !h.musicMuted.value, h.save()
        }
        onRefresh() {
            this.lbEnergy.text = h.energy.value + "/" + s.MAX_ENERGY, this.lbCoin.text = "" + (h.coin.value ? h.coin.value : 0), this.btnSkin.skin = h.musicMuted.value ? "icons/music_off.png" : "icons/music_on.png", this.timeBox.visible = !1
        }
        onUpdate() {
            if (h.energy.value &lt; s.MAX_ENERGY) {
                var e = (new Date).getTime() / 1e3 - h.energytimestamp.value;
                const o = Math.floor(e / s.RECOVER_ENERGY);
                if (o &gt; 0 &amp;&amp; (h.energy.value = Math.min(h.energy.value + o, s.MAX_ENERGY), h.energytimestamp.value = h.energytimestamp.value + 5 * s.RECOVER_ENERGY, h.save()), h.energy.value &lt; s.MAX_ENERGY) {
                    this.timeBox.visible = !0;
                    var t = s.RECOVER_ENERGY - e % s.RECOVER_ENERGY,
                        a = Math.floor(t / 60),
                        i = Math.floor(t % 60).toString();
                    i.length &lt; 2 &amp;&amp; (i = "0" + i), this.lbTime.text = a + ":" + i
                } else this.timeBox.visible = !1
            }
        }
    }
    __decorate([f.Property()], K.prototype, "btnMusic", void 0), __decorate([f.Property("btnMusic/btnSkin")], K.prototype, "btnSkin", void 0), __decorate([f.Property("coin/lbCoin")], K.prototype, "lbCoin", void 0), __decorate([f.Property("energy/lbEnergy")], K.prototype, "lbEnergy", void 0), __decorate([f.Property("energy/timeBox")], K.prototype, "timeBox", void 0), __decorate([f.Property("energy/timeBox/lbTime")], K.prototype, "lbTime", void 0);
    class G extends k {
        onAwake() {
            this.startObj = this.find("start_point", this.owner), this.carRot = new Laya.Vector3(0, 0, -.004);
            let e = h.getUserUseCar();
            this.onChangeCar(e), Laya.stage.on("changeCar", this, this.onChangeCar)
        }
        onChangeCar(e) {
            this.car &amp;&amp; this.car.destroy(), w.createAssetBundle("LayaScene_cars/Conventional/car_" + e + ".lh").then(e =&gt; {
                this.car = e;
                const t = this.find("car_main", e);
                let s = this;
                t.addComponent(class extends Laya.Script3D {
                    onCollisionEnter() {
                        t.getComponent(Laya.Rigidbody3D).isKinematic = !0, s.carTransform = t.transform
                    }
                }), this.car.transform.localScaleX = this.car.transform.localScaleY = this.car.transform.localScaleZ = .1, this.car.transform.localPosition = this.startObj.transform.position, this.car.transform.localPositionY += .05, this.owner.addChild(this.car)
            })
        }
        onEnable() {
            N.timer.frameLoop(1, this, this.onGameUpdate)
        }
        onDisable() {
            Laya.stage.off("changeCar", this, this.onChangeCar), super.onDisable(), N.timer.clearAll(this)
        }
        onGameUpdate() {
            this.carTransform &amp;&amp; this.carTransform.rotate(this.carRot)
        }
    }
    class V extends e {
        onAwake() {}
        onEnable() {
            super.onEnable(), b.open("LayaScene_start/Conventional/start.ls").then(e =&gt; {
                e.addComponent(G), b.open(m.HomeDialog)
            })
        }
        onDisable() {
            super.onDisable()
        }
    }
    __decorate([f.Property()], V.prototype, "ui", void 0), __decorate([f.Property()], V.prototype, "object", void 0);
    class W extends e {
        onAwake() {}
        onEnable() {
            w.process(["configs/app_config.json", "configs/cars_config.json"]).then(this.onAppConfigLoaded.bind(this))
        }
        onAppConfigLoaded() {
            let e = Laya.loader.getRes("configs/cars_config.json");
            for (let t in e) _.tableData.push(e[t]);
            _.tableData = _.tableData.sort((e, t) =&gt; e.id - t.id);
            const t = Laya.loader.getRes("configs/app_config.json");
            a.appConfig = t, w.push(h.dbAsyncInit()), w.push(d.init()), w.push("LayaScene_start/Conventional/start.ls"), w.resourcesAsync().then(this.onAssetsCompleted.bind(this))
        }
        onAssetsCompleted() {
            console.log("onAssetsCompleted"), d.playMusic(L.bgm), b.open(m.HomeScene)
        }
        onUpdate() {
            this.progress.value = w.percent / 100, this.lbPercent.text = w.percent + "%"
        }
    }
    __decorate([f.Property("contain/lbPercent")], W.prototype, "lbPercent", void 0), __decorate([f.Property("contain/lbMessage")], W.prototype, "lbMessage", void 0), __decorate([f.Property("contain/progress")], W.prototype, "progress", void 0);
    class Y {
        constructor() {}
        static init() {
            var e = Laya.ClassUtils.regClass;
            e("UiControllers/Dialogs/EnergyRewardDialog.ts", p), e("UiControllers/UiGarageController.ts", E), e("Components/Ui/UiButtonComponent.ts", A), e("UiControllers/Dialogs/UiGetItemDialogController.ts", S), e("UiControllers/Dialogs/UiHomeDialogController.ts", T), e("UiControllers/UiLevelController.ts", M), e("UiControllers/Dialogs/UiLoseDialogController.ts", R), e("UiControllers/Dialogs/UiWinDialogController.ts", B), e("UiControllers/UiGameController.ts", U), e("UiControllers/Prefabs/TopUiPrefab.ts", K), e("UiControllers/UiHomeController.ts", V), e("UiControllers/UiLoadingController.ts", W)
        }
    }
    Y.width = 1920, Y.height = 1080, Y.scaleMode = "fixedwidth", Y.screenMode = "none", Y.alignV = "top", Y.alignH = "left", Y.startScene = "dialogs/AdRewardDialog.scene", Y.sceneRoot = "", Y.debug = !1, Y.stat = !1, Y.physicsDebug = !1, Y.exportSceneToJson = !0, Y.init();
    new class {
        constructor() {
            Laya3D.init(Y.width, Y.height), Laya.stage.screenMode = Laya.Browser.onPC ? Laya.Stage.SCREEN_NONE : Laya.Stage.SCREEN_HORIZONTAL, Laya.stage.scaleMode = Laya.Stage.SCALE_SHOWALL, Laya.stage.alignV = Laya.Stage.ALIGN_MIDDLE, Laya.stage.alignH = Laya.Stage.ALIGN_CENTER, Laya.URL.exportSceneToJson = Y.exportSceneToJson, UIConfig.popupBgAlpha = .8, UIConfig.showButtons = !1, Laya.stage.bgColor = "#ffffff", Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded))
        }
        onConfigLoaded() {
            let e = new Laya.Image;
            e.skin = "cargames.png", e.zOrder = 1e4, e.bottom = 0, e.centerX = 0, e.mouseEnabled = !0, Laya.stage.addChild(e), window.carLogo = e, y.adsAsyncInit("Car-Master-3d").then(() =&gt; {
                window.carLogo.on(Laya.Event.MOUSE_DOWN, y, y.navigate, ["GAME", "LOGO", ""])
            }), b.init(), N.init(), b.open(m.LoadingScene)

            window.adsGameCon.recordOpen();
        }
    }

}();</pre></body></html>